@twin.org/verifiable-storage-models 0.0.2-next.5 → 0.0.3-next.1

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.
Files changed (34) hide show
  1. package/dist/es/factories/verifiableStorageConnectorFactory.js +9 -0
  2. package/dist/es/factories/verifiableStorageConnectorFactory.js.map +1 -0
  3. package/dist/es/index.js +14 -0
  4. package/dist/es/index.js.map +1 -0
  5. package/dist/es/models/IVerifiableStorageComponent.js +2 -0
  6. package/dist/es/models/IVerifiableStorageComponent.js.map +1 -0
  7. package/dist/es/models/IVerifiableStorageConnector.js +2 -0
  8. package/dist/es/models/IVerifiableStorageConnector.js.map +1 -0
  9. package/dist/es/models/api/IVerifiableStorageCreateRequest.js +4 -0
  10. package/dist/es/models/api/IVerifiableStorageCreateRequest.js.map +1 -0
  11. package/dist/es/models/api/IVerifiableStorageCreateResponse.js +2 -0
  12. package/dist/es/models/api/IVerifiableStorageCreateResponse.js.map +1 -0
  13. package/dist/es/models/api/IVerifiableStorageGetRequest.js +4 -0
  14. package/dist/es/models/api/IVerifiableStorageGetRequest.js.map +1 -0
  15. package/dist/es/models/api/IVerifiableStorageGetResponse.js +2 -0
  16. package/dist/es/models/api/IVerifiableStorageGetResponse.js.map +1 -0
  17. package/dist/es/models/api/IVerifiableStorageRemoveRequest.js +4 -0
  18. package/dist/es/models/api/IVerifiableStorageRemoveRequest.js.map +1 -0
  19. package/dist/es/models/api/IVerifiableStorageUpdateRequest.js +4 -0
  20. package/dist/es/models/api/IVerifiableStorageUpdateRequest.js.map +1 -0
  21. package/dist/es/models/api/IVerifiableStorageUpdateResponse.js +2 -0
  22. package/dist/es/models/api/IVerifiableStorageUpdateResponse.js.map +1 -0
  23. package/dist/es/models/verifiableStorageContexts.js +13 -0
  24. package/dist/es/models/verifiableStorageContexts.js.map +1 -0
  25. package/dist/types/factories/verifiableStorageConnectorFactory.d.ts +1 -1
  26. package/dist/types/index.d.ts +11 -11
  27. package/dist/types/models/IVerifiableStorageComponent.d.ts +6 -6
  28. package/dist/types/models/IVerifiableStorageConnector.d.ts +6 -6
  29. package/docs/changelog.md +23 -0
  30. package/docs/reference/interfaces/IVerifiableStorageComponent.md +10 -10
  31. package/docs/reference/interfaces/IVerifiableStorageConnector.md +6 -6
  32. package/package.json +25 -8
  33. package/dist/cjs/index.cjs +0 -27
  34. package/dist/esm/index.mjs +0 -24
@@ -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"]}
@@ -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,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IVerifiableStorageComponent.js.map
@@ -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,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IVerifiableStorageConnector.js.map
@@ -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,4 @@
1
+ // Copyright 2024 IOTA Stiftung.
2
+ // SPDX-License-Identifier: Apache-2.0.
3
+ export {};
4
+ //# sourceMappingURL=IVerifiableStorageCreateRequest.js.map
@@ -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,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IVerifiableStorageCreateResponse.js.map
@@ -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,4 @@
1
+ // Copyright 2024 IOTA Stiftung.
2
+ // SPDX-License-Identifier: Apache-2.0.
3
+ export {};
4
+ //# sourceMappingURL=IVerifiableStorageGetRequest.js.map
@@ -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,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IVerifiableStorageGetResponse.js.map
@@ -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,4 @@
1
+ // Copyright 2024 IOTA Stiftung.
2
+ // SPDX-License-Identifier: Apache-2.0.
3
+ export {};
4
+ //# sourceMappingURL=IVerifiableStorageRemoveRequest.js.map
@@ -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,4 @@
1
+ // Copyright 2024 IOTA Stiftung.
2
+ // SPDX-License-Identifier: Apache-2.0.
3
+ export {};
4
+ //# sourceMappingURL=IVerifiableStorageUpdateRequest.js.map
@@ -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,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IVerifiableStorageUpdateResponse.js.map
@@ -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,13 @@
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 context root for the verifiable storage types.
10
+ */
11
+ ContextRoot: "https://schema.twindev.org/verifiable-storage/"
12
+ };
13
+ //# 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,WAAW,EAAE,gDAAgD;CACpD,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 context root for the verifiable storage types.\n\t */\n\tContextRoot: \"https://schema.twindev.org/verifiable-storage/\"\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
  */
@@ -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
- }, identity?: string, namespace?: string): Promise<{
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 identity The identity of the user to access the vault keys.
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[], identity?: string): Promise<IJsonLdNodeObject>;
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 controllerIdentity The identity of the controller.
51
+ * @param controller The identity of the controller.
52
52
  * @returns Nothing.
53
53
  */
54
- remove(id: string, controllerIdentity?: string): Promise<void>;
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 controller The identity of the user to access the vault keys.
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(controller: string, data: Uint8Array, allowList?: string[], options?: {
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 controller The identity of the user to access the vault keys.
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(controller: string, id: string, data?: Uint8Array, allowList?: string[]): Promise<IJsonLdNodeObject>;
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 controller The identity of the user to access the vault keys.
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(controller: string, id: string): Promise<void>;
53
+ remove(controllerIdentity: string, id: string): Promise<void>;
54
54
  }
package/docs/changelog.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # @twin.org/verifiable-storage-models - Changelog
2
2
 
3
+ ## [0.0.3-next.1](https://github.com/twinfoundation/verifiable-storage/compare/verifiable-storage-models-v0.0.3-next.0...verifiable-storage-models-v0.0.3-next.1) (2025-11-12)
4
+
5
+
6
+ ### Features
7
+
8
+ * add context id features ([#40](https://github.com/twinfoundation/verifiable-storage/issues/40)) ([260b96a](https://github.com/twinfoundation/verifiable-storage/commit/260b96a8b7d1a26c6c415f2de12e09671ee70220))
9
+ * add support for allowlist ([#17](https://github.com/twinfoundation/verifiable-storage/issues/17)) ([9341ea6](https://github.com/twinfoundation/verifiable-storage/commit/9341ea6b95dfbf2a5dc70a53e5979d7d0e8b2de6))
10
+ * add validate-locales ([326384f](https://github.com/twinfoundation/verifiable-storage/commit/326384fe867604e7cd450460a6a56c6c7bdc8f98))
11
+ * eslint migration to flat config ([b0a0b85](https://github.com/twinfoundation/verifiable-storage/commit/b0a0b8585a77c1e541531d60b432916b9dc0867e))
12
+ * update allow list name case ([278a787](https://github.com/twinfoundation/verifiable-storage/commit/278a787e96864c95438f87adaac6f2fc8b6bebcd))
13
+ * update dependencies ([a16a772](https://github.com/twinfoundation/verifiable-storage/commit/a16a77244cb1d312ea5ee74232bcdadd25f2b330))
14
+ * update descriptions ([696be4d](https://github.com/twinfoundation/verifiable-storage/commit/696be4d253183375d4c96e5b74eca0c814fe2fd1))
15
+ * update framework core ([efa612e](https://github.com/twinfoundation/verifiable-storage/commit/efa612e54dbe2d8f223f27ff9e315e08a2fed04b))
16
+ * use new dlt packages with latency fix ([#6](https://github.com/twinfoundation/verifiable-storage/issues/6)) ([d81c45b](https://github.com/twinfoundation/verifiable-storage/commit/d81c45bce035864a41bbd498815169d7257fbcb8))
17
+ * use shared store mechanism ([#8](https://github.com/twinfoundation/verifiable-storage/issues/8)) ([8c8ecb8](https://github.com/twinfoundation/verifiable-storage/commit/8c8ecb83d32431952c594ea23d37040991f5b4d3))
18
+
19
+ ## [0.0.2-next.6](https://github.com/twinfoundation/verifiable-storage/compare/verifiable-storage-models-v0.0.2-next.5...verifiable-storage-models-v0.0.2-next.6) (2025-10-09)
20
+
21
+
22
+ ### Features
23
+
24
+ * add validate-locales ([326384f](https://github.com/twinfoundation/verifiable-storage/commit/326384fe867604e7cd450460a6a56c6c7bdc8f98))
25
+
3
26
  ## [0.0.2-next.5](https://github.com/twinfoundation/verifiable-storage/compare/verifiable-storage-models-v0.0.2-next.4...verifiable-storage-models-v0.0.2-next.5) (2025-09-26)
4
27
 
5
28
 
@@ -10,7 +10,7 @@ Interface describing a Verifiable Storage component.
10
10
 
11
11
  ### create()
12
12
 
13
- > **create**(`data`, `allowList?`, `options?`, `identity?`, `namespace?`): `Promise`\<\{ `id`: `string`; `receipt`: `IJsonLdNodeObject`; \}\>
13
+ > **create**(`data`, `allowList?`, `options?`, `namespace?`, `controller?`): `Promise`\<\{ `id`: `string`; `receipt`: `IJsonLdNodeObject`; \}\>
14
14
 
15
15
  Create an item in verifiable storage.
16
16
 
@@ -38,17 +38,17 @@ Additional options for creating the item.
38
38
 
39
39
  The maximum size of the allow list.
40
40
 
41
- ##### identity?
41
+ ##### namespace?
42
42
 
43
43
  `string`
44
44
 
45
- The identity of the user to access the vault keys.
45
+ The namespace to store the item in.
46
46
 
47
- ##### namespace?
47
+ ##### controller?
48
48
 
49
49
  `string`
50
50
 
51
- The namespace to store the item in.
51
+ The identity of the controller to access the vault keys.
52
52
 
53
53
  #### Returns
54
54
 
@@ -60,7 +60,7 @@ The id of the stored verifiable item in urn format and the receipt.
60
60
 
61
61
  ### update()
62
62
 
63
- > **update**(`id`, `data?`, `allowList?`, `identity?`): `Promise`\<`IJsonLdNodeObject`\>
63
+ > **update**(`id`, `data?`, `allowList?`, `controller?`): `Promise`\<`IJsonLdNodeObject`\>
64
64
 
65
65
  Update an item in verifiable storage.
66
66
 
@@ -84,11 +84,11 @@ The data to store, optional if updating the allow list.
84
84
 
85
85
  Updated list of identities that are allowed to modify the item.
86
86
 
87
- ##### identity?
87
+ ##### controller?
88
88
 
89
89
  `string`
90
90
 
91
- The identity of the user to access the vault keys.
91
+ The identity of the controller to access the vault keys.
92
92
 
93
93
  #### Returns
94
94
 
@@ -138,7 +138,7 @@ The data for the item and the receipt.
138
138
 
139
139
  ### remove()
140
140
 
141
- > **remove**(`id`, `controllerIdentity?`): `Promise`\<`void`\>
141
+ > **remove**(`id`, `controller?`): `Promise`\<`void`\>
142
142
 
143
143
  Remove the item from verifiable storage.
144
144
 
@@ -150,7 +150,7 @@ Remove the item from verifiable storage.
150
150
 
151
151
  The id of the verifiable item to remove in urn format.
152
152
 
153
- ##### controllerIdentity?
153
+ ##### controller?
154
154
 
155
155
  `string`
156
156
 
@@ -10,13 +10,13 @@ Interface describing a verifiable storage connector.
10
10
 
11
11
  ### create()
12
12
 
13
- > **create**(`controller`, `data`, `allowList?`, `options?`): `Promise`\<\{ `id`: `string`; `receipt`: `IJsonLdNodeObject`; \}\>
13
+ > **create**(`controllerIdentity`, `data`, `allowList?`, `options?`): `Promise`\<\{ `id`: `string`; `receipt`: `IJsonLdNodeObject`; \}\>
14
14
 
15
15
  Create an item in verifiable storage.
16
16
 
17
17
  #### Parameters
18
18
 
19
- ##### controller
19
+ ##### controllerIdentity
20
20
 
21
21
  `string`
22
22
 
@@ -54,13 +54,13 @@ The id of the stored verifiable item in urn format and the receipt.
54
54
 
55
55
  ### update()
56
56
 
57
- > **update**(`controller`, `id`, `data?`, `allowList?`): `Promise`\<`IJsonLdNodeObject`\>
57
+ > **update**(`controllerIdentity`, `id`, `data?`, `allowList?`): `Promise`\<`IJsonLdNodeObject`\>
58
58
 
59
59
  Update an item in verifiable storage.
60
60
 
61
61
  #### Parameters
62
62
 
63
- ##### controller
63
+ ##### controllerIdentity
64
64
 
65
65
  `string`
66
66
 
@@ -132,13 +132,13 @@ The data for the item, the receipt and the allow list.
132
132
 
133
133
  ### remove()
134
134
 
135
- > **remove**(`controller`, `id`): `Promise`\<`void`\>
135
+ > **remove**(`controllerIdentity`, `id`): `Promise`\<`void`\>
136
136
 
137
137
  Remove the item from verifiable storage.
138
138
 
139
139
  #### Parameters
140
140
 
141
- ##### controller
141
+ ##### controllerIdentity
142
142
 
143
143
  `string`
144
144
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/verifiable-storage-models",
3
- "version": "0.0.2-next.5",
3
+ "version": "0.0.3-next.1",
4
4
  "description": "Contains models and classes for use with verifiable storage",
5
5
  "repository": {
6
6
  "type": "git",
@@ -20,21 +20,38 @@
20
20
  "@twin.org/nameof": "next",
21
21
  "@twin.org/web": "next"
22
22
  },
23
- "main": "./dist/cjs/index.cjs",
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
- "require": "./dist/cjs/index.cjs",
30
- "import": "./dist/esm/index.mjs"
28
+ "import": "./dist/es/index.js",
29
+ "default": "./dist/es/index.js"
31
30
  }
32
31
  },
33
32
  "files": [
34
- "dist/cjs",
35
- "dist/esm",
33
+ "dist/es",
36
34
  "dist/types",
37
35
  "locales",
38
36
  "docs"
39
- ]
37
+ ],
38
+ "keywords": [
39
+ "twin",
40
+ "trade",
41
+ "iota",
42
+ "framework",
43
+ "blockchain",
44
+ "verifiable-storage",
45
+ "verifiable",
46
+ "storage",
47
+ "proof",
48
+ "immutable",
49
+ "models",
50
+ "types",
51
+ "schemas"
52
+ ],
53
+ "bugs": {
54
+ "url": "git+https://github.com/twinfoundation/verifiable-storage/issues"
55
+ },
56
+ "homepage": "https://twindev.org"
40
57
  }
@@ -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;
@@ -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 };