@twin.org/blob-storage-service 0.0.2-next.5 → 0.0.3-next.2

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.
@@ -1,7 +1,7 @@
1
1
  import { type BlobStorageCompressionType, type IBlobStorageComponent, type IBlobStorageEntry, type IBlobStorageEntryList } from "@twin.org/blob-storage-models";
2
2
  import { type IJsonLdNodeObject } from "@twin.org/data-json-ld";
3
3
  import { SortDirection, type EntityCondition } from "@twin.org/entity";
4
- import type { IBlobStorageServiceConstructorOptions } from "./models/IBlobStorageServiceConstructorOptions";
4
+ import type { IBlobStorageServiceConstructorOptions } from "./models/IBlobStorageServiceConstructorOptions.js";
5
5
  /**
6
6
  * Service for performing blob storage operations to a connector.
7
7
  */
@@ -15,6 +15,11 @@ export declare class BlobStorageService implements IBlobStorageComponent {
15
15
  * @param options The options for the service.
16
16
  */
17
17
  constructor(options?: IBlobStorageServiceConstructorOptions);
18
+ /**
19
+ * Returns the class name of the component.
20
+ * @returns The class name of the component.
21
+ */
22
+ className(): string;
18
23
  /**
19
24
  * Create the blob with some metadata.
20
25
  * @param blob The data for the blob in base64 format.
@@ -24,10 +29,8 @@ export declare class BlobStorageService implements IBlobStorageComponent {
24
29
  * @param options Optional options for the creation of the blob.
25
30
  * @param options.disableEncryption Disables encryption if enabled by default.
26
31
  * @param options.overrideVaultKeyId Use a different vault key id for encryption, if not provided the default vault key id will be used.
27
- * @param options.compress Optional compression type to use for the blob, defaults to no compression.*
32
+ * @param options.compress Optional compression type to use for the blob, defaults to no compression.
28
33
  * @param options.namespace The namespace to use for storing, defaults to component configured namespace.
29
- * @param userIdentity The user identity to use with storage operations.
30
- * @param nodeIdentity The node identity to use with storage operations.
31
34
  * @returns The id of the stored blob in urn format.
32
35
  */
33
36
  create(blob: string, encodingFormat?: string, fileExtension?: string, metadata?: IJsonLdNodeObject, options?: {
@@ -35,7 +38,7 @@ export declare class BlobStorageService implements IBlobStorageComponent {
35
38
  overrideVaultKeyId?: string;
36
39
  compress?: BlobStorageCompressionType;
37
40
  namespace?: string;
38
- }, userIdentity?: string, nodeIdentity?: string): Promise<string>;
41
+ }): Promise<string>;
39
42
  /**
40
43
  * Get the blob entry.
41
44
  * @param id The id of the blob to get in urn format.
@@ -43,8 +46,6 @@ export declare class BlobStorageService implements IBlobStorageComponent {
43
46
  * @param options.includeContent Include the content, or just get the metadata.
44
47
  * @param options.overrideVaultKeyId Use a different vault key id for decryption, if not provided the default vault key id will be used.
45
48
  * @param options.decompress If the content should be decompressed, if it was compressed when stored, defaults to true.
46
- * @param userIdentity The user identity to use with storage operations.
47
- * @param nodeIdentity The node identity to use with storage operations.
48
49
  * @returns The entry and data for the blob if it can be found.
49
50
  * @throws Not found error if the blob cannot be found.
50
51
  */
@@ -52,25 +53,23 @@ export declare class BlobStorageService implements IBlobStorageComponent {
52
53
  includeContent?: boolean;
53
54
  decompress?: boolean;
54
55
  overrideVaultKeyId?: string;
55
- }, userIdentity?: string, nodeIdentity?: string): Promise<IBlobStorageEntry>;
56
+ }): Promise<IBlobStorageEntry>;
56
57
  /**
57
58
  * Update the blob with metadata.
58
59
  * @param id The id of the blob entry to update.
59
60
  * @param encodingFormat Mime type for the blob, will be detected if left undefined.
60
61
  * @param fileExtension Extension for the blob, will be detected if left undefined.
61
62
  * @param metadata Data for the custom metadata as JSON-LD.
62
- * @param userIdentity The user identity to use with storage operations.
63
63
  * @returns Nothing.
64
64
  * @throws Not found error if the blob cannot be found.
65
65
  */
66
- update(id: string, encodingFormat?: string, fileExtension?: string, metadata?: IJsonLdNodeObject, userIdentity?: string): Promise<void>;
66
+ update(id: string, encodingFormat?: string, fileExtension?: string, metadata?: IJsonLdNodeObject): Promise<void>;
67
67
  /**
68
68
  * Remove the blob.
69
69
  * @param id The id of the blob to remove in urn format.
70
- * @param userIdentity The user identity to use with storage operations.
71
70
  * @returns Nothing.
72
71
  */
73
- remove(id: string, userIdentity?: string): Promise<void>;
72
+ remove(id: string): Promise<void>;
74
73
  /**
75
74
  * Query all the blob storage entries which match the conditions.
76
75
  * @param conditions The conditions to match for the entries.
@@ -78,9 +77,8 @@ export declare class BlobStorageService implements IBlobStorageComponent {
78
77
  * @param orderByDirection The direction for the order, defaults to descending.
79
78
  * @param cursor The cursor to request the next page of entries.
80
79
  * @param limit The suggested number of entries to return in each chunk, in some scenarios can return a different amount.
81
- * @param userIdentity The user identity to use with storage operations.
82
80
  * @returns All the entries for the storage matching the conditions,
83
81
  * and a cursor which can be used to request more entities.
84
82
  */
85
- query(conditions?: EntityCondition<IBlobStorageEntry>, orderBy?: keyof Pick<IBlobStorageEntry, "dateCreated" | "dateModified">, orderByDirection?: SortDirection, cursor?: string, limit?: number, userIdentity?: string): Promise<IBlobStorageEntryList>;
83
+ query(conditions?: EntityCondition<IBlobStorageEntry>, orderBy?: keyof Pick<IBlobStorageEntry, "dateCreated" | "dateModified">, orderByDirection?: SortDirection, cursor?: string, limit?: number): Promise<IBlobStorageEntryList>;
86
84
  }
@@ -44,8 +44,4 @@ export declare class BlobStorageEntry {
44
44
  * Is the entry compressed.
45
45
  */
46
46
  compression?: BlobStorageCompressionType;
47
- /**
48
- * The user identity that created the blob.
49
- */
50
- userIdentity?: string;
51
47
  }
@@ -1,7 +1,7 @@
1
- export * from "./blobStorageRoutes";
2
- export * from "./blobStorageService";
3
- export * from "./entities/blobStorageEntry";
4
- export * from "./models/IBlobStorageServiceConfig";
5
- export * from "./models/IBlobStorageServiceConstructorOptions";
6
- export * from "./restEntryPoints";
7
- export * from "./schema";
1
+ export * from "./blobStorageRoutes.js";
2
+ export * from "./blobStorageService.js";
3
+ export * from "./entities/blobStorageEntry.js";
4
+ export * from "./models/IBlobStorageServiceConfig.js";
5
+ export * from "./models/IBlobStorageServiceConstructorOptions.js";
6
+ export * from "./restEntryPoints.js";
7
+ export * from "./schema.js";
@@ -11,8 +11,4 @@ export interface IBlobStorageServiceConfig {
11
11
  * Defaults to the first entry in the factory if not provided.
12
12
  */
13
13
  defaultNamespace?: string;
14
- /**
15
- * Include the user identity when performing storage operations, allow partitioning per user, defaults to false.
16
- */
17
- partitionPerUser?: boolean;
18
14
  }
@@ -1,4 +1,4 @@
1
- import type { IBlobStorageServiceConfig } from "./IBlobStorageServiceConfig";
1
+ import type { IBlobStorageServiceConfig } from "./IBlobStorageServiceConfig.js";
2
2
  /**
3
3
  * Options for the Blob Storage Service constructor.
4
4
  */
package/docs/changelog.md CHANGED
@@ -1,5 +1,59 @@
1
1
  # @twin.org/blob-storage-service - Changelog
2
2
 
3
+ ## [0.0.3-next.2](https://github.com/twinfoundation/blob-storage/compare/blob-storage-service-v0.0.3-next.1...blob-storage-service-v0.0.3-next.2) (2026-01-14)
4
+
5
+
6
+ ### Features
7
+
8
+ * update contexts and namespaces ([#32](https://github.com/twinfoundation/blob-storage/issues/32)) ([187ed36](https://github.com/twinfoundation/blob-storage/commit/187ed36a7d83062665f70689ec5e2b2f553a592e))
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * api docs ([0f5d3ad](https://github.com/twinfoundation/blob-storage/commit/0f5d3ad88c4c048495ffd64886d00ceb25a976d6))
14
+
15
+
16
+ ### Dependencies
17
+
18
+ * The following workspace dependencies were updated
19
+ * dependencies
20
+ * @twin.org/blob-storage-models bumped from 0.0.3-next.1 to 0.0.3-next.2
21
+ * devDependencies
22
+ * @twin.org/blob-storage-connector-memory bumped from 0.0.3-next.1 to 0.0.3-next.2
23
+
24
+ ## [0.0.3-next.1](https://github.com/twinfoundation/blob-storage/compare/blob-storage-service-v0.0.3-next.0...blob-storage-service-v0.0.3-next.1) (2025-11-11)
25
+
26
+
27
+ ### Features
28
+
29
+ * add compression support ([67d239b](https://github.com/twinfoundation/blob-storage/commit/67d239bca8321bd90bf4ff93167c564130309730))
30
+ * add context id features ([#30](https://github.com/twinfoundation/blob-storage/issues/30)) ([fbf1c92](https://github.com/twinfoundation/blob-storage/commit/fbf1c9276424c841ef5ef3f4de8469ab3fba7e9c))
31
+ * add validate-locales ([f20fcec](https://github.com/twinfoundation/blob-storage/commit/f20fceced91e39a0c9edb770b2e43ce944c92f3c))
32
+ * additional encryption options on per item basis ([4b95a65](https://github.com/twinfoundation/blob-storage/commit/4b95a656d19e3b571cea905e36f29b679b13e1e8))
33
+ * eslint migration to flat config ([e4239dd](https://github.com/twinfoundation/blob-storage/commit/e4239dd1c721955cff7f0357255d2bba15319972))
34
+ * remove includeNodeIdentity flag ([13bc334](https://github.com/twinfoundation/blob-storage/commit/13bc33445b179879688af3c98e8be8a5609d3f46))
35
+ * remove unused namespace ([6376433](https://github.com/twinfoundation/blob-storage/commit/637643399ffa42dbf6af07e7579e82e392ac90c9))
36
+ * update dependencies ([56f0094](https://github.com/twinfoundation/blob-storage/commit/56f0094b68d8bd22864cd899ac1b61d95540f719))
37
+ * update framework core ([ff339fe](https://github.com/twinfoundation/blob-storage/commit/ff339fe7e3f09ddff429907834bdf43617e9c05e))
38
+ * update to support fully qualified data type names ([3297d69](https://github.com/twinfoundation/blob-storage/commit/3297d69d332058b0f0141002087f56ba230620e1))
39
+ * use shared store mechanism ([#12](https://github.com/twinfoundation/blob-storage/issues/12)) ([cae8110](https://github.com/twinfoundation/blob-storage/commit/cae8110681847a1ac4fcac968b8196694e49c320))
40
+ * use standard list json ld types ([d6bdfd6](https://github.com/twinfoundation/blob-storage/commit/d6bdfd68af47f70f3cc53658b4a12543497e1f48))
41
+
42
+
43
+ ### Bug Fixes
44
+
45
+ * Adding the optional flag to the entity ([#10](https://github.com/twinfoundation/blob-storage/issues/10)) ([626677e](https://github.com/twinfoundation/blob-storage/commit/626677e5730d23535a0eb1f36f8394d941ff2447))
46
+ * query params force coercion ([a5e547a](https://github.com/twinfoundation/blob-storage/commit/a5e547a775f8997cb04780938c7a9561ddb048d1))
47
+
48
+
49
+ ### Dependencies
50
+
51
+ * The following workspace dependencies were updated
52
+ * dependencies
53
+ * @twin.org/blob-storage-models bumped from 0.0.3-next.0 to 0.0.3-next.1
54
+ * devDependencies
55
+ * @twin.org/blob-storage-connector-memory bumped from 0.0.3-next.0 to 0.0.3-next.1
56
+
3
57
  ## [0.0.2-next.5](https://github.com/twinfoundation/blob-storage/compare/blob-storage-service-v0.0.2-next.4...blob-storage-service-v0.0.2-next.5) (2025-10-09)
4
58
 
5
59
 
@@ -388,10 +388,7 @@
388
388
  "in": "query",
389
389
  "required": false,
390
390
  "schema": {
391
- "type": [
392
- "boolean",
393
- "string"
394
- ]
391
+ "type": "string"
395
392
  },
396
393
  "example": "true"
397
394
  },
@@ -401,10 +398,7 @@
401
398
  "in": "query",
402
399
  "required": false,
403
400
  "schema": {
404
- "type": [
405
- "boolean",
406
- "string"
407
- ]
401
+ "type": "string"
408
402
  }
409
403
  },
410
404
  {
@@ -983,9 +977,6 @@
983
977
  "@context": {
984
978
  "type": "array",
985
979
  "minItems": 2,
986
- "items": {
987
- "$ref": "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
988
- },
989
980
  "description": "JSON-LD Context.",
990
981
  "prefixItems": [
991
982
  {
@@ -996,7 +987,10 @@
996
987
  "type": "string",
997
988
  "const": "https://schema.twindev.org/common/"
998
989
  }
999
- ]
990
+ ],
991
+ "items": {
992
+ "$ref": "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
993
+ }
1000
994
  },
1001
995
  "type": {
1002
996
  "type": "string",
@@ -1063,9 +1057,6 @@
1063
1057
  "@context": {
1064
1058
  "type": "array",
1065
1059
  "minItems": 3,
1066
- "items": {
1067
- "$ref": "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
1068
- },
1069
1060
  "description": "JSON-LD Context.",
1070
1061
  "prefixItems": [
1071
1062
  {
@@ -1080,7 +1071,10 @@
1080
1071
  "type": "string",
1081
1072
  "const": "https://schema.twindev.org/common/"
1082
1073
  }
1083
- ]
1074
+ ],
1075
+ "items": {
1076
+ "$ref": "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
1077
+ }
1084
1078
  },
1085
1079
  "type": {
1086
1080
  "type": "string",
@@ -1089,13 +1083,10 @@
1089
1083
  },
1090
1084
  "itemListElement": {
1091
1085
  "type": "array",
1092
- "items": false,
1093
- "description": "The list of entries.",
1094
- "prefixItems": [
1095
- {
1096
- "$ref": "#/components/schemas/BlobStorageEntry"
1097
- }
1098
- ]
1086
+ "items": {
1087
+ "$ref": "#/components/schemas/BlobStorageEntry"
1088
+ },
1089
+ "description": "The list of entries."
1099
1090
  },
1100
1091
  "nextItem": {
1101
1092
  "type": "string",
@@ -91,11 +91,3 @@ Is the entry encrypted.
91
91
  > `optional` **compression**: `BlobStorageCompressionType`
92
92
 
93
93
  Is the entry compressed.
94
-
95
- ***
96
-
97
- ### userIdentity?
98
-
99
- > `optional` **userIdentity**: `string`
100
-
101
- The user identity that created the blob.
@@ -36,9 +36,27 @@ Runtime name for the class.
36
36
 
37
37
  ## Methods
38
38
 
39
+ ### className()
40
+
41
+ > **className**(): `string`
42
+
43
+ Returns the class name of the component.
44
+
45
+ #### Returns
46
+
47
+ `string`
48
+
49
+ The class name of the component.
50
+
51
+ #### Implementation of
52
+
53
+ `IBlobStorageComponent.className`
54
+
55
+ ***
56
+
39
57
  ### create()
40
58
 
41
- > **create**(`blob`, `encodingFormat?`, `fileExtension?`, `metadata?`, `options?`, `userIdentity?`, `nodeIdentity?`): `Promise`\<`string`\>
59
+ > **create**(`blob`, `encodingFormat?`, `fileExtension?`, `metadata?`, `options?`): `Promise`\<`string`\>
42
60
 
43
61
  Create the blob with some metadata.
44
62
 
@@ -88,7 +106,7 @@ Use a different vault key id for encryption, if not provided the default vault k
88
106
 
89
107
  `BlobStorageCompressionType`
90
108
 
91
- Optional compression type to use for the blob, defaults to no compression.*
109
+ Optional compression type to use for the blob, defaults to no compression.
92
110
 
93
111
  ###### namespace?
94
112
 
@@ -96,18 +114,6 @@ Optional compression type to use for the blob, defaults to no compression.*
96
114
 
97
115
  The namespace to use for storing, defaults to component configured namespace.
98
116
 
99
- ##### userIdentity?
100
-
101
- `string`
102
-
103
- The user identity to use with storage operations.
104
-
105
- ##### nodeIdentity?
106
-
107
- `string`
108
-
109
- The node identity to use with storage operations.
110
-
111
117
  #### Returns
112
118
 
113
119
  `Promise`\<`string`\>
@@ -122,7 +128,7 @@ The id of the stored blob in urn format.
122
128
 
123
129
  ### get()
124
130
 
125
- > **get**(`id`, `options?`, `userIdentity?`, `nodeIdentity?`): `Promise`\<`IBlobStorageEntry`\>
131
+ > **get**(`id`, `options?`): `Promise`\<`IBlobStorageEntry`\>
126
132
 
127
133
  Get the blob entry.
128
134
 
@@ -156,18 +162,6 @@ If the content should be decompressed, if it was compressed when stored, default
156
162
 
157
163
  Use a different vault key id for decryption, if not provided the default vault key id will be used.
158
164
 
159
- ##### userIdentity?
160
-
161
- `string`
162
-
163
- The user identity to use with storage operations.
164
-
165
- ##### nodeIdentity?
166
-
167
- `string`
168
-
169
- The node identity to use with storage operations.
170
-
171
165
  #### Returns
172
166
 
173
167
  `Promise`\<`IBlobStorageEntry`\>
@@ -186,7 +180,7 @@ Not found error if the blob cannot be found.
186
180
 
187
181
  ### update()
188
182
 
189
- > **update**(`id`, `encodingFormat?`, `fileExtension?`, `metadata?`, `userIdentity?`): `Promise`\<`void`\>
183
+ > **update**(`id`, `encodingFormat?`, `fileExtension?`, `metadata?`): `Promise`\<`void`\>
190
184
 
191
185
  Update the blob with metadata.
192
186
 
@@ -216,12 +210,6 @@ Extension for the blob, will be detected if left undefined.
216
210
 
217
211
  Data for the custom metadata as JSON-LD.
218
212
 
219
- ##### userIdentity?
220
-
221
- `string`
222
-
223
- The user identity to use with storage operations.
224
-
225
213
  #### Returns
226
214
 
227
215
  `Promise`\<`void`\>
@@ -240,7 +228,7 @@ Not found error if the blob cannot be found.
240
228
 
241
229
  ### remove()
242
230
 
243
- > **remove**(`id`, `userIdentity?`): `Promise`\<`void`\>
231
+ > **remove**(`id`): `Promise`\<`void`\>
244
232
 
245
233
  Remove the blob.
246
234
 
@@ -252,12 +240,6 @@ Remove the blob.
252
240
 
253
241
  The id of the blob to remove in urn format.
254
242
 
255
- ##### userIdentity?
256
-
257
- `string`
258
-
259
- The user identity to use with storage operations.
260
-
261
243
  #### Returns
262
244
 
263
245
  `Promise`\<`void`\>
@@ -272,7 +254,7 @@ Nothing.
272
254
 
273
255
  ### query()
274
256
 
275
- > **query**(`conditions?`, `orderBy?`, `orderByDirection?`, `cursor?`, `limit?`, `userIdentity?`): `Promise`\<`IBlobStorageEntryList`\>
257
+ > **query**(`conditions?`, `orderBy?`, `orderByDirection?`, `cursor?`, `limit?`): `Promise`\<`IBlobStorageEntryList`\>
276
258
 
277
259
  Query all the blob storage entries which match the conditions.
278
260
 
@@ -308,12 +290,6 @@ The cursor to request the next page of entries.
308
290
 
309
291
  The suggested number of entries to return in each chunk, in some scenarios can return a different amount.
310
292
 
311
- ##### userIdentity?
312
-
313
- `string`
314
-
315
- The user identity to use with storage operations.
316
-
317
293
  #### Returns
318
294
 
319
295
  `Promise`\<`IBlobStorageEntryList`\>
@@ -18,11 +18,3 @@ The name of the vault key to use for encryption, if not configured no encryption
18
18
 
19
19
  The namespace of the default storage connector to use.
20
20
  Defaults to the first entry in the factory if not provided.
21
-
22
- ***
23
-
24
- ### partitionPerUser?
25
-
26
- > `optional` **partitionPerUser**: `boolean`
27
-
28
- Include the user identity when performing storage operations, allow partitioning per user, defaults to false.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/blob-storage-service",
3
- "version": "0.0.2-next.5",
3
+ "version": "0.0.3-next.2",
4
4
  "description": "Blob storage contract implementation and REST endpoint definitions",
5
5
  "repository": {
6
6
  "type": "git",
@@ -15,7 +15,8 @@
15
15
  },
16
16
  "dependencies": {
17
17
  "@twin.org/api-models": "next",
18
- "@twin.org/blob-storage-models": "0.0.2-next.5",
18
+ "@twin.org/blob-storage-models": "0.0.3-next.2",
19
+ "@twin.org/context": "next",
19
20
  "@twin.org/core": "next",
20
21
  "@twin.org/crypto": "next",
21
22
  "@twin.org/data-json-ld": "next",
@@ -26,20 +27,18 @@
26
27
  "@twin.org/vault-models": "next",
27
28
  "@twin.org/web": "next"
28
29
  },
29
- "main": "./dist/cjs/index.cjs",
30
- "module": "./dist/esm/index.mjs",
30
+ "main": "./dist/es/index.js",
31
31
  "types": "./dist/types/index.d.ts",
32
32
  "exports": {
33
33
  ".": {
34
34
  "types": "./dist/types/index.d.ts",
35
- "require": "./dist/cjs/index.cjs",
36
- "import": "./dist/esm/index.mjs"
35
+ "import": "./dist/es/index.js",
36
+ "default": "./dist/es/index.js"
37
37
  },
38
38
  "./locales/*.json": "./locales/*.json"
39
39
  },
40
40
  "files": [
41
- "dist/cjs",
42
- "dist/esm",
41
+ "dist/es",
43
42
  "dist/types",
44
43
  "locales",
45
44
  "docs"