@twin.org/blob-storage-service 0.0.1-next.19 → 0.0.1-next.21
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
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var apiModels = require('@twin.org/api-models');
|
|
4
4
|
var blobStorageModels = require('@twin.org/blob-storage-models');
|
|
5
5
|
var core = require('@twin.org/core');
|
|
6
|
-
var
|
|
6
|
+
var standardsSchemaOrg = require('@twin.org/standards-schema-org');
|
|
7
7
|
var web = require('@twin.org/web');
|
|
8
8
|
var dataJsonLd = require('@twin.org/data-json-ld');
|
|
9
9
|
var entity = require('@twin.org/entity');
|
|
@@ -54,7 +54,7 @@ function generateRestRoutesBlobStorage(baseRouteName, componentName, options) {
|
|
|
54
54
|
body: {
|
|
55
55
|
blob: "VGhlIHF1aWNrIGJyb3duIGZveCBqdW1wcyBvdmVyIHRoZSBsYXp5IGRvZw==",
|
|
56
56
|
metadata: {
|
|
57
|
-
"@context": "
|
|
57
|
+
"@context": "https://schema.org",
|
|
58
58
|
"@type": "DigitalDocument",
|
|
59
59
|
name: "myfile.pdf"
|
|
60
60
|
}
|
|
@@ -111,7 +111,7 @@ function generateRestRoutesBlobStorage(baseRouteName, componentName, options) {
|
|
|
111
111
|
id: `${camelTypeName}GetResponseExample`,
|
|
112
112
|
response: {
|
|
113
113
|
body: {
|
|
114
|
-
"@context": [blobStorageModels.BlobStorageTypes.ContextRoot,
|
|
114
|
+
"@context": [blobStorageModels.BlobStorageTypes.ContextRoot, standardsSchemaOrg.SchemaOrgTypes.ContextRoot],
|
|
115
115
|
type: blobStorageModels.BlobStorageTypes.Entry,
|
|
116
116
|
id: "blob-memory:c57d94b088f4c6d2cb32ded014813d0c786aa00134c8ee22f84b1e2545602a70",
|
|
117
117
|
dateCreated: "2024-01-01T00:00:00Z",
|
|
@@ -119,7 +119,7 @@ function generateRestRoutesBlobStorage(baseRouteName, componentName, options) {
|
|
|
119
119
|
blobSize: 42,
|
|
120
120
|
fileExtension: "pdf",
|
|
121
121
|
metadata: {
|
|
122
|
-
"@context": "
|
|
122
|
+
"@context": "https://schema.org",
|
|
123
123
|
"@type": "DigitalDocument",
|
|
124
124
|
name: "myfile.pdf"
|
|
125
125
|
},
|
|
@@ -137,7 +137,7 @@ function generateRestRoutesBlobStorage(baseRouteName, componentName, options) {
|
|
|
137
137
|
id: `${camelTypeName}GetResponseJsonLdExample`,
|
|
138
138
|
response: {
|
|
139
139
|
body: {
|
|
140
|
-
"@context": [blobStorageModels.BlobStorageTypes.ContextRoot,
|
|
140
|
+
"@context": [blobStorageModels.BlobStorageTypes.ContextRoot, standardsSchemaOrg.SchemaOrgTypes.ContextRoot],
|
|
141
141
|
type: blobStorageModels.BlobStorageTypes.Entry,
|
|
142
142
|
id: "blob-memory:c57d94b088f4c6d2cb32ded014813d0c786aa00134c8ee22f84b1e2545602a70",
|
|
143
143
|
dateCreated: "2024-01-01T00:00:00Z",
|
|
@@ -145,7 +145,7 @@ function generateRestRoutesBlobStorage(baseRouteName, componentName, options) {
|
|
|
145
145
|
blobSize: 42,
|
|
146
146
|
fileExtension: "pdf",
|
|
147
147
|
metadata: {
|
|
148
|
-
"@context": "
|
|
148
|
+
"@context": "https://schema.org",
|
|
149
149
|
"@type": "DigitalDocument",
|
|
150
150
|
name: "myfile.pdf"
|
|
151
151
|
},
|
|
@@ -221,7 +221,7 @@ function generateRestRoutesBlobStorage(baseRouteName, componentName, options) {
|
|
|
221
221
|
},
|
|
222
222
|
body: {
|
|
223
223
|
metadata: {
|
|
224
|
-
"@context": "
|
|
224
|
+
"@context": "https://schema.org",
|
|
225
225
|
"@type": "DigitalDocument",
|
|
226
226
|
name: "myfile.pdf"
|
|
227
227
|
}
|
|
@@ -293,7 +293,7 @@ function generateRestRoutesBlobStorage(baseRouteName, componentName, options) {
|
|
|
293
293
|
type: blobStorageModels.BlobStorageTypes.EntryList,
|
|
294
294
|
entries: [
|
|
295
295
|
{
|
|
296
|
-
"@context": [blobStorageModels.BlobStorageTypes.ContextRoot,
|
|
296
|
+
"@context": [blobStorageModels.BlobStorageTypes.ContextRoot, standardsSchemaOrg.SchemaOrgTypes.ContextRoot],
|
|
297
297
|
type: blobStorageModels.BlobStorageTypes.Entry,
|
|
298
298
|
id: "blob-memory:c57d94b088f4c6d2cb32ded014813d0c786aa00134c8ee22f84b1e2545602a70",
|
|
299
299
|
dateCreated: "2024-01-01T00:00:00Z",
|
|
@@ -301,7 +301,7 @@ function generateRestRoutesBlobStorage(baseRouteName, componentName, options) {
|
|
|
301
301
|
blobSize: 42,
|
|
302
302
|
fileExtension: "pdf",
|
|
303
303
|
metadata: {
|
|
304
|
-
"@context": "
|
|
304
|
+
"@context": "https://schema.org",
|
|
305
305
|
"@type": "DigitalDocument",
|
|
306
306
|
name: "myfile.pdf"
|
|
307
307
|
},
|
|
@@ -325,7 +325,7 @@ function generateRestRoutesBlobStorage(baseRouteName, componentName, options) {
|
|
|
325
325
|
type: blobStorageModels.BlobStorageTypes.EntryList,
|
|
326
326
|
entries: [
|
|
327
327
|
{
|
|
328
|
-
"@context": [blobStorageModels.BlobStorageTypes.ContextRoot,
|
|
328
|
+
"@context": [blobStorageModels.BlobStorageTypes.ContextRoot, standardsSchemaOrg.SchemaOrgTypes.ContextRoot],
|
|
329
329
|
type: blobStorageModels.BlobStorageTypes.Entry,
|
|
330
330
|
id: "blob-memory:c57d94b088f4c6d2cb32ded014813d0c786aa00134c8ee22f84b1e2545602a70",
|
|
331
331
|
dateCreated: "2024-01-01T00:00:00Z",
|
|
@@ -333,7 +333,7 @@ function generateRestRoutesBlobStorage(baseRouteName, componentName, options) {
|
|
|
333
333
|
blobSize: 42,
|
|
334
334
|
fileExtension: "pdf",
|
|
335
335
|
metadata: {
|
|
336
|
-
"@context": "
|
|
336
|
+
"@context": "https://schema.org",
|
|
337
337
|
"@type": "DigitalDocument",
|
|
338
338
|
name: "myfile.pdf"
|
|
339
339
|
},
|
|
@@ -543,7 +543,7 @@ class BlobStorageService {
|
|
|
543
543
|
this._vaultKeyId = options?.config?.vaultKeyId ?? "blob-storage";
|
|
544
544
|
this._includeNodeIdentity = options?.config?.includeNodeIdentity ?? true;
|
|
545
545
|
this._includeUserIdentity = options?.config?.includeUserIdentity ?? true;
|
|
546
|
-
|
|
546
|
+
standardsSchemaOrg.SchemaOrgDataTypes.registerRedirects();
|
|
547
547
|
}
|
|
548
548
|
/**
|
|
549
549
|
* Create the blob with some metadata.
|
|
@@ -802,7 +802,7 @@ class BlobStorageService {
|
|
|
802
802
|
core.ObjectHelper.propertyDelete(entity, "userIdentity");
|
|
803
803
|
}
|
|
804
804
|
const jsonLd = {
|
|
805
|
-
"@context": [blobStorageModels.BlobStorageTypes.ContextRoot,
|
|
805
|
+
"@context": [blobStorageModels.BlobStorageTypes.ContextRoot, standardsSchemaOrg.SchemaOrgTypes.ContextRoot],
|
|
806
806
|
type: blobStorageModels.BlobStorageTypes.EntryList,
|
|
807
807
|
// The entries are never Partial as we don't allow custom property requests.
|
|
808
808
|
entries: result.entities.map(entry => this.entryToJsonLd(entry)),
|
|
@@ -888,7 +888,7 @@ class BlobStorageService {
|
|
|
888
888
|
*/
|
|
889
889
|
entryToJsonLd(entry, blob) {
|
|
890
890
|
return {
|
|
891
|
-
"@context": [blobStorageModels.BlobStorageTypes.ContextRoot,
|
|
891
|
+
"@context": [blobStorageModels.BlobStorageTypes.ContextRoot, standardsSchemaOrg.SchemaOrgTypes.ContextRoot],
|
|
892
892
|
id: entry.id,
|
|
893
893
|
type: blobStorageModels.BlobStorageTypes.Entry,
|
|
894
894
|
dateCreated: entry.dateCreated,
|
|
@@ -946,39 +946,39 @@ exports.BlobStorageEntry = class BlobStorageEntry {
|
|
|
946
946
|
__decorate([
|
|
947
947
|
entity.property({ type: "string", isPrimary: true }),
|
|
948
948
|
__metadata("design:type", String)
|
|
949
|
-
], exports.BlobStorageEntry.prototype, "id",
|
|
949
|
+
], exports.BlobStorageEntry.prototype, "id", void 0);
|
|
950
950
|
__decorate([
|
|
951
951
|
entity.property({ type: "string", format: "date-time", sortDirection: entity.SortDirection.Descending }),
|
|
952
952
|
__metadata("design:type", String)
|
|
953
|
-
], exports.BlobStorageEntry.prototype, "dateCreated",
|
|
953
|
+
], exports.BlobStorageEntry.prototype, "dateCreated", void 0);
|
|
954
954
|
__decorate([
|
|
955
955
|
entity.property({ type: "string", format: "date-time", sortDirection: entity.SortDirection.Descending }),
|
|
956
956
|
__metadata("design:type", String)
|
|
957
|
-
], exports.BlobStorageEntry.prototype, "dateModified",
|
|
957
|
+
], exports.BlobStorageEntry.prototype, "dateModified", void 0);
|
|
958
958
|
__decorate([
|
|
959
959
|
entity.property({ type: "number" }),
|
|
960
960
|
__metadata("design:type", Number)
|
|
961
|
-
], exports.BlobStorageEntry.prototype, "blobSize",
|
|
961
|
+
], exports.BlobStorageEntry.prototype, "blobSize", void 0);
|
|
962
962
|
__decorate([
|
|
963
963
|
entity.property({ type: "string" }),
|
|
964
964
|
__metadata("design:type", String)
|
|
965
|
-
], exports.BlobStorageEntry.prototype, "encodingFormat",
|
|
965
|
+
], exports.BlobStorageEntry.prototype, "encodingFormat", void 0);
|
|
966
966
|
__decorate([
|
|
967
967
|
entity.property({ type: "string" }),
|
|
968
968
|
__metadata("design:type", String)
|
|
969
|
-
], exports.BlobStorageEntry.prototype, "fileExtension",
|
|
969
|
+
], exports.BlobStorageEntry.prototype, "fileExtension", void 0);
|
|
970
970
|
__decorate([
|
|
971
971
|
entity.property({ type: "object", itemTypeRef: "IJsonLdNodeObject" }),
|
|
972
972
|
__metadata("design:type", Object)
|
|
973
|
-
], exports.BlobStorageEntry.prototype, "metadata",
|
|
973
|
+
], exports.BlobStorageEntry.prototype, "metadata", void 0);
|
|
974
974
|
__decorate([
|
|
975
975
|
entity.property({ type: "string" }),
|
|
976
976
|
__metadata("design:type", String)
|
|
977
|
-
], exports.BlobStorageEntry.prototype, "userIdentity",
|
|
977
|
+
], exports.BlobStorageEntry.prototype, "userIdentity", void 0);
|
|
978
978
|
__decorate([
|
|
979
979
|
entity.property({ type: "string" }),
|
|
980
980
|
__metadata("design:type", String)
|
|
981
|
-
], exports.BlobStorageEntry.prototype, "nodeIdentity",
|
|
981
|
+
], exports.BlobStorageEntry.prototype, "nodeIdentity", void 0);
|
|
982
982
|
exports.BlobStorageEntry = __decorate([
|
|
983
983
|
entity.entity()
|
|
984
984
|
], exports.BlobStorageEntry);
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { HttpParameterHelper } from '@twin.org/api-models';
|
|
2
2
|
import { BlobStorageTypes, BlobStorageConnectorFactory } from '@twin.org/blob-storage-models';
|
|
3
3
|
import { StringHelper, Guards, ComponentFactory, Is, Converter, Coerce, GeneralError, Validation, ObjectHelper, Urn, NotFoundError } from '@twin.org/core';
|
|
4
|
-
import { SchemaOrgTypes, SchemaOrgDataTypes } from '@twin.org/
|
|
4
|
+
import { SchemaOrgTypes, SchemaOrgDataTypes } from '@twin.org/standards-schema-org';
|
|
5
5
|
import { HttpStatusCode, HeaderTypes, MimeTypes, MimeTypeHelper } from '@twin.org/web';
|
|
6
6
|
import { JsonLdHelper, JsonLdProcessor } from '@twin.org/data-json-ld';
|
|
7
7
|
import { ComparisonOperator, LogicalOperator, SortDirection, EntitySchemaHelper, property, entity, EntitySchemaFactory } from '@twin.org/entity';
|
|
@@ -52,7 +52,7 @@ function generateRestRoutesBlobStorage(baseRouteName, componentName, options) {
|
|
|
52
52
|
body: {
|
|
53
53
|
blob: "VGhlIHF1aWNrIGJyb3duIGZveCBqdW1wcyBvdmVyIHRoZSBsYXp5IGRvZw==",
|
|
54
54
|
metadata: {
|
|
55
|
-
"@context": "
|
|
55
|
+
"@context": "https://schema.org",
|
|
56
56
|
"@type": "DigitalDocument",
|
|
57
57
|
name: "myfile.pdf"
|
|
58
58
|
}
|
|
@@ -117,7 +117,7 @@ function generateRestRoutesBlobStorage(baseRouteName, componentName, options) {
|
|
|
117
117
|
blobSize: 42,
|
|
118
118
|
fileExtension: "pdf",
|
|
119
119
|
metadata: {
|
|
120
|
-
"@context": "
|
|
120
|
+
"@context": "https://schema.org",
|
|
121
121
|
"@type": "DigitalDocument",
|
|
122
122
|
name: "myfile.pdf"
|
|
123
123
|
},
|
|
@@ -143,7 +143,7 @@ function generateRestRoutesBlobStorage(baseRouteName, componentName, options) {
|
|
|
143
143
|
blobSize: 42,
|
|
144
144
|
fileExtension: "pdf",
|
|
145
145
|
metadata: {
|
|
146
|
-
"@context": "
|
|
146
|
+
"@context": "https://schema.org",
|
|
147
147
|
"@type": "DigitalDocument",
|
|
148
148
|
name: "myfile.pdf"
|
|
149
149
|
},
|
|
@@ -219,7 +219,7 @@ function generateRestRoutesBlobStorage(baseRouteName, componentName, options) {
|
|
|
219
219
|
},
|
|
220
220
|
body: {
|
|
221
221
|
metadata: {
|
|
222
|
-
"@context": "
|
|
222
|
+
"@context": "https://schema.org",
|
|
223
223
|
"@type": "DigitalDocument",
|
|
224
224
|
name: "myfile.pdf"
|
|
225
225
|
}
|
|
@@ -299,7 +299,7 @@ function generateRestRoutesBlobStorage(baseRouteName, componentName, options) {
|
|
|
299
299
|
blobSize: 42,
|
|
300
300
|
fileExtension: "pdf",
|
|
301
301
|
metadata: {
|
|
302
|
-
"@context": "
|
|
302
|
+
"@context": "https://schema.org",
|
|
303
303
|
"@type": "DigitalDocument",
|
|
304
304
|
name: "myfile.pdf"
|
|
305
305
|
},
|
|
@@ -331,7 +331,7 @@ function generateRestRoutesBlobStorage(baseRouteName, componentName, options) {
|
|
|
331
331
|
blobSize: 42,
|
|
332
332
|
fileExtension: "pdf",
|
|
333
333
|
metadata: {
|
|
334
|
-
"@context": "
|
|
334
|
+
"@context": "https://schema.org",
|
|
335
335
|
"@type": "DigitalDocument",
|
|
336
336
|
name: "myfile.pdf"
|
|
337
337
|
},
|
|
@@ -944,39 +944,39 @@ let BlobStorageEntry = class BlobStorageEntry {
|
|
|
944
944
|
__decorate([
|
|
945
945
|
property({ type: "string", isPrimary: true }),
|
|
946
946
|
__metadata("design:type", String)
|
|
947
|
-
], BlobStorageEntry.prototype, "id",
|
|
947
|
+
], BlobStorageEntry.prototype, "id", void 0);
|
|
948
948
|
__decorate([
|
|
949
949
|
property({ type: "string", format: "date-time", sortDirection: SortDirection.Descending }),
|
|
950
950
|
__metadata("design:type", String)
|
|
951
|
-
], BlobStorageEntry.prototype, "dateCreated",
|
|
951
|
+
], BlobStorageEntry.prototype, "dateCreated", void 0);
|
|
952
952
|
__decorate([
|
|
953
953
|
property({ type: "string", format: "date-time", sortDirection: SortDirection.Descending }),
|
|
954
954
|
__metadata("design:type", String)
|
|
955
|
-
], BlobStorageEntry.prototype, "dateModified",
|
|
955
|
+
], BlobStorageEntry.prototype, "dateModified", void 0);
|
|
956
956
|
__decorate([
|
|
957
957
|
property({ type: "number" }),
|
|
958
958
|
__metadata("design:type", Number)
|
|
959
|
-
], BlobStorageEntry.prototype, "blobSize",
|
|
959
|
+
], BlobStorageEntry.prototype, "blobSize", void 0);
|
|
960
960
|
__decorate([
|
|
961
961
|
property({ type: "string" }),
|
|
962
962
|
__metadata("design:type", String)
|
|
963
|
-
], BlobStorageEntry.prototype, "encodingFormat",
|
|
963
|
+
], BlobStorageEntry.prototype, "encodingFormat", void 0);
|
|
964
964
|
__decorate([
|
|
965
965
|
property({ type: "string" }),
|
|
966
966
|
__metadata("design:type", String)
|
|
967
|
-
], BlobStorageEntry.prototype, "fileExtension",
|
|
967
|
+
], BlobStorageEntry.prototype, "fileExtension", void 0);
|
|
968
968
|
__decorate([
|
|
969
969
|
property({ type: "object", itemTypeRef: "IJsonLdNodeObject" }),
|
|
970
970
|
__metadata("design:type", Object)
|
|
971
|
-
], BlobStorageEntry.prototype, "metadata",
|
|
971
|
+
], BlobStorageEntry.prototype, "metadata", void 0);
|
|
972
972
|
__decorate([
|
|
973
973
|
property({ type: "string" }),
|
|
974
974
|
__metadata("design:type", String)
|
|
975
|
-
], BlobStorageEntry.prototype, "userIdentity",
|
|
975
|
+
], BlobStorageEntry.prototype, "userIdentity", void 0);
|
|
976
976
|
__decorate([
|
|
977
977
|
property({ type: "string" }),
|
|
978
978
|
__metadata("design:type", String)
|
|
979
|
-
], BlobStorageEntry.prototype, "nodeIdentity",
|
|
979
|
+
], BlobStorageEntry.prototype, "nodeIdentity", void 0);
|
|
980
980
|
BlobStorageEntry = __decorate([
|
|
981
981
|
entity()
|
|
982
982
|
], BlobStorageEntry);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type IBlobStorageComponent, type IBlobStorageEntry, type IBlobStorageEntryList } from "@twin.org/blob-storage-models";
|
|
2
2
|
import { type IJsonLdNodeObject } from "@twin.org/data-json-ld";
|
|
3
|
-
import { type EntityCondition
|
|
3
|
+
import { SortDirection, type EntityCondition } from "@twin.org/entity";
|
|
4
4
|
import type { IBlobStorageServiceConstructorOptions } from "./models/IBlobStorageServiceConstructorOptions";
|
|
5
5
|
/**
|
|
6
6
|
* Service for performing blob storage operations to a connector.
|
package/docs/changelog.md
CHANGED