@twin.org/blob-storage-service 0.0.1-next.26 → 0.0.1-next.28

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.
@@ -113,9 +113,9 @@ function generateRestRoutesBlobStorage(baseRouteName, componentName, options) {
113
113
  response: {
114
114
  body: {
115
115
  "@context": [
116
- blobStorageModels.BlobStorageTypes.ContextRoot,
117
- blobStorageModels.BlobStorageTypes.ContextRootCommon,
118
- standardsSchemaOrg.SchemaOrgTypes.ContextRoot
116
+ blobStorageModels.BlobStorageContexts.ContextRoot,
117
+ blobStorageModels.BlobStorageContexts.ContextRootCommon,
118
+ standardsSchemaOrg.SchemaOrgContexts.ContextRoot
119
119
  ],
120
120
  type: blobStorageModels.BlobStorageTypes.Entry,
121
121
  id: "blob-memory:c57d94b088f4c6d2cb32ded014813d0c786aa00134c8ee22f84b1e2545602a70",
@@ -144,9 +144,9 @@ function generateRestRoutesBlobStorage(baseRouteName, componentName, options) {
144
144
  response: {
145
145
  body: {
146
146
  "@context": [
147
- blobStorageModels.BlobStorageTypes.ContextRoot,
148
- blobStorageModels.BlobStorageTypes.ContextRootCommon,
149
- standardsSchemaOrg.SchemaOrgTypes.ContextRoot
147
+ blobStorageModels.BlobStorageContexts.ContextRoot,
148
+ blobStorageModels.BlobStorageContexts.ContextRootCommon,
149
+ standardsSchemaOrg.SchemaOrgContexts.ContextRoot
150
150
  ],
151
151
  type: blobStorageModels.BlobStorageTypes.Entry,
152
152
  id: "blob-memory:c57d94b088f4c6d2cb32ded014813d0c786aa00134c8ee22f84b1e2545602a70",
@@ -300,14 +300,17 @@ function generateRestRoutesBlobStorage(baseRouteName, componentName, options) {
300
300
  id: `${camelTypeName}ListResponseExample`,
301
301
  response: {
302
302
  body: {
303
- "@context": [blobStorageModels.BlobStorageTypes.ContextRoot, blobStorageModels.BlobStorageTypes.ContextRootCommon],
303
+ "@context": [
304
+ blobStorageModels.BlobStorageContexts.ContextRoot,
305
+ blobStorageModels.BlobStorageContexts.ContextRootCommon
306
+ ],
304
307
  type: blobStorageModels.BlobStorageTypes.EntryList,
305
308
  entries: [
306
309
  {
307
310
  "@context": [
308
- blobStorageModels.BlobStorageTypes.ContextRoot,
309
- blobStorageModels.BlobStorageTypes.ContextRootCommon,
310
- standardsSchemaOrg.SchemaOrgTypes.ContextRoot
311
+ blobStorageModels.BlobStorageContexts.ContextRoot,
312
+ blobStorageModels.BlobStorageContexts.ContextRootCommon,
313
+ standardsSchemaOrg.SchemaOrgContexts.ContextRoot
311
314
  ],
312
315
  type: blobStorageModels.BlobStorageTypes.Entry,
313
316
  id: "blob-memory:c57d94b088f4c6d2cb32ded014813d0c786aa00134c8ee22f84b1e2545602a70",
@@ -337,14 +340,17 @@ function generateRestRoutesBlobStorage(baseRouteName, componentName, options) {
337
340
  id: `${camelTypeName}ListResponseJsonLdExample`,
338
341
  response: {
339
342
  body: {
340
- "@context": [blobStorageModels.BlobStorageTypes.ContextRoot, blobStorageModels.BlobStorageTypes.ContextRootCommon],
343
+ "@context": [
344
+ blobStorageModels.BlobStorageContexts.ContextRoot,
345
+ blobStorageModels.BlobStorageContexts.ContextRootCommon
346
+ ],
341
347
  type: blobStorageModels.BlobStorageTypes.EntryList,
342
348
  entries: [
343
349
  {
344
350
  "@context": [
345
- blobStorageModels.BlobStorageTypes.ContextRoot,
346
- blobStorageModels.BlobStorageTypes.ContextRootCommon,
347
- standardsSchemaOrg.SchemaOrgTypes.ContextRoot
351
+ blobStorageModels.BlobStorageContexts.ContextRoot,
352
+ blobStorageModels.BlobStorageContexts.ContextRootCommon,
353
+ standardsSchemaOrg.SchemaOrgContexts.ContextRoot
348
354
  ],
349
355
  type: blobStorageModels.BlobStorageTypes.Entry,
350
356
  id: "blob-memory:c57d94b088f4c6d2cb32ded014813d0c786aa00134c8ee22f84b1e2545602a70",
@@ -825,9 +831,9 @@ class BlobStorageService {
825
831
  core.ObjectHelper.propertyDelete(entity, "userIdentity");
826
832
  }
827
833
  let context = [
828
- blobStorageModels.BlobStorageTypes.ContextRoot,
829
- blobStorageModels.BlobStorageTypes.ContextRootCommon,
830
- standardsSchemaOrg.SchemaOrgTypes.ContextRoot
834
+ blobStorageModels.BlobStorageContexts.ContextRoot,
835
+ blobStorageModels.BlobStorageContexts.ContextRootCommon,
836
+ standardsSchemaOrg.SchemaOrgContexts.ContextRoot
831
837
  ];
832
838
  const entriesJsonLd = [];
833
839
  for (const entry of result.entities) {
@@ -921,9 +927,9 @@ class BlobStorageService {
921
927
  entryToJsonLd(entry, blob) {
922
928
  const jsonLd = {
923
929
  "@context": dataJsonLd.JsonLdProcessor.combineContexts([
924
- blobStorageModels.BlobStorageTypes.ContextRoot,
925
- blobStorageModels.BlobStorageTypes.ContextRootCommon,
926
- standardsSchemaOrg.SchemaOrgTypes.ContextRoot
930
+ blobStorageModels.BlobStorageContexts.ContextRoot,
931
+ blobStorageModels.BlobStorageContexts.ContextRootCommon,
932
+ standardsSchemaOrg.SchemaOrgContexts.ContextRoot
927
933
  ], entry?.metadata?.["@context"]),
928
934
  id: entry.id,
929
935
  type: blobStorageModels.BlobStorageTypes.Entry,
@@ -994,7 +1000,12 @@ __decorate([
994
1000
  __metadata("design:type", String)
995
1001
  ], exports.BlobStorageEntry.prototype, "dateCreated", void 0);
996
1002
  __decorate([
997
- entity.property({ type: "string", format: "date-time", sortDirection: entity.SortDirection.Descending }),
1003
+ entity.property({
1004
+ type: "string",
1005
+ format: "date-time",
1006
+ sortDirection: entity.SortDirection.Descending,
1007
+ optional: true
1008
+ }),
998
1009
  __metadata("design:type", String)
999
1010
  ], exports.BlobStorageEntry.prototype, "dateModified", void 0);
1000
1011
  __decorate([
@@ -1006,23 +1017,23 @@ __decorate([
1006
1017
  __metadata("design:type", String)
1007
1018
  ], exports.BlobStorageEntry.prototype, "blobHash", void 0);
1008
1019
  __decorate([
1009
- entity.property({ type: "string" }),
1020
+ entity.property({ type: "string", optional: true }),
1010
1021
  __metadata("design:type", String)
1011
1022
  ], exports.BlobStorageEntry.prototype, "encodingFormat", void 0);
1012
1023
  __decorate([
1013
- entity.property({ type: "string" }),
1024
+ entity.property({ type: "string", optional: true }),
1014
1025
  __metadata("design:type", String)
1015
1026
  ], exports.BlobStorageEntry.prototype, "fileExtension", void 0);
1016
1027
  __decorate([
1017
- entity.property({ type: "object", itemTypeRef: "IJsonLdNodeObject" }),
1028
+ entity.property({ type: "object", itemTypeRef: "IJsonLdNodeObject", optional: true }),
1018
1029
  __metadata("design:type", Object)
1019
1030
  ], exports.BlobStorageEntry.prototype, "metadata", void 0);
1020
1031
  __decorate([
1021
- entity.property({ type: "string" }),
1032
+ entity.property({ type: "string", optional: true }),
1022
1033
  __metadata("design:type", String)
1023
1034
  ], exports.BlobStorageEntry.prototype, "userIdentity", void 0);
1024
1035
  __decorate([
1025
- entity.property({ type: "string" }),
1036
+ entity.property({ type: "string", optional: true }),
1026
1037
  __metadata("design:type", String)
1027
1038
  ], exports.BlobStorageEntry.prototype, "nodeIdentity", void 0);
1028
1039
  exports.BlobStorageEntry = __decorate([
@@ -1,7 +1,7 @@
1
1
  import { HttpParameterHelper } from '@twin.org/api-models';
2
- import { BlobStorageTypes, BlobStorageConnectorFactory } from '@twin.org/blob-storage-models';
2
+ import { BlobStorageTypes, BlobStorageContexts, 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/standards-schema-org';
4
+ import { SchemaOrgContexts, SchemaOrgDataTypes } from '@twin.org/standards-schema-org';
5
5
  import { HttpStatusCode, HeaderTypes, MimeTypes, MimeTypeHelper } from '@twin.org/web';
6
6
  import { Sha256 } from '@twin.org/crypto';
7
7
  import { JsonLdHelper, JsonLdProcessor } from '@twin.org/data-json-ld';
@@ -111,9 +111,9 @@ function generateRestRoutesBlobStorage(baseRouteName, componentName, options) {
111
111
  response: {
112
112
  body: {
113
113
  "@context": [
114
- BlobStorageTypes.ContextRoot,
115
- BlobStorageTypes.ContextRootCommon,
116
- SchemaOrgTypes.ContextRoot
114
+ BlobStorageContexts.ContextRoot,
115
+ BlobStorageContexts.ContextRootCommon,
116
+ SchemaOrgContexts.ContextRoot
117
117
  ],
118
118
  type: BlobStorageTypes.Entry,
119
119
  id: "blob-memory:c57d94b088f4c6d2cb32ded014813d0c786aa00134c8ee22f84b1e2545602a70",
@@ -142,9 +142,9 @@ function generateRestRoutesBlobStorage(baseRouteName, componentName, options) {
142
142
  response: {
143
143
  body: {
144
144
  "@context": [
145
- BlobStorageTypes.ContextRoot,
146
- BlobStorageTypes.ContextRootCommon,
147
- SchemaOrgTypes.ContextRoot
145
+ BlobStorageContexts.ContextRoot,
146
+ BlobStorageContexts.ContextRootCommon,
147
+ SchemaOrgContexts.ContextRoot
148
148
  ],
149
149
  type: BlobStorageTypes.Entry,
150
150
  id: "blob-memory:c57d94b088f4c6d2cb32ded014813d0c786aa00134c8ee22f84b1e2545602a70",
@@ -298,14 +298,17 @@ function generateRestRoutesBlobStorage(baseRouteName, componentName, options) {
298
298
  id: `${camelTypeName}ListResponseExample`,
299
299
  response: {
300
300
  body: {
301
- "@context": [BlobStorageTypes.ContextRoot, BlobStorageTypes.ContextRootCommon],
301
+ "@context": [
302
+ BlobStorageContexts.ContextRoot,
303
+ BlobStorageContexts.ContextRootCommon
304
+ ],
302
305
  type: BlobStorageTypes.EntryList,
303
306
  entries: [
304
307
  {
305
308
  "@context": [
306
- BlobStorageTypes.ContextRoot,
307
- BlobStorageTypes.ContextRootCommon,
308
- SchemaOrgTypes.ContextRoot
309
+ BlobStorageContexts.ContextRoot,
310
+ BlobStorageContexts.ContextRootCommon,
311
+ SchemaOrgContexts.ContextRoot
309
312
  ],
310
313
  type: BlobStorageTypes.Entry,
311
314
  id: "blob-memory:c57d94b088f4c6d2cb32ded014813d0c786aa00134c8ee22f84b1e2545602a70",
@@ -335,14 +338,17 @@ function generateRestRoutesBlobStorage(baseRouteName, componentName, options) {
335
338
  id: `${camelTypeName}ListResponseJsonLdExample`,
336
339
  response: {
337
340
  body: {
338
- "@context": [BlobStorageTypes.ContextRoot, BlobStorageTypes.ContextRootCommon],
341
+ "@context": [
342
+ BlobStorageContexts.ContextRoot,
343
+ BlobStorageContexts.ContextRootCommon
344
+ ],
339
345
  type: BlobStorageTypes.EntryList,
340
346
  entries: [
341
347
  {
342
348
  "@context": [
343
- BlobStorageTypes.ContextRoot,
344
- BlobStorageTypes.ContextRootCommon,
345
- SchemaOrgTypes.ContextRoot
349
+ BlobStorageContexts.ContextRoot,
350
+ BlobStorageContexts.ContextRootCommon,
351
+ SchemaOrgContexts.ContextRoot
346
352
  ],
347
353
  type: BlobStorageTypes.Entry,
348
354
  id: "blob-memory:c57d94b088f4c6d2cb32ded014813d0c786aa00134c8ee22f84b1e2545602a70",
@@ -823,9 +829,9 @@ class BlobStorageService {
823
829
  ObjectHelper.propertyDelete(entity, "userIdentity");
824
830
  }
825
831
  let context = [
826
- BlobStorageTypes.ContextRoot,
827
- BlobStorageTypes.ContextRootCommon,
828
- SchemaOrgTypes.ContextRoot
832
+ BlobStorageContexts.ContextRoot,
833
+ BlobStorageContexts.ContextRootCommon,
834
+ SchemaOrgContexts.ContextRoot
829
835
  ];
830
836
  const entriesJsonLd = [];
831
837
  for (const entry of result.entities) {
@@ -919,9 +925,9 @@ class BlobStorageService {
919
925
  entryToJsonLd(entry, blob) {
920
926
  const jsonLd = {
921
927
  "@context": JsonLdProcessor.combineContexts([
922
- BlobStorageTypes.ContextRoot,
923
- BlobStorageTypes.ContextRootCommon,
924
- SchemaOrgTypes.ContextRoot
928
+ BlobStorageContexts.ContextRoot,
929
+ BlobStorageContexts.ContextRootCommon,
930
+ SchemaOrgContexts.ContextRoot
925
931
  ], entry?.metadata?.["@context"]),
926
932
  id: entry.id,
927
933
  type: BlobStorageTypes.Entry,
@@ -992,7 +998,12 @@ __decorate([
992
998
  __metadata("design:type", String)
993
999
  ], BlobStorageEntry.prototype, "dateCreated", void 0);
994
1000
  __decorate([
995
- property({ type: "string", format: "date-time", sortDirection: SortDirection.Descending }),
1001
+ property({
1002
+ type: "string",
1003
+ format: "date-time",
1004
+ sortDirection: SortDirection.Descending,
1005
+ optional: true
1006
+ }),
996
1007
  __metadata("design:type", String)
997
1008
  ], BlobStorageEntry.prototype, "dateModified", void 0);
998
1009
  __decorate([
@@ -1004,23 +1015,23 @@ __decorate([
1004
1015
  __metadata("design:type", String)
1005
1016
  ], BlobStorageEntry.prototype, "blobHash", void 0);
1006
1017
  __decorate([
1007
- property({ type: "string" }),
1018
+ property({ type: "string", optional: true }),
1008
1019
  __metadata("design:type", String)
1009
1020
  ], BlobStorageEntry.prototype, "encodingFormat", void 0);
1010
1021
  __decorate([
1011
- property({ type: "string" }),
1022
+ property({ type: "string", optional: true }),
1012
1023
  __metadata("design:type", String)
1013
1024
  ], BlobStorageEntry.prototype, "fileExtension", void 0);
1014
1025
  __decorate([
1015
- property({ type: "object", itemTypeRef: "IJsonLdNodeObject" }),
1026
+ property({ type: "object", itemTypeRef: "IJsonLdNodeObject", optional: true }),
1016
1027
  __metadata("design:type", Object)
1017
1028
  ], BlobStorageEntry.prototype, "metadata", void 0);
1018
1029
  __decorate([
1019
- property({ type: "string" }),
1030
+ property({ type: "string", optional: true }),
1020
1031
  __metadata("design:type", String)
1021
1032
  ], BlobStorageEntry.prototype, "userIdentity", void 0);
1022
1033
  __decorate([
1023
- property({ type: "string" }),
1034
+ property({ type: "string", optional: true }),
1024
1035
  __metadata("design:type", String)
1025
1036
  ], BlobStorageEntry.prototype, "nodeIdentity", void 0);
1026
1037
  BlobStorageEntry = __decorate([
package/docs/changelog.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # @twin.org/blob-storage-service - Changelog
2
2
 
3
- ## v0.0.1-next.26
3
+ ## v0.0.1-next.28
4
4
 
5
5
  - Initial Release
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/blob-storage-service",
3
- "version": "0.0.1-next.26",
3
+ "version": "0.0.1-next.28",
4
4
  "description": "Blob storage contract implementation and REST endpoint definitions",
5
5
  "repository": {
6
6
  "type": "git",
@@ -15,7 +15,7 @@
15
15
  },
16
16
  "dependencies": {
17
17
  "@twin.org/api-models": "next",
18
- "@twin.org/blob-storage-models": "0.0.1-next.26",
18
+ "@twin.org/blob-storage-models": "0.0.1-next.28",
19
19
  "@twin.org/core": "next",
20
20
  "@twin.org/crypto": "next",
21
21
  "@twin.org/data-json-ld": "next",