@twin.org/blob-storage-service 0.0.2-next.4 → 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/blobStorageRoutes.js +528 -0
- package/dist/es/blobStorageRoutes.js.map +1 -0
- package/dist/es/blobStorageService.js +359 -0
- package/dist/es/blobStorageService.js.map +1 -0
- package/dist/es/entities/blobStorageEntry.js +96 -0
- package/dist/es/entities/blobStorageEntry.js.map +1 -0
- package/dist/es/index.js +10 -0
- package/dist/es/index.js.map +1 -0
- package/dist/es/models/IBlobStorageServiceConfig.js +4 -0
- package/dist/es/models/IBlobStorageServiceConfig.js.map +1 -0
- package/dist/es/models/IBlobStorageServiceConstructorOptions.js +2 -0
- package/dist/es/models/IBlobStorageServiceConstructorOptions.js.map +1 -0
- package/dist/es/restEntryPoints.js +15 -0
- package/dist/es/restEntryPoints.js.map +1 -0
- package/dist/es/schema.js +11 -0
- package/dist/es/schema.js.map +1 -0
- package/dist/types/blobStorageService.d.ts +14 -16
- package/dist/types/entities/blobStorageEntry.d.ts +0 -4
- package/dist/types/index.d.ts +7 -7
- package/dist/types/models/IBlobStorageServiceConfig.d.ts +0 -4
- package/dist/types/models/IBlobStorageServiceConstructorOptions.d.ts +1 -1
- package/docs/changelog.md +49 -0
- package/docs/open-api/spec.json +38 -497
- package/docs/reference/classes/BlobStorageEntry.md +0 -8
- package/docs/reference/classes/BlobStorageService.md +24 -52
- package/docs/reference/interfaces/IBlobStorageServiceConfig.md +0 -8
- package/locales/en.json +3 -1
- package/package.json +12 -9
- package/dist/cjs/index.cjs +0 -1084
- package/dist/esm/index.mjs +0 -1072
|
@@ -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
|
*/
|
|
@@ -9,12 +9,17 @@ export declare class BlobStorageService implements IBlobStorageComponent {
|
|
|
9
9
|
/**
|
|
10
10
|
* Runtime name for the class.
|
|
11
11
|
*/
|
|
12
|
-
readonly CLASS_NAME: string;
|
|
12
|
+
static readonly CLASS_NAME: string;
|
|
13
13
|
/**
|
|
14
14
|
* Create a new instance of BlobStorageService.
|
|
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
|
-
}
|
|
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,35 +53,32 @@ export declare class BlobStorageService implements IBlobStorageComponent {
|
|
|
52
53
|
includeContent?: boolean;
|
|
53
54
|
decompress?: boolean;
|
|
54
55
|
overrideVaultKeyId?: string;
|
|
55
|
-
}
|
|
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
|
|
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
|
|
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.
|
|
77
76
|
* @param orderBy The order for the results, defaults to created.
|
|
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
|
-
* @param
|
|
81
|
-
* @param userIdentity The user identity to use with storage operations.
|
|
79
|
+
* @param limit The suggested number of entries to return in each chunk, in some scenarios can return a different amount.
|
|
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,
|
|
83
|
+
query(conditions?: EntityCondition<IBlobStorageEntry>, orderBy?: keyof Pick<IBlobStorageEntry, "dateCreated" | "dateModified">, orderByDirection?: SortDirection, cursor?: string, limit?: number): Promise<IBlobStorageEntryList>;
|
|
86
84
|
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -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
|
}
|
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,54 @@
|
|
|
1
1
|
# @twin.org/blob-storage-service - Changelog
|
|
2
2
|
|
|
3
|
+
## [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)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* add compression support ([67d239b](https://github.com/twinfoundation/blob-storage/commit/67d239bca8321bd90bf4ff93167c564130309730))
|
|
9
|
+
* add context id features ([#30](https://github.com/twinfoundation/blob-storage/issues/30)) ([fbf1c92](https://github.com/twinfoundation/blob-storage/commit/fbf1c9276424c841ef5ef3f4de8469ab3fba7e9c))
|
|
10
|
+
* add validate-locales ([f20fcec](https://github.com/twinfoundation/blob-storage/commit/f20fceced91e39a0c9edb770b2e43ce944c92f3c))
|
|
11
|
+
* additional encryption options on per item basis ([4b95a65](https://github.com/twinfoundation/blob-storage/commit/4b95a656d19e3b571cea905e36f29b679b13e1e8))
|
|
12
|
+
* eslint migration to flat config ([e4239dd](https://github.com/twinfoundation/blob-storage/commit/e4239dd1c721955cff7f0357255d2bba15319972))
|
|
13
|
+
* remove includeNodeIdentity flag ([13bc334](https://github.com/twinfoundation/blob-storage/commit/13bc33445b179879688af3c98e8be8a5609d3f46))
|
|
14
|
+
* remove unused namespace ([6376433](https://github.com/twinfoundation/blob-storage/commit/637643399ffa42dbf6af07e7579e82e392ac90c9))
|
|
15
|
+
* update dependencies ([56f0094](https://github.com/twinfoundation/blob-storage/commit/56f0094b68d8bd22864cd899ac1b61d95540f719))
|
|
16
|
+
* update framework core ([ff339fe](https://github.com/twinfoundation/blob-storage/commit/ff339fe7e3f09ddff429907834bdf43617e9c05e))
|
|
17
|
+
* update to support fully qualified data type names ([3297d69](https://github.com/twinfoundation/blob-storage/commit/3297d69d332058b0f0141002087f56ba230620e1))
|
|
18
|
+
* use shared store mechanism ([#12](https://github.com/twinfoundation/blob-storage/issues/12)) ([cae8110](https://github.com/twinfoundation/blob-storage/commit/cae8110681847a1ac4fcac968b8196694e49c320))
|
|
19
|
+
* use standard list json ld types ([d6bdfd6](https://github.com/twinfoundation/blob-storage/commit/d6bdfd68af47f70f3cc53658b4a12543497e1f48))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Bug Fixes
|
|
23
|
+
|
|
24
|
+
* 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))
|
|
25
|
+
* query params force coercion ([a5e547a](https://github.com/twinfoundation/blob-storage/commit/a5e547a775f8997cb04780938c7a9561ddb048d1))
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### Dependencies
|
|
29
|
+
|
|
30
|
+
* The following workspace dependencies were updated
|
|
31
|
+
* dependencies
|
|
32
|
+
* @twin.org/blob-storage-models bumped from 0.0.3-next.0 to 0.0.3-next.1
|
|
33
|
+
* devDependencies
|
|
34
|
+
* @twin.org/blob-storage-connector-memory bumped from 0.0.3-next.0 to 0.0.3-next.1
|
|
35
|
+
|
|
36
|
+
## [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)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
### Features
|
|
40
|
+
|
|
41
|
+
* add validate-locales ([f20fcec](https://github.com/twinfoundation/blob-storage/commit/f20fceced91e39a0c9edb770b2e43ce944c92f3c))
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
### Dependencies
|
|
45
|
+
|
|
46
|
+
* The following workspace dependencies were updated
|
|
47
|
+
* dependencies
|
|
48
|
+
* @twin.org/blob-storage-models bumped from 0.0.2-next.4 to 0.0.2-next.5
|
|
49
|
+
* devDependencies
|
|
50
|
+
* @twin.org/blob-storage-connector-memory bumped from 0.0.2-next.4 to 0.0.2-next.5
|
|
51
|
+
|
|
3
52
|
## [0.0.2-next.4](https://github.com/twinfoundation/blob-storage/compare/blob-storage-service-v0.0.2-next.3...blob-storage-service-v0.0.2-next.4) (2025-10-02)
|
|
4
53
|
|
|
5
54
|
|