@twin.org/verifiable-storage-models 0.0.1-next.8 → 0.0.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/types/models/IVerifiableStorageComponent.d.ts +12 -3
- package/dist/types/models/IVerifiableStorageConnector.d.ts +13 -4
- package/dist/types/models/api/IVerifiableStorageCreateRequest.d.ts +12 -3
- package/dist/types/models/api/IVerifiableStorageCreateResponse.d.ts +3 -3
- package/dist/types/models/api/IVerifiableStorageGetRequest.d.ts +9 -3
- package/dist/types/models/api/IVerifiableStorageGetResponse.d.ts +7 -3
- package/dist/types/models/api/IVerifiableStorageRemoveRequest.d.ts +2 -2
- package/dist/types/models/api/IVerifiableStorageUpdateRequest.d.ts +7 -3
- package/dist/types/models/api/IVerifiableStorageUpdateResponse.d.ts +1 -1
- package/docs/changelog.md +74 -0
- package/docs/reference/interfaces/IVerifiableStorageComponent.md +35 -7
- package/docs/reference/interfaces/IVerifiableStorageConnector.md +36 -8
- package/docs/reference/interfaces/IVerifiableStorageCreateRequest.md +21 -3
- package/docs/reference/interfaces/IVerifiableStorageCreateResponse.md +3 -3
- package/docs/reference/interfaces/IVerifiableStorageGetRequest.md +22 -4
- package/docs/reference/interfaces/IVerifiableStorageGetResponse.md +9 -3
- package/docs/reference/interfaces/IVerifiableStorageRemoveRequest.md +2 -2
- package/docs/reference/interfaces/IVerifiableStorageUpdateRequest.md +10 -4
- package/docs/reference/interfaces/IVerifiableStorageUpdateResponse.md +1 -1
- package/package.json +6 -6
|
@@ -7,34 +7,43 @@ export interface IVerifiableStorageComponent extends IComponent {
|
|
|
7
7
|
/**
|
|
8
8
|
* Create an item in verifiable storage.
|
|
9
9
|
* @param data The data to store.
|
|
10
|
+
* @param allowList The list of identities that are allowed to modify the item.
|
|
11
|
+
* @param options Additional options for creating the item.
|
|
12
|
+
* @param options.maxAllowListSize The maximum size of the allow list.
|
|
10
13
|
* @param identity The identity of the user to access the vault keys.
|
|
11
14
|
* @param namespace The namespace to store the item in.
|
|
12
15
|
* @returns The id of the stored verifiable item in urn format and the receipt.
|
|
13
16
|
*/
|
|
14
|
-
create(data: Uint8Array,
|
|
17
|
+
create(data: Uint8Array, allowList?: string[], options?: {
|
|
18
|
+
maxAllowListSize?: number;
|
|
19
|
+
}, identity?: string, namespace?: string): Promise<{
|
|
15
20
|
id: string;
|
|
16
21
|
receipt: IJsonLdNodeObject;
|
|
17
22
|
}>;
|
|
18
23
|
/**
|
|
19
24
|
* Update an item in verifiable storage.
|
|
20
25
|
* @param id The id of the item to update.
|
|
21
|
-
* @param data The data to store.
|
|
26
|
+
* @param data The data to store, optional if updating the allow list.
|
|
27
|
+
* @param allowList Updated list of identities that are allowed to modify the item.
|
|
22
28
|
* @param identity The identity of the user to access the vault keys.
|
|
23
29
|
* @returns The updated receipt.
|
|
24
30
|
*/
|
|
25
|
-
update(id: string, data
|
|
31
|
+
update(id: string, data?: Uint8Array, allowList?: string[], identity?: string): Promise<IJsonLdNodeObject>;
|
|
26
32
|
/**
|
|
27
33
|
* Get an verifiable item.
|
|
28
34
|
* @param id The id of the item to get.
|
|
29
35
|
* @param options Additional options for getting the item.
|
|
30
36
|
* @param options.includeData Should the data be included in the response, defaults to true.
|
|
37
|
+
* @param options.includeAllowList Should the allow list be included in the response, defaults to true.
|
|
31
38
|
* @returns The data for the item and the receipt.
|
|
32
39
|
*/
|
|
33
40
|
get(id: string, options?: {
|
|
34
41
|
includeData?: boolean;
|
|
42
|
+
includeAllowList?: boolean;
|
|
35
43
|
}): Promise<{
|
|
36
44
|
data?: Uint8Array;
|
|
37
45
|
receipt: IJsonLdNodeObject;
|
|
46
|
+
allowList?: string[];
|
|
38
47
|
}>;
|
|
39
48
|
/**
|
|
40
49
|
* Remove the item from verifiable storage.
|
|
@@ -8,9 +8,14 @@ export interface IVerifiableStorageConnector extends IComponent {
|
|
|
8
8
|
* Create an item in verifiable storage.
|
|
9
9
|
* @param controller The identity of the user to access the vault keys.
|
|
10
10
|
* @param data The data to store.
|
|
11
|
+
* @param allowList The list of identities that are allowed to modify the item.
|
|
12
|
+
* @param options Additional options for creating the item.
|
|
13
|
+
* @param options.maxAllowListSize The maximum size of the allow list.
|
|
11
14
|
* @returns The id of the stored verifiable item in urn format and the receipt.
|
|
12
15
|
*/
|
|
13
|
-
create(controller: string, data: Uint8Array
|
|
16
|
+
create(controller: string, data: Uint8Array, allowList?: string[], options?: {
|
|
17
|
+
maxAllowListSize?: number;
|
|
18
|
+
}): Promise<{
|
|
14
19
|
id: string;
|
|
15
20
|
receipt: IJsonLdNodeObject;
|
|
16
21
|
}>;
|
|
@@ -18,22 +23,26 @@ export interface IVerifiableStorageConnector extends IComponent {
|
|
|
18
23
|
* Update an item in verifiable storage.
|
|
19
24
|
* @param controller The identity of the user to access the vault keys.
|
|
20
25
|
* @param id The id of the item to update.
|
|
21
|
-
* @param data The data to store.
|
|
26
|
+
* @param data The data to store, optional if updating the allow list.
|
|
27
|
+
* @param allowList Updated list of identities that are allowed to modify the item.
|
|
22
28
|
* @returns The updated receipt.
|
|
23
29
|
*/
|
|
24
|
-
update(controller: string, id: string, data
|
|
30
|
+
update(controller: string, id: string, data?: Uint8Array, allowList?: string[]): Promise<IJsonLdNodeObject>;
|
|
25
31
|
/**
|
|
26
32
|
* Get an verifiable item.
|
|
27
33
|
* @param id The id of the item to get.
|
|
28
34
|
* @param options Additional options for getting the item.
|
|
29
35
|
* @param options.includeData Should the data be included in the response, defaults to true.
|
|
30
|
-
* @
|
|
36
|
+
* @param options.includeAllowList Should the allow list be included in the response, defaults to true.
|
|
37
|
+
* @returns The data for the item, the receipt and the allow list.
|
|
31
38
|
*/
|
|
32
39
|
get(id: string, options?: {
|
|
33
40
|
includeData?: boolean;
|
|
41
|
+
includeAllowList?: boolean;
|
|
34
42
|
}): Promise<{
|
|
35
43
|
data?: Uint8Array;
|
|
36
44
|
receipt: IJsonLdNodeObject;
|
|
45
|
+
allowList?: string[];
|
|
37
46
|
}>;
|
|
38
47
|
/**
|
|
39
48
|
* Remove the item from verifiable storage.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Store the data and return the
|
|
2
|
+
* Store the data and return the verifiable storage item id.
|
|
3
3
|
*/
|
|
4
4
|
export interface IVerifiableStorageCreateRequest {
|
|
5
5
|
/**
|
|
@@ -7,11 +7,20 @@ export interface IVerifiableStorageCreateRequest {
|
|
|
7
7
|
*/
|
|
8
8
|
body: {
|
|
9
9
|
/**
|
|
10
|
-
* The data for the
|
|
10
|
+
* The data for the verifiable storage item, this is a string serialized as base64.
|
|
11
11
|
*/
|
|
12
12
|
data: string;
|
|
13
13
|
/**
|
|
14
|
-
* The
|
|
14
|
+
* The list of identities that are allowed to modify the item.
|
|
15
|
+
*/
|
|
16
|
+
allowList?: string[];
|
|
17
|
+
/**
|
|
18
|
+
* The maximum size of the allow list.
|
|
19
|
+
* @default 100
|
|
20
|
+
*/
|
|
21
|
+
maxAllowListSize?: number;
|
|
22
|
+
/**
|
|
23
|
+
* The namespace of the connector to use for the verifiable storage item, defaults to component configured namespace.
|
|
15
24
|
*/
|
|
16
25
|
namespace?: string;
|
|
17
26
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ICreatedResponse } from "@twin.org/api-models";
|
|
2
2
|
import type { IJsonLdNodeObject } from "@twin.org/data-json-ld";
|
|
3
3
|
/**
|
|
4
|
-
* Response to storing the
|
|
4
|
+
* Response to storing the verifiable storage item.
|
|
5
5
|
*/
|
|
6
6
|
export interface IVerifiableStorageCreateResponse extends ICreatedResponse {
|
|
7
7
|
/**
|
|
@@ -9,11 +9,11 @@ export interface IVerifiableStorageCreateResponse extends ICreatedResponse {
|
|
|
9
9
|
*/
|
|
10
10
|
body: {
|
|
11
11
|
/**
|
|
12
|
-
* The receipt associated to the
|
|
12
|
+
* The receipt associated to the verifiable storage item.
|
|
13
13
|
*/
|
|
14
14
|
receipt: IJsonLdNodeObject;
|
|
15
15
|
/**
|
|
16
|
-
* The id of the
|
|
16
|
+
* The id of the verifiable storage item.
|
|
17
17
|
*/
|
|
18
18
|
id: string;
|
|
19
19
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Get the
|
|
2
|
+
* Get the verifiable storage item.
|
|
3
3
|
*/
|
|
4
4
|
export interface IVerifiableStorageGetRequest {
|
|
5
5
|
/**
|
|
@@ -7,7 +7,7 @@ export interface IVerifiableStorageGetRequest {
|
|
|
7
7
|
*/
|
|
8
8
|
pathParams: {
|
|
9
9
|
/**
|
|
10
|
-
* The id of the
|
|
10
|
+
* The id of the verifiable storage item to resolve.
|
|
11
11
|
*/
|
|
12
12
|
id: string;
|
|
13
13
|
};
|
|
@@ -17,7 +17,13 @@ export interface IVerifiableStorageGetRequest {
|
|
|
17
17
|
body?: {
|
|
18
18
|
/**
|
|
19
19
|
* The flag to include the data.
|
|
20
|
+
* @default true
|
|
20
21
|
*/
|
|
21
|
-
includeData
|
|
22
|
+
includeData?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* The flag to include the allow list.
|
|
25
|
+
* @default true
|
|
26
|
+
*/
|
|
27
|
+
includeAllowList?: boolean;
|
|
22
28
|
};
|
|
23
29
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { IJsonLdNodeObject } from "@twin.org/data-json-ld";
|
|
2
2
|
/**
|
|
3
|
-
* Response to getting the
|
|
3
|
+
* Response to getting the verifiable storage item.
|
|
4
4
|
*/
|
|
5
5
|
export interface IVerifiableStorageGetResponse {
|
|
6
6
|
/**
|
|
@@ -8,12 +8,16 @@ export interface IVerifiableStorageGetResponse {
|
|
|
8
8
|
*/
|
|
9
9
|
body: {
|
|
10
10
|
/**
|
|
11
|
-
* The receipt associated to the
|
|
11
|
+
* The receipt associated to the verifiable storage item.
|
|
12
12
|
*/
|
|
13
13
|
receipt: IJsonLdNodeObject;
|
|
14
14
|
/**
|
|
15
|
-
* The data of the
|
|
15
|
+
* The data of the verifiable storage item, this is a string serialized as base64.
|
|
16
16
|
*/
|
|
17
17
|
data?: string;
|
|
18
|
+
/**
|
|
19
|
+
* The list of identities that are allowed to modify the item.
|
|
20
|
+
*/
|
|
21
|
+
allowList?: string[];
|
|
18
22
|
};
|
|
19
23
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Remove the
|
|
2
|
+
* Remove the verifiable storage item.
|
|
3
3
|
*/
|
|
4
4
|
export interface IVerifiableStorageRemoveRequest {
|
|
5
5
|
/**
|
|
@@ -7,7 +7,7 @@ export interface IVerifiableStorageRemoveRequest {
|
|
|
7
7
|
*/
|
|
8
8
|
pathParams: {
|
|
9
9
|
/**
|
|
10
|
-
* The id of the
|
|
10
|
+
* The id of the verifiable storage item to remove.
|
|
11
11
|
*/
|
|
12
12
|
id: string;
|
|
13
13
|
};
|
|
@@ -7,7 +7,7 @@ export interface IVerifiableStorageUpdateRequest {
|
|
|
7
7
|
*/
|
|
8
8
|
pathParams: {
|
|
9
9
|
/**
|
|
10
|
-
* The id of the
|
|
10
|
+
* The id of the verifiable storage item to update.
|
|
11
11
|
*/
|
|
12
12
|
id: string;
|
|
13
13
|
};
|
|
@@ -16,8 +16,12 @@ export interface IVerifiableStorageUpdateRequest {
|
|
|
16
16
|
*/
|
|
17
17
|
body: {
|
|
18
18
|
/**
|
|
19
|
-
* The data
|
|
19
|
+
* The data which is a string serialized as base64, leave empty if just updating the allow list.
|
|
20
20
|
*/
|
|
21
|
-
data
|
|
21
|
+
data?: string;
|
|
22
|
+
/**
|
|
23
|
+
* An updated list of identities that are allowed to modify the item, send an empty list to remove all entries.
|
|
24
|
+
*/
|
|
25
|
+
allowList?: string[];
|
|
22
26
|
};
|
|
23
27
|
}
|
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,79 @@
|
|
|
1
1
|
# @twin.org/verifiable-storage-models - Changelog
|
|
2
2
|
|
|
3
|
+
## 0.0.1 (2025-07-09)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* release to production ([6ce6744](https://github.com/twinfoundation/verifiable-storage/commit/6ce6744c124cca586c1ef0552624378d1207578d))
|
|
9
|
+
|
|
10
|
+
## [0.0.1-next.17](https://github.com/twinfoundation/verifiable-storage/compare/verifiable-storage-models-v0.0.1-next.16...verifiable-storage-models-v0.0.1-next.17) (2025-06-25)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Miscellaneous Chores
|
|
14
|
+
|
|
15
|
+
* **verifiable-storage-models:** Synchronize repo versions
|
|
16
|
+
|
|
17
|
+
## [0.0.1-next.16](https://github.com/twinfoundation/verifiable-storage/compare/verifiable-storage-models-v0.0.1-next.15...verifiable-storage-models-v0.0.1-next.16) (2025-06-12)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
* update dependencies ([a16a772](https://github.com/twinfoundation/verifiable-storage/commit/a16a77244cb1d312ea5ee74232bcdadd25f2b330))
|
|
23
|
+
|
|
24
|
+
## [0.0.1-next.15](https://github.com/twinfoundation/verifiable-storage/compare/verifiable-storage-models-v0.0.1-next.14...verifiable-storage-models-v0.0.1-next.15) (2025-06-03)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
### Miscellaneous Chores
|
|
28
|
+
|
|
29
|
+
* **verifiable-storage-models:** Synchronize repo versions
|
|
30
|
+
|
|
31
|
+
## [0.0.1-next.14](https://github.com/twinfoundation/verifiable-storage/compare/verifiable-storage-models-v0.0.1-next.13...verifiable-storage-models-v0.0.1-next.14) (2025-05-28)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
### Features
|
|
35
|
+
|
|
36
|
+
* add support for allowlist ([#17](https://github.com/twinfoundation/verifiable-storage/issues/17)) ([9341ea6](https://github.com/twinfoundation/verifiable-storage/commit/9341ea6b95dfbf2a5dc70a53e5979d7d0e8b2de6))
|
|
37
|
+
* update allow list name case ([278a787](https://github.com/twinfoundation/verifiable-storage/commit/278a787e96864c95438f87adaac6f2fc8b6bebcd))
|
|
38
|
+
* update descriptions ([696be4d](https://github.com/twinfoundation/verifiable-storage/commit/696be4d253183375d4c96e5b74eca0c814fe2fd1))
|
|
39
|
+
* 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))
|
|
40
|
+
* use shared store mechanism ([#8](https://github.com/twinfoundation/verifiable-storage/issues/8)) ([8c8ecb8](https://github.com/twinfoundation/verifiable-storage/commit/8c8ecb83d32431952c594ea23d37040991f5b4d3))
|
|
41
|
+
|
|
42
|
+
## [0.0.1-next.13](https://github.com/twinfoundation/verifiable-storage/compare/verifiable-storage-models-v0.0.1-next.12...verifiable-storage-models-v0.0.1-next.13) (2025-05-28)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
### Miscellaneous Chores
|
|
46
|
+
|
|
47
|
+
* **verifiable-storage-models:** Synchronize repo versions
|
|
48
|
+
|
|
49
|
+
## [0.0.1-next.12](https://github.com/twinfoundation/verifiable-storage/compare/verifiable-storage-models-v0.0.1-next.11...verifiable-storage-models-v0.0.1-next.12) (2025-05-28)
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
### Features
|
|
53
|
+
|
|
54
|
+
* update allow list name case ([278a787](https://github.com/twinfoundation/verifiable-storage/commit/278a787e96864c95438f87adaac6f2fc8b6bebcd))
|
|
55
|
+
|
|
56
|
+
## [0.0.1-next.11](https://github.com/twinfoundation/verifiable-storage/compare/verifiable-storage-models-v0.0.1-next.10...verifiable-storage-models-v0.0.1-next.11) (2025-05-22)
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
### Miscellaneous Chores
|
|
60
|
+
|
|
61
|
+
* **verifiable-storage-models:** Synchronize repo versions
|
|
62
|
+
|
|
63
|
+
## [0.0.1-next.10](https://github.com/twinfoundation/verifiable-storage/compare/verifiable-storage-models-v0.0.1-next.9...verifiable-storage-models-v0.0.1-next.10) (2025-05-22)
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
### Features
|
|
67
|
+
|
|
68
|
+
* add support for allowlist ([#17](https://github.com/twinfoundation/verifiable-storage/issues/17)) ([9341ea6](https://github.com/twinfoundation/verifiable-storage/commit/9341ea6b95dfbf2a5dc70a53e5979d7d0e8b2de6))
|
|
69
|
+
|
|
70
|
+
## [0.0.1-next.9](https://github.com/twinfoundation/verifiable-storage/compare/verifiable-storage-models-v0.0.1-next.8...verifiable-storage-models-v0.0.1-next.9) (2025-05-06)
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
### Miscellaneous Chores
|
|
74
|
+
|
|
75
|
+
* **verifiable-storage-models:** Synchronize repo versions
|
|
76
|
+
|
|
3
77
|
## [0.0.1-next.8](https://github.com/twinfoundation/verifiable-storage/compare/verifiable-storage-models-v0.0.1-next.7...verifiable-storage-models-v0.0.1-next.8) (2025-04-24)
|
|
4
78
|
|
|
5
79
|
|
|
@@ -10,7 +10,7 @@ Interface describing a Verifiable Storage component.
|
|
|
10
10
|
|
|
11
11
|
### create()
|
|
12
12
|
|
|
13
|
-
> **create**(`data`, `identity?`, `namespace?`): `Promise`\<\{ `id`: `string`; `receipt`: `IJsonLdNodeObject`; \}\>
|
|
13
|
+
> **create**(`data`, `allowList?`, `options?`, `identity?`, `namespace?`): `Promise`\<\{ `id`: `string`; `receipt`: `IJsonLdNodeObject`; \}\>
|
|
14
14
|
|
|
15
15
|
Create an item in verifiable storage.
|
|
16
16
|
|
|
@@ -22,6 +22,22 @@ Create an item in verifiable storage.
|
|
|
22
22
|
|
|
23
23
|
The data to store.
|
|
24
24
|
|
|
25
|
+
##### allowList?
|
|
26
|
+
|
|
27
|
+
`string`[]
|
|
28
|
+
|
|
29
|
+
The list of identities that are allowed to modify the item.
|
|
30
|
+
|
|
31
|
+
##### options?
|
|
32
|
+
|
|
33
|
+
Additional options for creating the item.
|
|
34
|
+
|
|
35
|
+
###### maxAllowListSize?
|
|
36
|
+
|
|
37
|
+
`number`
|
|
38
|
+
|
|
39
|
+
The maximum size of the allow list.
|
|
40
|
+
|
|
25
41
|
##### identity?
|
|
26
42
|
|
|
27
43
|
`string`
|
|
@@ -44,7 +60,7 @@ The id of the stored verifiable item in urn format and the receipt.
|
|
|
44
60
|
|
|
45
61
|
### update()
|
|
46
62
|
|
|
47
|
-
> **update**(`id`, `data
|
|
63
|
+
> **update**(`id`, `data?`, `allowList?`, `identity?`): `Promise`\<`IJsonLdNodeObject`\>
|
|
48
64
|
|
|
49
65
|
Update an item in verifiable storage.
|
|
50
66
|
|
|
@@ -56,11 +72,17 @@ Update an item in verifiable storage.
|
|
|
56
72
|
|
|
57
73
|
The id of the item to update.
|
|
58
74
|
|
|
59
|
-
##### data
|
|
75
|
+
##### data?
|
|
60
76
|
|
|
61
|
-
`Uint8Array
|
|
77
|
+
`Uint8Array`\<`ArrayBufferLike`\>
|
|
62
78
|
|
|
63
|
-
The data to store.
|
|
79
|
+
The data to store, optional if updating the allow list.
|
|
80
|
+
|
|
81
|
+
##### allowList?
|
|
82
|
+
|
|
83
|
+
`string`[]
|
|
84
|
+
|
|
85
|
+
Updated list of identities that are allowed to modify the item.
|
|
64
86
|
|
|
65
87
|
##### identity?
|
|
66
88
|
|
|
@@ -78,7 +100,7 @@ The updated receipt.
|
|
|
78
100
|
|
|
79
101
|
### get()
|
|
80
102
|
|
|
81
|
-
> **get**(`id`, `options?`): `Promise`\<\{ `data
|
|
103
|
+
> **get**(`id`, `options?`): `Promise`\<\{ `data?`: `Uint8Array`\<`ArrayBufferLike`\>; `receipt`: `IJsonLdNodeObject`; `allowList?`: `string`[]; \}\>
|
|
82
104
|
|
|
83
105
|
Get an verifiable item.
|
|
84
106
|
|
|
@@ -100,9 +122,15 @@ Additional options for getting the item.
|
|
|
100
122
|
|
|
101
123
|
Should the data be included in the response, defaults to true.
|
|
102
124
|
|
|
125
|
+
###### includeAllowList?
|
|
126
|
+
|
|
127
|
+
`boolean`
|
|
128
|
+
|
|
129
|
+
Should the allow list be included in the response, defaults to true.
|
|
130
|
+
|
|
103
131
|
#### Returns
|
|
104
132
|
|
|
105
|
-
`Promise`\<\{ `data
|
|
133
|
+
`Promise`\<\{ `data?`: `Uint8Array`\<`ArrayBufferLike`\>; `receipt`: `IJsonLdNodeObject`; `allowList?`: `string`[]; \}\>
|
|
106
134
|
|
|
107
135
|
The data for the item and the receipt.
|
|
108
136
|
|
|
@@ -10,7 +10,7 @@ Interface describing a verifiable storage connector.
|
|
|
10
10
|
|
|
11
11
|
### create()
|
|
12
12
|
|
|
13
|
-
> **create**(`controller`, `data`): `Promise`\<\{ `id`: `string`; `receipt`: `IJsonLdNodeObject`; \}\>
|
|
13
|
+
> **create**(`controller`, `data`, `allowList?`, `options?`): `Promise`\<\{ `id`: `string`; `receipt`: `IJsonLdNodeObject`; \}\>
|
|
14
14
|
|
|
15
15
|
Create an item in verifiable storage.
|
|
16
16
|
|
|
@@ -28,6 +28,22 @@ The identity of the user to access the vault keys.
|
|
|
28
28
|
|
|
29
29
|
The data to store.
|
|
30
30
|
|
|
31
|
+
##### allowList?
|
|
32
|
+
|
|
33
|
+
`string`[]
|
|
34
|
+
|
|
35
|
+
The list of identities that are allowed to modify the item.
|
|
36
|
+
|
|
37
|
+
##### options?
|
|
38
|
+
|
|
39
|
+
Additional options for creating the item.
|
|
40
|
+
|
|
41
|
+
###### maxAllowListSize?
|
|
42
|
+
|
|
43
|
+
`number`
|
|
44
|
+
|
|
45
|
+
The maximum size of the allow list.
|
|
46
|
+
|
|
31
47
|
#### Returns
|
|
32
48
|
|
|
33
49
|
`Promise`\<\{ `id`: `string`; `receipt`: `IJsonLdNodeObject`; \}\>
|
|
@@ -38,7 +54,7 @@ The id of the stored verifiable item in urn format and the receipt.
|
|
|
38
54
|
|
|
39
55
|
### update()
|
|
40
56
|
|
|
41
|
-
> **update**(`controller`, `id`, `data`): `Promise`\<`IJsonLdNodeObject`\>
|
|
57
|
+
> **update**(`controller`, `id`, `data?`, `allowList?`): `Promise`\<`IJsonLdNodeObject`\>
|
|
42
58
|
|
|
43
59
|
Update an item in verifiable storage.
|
|
44
60
|
|
|
@@ -56,11 +72,17 @@ The identity of the user to access the vault keys.
|
|
|
56
72
|
|
|
57
73
|
The id of the item to update.
|
|
58
74
|
|
|
59
|
-
##### data
|
|
75
|
+
##### data?
|
|
60
76
|
|
|
61
|
-
`Uint8Array
|
|
77
|
+
`Uint8Array`\<`ArrayBufferLike`\>
|
|
62
78
|
|
|
63
|
-
The data to store.
|
|
79
|
+
The data to store, optional if updating the allow list.
|
|
80
|
+
|
|
81
|
+
##### allowList?
|
|
82
|
+
|
|
83
|
+
`string`[]
|
|
84
|
+
|
|
85
|
+
Updated list of identities that are allowed to modify the item.
|
|
64
86
|
|
|
65
87
|
#### Returns
|
|
66
88
|
|
|
@@ -72,7 +94,7 @@ The updated receipt.
|
|
|
72
94
|
|
|
73
95
|
### get()
|
|
74
96
|
|
|
75
|
-
> **get**(`id`, `options?`): `Promise`\<\{ `data
|
|
97
|
+
> **get**(`id`, `options?`): `Promise`\<\{ `data?`: `Uint8Array`\<`ArrayBufferLike`\>; `receipt`: `IJsonLdNodeObject`; `allowList?`: `string`[]; \}\>
|
|
76
98
|
|
|
77
99
|
Get an verifiable item.
|
|
78
100
|
|
|
@@ -94,11 +116,17 @@ Additional options for getting the item.
|
|
|
94
116
|
|
|
95
117
|
Should the data be included in the response, defaults to true.
|
|
96
118
|
|
|
119
|
+
###### includeAllowList?
|
|
120
|
+
|
|
121
|
+
`boolean`
|
|
122
|
+
|
|
123
|
+
Should the allow list be included in the response, defaults to true.
|
|
124
|
+
|
|
97
125
|
#### Returns
|
|
98
126
|
|
|
99
|
-
`Promise`\<\{ `data
|
|
127
|
+
`Promise`\<\{ `data?`: `Uint8Array`\<`ArrayBufferLike`\>; `receipt`: `IJsonLdNodeObject`; `allowList?`: `string`[]; \}\>
|
|
100
128
|
|
|
101
|
-
The data for the item and the
|
|
129
|
+
The data for the item, the receipt and the allow list.
|
|
102
130
|
|
|
103
131
|
***
|
|
104
132
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Interface: IVerifiableStorageCreateRequest
|
|
2
2
|
|
|
3
|
-
Store the data and return the
|
|
3
|
+
Store the data and return the verifiable storage item id.
|
|
4
4
|
|
|
5
5
|
## Properties
|
|
6
6
|
|
|
@@ -14,10 +14,28 @@ The data to be stored.
|
|
|
14
14
|
|
|
15
15
|
> **data**: `string`
|
|
16
16
|
|
|
17
|
-
The data for the
|
|
17
|
+
The data for the verifiable storage item, this is a string serialized as base64.
|
|
18
|
+
|
|
19
|
+
#### allowList?
|
|
20
|
+
|
|
21
|
+
> `optional` **allowList**: `string`[]
|
|
22
|
+
|
|
23
|
+
The list of identities that are allowed to modify the item.
|
|
24
|
+
|
|
25
|
+
#### maxAllowListSize?
|
|
26
|
+
|
|
27
|
+
> `optional` **maxAllowListSize**: `number`
|
|
28
|
+
|
|
29
|
+
The maximum size of the allow list.
|
|
30
|
+
|
|
31
|
+
##### Default
|
|
32
|
+
|
|
33
|
+
```ts
|
|
34
|
+
100
|
|
35
|
+
```
|
|
18
36
|
|
|
19
37
|
#### namespace?
|
|
20
38
|
|
|
21
39
|
> `optional` **namespace**: `string`
|
|
22
40
|
|
|
23
|
-
The namespace of the connector to use for the
|
|
41
|
+
The namespace of the connector to use for the verifiable storage item, defaults to component configured namespace.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Interface: IVerifiableStorageCreateResponse
|
|
2
2
|
|
|
3
|
-
Response to storing the
|
|
3
|
+
Response to storing the verifiable storage item.
|
|
4
4
|
|
|
5
5
|
## Extends
|
|
6
6
|
|
|
@@ -18,10 +18,10 @@ The data that was stored.
|
|
|
18
18
|
|
|
19
19
|
> **receipt**: `IJsonLdNodeObject`
|
|
20
20
|
|
|
21
|
-
The receipt associated to the
|
|
21
|
+
The receipt associated to the verifiable storage item.
|
|
22
22
|
|
|
23
23
|
#### id
|
|
24
24
|
|
|
25
25
|
> **id**: `string`
|
|
26
26
|
|
|
27
|
-
The id of the
|
|
27
|
+
The id of the verifiable storage item.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Interface: IVerifiableStorageGetRequest
|
|
2
2
|
|
|
3
|
-
Get the
|
|
3
|
+
Get the verifiable storage item.
|
|
4
4
|
|
|
5
5
|
## Properties
|
|
6
6
|
|
|
@@ -14,7 +14,7 @@ The data to be requested.
|
|
|
14
14
|
|
|
15
15
|
> **id**: `string`
|
|
16
16
|
|
|
17
|
-
The id of the
|
|
17
|
+
The id of the verifiable storage item to resolve.
|
|
18
18
|
|
|
19
19
|
***
|
|
20
20
|
|
|
@@ -24,8 +24,26 @@ The id of the Verifiable Storage to resolve.
|
|
|
24
24
|
|
|
25
25
|
The body optional param.
|
|
26
26
|
|
|
27
|
-
#### includeData
|
|
27
|
+
#### includeData?
|
|
28
28
|
|
|
29
|
-
> **includeData**: `boolean`
|
|
29
|
+
> `optional` **includeData**: `boolean`
|
|
30
30
|
|
|
31
31
|
The flag to include the data.
|
|
32
|
+
|
|
33
|
+
##### Default
|
|
34
|
+
|
|
35
|
+
```ts
|
|
36
|
+
true
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
#### includeAllowList?
|
|
40
|
+
|
|
41
|
+
> `optional` **includeAllowList**: `boolean`
|
|
42
|
+
|
|
43
|
+
The flag to include the allow list.
|
|
44
|
+
|
|
45
|
+
##### Default
|
|
46
|
+
|
|
47
|
+
```ts
|
|
48
|
+
true
|
|
49
|
+
```
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Interface: IVerifiableStorageGetResponse
|
|
2
2
|
|
|
3
|
-
Response to getting the
|
|
3
|
+
Response to getting the verifiable storage item.
|
|
4
4
|
|
|
5
5
|
## Properties
|
|
6
6
|
|
|
@@ -14,10 +14,16 @@ The data that was obtained.
|
|
|
14
14
|
|
|
15
15
|
> **receipt**: `IJsonLdNodeObject`
|
|
16
16
|
|
|
17
|
-
The receipt associated to the
|
|
17
|
+
The receipt associated to the verifiable storage item.
|
|
18
18
|
|
|
19
19
|
#### data?
|
|
20
20
|
|
|
21
21
|
> `optional` **data**: `string`
|
|
22
22
|
|
|
23
|
-
The data of the
|
|
23
|
+
The data of the verifiable storage item, this is a string serialized as base64.
|
|
24
|
+
|
|
25
|
+
#### allowList?
|
|
26
|
+
|
|
27
|
+
> `optional` **allowList**: `string`[]
|
|
28
|
+
|
|
29
|
+
The list of identities that are allowed to modify the item.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Interface: IVerifiableStorageRemoveRequest
|
|
2
2
|
|
|
3
|
-
Remove the
|
|
3
|
+
Remove the verifiable storage item.
|
|
4
4
|
|
|
5
5
|
## Properties
|
|
6
6
|
|
|
@@ -14,4 +14,4 @@ The data to be used for resolving.
|
|
|
14
14
|
|
|
15
15
|
> **id**: `string`
|
|
16
16
|
|
|
17
|
-
The id of the
|
|
17
|
+
The id of the verifiable storage item to remove.
|
|
@@ -14,7 +14,7 @@ The data to be updated.
|
|
|
14
14
|
|
|
15
15
|
> **id**: `string`
|
|
16
16
|
|
|
17
|
-
The id of the
|
|
17
|
+
The id of the verifiable storage item to update.
|
|
18
18
|
|
|
19
19
|
***
|
|
20
20
|
|
|
@@ -24,8 +24,14 @@ The id of the Verifiable Storage to update.
|
|
|
24
24
|
|
|
25
25
|
The data to be updated.
|
|
26
26
|
|
|
27
|
-
#### data
|
|
27
|
+
#### data?
|
|
28
28
|
|
|
29
|
-
> **data**: `string`
|
|
29
|
+
> `optional` **data**: `string`
|
|
30
30
|
|
|
31
|
-
The data
|
|
31
|
+
The data which is a string serialized as base64, leave empty if just updating the allow list.
|
|
32
|
+
|
|
33
|
+
#### allowList?
|
|
34
|
+
|
|
35
|
+
> `optional` **allowList**: `string`[]
|
|
36
|
+
|
|
37
|
+
An updated list of identities that are allowed to modify the item, send an empty list to remove all entries.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/verifiable-storage-models",
|
|
3
|
-
"version": "0.0.1
|
|
3
|
+
"version": "0.0.1",
|
|
4
4
|
"description": "Contains models and classes for use with verifiable storage",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -14,11 +14,11 @@
|
|
|
14
14
|
"node": ">=20.0.0"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@twin.org/api-models": "next",
|
|
18
|
-
"@twin.org/core": "
|
|
19
|
-
"@twin.org/data-json-ld": "
|
|
20
|
-
"@twin.org/nameof": "
|
|
21
|
-
"@twin.org/web": "
|
|
17
|
+
"@twin.org/api-models": "^0.0.2-next.1",
|
|
18
|
+
"@twin.org/core": "^0.0.1",
|
|
19
|
+
"@twin.org/data-json-ld": "^0.0.1",
|
|
20
|
+
"@twin.org/nameof": "^0.0.1",
|
|
21
|
+
"@twin.org/web": "^0.0.1"
|
|
22
22
|
},
|
|
23
23
|
"main": "./dist/cjs/index.cjs",
|
|
24
24
|
"module": "./dist/esm/index.mjs",
|