@twin.org/blob-storage-service 0.0.1-next.9 → 0.0.2-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.
@@ -0,0 +1,101 @@
1
+ # Class: BlobStorageEntry
2
+
3
+ Class representing entry for the blob storage.
4
+
5
+ ## Constructors
6
+
7
+ ### Constructor
8
+
9
+ > **new BlobStorageEntry**(): `BlobStorageEntry`
10
+
11
+ #### Returns
12
+
13
+ `BlobStorageEntry`
14
+
15
+ ## Properties
16
+
17
+ ### id
18
+
19
+ > **id**: `string`
20
+
21
+ The id for the blob.
22
+
23
+ ***
24
+
25
+ ### dateCreated
26
+
27
+ > **dateCreated**: `string`
28
+
29
+ The date/time when the entry was created.
30
+
31
+ ***
32
+
33
+ ### dateModified?
34
+
35
+ > `optional` **dateModified**: `string`
36
+
37
+ The date/time when the entry was modified.
38
+
39
+ ***
40
+
41
+ ### blobSize
42
+
43
+ > **blobSize**: `number`
44
+
45
+ The length of the data in the blob.
46
+
47
+ ***
48
+
49
+ ### blobHash
50
+
51
+ > **blobHash**: `string`
52
+
53
+ The hash of the data in the blob.
54
+
55
+ ***
56
+
57
+ ### encodingFormat?
58
+
59
+ > `optional` **encodingFormat**: `string`
60
+
61
+ The mime type for the blob.
62
+
63
+ ***
64
+
65
+ ### fileExtension?
66
+
67
+ > `optional` **fileExtension**: `string`
68
+
69
+ The extension.
70
+
71
+ ***
72
+
73
+ ### metadata?
74
+
75
+ > `optional` **metadata**: `IJsonLdNodeObject`
76
+
77
+ The metadata for the blob as JSON-LD.
78
+
79
+ ***
80
+
81
+ ### isEncrypted
82
+
83
+ > **isEncrypted**: `boolean`
84
+
85
+ Is the entry encrypted.
86
+
87
+ ***
88
+
89
+ ### compression?
90
+
91
+ > `optional` **compression**: `BlobStorageCompressionType`
92
+
93
+ Is the entry compressed.
94
+
95
+ ***
96
+
97
+ ### userIdentity?
98
+
99
+ > `optional` **userIdentity**: `string`
100
+
101
+ The user identity that created the blob.
@@ -8,44 +8,26 @@ Service for performing blob storage operations to a connector.
8
8
 
9
9
  ## Constructors
10
10
 
11
- ### new BlobStorageService()
11
+ ### Constructor
12
12
 
13
- > **new BlobStorageService**(`options`?): [`BlobStorageService`](BlobStorageService.md)
13
+ > **new BlobStorageService**(`options?`): `BlobStorageService`
14
14
 
15
15
  Create a new instance of BlobStorageService.
16
16
 
17
17
  #### Parameters
18
18
 
19
- **options?**
19
+ ##### options?
20
20
 
21
- The dependencies for the service.
21
+ [`IBlobStorageServiceConstructorOptions`](../interfaces/IBlobStorageServiceConstructorOptions.md)
22
22
 
23
- **options.metadataEntityStorageType?**: `string`
24
-
25
- The type of the storage connector for the metadata, defaults to "blob-metadata".
26
-
27
- • **options.vaultConnectorType?**: `string`
28
-
29
- The type of the vault connector for encryption, if undefined no encryption will be performed.
30
-
31
- • **options.config?**: [`IBlobStorageServiceConfig`](../interfaces/IBlobStorageServiceConfig.md)
32
-
33
- The configuration for the service.
23
+ The options for the service.
34
24
 
35
25
  #### Returns
36
26
 
37
- [`BlobStorageService`](BlobStorageService.md)
27
+ `BlobStorageService`
38
28
 
39
29
  ## Properties
40
30
 
41
- ### NAMESPACE
42
-
43
- > `readonly` `static` **NAMESPACE**: `string` = `"blob"`
44
-
45
- The namespace supported by the blob storage service.
46
-
47
- ***
48
-
49
31
  ### CLASS\_NAME
50
32
 
51
33
  > `readonly` **CLASS\_NAME**: `string`
@@ -60,37 +42,73 @@ Runtime name for the class.
60
42
 
61
43
  ### create()
62
44
 
63
- > **create**(`blob`, `mimeType`?, `extension`?, `metadata`?, `namespace`?, `userIdentity`?, `nodeIdentity`?): `Promise`\<`string`\>
45
+ > **create**(`blob`, `encodingFormat?`, `fileExtension?`, `metadata?`, `options?`, `userIdentity?`, `nodeIdentity?`): `Promise`\<`string`\>
64
46
 
65
47
  Create the blob with some metadata.
66
48
 
67
49
  #### Parameters
68
50
 
69
- **blob**: `string`
51
+ ##### blob
52
+
53
+ `string`
70
54
 
71
55
  The data for the blob in base64 format.
72
56
 
73
- **mimeType?**: `string`
57
+ ##### encodingFormat?
58
+
59
+ `string`
74
60
 
75
61
  Mime type for the blob, will be detected if left undefined.
76
62
 
77
- **extension?**: `string`
63
+ ##### fileExtension?
64
+
65
+ `string`
78
66
 
79
67
  Extension for the blob, will be detected if left undefined.
80
68
 
81
- **metadata?**: `IJsonLdNodeObject`
69
+ ##### metadata?
70
+
71
+ `IJsonLdNodeObject`
82
72
 
83
73
  Data for the custom metadata as JSON-LD.
84
74
 
85
- **namespace?**: `string`
75
+ ##### options?
76
+
77
+ Optional options for the creation of the blob.
78
+
79
+ ###### disableEncryption?
80
+
81
+ `boolean`
82
+
83
+ Disables encryption if enabled by default.
84
+
85
+ ###### overrideVaultKeyId?
86
+
87
+ `string`
88
+
89
+ Use a different vault key id for encryption, if not provided the default vault key id will be used.
90
+
91
+ ###### compress?
92
+
93
+ `BlobStorageCompressionType`
94
+
95
+ Optional compression type to use for the blob, defaults to no compression.*
96
+
97
+ ###### namespace?
98
+
99
+ `string`
86
100
 
87
101
  The namespace to use for storing, defaults to component configured namespace.
88
102
 
89
- **userIdentity?**: `string`
103
+ ##### userIdentity?
104
+
105
+ `string`
90
106
 
91
107
  The user identity to use with storage operations.
92
108
 
93
- **nodeIdentity?**: `string`
109
+ ##### nodeIdentity?
110
+
111
+ `string`
94
112
 
95
113
  The node identity to use with storage operations.
96
114
 
@@ -108,49 +126,57 @@ The id of the stored blob in urn format.
108
126
 
109
127
  ### get()
110
128
 
111
- > **get**(`id`, `includeContent`, `userIdentity`?, `nodeIdentity`?): `Promise`\<`object`\>
129
+ > **get**(`id`, `options?`, `userIdentity?`, `nodeIdentity?`): `Promise`\<`IBlobStorageEntry`\>
112
130
 
113
- Get the blob and metadata.
131
+ Get the blob entry.
114
132
 
115
133
  #### Parameters
116
134
 
117
- **id**: `string`
135
+ ##### id
136
+
137
+ `string`
118
138
 
119
139
  The id of the blob to get in urn format.
120
140
 
121
- **includeContent**: `boolean`
141
+ ##### options?
142
+
143
+ Optional options for the retrieval of the blob.
144
+
145
+ ###### includeContent?
146
+
147
+ `boolean`
122
148
 
123
149
  Include the content, or just get the metadata.
124
150
 
125
- **userIdentity?**: `string`
151
+ ###### decompress?
126
152
 
127
- The user identity to use with storage operations.
153
+ `boolean`
128
154
 
129
- **nodeIdentity?**: `string`
155
+ If the content should be decompressed, if it was compressed when stored, defaults to true.
130
156
 
131
- The node identity to use with storage operations.
157
+ ###### overrideVaultKeyId?
132
158
 
133
- #### Returns
159
+ `string`
134
160
 
135
- `Promise`\<`object`\>
161
+ Use a different vault key id for decryption, if not provided the default vault key id will be used.
136
162
 
137
- The metadata and data for the blob if it can be found.
163
+ ##### userIdentity?
138
164
 
139
- ##### blob?
165
+ `string`
140
166
 
141
- > `optional` **blob**: `string`
167
+ The user identity to use with storage operations.
142
168
 
143
- ##### mimeType?
169
+ ##### nodeIdentity?
144
170
 
145
- > `optional` **mimeType**: `string`
171
+ `string`
146
172
 
147
- ##### extension?
173
+ The node identity to use with storage operations.
148
174
 
149
- > `optional` **extension**: `string`
175
+ #### Returns
150
176
 
151
- ##### metadata?
177
+ `Promise`\<`IBlobStorageEntry`\>
152
178
 
153
- > `optional` **metadata**: `IJsonLdNodeObject`
179
+ The entry and data for the blob if it can be found.
154
180
 
155
181
  #### Throws
156
182
 
@@ -164,35 +190,41 @@ Not found error if the blob cannot be found.
164
190
 
165
191
  ### update()
166
192
 
167
- > **update**(`id`, `mimeType`?, `extension`?, `metadata`?, `userIdentity`?, `nodeIdentity`?): `Promise`\<`void`\>
193
+ > **update**(`id`, `encodingFormat?`, `fileExtension?`, `metadata?`, `userIdentity?`): `Promise`\<`void`\>
168
194
 
169
195
  Update the blob with metadata.
170
196
 
171
197
  #### Parameters
172
198
 
173
- **id**: `string`
199
+ ##### id
200
+
201
+ `string`
202
+
203
+ The id of the blob entry to update.
174
204
 
175
- The id of the blob metadata to update.
205
+ ##### encodingFormat?
176
206
 
177
- • **mimeType?**: `string`
207
+ `string`
178
208
 
179
209
  Mime type for the blob, will be detected if left undefined.
180
210
 
181
- **extension?**: `string`
211
+ ##### fileExtension?
212
+
213
+ `string`
182
214
 
183
215
  Extension for the blob, will be detected if left undefined.
184
216
 
185
- **metadata?**: `IJsonLdNodeObject`
217
+ ##### metadata?
186
218
 
187
- Data for the custom metadata as JSON-LD.
219
+ `IJsonLdNodeObject`
188
220
 
189
- **userIdentity?**: `string`
221
+ Data for the custom metadata as JSON-LD.
190
222
 
191
- The user identity to use with storage operations.
223
+ ##### userIdentity?
192
224
 
193
- • **nodeIdentity?**: `string`
225
+ `string`
194
226
 
195
- The node identity to use with storage operations.
227
+ The user identity to use with storage operations.
196
228
 
197
229
  #### Returns
198
230
 
@@ -212,23 +244,23 @@ Not found error if the blob cannot be found.
212
244
 
213
245
  ### remove()
214
246
 
215
- > **remove**(`id`, `userIdentity`?, `nodeIdentity`?): `Promise`\<`void`\>
247
+ > **remove**(`id`, `userIdentity?`): `Promise`\<`void`\>
216
248
 
217
249
  Remove the blob.
218
250
 
219
251
  #### Parameters
220
252
 
221
- **id**: `string`
253
+ ##### id
222
254
 
223
- The id of the blob to remove in urn format.
255
+ `string`
224
256
 
225
- **userIdentity?**: `string`
257
+ The id of the blob to remove in urn format.
226
258
 
227
- The user identity to use with storage operations.
259
+ ##### userIdentity?
228
260
 
229
- • **nodeIdentity?**: `string`
261
+ `string`
230
262
 
231
- The node identity to use with storage operations.
263
+ The user identity to use with storage operations.
232
264
 
233
265
  #### Returns
234
266
 
@@ -239,3 +271,60 @@ Nothing.
239
271
  #### Implementation of
240
272
 
241
273
  `IBlobStorageComponent.remove`
274
+
275
+ ***
276
+
277
+ ### query()
278
+
279
+ > **query**(`conditions?`, `orderBy?`, `orderByDirection?`, `cursor?`, `pageSize?`, `userIdentity?`): `Promise`\<`IBlobStorageEntryList`\>
280
+
281
+ Query all the blob storage entries which match the conditions.
282
+
283
+ #### Parameters
284
+
285
+ ##### conditions?
286
+
287
+ `EntityCondition`\<`IBlobStorageEntry`\>
288
+
289
+ The conditions to match for the entries.
290
+
291
+ ##### orderBy?
292
+
293
+ The order for the results, defaults to created.
294
+
295
+ `"dateCreated"` | `"dateModified"`
296
+
297
+ ##### orderByDirection?
298
+
299
+ `SortDirection`
300
+
301
+ The direction for the order, defaults to descending.
302
+
303
+ ##### cursor?
304
+
305
+ `string`
306
+
307
+ The cursor to request the next page of entries.
308
+
309
+ ##### pageSize?
310
+
311
+ `number`
312
+
313
+ The suggested number of entries to return in each chunk, in some scenarios can return a different amount.
314
+
315
+ ##### userIdentity?
316
+
317
+ `string`
318
+
319
+ The user identity to use with storage operations.
320
+
321
+ #### Returns
322
+
323
+ `Promise`\<`IBlobStorageEntryList`\>
324
+
325
+ All the entries for the storage matching the conditions,
326
+ and a cursor which can be used to request more entities.
327
+
328
+ #### Implementation of
329
+
330
+ `IBlobStorageComponent.query`
@@ -6,15 +6,21 @@ Create a blob in storage.
6
6
 
7
7
  ## Parameters
8
8
 
9
- **httpRequestContext**: `IHttpRequestContext`
9
+ ### httpRequestContext
10
+
11
+ `IHttpRequestContext`
10
12
 
11
13
  The request context for the API.
12
14
 
13
- **componentName**: `string`
15
+ ### componentName
16
+
17
+ `string`
14
18
 
15
19
  The name of the component to use in the routes.
16
20
 
17
- **request**: `IBlobStorageCreateRequest`
21
+ ### request
22
+
23
+ `IBlobStorageCreateRequest`
18
24
 
19
25
  The request.
20
26
 
@@ -6,15 +6,21 @@ Get the blob from storage.
6
6
 
7
7
  ## Parameters
8
8
 
9
- **httpRequestContext**: `IHttpRequestContext`
9
+ ### httpRequestContext
10
+
11
+ `IHttpRequestContext`
10
12
 
11
13
  The request context for the API.
12
14
 
13
- **componentName**: `string`
15
+ ### componentName
16
+
17
+ `string`
14
18
 
15
19
  The name of the component to use in the routes.
16
20
 
17
- **request**: `IBlobStorageGetRequest`
21
+ ### request
22
+
23
+ `IBlobStorageGetRequest`
18
24
 
19
25
  The request.
20
26
 
@@ -6,15 +6,21 @@ Get the blob from storage.
6
6
 
7
7
  ## Parameters
8
8
 
9
- **httpRequestContext**: `IHttpRequestContext`
9
+ ### httpRequestContext
10
+
11
+ `IHttpRequestContext`
10
12
 
11
13
  The request context for the API.
12
14
 
13
- **componentName**: `string`
15
+ ### componentName
16
+
17
+ `string`
14
18
 
15
19
  The name of the component to use in the routes.
16
20
 
17
- **request**: `IBlobStorageGetContentRequest`
21
+ ### request
22
+
23
+ `IBlobStorageGetContentRequest`
18
24
 
19
25
  The request.
20
26
 
@@ -0,0 +1,31 @@
1
+ # Function: blobStorageList()
2
+
3
+ > **blobStorageList**(`httpRequestContext`, `componentName`, `request`): `Promise`\<`IBlobStorageListResponse`\>
4
+
5
+ List the entries from blob storage.
6
+
7
+ ## Parameters
8
+
9
+ ### httpRequestContext
10
+
11
+ `IHttpRequestContext`
12
+
13
+ The request context for the API.
14
+
15
+ ### componentName
16
+
17
+ `string`
18
+
19
+ The name of the component to use in the routes.
20
+
21
+ ### request
22
+
23
+ `IBlobStorageListRequest`
24
+
25
+ The request.
26
+
27
+ ## Returns
28
+
29
+ `Promise`\<`IBlobStorageListResponse`\>
30
+
31
+ The response object with additional http response properties.
@@ -6,15 +6,21 @@ Remove the blob from storage.
6
6
 
7
7
  ## Parameters
8
8
 
9
- **httpRequestContext**: `IHttpRequestContext`
9
+ ### httpRequestContext
10
+
11
+ `IHttpRequestContext`
10
12
 
11
13
  The request context for the API.
12
14
 
13
- **componentName**: `string`
15
+ ### componentName
16
+
17
+ `string`
14
18
 
15
19
  The name of the component to use in the routes.
16
20
 
17
- **request**: `IBlobStorageRemoveRequest`
21
+ ### request
22
+
23
+ `IBlobStorageRemoveRequest`
18
24
 
19
25
  The request.
20
26
 
@@ -6,15 +6,21 @@ Update the blob storage metadata.
6
6
 
7
7
  ## Parameters
8
8
 
9
- **httpRequestContext**: `IHttpRequestContext`
9
+ ### httpRequestContext
10
+
11
+ `IHttpRequestContext`
10
12
 
11
13
  The request context for the API.
12
14
 
13
- **componentName**: `string`
15
+ ### componentName
16
+
17
+ `string`
14
18
 
15
19
  The name of the component to use in the routes.
16
20
 
17
- **request**: `IBlobStorageUpdateRequest`
21
+ ### request
22
+
23
+ `IBlobStorageUpdateRequest`
18
24
 
19
25
  The request.
20
26
 
@@ -1,33 +1,41 @@
1
1
  # Function: generateRestRoutesBlobStorage()
2
2
 
3
- > **generateRestRoutesBlobStorage**(`baseRouteName`, `componentName`, `options`?): `IRestRoute`[]
3
+ > **generateRestRoutesBlobStorage**(`baseRouteName`, `componentName`, `options?`): `IRestRoute`\<`any`, `any`\>[]
4
4
 
5
5
  The REST routes for blob storage.
6
6
 
7
7
  ## Parameters
8
8
 
9
- **baseRouteName**: `string`
9
+ ### baseRouteName
10
+
11
+ `string`
10
12
 
11
13
  Prefix to prepend to the paths.
12
14
 
13
- **componentName**: `string`
15
+ ### componentName
16
+
17
+ `string`
14
18
 
15
19
  The name of the component to use in the routes stored in the ComponentFactory.
16
20
 
17
- **options?**
21
+ ### options?
18
22
 
19
23
  Additional options for the routes.
20
24
 
21
- **options.typeName?**: `string`
25
+ #### typeName?
26
+
27
+ `string`
22
28
 
23
29
  Optional type name to use in the routes, defaults to Blob Storage.
24
30
 
25
- **options.tagName?**: `string`
31
+ #### tagName?
32
+
33
+ `string`
26
34
 
27
35
  Optional name to use in OpenAPI spec for tag.
28
36
 
29
37
  ## Returns
30
38
 
31
- `IRestRoute`[]
39
+ `IRestRoute`\<`any`, `any`\>[]
32
40
 
33
41
  The generated routes.
@@ -3,11 +3,12 @@
3
3
  ## Classes
4
4
 
5
5
  - [BlobStorageService](classes/BlobStorageService.md)
6
- - [BlobMetadata](classes/BlobMetadata.md)
6
+ - [BlobStorageEntry](classes/BlobStorageEntry.md)
7
7
 
8
8
  ## Interfaces
9
9
 
10
10
  - [IBlobStorageServiceConfig](interfaces/IBlobStorageServiceConfig.md)
11
+ - [IBlobStorageServiceConstructorOptions](interfaces/IBlobStorageServiceConstructorOptions.md)
11
12
 
12
13
  ## Variables
13
14
 
@@ -22,4 +23,5 @@
22
23
  - [blobStorageGetContent](functions/blobStorageGetContent.md)
23
24
  - [blobStorageUpdate](functions/blobStorageUpdate.md)
24
25
  - [blobStorageRemove](functions/blobStorageRemove.md)
26
+ - [blobStorageList](functions/blobStorageList.md)
25
27
  - [initSchema](functions/initSchema.md)