@twin.org/blob-storage-models 0.0.1-next.3 → 0.0.1-next.31

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.
Files changed (33) hide show
  1. package/dist/cjs/index.cjs +132 -0
  2. package/dist/esm/index.mjs +130 -1
  3. package/dist/types/dataTypes/blobStorageDataTypes.d.ts +9 -0
  4. package/dist/types/index.d.ts +7 -0
  5. package/dist/types/models/IBlobStorageComponent.d.ts +32 -15
  6. package/dist/types/models/IBlobStorageEntry.d.ts +56 -0
  7. package/dist/types/models/IBlobStorageEntryList.d.ts +30 -0
  8. package/dist/types/models/api/IBlobStorageCreateRequest.d.ts +2 -2
  9. package/dist/types/models/api/IBlobStorageGetRequest.d.ts +7 -0
  10. package/dist/types/models/api/IBlobStorageGetResponse.d.ts +9 -19
  11. package/dist/types/models/api/IBlobStorageListRequest.d.ts +39 -0
  12. package/dist/types/models/api/IBlobStorageListResponse.d.ts +17 -0
  13. package/dist/types/models/api/IBlobStorageUpdateRequest.d.ts +2 -2
  14. package/dist/types/models/blobStorageContexts.d.ts +17 -0
  15. package/dist/types/models/blobStorageTypes.d.ts +13 -0
  16. package/docs/changelog.md +22 -1
  17. package/docs/reference/classes/BlobStorageDataTypes.md +25 -0
  18. package/docs/reference/index.md +15 -0
  19. package/docs/reference/interfaces/IBlobStorageComponent.md +142 -35
  20. package/docs/reference/interfaces/IBlobStorageConnector.md +11 -5
  21. package/docs/reference/interfaces/IBlobStorageCreateRequest.md +4 -4
  22. package/docs/reference/interfaces/IBlobStorageEntry.md +91 -0
  23. package/docs/reference/interfaces/IBlobStorageEntryList.md +35 -0
  24. package/docs/reference/interfaces/IBlobStorageGetRequest.md +12 -0
  25. package/docs/reference/interfaces/IBlobStorageGetResponse.md +9 -21
  26. package/docs/reference/interfaces/IBlobStorageListRequest.md +53 -0
  27. package/docs/reference/interfaces/IBlobStorageListResponse.md +23 -0
  28. package/docs/reference/interfaces/IBlobStorageUpdateRequest.md +4 -4
  29. package/docs/reference/type-aliases/BlobStorageContexts.md +5 -0
  30. package/docs/reference/type-aliases/BlobStorageTypes.md +5 -0
  31. package/docs/reference/variables/BlobStorageContexts.md +19 -0
  32. package/docs/reference/variables/BlobStorageTypes.md +13 -0
  33. package/package.json +9 -31
@@ -1,7 +1,119 @@
1
1
  'use strict';
2
2
 
3
+ var dataCore = require('@twin.org/data-core');
3
4
  var core = require('@twin.org/core');
4
5
 
6
+ // Copyright 2024 IOTA Stiftung.
7
+ // SPDX-License-Identifier: Apache-2.0.
8
+ /**
9
+ * The types of blob storage data.
10
+ */
11
+ // eslint-disable-next-line @typescript-eslint/naming-convention
12
+ const BlobStorageTypes = {
13
+ /**
14
+ * Represents blob storage entry.
15
+ */
16
+ Entry: "BlobStorageEntry"
17
+ };
18
+
19
+ var type = "object";
20
+ var properties = {
21
+ "@context": {
22
+ type: "array",
23
+ minItems: 2,
24
+ items: [
25
+ {
26
+ type: "string",
27
+ "const": "https://schema.twindev.org/blob-storage/"
28
+ },
29
+ {
30
+ type: "string",
31
+ "const": "https://schema.twindev.org/common/"
32
+ }
33
+ ],
34
+ additionalItems: {
35
+ $ref: "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
36
+ },
37
+ description: "JSON-LD Context."
38
+ },
39
+ type: {
40
+ type: "string",
41
+ "const": "BlobStorageEntry",
42
+ description: "JSON-LD Type."
43
+ },
44
+ id: {
45
+ type: "string",
46
+ description: "The id for the blob."
47
+ },
48
+ dateCreated: {
49
+ type: "string",
50
+ description: "The date/time when the entry was created."
51
+ },
52
+ dateModified: {
53
+ type: "string",
54
+ description: "The date/time when the entry was modified."
55
+ },
56
+ blobSize: {
57
+ type: "number",
58
+ description: "The size of the data in the blob."
59
+ },
60
+ blobHash: {
61
+ type: "string",
62
+ description: "The hash of the data in the blob."
63
+ },
64
+ encodingFormat: {
65
+ type: "string",
66
+ description: "The mime type for the blob."
67
+ },
68
+ fileExtension: {
69
+ type: "string",
70
+ description: "The extension."
71
+ },
72
+ metadata: {
73
+ $ref: "https://schema.twindev.org/json-ld/JsonLdNodeObject",
74
+ description: "The metadata for the blob as JSON-LD."
75
+ },
76
+ blob: {
77
+ type: "string",
78
+ description: "The blob in base64 format, included if the includeContent flag was set in the request."
79
+ }
80
+ };
81
+ var required = [
82
+ "@context",
83
+ "type",
84
+ "id",
85
+ "dateCreated",
86
+ "blobSize",
87
+ "blobHash"
88
+ ];
89
+ var additionalProperties = false;
90
+ var description = "Interface describing a blob storage entry.";
91
+ var BlobStorageEntrySchema = {
92
+ type: type,
93
+ properties: properties,
94
+ required: required,
95
+ additionalProperties: additionalProperties,
96
+ description: description
97
+ };
98
+
99
+ // Copyright 2024 IOTA Stiftung.
100
+ // SPDX-License-Identifier: Apache-2.0.
101
+ /**
102
+ * Handle all the data types for blob storage.
103
+ */
104
+ class BlobStorageDataTypes {
105
+ /**
106
+ * Register all the data types.
107
+ */
108
+ static registerTypes() {
109
+ dataCore.DataTypeHandlerFactory.register(BlobStorageTypes.Entry, () => ({
110
+ type: BlobStorageTypes.Entry,
111
+ defaultValue: {},
112
+ jsonSchema: async () => BlobStorageEntrySchema
113
+ }));
114
+ }
115
+ }
116
+
5
117
  // Copyright 2024 IOTA Stiftung.
6
118
  // SPDX-License-Identifier: Apache-2.0.
7
119
  /**
@@ -10,4 +122,24 @@ var core = require('@twin.org/core');
10
122
  // eslint-disable-next-line @typescript-eslint/naming-convention
11
123
  const BlobStorageConnectorFactory = core.Factory.createFactory("blob-storage");
12
124
 
125
+ // Copyright 2024 IOTA Stiftung.
126
+ // SPDX-License-Identifier: Apache-2.0.
127
+ /**
128
+ * The contexts of blob storage data.
129
+ */
130
+ // eslint-disable-next-line @typescript-eslint/naming-convention
131
+ const BlobStorageContexts = {
132
+ /**
133
+ * The context root for the blob storage types.
134
+ */
135
+ ContextRoot: "https://schema.twindev.org/blob-storage/",
136
+ /**
137
+ * The context root for the common types.
138
+ */
139
+ ContextRootCommon: "https://schema.twindev.org/common/"
140
+ };
141
+
13
142
  exports.BlobStorageConnectorFactory = BlobStorageConnectorFactory;
143
+ exports.BlobStorageContexts = BlobStorageContexts;
144
+ exports.BlobStorageDataTypes = BlobStorageDataTypes;
145
+ exports.BlobStorageTypes = BlobStorageTypes;
@@ -1,5 +1,117 @@
1
+ import { DataTypeHandlerFactory } from '@twin.org/data-core';
1
2
  import { Factory } from '@twin.org/core';
2
3
 
4
+ // Copyright 2024 IOTA Stiftung.
5
+ // SPDX-License-Identifier: Apache-2.0.
6
+ /**
7
+ * The types of blob storage data.
8
+ */
9
+ // eslint-disable-next-line @typescript-eslint/naming-convention
10
+ const BlobStorageTypes = {
11
+ /**
12
+ * Represents blob storage entry.
13
+ */
14
+ Entry: "BlobStorageEntry"
15
+ };
16
+
17
+ var type = "object";
18
+ var properties = {
19
+ "@context": {
20
+ type: "array",
21
+ minItems: 2,
22
+ items: [
23
+ {
24
+ type: "string",
25
+ "const": "https://schema.twindev.org/blob-storage/"
26
+ },
27
+ {
28
+ type: "string",
29
+ "const": "https://schema.twindev.org/common/"
30
+ }
31
+ ],
32
+ additionalItems: {
33
+ $ref: "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
34
+ },
35
+ description: "JSON-LD Context."
36
+ },
37
+ type: {
38
+ type: "string",
39
+ "const": "BlobStorageEntry",
40
+ description: "JSON-LD Type."
41
+ },
42
+ id: {
43
+ type: "string",
44
+ description: "The id for the blob."
45
+ },
46
+ dateCreated: {
47
+ type: "string",
48
+ description: "The date/time when the entry was created."
49
+ },
50
+ dateModified: {
51
+ type: "string",
52
+ description: "The date/time when the entry was modified."
53
+ },
54
+ blobSize: {
55
+ type: "number",
56
+ description: "The size of the data in the blob."
57
+ },
58
+ blobHash: {
59
+ type: "string",
60
+ description: "The hash of the data in the blob."
61
+ },
62
+ encodingFormat: {
63
+ type: "string",
64
+ description: "The mime type for the blob."
65
+ },
66
+ fileExtension: {
67
+ type: "string",
68
+ description: "The extension."
69
+ },
70
+ metadata: {
71
+ $ref: "https://schema.twindev.org/json-ld/JsonLdNodeObject",
72
+ description: "The metadata for the blob as JSON-LD."
73
+ },
74
+ blob: {
75
+ type: "string",
76
+ description: "The blob in base64 format, included if the includeContent flag was set in the request."
77
+ }
78
+ };
79
+ var required = [
80
+ "@context",
81
+ "type",
82
+ "id",
83
+ "dateCreated",
84
+ "blobSize",
85
+ "blobHash"
86
+ ];
87
+ var additionalProperties = false;
88
+ var description = "Interface describing a blob storage entry.";
89
+ var BlobStorageEntrySchema = {
90
+ type: type,
91
+ properties: properties,
92
+ required: required,
93
+ additionalProperties: additionalProperties,
94
+ description: description
95
+ };
96
+
97
+ // Copyright 2024 IOTA Stiftung.
98
+ // SPDX-License-Identifier: Apache-2.0.
99
+ /**
100
+ * Handle all the data types for blob storage.
101
+ */
102
+ class BlobStorageDataTypes {
103
+ /**
104
+ * Register all the data types.
105
+ */
106
+ static registerTypes() {
107
+ DataTypeHandlerFactory.register(BlobStorageTypes.Entry, () => ({
108
+ type: BlobStorageTypes.Entry,
109
+ defaultValue: {},
110
+ jsonSchema: async () => BlobStorageEntrySchema
111
+ }));
112
+ }
113
+ }
114
+
3
115
  // Copyright 2024 IOTA Stiftung.
4
116
  // SPDX-License-Identifier: Apache-2.0.
5
117
  /**
@@ -8,4 +120,21 @@ import { Factory } from '@twin.org/core';
8
120
  // eslint-disable-next-line @typescript-eslint/naming-convention
9
121
  const BlobStorageConnectorFactory = Factory.createFactory("blob-storage");
10
122
 
11
- export { BlobStorageConnectorFactory };
123
+ // Copyright 2024 IOTA Stiftung.
124
+ // SPDX-License-Identifier: Apache-2.0.
125
+ /**
126
+ * The contexts of blob storage data.
127
+ */
128
+ // eslint-disable-next-line @typescript-eslint/naming-convention
129
+ const BlobStorageContexts = {
130
+ /**
131
+ * The context root for the blob storage types.
132
+ */
133
+ ContextRoot: "https://schema.twindev.org/blob-storage/",
134
+ /**
135
+ * The context root for the common types.
136
+ */
137
+ ContextRootCommon: "https://schema.twindev.org/common/"
138
+ };
139
+
140
+ export { BlobStorageConnectorFactory, BlobStorageContexts, BlobStorageDataTypes, BlobStorageTypes };
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Handle all the data types for blob storage.
3
+ */
4
+ export declare class BlobStorageDataTypes {
5
+ /**
6
+ * Register all the data types.
7
+ */
8
+ static registerTypes(): void;
9
+ }
@@ -1,10 +1,17 @@
1
+ export * from "./dataTypes/blobStorageDataTypes";
1
2
  export * from "./factories/blobStorageConnectorFactory";
2
3
  export * from "./models/api/IBlobStorageCreateRequest";
3
4
  export * from "./models/api/IBlobStorageGetContentRequest";
4
5
  export * from "./models/api/IBlobStorageGetContentResponse";
5
6
  export * from "./models/api/IBlobStorageGetRequest";
6
7
  export * from "./models/api/IBlobStorageGetResponse";
8
+ export * from "./models/api/IBlobStorageListRequest";
9
+ export * from "./models/api/IBlobStorageListResponse";
7
10
  export * from "./models/api/IBlobStorageRemoveRequest";
8
11
  export * from "./models/api/IBlobStorageUpdateRequest";
12
+ export * from "./models/blobStorageContexts";
13
+ export * from "./models/blobStorageTypes";
9
14
  export * from "./models/IBlobStorageComponent";
10
15
  export * from "./models/IBlobStorageConnector";
16
+ export * from "./models/IBlobStorageEntry";
17
+ export * from "./models/IBlobStorageEntryList";
@@ -1,5 +1,8 @@
1
1
  import type { IComponent } from "@twin.org/core";
2
2
  import type { IJsonLdNodeObject } from "@twin.org/data-json-ld";
3
+ import type { EntityCondition, SortDirection } from "@twin.org/entity";
4
+ import type { IBlobStorageEntry } from "./IBlobStorageEntry";
5
+ import type { IBlobStorageEntryList } from "./IBlobStorageEntryList";
3
6
  /**
4
7
  * Interface describing an blob storage component.
5
8
  */
@@ -7,43 +10,57 @@ export interface IBlobStorageComponent extends IComponent {
7
10
  /**
8
11
  * Create the blob with some metadata.
9
12
  * @param blob The data for the blob in base64 format.
10
- * @param mimeType Mime type for the blob, will be detected if left undefined.
11
- * @param extension Extension for the blob, will be detected if left undefined.
13
+ * @param encodingFormat Mime type for the blob, will be detected if left undefined.
14
+ * @param fileExtension Extension for the blob, will be detected if left undefined.
12
15
  * @param metadata Data for the custom metadata as JSON-LD.
13
16
  * @param namespace The namespace to use for storing, defaults to component configured namespace.
14
- * @param nodeIdentity The node identity which controls the vault key.
17
+ * @param userIdentity The user identity to use with storage operations.
18
+ * @param nodeIdentity The node identity to use with storage operations.
15
19
  * @returns The id of the stored blob in urn format.
16
20
  */
17
- create(blob: string, mimeType?: string, extension?: string, metadata?: IJsonLdNodeObject, namespace?: string, nodeIdentity?: string): Promise<string>;
21
+ create(blob: string, encodingFormat?: string, fileExtension?: string, metadata?: IJsonLdNodeObject, namespace?: string, userIdentity?: string, nodeIdentity?: string): Promise<string>;
18
22
  /**
19
23
  * Get the blob and metadata.
20
24
  * @param id The id of the blob to get in urn format.
21
25
  * @param includeContent Include the content, or just get the metadata.
22
- * @param nodeIdentity The node identity which controls the vault key.
26
+ * @param userIdentity The user identity to use with storage operations.
27
+ * @param nodeIdentity The node identity to use with storage operations.
23
28
  * @returns The data and metadata for the blob if it can be found.
24
29
  * @throws Not found error if the blob cannot be found.
25
30
  */
26
- get(id: string, includeContent: boolean, nodeIdentity?: string): Promise<{
27
- blob?: string;
28
- mimeType?: string;
29
- extension?: string;
30
- metadata?: IJsonLdNodeObject;
31
- }>;
31
+ get(id: string, includeContent: boolean, userIdentity?: string, nodeIdentity?: string): Promise<IBlobStorageEntry>;
32
32
  /**
33
33
  * Update the blob with metadata.
34
34
  * @param id The id of the blob metadata to update.
35
- * @param mimeType Mime type for the blob, will be detected if left undefined.
36
- * @param extension Extension for the blob, will be detected if left undefined.
35
+ * @param encodingFormat Mime type for the blob, will be detected if left undefined.
36
+ * @param fileExtension Extension for the blob, will be detected if left undefined.
37
37
  * @param metadata Data for the custom metadata as JSON-LD.
38
+ * @param userIdentity The user identity to use with storage operations.
39
+ * @param nodeIdentity The node identity to use with storage operations.
38
40
  * @returns Nothing.
39
41
  * @throws Not found error if the blob cannot be found.
40
42
  */
41
- update(id: string, mimeType?: string, extension?: string, metadata?: IJsonLdNodeObject): Promise<void>;
43
+ update(id: string, encodingFormat?: string, fileExtension?: string, metadata?: IJsonLdNodeObject, userIdentity?: string, nodeIdentity?: string): Promise<void>;
42
44
  /**
43
45
  * Remove the blob.
44
46
  * @param id The id of the blob to remove in urn format.
47
+ * @param userIdentity The user identity to use with storage operations.
48
+ * @param nodeIdentity The node identity to use with storage operations.
45
49
  * @returns Nothing.
46
50
  * @throws Not found error if the blob cannot be found.
47
51
  */
48
- remove(id: string): Promise<void>;
52
+ remove(id: string, userIdentity?: string, nodeIdentity?: string): Promise<void>;
53
+ /**
54
+ * Query all the blob storage entries which match the conditions.
55
+ * @param conditions The conditions to match for the entries.
56
+ * @param orderBy The order for the results, defaults to created.
57
+ * @param orderByDirection The direction for the order, defaults to descending.
58
+ * @param cursor The cursor to request the next page of entries.
59
+ * @param pageSize The suggested number of entries to return in each chunk, in some scenarios can return a different amount.
60
+ * @param userIdentity The user identity to use with storage operations.
61
+ * @param nodeIdentity The node identity to use with storage operations.
62
+ * @returns All the entries for the storage matching the conditions,
63
+ * and a cursor which can be used to request more entities.
64
+ */
65
+ query(conditions?: EntityCondition<IBlobStorageEntry>, orderBy?: keyof Pick<IBlobStorageEntry, "dateCreated" | "dateModified">, orderByDirection?: SortDirection, cursor?: string, pageSize?: number, userIdentity?: string, nodeIdentity?: string): Promise<IBlobStorageEntryList>;
49
66
  }
@@ -0,0 +1,56 @@
1
+ import type { IJsonLdContextDefinitionElement, IJsonLdNodeObject } from "@twin.org/data-json-ld";
2
+ import type { BlobStorageContexts } from "./blobStorageContexts";
3
+ import type { BlobStorageTypes } from "./blobStorageTypes";
4
+ /**
5
+ * Interface describing a blob storage entry.
6
+ */
7
+ export interface IBlobStorageEntry {
8
+ /**
9
+ * JSON-LD Context.
10
+ */
11
+ "@context": [
12
+ typeof BlobStorageContexts.ContextRoot,
13
+ typeof BlobStorageContexts.ContextRootCommon,
14
+ ...IJsonLdContextDefinitionElement[]
15
+ ];
16
+ /**
17
+ * JSON-LD Type.
18
+ */
19
+ type: typeof BlobStorageTypes.Entry;
20
+ /**
21
+ * The id for the blob.
22
+ */
23
+ id: string;
24
+ /**
25
+ * The date/time when the entry was created.
26
+ */
27
+ dateCreated: string;
28
+ /**
29
+ * The date/time when the entry was modified.
30
+ */
31
+ dateModified?: string;
32
+ /**
33
+ * The size of the data in the blob.
34
+ */
35
+ blobSize: number;
36
+ /**
37
+ * The hash of the data in the blob.
38
+ */
39
+ blobHash: string;
40
+ /**
41
+ * The mime type for the blob.
42
+ */
43
+ encodingFormat?: string;
44
+ /**
45
+ * The extension.
46
+ */
47
+ fileExtension?: string;
48
+ /**
49
+ * The metadata for the blob as JSON-LD.
50
+ */
51
+ metadata?: IJsonLdNodeObject;
52
+ /**
53
+ * The blob in base64 format, included if the includeContent flag was set in the request.
54
+ */
55
+ blob?: string;
56
+ }
@@ -0,0 +1,30 @@
1
+ import type { IJsonLdContextDefinitionElement } from "@twin.org/data-json-ld";
2
+ import type { SchemaOrgContexts, SchemaOrgTypes } from "@twin.org/standards-schema-org";
3
+ import type { BlobStorageContexts } from "./blobStorageContexts";
4
+ import type { IBlobStorageEntry } from "./IBlobStorageEntry";
5
+ /**
6
+ * Interface describing an blob storage entry list.
7
+ */
8
+ export interface IBlobStorageEntryList {
9
+ /**
10
+ * JSON-LD Context.
11
+ */
12
+ "@context": [
13
+ typeof SchemaOrgContexts.ContextRoot,
14
+ typeof BlobStorageContexts.ContextRoot,
15
+ typeof BlobStorageContexts.ContextRootCommon,
16
+ ...IJsonLdContextDefinitionElement[]
17
+ ];
18
+ /**
19
+ * JSON-LD Type.
20
+ */
21
+ type: typeof SchemaOrgTypes.ItemList;
22
+ /**
23
+ * The list of entries.
24
+ */
25
+ [SchemaOrgTypes.ItemListElement]: IBlobStorageEntry[];
26
+ /**
27
+ * The cursor to get the next chunk of entries.
28
+ */
29
+ [SchemaOrgTypes.NextItem]?: string;
30
+ }
@@ -14,11 +14,11 @@ export interface IBlobStorageCreateRequest {
14
14
  /**
15
15
  * The mime type of the blob, will be detected if left undefined.
16
16
  */
17
- mimeType?: string;
17
+ encodingFormat?: string;
18
18
  /**
19
19
  * The extension of the blob, will be detected if left undefined.
20
20
  */
21
- extension?: string;
21
+ fileExtension?: string;
22
22
  /**
23
23
  * Custom metadata to associate with the blob as JSON-LD.
24
24
  */
@@ -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
  */
@@ -1,27 +1,17 @@
1
- import type { IJsonLdNodeObject } from "@twin.org/data-json-ld";
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 body parameters.
8
+ * The headers which can be used to determine the response data type.
8
9
  */
9
- body: {
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;
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
- mimeType?: string;
22
+ encodingFormat?: string;
23
23
  /**
24
24
  * The extension of the blob, will be detected if left undefined.
25
25
  */
26
- extension?: string;
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 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,13 @@
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
+ /**
11
+ * The types of blob storage data.
12
+ */
13
+ export type BlobStorageTypes = (typeof BlobStorageTypes)[keyof typeof BlobStorageTypes];