From 6ff9e9eebdadfb54fe2b7acd3ade2040c4ee8b09 Mon Sep 17 00:00:00 2001 From: Paul Le Cam Date: Tue, 16 Apr 2024 15:28:50 +0100 Subject: [PATCH] Update generated docs --- .../server/src/controllers/multiController.ts | 23 +- docs/api/classes/points.GenericReader.md | 158 +++++++++ docs/api/classes/points.ListWriter.md | 253 ++++++++++++++ docs/api/classes/points.PointsReader.md | 111 ++---- docs/api/classes/points.PointsWriter.md | 175 +++++----- docs/api/classes/points.SetReader.md | 230 ++++++++++++ docs/api/classes/points.SetWriter.md | 327 ++++++++++++++++++ docs/api/classes/points.SinglePointReader.md | 156 --------- docs/api/classes/points.SinglePointWriter.md | 254 -------------- docs/api/modules/points.md | 142 +++++--- docs/api/modules/points_composite.md | 45 ++- libraries/points/src/set-writer.ts | 12 +- 12 files changed, 1244 insertions(+), 642 deletions(-) create mode 100644 docs/api/classes/points.GenericReader.md create mode 100644 docs/api/classes/points.ListWriter.md create mode 100644 docs/api/classes/points.SetReader.md create mode 100644 docs/api/classes/points.SetWriter.md delete mode 100644 docs/api/classes/points.SinglePointReader.md delete mode 100644 docs/api/classes/points.SinglePointWriter.md diff --git a/demo/server/src/controllers/multiController.ts b/demo/server/src/controllers/multiController.ts index 97f83f0..6c0c2b7 100644 --- a/demo/server/src/controllers/multiController.ts +++ b/demo/server/src/controllers/multiController.ts @@ -47,7 +47,7 @@ const getContextAggregation = async ( const { recipient, context } = req.body //instantiate a reader - const reader = new PointsReader({ + const reader = PointsReader.create({ ceramic, issuer: ceramic.did!.id, aggregationModelID, @@ -75,7 +75,7 @@ const getTotalAggregation = async ( const { recipient } = req.body //instantiate a reader - const reader = new PointsReader({ + const reader = PointsReader.create({ ceramic, issuer: ceramic.did!.id, }) @@ -101,20 +101,14 @@ const updateContextAggregation = async ( const { ceramic, aggregationModelID } = await getContext() const { amount, recipient, context } = req.body - //instantiate a writer and reader - const contextWriter = new PointsWriter({ + //instantiate a writer + const contextWriter = PointsWriter.fromAuthenticated({ ceramic, aggregationModelID, }) - const contextReader = new PointsReader({ - ceramic, - issuer: ceramic.did!.id, - aggregationModelID, - }) - // load the document for the recipient and context - const doc = await contextReader.loadAggregationDocumentFor([recipient, context]) + const doc = await contextWriter.loadAggregationDocumentFor([recipient, context]) if (!doc) { await contextWriter.setPointsAggregationFor([recipient, context], amount, { recipient, @@ -159,12 +153,11 @@ const updateTotalAggregation = async ( const { ceramic } = await getContext() const { amount, recipient } = req.body - //instantiate a writer and reader - const totalWriter = new PointsWriter({ ceramic }) - const totalReader = new PointsReader({ ceramic, issuer: ceramic.did!.id }) + //instantiate a writer + const totalWriter = PointsWriter.fromAuthenticated({ ceramic }) // load the document for the recipient and context - const doc = await totalReader.loadAggregationDocumentFor([recipient]) + const doc = await totalWriter.loadAggregationDocumentFor([recipient]) if (!doc) { await totalWriter.setPointsAggregationFor([recipient], amount, { recipient, diff --git a/docs/api/classes/points.GenericReader.md b/docs/api/classes/points.GenericReader.md new file mode 100644 index 0000000..523a9bf --- /dev/null +++ b/docs/api/classes/points.GenericReader.md @@ -0,0 +1,158 @@ +# Class: GenericReader\ + +[points](../modules/points.md).GenericReader + +## Type parameters + +| Name | Type | +| :------ | :------ | +| `Content` | extends `PointsContent` = `PointsContent` | + +## Hierarchy + +- **`GenericReader`** + + ↳ [`ListWriter`](points.ListWriter.md) + + ↳ [`SetReader`](points.SetReader.md) + +## Table of contents + +### Constructors + +- [constructor](points.GenericReader.md#constructor) + +### Accessors + +- [ceramic](points.GenericReader.md#ceramic) +- [issuer](points.GenericReader.md#issuer) +- [loader](points.GenericReader.md#loader) +- [modelID](points.GenericReader.md#modelid) + +### Methods + +- [queryDocuments](points.GenericReader.md#querydocuments) +- [queryDocumentsFor](points.GenericReader.md#querydocumentsfor) + +## Constructors + +### constructor + +• **new GenericReader**\<`Content`\>(`params`): [`GenericReader`](points.GenericReader.md)\<`Content`\> + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `Content` | extends `PointsContent` = `PointsContent` | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `params` | [`GenericReaderParams`](../modules/points.md#genericreaderparams) | + +#### Returns + +[`GenericReader`](points.GenericReader.md)\<`Content`\> + +#### Defined in + +[libraries/points/src/generic-reader.ts:24](https://github.com/ceramicstudio/solutions-sdk/blob/410a332e8e4d42d225b25ac7932f63038da217ad/libraries/points/src/generic-reader.ts#L24) + +## Accessors + +### ceramic + +• `get` **ceramic**(): `CeramicAPI` + +#### Returns + +`CeramicAPI` + +#### Defined in + +[libraries/points/src/generic-reader.ts:41](https://github.com/ceramicstudio/solutions-sdk/blob/410a332e8e4d42d225b25ac7932f63038da217ad/libraries/points/src/generic-reader.ts#L41) + +___ + +### issuer + +• `get` **issuer**(): `string` + +#### Returns + +`string` + +#### Defined in + +[libraries/points/src/generic-reader.ts:33](https://github.com/ceramicstudio/solutions-sdk/blob/410a332e8e4d42d225b25ac7932f63038da217ad/libraries/points/src/generic-reader.ts#L33) + +___ + +### loader + +• `get` **loader**(): `DocumentLoader` + +#### Returns + +`DocumentLoader` + +#### Defined in + +[libraries/points/src/generic-reader.ts:45](https://github.com/ceramicstudio/solutions-sdk/blob/410a332e8e4d42d225b25ac7932f63038da217ad/libraries/points/src/generic-reader.ts#L45) + +___ + +### modelID + +• `get` **modelID**(): `string` + +#### Returns + +`string` + +#### Defined in + +[libraries/points/src/generic-reader.ts:37](https://github.com/ceramicstudio/solutions-sdk/blob/410a332e8e4d42d225b25ac7932f63038da217ad/libraries/points/src/generic-reader.ts#L37) + +## Methods + +### queryDocuments + +▸ **queryDocuments**(`options?`): `Promise`\<[`QueryDocumentsResult`](../modules/points.md#querydocumentsresult)\<`Content`\>\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `options?` | [`QueryDocumentsOptions`](../modules/points.md#querydocumentsoptions) | + +#### Returns + +`Promise`\<[`QueryDocumentsResult`](../modules/points.md#querydocumentsresult)\<`Content`\>\> + +#### Defined in + +[libraries/points/src/generic-reader.ts:49](https://github.com/ceramicstudio/solutions-sdk/blob/410a332e8e4d42d225b25ac7932f63038da217ad/libraries/points/src/generic-reader.ts#L49) + +___ + +### queryDocumentsFor + +▸ **queryDocumentsFor**(`did`, `options?`): `Promise`\<[`QueryDocumentsResult`](../modules/points.md#querydocumentsresult)\<`Content`\>\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `did` | `string` | +| `options?` | [`QueryDocumentsOptions`](../modules/points.md#querydocumentsoptions) | + +#### Returns + +`Promise`\<[`QueryDocumentsResult`](../modules/points.md#querydocumentsresult)\<`Content`\>\> + +#### Defined in + +[libraries/points/src/generic-reader.ts:53](https://github.com/ceramicstudio/solutions-sdk/blob/410a332e8e4d42d225b25ac7932f63038da217ad/libraries/points/src/generic-reader.ts#L53) diff --git a/docs/api/classes/points.ListWriter.md b/docs/api/classes/points.ListWriter.md new file mode 100644 index 0000000..f13bc22 --- /dev/null +++ b/docs/api/classes/points.ListWriter.md @@ -0,0 +1,253 @@ +# Class: ListWriter\ + +[points](../modules/points.md).ListWriter + +## Type parameters + +| Name | Type | +| :------ | :------ | +| `Content` | extends `PointsContent` = `PointsContent` | + +## Hierarchy + +- [`GenericReader`](points.GenericReader.md)\<`Content`\> + + ↳ **`ListWriter`** + +## Table of contents + +### Constructors + +- [constructor](points.ListWriter.md#constructor) + +### Accessors + +- [ceramic](points.ListWriter.md#ceramic) +- [issuer](points.ListWriter.md#issuer) +- [loader](points.ListWriter.md#loader) +- [modelID](points.ListWriter.md#modelid) + +### Methods + +- [createDocument](points.ListWriter.md#createdocument) +- [queryDocuments](points.ListWriter.md#querydocuments) +- [queryDocumentsFor](points.ListWriter.md#querydocumentsfor) +- [removeDocument](points.ListWriter.md#removedocument) +- [fromSeed](points.ListWriter.md#fromseed) + +## Constructors + +### constructor + +• **new ListWriter**\<`Content`\>(`params`): [`ListWriter`](points.ListWriter.md)\<`Content`\> + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `Content` | extends `PointsContent` = `PointsContent` | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `params` | [`ListWriterParams`](../modules/points.md#listwriterparams) | + +#### Returns + +[`ListWriter`](points.ListWriter.md)\<`Content`\> + +#### Overrides + +[GenericReader](points.GenericReader.md).[constructor](points.GenericReader.md#constructor) + +#### Defined in + +[libraries/points/src/list-writer.ts:31](https://github.com/ceramicstudio/solutions-sdk/blob/410a332e8e4d42d225b25ac7932f63038da217ad/libraries/points/src/list-writer.ts#L31) + +## Accessors + +### ceramic + +• `get` **ceramic**(): `CeramicAPI` + +#### Returns + +`CeramicAPI` + +#### Inherited from + +GenericReader.ceramic + +#### Defined in + +[libraries/points/src/generic-reader.ts:41](https://github.com/ceramicstudio/solutions-sdk/blob/410a332e8e4d42d225b25ac7932f63038da217ad/libraries/points/src/generic-reader.ts#L41) + +___ + +### issuer + +• `get` **issuer**(): `string` + +#### Returns + +`string` + +#### Inherited from + +GenericReader.issuer + +#### Defined in + +[libraries/points/src/generic-reader.ts:33](https://github.com/ceramicstudio/solutions-sdk/blob/410a332e8e4d42d225b25ac7932f63038da217ad/libraries/points/src/generic-reader.ts#L33) + +___ + +### loader + +• `get` **loader**(): `DocumentLoader` + +#### Returns + +`DocumentLoader` + +#### Inherited from + +GenericReader.loader + +#### Defined in + +[libraries/points/src/generic-reader.ts:45](https://github.com/ceramicstudio/solutions-sdk/blob/410a332e8e4d42d225b25ac7932f63038da217ad/libraries/points/src/generic-reader.ts#L45) + +___ + +### modelID + +• `get` **modelID**(): `string` + +#### Returns + +`string` + +#### Inherited from + +GenericReader.modelID + +#### Defined in + +[libraries/points/src/generic-reader.ts:37](https://github.com/ceramicstudio/solutions-sdk/blob/410a332e8e4d42d225b25ac7932f63038da217ad/libraries/points/src/generic-reader.ts#L37) + +## Methods + +### createDocument + +▸ **createDocument**(`content`): `Promise`\<`ModelInstanceDocument`\<`Content`\>\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `content` | `Content` | + +#### Returns + +`Promise`\<`ModelInstanceDocument`\<`Content`\>\> + +#### Defined in + +[libraries/points/src/list-writer.ts:36](https://github.com/ceramicstudio/solutions-sdk/blob/410a332e8e4d42d225b25ac7932f63038da217ad/libraries/points/src/list-writer.ts#L36) + +___ + +### queryDocuments + +▸ **queryDocuments**(`options?`): `Promise`\<[`QueryDocumentsResult`](../modules/points.md#querydocumentsresult)\<`Content`\>\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `options?` | [`QueryDocumentsOptions`](../modules/points.md#querydocumentsoptions) | + +#### Returns + +`Promise`\<[`QueryDocumentsResult`](../modules/points.md#querydocumentsresult)\<`Content`\>\> + +#### Inherited from + +[GenericReader](points.GenericReader.md).[queryDocuments](points.GenericReader.md#querydocuments) + +#### Defined in + +[libraries/points/src/generic-reader.ts:49](https://github.com/ceramicstudio/solutions-sdk/blob/410a332e8e4d42d225b25ac7932f63038da217ad/libraries/points/src/generic-reader.ts#L49) + +___ + +### queryDocumentsFor + +▸ **queryDocumentsFor**(`did`, `options?`): `Promise`\<[`QueryDocumentsResult`](../modules/points.md#querydocumentsresult)\<`Content`\>\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `did` | `string` | +| `options?` | [`QueryDocumentsOptions`](../modules/points.md#querydocumentsoptions) | + +#### Returns + +`Promise`\<[`QueryDocumentsResult`](../modules/points.md#querydocumentsresult)\<`Content`\>\> + +#### Inherited from + +[GenericReader](points.GenericReader.md).[queryDocumentsFor](points.GenericReader.md#querydocumentsfor) + +#### Defined in + +[libraries/points/src/generic-reader.ts:53](https://github.com/ceramicstudio/solutions-sdk/blob/410a332e8e4d42d225b25ac7932f63038da217ad/libraries/points/src/generic-reader.ts#L53) + +___ + +### removeDocument + +▸ **removeDocument**(`id`): `Promise`\<`void`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `id` | `string` | + +#### Returns + +`Promise`\<`void`\> + +#### Defined in + +[libraries/points/src/list-writer.ts:40](https://github.com/ceramicstudio/solutions-sdk/blob/410a332e8e4d42d225b25ac7932f63038da217ad/libraries/points/src/list-writer.ts#L40) + +___ + +### fromSeed + +▸ **fromSeed**\<`Content`\>(`params`): `Promise`\<[`ListWriter`](points.ListWriter.md)\<`Content`\>\> + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `Content` | extends `PointsContent` = `PointsContent` | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `params` | [`ListWriterFromSeedParams`](../modules/points.md#listwriterfromseedparams) | + +#### Returns + +`Promise`\<[`ListWriter`](points.ListWriter.md)\<`Content`\>\> + +#### Defined in + +[libraries/points/src/list-writer.ts:24](https://github.com/ceramicstudio/solutions-sdk/blob/410a332e8e4d42d225b25ac7932f63038da217ad/libraries/points/src/list-writer.ts#L24) diff --git a/docs/api/classes/points.PointsReader.md b/docs/api/classes/points.PointsReader.md index 9c6ee4b..4157dac 100644 --- a/docs/api/classes/points.PointsReader.md +++ b/docs/api/classes/points.PointsReader.md @@ -7,7 +7,7 @@ | Name | Type | | :------ | :------ | | `AggregationContent` | extends `TotalPointsContent` = `TotalPointsContent` | -| `AllocationContent` | extends `MultiplePointsContent` = `MultiplePointsContent` | +| `AllocationContent` | extends `AllocatePointsContent` = `AllocatePointsContent` | ## Hierarchy @@ -21,13 +21,6 @@ - [constructor](points.PointsReader.md#constructor) -### Accessors - -- [aggregationModelID](points.PointsReader.md#aggregationmodelid) -- [allocationModelID](points.PointsReader.md#allocationmodelid) -- [ceramic](points.PointsReader.md#ceramic) -- [loader](points.PointsReader.md#loader) - ### Methods - [getAggregationPointsFor](points.PointsReader.md#getaggregationpointsfor) @@ -35,6 +28,7 @@ - [loadAggregationDocumentsFor](points.PointsReader.md#loadaggregationdocumentsfor) - [queryAggregationDocuments](points.PointsReader.md#queryaggregationdocuments) - [queryAllocationDocumentsFor](points.PointsReader.md#queryallocationdocumentsfor) +- [create](points.PointsReader.md#create) ## Constructors @@ -47,13 +41,13 @@ | Name | Type | | :------ | :------ | | `AggregationContent` | extends `TotalPointsContent` = `TotalPointsContent` | -| `AllocationContent` | extends `MultiplePointsContent` = `MultiplePointsContent` | +| `AllocationContent` | extends `PointsContent` = `PointsContent` | #### Parameters | Name | Type | | :------ | :------ | -| `params` | [`PointsReaderParams`](../modules/points.md#pointsreaderparams) | +| `params` | [`PointsReaderParams`](../modules/points.md#pointsreaderparams)\<`AggregationContent`, `AllocationContent`\> | #### Returns @@ -61,63 +55,7 @@ #### Defined in -[libraries/points/src/points-reader.ts:45](https://github.com/ceramicstudio/solutions-sdk/blob/996989c557810301e582e300ab7215628488db96/libraries/points/src/points-reader.ts#L45) - -## Accessors - -### aggregationModelID - -• `get` **aggregationModelID**(): `string` - -#### Returns - -`string` - -#### Defined in - -[libraries/points/src/points-reader.ts:59](https://github.com/ceramicstudio/solutions-sdk/blob/996989c557810301e582e300ab7215628488db96/libraries/points/src/points-reader.ts#L59) - -___ - -### allocationModelID - -• `get` **allocationModelID**(): `string` - -#### Returns - -`string` - -#### Defined in - -[libraries/points/src/points-reader.ts:63](https://github.com/ceramicstudio/solutions-sdk/blob/996989c557810301e582e300ab7215628488db96/libraries/points/src/points-reader.ts#L63) - -___ - -### ceramic - -• `get` **ceramic**(): `CeramicAPI` - -#### Returns - -`CeramicAPI` - -#### Defined in - -[libraries/points/src/points-reader.ts:67](https://github.com/ceramicstudio/solutions-sdk/blob/996989c557810301e582e300ab7215628488db96/libraries/points/src/points-reader.ts#L67) - -___ - -### loader - -• `get` **loader**(): `DocumentLoader` - -#### Returns - -`DocumentLoader` - -#### Defined in - -[libraries/points/src/points-reader.ts:71](https://github.com/ceramicstudio/solutions-sdk/blob/996989c557810301e582e300ab7215628488db96/libraries/points/src/points-reader.ts#L71) +[libraries/points/src/points-reader.ts:63](https://github.com/ceramicstudio/solutions-sdk/blob/410a332e8e4d42d225b25ac7932f63038da217ad/libraries/points/src/points-reader.ts#L63) ## Methods @@ -137,7 +75,7 @@ ___ #### Defined in -[libraries/points/src/points-reader.ts:95](https://github.com/ceramicstudio/solutions-sdk/blob/996989c557810301e582e300ab7215628488db96/libraries/points/src/points-reader.ts#L95) +[libraries/points/src/points-reader.ts:82](https://github.com/ceramicstudio/solutions-sdk/blob/410a332e8e4d42d225b25ac7932f63038da217ad/libraries/points/src/points-reader.ts#L82) ___ @@ -150,7 +88,7 @@ ___ | Name | Type | | :------ | :------ | | `didOrValues` | `string` \| `string`[] | -| `options` | `DeterministicLoadOptions` | +| `options?` | `DeterministicLoadOptions` | #### Returns @@ -158,7 +96,7 @@ ___ #### Defined in -[libraries/points/src/points-reader.ts:75](https://github.com/ceramicstudio/solutions-sdk/blob/996989c557810301e582e300ab7215628488db96/libraries/points/src/points-reader.ts#L75) +[libraries/points/src/points-reader.ts:68](https://github.com/ceramicstudio/solutions-sdk/blob/410a332e8e4d42d225b25ac7932f63038da217ad/libraries/points/src/points-reader.ts#L68) ___ @@ -179,7 +117,7 @@ ___ #### Defined in -[libraries/points/src/points-reader.ts:87](https://github.com/ceramicstudio/solutions-sdk/blob/996989c557810301e582e300ab7215628488db96/libraries/points/src/points-reader.ts#L87) +[libraries/points/src/points-reader.ts:75](https://github.com/ceramicstudio/solutions-sdk/blob/410a332e8e4d42d225b25ac7932f63038da217ad/libraries/points/src/points-reader.ts#L75) ___ @@ -199,7 +137,7 @@ ___ #### Defined in -[libraries/points/src/points-reader.ts:100](https://github.com/ceramicstudio/solutions-sdk/blob/996989c557810301e582e300ab7215628488db96/libraries/points/src/points-reader.ts#L100) +[libraries/points/src/points-reader.ts:86](https://github.com/ceramicstudio/solutions-sdk/blob/410a332e8e4d42d225b25ac7932f63038da217ad/libraries/points/src/points-reader.ts#L86) ___ @@ -220,4 +158,31 @@ ___ #### Defined in -[libraries/points/src/points-reader.ts:106](https://github.com/ceramicstudio/solutions-sdk/blob/996989c557810301e582e300ab7215628488db96/libraries/points/src/points-reader.ts#L106) +[libraries/points/src/points-reader.ts:92](https://github.com/ceramicstudio/solutions-sdk/blob/410a332e8e4d42d225b25ac7932f63038da217ad/libraries/points/src/points-reader.ts#L92) + +___ + +### create + +▸ **create**\<`AggregationContent`, `AllocationContent`\>(`params`): [`PointsReader`](points.PointsReader.md)\<`AggregationContent`, `AllocationContent`\> + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `AggregationContent` | extends `TotalPointsContent` = `TotalPointsContent` | +| `AllocationContent` | extends `PointsContent` = `PointsContent` | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `params` | `CreatePointsReaderParams` | + +#### Returns + +[`PointsReader`](points.PointsReader.md)\<`AggregationContent`, `AllocationContent`\> + +#### Defined in + +[libraries/points/src/points-reader.ts:40](https://github.com/ceramicstudio/solutions-sdk/blob/410a332e8e4d42d225b25ac7932f63038da217ad/libraries/points/src/points-reader.ts#L40) diff --git a/docs/api/classes/points.PointsWriter.md b/docs/api/classes/points.PointsWriter.md index f9cba05..6bdd367 100644 --- a/docs/api/classes/points.PointsWriter.md +++ b/docs/api/classes/points.PointsWriter.md @@ -7,7 +7,7 @@ | Name | Type | | :------ | :------ | | `AggregationContent` | extends `TotalPointsContent` = `TotalPointsContent` | -| `AllocationContent` | extends `MultiplePointsContent` = `MultiplePointsContent` | +| `AllocationContent` | extends `AllocatePointsContent` = `AllocatePointsContent` | ## Hierarchy @@ -21,13 +21,6 @@ - [constructor](points.PointsWriter.md#constructor) -### Accessors - -- [aggregationModelID](points.PointsWriter.md#aggregationmodelid) -- [allocationModelID](points.PointsWriter.md#allocationmodelid) -- [ceramic](points.PointsWriter.md#ceramic) -- [loader](points.PointsWriter.md#loader) - ### Methods - [allocatePointsTo](points.PointsWriter.md#allocatepointsto) @@ -39,6 +32,8 @@ - [removePointsAllocation](points.PointsWriter.md#removepointsallocation) - [setPointsAggregationFor](points.PointsWriter.md#setpointsaggregationfor) - [updatePointsAggregationFor](points.PointsWriter.md#updatepointsaggregationfor) +- [create](points.PointsWriter.md#create) +- [fromAuthenticated](points.PointsWriter.md#fromauthenticated) - [fromSeed](points.PointsWriter.md#fromseed) ## Constructors @@ -52,13 +47,13 @@ | Name | Type | | :------ | :------ | | `AggregationContent` | extends `TotalPointsContent` = `TotalPointsContent` | -| `AllocationContent` | extends `MultiplePointsContent` = `MultiplePointsContent` | +| `AllocationContent` | extends `PointsContent` = `PointsContent` | #### Parameters | Name | Type | | :------ | :------ | -| `params` | [`PointsWriterParams`](../modules/points.md#pointswriterparams) | +| `params` | [`PointsWriterParams`](../modules/points.md#pointswriterparams)\<`AggregationContent`, `AllocationContent`\> | #### Returns @@ -70,79 +65,7 @@ #### Defined in -[libraries/points/src/points-writer.ts:43](https://github.com/ceramicstudio/solutions-sdk/blob/996989c557810301e582e300ab7215628488db96/libraries/points/src/points-writer.ts#L43) - -## Accessors - -### aggregationModelID - -• `get` **aggregationModelID**(): `string` - -#### Returns - -`string` - -#### Inherited from - -PointsReader.aggregationModelID - -#### Defined in - -[libraries/points/src/points-reader.ts:59](https://github.com/ceramicstudio/solutions-sdk/blob/996989c557810301e582e300ab7215628488db96/libraries/points/src/points-reader.ts#L59) - -___ - -### allocationModelID - -• `get` **allocationModelID**(): `string` - -#### Returns - -`string` - -#### Inherited from - -PointsReader.allocationModelID - -#### Defined in - -[libraries/points/src/points-reader.ts:63](https://github.com/ceramicstudio/solutions-sdk/blob/996989c557810301e582e300ab7215628488db96/libraries/points/src/points-reader.ts#L63) - -___ - -### ceramic - -• `get` **ceramic**(): `CeramicAPI` - -#### Returns - -`CeramicAPI` - -#### Inherited from - -PointsReader.ceramic - -#### Defined in - -[libraries/points/src/points-reader.ts:67](https://github.com/ceramicstudio/solutions-sdk/blob/996989c557810301e582e300ab7215628488db96/libraries/points/src/points-reader.ts#L67) - -___ - -### loader - -• `get` **loader**(): `DocumentLoader` - -#### Returns - -`DocumentLoader` - -#### Inherited from - -PointsReader.loader - -#### Defined in - -[libraries/points/src/points-reader.ts:71](https://github.com/ceramicstudio/solutions-sdk/blob/996989c557810301e582e300ab7215628488db96/libraries/points/src/points-reader.ts#L71) +[libraries/points/src/points-writer.ts:78](https://github.com/ceramicstudio/solutions-sdk/blob/410a332e8e4d42d225b25ac7932f63038da217ad/libraries/points/src/points-writer.ts#L78) ## Methods @@ -164,7 +87,7 @@ PointsReader.loader #### Defined in -[libraries/points/src/points-writer.ts:50](https://github.com/ceramicstudio/solutions-sdk/blob/996989c557810301e582e300ab7215628488db96/libraries/points/src/points-writer.ts#L50) +[libraries/points/src/points-writer.ts:87](https://github.com/ceramicstudio/solutions-sdk/blob/410a332e8e4d42d225b25ac7932f63038da217ad/libraries/points/src/points-writer.ts#L87) ___ @@ -188,7 +111,7 @@ ___ #### Defined in -[libraries/points/src/points-reader.ts:95](https://github.com/ceramicstudio/solutions-sdk/blob/996989c557810301e582e300ab7215628488db96/libraries/points/src/points-reader.ts#L95) +[libraries/points/src/points-reader.ts:82](https://github.com/ceramicstudio/solutions-sdk/blob/410a332e8e4d42d225b25ac7932f63038da217ad/libraries/points/src/points-reader.ts#L82) ___ @@ -201,7 +124,7 @@ ___ | Name | Type | | :------ | :------ | | `didOrValues` | `string` \| `string`[] | -| `options` | `DeterministicLoadOptions` | +| `options?` | `DeterministicLoadOptions` | #### Returns @@ -213,7 +136,7 @@ ___ #### Defined in -[libraries/points/src/points-reader.ts:75](https://github.com/ceramicstudio/solutions-sdk/blob/996989c557810301e582e300ab7215628488db96/libraries/points/src/points-reader.ts#L75) +[libraries/points/src/points-reader.ts:68](https://github.com/ceramicstudio/solutions-sdk/blob/410a332e8e4d42d225b25ac7932f63038da217ad/libraries/points/src/points-reader.ts#L68) ___ @@ -238,7 +161,7 @@ ___ #### Defined in -[libraries/points/src/points-reader.ts:87](https://github.com/ceramicstudio/solutions-sdk/blob/996989c557810301e582e300ab7215628488db96/libraries/points/src/points-reader.ts#L87) +[libraries/points/src/points-reader.ts:75](https://github.com/ceramicstudio/solutions-sdk/blob/410a332e8e4d42d225b25ac7932f63038da217ad/libraries/points/src/points-reader.ts#L75) ___ @@ -262,7 +185,7 @@ ___ #### Defined in -[libraries/points/src/points-reader.ts:100](https://github.com/ceramicstudio/solutions-sdk/blob/996989c557810301e582e300ab7215628488db96/libraries/points/src/points-reader.ts#L100) +[libraries/points/src/points-reader.ts:86](https://github.com/ceramicstudio/solutions-sdk/blob/410a332e8e4d42d225b25ac7932f63038da217ad/libraries/points/src/points-reader.ts#L86) ___ @@ -287,7 +210,7 @@ ___ #### Defined in -[libraries/points/src/points-reader.ts:106](https://github.com/ceramicstudio/solutions-sdk/blob/996989c557810301e582e300ab7215628488db96/libraries/points/src/points-reader.ts#L106) +[libraries/points/src/points-reader.ts:92](https://github.com/ceramicstudio/solutions-sdk/blob/410a332e8e4d42d225b25ac7932f63038da217ad/libraries/points/src/points-reader.ts#L92) ___ @@ -307,7 +230,7 @@ ___ #### Defined in -[libraries/points/src/points-writer.ts:62](https://github.com/ceramicstudio/solutions-sdk/blob/996989c557810301e582e300ab7215628488db96/libraries/points/src/points-writer.ts#L62) +[libraries/points/src/points-writer.ts:99](https://github.com/ceramicstudio/solutions-sdk/blob/410a332e8e4d42d225b25ac7932f63038da217ad/libraries/points/src/points-writer.ts#L99) ___ @@ -329,20 +252,20 @@ ___ #### Defined in -[libraries/points/src/points-writer.ts:89](https://github.com/ceramicstudio/solutions-sdk/blob/996989c557810301e582e300ab7215628488db96/libraries/points/src/points-writer.ts#L89) +[libraries/points/src/points-writer.ts:110](https://github.com/ceramicstudio/solutions-sdk/blob/410a332e8e4d42d225b25ac7932f63038da217ad/libraries/points/src/points-writer.ts#L110) ___ ### updatePointsAggregationFor -▸ **updatePointsAggregationFor**(`didOrValues`, `update`): `Promise`\<`ModelInstanceDocument`\<`AggregationContent`\>\> +▸ **updatePointsAggregationFor**(`didOrValues`, `updateContent`): `Promise`\<`ModelInstanceDocument`\<`AggregationContent`\>\> #### Parameters | Name | Type | | :------ | :------ | | `didOrValues` | `string` \| `string`[] | -| `update` | (`content`: ``null`` \| `AggregationContent`) => `Partial`\<`AggregationContent`\> | +| `updateContent` | (`content`: ``null`` \| `AggregationContent`) => `Partial`\<`AggregationContent`\> | #### Returns @@ -350,7 +273,65 @@ ___ #### Defined in -[libraries/points/src/points-writer.ts:70](https://github.com/ceramicstudio/solutions-sdk/blob/996989c557810301e582e300ab7215628488db96/libraries/points/src/points-writer.ts#L70) +[libraries/points/src/points-writer.ts:103](https://github.com/ceramicstudio/solutions-sdk/blob/410a332e8e4d42d225b25ac7932f63038da217ad/libraries/points/src/points-writer.ts#L103) + +___ + +### create + +▸ **create**\<`AggregationContent`, `AllocationContent`\>(`params`): [`PointsReader`](points.PointsReader.md)\<`AggregationContent`, `AllocationContent`\> + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `AggregationContent` | extends `TotalPointsContent` = `TotalPointsContent` | +| `AllocationContent` | extends `PointsContent` = `PointsContent` | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `params` | `CreatePointsReaderParams` | + +#### Returns + +[`PointsReader`](points.PointsReader.md)\<`AggregationContent`, `AllocationContent`\> + +#### Inherited from + +[PointsReader](points.PointsReader.md).[create](points.PointsReader.md#create) + +#### Defined in + +[libraries/points/src/points-reader.ts:40](https://github.com/ceramicstudio/solutions-sdk/blob/410a332e8e4d42d225b25ac7932f63038da217ad/libraries/points/src/points-reader.ts#L40) + +___ + +### fromAuthenticated + +▸ **fromAuthenticated**\<`AggregationContent`, `AllocationContent`\>(`params`): [`PointsWriter`](points.PointsWriter.md)\<`AggregationContent`, `AllocationContent`\> + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `AggregationContent` | extends `TotalPointsContent` = `TotalPointsContent` | +| `AllocationContent` | extends `PointsContent` = `PointsContent` | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `params` | `PointsWriterFromAuthenticatedParams` | + +#### Returns + +[`PointsWriter`](points.PointsWriter.md)\<`AggregationContent`, `AllocationContent`\> + +#### Defined in + +[libraries/points/src/points-writer.ts:44](https://github.com/ceramicstudio/solutions-sdk/blob/410a332e8e4d42d225b25ac7932f63038da217ad/libraries/points/src/points-writer.ts#L44) ___ @@ -363,7 +344,7 @@ ___ | Name | Type | | :------ | :------ | | `AggregationContent` | extends `TotalPointsContent` = `TotalPointsContent` | -| `AllocationContent` | extends `MultiplePointsContent` = `MultiplePointsContent` | +| `AllocationContent` | extends `PointsContent` = `PointsContent` | #### Parameters @@ -377,4 +358,4 @@ ___ #### Defined in -[libraries/points/src/points-writer.ts:31](https://github.com/ceramicstudio/solutions-sdk/blob/996989c557810301e582e300ab7215628488db96/libraries/points/src/points-writer.ts#L31) +[libraries/points/src/points-writer.ts:64](https://github.com/ceramicstudio/solutions-sdk/blob/410a332e8e4d42d225b25ac7932f63038da217ad/libraries/points/src/points-writer.ts#L64) diff --git a/docs/api/classes/points.SetReader.md b/docs/api/classes/points.SetReader.md new file mode 100644 index 0000000..47b2cd1 --- /dev/null +++ b/docs/api/classes/points.SetReader.md @@ -0,0 +1,230 @@ +# Class: SetReader\ + +[points](../modules/points.md).SetReader + +## Type parameters + +| Name | Type | +| :------ | :------ | +| `Content` | extends `PointsContent` = `PointsContent` | + +## Hierarchy + +- [`GenericReader`](points.GenericReader.md)\<`Content`\> + + ↳ **`SetReader`** + + ↳↳ [`SetWriter`](points.SetWriter.md) + +## Table of contents + +### Constructors + +- [constructor](points.SetReader.md#constructor) + +### Accessors + +- [ceramic](points.SetReader.md#ceramic) +- [issuer](points.SetReader.md#issuer) +- [loader](points.SetReader.md#loader) +- [modelID](points.SetReader.md#modelid) + +### Methods + +- [getPointsFor](points.SetReader.md#getpointsfor) +- [loadDocumentFor](points.SetReader.md#loaddocumentfor) +- [queryDocuments](points.SetReader.md#querydocuments) +- [queryDocumentsFor](points.SetReader.md#querydocumentsfor) + +## Constructors + +### constructor + +• **new SetReader**\<`Content`\>(`params`): [`SetReader`](points.SetReader.md)\<`Content`\> + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `Content` | extends `PointsContent` = `PointsContent` | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `params` | [`GenericReaderParams`](../modules/points.md#genericreaderparams) | + +#### Returns + +[`SetReader`](points.SetReader.md)\<`Content`\> + +#### Inherited from + +[GenericReader](points.GenericReader.md).[constructor](points.GenericReader.md#constructor) + +#### Defined in + +[libraries/points/src/generic-reader.ts:24](https://github.com/ceramicstudio/solutions-sdk/blob/410a332e8e4d42d225b25ac7932f63038da217ad/libraries/points/src/generic-reader.ts#L24) + +## Accessors + +### ceramic + +• `get` **ceramic**(): `CeramicAPI` + +#### Returns + +`CeramicAPI` + +#### Inherited from + +GenericReader.ceramic + +#### Defined in + +[libraries/points/src/generic-reader.ts:41](https://github.com/ceramicstudio/solutions-sdk/blob/410a332e8e4d42d225b25ac7932f63038da217ad/libraries/points/src/generic-reader.ts#L41) + +___ + +### issuer + +• `get` **issuer**(): `string` + +#### Returns + +`string` + +#### Inherited from + +GenericReader.issuer + +#### Defined in + +[libraries/points/src/generic-reader.ts:33](https://github.com/ceramicstudio/solutions-sdk/blob/410a332e8e4d42d225b25ac7932f63038da217ad/libraries/points/src/generic-reader.ts#L33) + +___ + +### loader + +• `get` **loader**(): `DocumentLoader` + +#### Returns + +`DocumentLoader` + +#### Inherited from + +GenericReader.loader + +#### Defined in + +[libraries/points/src/generic-reader.ts:45](https://github.com/ceramicstudio/solutions-sdk/blob/410a332e8e4d42d225b25ac7932f63038da217ad/libraries/points/src/generic-reader.ts#L45) + +___ + +### modelID + +• `get` **modelID**(): `string` + +#### Returns + +`string` + +#### Inherited from + +GenericReader.modelID + +#### Defined in + +[libraries/points/src/generic-reader.ts:37](https://github.com/ceramicstudio/solutions-sdk/blob/410a332e8e4d42d225b25ac7932f63038da217ad/libraries/points/src/generic-reader.ts#L37) + +## Methods + +### getPointsFor + +▸ **getPointsFor**(`didOrValues`, `options?`): `Promise`\<`number`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `didOrValues` | `string` \| `string`[] | +| `options?` | `DeterministicLoadOptions` | + +#### Returns + +`Promise`\<`number`\> + +#### Defined in + +[libraries/points/src/set-reader.ts:26](https://github.com/ceramicstudio/solutions-sdk/blob/410a332e8e4d42d225b25ac7932f63038da217ad/libraries/points/src/set-reader.ts#L26) + +___ + +### loadDocumentFor + +▸ **loadDocumentFor**(`didOrValues`, `options?`): `Promise`\<``null`` \| `ModelInstanceDocument`\<`Content`\>\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `didOrValues` | `string` \| `string`[] | +| `options` | `DeterministicLoadOptions` | + +#### Returns + +`Promise`\<``null`` \| `ModelInstanceDocument`\<`Content`\>\> + +#### Defined in + +[libraries/points/src/set-reader.ts:16](https://github.com/ceramicstudio/solutions-sdk/blob/410a332e8e4d42d225b25ac7932f63038da217ad/libraries/points/src/set-reader.ts#L16) + +___ + +### queryDocuments + +▸ **queryDocuments**(`options?`): `Promise`\<[`QueryDocumentsResult`](../modules/points.md#querydocumentsresult)\<`Content`\>\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `options?` | [`QueryDocumentsOptions`](../modules/points.md#querydocumentsoptions) | + +#### Returns + +`Promise`\<[`QueryDocumentsResult`](../modules/points.md#querydocumentsresult)\<`Content`\>\> + +#### Inherited from + +[GenericReader](points.GenericReader.md).[queryDocuments](points.GenericReader.md#querydocuments) + +#### Defined in + +[libraries/points/src/generic-reader.ts:49](https://github.com/ceramicstudio/solutions-sdk/blob/410a332e8e4d42d225b25ac7932f63038da217ad/libraries/points/src/generic-reader.ts#L49) + +___ + +### queryDocumentsFor + +▸ **queryDocumentsFor**(`did`, `options?`): `Promise`\<[`QueryDocumentsResult`](../modules/points.md#querydocumentsresult)\<`Content`\>\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `did` | `string` | +| `options?` | [`QueryDocumentsOptions`](../modules/points.md#querydocumentsoptions) | + +#### Returns + +`Promise`\<[`QueryDocumentsResult`](../modules/points.md#querydocumentsresult)\<`Content`\>\> + +#### Inherited from + +[GenericReader](points.GenericReader.md).[queryDocumentsFor](points.GenericReader.md#querydocumentsfor) + +#### Defined in + +[libraries/points/src/generic-reader.ts:53](https://github.com/ceramicstudio/solutions-sdk/blob/410a332e8e4d42d225b25ac7932f63038da217ad/libraries/points/src/generic-reader.ts#L53) diff --git a/docs/api/classes/points.SetWriter.md b/docs/api/classes/points.SetWriter.md new file mode 100644 index 0000000..f1e0a28 --- /dev/null +++ b/docs/api/classes/points.SetWriter.md @@ -0,0 +1,327 @@ +# Class: SetWriter\ + +[points](../modules/points.md).SetWriter + +## Type parameters + +| Name | Type | +| :------ | :------ | +| `Content` | extends `PointsContent` = `PointsContent` | + +## Hierarchy + +- [`SetReader`](points.SetReader.md)\<`Content`\> + + ↳ **`SetWriter`** + +## Table of contents + +### Constructors + +- [constructor](points.SetWriter.md#constructor) + +### Accessors + +- [ceramic](points.SetWriter.md#ceramic) +- [issuer](points.SetWriter.md#issuer) +- [loader](points.SetWriter.md#loader) +- [modelID](points.SetWriter.md#modelid) + +### Methods + +- [getPointsFor](points.SetWriter.md#getpointsfor) +- [loadDocumentFor](points.SetWriter.md#loaddocumentfor) +- [queryDocuments](points.SetWriter.md#querydocuments) +- [queryDocumentsFor](points.SetWriter.md#querydocumentsfor) +- [removeDocument](points.SetWriter.md#removedocument) +- [removeDocumentFor](points.SetWriter.md#removedocumentfor) +- [setDocumentFor](points.SetWriter.md#setdocumentfor) +- [fromSeed](points.SetWriter.md#fromseed) + +## Constructors + +### constructor + +• **new SetWriter**\<`Content`\>(`params`): [`SetWriter`](points.SetWriter.md)\<`Content`\> + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `Content` | extends `PointsContent` = `PointsContent` | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `params` | [`SetWriterParams`](../modules/points.md#setwriterparams) | + +#### Returns + +[`SetWriter`](points.SetWriter.md)\<`Content`\> + +#### Overrides + +[SetReader](points.SetReader.md).[constructor](points.SetReader.md#constructor) + +#### Defined in + +[libraries/points/src/set-writer.ts:29](https://github.com/ceramicstudio/solutions-sdk/blob/410a332e8e4d42d225b25ac7932f63038da217ad/libraries/points/src/set-writer.ts#L29) + +## Accessors + +### ceramic + +• `get` **ceramic**(): `CeramicAPI` + +#### Returns + +`CeramicAPI` + +#### Inherited from + +SetReader.ceramic + +#### Defined in + +[libraries/points/src/generic-reader.ts:41](https://github.com/ceramicstudio/solutions-sdk/blob/410a332e8e4d42d225b25ac7932f63038da217ad/libraries/points/src/generic-reader.ts#L41) + +___ + +### issuer + +• `get` **issuer**(): `string` + +#### Returns + +`string` + +#### Inherited from + +SetReader.issuer + +#### Defined in + +[libraries/points/src/generic-reader.ts:33](https://github.com/ceramicstudio/solutions-sdk/blob/410a332e8e4d42d225b25ac7932f63038da217ad/libraries/points/src/generic-reader.ts#L33) + +___ + +### loader + +• `get` **loader**(): `DocumentLoader` + +#### Returns + +`DocumentLoader` + +#### Inherited from + +SetReader.loader + +#### Defined in + +[libraries/points/src/generic-reader.ts:45](https://github.com/ceramicstudio/solutions-sdk/blob/410a332e8e4d42d225b25ac7932f63038da217ad/libraries/points/src/generic-reader.ts#L45) + +___ + +### modelID + +• `get` **modelID**(): `string` + +#### Returns + +`string` + +#### Inherited from + +SetReader.modelID + +#### Defined in + +[libraries/points/src/generic-reader.ts:37](https://github.com/ceramicstudio/solutions-sdk/blob/410a332e8e4d42d225b25ac7932f63038da217ad/libraries/points/src/generic-reader.ts#L37) + +## Methods + +### getPointsFor + +▸ **getPointsFor**(`didOrValues`, `options?`): `Promise`\<`number`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `didOrValues` | `string` \| `string`[] | +| `options?` | `DeterministicLoadOptions` | + +#### Returns + +`Promise`\<`number`\> + +#### Inherited from + +[SetReader](points.SetReader.md).[getPointsFor](points.SetReader.md#getpointsfor) + +#### Defined in + +[libraries/points/src/set-reader.ts:26](https://github.com/ceramicstudio/solutions-sdk/blob/410a332e8e4d42d225b25ac7932f63038da217ad/libraries/points/src/set-reader.ts#L26) + +___ + +### loadDocumentFor + +▸ **loadDocumentFor**(`didOrValues`, `options?`): `Promise`\<``null`` \| `ModelInstanceDocument`\<`Content`\>\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `didOrValues` | `string` \| `string`[] | +| `options` | `DeterministicLoadOptions` | + +#### Returns + +`Promise`\<``null`` \| `ModelInstanceDocument`\<`Content`\>\> + +#### Inherited from + +[SetReader](points.SetReader.md).[loadDocumentFor](points.SetReader.md#loaddocumentfor) + +#### Defined in + +[libraries/points/src/set-reader.ts:16](https://github.com/ceramicstudio/solutions-sdk/blob/410a332e8e4d42d225b25ac7932f63038da217ad/libraries/points/src/set-reader.ts#L16) + +___ + +### queryDocuments + +▸ **queryDocuments**(`options?`): `Promise`\<[`QueryDocumentsResult`](../modules/points.md#querydocumentsresult)\<`Content`\>\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `options?` | [`QueryDocumentsOptions`](../modules/points.md#querydocumentsoptions) | + +#### Returns + +`Promise`\<[`QueryDocumentsResult`](../modules/points.md#querydocumentsresult)\<`Content`\>\> + +#### Inherited from + +[SetReader](points.SetReader.md).[queryDocuments](points.SetReader.md#querydocuments) + +#### Defined in + +[libraries/points/src/generic-reader.ts:49](https://github.com/ceramicstudio/solutions-sdk/blob/410a332e8e4d42d225b25ac7932f63038da217ad/libraries/points/src/generic-reader.ts#L49) + +___ + +### queryDocumentsFor + +▸ **queryDocumentsFor**(`did`, `options?`): `Promise`\<[`QueryDocumentsResult`](../modules/points.md#querydocumentsresult)\<`Content`\>\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `did` | `string` | +| `options?` | [`QueryDocumentsOptions`](../modules/points.md#querydocumentsoptions) | + +#### Returns + +`Promise`\<[`QueryDocumentsResult`](../modules/points.md#querydocumentsresult)\<`Content`\>\> + +#### Inherited from + +[SetReader](points.SetReader.md).[queryDocumentsFor](points.SetReader.md#querydocumentsfor) + +#### Defined in + +[libraries/points/src/generic-reader.ts:53](https://github.com/ceramicstudio/solutions-sdk/blob/410a332e8e4d42d225b25ac7932f63038da217ad/libraries/points/src/generic-reader.ts#L53) + +___ + +### removeDocument + +▸ **removeDocument**(`id`): `Promise`\<`void`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `id` | `string` | + +#### Returns + +`Promise`\<`void`\> + +#### Defined in + +[libraries/points/src/set-writer.ts:57](https://github.com/ceramicstudio/solutions-sdk/blob/410a332e8e4d42d225b25ac7932f63038da217ad/libraries/points/src/set-writer.ts#L57) + +___ + +### removeDocumentFor + +▸ **removeDocumentFor**(`didOrValues`): `Promise`\<`void`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `didOrValues` | `string` \| `string`[] | + +#### Returns + +`Promise`\<`void`\> + +#### Defined in + +[libraries/points/src/set-writer.ts:65](https://github.com/ceramicstudio/solutions-sdk/blob/410a332e8e4d42d225b25ac7932f63038da217ad/libraries/points/src/set-writer.ts#L65) + +___ + +### setDocumentFor + +▸ **setDocumentFor**(`didOrValues`, `updateContent`): `Promise`\<`ModelInstanceDocument`\<`Content`\>\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `didOrValues` | `string` \| `string`[] | +| `updateContent` | (`content`: ``null`` \| `Content`) => `Partial`\<`Content`\> | + +#### Returns + +`Promise`\<`ModelInstanceDocument`\<`Content`\>\> + +#### Defined in + +[libraries/points/src/set-writer.ts:41](https://github.com/ceramicstudio/solutions-sdk/blob/410a332e8e4d42d225b25ac7932f63038da217ad/libraries/points/src/set-writer.ts#L41) + +___ + +### fromSeed + +▸ **fromSeed**\<`Content`\>(`params`): `Promise`\<[`SetWriter`](points.SetWriter.md)\<`Content`\>\> + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `Content` | extends `PointsContent` = `PointsContent` | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `params` | [`SetWriterFromSeedParams`](../modules/points.md#setwriterfromseedparams) | + +#### Returns + +`Promise`\<[`SetWriter`](points.SetWriter.md)\<`Content`\>\> + +#### Defined in + +[libraries/points/src/set-writer.ts:22](https://github.com/ceramicstudio/solutions-sdk/blob/410a332e8e4d42d225b25ac7932f63038da217ad/libraries/points/src/set-writer.ts#L22) diff --git a/docs/api/classes/points.SinglePointReader.md b/docs/api/classes/points.SinglePointReader.md deleted file mode 100644 index bcb7105..0000000 --- a/docs/api/classes/points.SinglePointReader.md +++ /dev/null @@ -1,156 +0,0 @@ -# Class: SinglePointReader\ - -[points](../modules/points.md).SinglePointReader - -## Type parameters - -| Name | Type | -| :------ | :------ | -| `Content` | extends `SinglePointContent` = `SinglePointContent` | - -## Hierarchy - -- **`SinglePointReader`** - - ↳ [`SinglePointWriter`](points.SinglePointWriter.md) - -## Table of contents - -### Constructors - -- [constructor](points.SinglePointReader.md#constructor) - -### Accessors - -- [ceramic](points.SinglePointReader.md#ceramic) -- [loader](points.SinglePointReader.md#loader) -- [modelID](points.SinglePointReader.md#modelid) - -### Methods - -- [countPointsFor](points.SinglePointReader.md#countpointsfor) -- [countTotalPoints](points.SinglePointReader.md#counttotalpoints) -- [queryPointDocumentsFor](points.SinglePointReader.md#querypointdocumentsfor) - -## Constructors - -### constructor - -• **new SinglePointReader**\<`Content`\>(`params`): [`SinglePointReader`](points.SinglePointReader.md)\<`Content`\> - -#### Type parameters - -| Name | Type | -| :------ | :------ | -| `Content` | extends `SinglePointContent` = `SinglePointContent` | - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `params` | [`SinglePointReaderParams`](../modules/points.md#singlepointreaderparams) | - -#### Returns - -[`SinglePointReader`](points.SinglePointReader.md)\<`Content`\> - -#### Defined in - -[libraries/points/src/single-reader.ts:27](https://github.com/ceramicstudio/solutions-sdk/blob/996989c557810301e582e300ab7215628488db96/libraries/points/src/single-reader.ts#L27) - -## Accessors - -### ceramic - -• `get` **ceramic**(): `CeramicAPI` - -#### Returns - -`CeramicAPI` - -#### Defined in - -[libraries/points/src/single-reader.ts:37](https://github.com/ceramicstudio/solutions-sdk/blob/996989c557810301e582e300ab7215628488db96/libraries/points/src/single-reader.ts#L37) - -___ - -### loader - -• `get` **loader**(): `DocumentLoader` - -#### Returns - -`DocumentLoader` - -#### Defined in - -[libraries/points/src/single-reader.ts:41](https://github.com/ceramicstudio/solutions-sdk/blob/996989c557810301e582e300ab7215628488db96/libraries/points/src/single-reader.ts#L41) - -___ - -### modelID - -• `get` **modelID**(): `string` - -#### Returns - -`string` - -#### Defined in - -[libraries/points/src/single-reader.ts:45](https://github.com/ceramicstudio/solutions-sdk/blob/996989c557810301e582e300ab7215628488db96/libraries/points/src/single-reader.ts#L45) - -## Methods - -### countPointsFor - -▸ **countPointsFor**(`did`): `Promise`\<`number`\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `did` | `string` | - -#### Returns - -`Promise`\<`number`\> - -#### Defined in - -[libraries/points/src/single-reader.ts:61](https://github.com/ceramicstudio/solutions-sdk/blob/996989c557810301e582e300ab7215628488db96/libraries/points/src/single-reader.ts#L61) - -___ - -### countTotalPoints - -▸ **countTotalPoints**(): `Promise`\<`number`\> - -#### Returns - -`Promise`\<`number`\> - -#### Defined in - -[libraries/points/src/single-reader.ts:49](https://github.com/ceramicstudio/solutions-sdk/blob/996989c557810301e582e300ab7215628488db96/libraries/points/src/single-reader.ts#L49) - -___ - -### queryPointDocumentsFor - -▸ **queryPointDocumentsFor**(`did`, `options?`): `Promise`\<[`QueryDocumentsResult`](../modules/points.md#querydocumentsresult)\<`Content`\>\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `did` | `string` | -| `options?` | [`QueryDocumentsOptions`](../modules/points.md#querydocumentsoptions) | - -#### Returns - -`Promise`\<[`QueryDocumentsResult`](../modules/points.md#querydocumentsresult)\<`Content`\>\> - -#### Defined in - -[libraries/points/src/single-reader.ts:53](https://github.com/ceramicstudio/solutions-sdk/blob/996989c557810301e582e300ab7215628488db96/libraries/points/src/single-reader.ts#L53) diff --git a/docs/api/classes/points.SinglePointWriter.md b/docs/api/classes/points.SinglePointWriter.md deleted file mode 100644 index 4f6492f..0000000 --- a/docs/api/classes/points.SinglePointWriter.md +++ /dev/null @@ -1,254 +0,0 @@ -# Class: SinglePointWriter\ - -[points](../modules/points.md).SinglePointWriter - -## Type parameters - -| Name | Type | -| :------ | :------ | -| `Content` | extends `SinglePointContent` = `SinglePointContent` | - -## Hierarchy - -- [`SinglePointReader`](points.SinglePointReader.md)\<`Content`\> - - ↳ **`SinglePointWriter`** - -## Table of contents - -### Constructors - -- [constructor](points.SinglePointWriter.md#constructor) - -### Accessors - -- [ceramic](points.SinglePointWriter.md#ceramic) -- [loader](points.SinglePointWriter.md#loader) -- [modelID](points.SinglePointWriter.md#modelid) - -### Methods - -- [addPointTo](points.SinglePointWriter.md#addpointto) -- [countPointsFor](points.SinglePointWriter.md#countpointsfor) -- [countTotalPoints](points.SinglePointWriter.md#counttotalpoints) -- [queryPointDocumentsFor](points.SinglePointWriter.md#querypointdocumentsfor) -- [removePoint](points.SinglePointWriter.md#removepoint) -- [fromSeed](points.SinglePointWriter.md#fromseed) - -## Constructors - -### constructor - -• **new SinglePointWriter**\<`Content`\>(`params`): [`SinglePointWriter`](points.SinglePointWriter.md)\<`Content`\> - -#### Type parameters - -| Name | Type | -| :------ | :------ | -| `Content` | extends `SinglePointContent` = `SinglePointContent` | - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `params` | [`SinglePointWriterParams`](../modules/points.md#singlepointwriterparams) | - -#### Returns - -[`SinglePointWriter`](points.SinglePointWriter.md)\<`Content`\> - -#### Overrides - -[SinglePointReader](points.SinglePointReader.md).[constructor](points.SinglePointReader.md#constructor) - -#### Defined in - -[libraries/points/src/single-writer.ts:33](https://github.com/ceramicstudio/solutions-sdk/blob/996989c557810301e582e300ab7215628488db96/libraries/points/src/single-writer.ts#L33) - -## Accessors - -### ceramic - -• `get` **ceramic**(): `CeramicAPI` - -#### Returns - -`CeramicAPI` - -#### Inherited from - -SinglePointReader.ceramic - -#### Defined in - -[libraries/points/src/single-reader.ts:37](https://github.com/ceramicstudio/solutions-sdk/blob/996989c557810301e582e300ab7215628488db96/libraries/points/src/single-reader.ts#L37) - -___ - -### loader - -• `get` **loader**(): `DocumentLoader` - -#### Returns - -`DocumentLoader` - -#### Inherited from - -SinglePointReader.loader - -#### Defined in - -[libraries/points/src/single-reader.ts:41](https://github.com/ceramicstudio/solutions-sdk/blob/996989c557810301e582e300ab7215628488db96/libraries/points/src/single-reader.ts#L41) - -___ - -### modelID - -• `get` **modelID**(): `string` - -#### Returns - -`string` - -#### Inherited from - -SinglePointReader.modelID - -#### Defined in - -[libraries/points/src/single-reader.ts:45](https://github.com/ceramicstudio/solutions-sdk/blob/996989c557810301e582e300ab7215628488db96/libraries/points/src/single-reader.ts#L45) - -## Methods - -### addPointTo - -▸ **addPointTo**(`did`, `content?`): `Promise`\<`ModelInstanceDocument`\<`Content`\>\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `did` | `string` | -| `content` | `Partial`\<`Content`\> | - -#### Returns - -`Promise`\<`ModelInstanceDocument`\<`Content`\>\> - -#### Defined in - -[libraries/points/src/single-writer.ts:40](https://github.com/ceramicstudio/solutions-sdk/blob/996989c557810301e582e300ab7215628488db96/libraries/points/src/single-writer.ts#L40) - -___ - -### countPointsFor - -▸ **countPointsFor**(`did`): `Promise`\<`number`\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `did` | `string` | - -#### Returns - -`Promise`\<`number`\> - -#### Inherited from - -[SinglePointReader](points.SinglePointReader.md).[countPointsFor](points.SinglePointReader.md#countpointsfor) - -#### Defined in - -[libraries/points/src/single-reader.ts:61](https://github.com/ceramicstudio/solutions-sdk/blob/996989c557810301e582e300ab7215628488db96/libraries/points/src/single-reader.ts#L61) - -___ - -### countTotalPoints - -▸ **countTotalPoints**(): `Promise`\<`number`\> - -#### Returns - -`Promise`\<`number`\> - -#### Inherited from - -[SinglePointReader](points.SinglePointReader.md).[countTotalPoints](points.SinglePointReader.md#counttotalpoints) - -#### Defined in - -[libraries/points/src/single-reader.ts:49](https://github.com/ceramicstudio/solutions-sdk/blob/996989c557810301e582e300ab7215628488db96/libraries/points/src/single-reader.ts#L49) - -___ - -### queryPointDocumentsFor - -▸ **queryPointDocumentsFor**(`did`, `options?`): `Promise`\<[`QueryDocumentsResult`](../modules/points.md#querydocumentsresult)\<`Content`\>\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `did` | `string` | -| `options?` | [`QueryDocumentsOptions`](../modules/points.md#querydocumentsoptions) | - -#### Returns - -`Promise`\<[`QueryDocumentsResult`](../modules/points.md#querydocumentsresult)\<`Content`\>\> - -#### Inherited from - -[SinglePointReader](points.SinglePointReader.md).[queryPointDocumentsFor](points.SinglePointReader.md#querypointdocumentsfor) - -#### Defined in - -[libraries/points/src/single-reader.ts:53](https://github.com/ceramicstudio/solutions-sdk/blob/996989c557810301e582e300ab7215628488db96/libraries/points/src/single-reader.ts#L53) - -___ - -### removePoint - -▸ **removePoint**(`id`): `Promise`\<`void`\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `id` | `string` | - -#### Returns - -`Promise`\<`void`\> - -#### Defined in - -[libraries/points/src/single-writer.ts:47](https://github.com/ceramicstudio/solutions-sdk/blob/996989c557810301e582e300ab7215628488db96/libraries/points/src/single-writer.ts#L47) - -___ - -### fromSeed - -▸ **fromSeed**\<`Content`\>(`params`): `Promise`\<[`SinglePointWriter`](points.SinglePointWriter.md)\<`Content`\>\> - -#### Type parameters - -| Name | Type | -| :------ | :------ | -| `Content` | extends `SinglePointContent` = `SinglePointContent` | - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `params` | [`SinglePointWriterFromSeedParams`](../modules/points.md#singlepointwriterfromseedparams) | - -#### Returns - -`Promise`\<[`SinglePointWriter`](points.SinglePointWriter.md)\<`Content`\>\> - -#### Defined in - -[libraries/points/src/single-writer.ts:24](https://github.com/ceramicstudio/solutions-sdk/blob/996989c557810301e582e300ab7215628488db96/libraries/points/src/single-writer.ts#L24) diff --git a/docs/api/modules/points.md b/docs/api/modules/points.md index e3941f1..6b98b7f 100644 --- a/docs/api/modules/points.md +++ b/docs/api/modules/points.md @@ -4,47 +4,51 @@ ### Classes +- [GenericReader](../classes/points.GenericReader.md) +- [ListWriter](../classes/points.ListWriter.md) - [PointsReader](../classes/points.PointsReader.md) - [PointsWriter](../classes/points.PointsWriter.md) -- [SinglePointReader](../classes/points.SinglePointReader.md) -- [SinglePointWriter](../classes/points.SinglePointWriter.md) +- [SetReader](../classes/points.SetReader.md) +- [SetWriter](../classes/points.SetWriter.md) ### Type Aliases +- [GenericReaderParams](points.md#genericreaderparams) +- [ListWriterFromSeedParams](points.md#listwriterfromseedparams) +- [ListWriterParams](points.md#listwriterparams) - [PointsReaderParams](points.md#pointsreaderparams) - [PointsWriterFromSeedParams](points.md#pointswriterfromseedparams) - [PointsWriterParams](points.md#pointswriterparams) - [QueryDocumentsOptions](points.md#querydocumentsoptions) - [QueryDocumentsResult](points.md#querydocumentsresult) -- [SinglePointReaderParams](points.md#singlepointreaderparams) -- [SinglePointWriterFromSeedParams](points.md#singlepointwriterfromseedparams) -- [SinglePointWriterParams](points.md#singlepointwriterparams) +- [SetReaderParams](points.md#setreaderparams) +- [SetWriterFromSeedParams](points.md#setwriterfromseedparams) +- [SetWriterParams](points.md#setwriterparams) ## Type Aliases -### PointsReaderParams +### GenericReaderParams -Ƭ **PointsReaderParams**: `Object` +Ƭ **GenericReaderParams**: `Object` #### Type declaration | Name | Type | | :------ | :------ | -| `aggregationModelID?` | `string` | -| `allocationModelID?` | `string` | | `ceramic?` | `CeramicAPI` \| `string` | | `issuer` | `string` | | `loader?` | `DocumentLoader` | +| `modelID` | `string` | #### Defined in -[libraries/points/src/points-reader.ts:25](https://github.com/ceramicstudio/solutions-sdk/blob/996989c557810301e582e300ab7215628488db96/libraries/points/src/points-reader.ts#L25) +[libraries/points/src/generic-reader.ts:10](https://github.com/ceramicstudio/solutions-sdk/blob/410a332e8e4d42d225b25ac7932f63038da217ad/libraries/points/src/generic-reader.ts#L10) ___ -### PointsWriterFromSeedParams +### ListWriterFromSeedParams -Ƭ **PointsWriterFromSeedParams**: `Object` +Ƭ **ListWriterFromSeedParams**: `Object` #### Type declaration @@ -52,18 +56,60 @@ ___ | :------ | :------ | | `ceramic?` | `CeramicAPI` \| `string` | | `loader?` | `DocumentLoader` | -| `modelID?` | `string` | +| `modelID` | `string` | | `seed` | `Uint8Array` | #### Defined in -[libraries/points/src/points-writer.ts:13](https://github.com/ceramicstudio/solutions-sdk/blob/996989c557810301e582e300ab7215628488db96/libraries/points/src/points-writer.ts#L13) +[libraries/points/src/list-writer.ts:8](https://github.com/ceramicstudio/solutions-sdk/blob/410a332e8e4d42d225b25ac7932f63038da217ad/libraries/points/src/list-writer.ts#L8) ___ -### PointsWriterParams +### ListWriterParams -Ƭ **PointsWriterParams**: `Object` +Ƭ **ListWriterParams**: `Object` + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `ceramic` | `CeramicAPI` | +| `loader?` | `DocumentLoader` | +| `modelID` | `string` | + +#### Defined in + +[libraries/points/src/list-writer.ts:15](https://github.com/ceramicstudio/solutions-sdk/blob/410a332e8e4d42d225b25ac7932f63038da217ad/libraries/points/src/list-writer.ts#L15) + +___ + +### PointsReaderParams + +Ƭ **PointsReaderParams**\<`AggregationContent`, `AllocationContent`\>: `Object` + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `AggregationContent` | extends `TotalPointsContent` = `TotalPointsContent` | +| `AllocationContent` | extends `AllocatePointsContent` = `AllocatePointsContent` | + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `aggregationReader` | [`SetReader`](../classes/points.SetReader.md)\<`AggregationContent`\> | +| `allocationReader` | [`GenericReader`](../classes/points.GenericReader.md)\<`AllocationContent`\> | + +#### Defined in + +[libraries/points/src/points-reader.ts:28](https://github.com/ceramicstudio/solutions-sdk/blob/410a332e8e4d42d225b25ac7932f63038da217ad/libraries/points/src/points-reader.ts#L28) + +___ + +### PointsWriterFromSeedParams + +Ƭ **PointsWriterFromSeedParams**: `Object` #### Type declaration @@ -71,12 +117,37 @@ ___ | :------ | :------ | | `aggregationModelID?` | `string` | | `allocationModelID?` | `string` | -| `ceramic` | `CeramicAPI` | +| `ceramic?` | `CeramicAPI` \| `string` | | `loader?` | `DocumentLoader` | +| `seed` | `Uint8Array` | + +#### Defined in + +[libraries/points/src/points-writer.ts:24](https://github.com/ceramicstudio/solutions-sdk/blob/410a332e8e4d42d225b25ac7932f63038da217ad/libraries/points/src/points-writer.ts#L24) + +___ + +### PointsWriterParams + +Ƭ **PointsWriterParams**\<`AggregationContent`, `AllocationContent`\>: `Object` + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `AggregationContent` | extends `TotalPointsContent` = `TotalPointsContent` | +| `AllocationContent` | extends `AllocatePointsContent` = `AllocatePointsContent` | + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `aggregationWriter` | [`SetWriter`](../classes/points.SetWriter.md)\<`AggregationContent`\> | +| `allocationWriter` | [`ListWriter`](../classes/points.ListWriter.md)\<`AllocationContent`\> | #### Defined in -[libraries/points/src/points-writer.ts:20](https://github.com/ceramicstudio/solutions-sdk/blob/996989c557810301e582e300ab7215628488db96/libraries/points/src/points-writer.ts#L20) +[libraries/points/src/points-writer.ts:32](https://github.com/ceramicstudio/solutions-sdk/blob/410a332e8e4d42d225b25ac7932f63038da217ad/libraries/points/src/points-writer.ts#L32) ___ @@ -94,7 +165,7 @@ ___ #### Defined in -[libraries/points/src/types.ts:3](https://github.com/ceramicstudio/solutions-sdk/blob/996989c557810301e582e300ab7215628488db96/libraries/points/src/types.ts#L3) +[libraries/points/src/types.ts:3](https://github.com/ceramicstudio/solutions-sdk/blob/410a332e8e4d42d225b25ac7932f63038da217ad/libraries/points/src/types.ts#L3) ___ @@ -120,32 +191,23 @@ ___ #### Defined in -[libraries/points/src/types.ts:9](https://github.com/ceramicstudio/solutions-sdk/blob/996989c557810301e582e300ab7215628488db96/libraries/points/src/types.ts#L9) +[libraries/points/src/types.ts:9](https://github.com/ceramicstudio/solutions-sdk/blob/410a332e8e4d42d225b25ac7932f63038da217ad/libraries/points/src/types.ts#L9) ___ -### SinglePointReaderParams +### SetReaderParams -Ƭ **SinglePointReaderParams**: `Object` - -#### Type declaration - -| Name | Type | -| :------ | :------ | -| `ceramic?` | `CeramicAPI` \| `string` | -| `issuer` | `string` | -| `loader?` | `DocumentLoader` | -| `modelID?` | `string` | +Ƭ **SetReaderParams**: [`GenericReaderParams`](points.md#genericreaderparams) #### Defined in -[libraries/points/src/single-reader.ts:14](https://github.com/ceramicstudio/solutions-sdk/blob/996989c557810301e582e300ab7215628488db96/libraries/points/src/single-reader.ts#L14) +[libraries/points/src/set-reader.ts:11](https://github.com/ceramicstudio/solutions-sdk/blob/410a332e8e4d42d225b25ac7932f63038da217ad/libraries/points/src/set-reader.ts#L11) ___ -### SinglePointWriterFromSeedParams +### SetWriterFromSeedParams -Ƭ **SinglePointWriterFromSeedParams**: `Object` +Ƭ **SetWriterFromSeedParams**: `Object` #### Type declaration @@ -153,18 +215,18 @@ ___ | :------ | :------ | | `ceramic?` | `CeramicAPI` \| `string` | | `loader?` | `DocumentLoader` | -| `modelID?` | `string` | +| `modelID` | `string` | | `seed` | `Uint8Array` | #### Defined in -[libraries/points/src/single-writer.ts:8](https://github.com/ceramicstudio/solutions-sdk/blob/996989c557810301e582e300ab7215628488db96/libraries/points/src/single-writer.ts#L8) +[libraries/points/src/set-writer.ts:8](https://github.com/ceramicstudio/solutions-sdk/blob/410a332e8e4d42d225b25ac7932f63038da217ad/libraries/points/src/set-writer.ts#L8) ___ -### SinglePointWriterParams +### SetWriterParams -Ƭ **SinglePointWriterParams**: `Object` +Ƭ **SetWriterParams**: `Object` #### Type declaration @@ -172,8 +234,8 @@ ___ | :------ | :------ | | `ceramic` | `CeramicAPI` | | `loader?` | `DocumentLoader` | -| `modelID?` | `string` | +| `modelID` | `string` | #### Defined in -[libraries/points/src/single-writer.ts:15](https://github.com/ceramicstudio/solutions-sdk/blob/996989c557810301e582e300ab7215628488db96/libraries/points/src/single-writer.ts#L15) +[libraries/points/src/set-writer.ts:15](https://github.com/ceramicstudio/solutions-sdk/blob/410a332e8e4d42d225b25ac7932f63038da217ad/libraries/points/src/set-writer.ts#L15) diff --git a/docs/api/modules/points_composite.md b/docs/api/modules/points_composite.md index 303a59e..e78f79a 100644 --- a/docs/api/modules/points_composite.md +++ b/docs/api/modules/points_composite.md @@ -2,16 +2,59 @@ ## Table of contents +### Type Aliases + +- [PointsContent](points_composite.md#pointscontent) + ### Variables +- [SimplePointsAggregationID](points_composite.md#simplepointsaggregationid) +- [SimplePointsAllocationID](points_composite.md#simplepointsallocationid) - [definition](points_composite.md#definition) +## Type Aliases + +### PointsContent + +Ƭ **PointsContent**: `Object` + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `points` | `number` | +| `recipient` | `string` | + +#### Defined in + +[composites/points/src/index.ts:11](https://github.com/ceramicstudio/solutions-sdk/blob/410a332e8e4d42d225b25ac7932f63038da217ad/composites/points/src/index.ts#L11) + ## Variables +### SimplePointsAggregationID + +• `Const` **SimplePointsAggregationID**: `string` = `definition.models.SimplePointsAggregation.id` + +#### Defined in + +[composites/points/src/index.ts:8](https://github.com/ceramicstudio/solutions-sdk/blob/410a332e8e4d42d225b25ac7932f63038da217ad/composites/points/src/index.ts#L8) + +___ + +### SimplePointsAllocationID + +• `Const` **SimplePointsAllocationID**: `string` = `definition.models.SimplePointsAllocation.id` + +#### Defined in + +[composites/points/src/index.ts:9](https://github.com/ceramicstudio/solutions-sdk/blob/410a332e8e4d42d225b25ac7932f63038da217ad/composites/points/src/index.ts#L9) + +___ + ### definition • `Const` **definition**: `RuntimeCompositeDefinition` #### Defined in -[composites/points/src/definition.ts:3](https://github.com/ceramicstudio/solutions-sdk/blob/996989c557810301e582e300ab7215628488db96/composites/points/src/definition.ts#L3) +[composites/points/src/definition.ts:3](https://github.com/ceramicstudio/solutions-sdk/blob/410a332e8e4d42d225b25ac7932f63038da217ad/composites/points/src/definition.ts#L3) diff --git a/libraries/points/src/set-writer.ts b/libraries/points/src/set-writer.ts index 5a4a7b9..83feb9d 100644 --- a/libraries/points/src/set-writer.ts +++ b/libraries/points/src/set-writer.ts @@ -31,7 +31,7 @@ export class SetWriter extends Se super({ ...params, issuer: params.ceramic.did.id }) } - async _loadDocumentFor( + async #loadDocumentFor( didOrValues: string | Array, ): Promise> { const doc = await this.loadDocumentFor(didOrValues, { ignoreEmpty: false, onlyIndexed: false }) @@ -43,15 +43,15 @@ export class SetWriter extends Se updateContent: (content: Content | null) => Partial, ): Promise> { const unique = toUniqueArg(didOrValues) - const doc = await this._loadDocumentFor(didOrValues) - const content = doc!.content - await doc!.replace({ + const doc = await this.#loadDocumentFor(didOrValues) + const content = doc.content + await doc.replace({ // Copy existing content or set recipient (assuming it's the first value) ...(content ?? { recipient: unique[0] }), // Apply content update ...updateContent(content), } as Content) - return doc! + return doc } async removeDocument(id: string): Promise { @@ -63,7 +63,7 @@ export class SetWriter extends Se } async removeDocumentFor(didOrValues: string | Array): Promise { - const doc = await this._loadDocumentFor(didOrValues) + const doc = await this.#loadDocumentFor(didOrValues) await doc.shouldIndex(false) } }