@twin.org/blob-storage-models 0.0.3-next.3 → 0.0.3-next.4
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/models/IBlobStorageComponent.js.map +1 -1
- package/dist/es/models/IBlobStorageEntryList.js.map +1 -1
- package/dist/es/models/api/IBlobStorageListResponse.js.map +1 -1
- package/dist/types/models/IBlobStorageComponent.d.ts +4 -1
- package/dist/types/models/IBlobStorageEntryList.d.ts +0 -4
- package/dist/types/models/api/IBlobStorageListResponse.d.ts +1 -0
- package/docs/changelog.md +7 -0
- package/docs/reference/interfaces/IBlobStorageComponent.md +2 -2
- package/docs/reference/interfaces/IBlobStorageEntryList.md +0 -8
- package/docs/reference/interfaces/IBlobStorageListResponse.md +4 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IBlobStorageComponent.js","sourceRoot":"","sources":["../../../src/models/IBlobStorageComponent.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IComponent } from \"@twin.org/core\";\nimport type { IJsonLdNodeObject } from \"@twin.org/data-json-ld\";\nimport type { EntityCondition, SortDirection } from \"@twin.org/entity\";\nimport type { BlobStorageCompressionType } from \"./blobStorageCompressionType.js\";\nimport type { IBlobStorageEntry } from \"./IBlobStorageEntry.js\";\nimport type { IBlobStorageEntryList } from \"./IBlobStorageEntryList.js\";\n\n/**\n * Interface describing an blob storage component.\n */\nexport interface IBlobStorageComponent extends IComponent {\n\t/**\n\t * Create the blob with some metadata.\n\t * @param blob The data for the blob in base64 format.\n\t * @param encodingFormat Mime type for the blob, will be detected if left undefined.\n\t * @param fileExtension Extension for the blob, will be detected if left undefined.\n\t * @param metadata Data for the custom metadata as JSON-LD.\n\t * @param options Optional options for the creation of the blob.\n\t * @param options.disableEncryption Disables encryption if enabled by default.\n\t * @param options.overrideVaultKeyId Use a different vault key id for encryption, if not provided the default vault key id will be used.\n\t * @param options.compress Optional compression type to use for the blob, defaults to no compression.\n\t * @param options.namespace The namespace to use for storing, defaults to component configured namespace.\n\t * @returns The id of the stored blob in urn format.\n\t */\n\tcreate(\n\t\tblob: string,\n\t\tencodingFormat?: string,\n\t\tfileExtension?: string,\n\t\tmetadata?: IJsonLdNodeObject,\n\t\toptions?: {\n\t\t\tdisableEncryption?: boolean;\n\t\t\toverrideVaultKeyId?: string;\n\t\t\tcompress?: BlobStorageCompressionType;\n\t\t\tnamespace?: string;\n\t\t}\n\t): Promise<string>;\n\n\t/**\n\t * Get the blob and metadata.\n\t * @param id The id of the blob to get in urn format.\n\t * @param options Optional options for the retrieval of the blob.\n\t * @param options.includeContent Include the content, or just get the metadata.\n\t * @param options.overrideVaultKeyId Use a different vault key id for decryption, if not provided the default vault key id will be used.\n\t * @param options.decompress If the content should be decompressed, if it was compressed when stored, defaults to true.\n\t * @returns The data and metadata for the blob if it can be found.\n\t * @throws Not found error if the blob cannot be found.\n\t */\n\tget(\n\t\tid: string,\n\t\toptions?: {\n\t\t\tincludeContent?: boolean;\n\t\t\tdecompress?: boolean;\n\t\t\toverrideVaultKeyId?: string;\n\t\t}\n\t): Promise<IBlobStorageEntry>;\n\n\t/**\n\t * Update the blob with metadata.\n\t * @param id The id of the blob metadata to update.\n\t * @param encodingFormat Mime type for the blob, will be detected if left undefined.\n\t * @param fileExtension Extension for the blob, will be detected if left undefined.\n\t * @param metadata Data for the custom metadata as JSON-LD.\n\t * @returns Nothing.\n\t * @throws Not found error if the blob cannot be found.\n\t */\n\tupdate(\n\t\tid: string,\n\t\tencodingFormat?: string,\n\t\tfileExtension?: string,\n\t\tmetadata?: IJsonLdNodeObject\n\t): Promise<void>;\n\n\t/**\n\t * Remove the blob.\n\t * @param id The id of the blob to remove in urn format.\n\t * @returns Nothing.\n\t * @throws Not found error if the blob cannot be found.\n\t */\n\tremove(id: string): Promise<void>;\n\n\t/**\n\t * Query all the blob storage entries which match the conditions.\n\t * @param conditions The conditions to match for the entries.\n\t * @param orderBy The order for the results, defaults to created.\n\t * @param orderByDirection The direction for the order, defaults to descending.\n\t * @param cursor The cursor to request the next page of entries.\n\t * @param limit The suggested number of entries to return in each chunk, in some scenarios can return a different amount.\n\t * @returns All the entries for the storage matching the conditions,\n\t * and a cursor which can be used to request more entities.\n\t */\n\tquery(\n\t\tconditions?: EntityCondition<IBlobStorageEntry>,\n\t\torderBy?: keyof Pick<IBlobStorageEntry, \"dateCreated\" | \"dateModified\">,\n\t\torderByDirection?: SortDirection,\n\t\tcursor?: string,\n\t\tlimit?: number\n\t): Promise<IBlobStorageEntryList>;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"IBlobStorageComponent.js","sourceRoot":"","sources":["../../../src/models/IBlobStorageComponent.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IComponent } from \"@twin.org/core\";\nimport type { IJsonLdNodeObject } from \"@twin.org/data-json-ld\";\nimport type { EntityCondition, SortDirection } from \"@twin.org/entity\";\nimport type { BlobStorageCompressionType } from \"./blobStorageCompressionType.js\";\nimport type { IBlobStorageEntry } from \"./IBlobStorageEntry.js\";\nimport type { IBlobStorageEntryList } from \"./IBlobStorageEntryList.js\";\n\n/**\n * Interface describing an blob storage component.\n */\nexport interface IBlobStorageComponent extends IComponent {\n\t/**\n\t * Create the blob with some metadata.\n\t * @param blob The data for the blob in base64 format.\n\t * @param encodingFormat Mime type for the blob, will be detected if left undefined.\n\t * @param fileExtension Extension for the blob, will be detected if left undefined.\n\t * @param metadata Data for the custom metadata as JSON-LD.\n\t * @param options Optional options for the creation of the blob.\n\t * @param options.disableEncryption Disables encryption if enabled by default.\n\t * @param options.overrideVaultKeyId Use a different vault key id for encryption, if not provided the default vault key id will be used.\n\t * @param options.compress Optional compression type to use for the blob, defaults to no compression.\n\t * @param options.namespace The namespace to use for storing, defaults to component configured namespace.\n\t * @returns The id of the stored blob in urn format.\n\t */\n\tcreate(\n\t\tblob: string,\n\t\tencodingFormat?: string,\n\t\tfileExtension?: string,\n\t\tmetadata?: IJsonLdNodeObject,\n\t\toptions?: {\n\t\t\tdisableEncryption?: boolean;\n\t\t\toverrideVaultKeyId?: string;\n\t\t\tcompress?: BlobStorageCompressionType;\n\t\t\tnamespace?: string;\n\t\t}\n\t): Promise<string>;\n\n\t/**\n\t * Get the blob and metadata.\n\t * @param id The id of the blob to get in urn format.\n\t * @param options Optional options for the retrieval of the blob.\n\t * @param options.includeContent Include the content, or just get the metadata.\n\t * @param options.overrideVaultKeyId Use a different vault key id for decryption, if not provided the default vault key id will be used.\n\t * @param options.decompress If the content should be decompressed, if it was compressed when stored, defaults to true.\n\t * @returns The data and metadata for the blob if it can be found.\n\t * @throws Not found error if the blob cannot be found.\n\t */\n\tget(\n\t\tid: string,\n\t\toptions?: {\n\t\t\tincludeContent?: boolean;\n\t\t\tdecompress?: boolean;\n\t\t\toverrideVaultKeyId?: string;\n\t\t}\n\t): Promise<IBlobStorageEntry>;\n\n\t/**\n\t * Update the blob with metadata.\n\t * @param id The id of the blob metadata to update.\n\t * @param encodingFormat Mime type for the blob, will be detected if left undefined.\n\t * @param fileExtension Extension for the blob, will be detected if left undefined.\n\t * @param metadata Data for the custom metadata as JSON-LD.\n\t * @returns Nothing.\n\t * @throws Not found error if the blob cannot be found.\n\t */\n\tupdate(\n\t\tid: string,\n\t\tencodingFormat?: string,\n\t\tfileExtension?: string,\n\t\tmetadata?: IJsonLdNodeObject\n\t): Promise<void>;\n\n\t/**\n\t * Remove the blob.\n\t * @param id The id of the blob to remove in urn format.\n\t * @returns Nothing.\n\t * @throws Not found error if the blob cannot be found.\n\t */\n\tremove(id: string): Promise<void>;\n\n\t/**\n\t * Query all the blob storage entries which match the conditions.\n\t * @param conditions The conditions to match for the entries.\n\t * @param orderBy The order for the results, defaults to created.\n\t * @param orderByDirection The direction for the order, defaults to descending.\n\t * @param cursor The cursor to request the next page of entries.\n\t * @param limit The suggested number of entries to return in each chunk, in some scenarios can return a different amount.\n\t * @returns All the entries for the storage matching the conditions,\n\t * and a cursor which can be used to request more entities.\n\t */\n\tquery(\n\t\tconditions?: EntityCondition<IBlobStorageEntry>,\n\t\torderBy?: keyof Pick<IBlobStorageEntry, \"dateCreated\" | \"dateModified\">,\n\t\torderByDirection?: SortDirection,\n\t\tcursor?: string,\n\t\tlimit?: number\n\t): Promise<{\n\t\tentries: IBlobStorageEntryList;\n\t\tcursor?: string;\n\t}>;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IBlobStorageEntryList.js","sourceRoot":"","sources":["../../../src/models/IBlobStorageEntryList.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IJsonLdContextDefinitionElement } from \"@twin.org/data-json-ld\";\nimport type { SchemaOrgContexts, SchemaOrgTypes } from \"@twin.org/standards-schema-org\";\nimport type { BlobStorageContexts } from \"./blobStorageContexts.js\";\nimport type { IBlobStorageEntry } from \"./IBlobStorageEntry.js\";\n\n/**\n * Interface describing an blob storage entry list.\n */\nexport interface IBlobStorageEntryList {\n\t/**\n\t * JSON-LD Context.\n\t */\n\t\"@context\": [\n\t\ttypeof SchemaOrgContexts.Context,\n\t\ttypeof BlobStorageContexts.Context,\n\t\ttypeof BlobStorageContexts.ContextCommon,\n\t\t...IJsonLdContextDefinitionElement[]\n\t];\n\n\t/**\n\t * JSON-LD Type.\n\t */\n\ttype: typeof SchemaOrgTypes.ItemList;\n\n\t/**\n\t * The list of entries.\n\t */\n\t[SchemaOrgTypes.ItemListElement]: IBlobStorageEntry[];\n
|
|
1
|
+
{"version":3,"file":"IBlobStorageEntryList.js","sourceRoot":"","sources":["../../../src/models/IBlobStorageEntryList.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IJsonLdContextDefinitionElement } from \"@twin.org/data-json-ld\";\nimport type { SchemaOrgContexts, SchemaOrgTypes } from \"@twin.org/standards-schema-org\";\nimport type { BlobStorageContexts } from \"./blobStorageContexts.js\";\nimport type { IBlobStorageEntry } from \"./IBlobStorageEntry.js\";\n\n/**\n * Interface describing an blob storage entry list.\n */\nexport interface IBlobStorageEntryList {\n\t/**\n\t * JSON-LD Context.\n\t */\n\t\"@context\": [\n\t\ttypeof SchemaOrgContexts.Context,\n\t\ttypeof BlobStorageContexts.Context,\n\t\ttypeof BlobStorageContexts.ContextCommon,\n\t\t...IJsonLdContextDefinitionElement[]\n\t];\n\n\t/**\n\t * JSON-LD Type.\n\t */\n\ttype: typeof SchemaOrgTypes.ItemList;\n\n\t/**\n\t * The list of entries.\n\t */\n\t[SchemaOrgTypes.ItemListElement]: IBlobStorageEntry[];\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IBlobStorageListResponse.js","sourceRoot":"","sources":["../../../../src/models/api/IBlobStorageListResponse.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { HeaderTypes, MimeTypes } from \"@twin.org/web\";\nimport type { IBlobStorageEntryList } from \"../IBlobStorageEntryList.js\";\n\n/**\n * Response to getting the list of entries from a query.\n */\nexport interface IBlobStorageListResponse {\n\t/**\n\t * The headers which can be used to determine the response data type.\n\t */\n\theaders?: {\n\t\t[HeaderTypes.ContentType]: typeof MimeTypes.Json | typeof MimeTypes.JsonLd;\n\t};\n\n\t/**\n\t * The list of entries from the query.\n\t */\n\tbody: IBlobStorageEntryList;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"IBlobStorageListResponse.js","sourceRoot":"","sources":["../../../../src/models/api/IBlobStorageListResponse.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { HeaderTypes, MimeTypes } from \"@twin.org/web\";\nimport type { IBlobStorageEntryList } from \"../IBlobStorageEntryList.js\";\n\n/**\n * Response to getting the list of entries from a query.\n */\nexport interface IBlobStorageListResponse {\n\t/**\n\t * The headers which can be used to determine the response data type.\n\t */\n\theaders?: {\n\t\t[HeaderTypes.ContentType]: typeof MimeTypes.Json | typeof MimeTypes.JsonLd;\n\t\t[HeaderTypes.Link]?: string | string[];\n\t};\n\n\t/**\n\t * The list of entries from the query.\n\t */\n\tbody: IBlobStorageEntryList;\n}\n"]}
|
|
@@ -69,5 +69,8 @@ export interface IBlobStorageComponent extends IComponent {
|
|
|
69
69
|
* @returns All the entries for the storage matching the conditions,
|
|
70
70
|
* and a cursor which can be used to request more entities.
|
|
71
71
|
*/
|
|
72
|
-
query(conditions?: EntityCondition<IBlobStorageEntry>, orderBy?: keyof Pick<IBlobStorageEntry, "dateCreated" | "dateModified">, orderByDirection?: SortDirection, cursor?: string, limit?: number): Promise<
|
|
72
|
+
query(conditions?: EntityCondition<IBlobStorageEntry>, orderBy?: keyof Pick<IBlobStorageEntry, "dateCreated" | "dateModified">, orderByDirection?: SortDirection, cursor?: string, limit?: number): Promise<{
|
|
73
|
+
entries: IBlobStorageEntryList;
|
|
74
|
+
cursor?: string;
|
|
75
|
+
}>;
|
|
73
76
|
}
|
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @twin.org/blob-storage-models - Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.3-next.4](https://github.com/twinfoundation/blob-storage/compare/blob-storage-models-v0.0.3-next.3...blob-storage-models-v0.0.3-next.4) (2026-01-23)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* replace nextItem property with Link header ([#37](https://github.com/twinfoundation/blob-storage/issues/37)) ([0b68da5](https://github.com/twinfoundation/blob-storage/commit/0b68da58549c9e52eb2313ea5a868573840d5ca6))
|
|
9
|
+
|
|
3
10
|
## [0.0.3-next.3](https://github.com/twinfoundation/blob-storage/compare/blob-storage-models-v0.0.3-next.2...blob-storage-models-v0.0.3-next.3) (2026-01-21)
|
|
4
11
|
|
|
5
12
|
|
|
@@ -196,7 +196,7 @@ Not found error if the blob cannot be found.
|
|
|
196
196
|
|
|
197
197
|
### query()
|
|
198
198
|
|
|
199
|
-
> **query**(`conditions?`, `orderBy?`, `orderByDirection?`, `cursor?`, `limit?`): `Promise
|
|
199
|
+
> **query**(`conditions?`, `orderBy?`, `orderByDirection?`, `cursor?`, `limit?`): `Promise`\<\{ `entries`: [`IBlobStorageEntryList`](IBlobStorageEntryList.md); `cursor?`: `string`; \}\>
|
|
200
200
|
|
|
201
201
|
Query all the blob storage entries which match the conditions.
|
|
202
202
|
|
|
@@ -234,7 +234,7 @@ The suggested number of entries to return in each chunk, in some scenarios can r
|
|
|
234
234
|
|
|
235
235
|
#### Returns
|
|
236
236
|
|
|
237
|
-
`Promise
|
|
237
|
+
`Promise`\<\{ `entries`: [`IBlobStorageEntryList`](IBlobStorageEntryList.md); `cursor?`: `string`; \}\>
|
|
238
238
|
|
|
239
239
|
All the entries for the storage matching the conditions,
|
|
240
240
|
and a cursor which can be used to request more entities.
|