@twin.org/blob-storage-models 0.0.1-next.8 → 0.0.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/cjs/index.cjs +188 -0
- package/dist/esm/index.mjs +185 -1
- package/dist/types/dataTypes/blobStorageDataTypes.d.ts +9 -0
- package/dist/types/index.d.ts +8 -0
- package/dist/types/models/IBlobStorageComponent.d.ts +51 -17
- package/dist/types/models/IBlobStorageEntry.d.ts +65 -0
- package/dist/types/models/IBlobStorageEntryList.d.ts +30 -0
- package/dist/types/models/api/IBlobStorageCreateRequest.d.ts +17 -2
- package/dist/types/models/api/IBlobStorageGetContentRequest.d.ts +11 -1
- package/dist/types/models/api/IBlobStorageGetRequest.d.ts +18 -1
- package/dist/types/models/api/IBlobStorageGetResponse.d.ts +9 -19
- package/dist/types/models/api/IBlobStorageListRequest.d.ts +39 -0
- package/dist/types/models/api/IBlobStorageListResponse.d.ts +17 -0
- package/dist/types/models/api/IBlobStorageUpdateRequest.d.ts +2 -2
- package/dist/types/models/blobStorageCompressionType.d.ts +17 -0
- package/dist/types/models/blobStorageContexts.d.ts +17 -0
- package/dist/types/models/blobStorageTypes.d.ts +17 -0
- package/docs/changelog.md +71 -1
- package/docs/reference/classes/BlobStorageDataTypes.md +25 -0
- package/docs/reference/index.md +17 -0
- package/docs/reference/interfaces/IBlobStorageComponent.md +176 -31
- package/docs/reference/interfaces/IBlobStorageConnector.md +11 -5
- package/docs/reference/interfaces/IBlobStorageCreateRequest.md +34 -4
- package/docs/reference/interfaces/IBlobStorageEntry.md +107 -0
- package/docs/reference/interfaces/IBlobStorageEntryList.md +35 -0
- package/docs/reference/interfaces/IBlobStorageGetContentRequest.md +25 -1
- package/docs/reference/interfaces/IBlobStorageGetRequest.md +37 -1
- package/docs/reference/interfaces/IBlobStorageGetResponse.md +9 -21
- package/docs/reference/interfaces/IBlobStorageListRequest.md +53 -0
- package/docs/reference/interfaces/IBlobStorageListResponse.md +23 -0
- package/docs/reference/interfaces/IBlobStorageUpdateRequest.md +4 -4
- package/docs/reference/type-aliases/BlobStorageCompressionType.md +5 -0
- package/docs/reference/type-aliases/BlobStorageContexts.md +5 -0
- package/docs/reference/type-aliases/BlobStorageTypes.md +5 -0
- package/docs/reference/variables/BlobStorageCompressionType.md +19 -0
- package/docs/reference/variables/BlobStorageContexts.md +19 -0
- package/docs/reference/variables/BlobStorageTypes.md +19 -0
- package/package.json +11 -7
|
@@ -1,7 +1,14 @@
|
|
|
1
|
+
import type { HeaderTypes, MimeTypes } from "@twin.org/web";
|
|
1
2
|
/**
|
|
2
3
|
* Request to get an entry from blob storage.
|
|
3
4
|
*/
|
|
4
5
|
export interface IBlobStorageGetRequest {
|
|
6
|
+
/**
|
|
7
|
+
* The headers which can be used to determine the response data type.
|
|
8
|
+
*/
|
|
9
|
+
headers?: {
|
|
10
|
+
[HeaderTypes.Accept]: typeof MimeTypes.Json | typeof MimeTypes.JsonLd;
|
|
11
|
+
};
|
|
5
12
|
/**
|
|
6
13
|
* The path parameters.
|
|
7
14
|
*/
|
|
@@ -19,6 +26,16 @@ export interface IBlobStorageGetRequest {
|
|
|
19
26
|
* Include the content in the response, otherwise only metadata is returned.
|
|
20
27
|
* @default false
|
|
21
28
|
*/
|
|
22
|
-
includeContent?: boolean;
|
|
29
|
+
includeContent?: boolean | string;
|
|
30
|
+
/**
|
|
31
|
+
* If the content should be decompressed, if it was compressed when stored, defaults to true.
|
|
32
|
+
* @default true
|
|
33
|
+
*/
|
|
34
|
+
decompress?: boolean | 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;
|
|
23
40
|
};
|
|
24
41
|
}
|
|
@@ -1,27 +1,17 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { HeaderTypes, MimeTypes } from "@twin.org/web";
|
|
2
|
+
import type { IBlobStorageEntry } from "../IBlobStorageEntry";
|
|
2
3
|
/**
|
|
3
4
|
* Response to get an entry from blob storage.
|
|
4
5
|
*/
|
|
5
6
|
export interface IBlobStorageGetResponse {
|
|
6
7
|
/**
|
|
7
|
-
* The
|
|
8
|
+
* The headers which can be used to determine the response data type.
|
|
8
9
|
*/
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
* The mime type of the blob.
|
|
12
|
-
*/
|
|
13
|
-
mimeType?: string;
|
|
14
|
-
/**
|
|
15
|
-
* The extension of the blob.
|
|
16
|
-
*/
|
|
17
|
-
extension?: string;
|
|
18
|
-
/**
|
|
19
|
-
* Custom metadata to associate with the blob as JSON-LD.
|
|
20
|
-
*/
|
|
21
|
-
metadata?: IJsonLdNodeObject;
|
|
22
|
-
/**
|
|
23
|
-
* The blob in base64 format, if the includeContent flag was set in the request.
|
|
24
|
-
*/
|
|
25
|
-
blob?: string;
|
|
10
|
+
headers?: {
|
|
11
|
+
[HeaderTypes.ContentType]: typeof MimeTypes.Json | typeof MimeTypes.JsonLd;
|
|
26
12
|
};
|
|
13
|
+
/**
|
|
14
|
+
* The body parameters.
|
|
15
|
+
*/
|
|
16
|
+
body: IBlobStorageEntry;
|
|
27
17
|
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { SortDirection } from "@twin.org/entity";
|
|
2
|
+
import type { HeaderTypes, MimeTypes } from "@twin.org/web";
|
|
3
|
+
import type { IBlobStorageEntry } from "../IBlobStorageEntry";
|
|
4
|
+
/**
|
|
5
|
+
* Query the entries from blob storage.
|
|
6
|
+
*/
|
|
7
|
+
export interface IBlobStorageListRequest {
|
|
8
|
+
/**
|
|
9
|
+
* The headers which can be used to determine the response data type.
|
|
10
|
+
*/
|
|
11
|
+
headers?: {
|
|
12
|
+
[HeaderTypes.Accept]: typeof MimeTypes.Json | typeof MimeTypes.JsonLd;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* The parameters from the query.
|
|
16
|
+
*/
|
|
17
|
+
query?: {
|
|
18
|
+
/**
|
|
19
|
+
* The condition for the query as JSON version of EntityCondition type.
|
|
20
|
+
*/
|
|
21
|
+
conditions?: string;
|
|
22
|
+
/**
|
|
23
|
+
* The order for the results, default to created.
|
|
24
|
+
*/
|
|
25
|
+
orderBy?: keyof Pick<IBlobStorageEntry, "dateCreated" | "dateModified">;
|
|
26
|
+
/**
|
|
27
|
+
* The direction for the order, defaults to desc.
|
|
28
|
+
*/
|
|
29
|
+
orderByDirection?: SortDirection;
|
|
30
|
+
/**
|
|
31
|
+
* The number of entries to return per page.
|
|
32
|
+
*/
|
|
33
|
+
pageSize?: number | string;
|
|
34
|
+
/**
|
|
35
|
+
* The cursor to get next chunk of data, returned in previous response.
|
|
36
|
+
*/
|
|
37
|
+
cursor?: string;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { HeaderTypes, MimeTypes } from "@twin.org/web";
|
|
2
|
+
import type { IBlobStorageEntryList } from "../IBlobStorageEntryList";
|
|
3
|
+
/**
|
|
4
|
+
* Response to getting the list of entries from a query.
|
|
5
|
+
*/
|
|
6
|
+
export interface IBlobStorageListResponse {
|
|
7
|
+
/**
|
|
8
|
+
* The headers which can be used to determine the response data type.
|
|
9
|
+
*/
|
|
10
|
+
headers?: {
|
|
11
|
+
[HeaderTypes.ContentType]: typeof MimeTypes.Json | typeof MimeTypes.JsonLd;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* The list of entries from the query.
|
|
15
|
+
*/
|
|
16
|
+
body: IBlobStorageEntryList;
|
|
17
|
+
}
|
|
@@ -19,11 +19,11 @@ export interface IBlobStorageUpdateRequest {
|
|
|
19
19
|
/**
|
|
20
20
|
* The mime type of the blob, will be detected if left undefined.
|
|
21
21
|
*/
|
|
22
|
-
|
|
22
|
+
encodingFormat?: string;
|
|
23
23
|
/**
|
|
24
24
|
* The extension of the blob, will be detected if left undefined.
|
|
25
25
|
*/
|
|
26
|
-
|
|
26
|
+
fileExtension?: string;
|
|
27
27
|
/**
|
|
28
28
|
* Custom metadata to associate with the blob as JSON-LD.
|
|
29
29
|
*/
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The types of compression for blob storage data.
|
|
3
|
+
*/
|
|
4
|
+
export declare const BlobStorageCompressionType: {
|
|
5
|
+
/**
|
|
6
|
+
* Gzip.
|
|
7
|
+
*/
|
|
8
|
+
readonly Gzip: "gzip";
|
|
9
|
+
/**
|
|
10
|
+
* Deflate.
|
|
11
|
+
*/
|
|
12
|
+
readonly Deflate: "deflate";
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* The types of compression for blob storage data.
|
|
16
|
+
*/
|
|
17
|
+
export type BlobStorageCompressionType = (typeof BlobStorageCompressionType)[keyof typeof BlobStorageCompressionType];
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The contexts of blob storage data.
|
|
3
|
+
*/
|
|
4
|
+
export declare const BlobStorageContexts: {
|
|
5
|
+
/**
|
|
6
|
+
* The context root for the blob storage types.
|
|
7
|
+
*/
|
|
8
|
+
readonly ContextRoot: "https://schema.twindev.org/blob-storage/";
|
|
9
|
+
/**
|
|
10
|
+
* The context root for the common types.
|
|
11
|
+
*/
|
|
12
|
+
readonly ContextRootCommon: "https://schema.twindev.org/common/";
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* The contexts of blob storage data.
|
|
16
|
+
*/
|
|
17
|
+
export type BlobStorageContexts = (typeof BlobStorageContexts)[keyof typeof BlobStorageContexts];
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The types of blob storage data.
|
|
3
|
+
*/
|
|
4
|
+
export declare const BlobStorageTypes: {
|
|
5
|
+
/**
|
|
6
|
+
* Represents blob storage entry.
|
|
7
|
+
*/
|
|
8
|
+
readonly Entry: "BlobStorageEntry";
|
|
9
|
+
/**
|
|
10
|
+
* Represents blob storage entry compression.
|
|
11
|
+
*/
|
|
12
|
+
readonly CompressionType: "BlobStorageCompressionType";
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* The types of blob storage data.
|
|
16
|
+
*/
|
|
17
|
+
export type BlobStorageTypes = (typeof BlobStorageTypes)[keyof typeof BlobStorageTypes];
|
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,75 @@
|
|
|
1
1
|
# @twin.org/blob-storage-models - Changelog
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## 0.0.1 (2025-07-04)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* release to production ([eacfe75](https://github.com/twinfoundation/blob-storage/commit/eacfe754a0dcd9243d9e13d86422327d0a605164))
|
|
9
|
+
|
|
10
|
+
## [0.0.1-next.37](https://github.com/twinfoundation/blob-storage/compare/blob-storage-models-v0.0.1-next.36...blob-storage-models-v0.0.1-next.37) (2025-06-20)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* query params force coercion ([a5e547a](https://github.com/twinfoundation/blob-storage/commit/a5e547a775f8997cb04780938c7a9561ddb048d1))
|
|
16
|
+
|
|
17
|
+
## [0.0.1-next.36](https://github.com/twinfoundation/blob-storage/compare/blob-storage-models-v0.0.1-next.35...blob-storage-models-v0.0.1-next.36) (2025-06-19)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
* add compression support ([67d239b](https://github.com/twinfoundation/blob-storage/commit/67d239bca8321bd90bf4ff93167c564130309730))
|
|
23
|
+
|
|
24
|
+
## [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)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
### Features
|
|
28
|
+
|
|
29
|
+
* additional encryption options on per item basis ([4b95a65](https://github.com/twinfoundation/blob-storage/commit/4b95a656d19e3b571cea905e36f29b679b13e1e8))
|
|
30
|
+
|
|
31
|
+
## [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)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
### Features
|
|
35
|
+
|
|
36
|
+
* update dependencies ([56f0094](https://github.com/twinfoundation/blob-storage/commit/56f0094b68d8bd22864cd899ac1b61d95540f719))
|
|
37
|
+
|
|
38
|
+
## [0.0.1-next.33](https://github.com/twinfoundation/blob-storage/compare/blob-storage-models-v0.0.1-next.32...blob-storage-models-v0.0.1-next.33) (2025-06-03)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
### Features
|
|
42
|
+
|
|
43
|
+
* update ts-to-schema generation ([03439c7](https://github.com/twinfoundation/blob-storage/commit/03439c726108bf645941290e41824c57a6a23de3))
|
|
44
|
+
|
|
45
|
+
## [0.0.1-next.32](https://github.com/twinfoundation/blob-storage/compare/blob-storage-models-v0.0.1-next.31...blob-storage-models-v0.0.1-next.32) (2025-05-28)
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
### Features
|
|
49
|
+
|
|
50
|
+
* update to support fully qualified data type names ([3297d69](https://github.com/twinfoundation/blob-storage/commit/3297d69d332058b0f0141002087f56ba230620e1))
|
|
51
|
+
|
|
52
|
+
## [0.0.1-next.31](https://github.com/twinfoundation/blob-storage/compare/blob-storage-models-v0.0.1-next.30...blob-storage-models-v0.0.1-next.31) (2025-05-08)
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
### Features
|
|
56
|
+
|
|
57
|
+
* use standard list json ld types ([d6bdfd6](https://github.com/twinfoundation/blob-storage/commit/d6bdfd68af47f70f3cc53658b4a12543497e1f48))
|
|
58
|
+
|
|
59
|
+
## [0.0.1-next.30](https://github.com/twinfoundation/blob-storage/compare/blob-storage-models-v0.0.1-next.29...blob-storage-models-v0.0.1-next.30) (2025-04-17)
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
### Features
|
|
63
|
+
|
|
64
|
+
* use shared store mechanism ([#12](https://github.com/twinfoundation/blob-storage/issues/12)) ([cae8110](https://github.com/twinfoundation/blob-storage/commit/cae8110681847a1ac4fcac968b8196694e49c320))
|
|
65
|
+
|
|
66
|
+
## [0.0.1-next.29](https://github.com/twinfoundation/blob-storage/compare/blob-storage-models-v0.0.1-next.28...blob-storage-models-v0.0.1-next.29) (2025-03-28)
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
### Bug Fixes
|
|
70
|
+
|
|
71
|
+
* 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))
|
|
72
|
+
|
|
73
|
+
## v0.0.1-next.28
|
|
4
74
|
|
|
5
75
|
- Initial Release
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Class: BlobStorageDataTypes
|
|
2
|
+
|
|
3
|
+
Handle all the data types for blob storage.
|
|
4
|
+
|
|
5
|
+
## Constructors
|
|
6
|
+
|
|
7
|
+
### Constructor
|
|
8
|
+
|
|
9
|
+
> **new BlobStorageDataTypes**(): `BlobStorageDataTypes`
|
|
10
|
+
|
|
11
|
+
#### Returns
|
|
12
|
+
|
|
13
|
+
`BlobStorageDataTypes`
|
|
14
|
+
|
|
15
|
+
## Methods
|
|
16
|
+
|
|
17
|
+
### registerTypes()
|
|
18
|
+
|
|
19
|
+
> `static` **registerTypes**(): `void`
|
|
20
|
+
|
|
21
|
+
Register all the data types.
|
|
22
|
+
|
|
23
|
+
#### Returns
|
|
24
|
+
|
|
25
|
+
`void`
|
package/docs/reference/index.md
CHANGED
|
@@ -1,17 +1,34 @@
|
|
|
1
1
|
# @twin.org/blob-storage-models
|
|
2
2
|
|
|
3
|
+
## Classes
|
|
4
|
+
|
|
5
|
+
- [BlobStorageDataTypes](classes/BlobStorageDataTypes.md)
|
|
6
|
+
|
|
3
7
|
## Interfaces
|
|
4
8
|
|
|
5
9
|
- [IBlobStorageComponent](interfaces/IBlobStorageComponent.md)
|
|
6
10
|
- [IBlobStorageConnector](interfaces/IBlobStorageConnector.md)
|
|
11
|
+
- [IBlobStorageEntry](interfaces/IBlobStorageEntry.md)
|
|
12
|
+
- [IBlobStorageEntryList](interfaces/IBlobStorageEntryList.md)
|
|
7
13
|
- [IBlobStorageCreateRequest](interfaces/IBlobStorageCreateRequest.md)
|
|
8
14
|
- [IBlobStorageGetContentRequest](interfaces/IBlobStorageGetContentRequest.md)
|
|
9
15
|
- [IBlobStorageGetContentResponse](interfaces/IBlobStorageGetContentResponse.md)
|
|
10
16
|
- [IBlobStorageGetRequest](interfaces/IBlobStorageGetRequest.md)
|
|
11
17
|
- [IBlobStorageGetResponse](interfaces/IBlobStorageGetResponse.md)
|
|
18
|
+
- [IBlobStorageListRequest](interfaces/IBlobStorageListRequest.md)
|
|
19
|
+
- [IBlobStorageListResponse](interfaces/IBlobStorageListResponse.md)
|
|
12
20
|
- [IBlobStorageRemoveRequest](interfaces/IBlobStorageRemoveRequest.md)
|
|
13
21
|
- [IBlobStorageUpdateRequest](interfaces/IBlobStorageUpdateRequest.md)
|
|
14
22
|
|
|
23
|
+
## Type Aliases
|
|
24
|
+
|
|
25
|
+
- [BlobStorageCompressionType](type-aliases/BlobStorageCompressionType.md)
|
|
26
|
+
- [BlobStorageContexts](type-aliases/BlobStorageContexts.md)
|
|
27
|
+
- [BlobStorageTypes](type-aliases/BlobStorageTypes.md)
|
|
28
|
+
|
|
15
29
|
## Variables
|
|
16
30
|
|
|
17
31
|
- [BlobStorageConnectorFactory](variables/BlobStorageConnectorFactory.md)
|
|
32
|
+
- [BlobStorageCompressionType](variables/BlobStorageCompressionType.md)
|
|
33
|
+
- [BlobStorageContexts](variables/BlobStorageContexts.md)
|
|
34
|
+
- [BlobStorageTypes](variables/BlobStorageTypes.md)
|
|
@@ -10,35 +10,75 @@ Interface describing an blob storage component.
|
|
|
10
10
|
|
|
11
11
|
### create()
|
|
12
12
|
|
|
13
|
-
> **create**(`blob`, `
|
|
13
|
+
> **create**(`blob`, `encodingFormat?`, `fileExtension?`, `metadata?`, `options?`, `userIdentity?`, `nodeIdentity?`): `Promise`\<`string`\>
|
|
14
14
|
|
|
15
15
|
Create the blob with some metadata.
|
|
16
16
|
|
|
17
17
|
#### Parameters
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
##### blob
|
|
20
|
+
|
|
21
|
+
`string`
|
|
20
22
|
|
|
21
23
|
The data for the blob in base64 format.
|
|
22
24
|
|
|
23
|
-
|
|
25
|
+
##### encodingFormat?
|
|
26
|
+
|
|
27
|
+
`string`
|
|
24
28
|
|
|
25
29
|
Mime type for the blob, will be detected if left undefined.
|
|
26
30
|
|
|
27
|
-
|
|
31
|
+
##### fileExtension?
|
|
32
|
+
|
|
33
|
+
`string`
|
|
28
34
|
|
|
29
35
|
Extension for the blob, will be detected if left undefined.
|
|
30
36
|
|
|
31
|
-
|
|
37
|
+
##### metadata?
|
|
38
|
+
|
|
39
|
+
`IJsonLdNodeObject`
|
|
32
40
|
|
|
33
41
|
Data for the custom metadata as JSON-LD.
|
|
34
42
|
|
|
35
|
-
|
|
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
|
+
###### compress?
|
|
60
|
+
|
|
61
|
+
[`BlobStorageCompressionType`](../type-aliases/BlobStorageCompressionType.md)
|
|
62
|
+
|
|
63
|
+
Optional compression type to use for the blob, defaults to no compression.
|
|
64
|
+
|
|
65
|
+
###### namespace?
|
|
66
|
+
|
|
67
|
+
`string`
|
|
36
68
|
|
|
37
69
|
The namespace to use for storing, defaults to component configured namespace.
|
|
38
70
|
|
|
39
|
-
|
|
71
|
+
##### userIdentity?
|
|
72
|
+
|
|
73
|
+
`string`
|
|
74
|
+
|
|
75
|
+
The user identity to use with storage operations.
|
|
76
|
+
|
|
77
|
+
##### nodeIdentity?
|
|
78
|
+
|
|
79
|
+
`string`
|
|
40
80
|
|
|
41
|
-
The node identity
|
|
81
|
+
The node identity to use with storage operations.
|
|
42
82
|
|
|
43
83
|
#### Returns
|
|
44
84
|
|
|
@@ -50,45 +90,57 @@ The id of the stored blob in urn format.
|
|
|
50
90
|
|
|
51
91
|
### get()
|
|
52
92
|
|
|
53
|
-
> **get**(`id`, `
|
|
93
|
+
> **get**(`id`, `options?`, `userIdentity?`, `nodeIdentity?`): `Promise`\<[`IBlobStorageEntry`](IBlobStorageEntry.md)\>
|
|
54
94
|
|
|
55
95
|
Get the blob and metadata.
|
|
56
96
|
|
|
57
97
|
#### Parameters
|
|
58
98
|
|
|
59
|
-
|
|
99
|
+
##### id
|
|
100
|
+
|
|
101
|
+
`string`
|
|
60
102
|
|
|
61
103
|
The id of the blob to get in urn format.
|
|
62
104
|
|
|
63
|
-
|
|
105
|
+
##### options?
|
|
106
|
+
|
|
107
|
+
Optional options for the retrieval of the blob.
|
|
108
|
+
|
|
109
|
+
###### includeContent?
|
|
110
|
+
|
|
111
|
+
`boolean`
|
|
64
112
|
|
|
65
113
|
Include the content, or just get the metadata.
|
|
66
114
|
|
|
67
|
-
|
|
115
|
+
###### decompress?
|
|
68
116
|
|
|
69
|
-
|
|
117
|
+
`boolean`
|
|
70
118
|
|
|
71
|
-
|
|
119
|
+
If the content should be decompressed, if it was compressed when stored, defaults to true.
|
|
72
120
|
|
|
73
|
-
|
|
121
|
+
###### overrideVaultKeyId?
|
|
74
122
|
|
|
75
|
-
|
|
123
|
+
`string`
|
|
76
124
|
|
|
77
|
-
|
|
125
|
+
Use a different vault key id for decryption, if not provided the default vault key id will be used.
|
|
78
126
|
|
|
79
|
-
|
|
127
|
+
##### userIdentity?
|
|
80
128
|
|
|
81
|
-
|
|
129
|
+
`string`
|
|
82
130
|
|
|
83
|
-
|
|
131
|
+
The user identity to use with storage operations.
|
|
84
132
|
|
|
85
|
-
#####
|
|
133
|
+
##### nodeIdentity?
|
|
86
134
|
|
|
87
|
-
|
|
135
|
+
`string`
|
|
88
136
|
|
|
89
|
-
|
|
137
|
+
The node identity to use with storage operations.
|
|
138
|
+
|
|
139
|
+
#### Returns
|
|
140
|
+
|
|
141
|
+
`Promise`\<[`IBlobStorageEntry`](IBlobStorageEntry.md)\>
|
|
90
142
|
|
|
91
|
-
|
|
143
|
+
The data and metadata for the blob if it can be found.
|
|
92
144
|
|
|
93
145
|
#### Throws
|
|
94
146
|
|
|
@@ -98,28 +150,48 @@ Not found error if the blob cannot be found.
|
|
|
98
150
|
|
|
99
151
|
### update()
|
|
100
152
|
|
|
101
|
-
> **update**(`id`, `
|
|
153
|
+
> **update**(`id`, `encodingFormat?`, `fileExtension?`, `metadata?`, `userIdentity?`, `nodeIdentity?`): `Promise`\<`void`\>
|
|
102
154
|
|
|
103
155
|
Update the blob with metadata.
|
|
104
156
|
|
|
105
157
|
#### Parameters
|
|
106
158
|
|
|
107
|
-
|
|
159
|
+
##### id
|
|
160
|
+
|
|
161
|
+
`string`
|
|
108
162
|
|
|
109
163
|
The id of the blob metadata to update.
|
|
110
164
|
|
|
111
|
-
|
|
165
|
+
##### encodingFormat?
|
|
166
|
+
|
|
167
|
+
`string`
|
|
112
168
|
|
|
113
169
|
Mime type for the blob, will be detected if left undefined.
|
|
114
170
|
|
|
115
|
-
|
|
171
|
+
##### fileExtension?
|
|
172
|
+
|
|
173
|
+
`string`
|
|
116
174
|
|
|
117
175
|
Extension for the blob, will be detected if left undefined.
|
|
118
176
|
|
|
119
|
-
|
|
177
|
+
##### metadata?
|
|
178
|
+
|
|
179
|
+
`IJsonLdNodeObject`
|
|
120
180
|
|
|
121
181
|
Data for the custom metadata as JSON-LD.
|
|
122
182
|
|
|
183
|
+
##### userIdentity?
|
|
184
|
+
|
|
185
|
+
`string`
|
|
186
|
+
|
|
187
|
+
The user identity to use with storage operations.
|
|
188
|
+
|
|
189
|
+
##### nodeIdentity?
|
|
190
|
+
|
|
191
|
+
`string`
|
|
192
|
+
|
|
193
|
+
The node identity to use with storage operations.
|
|
194
|
+
|
|
123
195
|
#### Returns
|
|
124
196
|
|
|
125
197
|
`Promise`\<`void`\>
|
|
@@ -134,16 +206,30 @@ Not found error if the blob cannot be found.
|
|
|
134
206
|
|
|
135
207
|
### remove()
|
|
136
208
|
|
|
137
|
-
> **remove**(`id`): `Promise`\<`void`\>
|
|
209
|
+
> **remove**(`id`, `userIdentity?`, `nodeIdentity?`): `Promise`\<`void`\>
|
|
138
210
|
|
|
139
211
|
Remove the blob.
|
|
140
212
|
|
|
141
213
|
#### Parameters
|
|
142
214
|
|
|
143
|
-
|
|
215
|
+
##### id
|
|
216
|
+
|
|
217
|
+
`string`
|
|
144
218
|
|
|
145
219
|
The id of the blob to remove in urn format.
|
|
146
220
|
|
|
221
|
+
##### userIdentity?
|
|
222
|
+
|
|
223
|
+
`string`
|
|
224
|
+
|
|
225
|
+
The user identity to use with storage operations.
|
|
226
|
+
|
|
227
|
+
##### nodeIdentity?
|
|
228
|
+
|
|
229
|
+
`string`
|
|
230
|
+
|
|
231
|
+
The node identity to use with storage operations.
|
|
232
|
+
|
|
147
233
|
#### Returns
|
|
148
234
|
|
|
149
235
|
`Promise`\<`void`\>
|
|
@@ -153,3 +239,62 @@ Nothing.
|
|
|
153
239
|
#### Throws
|
|
154
240
|
|
|
155
241
|
Not found error if the blob cannot be found.
|
|
242
|
+
|
|
243
|
+
***
|
|
244
|
+
|
|
245
|
+
### query()
|
|
246
|
+
|
|
247
|
+
> **query**(`conditions?`, `orderBy?`, `orderByDirection?`, `cursor?`, `pageSize?`, `userIdentity?`, `nodeIdentity?`): `Promise`\<[`IBlobStorageEntryList`](IBlobStorageEntryList.md)\>
|
|
248
|
+
|
|
249
|
+
Query all the blob storage entries which match the conditions.
|
|
250
|
+
|
|
251
|
+
#### Parameters
|
|
252
|
+
|
|
253
|
+
##### conditions?
|
|
254
|
+
|
|
255
|
+
`EntityCondition`\<[`IBlobStorageEntry`](IBlobStorageEntry.md)\>
|
|
256
|
+
|
|
257
|
+
The conditions to match for the entries.
|
|
258
|
+
|
|
259
|
+
##### orderBy?
|
|
260
|
+
|
|
261
|
+
The order for the results, defaults to created.
|
|
262
|
+
|
|
263
|
+
`"dateCreated"` | `"dateModified"`
|
|
264
|
+
|
|
265
|
+
##### orderByDirection?
|
|
266
|
+
|
|
267
|
+
`SortDirection`
|
|
268
|
+
|
|
269
|
+
The direction for the order, defaults to descending.
|
|
270
|
+
|
|
271
|
+
##### cursor?
|
|
272
|
+
|
|
273
|
+
`string`
|
|
274
|
+
|
|
275
|
+
The cursor to request the next page of entries.
|
|
276
|
+
|
|
277
|
+
##### pageSize?
|
|
278
|
+
|
|
279
|
+
`number`
|
|
280
|
+
|
|
281
|
+
The suggested number of entries to return in each chunk, in some scenarios can return a different amount.
|
|
282
|
+
|
|
283
|
+
##### userIdentity?
|
|
284
|
+
|
|
285
|
+
`string`
|
|
286
|
+
|
|
287
|
+
The user identity to use with storage operations.
|
|
288
|
+
|
|
289
|
+
##### nodeIdentity?
|
|
290
|
+
|
|
291
|
+
`string`
|
|
292
|
+
|
|
293
|
+
The node identity to use with storage operations.
|
|
294
|
+
|
|
295
|
+
#### Returns
|
|
296
|
+
|
|
297
|
+
`Promise`\<[`IBlobStorageEntryList`](IBlobStorageEntryList.md)\>
|
|
298
|
+
|
|
299
|
+
All the entries for the storage matching the conditions,
|
|
300
|
+
and a cursor which can be used to request more entities.
|
|
@@ -16,7 +16,9 @@ Set the blob.
|
|
|
16
16
|
|
|
17
17
|
#### Parameters
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
##### blob
|
|
20
|
+
|
|
21
|
+
`Uint8Array`
|
|
20
22
|
|
|
21
23
|
The data for the blob.
|
|
22
24
|
|
|
@@ -30,19 +32,21 @@ The id of the stored blob in urn format.
|
|
|
30
32
|
|
|
31
33
|
### get()
|
|
32
34
|
|
|
33
|
-
> **get**(`id`): `Promise`\<`undefined` \| `Uint8Array
|
|
35
|
+
> **get**(`id`): `Promise`\<`undefined` \| `Uint8Array`\<`ArrayBufferLike`\>\>
|
|
34
36
|
|
|
35
37
|
Get the blob.
|
|
36
38
|
|
|
37
39
|
#### Parameters
|
|
38
40
|
|
|
39
|
-
|
|
41
|
+
##### id
|
|
42
|
+
|
|
43
|
+
`string`
|
|
40
44
|
|
|
41
45
|
The id of the blob to get in urn format.
|
|
42
46
|
|
|
43
47
|
#### Returns
|
|
44
48
|
|
|
45
|
-
`Promise`\<`undefined` \| `Uint8Array
|
|
49
|
+
`Promise`\<`undefined` \| `Uint8Array`\<`ArrayBufferLike`\>\>
|
|
46
50
|
|
|
47
51
|
The data for the blob if it can be found or undefined.
|
|
48
52
|
|
|
@@ -56,7 +60,9 @@ Remove the blob.
|
|
|
56
60
|
|
|
57
61
|
#### Parameters
|
|
58
62
|
|
|
59
|
-
|
|
63
|
+
##### id
|
|
64
|
+
|
|
65
|
+
`string`
|
|
60
66
|
|
|
61
67
|
The id of the blob to remove in urn format.
|
|
62
68
|
|