@twin.org/blob-storage-models 0.0.1-next.34 → 0.0.1-next.35
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/cjs/index.cjs +4 -0
- package/dist/esm/index.mjs +4 -0
- package/dist/types/models/IBlobStorageComponent.d.ts +18 -4
- package/dist/types/models/IBlobStorageEntry.d.ts +4 -0
- package/dist/types/models/api/IBlobStorageCreateRequest.d.ts +10 -0
- package/dist/types/models/api/IBlobStorageGetContentRequest.d.ts +11 -1
- package/dist/types/models/api/IBlobStorageGetRequest.d.ts +11 -1
- package/dist/types/models/api/IBlobStorageUpdateRequest.d.ts +10 -0
- package/docs/changelog.md +7 -0
- package/docs/reference/interfaces/IBlobStorageComponent.md +36 -4
- package/docs/reference/interfaces/IBlobStorageCreateRequest.md +24 -0
- package/docs/reference/interfaces/IBlobStorageEntry.md +8 -0
- package/docs/reference/interfaces/IBlobStorageGetContentRequest.md +25 -1
- package/docs/reference/interfaces/IBlobStorageGetRequest.md +25 -1
- package/docs/reference/interfaces/IBlobStorageUpdateRequest.md +24 -0
- package/package.json +1 -1
package/dist/cjs/index.cjs
CHANGED
|
@@ -85,6 +85,10 @@ var properties = {
|
|
|
85
85
|
type: "string",
|
|
86
86
|
description: "The mime type for the blob."
|
|
87
87
|
},
|
|
88
|
+
isEncrypted: {
|
|
89
|
+
type: "boolean",
|
|
90
|
+
description: "Indicates if the blob is encrypted."
|
|
91
|
+
},
|
|
88
92
|
fileExtension: {
|
|
89
93
|
type: "string",
|
|
90
94
|
description: "The extension."
|
package/dist/esm/index.mjs
CHANGED
|
@@ -83,6 +83,10 @@ var properties = {
|
|
|
83
83
|
type: "string",
|
|
84
84
|
description: "The mime type for the blob."
|
|
85
85
|
},
|
|
86
|
+
isEncrypted: {
|
|
87
|
+
type: "boolean",
|
|
88
|
+
description: "Indicates if the blob is encrypted."
|
|
89
|
+
},
|
|
86
90
|
fileExtension: {
|
|
87
91
|
type: "string",
|
|
88
92
|
description: "The extension."
|
|
@@ -13,22 +13,36 @@ export interface IBlobStorageComponent extends IComponent {
|
|
|
13
13
|
* @param encodingFormat Mime type for the blob, will be detected if left undefined.
|
|
14
14
|
* @param fileExtension Extension for the blob, will be detected if left undefined.
|
|
15
15
|
* @param metadata Data for the custom metadata as JSON-LD.
|
|
16
|
-
* @param
|
|
16
|
+
* @param options Optional options for the creation of the blob.
|
|
17
|
+
* @param options.disableEncryption Disables encryption if enabled by default.
|
|
18
|
+
* @param options.overrideVaultKeyId Use a different vault key id for encryption, if not provided the default vault key id will be used.
|
|
19
|
+
* @param options.namespace The namespace to use for storing, defaults to component configured namespace.
|
|
17
20
|
* @param userIdentity The user identity to use with storage operations.
|
|
18
21
|
* @param nodeIdentity The node identity to use with storage operations.
|
|
19
22
|
* @returns The id of the stored blob in urn format.
|
|
20
23
|
*/
|
|
21
|
-
create(blob: string, encodingFormat?: string, fileExtension?: string, metadata?: IJsonLdNodeObject,
|
|
24
|
+
create(blob: string, encodingFormat?: string, fileExtension?: string, metadata?: IJsonLdNodeObject, options?: {
|
|
25
|
+
disableEncryption?: boolean;
|
|
26
|
+
overrideVaultKeyId?: string;
|
|
27
|
+
namespace?: string;
|
|
28
|
+
}, userIdentity?: string, nodeIdentity?: string): Promise<string>;
|
|
22
29
|
/**
|
|
23
30
|
* Get the blob and metadata.
|
|
24
31
|
* @param id The id of the blob to get in urn format.
|
|
25
|
-
* @param
|
|
32
|
+
* @param options Optional options for the retrieval of the blob.
|
|
33
|
+
* @param options.includeContent Include the content, or just get the metadata.
|
|
34
|
+
* @param options.disableDecryption Disables decryption if enabled by default.
|
|
35
|
+
* @param options.overrideVaultKeyId Use a different vault key id for decryption, if not provided the default vault key id will be used.
|
|
26
36
|
* @param userIdentity The user identity to use with storage operations.
|
|
27
37
|
* @param nodeIdentity The node identity to use with storage operations.
|
|
28
38
|
* @returns The data and metadata for the blob if it can be found.
|
|
29
39
|
* @throws Not found error if the blob cannot be found.
|
|
30
40
|
*/
|
|
31
|
-
get(id: string,
|
|
41
|
+
get(id: string, options?: {
|
|
42
|
+
includeContent?: boolean;
|
|
43
|
+
disableDecryption?: boolean;
|
|
44
|
+
overrideVaultKeyId?: string;
|
|
45
|
+
}, userIdentity?: string, nodeIdentity?: string): Promise<IBlobStorageEntry>;
|
|
32
46
|
/**
|
|
33
47
|
* Update the blob with metadata.
|
|
34
48
|
* @param id The id of the blob metadata to update.
|
|
@@ -23,6 +23,16 @@ export interface IBlobStorageCreateRequest {
|
|
|
23
23
|
* Custom metadata to associate with the blob as JSON-LD.
|
|
24
24
|
*/
|
|
25
25
|
metadata?: IJsonLdNodeObject;
|
|
26
|
+
/**
|
|
27
|
+
* Disables encryption if enabled by default.
|
|
28
|
+
* @default false
|
|
29
|
+
*/
|
|
30
|
+
disableEncryption?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Use a different vault key id for encryption, if not provided the default vault key id will be used.
|
|
33
|
+
* @default undefined
|
|
34
|
+
*/
|
|
35
|
+
overrideVaultKeyId?: string;
|
|
26
36
|
/**
|
|
27
37
|
* The namespace to store the data in, defaults to component configured namespace.
|
|
28
38
|
*/
|
|
@@ -15,12 +15,22 @@ export interface IBlobStorageGetContentRequest {
|
|
|
15
15
|
* The query parameters.
|
|
16
16
|
*/
|
|
17
17
|
query?: {
|
|
18
|
+
/**
|
|
19
|
+
* Disables decryption if enabled by default.
|
|
20
|
+
* @default false
|
|
21
|
+
*/
|
|
22
|
+
disableDecryption?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Use a different vault key id for decryption, if not provided the default vault key id will be used.
|
|
25
|
+
* @default undefined
|
|
26
|
+
*/
|
|
27
|
+
overrideVaultKeyId?: string;
|
|
18
28
|
/**
|
|
19
29
|
* Set the download flag which should prompt the browser to save the file.
|
|
20
30
|
* Otherwise the browser should show the content inside the page.
|
|
21
31
|
* @default false
|
|
22
32
|
*/
|
|
23
|
-
download?:
|
|
33
|
+
download?: string;
|
|
24
34
|
/**
|
|
25
35
|
* Set the filename to use when a download is triggered.
|
|
26
36
|
* A filename will be generated if not provided.
|
|
@@ -26,6 +26,16 @@ export interface IBlobStorageGetRequest {
|
|
|
26
26
|
* Include the content in the response, otherwise only metadata is returned.
|
|
27
27
|
* @default false
|
|
28
28
|
*/
|
|
29
|
-
includeContent?:
|
|
29
|
+
includeContent?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Disables decryption if enabled by default.
|
|
32
|
+
* @default false
|
|
33
|
+
*/
|
|
34
|
+
disableDecryption?: string;
|
|
35
|
+
/**
|
|
36
|
+
* Use a different vault key id for decryption, if not provided the default vault key id will be used.
|
|
37
|
+
* @default undefined
|
|
38
|
+
*/
|
|
39
|
+
overrideVaultKeyId?: string;
|
|
30
40
|
};
|
|
31
41
|
}
|
|
@@ -28,5 +28,15 @@ export interface IBlobStorageUpdateRequest {
|
|
|
28
28
|
* Custom metadata to associate with the blob as JSON-LD.
|
|
29
29
|
*/
|
|
30
30
|
metadata?: IJsonLdNodeObject;
|
|
31
|
+
/**
|
|
32
|
+
* Disables encryption if enabled by default.
|
|
33
|
+
* @default false
|
|
34
|
+
*/
|
|
35
|
+
disableEncryption?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Use a different vault key id for encryption, if not provided the default vault key id will be used.
|
|
38
|
+
* @default undefined
|
|
39
|
+
*/
|
|
40
|
+
overrideVaultKeyId?: string;
|
|
31
41
|
};
|
|
32
42
|
}
|
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @twin.org/blob-storage-models - Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.1-next.35](https://github.com/twinfoundation/blob-storage/compare/blob-storage-models-v0.0.1-next.34...blob-storage-models-v0.0.1-next.35) (2025-06-17)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* additional encryption options on per item basis ([4b95a65](https://github.com/twinfoundation/blob-storage/commit/4b95a656d19e3b571cea905e36f29b679b13e1e8))
|
|
9
|
+
|
|
3
10
|
## [0.0.1-next.34](https://github.com/twinfoundation/blob-storage/compare/blob-storage-models-v0.0.1-next.33...blob-storage-models-v0.0.1-next.34) (2025-06-12)
|
|
4
11
|
|
|
5
12
|
|
|
@@ -10,7 +10,7 @@ Interface describing an blob storage component.
|
|
|
10
10
|
|
|
11
11
|
### create()
|
|
12
12
|
|
|
13
|
-
> **create**(`blob`, `encodingFormat?`, `fileExtension?`, `metadata?`, `
|
|
13
|
+
> **create**(`blob`, `encodingFormat?`, `fileExtension?`, `metadata?`, `options?`, `userIdentity?`, `nodeIdentity?`): `Promise`\<`string`\>
|
|
14
14
|
|
|
15
15
|
Create the blob with some metadata.
|
|
16
16
|
|
|
@@ -40,7 +40,23 @@ Extension for the blob, will be detected if left undefined.
|
|
|
40
40
|
|
|
41
41
|
Data for the custom metadata as JSON-LD.
|
|
42
42
|
|
|
43
|
-
#####
|
|
43
|
+
##### options?
|
|
44
|
+
|
|
45
|
+
Optional options for the creation of the blob.
|
|
46
|
+
|
|
47
|
+
###### disableEncryption?
|
|
48
|
+
|
|
49
|
+
`boolean`
|
|
50
|
+
|
|
51
|
+
Disables encryption if enabled by default.
|
|
52
|
+
|
|
53
|
+
###### overrideVaultKeyId?
|
|
54
|
+
|
|
55
|
+
`string`
|
|
56
|
+
|
|
57
|
+
Use a different vault key id for encryption, if not provided the default vault key id will be used.
|
|
58
|
+
|
|
59
|
+
###### namespace?
|
|
44
60
|
|
|
45
61
|
`string`
|
|
46
62
|
|
|
@@ -68,7 +84,7 @@ The id of the stored blob in urn format.
|
|
|
68
84
|
|
|
69
85
|
### get()
|
|
70
86
|
|
|
71
|
-
> **get**(`id`, `
|
|
87
|
+
> **get**(`id`, `options?`, `userIdentity?`, `nodeIdentity?`): `Promise`\<[`IBlobStorageEntry`](IBlobStorageEntry.md)\>
|
|
72
88
|
|
|
73
89
|
Get the blob and metadata.
|
|
74
90
|
|
|
@@ -80,12 +96,28 @@ Get the blob and metadata.
|
|
|
80
96
|
|
|
81
97
|
The id of the blob to get in urn format.
|
|
82
98
|
|
|
83
|
-
#####
|
|
99
|
+
##### options?
|
|
100
|
+
|
|
101
|
+
Optional options for the retrieval of the blob.
|
|
102
|
+
|
|
103
|
+
###### includeContent?
|
|
84
104
|
|
|
85
105
|
`boolean`
|
|
86
106
|
|
|
87
107
|
Include the content, or just get the metadata.
|
|
88
108
|
|
|
109
|
+
###### disableDecryption?
|
|
110
|
+
|
|
111
|
+
`boolean`
|
|
112
|
+
|
|
113
|
+
Disables decryption if enabled by default.
|
|
114
|
+
|
|
115
|
+
###### overrideVaultKeyId?
|
|
116
|
+
|
|
117
|
+
`string`
|
|
118
|
+
|
|
119
|
+
Use a different vault key id for decryption, if not provided the default vault key id will be used.
|
|
120
|
+
|
|
89
121
|
##### userIdentity?
|
|
90
122
|
|
|
91
123
|
`string`
|
|
@@ -34,6 +34,30 @@ The extension of the blob, will be detected if left undefined.
|
|
|
34
34
|
|
|
35
35
|
Custom metadata to associate with the blob as JSON-LD.
|
|
36
36
|
|
|
37
|
+
#### disableEncryption?
|
|
38
|
+
|
|
39
|
+
> `optional` **disableEncryption**: `boolean`
|
|
40
|
+
|
|
41
|
+
Disables encryption if enabled by default.
|
|
42
|
+
|
|
43
|
+
##### Default
|
|
44
|
+
|
|
45
|
+
```ts
|
|
46
|
+
false
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
#### overrideVaultKeyId?
|
|
50
|
+
|
|
51
|
+
> `optional` **overrideVaultKeyId**: `string`
|
|
52
|
+
|
|
53
|
+
Use a different vault key id for encryption, if not provided the default vault key id will be used.
|
|
54
|
+
|
|
55
|
+
##### Default
|
|
56
|
+
|
|
57
|
+
```ts
|
|
58
|
+
undefined
|
|
59
|
+
```
|
|
60
|
+
|
|
37
61
|
#### namespace?
|
|
38
62
|
|
|
39
63
|
> `optional` **namespace**: `string`
|
|
@@ -24,9 +24,33 @@ The id of the blob to get in urn format.
|
|
|
24
24
|
|
|
25
25
|
The query parameters.
|
|
26
26
|
|
|
27
|
+
#### disableDecryption?
|
|
28
|
+
|
|
29
|
+
> `optional` **disableDecryption**: `string`
|
|
30
|
+
|
|
31
|
+
Disables decryption if enabled by default.
|
|
32
|
+
|
|
33
|
+
##### Default
|
|
34
|
+
|
|
35
|
+
```ts
|
|
36
|
+
false
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
#### overrideVaultKeyId?
|
|
40
|
+
|
|
41
|
+
> `optional` **overrideVaultKeyId**: `string`
|
|
42
|
+
|
|
43
|
+
Use a different vault key id for decryption, if not provided the default vault key id will be used.
|
|
44
|
+
|
|
45
|
+
##### Default
|
|
46
|
+
|
|
47
|
+
```ts
|
|
48
|
+
undefined
|
|
49
|
+
```
|
|
50
|
+
|
|
27
51
|
#### download?
|
|
28
52
|
|
|
29
|
-
> `optional` **download**: `
|
|
53
|
+
> `optional` **download**: `string`
|
|
30
54
|
|
|
31
55
|
Set the download flag which should prompt the browser to save the file.
|
|
32
56
|
Otherwise the browser should show the content inside the page.
|
|
@@ -38,7 +38,7 @@ The query parameters.
|
|
|
38
38
|
|
|
39
39
|
#### includeContent?
|
|
40
40
|
|
|
41
|
-
> `optional` **includeContent**: `
|
|
41
|
+
> `optional` **includeContent**: `string`
|
|
42
42
|
|
|
43
43
|
Include the content in the response, otherwise only metadata is returned.
|
|
44
44
|
|
|
@@ -47,3 +47,27 @@ Include the content in the response, otherwise only metadata is returned.
|
|
|
47
47
|
```ts
|
|
48
48
|
false
|
|
49
49
|
```
|
|
50
|
+
|
|
51
|
+
#### disableDecryption?
|
|
52
|
+
|
|
53
|
+
> `optional` **disableDecryption**: `string`
|
|
54
|
+
|
|
55
|
+
Disables decryption if enabled by default.
|
|
56
|
+
|
|
57
|
+
##### Default
|
|
58
|
+
|
|
59
|
+
```ts
|
|
60
|
+
false
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
#### overrideVaultKeyId?
|
|
64
|
+
|
|
65
|
+
> `optional` **overrideVaultKeyId**: `string`
|
|
66
|
+
|
|
67
|
+
Use a different vault key id for decryption, if not provided the default vault key id will be used.
|
|
68
|
+
|
|
69
|
+
##### Default
|
|
70
|
+
|
|
71
|
+
```ts
|
|
72
|
+
undefined
|
|
73
|
+
```
|
|
@@ -41,3 +41,27 @@ The extension of the blob, will be detected if left undefined.
|
|
|
41
41
|
> `optional` **metadata**: `IJsonLdNodeObject`
|
|
42
42
|
|
|
43
43
|
Custom metadata to associate with the blob as JSON-LD.
|
|
44
|
+
|
|
45
|
+
#### disableEncryption?
|
|
46
|
+
|
|
47
|
+
> `optional` **disableEncryption**: `boolean`
|
|
48
|
+
|
|
49
|
+
Disables encryption if enabled by default.
|
|
50
|
+
|
|
51
|
+
##### Default
|
|
52
|
+
|
|
53
|
+
```ts
|
|
54
|
+
false
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
#### overrideVaultKeyId?
|
|
58
|
+
|
|
59
|
+
> `optional` **overrideVaultKeyId**: `string`
|
|
60
|
+
|
|
61
|
+
Use a different vault key id for encryption, if not provided the default vault key id will be used.
|
|
62
|
+
|
|
63
|
+
##### Default
|
|
64
|
+
|
|
65
|
+
```ts
|
|
66
|
+
undefined
|
|
67
|
+
```
|