@twin.org/verifiable-storage-models 0.0.2-next.6 → 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.
- 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 +13 -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/docs/changelog.md +16 -0
- package/docs/reference/interfaces/IVerifiableStorageComponent.md +10 -18
- package/docs/reference/interfaces/IVerifiableStorageConnector.md +6 -14
- package/package.json +5 -7
- package/dist/cjs/index.cjs +0 -27
- 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"]}
|
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,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
|
*/
|
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
|
}
|
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
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
|
+
|
|
3
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)
|
|
4
20
|
|
|
5
21
|
|
|
@@ -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
11
|
### 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
|
|
|
@@ -68,7 +60,7 @@ The id of the stored verifiable item in urn format and the receipt.
|
|
|
68
60
|
|
|
69
61
|
### 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
|
|
|
@@ -146,7 +138,7 @@ The data for the item and the receipt.
|
|
|
146
138
|
|
|
147
139
|
### 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
11
|
### 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
|
|
|
@@ -62,13 +54,13 @@ The id of the stored verifiable item in urn format and the receipt.
|
|
|
62
54
|
|
|
63
55
|
### 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
|
|
|
@@ -140,13 +132,13 @@ The data for the item, the receipt and the allow list.
|
|
|
140
132
|
|
|
141
133
|
### 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
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/verifiable-storage-models",
|
|
3
|
-
"version": "0.0.
|
|
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,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"
|
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 };
|