@twin.org/blob-storage-models 0.0.1-next.8 → 0.0.1-next.9
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.
|
@@ -11,19 +11,21 @@ export interface IBlobStorageComponent extends IComponent {
|
|
|
11
11
|
* @param extension Extension for the blob, will be detected if left undefined.
|
|
12
12
|
* @param metadata Data for the custom metadata as JSON-LD.
|
|
13
13
|
* @param namespace The namespace to use for storing, defaults to component configured namespace.
|
|
14
|
-
* @param
|
|
14
|
+
* @param userIdentity The user identity to use with storage operations.
|
|
15
|
+
* @param nodeIdentity The node identity to use with storage operations.
|
|
15
16
|
* @returns The id of the stored blob in urn format.
|
|
16
17
|
*/
|
|
17
|
-
create(blob: string, mimeType?: string, extension?: string, metadata?: IJsonLdNodeObject, namespace?: string, nodeIdentity?: string): Promise<string>;
|
|
18
|
+
create(blob: string, mimeType?: string, extension?: string, metadata?: IJsonLdNodeObject, namespace?: string, userIdentity?: string, nodeIdentity?: string): Promise<string>;
|
|
18
19
|
/**
|
|
19
20
|
* Get the blob and metadata.
|
|
20
21
|
* @param id The id of the blob to get in urn format.
|
|
21
22
|
* @param includeContent Include the content, or just get the metadata.
|
|
22
|
-
* @param
|
|
23
|
+
* @param userIdentity The user identity to use with storage operations.
|
|
24
|
+
* @param nodeIdentity The node identity to use with storage operations.
|
|
23
25
|
* @returns The data and metadata for the blob if it can be found.
|
|
24
26
|
* @throws Not found error if the blob cannot be found.
|
|
25
27
|
*/
|
|
26
|
-
get(id: string, includeContent: boolean, nodeIdentity?: string): Promise<{
|
|
28
|
+
get(id: string, includeContent: boolean, userIdentity?: string, nodeIdentity?: string): Promise<{
|
|
27
29
|
blob?: string;
|
|
28
30
|
mimeType?: string;
|
|
29
31
|
extension?: string;
|
|
@@ -35,15 +37,19 @@ export interface IBlobStorageComponent extends IComponent {
|
|
|
35
37
|
* @param mimeType Mime type for the blob, will be detected if left undefined.
|
|
36
38
|
* @param extension Extension for the blob, will be detected if left undefined.
|
|
37
39
|
* @param metadata Data for the custom metadata as JSON-LD.
|
|
40
|
+
* @param userIdentity The user identity to use with storage operations.
|
|
41
|
+
* @param nodeIdentity The node identity to use with storage operations.
|
|
38
42
|
* @returns Nothing.
|
|
39
43
|
* @throws Not found error if the blob cannot be found.
|
|
40
44
|
*/
|
|
41
|
-
update(id: string, mimeType?: string, extension?: string, metadata?: IJsonLdNodeObject): Promise<void>;
|
|
45
|
+
update(id: string, mimeType?: string, extension?: string, metadata?: IJsonLdNodeObject, userIdentity?: string, nodeIdentity?: string): Promise<void>;
|
|
42
46
|
/**
|
|
43
47
|
* Remove the blob.
|
|
44
48
|
* @param id The id of the blob to remove in urn format.
|
|
49
|
+
* @param userIdentity The user identity to use with storage operations.
|
|
50
|
+
* @param nodeIdentity The node identity to use with storage operations.
|
|
45
51
|
* @returns Nothing.
|
|
46
52
|
* @throws Not found error if the blob cannot be found.
|
|
47
53
|
*/
|
|
48
|
-
remove(id: string): Promise<void>;
|
|
54
|
+
remove(id: string, userIdentity?: string, nodeIdentity?: string): Promise<void>;
|
|
49
55
|
}
|
package/docs/changelog.md
CHANGED
|
@@ -10,7 +10,7 @@ Interface describing an blob storage component.
|
|
|
10
10
|
|
|
11
11
|
### create()
|
|
12
12
|
|
|
13
|
-
> **create**(`blob`, `mimeType`?, `extension`?, `metadata`?, `namespace`?, `nodeIdentity`?): `Promise`\<`string`\>
|
|
13
|
+
> **create**(`blob`, `mimeType`?, `extension`?, `metadata`?, `namespace`?, `userIdentity`?, `nodeIdentity`?): `Promise`\<`string`\>
|
|
14
14
|
|
|
15
15
|
Create the blob with some metadata.
|
|
16
16
|
|
|
@@ -36,9 +36,13 @@ Data for the custom metadata as JSON-LD.
|
|
|
36
36
|
|
|
37
37
|
The namespace to use for storing, defaults to component configured namespace.
|
|
38
38
|
|
|
39
|
+
• **userIdentity?**: `string`
|
|
40
|
+
|
|
41
|
+
The user identity to use with storage operations.
|
|
42
|
+
|
|
39
43
|
• **nodeIdentity?**: `string`
|
|
40
44
|
|
|
41
|
-
The node identity
|
|
45
|
+
The node identity to use with storage operations.
|
|
42
46
|
|
|
43
47
|
#### Returns
|
|
44
48
|
|
|
@@ -50,7 +54,7 @@ The id of the stored blob in urn format.
|
|
|
50
54
|
|
|
51
55
|
### get()
|
|
52
56
|
|
|
53
|
-
> **get**(`id`, `includeContent`, `nodeIdentity`?): `Promise`\<`object`\>
|
|
57
|
+
> **get**(`id`, `includeContent`, `userIdentity`?, `nodeIdentity`?): `Promise`\<`object`\>
|
|
54
58
|
|
|
55
59
|
Get the blob and metadata.
|
|
56
60
|
|
|
@@ -64,9 +68,13 @@ The id of the blob to get in urn format.
|
|
|
64
68
|
|
|
65
69
|
Include the content, or just get the metadata.
|
|
66
70
|
|
|
71
|
+
• **userIdentity?**: `string`
|
|
72
|
+
|
|
73
|
+
The user identity to use with storage operations.
|
|
74
|
+
|
|
67
75
|
• **nodeIdentity?**: `string`
|
|
68
76
|
|
|
69
|
-
The node identity
|
|
77
|
+
The node identity to use with storage operations.
|
|
70
78
|
|
|
71
79
|
#### Returns
|
|
72
80
|
|
|
@@ -98,7 +106,7 @@ Not found error if the blob cannot be found.
|
|
|
98
106
|
|
|
99
107
|
### update()
|
|
100
108
|
|
|
101
|
-
> **update**(`id`, `mimeType`?, `extension`?, `metadata`?): `Promise`\<`void`\>
|
|
109
|
+
> **update**(`id`, `mimeType`?, `extension`?, `metadata`?, `userIdentity`?, `nodeIdentity`?): `Promise`\<`void`\>
|
|
102
110
|
|
|
103
111
|
Update the blob with metadata.
|
|
104
112
|
|
|
@@ -120,6 +128,14 @@ Extension for the blob, will be detected if left undefined.
|
|
|
120
128
|
|
|
121
129
|
Data for the custom metadata as JSON-LD.
|
|
122
130
|
|
|
131
|
+
• **userIdentity?**: `string`
|
|
132
|
+
|
|
133
|
+
The user identity to use with storage operations.
|
|
134
|
+
|
|
135
|
+
• **nodeIdentity?**: `string`
|
|
136
|
+
|
|
137
|
+
The node identity to use with storage operations.
|
|
138
|
+
|
|
123
139
|
#### Returns
|
|
124
140
|
|
|
125
141
|
`Promise`\<`void`\>
|
|
@@ -134,7 +150,7 @@ Not found error if the blob cannot be found.
|
|
|
134
150
|
|
|
135
151
|
### remove()
|
|
136
152
|
|
|
137
|
-
> **remove**(`id`): `Promise`\<`void`\>
|
|
153
|
+
> **remove**(`id`, `userIdentity`?, `nodeIdentity`?): `Promise`\<`void`\>
|
|
138
154
|
|
|
139
155
|
Remove the blob.
|
|
140
156
|
|
|
@@ -144,6 +160,14 @@ Remove the blob.
|
|
|
144
160
|
|
|
145
161
|
The id of the blob to remove in urn format.
|
|
146
162
|
|
|
163
|
+
• **userIdentity?**: `string`
|
|
164
|
+
|
|
165
|
+
The user identity to use with storage operations.
|
|
166
|
+
|
|
167
|
+
• **nodeIdentity?**: `string`
|
|
168
|
+
|
|
169
|
+
The node identity to use with storage operations.
|
|
170
|
+
|
|
147
171
|
#### Returns
|
|
148
172
|
|
|
149
173
|
`Promise`\<`void`\>
|