@twin.org/verifiable-storage-models 0.0.2-next.6 → 0.0.3-next.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/dist/es/factories/verifiableStorageConnectorFactory.js +9 -0
- package/dist/es/factories/verifiableStorageConnectorFactory.js.map +1 -0
- package/dist/es/index.js +14 -0
- package/dist/es/index.js.map +1 -0
- package/dist/es/models/IVerifiableStorageComponent.js +2 -0
- package/dist/es/models/IVerifiableStorageComponent.js.map +1 -0
- package/dist/es/models/IVerifiableStorageConnector.js +2 -0
- package/dist/es/models/IVerifiableStorageConnector.js.map +1 -0
- package/dist/es/models/api/IVerifiableStorageCreateRequest.js +4 -0
- package/dist/es/models/api/IVerifiableStorageCreateRequest.js.map +1 -0
- package/dist/es/models/api/IVerifiableStorageCreateResponse.js +2 -0
- package/dist/es/models/api/IVerifiableStorageCreateResponse.js.map +1 -0
- package/dist/es/models/api/IVerifiableStorageGetRequest.js +4 -0
- package/dist/es/models/api/IVerifiableStorageGetRequest.js.map +1 -0
- package/dist/es/models/api/IVerifiableStorageGetResponse.js +2 -0
- package/dist/es/models/api/IVerifiableStorageGetResponse.js.map +1 -0
- package/dist/es/models/api/IVerifiableStorageRemoveRequest.js +4 -0
- package/dist/es/models/api/IVerifiableStorageRemoveRequest.js.map +1 -0
- package/dist/es/models/api/IVerifiableStorageUpdateRequest.js +4 -0
- package/dist/es/models/api/IVerifiableStorageUpdateRequest.js.map +1 -0
- package/dist/es/models/api/IVerifiableStorageUpdateResponse.js +2 -0
- package/dist/es/models/api/IVerifiableStorageUpdateResponse.js.map +1 -0
- package/dist/es/models/verifiableStorageContexts.js +21 -0
- package/dist/es/models/verifiableStorageContexts.js.map +1 -0
- package/dist/types/factories/verifiableStorageConnectorFactory.d.ts +1 -1
- package/dist/types/index.d.ts +11 -11
- package/dist/types/models/IVerifiableStorageComponent.d.ts +6 -6
- package/dist/types/models/IVerifiableStorageConnector.d.ts +6 -6
- package/dist/types/models/verifiableStorageContexts.d.ts +10 -2
- package/docs/changelog.md +140 -50
- package/docs/examples.md +51 -1
- package/docs/reference/interfaces/IVerifiableStorageComponent.md +14 -22
- package/docs/reference/interfaces/IVerifiableStorageConnector.md +10 -18
- package/docs/reference/interfaces/IVerifiableStorageCreateRequest.md +4 -4
- package/docs/reference/interfaces/IVerifiableStorageCreateResponse.md +1 -1
- package/docs/reference/interfaces/IVerifiableStorageGetRequest.md +5 -5
- package/docs/reference/interfaces/IVerifiableStorageGetResponse.md +3 -3
- package/docs/reference/interfaces/IVerifiableStorageRemoveRequest.md +1 -1
- package/docs/reference/interfaces/IVerifiableStorageUpdateRequest.md +4 -4
- package/docs/reference/interfaces/IVerifiableStorageUpdateResponse.md +1 -1
- package/docs/reference/variables/VerifiableStorageContexts.md +15 -3
- package/package.json +8 -10
- package/dist/cjs/index.cjs +0 -27
- package/dist/esm/index.mjs +0 -24
package/README.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# TWIN Verifiable Storage Models
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
This package defines the shared contracts used by verifiable storage components across the repository. It includes common interfaces, API request and response models, and context definitions so integrations can rely on a consistent shape for data and behaviour.
|
|
4
|
+
|
|
5
|
+
By centralising these reusable contracts, it reduces duplication and helps connectors, services, and clients evolve together without introducing mismatched assumptions.
|
|
4
6
|
|
|
5
7
|
## Installation
|
|
6
8
|
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Copyright 2024 IOTA Stiftung.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
3
|
+
import { Factory } from "@twin.org/core";
|
|
4
|
+
/**
|
|
5
|
+
* Factory for creating verifiable storage connectors.
|
|
6
|
+
*/
|
|
7
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
8
|
+
export const VerifiableStorageConnectorFactory = Factory.createFactory("verifiable-storage-connector");
|
|
9
|
+
//# sourceMappingURL=verifiableStorageConnectorFactory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verifiableStorageConnectorFactory.js","sourceRoot":"","sources":["../../../src/factories/verifiableStorageConnectorFactory.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAGzC;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,iCAAiC,GAAG,OAAO,CAAC,aAAa,CACrE,8BAA8B,CAC9B,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { Factory } from \"@twin.org/core\";\nimport type { IVerifiableStorageConnector } from \"../models/IVerifiableStorageConnector.js\";\n\n/**\n * Factory for creating verifiable storage connectors.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const VerifiableStorageConnectorFactory = Factory.createFactory<IVerifiableStorageConnector>(\n\t\"verifiable-storage-connector\"\n);\n"]}
|
package/dist/es/index.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Copyright 2024 IOTA Stiftung.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
3
|
+
export * from "./factories/verifiableStorageConnectorFactory.js";
|
|
4
|
+
export * from "./models/api/IVerifiableStorageCreateRequest.js";
|
|
5
|
+
export * from "./models/api/IVerifiableStorageCreateResponse.js";
|
|
6
|
+
export * from "./models/api/IVerifiableStorageGetRequest.js";
|
|
7
|
+
export * from "./models/api/IVerifiableStorageGetResponse.js";
|
|
8
|
+
export * from "./models/api/IVerifiableStorageRemoveRequest.js";
|
|
9
|
+
export * from "./models/api/IVerifiableStorageUpdateRequest.js";
|
|
10
|
+
export * from "./models/api/IVerifiableStorageUpdateResponse.js";
|
|
11
|
+
export * from "./models/IVerifiableStorageComponent.js";
|
|
12
|
+
export * from "./models/IVerifiableStorageConnector.js";
|
|
13
|
+
export * from "./models/verifiableStorageContexts.js";
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,cAAc,kDAAkD,CAAC;AACjE,cAAc,iDAAiD,CAAC;AAChE,cAAc,kDAAkD,CAAC;AACjE,cAAc,8CAA8C,CAAC;AAC7D,cAAc,+CAA+C,CAAC;AAC9D,cAAc,iDAAiD,CAAC;AAChE,cAAc,iDAAiD,CAAC;AAChE,cAAc,kDAAkD,CAAC;AACjE,cAAc,yCAAyC,CAAC;AACxD,cAAc,yCAAyC,CAAC;AACxD,cAAc,uCAAuC,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nexport * from \"./factories/verifiableStorageConnectorFactory.js\";\nexport * from \"./models/api/IVerifiableStorageCreateRequest.js\";\nexport * from \"./models/api/IVerifiableStorageCreateResponse.js\";\nexport * from \"./models/api/IVerifiableStorageGetRequest.js\";\nexport * from \"./models/api/IVerifiableStorageGetResponse.js\";\nexport * from \"./models/api/IVerifiableStorageRemoveRequest.js\";\nexport * from \"./models/api/IVerifiableStorageUpdateRequest.js\";\nexport * from \"./models/api/IVerifiableStorageUpdateResponse.js\";\nexport * from \"./models/IVerifiableStorageComponent.js\";\nexport * from \"./models/IVerifiableStorageConnector.js\";\nexport * from \"./models/verifiableStorageContexts.js\";\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IVerifiableStorageComponent.js","sourceRoot":"","sources":["../../../src/models/IVerifiableStorageComponent.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IComponent } from \"@twin.org/core\";\nimport type { IJsonLdNodeObject } from \"@twin.org/data-json-ld\";\n\n/**\n * Interface describing a Verifiable Storage component.\n */\nexport interface IVerifiableStorageComponent extends IComponent {\n\t/**\n\t * Create an item in verifiable storage.\n\t * @param data The data to store.\n\t * @param allowList The list of identities that are allowed to modify the item.\n\t * @param options Additional options for creating the item.\n\t * @param options.maxAllowListSize The maximum size of the allow list.\n\t * @param namespace The namespace to store the item in.\n\t * @param controller The identity of the controller to access the vault keys.\n\t * @returns The id of the stored verifiable item in urn format and the receipt.\n\t */\n\tcreate(\n\t\tdata: Uint8Array,\n\t\tallowList?: string[],\n\t\toptions?: {\n\t\t\tmaxAllowListSize?: number;\n\t\t},\n\t\tnamespace?: string,\n\t\tcontroller?: string\n\t): Promise<{\n\t\tid: string;\n\t\treceipt: IJsonLdNodeObject;\n\t}>;\n\n\t/**\n\t * Update an item in verifiable storage.\n\t * @param id The id of the item to update.\n\t * @param data The data to store, optional if updating the allow list.\n\t * @param allowList Updated list of identities that are allowed to modify the item.\n\t * @param controller The identity of the controller to access the vault keys.\n\t * @returns The updated receipt.\n\t */\n\tupdate(\n\t\tid: string,\n\t\tdata?: Uint8Array,\n\t\tallowList?: string[],\n\t\tcontroller?: string\n\t): Promise<IJsonLdNodeObject>;\n\n\t/**\n\t * Get an verifiable item.\n\t * @param id The id of the item to get.\n\t * @param options Additional options for getting the item.\n\t * @param options.includeData Should the data be included in the response, defaults to true.\n\t * @param options.includeAllowList Should the allow list be included in the response, defaults to true.\n\t * @returns The data for the item and the receipt.\n\t */\n\tget(\n\t\tid: string,\n\t\toptions?: { includeData?: boolean; includeAllowList?: boolean }\n\t): Promise<{\n\t\tdata?: Uint8Array;\n\t\treceipt: IJsonLdNodeObject;\n\t\tallowList?: string[];\n\t}>;\n\n\t/**\n\t * Remove the item from verifiable storage.\n\t * @param id The id of the verifiable item to remove in urn format.\n\t * @param controller The identity of the controller.\n\t * @returns Nothing.\n\t */\n\tremove(id: string, controller?: string): Promise<void>;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IVerifiableStorageConnector.js","sourceRoot":"","sources":["../../../src/models/IVerifiableStorageConnector.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IComponent } from \"@twin.org/core\";\nimport type { IJsonLdNodeObject } from \"@twin.org/data-json-ld\";\n\n/**\n * Interface describing a verifiable storage connector.\n */\nexport interface IVerifiableStorageConnector extends IComponent {\n\t/**\n\t * Create an item in verifiable storage.\n\t * @param controllerIdentity The identity of the user to access the vault keys.\n\t * @param data The data to store.\n\t * @param allowList The list of identities that are allowed to modify the item.\n\t * @param options Additional options for creating the item.\n\t * @param options.maxAllowListSize The maximum size of the allow list.\n\t * @returns The id of the stored verifiable item in urn format and the receipt.\n\t */\n\tcreate(\n\t\tcontrollerIdentity: string,\n\t\tdata: Uint8Array,\n\t\tallowList?: string[],\n\t\toptions?: {\n\t\t\tmaxAllowListSize?: number;\n\t\t}\n\t): Promise<{\n\t\tid: string;\n\t\treceipt: IJsonLdNodeObject;\n\t}>;\n\n\t/**\n\t * Update an item in verifiable storage.\n\t * @param controllerIdentity The identity of the user to access the vault keys.\n\t * @param id The id of the item to update.\n\t * @param data The data to store, optional if updating the allow list.\n\t * @param allowList Updated list of identities that are allowed to modify the item.\n\t * @returns The updated receipt.\n\t */\n\tupdate(\n\t\tcontrollerIdentity: string,\n\t\tid: string,\n\t\tdata?: Uint8Array,\n\t\tallowList?: string[]\n\t): Promise<IJsonLdNodeObject>;\n\n\t/**\n\t * Get an verifiable item.\n\t * @param id The id of the item to get.\n\t * @param options Additional options for getting the item.\n\t * @param options.includeData Should the data be included in the response, defaults to true.\n\t * @param options.includeAllowList Should the allow list be included in the response, defaults to true.\n\t * @returns The data for the item, the receipt and the allow list.\n\t */\n\tget(\n\t\tid: string,\n\t\toptions?: { includeData?: boolean; includeAllowList?: boolean }\n\t): Promise<{\n\t\tdata?: Uint8Array;\n\t\treceipt: IJsonLdNodeObject;\n\t\tallowList?: string[];\n\t}>;\n\n\t/**\n\t * Remove the item from verifiable storage.\n\t * @param controllerIdentity The identity of the user to access the vault keys.\n\t * @param id The id of the verifiable item to remove in urn format.\n\t * @returns Nothing.\n\t */\n\tremove(controllerIdentity: string, id: string): Promise<void>;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IVerifiableStorageCreateRequest.js","sourceRoot":"","sources":["../../../../src/models/api/IVerifiableStorageCreateRequest.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Store the data and return the verifiable storage item id.\n */\nexport interface IVerifiableStorageCreateRequest {\n\t/**\n\t * The data to be stored.\n\t */\n\tbody: {\n\t\t/**\n\t\t * The data for the verifiable storage item, this is a string serialized as base64.\n\t\t */\n\t\tdata: string;\n\n\t\t/**\n\t\t * The list of identities that are allowed to modify the item.\n\t\t */\n\t\tallowList?: string[];\n\n\t\t/**\n\t\t * The maximum size of the allow list.\n\t\t * @default 100\n\t\t */\n\t\tmaxAllowListSize?: number;\n\n\t\t/**\n\t\t * The namespace of the connector to use for the verifiable storage item, defaults to component configured namespace.\n\t\t */\n\t\tnamespace?: string;\n\t};\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IVerifiableStorageCreateResponse.js","sourceRoot":"","sources":["../../../../src/models/api/IVerifiableStorageCreateResponse.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { ICreatedResponse } from \"@twin.org/api-models\";\nimport type { IJsonLdNodeObject } from \"@twin.org/data-json-ld\";\n\n/**\n * Response to storing the verifiable storage item.\n */\nexport interface IVerifiableStorageCreateResponse extends ICreatedResponse {\n\t/**\n\t * The data that was stored.\n\t */\n\tbody: {\n\t\t/**\n\t\t * The receipt associated to the verifiable storage item.\n\t\t */\n\t\treceipt: IJsonLdNodeObject;\n\n\t\t/**\n\t\t * The id of the verifiable storage item.\n\t\t */\n\t\tid: string;\n\t};\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IVerifiableStorageGetRequest.js","sourceRoot":"","sources":["../../../../src/models/api/IVerifiableStorageGetRequest.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Get the verifiable storage item.\n */\nexport interface IVerifiableStorageGetRequest {\n\t/**\n\t * The data to be requested.\n\t */\n\tpathParams: {\n\t\t/**\n\t\t * The id of the verifiable storage item to resolve.\n\t\t */\n\t\tid: string;\n\t};\n\t/**\n\t * The body optional param.\n\t */\n\tbody?: {\n\t\t/**\n\t\t * The flag to include the data.\n\t\t * @default true\n\t\t */\n\t\tincludeData?: boolean;\n\n\t\t/**\n\t\t * The flag to include the allow list.\n\t\t * @default true\n\t\t */\n\t\tincludeAllowList?: boolean;\n\t};\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IVerifiableStorageGetResponse.js","sourceRoot":"","sources":["../../../../src/models/api/IVerifiableStorageGetResponse.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IJsonLdNodeObject } from \"@twin.org/data-json-ld\";\n\n/**\n * Response to getting the verifiable storage item.\n */\nexport interface IVerifiableStorageGetResponse {\n\t/**\n\t * The data that was obtained.\n\t */\n\tbody: {\n\t\t/**\n\t\t * The receipt associated to the verifiable storage item.\n\t\t */\n\t\treceipt: IJsonLdNodeObject;\n\n\t\t/**\n\t\t * The data of the verifiable storage item, this is a string serialized as base64.\n\t\t */\n\t\tdata?: string;\n\n\t\t/**\n\t\t * The list of identities that are allowed to modify the item.\n\t\t */\n\t\tallowList?: string[];\n\t};\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IVerifiableStorageRemoveRequest.js","sourceRoot":"","sources":["../../../../src/models/api/IVerifiableStorageRemoveRequest.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Remove the verifiable storage item.\n */\nexport interface IVerifiableStorageRemoveRequest {\n\t/**\n\t * The data to be used for resolving.\n\t */\n\tpathParams: {\n\t\t/**\n\t\t * The id of the verifiable storage item to remove.\n\t\t */\n\t\tid: string;\n\t};\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IVerifiableStorageUpdateRequest.js","sourceRoot":"","sources":["../../../../src/models/api/IVerifiableStorageUpdateRequest.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Update the data and return the receipt.\n */\nexport interface IVerifiableStorageUpdateRequest {\n\t/**\n\t * The data to be updated.\n\t */\n\tpathParams: {\n\t\t/**\n\t\t * The id of the verifiable storage item to update.\n\t\t */\n\t\tid: string;\n\t};\n\n\t/**\n\t * The data to be updated.\n\t */\n\tbody: {\n\t\t/**\n\t\t * The data which is a string serialized as base64, leave empty if just updating the allow list.\n\t\t */\n\t\tdata?: string;\n\n\t\t/**\n\t\t * An updated list of identities that are allowed to modify the item, send an empty list to remove all entries.\n\t\t */\n\t\tallowList?: string[];\n\t};\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IVerifiableStorageUpdateResponse.js","sourceRoot":"","sources":["../../../../src/models/api/IVerifiableStorageUpdateResponse.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IJsonLdNodeObject } from \"@twin.org/data-json-ld\";\n\n/**\n * Response to updating the verifiable storage item.\n */\nexport interface IVerifiableStorageUpdateResponse {\n\t/**\n\t * The data that was updated.\n\t */\n\tbody: IJsonLdNodeObject;\n}\n"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// Copyright 2024 IOTA Stiftung.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
3
|
+
/**
|
|
4
|
+
* The contexts of verifiable storage data.
|
|
5
|
+
*/
|
|
6
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
7
|
+
export const VerifiableStorageContexts = {
|
|
8
|
+
/**
|
|
9
|
+
* The canonical RDF namespace URI for Verifiable Storage.
|
|
10
|
+
*/
|
|
11
|
+
Namespace: "https://schema.twindev.org/verifiable-storage/",
|
|
12
|
+
/**
|
|
13
|
+
* The value to use in context for Verifiable Storage.
|
|
14
|
+
*/
|
|
15
|
+
Context: "https://schema.twindev.org/verifiable-storage/",
|
|
16
|
+
/**
|
|
17
|
+
* The JSON-LD Context URL for Verifiable Storage.
|
|
18
|
+
*/
|
|
19
|
+
JsonLdContext: "https://schema.twindev.org/verifiable-storage/types.jsonld"
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=verifiableStorageContexts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verifiableStorageContexts.js","sourceRoot":"","sources":["../../../src/models/verifiableStorageContexts.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AAEvC;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACxC;;OAEG;IACH,SAAS,EAAE,gDAAgD;IAE3D;;OAEG;IACH,OAAO,EAAE,gDAAgD;IAEzD;;OAEG;IACH,aAAa,EAAE,4DAA4D;CAClE,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * The contexts of verifiable storage data.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const VerifiableStorageContexts = {\n\t/**\n\t * The canonical RDF namespace URI for Verifiable Storage.\n\t */\n\tNamespace: \"https://schema.twindev.org/verifiable-storage/\",\n\n\t/**\n\t * The value to use in context for Verifiable Storage.\n\t */\n\tContext: \"https://schema.twindev.org/verifiable-storage/\",\n\n\t/**\n\t * The JSON-LD Context URL for Verifiable Storage.\n\t */\n\tJsonLdContext: \"https://schema.twindev.org/verifiable-storage/types.jsonld\"\n} as const;\n\n/**\n * The contexts of verifiable storage data.\n */\nexport type VerifiableStorageContexts =\n\t(typeof VerifiableStorageContexts)[keyof typeof VerifiableStorageContexts];\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Factory } from "@twin.org/core";
|
|
2
|
-
import type { IVerifiableStorageConnector } from "../models/IVerifiableStorageConnector";
|
|
2
|
+
import type { IVerifiableStorageConnector } from "../models/IVerifiableStorageConnector.js";
|
|
3
3
|
/**
|
|
4
4
|
* Factory for creating verifiable storage connectors.
|
|
5
5
|
*/
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export * from "./factories/verifiableStorageConnectorFactory";
|
|
2
|
-
export * from "./models/api/IVerifiableStorageCreateRequest";
|
|
3
|
-
export * from "./models/api/IVerifiableStorageCreateResponse";
|
|
4
|
-
export * from "./models/api/IVerifiableStorageGetRequest";
|
|
5
|
-
export * from "./models/api/IVerifiableStorageGetResponse";
|
|
6
|
-
export * from "./models/api/IVerifiableStorageRemoveRequest";
|
|
7
|
-
export * from "./models/api/IVerifiableStorageUpdateRequest";
|
|
8
|
-
export * from "./models/api/IVerifiableStorageUpdateResponse";
|
|
9
|
-
export * from "./models/IVerifiableStorageComponent";
|
|
10
|
-
export * from "./models/IVerifiableStorageConnector";
|
|
11
|
-
export * from "./models/verifiableStorageContexts";
|
|
1
|
+
export * from "./factories/verifiableStorageConnectorFactory.js";
|
|
2
|
+
export * from "./models/api/IVerifiableStorageCreateRequest.js";
|
|
3
|
+
export * from "./models/api/IVerifiableStorageCreateResponse.js";
|
|
4
|
+
export * from "./models/api/IVerifiableStorageGetRequest.js";
|
|
5
|
+
export * from "./models/api/IVerifiableStorageGetResponse.js";
|
|
6
|
+
export * from "./models/api/IVerifiableStorageRemoveRequest.js";
|
|
7
|
+
export * from "./models/api/IVerifiableStorageUpdateRequest.js";
|
|
8
|
+
export * from "./models/api/IVerifiableStorageUpdateResponse.js";
|
|
9
|
+
export * from "./models/IVerifiableStorageComponent.js";
|
|
10
|
+
export * from "./models/IVerifiableStorageConnector.js";
|
|
11
|
+
export * from "./models/verifiableStorageContexts.js";
|
|
@@ -10,13 +10,13 @@ export interface IVerifiableStorageComponent extends IComponent {
|
|
|
10
10
|
* @param allowList The list of identities that are allowed to modify the item.
|
|
11
11
|
* @param options Additional options for creating the item.
|
|
12
12
|
* @param options.maxAllowListSize The maximum size of the allow list.
|
|
13
|
-
* @param identity The identity of the user to access the vault keys.
|
|
14
13
|
* @param namespace The namespace to store the item in.
|
|
14
|
+
* @param controller The identity of the controller to access the vault keys.
|
|
15
15
|
* @returns The id of the stored verifiable item in urn format and the receipt.
|
|
16
16
|
*/
|
|
17
17
|
create(data: Uint8Array, allowList?: string[], options?: {
|
|
18
18
|
maxAllowListSize?: number;
|
|
19
|
-
},
|
|
19
|
+
}, namespace?: string, controller?: string): Promise<{
|
|
20
20
|
id: string;
|
|
21
21
|
receipt: IJsonLdNodeObject;
|
|
22
22
|
}>;
|
|
@@ -25,10 +25,10 @@ export interface IVerifiableStorageComponent extends IComponent {
|
|
|
25
25
|
* @param id The id of the item to update.
|
|
26
26
|
* @param data The data to store, optional if updating the allow list.
|
|
27
27
|
* @param allowList Updated list of identities that are allowed to modify the item.
|
|
28
|
-
* @param
|
|
28
|
+
* @param controller The identity of the controller to access the vault keys.
|
|
29
29
|
* @returns The updated receipt.
|
|
30
30
|
*/
|
|
31
|
-
update(id: string, data?: Uint8Array, allowList?: string[],
|
|
31
|
+
update(id: string, data?: Uint8Array, allowList?: string[], controller?: string): Promise<IJsonLdNodeObject>;
|
|
32
32
|
/**
|
|
33
33
|
* Get an verifiable item.
|
|
34
34
|
* @param id The id of the item to get.
|
|
@@ -48,8 +48,8 @@ export interface IVerifiableStorageComponent extends IComponent {
|
|
|
48
48
|
/**
|
|
49
49
|
* Remove the item from verifiable storage.
|
|
50
50
|
* @param id The id of the verifiable item to remove in urn format.
|
|
51
|
-
* @param
|
|
51
|
+
* @param controller The identity of the controller.
|
|
52
52
|
* @returns Nothing.
|
|
53
53
|
*/
|
|
54
|
-
remove(id: string,
|
|
54
|
+
remove(id: string, controller?: string): Promise<void>;
|
|
55
55
|
}
|
|
@@ -6,14 +6,14 @@ import type { IJsonLdNodeObject } from "@twin.org/data-json-ld";
|
|
|
6
6
|
export interface IVerifiableStorageConnector extends IComponent {
|
|
7
7
|
/**
|
|
8
8
|
* Create an item in verifiable storage.
|
|
9
|
-
* @param
|
|
9
|
+
* @param controllerIdentity The identity of the user to access the vault keys.
|
|
10
10
|
* @param data The data to store.
|
|
11
11
|
* @param allowList The list of identities that are allowed to modify the item.
|
|
12
12
|
* @param options Additional options for creating the item.
|
|
13
13
|
* @param options.maxAllowListSize The maximum size of the allow list.
|
|
14
14
|
* @returns The id of the stored verifiable item in urn format and the receipt.
|
|
15
15
|
*/
|
|
16
|
-
create(
|
|
16
|
+
create(controllerIdentity: string, data: Uint8Array, allowList?: string[], options?: {
|
|
17
17
|
maxAllowListSize?: number;
|
|
18
18
|
}): Promise<{
|
|
19
19
|
id: string;
|
|
@@ -21,13 +21,13 @@ export interface IVerifiableStorageConnector extends IComponent {
|
|
|
21
21
|
}>;
|
|
22
22
|
/**
|
|
23
23
|
* Update an item in verifiable storage.
|
|
24
|
-
* @param
|
|
24
|
+
* @param controllerIdentity The identity of the user to access the vault keys.
|
|
25
25
|
* @param id The id of the item to update.
|
|
26
26
|
* @param data The data to store, optional if updating the allow list.
|
|
27
27
|
* @param allowList Updated list of identities that are allowed to modify the item.
|
|
28
28
|
* @returns The updated receipt.
|
|
29
29
|
*/
|
|
30
|
-
update(
|
|
30
|
+
update(controllerIdentity: string, id: string, data?: Uint8Array, allowList?: string[]): Promise<IJsonLdNodeObject>;
|
|
31
31
|
/**
|
|
32
32
|
* Get an verifiable item.
|
|
33
33
|
* @param id The id of the item to get.
|
|
@@ -46,9 +46,9 @@ export interface IVerifiableStorageConnector extends IComponent {
|
|
|
46
46
|
}>;
|
|
47
47
|
/**
|
|
48
48
|
* Remove the item from verifiable storage.
|
|
49
|
-
* @param
|
|
49
|
+
* @param controllerIdentity The identity of the user to access the vault keys.
|
|
50
50
|
* @param id The id of the verifiable item to remove in urn format.
|
|
51
51
|
* @returns Nothing.
|
|
52
52
|
*/
|
|
53
|
-
remove(
|
|
53
|
+
remove(controllerIdentity: string, id: string): Promise<void>;
|
|
54
54
|
}
|
|
@@ -3,9 +3,17 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export declare const VerifiableStorageContexts: {
|
|
5
5
|
/**
|
|
6
|
-
* The
|
|
6
|
+
* The canonical RDF namespace URI for Verifiable Storage.
|
|
7
7
|
*/
|
|
8
|
-
readonly
|
|
8
|
+
readonly Namespace: "https://schema.twindev.org/verifiable-storage/";
|
|
9
|
+
/**
|
|
10
|
+
* The value to use in context for Verifiable Storage.
|
|
11
|
+
*/
|
|
12
|
+
readonly Context: "https://schema.twindev.org/verifiable-storage/";
|
|
13
|
+
/**
|
|
14
|
+
* The JSON-LD Context URL for Verifiable Storage.
|
|
15
|
+
*/
|
|
16
|
+
readonly JsonLdContext: "https://schema.twindev.org/verifiable-storage/types.jsonld";
|
|
9
17
|
};
|
|
10
18
|
/**
|
|
11
19
|
* The contexts of verifiable storage data.
|
package/docs/changelog.md
CHANGED
|
@@ -1,179 +1,269 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Changelog
|
|
2
2
|
|
|
3
|
-
## [0.0.
|
|
3
|
+
## [0.0.3-next.10](https://github.com/iotaledger/twin-verifiable-storage/compare/verifiable-storage-models-v0.0.3-next.9...verifiable-storage-models-v0.0.3-next.10) (2026-05-12)
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
### Features
|
|
7
7
|
|
|
8
|
-
*
|
|
8
|
+
* typescript 6 update ([66823cf](https://github.com/iotaledger/twin-verifiable-storage/commit/66823cf7a6522622c889afdc49005d016e8574fe))
|
|
9
9
|
|
|
10
|
-
## [0.0.
|
|
10
|
+
## [0.0.3-next.9](https://github.com/iotaledger/twin-verifiable-storage/compare/verifiable-storage-models-v0.0.3-next.8...verifiable-storage-models-v0.0.3-next.9) (2026-05-08)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Miscellaneous Chores
|
|
14
|
+
|
|
15
|
+
* **verifiable-storage-models:** Synchronize repo versions
|
|
16
|
+
|
|
17
|
+
## [0.0.3-next.8](https://github.com/iotaledger/twin-verifiable-storage/compare/verifiable-storage-models-v0.0.3-next.7...verifiable-storage-models-v0.0.3-next.8) (2026-03-03)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Miscellaneous Chores
|
|
21
|
+
|
|
22
|
+
* **verifiable-storage-models:** Synchronize repo versions
|
|
23
|
+
|
|
24
|
+
## [0.0.3-next.7](https://github.com/iotaledger/twin-verifiable-storage/compare/verifiable-storage-models-v0.0.3-next.6...verifiable-storage-models-v0.0.3-next.7) (2026-02-25)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
### Features
|
|
28
|
+
|
|
29
|
+
* add context id features ([#40](https://github.com/iotaledger/twin-verifiable-storage/issues/40)) ([260b96a](https://github.com/iotaledger/twin-verifiable-storage/commit/260b96a8b7d1a26c6c415f2de12e09671ee70220))
|
|
30
|
+
* add support for allowlist ([#17](https://github.com/iotaledger/twin-verifiable-storage/issues/17)) ([9341ea6](https://github.com/iotaledger/twin-verifiable-storage/commit/9341ea6b95dfbf2a5dc70a53e5979d7d0e8b2de6))
|
|
31
|
+
* add validate-locales ([326384f](https://github.com/iotaledger/twin-verifiable-storage/commit/326384fe867604e7cd450460a6a56c6c7bdc8f98))
|
|
32
|
+
* context updates ([#44](https://github.com/iotaledger/twin-verifiable-storage/issues/44)) ([2f92558](https://github.com/iotaledger/twin-verifiable-storage/commit/2f9255835eddc9620268b6eb3bba723bc38a0591))
|
|
33
|
+
* eslint migration to flat config ([b0a0b85](https://github.com/iotaledger/twin-verifiable-storage/commit/b0a0b8585a77c1e541531d60b432916b9dc0867e))
|
|
34
|
+
* update allow list name case ([278a787](https://github.com/iotaledger/twin-verifiable-storage/commit/278a787e96864c95438f87adaac6f2fc8b6bebcd))
|
|
35
|
+
* update context and namespaces ([#42](https://github.com/iotaledger/twin-verifiable-storage/issues/42)) ([7863833](https://github.com/iotaledger/twin-verifiable-storage/commit/78638336c5cd7dce0c53aaf598aef603fbed7a9e))
|
|
36
|
+
* update dependencies ([a16a772](https://github.com/iotaledger/twin-verifiable-storage/commit/a16a77244cb1d312ea5ee74232bcdadd25f2b330))
|
|
37
|
+
* update descriptions ([696be4d](https://github.com/iotaledger/twin-verifiable-storage/commit/696be4d253183375d4c96e5b74eca0c814fe2fd1))
|
|
38
|
+
* update framework core ([efa612e](https://github.com/iotaledger/twin-verifiable-storage/commit/efa612e54dbe2d8f223f27ff9e315e08a2fed04b))
|
|
39
|
+
* use new dlt packages with latency fix ([#6](https://github.com/iotaledger/twin-verifiable-storage/issues/6)) ([d81c45b](https://github.com/iotaledger/twin-verifiable-storage/commit/d81c45bce035864a41bbd498815169d7257fbcb8))
|
|
40
|
+
* use shared store mechanism ([#8](https://github.com/iotaledger/twin-verifiable-storage/issues/8)) ([8c8ecb8](https://github.com/iotaledger/twin-verifiable-storage/commit/8c8ecb83d32431952c594ea23d37040991f5b4d3))
|
|
41
|
+
|
|
42
|
+
## [0.0.3-next.6](https://github.com/iotaledger/twin-verifiable-storage/compare/verifiable-storage-models-v0.0.3-next.5...verifiable-storage-models-v0.0.3-next.6) (2026-02-25)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
### Miscellaneous Chores
|
|
46
|
+
|
|
47
|
+
* **verifiable-storage-models:** Synchronize repo versions
|
|
48
|
+
|
|
49
|
+
## [0.0.3-next.5](https://github.com/iotaledger/twin-verifiable-storage/compare/verifiable-storage-models-v0.0.3-next.4...verifiable-storage-models-v0.0.3-next.5) (2026-02-09)
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
### Miscellaneous Chores
|
|
53
|
+
|
|
54
|
+
* **verifiable-storage-models:** Synchronize repo versions
|
|
55
|
+
|
|
56
|
+
## [0.0.3-next.4](https://github.com/iotaledger/twin-verifiable-storage/compare/verifiable-storage-models-v0.0.3-next.3...verifiable-storage-models-v0.0.3-next.4) (2026-02-09)
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
### Miscellaneous Chores
|
|
60
|
+
|
|
61
|
+
* **verifiable-storage-models:** Synchronize repo versions
|
|
62
|
+
|
|
63
|
+
## [0.0.3-next.3](https://github.com/iotaledger/twin-verifiable-storage/compare/verifiable-storage-models-v0.0.3-next.2...verifiable-storage-models-v0.0.3-next.3) (2026-01-21)
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
### Features
|
|
67
|
+
|
|
68
|
+
* context updates ([#44](https://github.com/iotaledger/twin-verifiable-storage/issues/44)) ([2f92558](https://github.com/iotaledger/twin-verifiable-storage/commit/2f9255835eddc9620268b6eb3bba723bc38a0591))
|
|
69
|
+
|
|
70
|
+
## [0.0.3-next.2](https://github.com/iotaledger/twin-verifiable-storage/compare/verifiable-storage-models-v0.0.3-next.1...verifiable-storage-models-v0.0.3-next.2) (2026-01-14)
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
### Features
|
|
74
|
+
|
|
75
|
+
* update context and namespaces ([#42](https://github.com/iotaledger/twin-verifiable-storage/issues/42)) ([7863833](https://github.com/iotaledger/twin-verifiable-storage/commit/78638336c5cd7dce0c53aaf598aef603fbed7a9e))
|
|
76
|
+
|
|
77
|
+
## [0.0.3-next.1](https://github.com/iotaledger/twin-verifiable-storage/compare/verifiable-storage-models-v0.0.3-next.0...verifiable-storage-models-v0.0.3-next.1) (2025-11-12)
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
### Features
|
|
81
|
+
|
|
82
|
+
* add context id features ([#40](https://github.com/iotaledger/twin-verifiable-storage/issues/40)) ([260b96a](https://github.com/iotaledger/twin-verifiable-storage/commit/260b96a8b7d1a26c6c415f2de12e09671ee70220))
|
|
83
|
+
* add support for allowlist ([#17](https://github.com/iotaledger/twin-verifiable-storage/issues/17)) ([9341ea6](https://github.com/iotaledger/twin-verifiable-storage/commit/9341ea6b95dfbf2a5dc70a53e5979d7d0e8b2de6))
|
|
84
|
+
* add validate-locales ([326384f](https://github.com/iotaledger/twin-verifiable-storage/commit/326384fe867604e7cd450460a6a56c6c7bdc8f98))
|
|
85
|
+
* eslint migration to flat config ([b0a0b85](https://github.com/iotaledger/twin-verifiable-storage/commit/b0a0b8585a77c1e541531d60b432916b9dc0867e))
|
|
86
|
+
* update allow list name case ([278a787](https://github.com/iotaledger/twin-verifiable-storage/commit/278a787e96864c95438f87adaac6f2fc8b6bebcd))
|
|
87
|
+
* update dependencies ([a16a772](https://github.com/iotaledger/twin-verifiable-storage/commit/a16a77244cb1d312ea5ee74232bcdadd25f2b330))
|
|
88
|
+
* update descriptions ([696be4d](https://github.com/iotaledger/twin-verifiable-storage/commit/696be4d253183375d4c96e5b74eca0c814fe2fd1))
|
|
89
|
+
* update framework core ([efa612e](https://github.com/iotaledger/twin-verifiable-storage/commit/efa612e54dbe2d8f223f27ff9e315e08a2fed04b))
|
|
90
|
+
* use new dlt packages with latency fix ([#6](https://github.com/iotaledger/twin-verifiable-storage/issues/6)) ([d81c45b](https://github.com/iotaledger/twin-verifiable-storage/commit/d81c45bce035864a41bbd498815169d7257fbcb8))
|
|
91
|
+
* use shared store mechanism ([#8](https://github.com/iotaledger/twin-verifiable-storage/issues/8)) ([8c8ecb8](https://github.com/iotaledger/twin-verifiable-storage/commit/8c8ecb83d32431952c594ea23d37040991f5b4d3))
|
|
92
|
+
|
|
93
|
+
## [0.0.2-next.6](https://github.com/iotaledger/twin-verifiable-storage/compare/verifiable-storage-models-v0.0.2-next.5...verifiable-storage-models-v0.0.2-next.6) (2025-10-09)
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
### Features
|
|
97
|
+
|
|
98
|
+
* add validate-locales ([326384f](https://github.com/iotaledger/twin-verifiable-storage/commit/326384fe867604e7cd450460a6a56c6c7bdc8f98))
|
|
99
|
+
|
|
100
|
+
## [0.0.2-next.5](https://github.com/iotaledger/twin-verifiable-storage/compare/verifiable-storage-models-v0.0.2-next.4...verifiable-storage-models-v0.0.2-next.5) (2025-09-26)
|
|
11
101
|
|
|
12
102
|
|
|
13
103
|
### Features
|
|
14
104
|
|
|
15
|
-
* eslint migration to flat config ([b0a0b85](https://github.com/
|
|
105
|
+
* eslint migration to flat config ([b0a0b85](https://github.com/iotaledger/twin-verifiable-storage/commit/b0a0b8585a77c1e541531d60b432916b9dc0867e))
|
|
16
106
|
|
|
17
|
-
## [0.0.2-next.4](https://github.com/
|
|
107
|
+
## [0.0.2-next.4](https://github.com/iotaledger/twin-verifiable-storage/compare/verifiable-storage-models-v0.0.2-next.3...verifiable-storage-models-v0.0.2-next.4) (2025-08-20)
|
|
18
108
|
|
|
19
109
|
|
|
20
110
|
### Features
|
|
21
111
|
|
|
22
|
-
* update framework core ([efa612e](https://github.com/
|
|
112
|
+
* update framework core ([efa612e](https://github.com/iotaledger/twin-verifiable-storage/commit/efa612e54dbe2d8f223f27ff9e315e08a2fed04b))
|
|
23
113
|
|
|
24
|
-
## [0.0.2-next.3](https://github.com/
|
|
114
|
+
## [0.0.2-next.3](https://github.com/iotaledger/twin-verifiable-storage/compare/verifiable-storage-models-v0.0.2-next.2...verifiable-storage-models-v0.0.2-next.3) (2025-07-28)
|
|
25
115
|
|
|
26
116
|
|
|
27
117
|
### Miscellaneous Chores
|
|
28
118
|
|
|
29
119
|
* **verifiable-storage-models:** Synchronize repo versions
|
|
30
120
|
|
|
31
|
-
## [0.0.2-next.2](https://github.com/
|
|
121
|
+
## [0.0.2-next.2](https://github.com/iotaledger/twin-verifiable-storage/compare/verifiable-storage-models-v0.0.2-next.1...verifiable-storage-models-v0.0.2-next.2) (2025-07-16)
|
|
32
122
|
|
|
33
123
|
|
|
34
124
|
### Features
|
|
35
125
|
|
|
36
|
-
* add support for allowlist ([#17](https://github.com/
|
|
37
|
-
* update allow list name case ([278a787](https://github.com/
|
|
38
|
-
* update dependencies ([a16a772](https://github.com/
|
|
39
|
-
* update descriptions ([696be4d](https://github.com/
|
|
40
|
-
* use new dlt packages with latency fix ([#6](https://github.com/
|
|
41
|
-
* use shared store mechanism ([#8](https://github.com/
|
|
126
|
+
* add support for allowlist ([#17](https://github.com/iotaledger/twin-verifiable-storage/issues/17)) ([9341ea6](https://github.com/iotaledger/twin-verifiable-storage/commit/9341ea6b95dfbf2a5dc70a53e5979d7d0e8b2de6))
|
|
127
|
+
* update allow list name case ([278a787](https://github.com/iotaledger/twin-verifiable-storage/commit/278a787e96864c95438f87adaac6f2fc8b6bebcd))
|
|
128
|
+
* update dependencies ([a16a772](https://github.com/iotaledger/twin-verifiable-storage/commit/a16a77244cb1d312ea5ee74232bcdadd25f2b330))
|
|
129
|
+
* update descriptions ([696be4d](https://github.com/iotaledger/twin-verifiable-storage/commit/696be4d253183375d4c96e5b74eca0c814fe2fd1))
|
|
130
|
+
* use new dlt packages with latency fix ([#6](https://github.com/iotaledger/twin-verifiable-storage/issues/6)) ([d81c45b](https://github.com/iotaledger/twin-verifiable-storage/commit/d81c45bce035864a41bbd498815169d7257fbcb8))
|
|
131
|
+
* use shared store mechanism ([#8](https://github.com/iotaledger/twin-verifiable-storage/issues/8)) ([8c8ecb8](https://github.com/iotaledger/twin-verifiable-storage/commit/8c8ecb83d32431952c594ea23d37040991f5b4d3))
|
|
42
132
|
|
|
43
|
-
## [0.0.2-next.0](https://github.com/
|
|
133
|
+
## [0.0.2-next.0](https://github.com/iotaledger/twin-verifiable-storage/compare/verifiable-storage-models-v0.0.2-next.0...verifiable-storage-models-v0.0.2-next.0) (2025-07-16)
|
|
44
134
|
|
|
45
135
|
|
|
46
136
|
### Features
|
|
47
137
|
|
|
48
|
-
* add support for allowlist ([#17](https://github.com/
|
|
49
|
-
* update allow list name case ([278a787](https://github.com/
|
|
50
|
-
* update dependencies ([a16a772](https://github.com/
|
|
51
|
-
* update descriptions ([696be4d](https://github.com/
|
|
52
|
-
* use new dlt packages with latency fix ([#6](https://github.com/
|
|
53
|
-
* use shared store mechanism ([#8](https://github.com/
|
|
138
|
+
* add support for allowlist ([#17](https://github.com/iotaledger/twin-verifiable-storage/issues/17)) ([9341ea6](https://github.com/iotaledger/twin-verifiable-storage/commit/9341ea6b95dfbf2a5dc70a53e5979d7d0e8b2de6))
|
|
139
|
+
* update allow list name case ([278a787](https://github.com/iotaledger/twin-verifiable-storage/commit/278a787e96864c95438f87adaac6f2fc8b6bebcd))
|
|
140
|
+
* update dependencies ([a16a772](https://github.com/iotaledger/twin-verifiable-storage/commit/a16a77244cb1d312ea5ee74232bcdadd25f2b330))
|
|
141
|
+
* update descriptions ([696be4d](https://github.com/iotaledger/twin-verifiable-storage/commit/696be4d253183375d4c96e5b74eca0c814fe2fd1))
|
|
142
|
+
* use new dlt packages with latency fix ([#6](https://github.com/iotaledger/twin-verifiable-storage/issues/6)) ([d81c45b](https://github.com/iotaledger/twin-verifiable-storage/commit/d81c45bce035864a41bbd498815169d7257fbcb8))
|
|
143
|
+
* use shared store mechanism ([#8](https://github.com/iotaledger/twin-verifiable-storage/issues/8)) ([8c8ecb8](https://github.com/iotaledger/twin-verifiable-storage/commit/8c8ecb83d32431952c594ea23d37040991f5b4d3))
|
|
54
144
|
|
|
55
145
|
## 0.0.1 (2025-07-09)
|
|
56
146
|
|
|
57
147
|
|
|
58
148
|
### Features
|
|
59
149
|
|
|
60
|
-
* release to production ([6ce6744](https://github.com/
|
|
150
|
+
* release to production ([6ce6744](https://github.com/iotaledger/twin-verifiable-storage/commit/6ce6744c124cca586c1ef0552624378d1207578d))
|
|
61
151
|
|
|
62
|
-
## [0.0.1-next.17](https://github.com/
|
|
152
|
+
## [0.0.1-next.17](https://github.com/iotaledger/twin-verifiable-storage/compare/verifiable-storage-models-v0.0.1-next.16...verifiable-storage-models-v0.0.1-next.17) (2025-06-25)
|
|
63
153
|
|
|
64
154
|
|
|
65
155
|
### Miscellaneous Chores
|
|
66
156
|
|
|
67
157
|
* **verifiable-storage-models:** Synchronize repo versions
|
|
68
158
|
|
|
69
|
-
## [0.0.1-next.16](https://github.com/
|
|
159
|
+
## [0.0.1-next.16](https://github.com/iotaledger/twin-verifiable-storage/compare/verifiable-storage-models-v0.0.1-next.15...verifiable-storage-models-v0.0.1-next.16) (2025-06-12)
|
|
70
160
|
|
|
71
161
|
|
|
72
162
|
### Features
|
|
73
163
|
|
|
74
|
-
* update dependencies ([a16a772](https://github.com/
|
|
164
|
+
* update dependencies ([a16a772](https://github.com/iotaledger/twin-verifiable-storage/commit/a16a77244cb1d312ea5ee74232bcdadd25f2b330))
|
|
75
165
|
|
|
76
|
-
## [0.0.1-next.15](https://github.com/
|
|
166
|
+
## [0.0.1-next.15](https://github.com/iotaledger/twin-verifiable-storage/compare/verifiable-storage-models-v0.0.1-next.14...verifiable-storage-models-v0.0.1-next.15) (2025-06-03)
|
|
77
167
|
|
|
78
168
|
|
|
79
169
|
### Miscellaneous Chores
|
|
80
170
|
|
|
81
171
|
* **verifiable-storage-models:** Synchronize repo versions
|
|
82
172
|
|
|
83
|
-
## [0.0.1-next.14](https://github.com/
|
|
173
|
+
## [0.0.1-next.14](https://github.com/iotaledger/twin-verifiable-storage/compare/verifiable-storage-models-v0.0.1-next.13...verifiable-storage-models-v0.0.1-next.14) (2025-05-28)
|
|
84
174
|
|
|
85
175
|
|
|
86
176
|
### Features
|
|
87
177
|
|
|
88
|
-
* add support for allowlist ([#17](https://github.com/
|
|
89
|
-
* update allow list name case ([278a787](https://github.com/
|
|
90
|
-
* update descriptions ([696be4d](https://github.com/
|
|
91
|
-
* use new dlt packages with latency fix ([#6](https://github.com/
|
|
92
|
-
* use shared store mechanism ([#8](https://github.com/
|
|
178
|
+
* add support for allowlist ([#17](https://github.com/iotaledger/twin-verifiable-storage/issues/17)) ([9341ea6](https://github.com/iotaledger/twin-verifiable-storage/commit/9341ea6b95dfbf2a5dc70a53e5979d7d0e8b2de6))
|
|
179
|
+
* update allow list name case ([278a787](https://github.com/iotaledger/twin-verifiable-storage/commit/278a787e96864c95438f87adaac6f2fc8b6bebcd))
|
|
180
|
+
* update descriptions ([696be4d](https://github.com/iotaledger/twin-verifiable-storage/commit/696be4d253183375d4c96e5b74eca0c814fe2fd1))
|
|
181
|
+
* use new dlt packages with latency fix ([#6](https://github.com/iotaledger/twin-verifiable-storage/issues/6)) ([d81c45b](https://github.com/iotaledger/twin-verifiable-storage/commit/d81c45bce035864a41bbd498815169d7257fbcb8))
|
|
182
|
+
* use shared store mechanism ([#8](https://github.com/iotaledger/twin-verifiable-storage/issues/8)) ([8c8ecb8](https://github.com/iotaledger/twin-verifiable-storage/commit/8c8ecb83d32431952c594ea23d37040991f5b4d3))
|
|
93
183
|
|
|
94
|
-
## [0.0.1-next.13](https://github.com/
|
|
184
|
+
## [0.0.1-next.13](https://github.com/iotaledger/twin-verifiable-storage/compare/verifiable-storage-models-v0.0.1-next.12...verifiable-storage-models-v0.0.1-next.13) (2025-05-28)
|
|
95
185
|
|
|
96
186
|
|
|
97
187
|
### Miscellaneous Chores
|
|
98
188
|
|
|
99
189
|
* **verifiable-storage-models:** Synchronize repo versions
|
|
100
190
|
|
|
101
|
-
## [0.0.1-next.12](https://github.com/
|
|
191
|
+
## [0.0.1-next.12](https://github.com/iotaledger/twin-verifiable-storage/compare/verifiable-storage-models-v0.0.1-next.11...verifiable-storage-models-v0.0.1-next.12) (2025-05-28)
|
|
102
192
|
|
|
103
193
|
|
|
104
194
|
### Features
|
|
105
195
|
|
|
106
|
-
* update allow list name case ([278a787](https://github.com/
|
|
196
|
+
* update allow list name case ([278a787](https://github.com/iotaledger/twin-verifiable-storage/commit/278a787e96864c95438f87adaac6f2fc8b6bebcd))
|
|
107
197
|
|
|
108
|
-
## [0.0.1-next.11](https://github.com/
|
|
198
|
+
## [0.0.1-next.11](https://github.com/iotaledger/twin-verifiable-storage/compare/verifiable-storage-models-v0.0.1-next.10...verifiable-storage-models-v0.0.1-next.11) (2025-05-22)
|
|
109
199
|
|
|
110
200
|
|
|
111
201
|
### Miscellaneous Chores
|
|
112
202
|
|
|
113
203
|
* **verifiable-storage-models:** Synchronize repo versions
|
|
114
204
|
|
|
115
|
-
## [0.0.1-next.10](https://github.com/
|
|
205
|
+
## [0.0.1-next.10](https://github.com/iotaledger/twin-verifiable-storage/compare/verifiable-storage-models-v0.0.1-next.9...verifiable-storage-models-v0.0.1-next.10) (2025-05-22)
|
|
116
206
|
|
|
117
207
|
|
|
118
208
|
### Features
|
|
119
209
|
|
|
120
|
-
* add support for allowlist ([#17](https://github.com/
|
|
210
|
+
* add support for allowlist ([#17](https://github.com/iotaledger/twin-verifiable-storage/issues/17)) ([9341ea6](https://github.com/iotaledger/twin-verifiable-storage/commit/9341ea6b95dfbf2a5dc70a53e5979d7d0e8b2de6))
|
|
121
211
|
|
|
122
|
-
## [0.0.1-next.9](https://github.com/
|
|
212
|
+
## [0.0.1-next.9](https://github.com/iotaledger/twin-verifiable-storage/compare/verifiable-storage-models-v0.0.1-next.8...verifiable-storage-models-v0.0.1-next.9) (2025-05-06)
|
|
123
213
|
|
|
124
214
|
|
|
125
215
|
### Miscellaneous Chores
|
|
126
216
|
|
|
127
217
|
* **verifiable-storage-models:** Synchronize repo versions
|
|
128
218
|
|
|
129
|
-
## [0.0.1-next.8](https://github.com/
|
|
219
|
+
## [0.0.1-next.8](https://github.com/iotaledger/twin-verifiable-storage/compare/verifiable-storage-models-v0.0.1-next.7...verifiable-storage-models-v0.0.1-next.8) (2025-04-24)
|
|
130
220
|
|
|
131
221
|
|
|
132
222
|
### Miscellaneous Chores
|
|
133
223
|
|
|
134
224
|
* **verifiable-storage-models:** Synchronize repo versions
|
|
135
225
|
|
|
136
|
-
## [0.0.1-next.7](https://github.com/
|
|
226
|
+
## [0.0.1-next.7](https://github.com/iotaledger/twin-verifiable-storage/compare/verifiable-storage-models-v0.0.1-next.6...verifiable-storage-models-v0.0.1-next.7) (2025-04-23)
|
|
137
227
|
|
|
138
228
|
|
|
139
229
|
### Miscellaneous Chores
|
|
140
230
|
|
|
141
231
|
* **verifiable-storage-models:** Synchronize repo versions
|
|
142
232
|
|
|
143
|
-
## [0.0.1-next.6](https://github.com/
|
|
233
|
+
## [0.0.1-next.6](https://github.com/iotaledger/twin-verifiable-storage/compare/verifiable-storage-models-v0.0.1-next.5...verifiable-storage-models-v0.0.1-next.6) (2025-04-23)
|
|
144
234
|
|
|
145
235
|
|
|
146
236
|
### Miscellaneous Chores
|
|
147
237
|
|
|
148
238
|
* **verifiable-storage-models:** Synchronize repo versions
|
|
149
239
|
|
|
150
|
-
## [0.0.1-next.5](https://github.com/
|
|
240
|
+
## [0.0.1-next.5](https://github.com/iotaledger/twin-verifiable-storage/compare/verifiable-storage-models-v0.0.1-next.4...verifiable-storage-models-v0.0.1-next.5) (2025-04-23)
|
|
151
241
|
|
|
152
242
|
|
|
153
243
|
### Miscellaneous Chores
|
|
154
244
|
|
|
155
245
|
* **verifiable-storage-models:** Synchronize repo versions
|
|
156
246
|
|
|
157
|
-
## [0.0.1-next.4](https://github.com/
|
|
247
|
+
## [0.0.1-next.4](https://github.com/iotaledger/twin-verifiable-storage/compare/verifiable-storage-models-v0.0.1-next.3...verifiable-storage-models-v0.0.1-next.4) (2025-04-17)
|
|
158
248
|
|
|
159
249
|
|
|
160
250
|
### Features
|
|
161
251
|
|
|
162
|
-
* use shared store mechanism ([#8](https://github.com/
|
|
252
|
+
* use shared store mechanism ([#8](https://github.com/iotaledger/twin-verifiable-storage/issues/8)) ([8c8ecb8](https://github.com/iotaledger/twin-verifiable-storage/commit/8c8ecb83d32431952c594ea23d37040991f5b4d3))
|
|
163
253
|
|
|
164
|
-
## [0.0.1-next.3](https://github.com/
|
|
254
|
+
## [0.0.1-next.3](https://github.com/iotaledger/twin-verifiable-storage/compare/verifiable-storage-models-v0.0.1-next.2...verifiable-storage-models-v0.0.1-next.3) (2025-04-17)
|
|
165
255
|
|
|
166
256
|
|
|
167
257
|
### Features
|
|
168
258
|
|
|
169
|
-
* use new dlt packages with latency fix ([#6](https://github.com/
|
|
259
|
+
* use new dlt packages with latency fix ([#6](https://github.com/iotaledger/twin-verifiable-storage/issues/6)) ([d81c45b](https://github.com/iotaledger/twin-verifiable-storage/commit/d81c45bce035864a41bbd498815169d7257fbcb8))
|
|
170
260
|
|
|
171
|
-
## [0.0.1-next.2](https://github.com/
|
|
261
|
+
## [0.0.1-next.2](https://github.com/iotaledger/twin-verifiable-storage/compare/verifiable-storage-models-v0.0.1-next.1...verifiable-storage-models-v0.0.1-next.2) (2025-03-28)
|
|
172
262
|
|
|
173
263
|
|
|
174
264
|
### Features
|
|
175
265
|
|
|
176
|
-
* update descriptions ([696be4d](https://github.com/
|
|
266
|
+
* update descriptions ([696be4d](https://github.com/iotaledger/twin-verifiable-storage/commit/696be4d253183375d4c96e5b74eca0c814fe2fd1))
|
|
177
267
|
|
|
178
268
|
## v0.0.1-next.1
|
|
179
269
|
|
package/docs/examples.md
CHANGED
|
@@ -1 +1,51 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Verifiable Storage Models Examples
|
|
2
|
+
|
|
3
|
+
This page provides TypeScript examples for the verifiable storage models, including how to use the main interfaces, types, and the connector factory. These examples are intended to help you understand the structure and usage of the verifiable storage model layer.
|
|
4
|
+
|
|
5
|
+
## VerifiableStorageConnectorFactory
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
import { VerifiableStorageConnectorFactory } from '@twin.org/verifiable-storage-models';
|
|
9
|
+
|
|
10
|
+
// List available connector names
|
|
11
|
+
const connectorNames = VerifiableStorageConnectorFactory.names();
|
|
12
|
+
console.log(connectorNames); // Outputs an array of connector names
|
|
13
|
+
|
|
14
|
+
// Get a connector instance (example, replace 'entity-storage' with your connector name)
|
|
15
|
+
const connector = VerifiableStorageConnectorFactory.get('entity-storage');
|
|
16
|
+
console.log(connector.className()); // Outputs the class name of the connector
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## IVerifiableStorageConnector
|
|
20
|
+
|
|
21
|
+
```typescript
|
|
22
|
+
import type { IVerifiableStorageConnector } from '@twin.org/verifiable-storage-models';
|
|
23
|
+
|
|
24
|
+
async function createAndGetItem(connector: IVerifiableStorageConnector) {
|
|
25
|
+
const controllerIdentity = 'did:example:controller1';
|
|
26
|
+
const data = new TextEncoder().encode('Sample data');
|
|
27
|
+
const allowList = ['did:example:controller1'];
|
|
28
|
+
const { id, receipt } = await connector.create(controllerIdentity, data, allowList, {
|
|
29
|
+
maxAllowListSize: 5
|
|
30
|
+
});
|
|
31
|
+
console.log(id); // Outputs the new item id
|
|
32
|
+
const item = await connector.get(id);
|
|
33
|
+
if (item.data) {
|
|
34
|
+
const decoded = new TextDecoder().decode(item.data);
|
|
35
|
+
console.log(decoded); // Sample data
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## IVerifiableStorageComponent
|
|
41
|
+
|
|
42
|
+
```typescript
|
|
43
|
+
import type { IVerifiableStorageComponent } from '@twin.org/verifiable-storage-models';
|
|
44
|
+
|
|
45
|
+
async function createItem(component: IVerifiableStorageComponent) {
|
|
46
|
+
const data = new TextEncoder().encode('Component data');
|
|
47
|
+
const allowList = ['did:example:controller1'];
|
|
48
|
+
const { id, receipt } = await component.create(data, allowList, { maxAllowListSize: 3 });
|
|
49
|
+
console.log(id); // Outputs the new item id
|
|
50
|
+
}
|
|
51
|
+
```
|
|
@@ -6,19 +6,11 @@ Interface describing a Verifiable Storage component.
|
|
|
6
6
|
|
|
7
7
|
- `IComponent`
|
|
8
8
|
|
|
9
|
-
## Indexable
|
|
10
|
-
|
|
11
|
-
\[`key`: `string`\]: `any`
|
|
12
|
-
|
|
13
|
-
All methods are optional, so we introduce an index signature to allow
|
|
14
|
-
any additional properties or methods, which removes the TypeScript error where
|
|
15
|
-
the class has no properties in common with the type.
|
|
16
|
-
|
|
17
9
|
## Methods
|
|
18
10
|
|
|
19
|
-
### create()
|
|
11
|
+
### create() {#create}
|
|
20
12
|
|
|
21
|
-
> **create**(`data`, `allowList?`, `options?`, `
|
|
13
|
+
> **create**(`data`, `allowList?`, `options?`, `namespace?`, `controller?`): `Promise`\<\{ `id`: `string`; `receipt`: `IJsonLdNodeObject`; \}\>
|
|
22
14
|
|
|
23
15
|
Create an item in verifiable storage.
|
|
24
16
|
|
|
@@ -46,17 +38,17 @@ Additional options for creating the item.
|
|
|
46
38
|
|
|
47
39
|
The maximum size of the allow list.
|
|
48
40
|
|
|
49
|
-
#####
|
|
41
|
+
##### namespace?
|
|
50
42
|
|
|
51
43
|
`string`
|
|
52
44
|
|
|
53
|
-
The
|
|
45
|
+
The namespace to store the item in.
|
|
54
46
|
|
|
55
|
-
#####
|
|
47
|
+
##### controller?
|
|
56
48
|
|
|
57
49
|
`string`
|
|
58
50
|
|
|
59
|
-
The
|
|
51
|
+
The identity of the controller to access the vault keys.
|
|
60
52
|
|
|
61
53
|
#### Returns
|
|
62
54
|
|
|
@@ -66,9 +58,9 @@ The id of the stored verifiable item in urn format and the receipt.
|
|
|
66
58
|
|
|
67
59
|
***
|
|
68
60
|
|
|
69
|
-
### update()
|
|
61
|
+
### update() {#update}
|
|
70
62
|
|
|
71
|
-
> **update**(`id`, `data?`, `allowList?`, `
|
|
63
|
+
> **update**(`id`, `data?`, `allowList?`, `controller?`): `Promise`\<`IJsonLdNodeObject`\>
|
|
72
64
|
|
|
73
65
|
Update an item in verifiable storage.
|
|
74
66
|
|
|
@@ -92,11 +84,11 @@ The data to store, optional if updating the allow list.
|
|
|
92
84
|
|
|
93
85
|
Updated list of identities that are allowed to modify the item.
|
|
94
86
|
|
|
95
|
-
#####
|
|
87
|
+
##### controller?
|
|
96
88
|
|
|
97
89
|
`string`
|
|
98
90
|
|
|
99
|
-
The identity of the
|
|
91
|
+
The identity of the controller to access the vault keys.
|
|
100
92
|
|
|
101
93
|
#### Returns
|
|
102
94
|
|
|
@@ -106,7 +98,7 @@ The updated receipt.
|
|
|
106
98
|
|
|
107
99
|
***
|
|
108
100
|
|
|
109
|
-
### get()
|
|
101
|
+
### get() {#get}
|
|
110
102
|
|
|
111
103
|
> **get**(`id`, `options?`): `Promise`\<\{ `data?`: `Uint8Array`\<`ArrayBufferLike`\>; `receipt`: `IJsonLdNodeObject`; `allowList?`: `string`[]; \}\>
|
|
112
104
|
|
|
@@ -144,9 +136,9 @@ The data for the item and the receipt.
|
|
|
144
136
|
|
|
145
137
|
***
|
|
146
138
|
|
|
147
|
-
### remove()
|
|
139
|
+
### remove() {#remove}
|
|
148
140
|
|
|
149
|
-
> **remove**(`id`, `
|
|
141
|
+
> **remove**(`id`, `controller?`): `Promise`\<`void`\>
|
|
150
142
|
|
|
151
143
|
Remove the item from verifiable storage.
|
|
152
144
|
|
|
@@ -158,7 +150,7 @@ Remove the item from verifiable storage.
|
|
|
158
150
|
|
|
159
151
|
The id of the verifiable item to remove in urn format.
|
|
160
152
|
|
|
161
|
-
#####
|
|
153
|
+
##### controller?
|
|
162
154
|
|
|
163
155
|
`string`
|
|
164
156
|
|
|
@@ -6,25 +6,17 @@ Interface describing a verifiable storage connector.
|
|
|
6
6
|
|
|
7
7
|
- `IComponent`
|
|
8
8
|
|
|
9
|
-
## Indexable
|
|
10
|
-
|
|
11
|
-
\[`key`: `string`\]: `any`
|
|
12
|
-
|
|
13
|
-
All methods are optional, so we introduce an index signature to allow
|
|
14
|
-
any additional properties or methods, which removes the TypeScript error where
|
|
15
|
-
the class has no properties in common with the type.
|
|
16
|
-
|
|
17
9
|
## Methods
|
|
18
10
|
|
|
19
|
-
### create()
|
|
11
|
+
### create() {#create}
|
|
20
12
|
|
|
21
|
-
> **create**(`
|
|
13
|
+
> **create**(`controllerIdentity`, `data`, `allowList?`, `options?`): `Promise`\<\{ `id`: `string`; `receipt`: `IJsonLdNodeObject`; \}\>
|
|
22
14
|
|
|
23
15
|
Create an item in verifiable storage.
|
|
24
16
|
|
|
25
17
|
#### Parameters
|
|
26
18
|
|
|
27
|
-
#####
|
|
19
|
+
##### controllerIdentity
|
|
28
20
|
|
|
29
21
|
`string`
|
|
30
22
|
|
|
@@ -60,15 +52,15 @@ The id of the stored verifiable item in urn format and the receipt.
|
|
|
60
52
|
|
|
61
53
|
***
|
|
62
54
|
|
|
63
|
-
### update()
|
|
55
|
+
### update() {#update}
|
|
64
56
|
|
|
65
|
-
> **update**(`
|
|
57
|
+
> **update**(`controllerIdentity`, `id`, `data?`, `allowList?`): `Promise`\<`IJsonLdNodeObject`\>
|
|
66
58
|
|
|
67
59
|
Update an item in verifiable storage.
|
|
68
60
|
|
|
69
61
|
#### Parameters
|
|
70
62
|
|
|
71
|
-
#####
|
|
63
|
+
##### controllerIdentity
|
|
72
64
|
|
|
73
65
|
`string`
|
|
74
66
|
|
|
@@ -100,7 +92,7 @@ The updated receipt.
|
|
|
100
92
|
|
|
101
93
|
***
|
|
102
94
|
|
|
103
|
-
### get()
|
|
95
|
+
### get() {#get}
|
|
104
96
|
|
|
105
97
|
> **get**(`id`, `options?`): `Promise`\<\{ `data?`: `Uint8Array`\<`ArrayBufferLike`\>; `receipt`: `IJsonLdNodeObject`; `allowList?`: `string`[]; \}\>
|
|
106
98
|
|
|
@@ -138,15 +130,15 @@ The data for the item, the receipt and the allow list.
|
|
|
138
130
|
|
|
139
131
|
***
|
|
140
132
|
|
|
141
|
-
### remove()
|
|
133
|
+
### remove() {#remove}
|
|
142
134
|
|
|
143
|
-
> **remove**(`
|
|
135
|
+
> **remove**(`controllerIdentity`, `id`): `Promise`\<`void`\>
|
|
144
136
|
|
|
145
137
|
Remove the item from verifiable storage.
|
|
146
138
|
|
|
147
139
|
#### Parameters
|
|
148
140
|
|
|
149
|
-
#####
|
|
141
|
+
##### controllerIdentity
|
|
150
142
|
|
|
151
143
|
`string`
|
|
152
144
|
|
|
@@ -4,7 +4,7 @@ Store the data and return the verifiable storage item id.
|
|
|
4
4
|
|
|
5
5
|
## Properties
|
|
6
6
|
|
|
7
|
-
### body
|
|
7
|
+
### body {#body}
|
|
8
8
|
|
|
9
9
|
> **body**: `object`
|
|
10
10
|
|
|
@@ -18,13 +18,13 @@ The data for the verifiable storage item, this is a string serialized as base64.
|
|
|
18
18
|
|
|
19
19
|
#### allowList?
|
|
20
20
|
|
|
21
|
-
> `optional` **allowList
|
|
21
|
+
> `optional` **allowList?**: `string`[]
|
|
22
22
|
|
|
23
23
|
The list of identities that are allowed to modify the item.
|
|
24
24
|
|
|
25
25
|
#### maxAllowListSize?
|
|
26
26
|
|
|
27
|
-
> `optional` **maxAllowListSize
|
|
27
|
+
> `optional` **maxAllowListSize?**: `number`
|
|
28
28
|
|
|
29
29
|
The maximum size of the allow list.
|
|
30
30
|
|
|
@@ -36,6 +36,6 @@ The maximum size of the allow list.
|
|
|
36
36
|
|
|
37
37
|
#### namespace?
|
|
38
38
|
|
|
39
|
-
> `optional` **namespace
|
|
39
|
+
> `optional` **namespace?**: `string`
|
|
40
40
|
|
|
41
41
|
The namespace of the connector to use for the verifiable storage item, defaults to component configured namespace.
|
|
@@ -4,7 +4,7 @@ Get the verifiable storage item.
|
|
|
4
4
|
|
|
5
5
|
## Properties
|
|
6
6
|
|
|
7
|
-
### pathParams
|
|
7
|
+
### pathParams {#pathparams}
|
|
8
8
|
|
|
9
9
|
> **pathParams**: `object`
|
|
10
10
|
|
|
@@ -18,15 +18,15 @@ The id of the verifiable storage item to resolve.
|
|
|
18
18
|
|
|
19
19
|
***
|
|
20
20
|
|
|
21
|
-
### body?
|
|
21
|
+
### body? {#body}
|
|
22
22
|
|
|
23
|
-
> `optional` **body
|
|
23
|
+
> `optional` **body?**: `object`
|
|
24
24
|
|
|
25
25
|
The body optional param.
|
|
26
26
|
|
|
27
27
|
#### includeData?
|
|
28
28
|
|
|
29
|
-
> `optional` **includeData
|
|
29
|
+
> `optional` **includeData?**: `boolean`
|
|
30
30
|
|
|
31
31
|
The flag to include the data.
|
|
32
32
|
|
|
@@ -38,7 +38,7 @@ true
|
|
|
38
38
|
|
|
39
39
|
#### includeAllowList?
|
|
40
40
|
|
|
41
|
-
> `optional` **includeAllowList
|
|
41
|
+
> `optional` **includeAllowList?**: `boolean`
|
|
42
42
|
|
|
43
43
|
The flag to include the allow list.
|
|
44
44
|
|
|
@@ -4,7 +4,7 @@ Response to getting the verifiable storage item.
|
|
|
4
4
|
|
|
5
5
|
## Properties
|
|
6
6
|
|
|
7
|
-
### body
|
|
7
|
+
### body {#body}
|
|
8
8
|
|
|
9
9
|
> **body**: `object`
|
|
10
10
|
|
|
@@ -18,12 +18,12 @@ The receipt associated to the verifiable storage item.
|
|
|
18
18
|
|
|
19
19
|
#### data?
|
|
20
20
|
|
|
21
|
-
> `optional` **data
|
|
21
|
+
> `optional` **data?**: `string`
|
|
22
22
|
|
|
23
23
|
The data of the verifiable storage item, this is a string serialized as base64.
|
|
24
24
|
|
|
25
25
|
#### allowList?
|
|
26
26
|
|
|
27
|
-
> `optional` **allowList
|
|
27
|
+
> `optional` **allowList?**: `string`[]
|
|
28
28
|
|
|
29
29
|
The list of identities that are allowed to modify the item.
|
|
@@ -4,7 +4,7 @@ Update the data and return the receipt.
|
|
|
4
4
|
|
|
5
5
|
## Properties
|
|
6
6
|
|
|
7
|
-
### pathParams
|
|
7
|
+
### pathParams {#pathparams}
|
|
8
8
|
|
|
9
9
|
> **pathParams**: `object`
|
|
10
10
|
|
|
@@ -18,7 +18,7 @@ The id of the verifiable storage item to update.
|
|
|
18
18
|
|
|
19
19
|
***
|
|
20
20
|
|
|
21
|
-
### body
|
|
21
|
+
### body {#body}
|
|
22
22
|
|
|
23
23
|
> **body**: `object`
|
|
24
24
|
|
|
@@ -26,12 +26,12 @@ The data to be updated.
|
|
|
26
26
|
|
|
27
27
|
#### data?
|
|
28
28
|
|
|
29
|
-
> `optional` **data
|
|
29
|
+
> `optional` **data?**: `string`
|
|
30
30
|
|
|
31
31
|
The data which is a string serialized as base64, leave empty if just updating the allow list.
|
|
32
32
|
|
|
33
33
|
#### allowList?
|
|
34
34
|
|
|
35
|
-
> `optional` **allowList
|
|
35
|
+
> `optional` **allowList?**: `string`[]
|
|
36
36
|
|
|
37
37
|
An updated list of identities that are allowed to modify the item, send an empty list to remove all entries.
|
|
@@ -6,8 +6,20 @@ The contexts of verifiable storage data.
|
|
|
6
6
|
|
|
7
7
|
## Type Declaration
|
|
8
8
|
|
|
9
|
-
###
|
|
9
|
+
### Namespace {#namespace}
|
|
10
10
|
|
|
11
|
-
> `readonly` **
|
|
11
|
+
> `readonly` **Namespace**: `"https://schema.twindev.org/verifiable-storage/"` = `"https://schema.twindev.org/verifiable-storage/"`
|
|
12
12
|
|
|
13
|
-
The
|
|
13
|
+
The canonical RDF namespace URI for Verifiable Storage.
|
|
14
|
+
|
|
15
|
+
### Context {#context}
|
|
16
|
+
|
|
17
|
+
> `readonly` **Context**: `"https://schema.twindev.org/verifiable-storage/"` = `"https://schema.twindev.org/verifiable-storage/"`
|
|
18
|
+
|
|
19
|
+
The value to use in context for Verifiable Storage.
|
|
20
|
+
|
|
21
|
+
### JsonLdContext {#jsonldcontext}
|
|
22
|
+
|
|
23
|
+
> `readonly` **JsonLdContext**: `"https://schema.twindev.org/verifiable-storage/types.jsonld"` = `"https://schema.twindev.org/verifiable-storage/types.jsonld"`
|
|
24
|
+
|
|
25
|
+
The JSON-LD Context URL for Verifiable Storage.
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/verifiable-storage-models",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.0.3-next.10",
|
|
4
|
+
"description": "Shared interfaces, API payload models, and connector factory contracts for verifiable storage",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
|
-
"url": "git+https://github.com/
|
|
7
|
+
"url": "git+https://github.com/iotaledger/verifiable-storage.git",
|
|
8
8
|
"directory": "packages/verifiable-storage-models"
|
|
9
9
|
},
|
|
10
10
|
"author": "martyn.janes@iota.org",
|
|
@@ -20,19 +20,17 @@
|
|
|
20
20
|
"@twin.org/nameof": "next",
|
|
21
21
|
"@twin.org/web": "next"
|
|
22
22
|
},
|
|
23
|
-
"main": "./dist/
|
|
24
|
-
"module": "./dist/esm/index.mjs",
|
|
23
|
+
"main": "./dist/es/index.js",
|
|
25
24
|
"types": "./dist/types/index.d.ts",
|
|
26
25
|
"exports": {
|
|
27
26
|
".": {
|
|
28
27
|
"types": "./dist/types/index.d.ts",
|
|
29
|
-
"
|
|
30
|
-
"
|
|
28
|
+
"import": "./dist/es/index.js",
|
|
29
|
+
"default": "./dist/es/index.js"
|
|
31
30
|
}
|
|
32
31
|
},
|
|
33
32
|
"files": [
|
|
34
|
-
"dist/
|
|
35
|
-
"dist/esm",
|
|
33
|
+
"dist/es",
|
|
36
34
|
"dist/types",
|
|
37
35
|
"locales",
|
|
38
36
|
"docs"
|
|
@@ -53,7 +51,7 @@
|
|
|
53
51
|
"schemas"
|
|
54
52
|
],
|
|
55
53
|
"bugs": {
|
|
56
|
-
"url": "git+https://github.com/
|
|
54
|
+
"url": "git+https://github.com/iotaledger/verifiable-storage/issues"
|
|
57
55
|
},
|
|
58
56
|
"homepage": "https://twindev.org"
|
|
59
57
|
}
|
package/dist/cjs/index.cjs
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var core = require('@twin.org/core');
|
|
4
|
-
|
|
5
|
-
// Copyright 2024 IOTA Stiftung.
|
|
6
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
7
|
-
/**
|
|
8
|
-
* Factory for creating verifiable storage connectors.
|
|
9
|
-
*/
|
|
10
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
11
|
-
const VerifiableStorageConnectorFactory = core.Factory.createFactory("verifiable-storage-connector");
|
|
12
|
-
|
|
13
|
-
// Copyright 2024 IOTA Stiftung.
|
|
14
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
15
|
-
/**
|
|
16
|
-
* The contexts of verifiable storage data.
|
|
17
|
-
*/
|
|
18
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
19
|
-
const VerifiableStorageContexts = {
|
|
20
|
-
/**
|
|
21
|
-
* The context root for the verifiable storage types.
|
|
22
|
-
*/
|
|
23
|
-
ContextRoot: "https://schema.twindev.org/verifiable-storage/"
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
exports.VerifiableStorageConnectorFactory = VerifiableStorageConnectorFactory;
|
|
27
|
-
exports.VerifiableStorageContexts = VerifiableStorageContexts;
|
package/dist/esm/index.mjs
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { Factory } from '@twin.org/core';
|
|
2
|
-
|
|
3
|
-
// Copyright 2024 IOTA Stiftung.
|
|
4
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
5
|
-
/**
|
|
6
|
-
* Factory for creating verifiable storage connectors.
|
|
7
|
-
*/
|
|
8
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
9
|
-
const VerifiableStorageConnectorFactory = Factory.createFactory("verifiable-storage-connector");
|
|
10
|
-
|
|
11
|
-
// Copyright 2024 IOTA Stiftung.
|
|
12
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
13
|
-
/**
|
|
14
|
-
* The contexts of verifiable storage data.
|
|
15
|
-
*/
|
|
16
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
17
|
-
const VerifiableStorageContexts = {
|
|
18
|
-
/**
|
|
19
|
-
* The context root for the verifiable storage types.
|
|
20
|
-
*/
|
|
21
|
-
ContextRoot: "https://schema.twindev.org/verifiable-storage/"
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export { VerifiableStorageConnectorFactory, VerifiableStorageContexts };
|