@nmshd/transport 2.0.0-beta.6 → 2.0.0-beta.7

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 (57) hide show
  1. package/dist/buildInformation.js +4 -4
  2. package/dist/modules/accounts/AccountController.js +0 -2
  3. package/dist/modules/accounts/AccountController.js.map +1 -1
  4. package/dist/modules/accounts/data/Identity.d.ts +0 -18
  5. package/dist/modules/accounts/data/Identity.js +0 -33
  6. package/dist/modules/accounts/data/Identity.js.map +1 -1
  7. package/dist/modules/challenges/ChallengeController.js +0 -2
  8. package/dist/modules/challenges/ChallengeController.js.map +1 -1
  9. package/dist/modules/devices/DeviceController.js +1 -2
  10. package/dist/modules/devices/DeviceController.js.map +1 -1
  11. package/dist/modules/devices/DeviceSecretController.js +0 -1
  12. package/dist/modules/devices/DeviceSecretController.js.map +1 -1
  13. package/dist/modules/files/FileController.js +0 -9
  14. package/dist/modules/files/FileController.js.map +1 -1
  15. package/dist/modules/index.d.ts +4 -4
  16. package/dist/modules/index.js +4 -4
  17. package/dist/modules/index.js.map +1 -1
  18. package/dist/modules/messages/MessageController.js +4 -4
  19. package/dist/modules/messages/MessageController.js.map +1 -1
  20. package/dist/modules/messages/transmission/{MessagePlain.d.ts → MessageContentWrapper.d.ts} +4 -4
  21. package/dist/modules/messages/transmission/{MessagePlain.js → MessageContentWrapper.js} +12 -12
  22. package/dist/modules/messages/transmission/MessageContentWrapper.js.map +1 -0
  23. package/dist/modules/relationshipTemplates/RelationshipTemplateController.js +4 -11
  24. package/dist/modules/relationshipTemplates/RelationshipTemplateController.js.map +1 -1
  25. package/dist/modules/relationshipTemplates/backbone/BackboneGetRelationshipTemplates.d.ts +0 -1
  26. package/dist/modules/relationshipTemplates/backbone/BackbonePostRelationshipTemplates.d.ts +0 -5
  27. package/dist/modules/relationshipTemplates/local/CachedRelationshipTemplate.d.ts +0 -11
  28. package/dist/modules/relationshipTemplates/local/CachedRelationshipTemplate.js +1 -15
  29. package/dist/modules/relationshipTemplates/local/CachedRelationshipTemplate.js.map +1 -1
  30. package/dist/modules/relationshipTemplates/local/SendRelationshipTemplateParameters.d.ts +0 -11
  31. package/dist/modules/relationshipTemplates/local/SendRelationshipTemplateParameters.js +2 -17
  32. package/dist/modules/relationshipTemplates/local/SendRelationshipTemplateParameters.js.map +1 -1
  33. package/dist/modules/relationshipTemplates/transmission/{RelationshipTemplateContent.d.ts → RelationshipTemplateContentWrapper.d.ts} +3 -3
  34. package/dist/modules/relationshipTemplates/transmission/{RelationshipTemplateContent.js → RelationshipTemplateContentWrapper.js} +10 -10
  35. package/dist/modules/relationshipTemplates/transmission/RelationshipTemplateContentWrapper.js.map +1 -0
  36. package/dist/modules/relationships/RelationshipsController.js +7 -7
  37. package/dist/modules/relationships/RelationshipsController.js.map +1 -1
  38. package/dist/modules/relationships/transmission/requests/{RelationshipCreationChangeRequestContent.d.ts → RelationshipCreationChangeRequestContentWrapper.d.ts} +3 -3
  39. package/dist/modules/relationships/transmission/requests/{RelationshipCreationChangeRequestContent.js → RelationshipCreationChangeRequestContentWrapper.js} +10 -10
  40. package/dist/modules/relationships/transmission/requests/RelationshipCreationChangeRequestContentWrapper.js.map +1 -0
  41. package/dist/modules/relationships/transmission/responses/{RelationshipCreationChangeResponseContent.d.ts → RelationshipCreationChangeResponseContentWrapper.d.ts} +3 -3
  42. package/dist/modules/relationships/transmission/responses/{RelationshipCreationChangeResponseContent.js → RelationshipCreationChangeResponseContentWrapper.js} +9 -9
  43. package/dist/modules/relationships/transmission/responses/RelationshipCreationChangeResponseContentWrapper.js.map +1 -0
  44. package/dist/modules/secrets/SecretController.js +0 -1
  45. package/dist/modules/secrets/SecretController.js.map +1 -1
  46. package/dist/modules/sync/SyncController.js.map +1 -1
  47. package/dist/modules/tokens/TokenController.js +0 -1
  48. package/dist/modules/tokens/TokenController.js.map +1 -1
  49. package/lib-web/nmshd.transport.js +145 -231
  50. package/lib-web/nmshd.transport.js.map +1 -1
  51. package/lib-web/nmshd.transport.min.js +1 -1
  52. package/lib-web/nmshd.transport.min.js.map +1 -1
  53. package/package.json +1 -1
  54. package/dist/modules/messages/transmission/MessagePlain.js.map +0 -1
  55. package/dist/modules/relationshipTemplates/transmission/RelationshipTemplateContent.js.map +0 -1
  56. package/dist/modules/relationships/transmission/requests/RelationshipCreationChangeRequestContent.js.map +0 -1
  57. package/dist/modules/relationships/transmission/responses/RelationshipCreationChangeResponseContent.js.map +0 -1
@@ -15,10 +15,10 @@ exports.buildInformation = void 0;
15
15
  const ts_serval_1 = __webpack_require__(/*! @js-soft/ts-serval */ "@js-soft/ts-serval");
16
16
  const crypto_1 = __webpack_require__(/*! @nmshd/crypto */ "@nmshd/crypto");
17
17
  exports.buildInformation = {
18
- version: "2.0.0-beta.6",
19
- build: "37",
20
- date: "2022-09-28T09:23:28+00:00",
21
- commit: "3c28b2ad382a88645bc80f45ea3d3b6739218e2b",
18
+ version: "2.0.0-beta.7",
19
+ build: "38",
20
+ date: "2022-09-28T11:13:26+00:00",
21
+ commit: "44a803a33359c25924b03d92bece8556be05af18",
22
22
  dependencies: {"@js-soft/docdb-access-abstractions":"1.0.1","@js-soft/logging-abstractions":"1.0.0","@js-soft/simple-logger":"1.0.2","@js-soft/ts-utils":"2.3.0","axios":"^0.27.2","deep-equal":"^2.0.5","fast-json-patch":"^3.1.1","form-data":"^4.0.0","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","luxon":"^3.0.4","qs":"^6.11.0","reflect-metadata":"^0.1.13","ts-simple-nameof":"^1.3.1","uuid":"^9.0.0"},
23
23
  libraries: {
24
24
  crypto: crypto_1.buildInformation,
@@ -2853,7 +2853,6 @@ class AccountController {
2853
2853
  get identity() {
2854
2854
  return this._identity;
2855
2855
  }
2856
- // TODO: JSSNMSHDD-2487 (last login date)
2857
2856
  async init(deviceSharedSecret) {
2858
2857
  this.info = await this.db.getMap("AccountInfo");
2859
2858
  this.unpushedDatawalletModifications = await this.db.getCollection(DbCollectionName_1.DbCollectionName.UnpushedDatawalletModifications);
@@ -3043,7 +3042,6 @@ class AccountController {
3043
3042
  this.activeDevice.secrets.storeSecret(deviceKeypair.privateKey, DeviceSecretController_1.DeviceSecretType.DeviceSignature),
3044
3043
  this.activeDevice.secrets.storeSecret(deviceCredentials, DeviceSecretController_1.DeviceSecretType.DeviceCredentials)
3045
3044
  ]);
3046
- // TODO: JSSNMSHDD-2471 (Rollback on error)
3047
3045
  return { identity, device };
3048
3046
  }
3049
3047
  async onboardDevice(deviceSharedSecret) {
@@ -3328,7 +3326,6 @@ const ts_serval_1 = __webpack_require__(/*! @js-soft/ts-serval */ "@js-soft/ts-s
3328
3326
  const crypto_1 = __webpack_require__(/*! @nmshd/crypto */ "@nmshd/crypto");
3329
3327
  const CoreSerializable_1 = __webpack_require__(/*! ../../../core/CoreSerializable */ "./dist/core/CoreSerializable.js");
3330
3328
  const CoreAddress_1 = __webpack_require__(/*! ../../../core/types/CoreAddress */ "./dist/core/types/CoreAddress.js");
3331
- const CoreDate_1 = __webpack_require__(/*! ../../../core/types/CoreDate */ "./dist/core/types/CoreDate.js");
3332
3329
  var Realm;
3333
3330
  (function (Realm) {
3334
3331
  Realm["Dev"] = "dev";
@@ -3336,14 +3333,6 @@ var Realm;
3336
3333
  Realm["Prod"] = "id1";
3337
3334
  })(Realm = exports.Realm || (exports.Realm = {}));
3338
3335
  let Identity = class Identity extends CoreSerializable_1.CoreSerializable {
3339
- static postFrom(value) {
3340
- // TODO: Remove these default values once we're sure that nobody is accessing the deprecated properties anymore
3341
- value.name = "";
3342
- value.description = "";
3343
- value.type = "unknown";
3344
- value.createdAt = CoreDate_1.CoreDate.from("2020-01-01T00:00:00Z");
3345
- return value;
3346
- }
3347
3336
  static from(value) {
3348
3337
  return this.fromAny(value);
3349
3338
  }
@@ -3363,30 +3352,6 @@ __decorate([
3363
3352
  (0, ts_serval_1.serialize)(),
3364
3353
  __metadata("design:type", String)
3365
3354
  ], Identity.prototype, "realm", void 0);
3366
- __decorate([
3367
- (0, ts_serval_1.validate)({ nullable: true }),
3368
- (0, ts_serval_1.serialize)(),
3369
- __metadata("design:type", String)
3370
- ], Identity.prototype, "name", void 0);
3371
- __decorate([
3372
- (0, ts_serval_1.validate)({ nullable: true }),
3373
- (0, ts_serval_1.serialize)(),
3374
- __metadata("design:type", String)
3375
- ], Identity.prototype, "description", void 0);
3376
- __decorate([
3377
- (0, ts_serval_1.validate)({ nullable: true }),
3378
- (0, ts_serval_1.serialize)(),
3379
- __metadata("design:type", CoreDate_1.CoreDate
3380
- /**
3381
- * @deprecated
3382
- */
3383
- )
3384
- ], Identity.prototype, "createdAt", void 0);
3385
- __decorate([
3386
- (0, ts_serval_1.validate)({ nullable: true }),
3387
- (0, ts_serval_1.serialize)(),
3388
- __metadata("design:type", String)
3389
- ], Identity.prototype, "type", void 0);
3390
3355
  Identity = __decorate([
3391
3356
  (0, ts_serval_1.type)("Identity")
3392
3357
  ], Identity);
@@ -4332,8 +4297,6 @@ class ChallengeController extends TransportController_1.TransportController {
4332
4297
  if (backboneChallengeResponse.isError)
4333
4298
  return { isValid: false };
4334
4299
  if ((challenge.createdBy && backboneChallengeResponse.value.createdBy !== challenge.createdBy.toString()) ||
4335
- // TODO: JSSNMSHDD-2472 (Reenable check once the backbone returns with same timestamp)
4336
- // response.expiresAt !== challenge.expiresAt.toString() ||
4337
4300
  backboneChallengeResponse.value.id !== challenge.id.toString()) {
4338
4301
  return { isValid: false };
4339
4302
  }
@@ -4666,8 +4629,7 @@ class DeviceController extends core_1.TransportController {
4666
4629
  await this.secrets.storeSecret(credentials, DeviceSecretController_1.DeviceSecretType.DeviceCredentials);
4667
4630
  }
4668
4631
  catch (e) {
4669
- // TODO: JSSNMSHDD-2473 (rollback if password saving failed)
4670
- this.log.warn(`We've changed the device password on the backboen but weren't able to store it to the database. The new password is '${newPassword}'.`);
4632
+ this.log.warn(`We've changed the device password on the backbone but weren't able to store it to the database. The new password is '${newPassword}'.`);
4671
4633
  throw e;
4672
4634
  }
4673
4635
  }
@@ -4878,7 +4840,6 @@ class DeviceSecretController extends TransportController_1.TransportController {
4878
4840
  password: device.initialPassword,
4879
4841
  identity: this.parent.identity.identity
4880
4842
  });
4881
- // TODO: JSSNMSHDD-2474 (Rollback on error)
4882
4843
  return deviceSharedSecret;
4883
4844
  }
4884
4845
  async encryptDatawalletModificationPayload(event, index) {
@@ -5509,7 +5470,6 @@ class FileController extends TransportController_1.TransportController {
5509
5470
  if (ids.length < 1) {
5510
5471
  return [];
5511
5472
  }
5512
- // TODO: JSSNMSHDD-2820 (check for items that couldn't be fetched e.g. because it is expired)
5513
5473
  const resultItems = (await this.client.getFiles({ ids })).value;
5514
5474
  const promises = [];
5515
5475
  for await (const resultItem of resultItems) {
@@ -5544,7 +5504,6 @@ class FileController extends TransportController_1.TransportController {
5544
5504
  if (!(plaintextMetadata instanceof FileMetadata_1.FileMetadata)) {
5545
5505
  throw core_1.TransportErrors.files.invalidMetadata(response.id);
5546
5506
  }
5547
- // TODO: JSSNMSHDD-2486 (check signature)
5548
5507
  const cachedFile = CachedFile_1.CachedFile.fromBackbone(response, plaintextMetadata);
5549
5508
  return cachedFile;
5550
5509
  }
@@ -5662,13 +5621,6 @@ class FileController extends TransportController_1.TransportController {
5662
5621
  if (hashb64 !== file.cache.cipherHash.hash) {
5663
5622
  throw core_1.TransportErrors.files.cipherMismatch();
5664
5623
  }
5665
- /*
5666
- // TODO: JSSNMSHDD-2486 (verify owner signature)
5667
- const valid = await Crypto.verify(parcel.cipher.cipher, parcel.ownerSignature, owner.signing)
5668
- if (!valid) {
5669
- throw CoreErrors.General.SignatureNotValid("file")
5670
- }
5671
- */
5672
5624
  const cipher = crypto_1.CryptoCipher.fromBase64(buffer.toBase64URL());
5673
5625
  const decrypt = await core_1.CoreCrypto.decrypt(cipher, file.cache.cipherKey);
5674
5626
  const plaintextHashesMatch = await file.cache.plaintextHash.verify(decrypt, 2 /* CryptoHashAlgorithm.SHA512 */);
@@ -6272,9 +6224,9 @@ __exportStar(__webpack_require__(/*! ./messages/local/CachedMessage */ "./dist/m
6272
6224
  __exportStar(__webpack_require__(/*! ./messages/local/Message */ "./dist/modules/messages/local/Message.js"), exports);
6273
6225
  __exportStar(__webpack_require__(/*! ./messages/local/SendMessageParameters */ "./dist/modules/messages/local/SendMessageParameters.js"), exports);
6274
6226
  __exportStar(__webpack_require__(/*! ./messages/MessageController */ "./dist/modules/messages/MessageController.js"), exports);
6227
+ __exportStar(__webpack_require__(/*! ./messages/transmission/MessageContentWrapper */ "./dist/modules/messages/transmission/MessageContentWrapper.js"), exports);
6275
6228
  __exportStar(__webpack_require__(/*! ./messages/transmission/MessageEnvelope */ "./dist/modules/messages/transmission/MessageEnvelope.js"), exports);
6276
6229
  __exportStar(__webpack_require__(/*! ./messages/transmission/MessageEnvelopeRecipient */ "./dist/modules/messages/transmission/MessageEnvelopeRecipient.js"), exports);
6277
- __exportStar(__webpack_require__(/*! ./messages/transmission/MessagePlain */ "./dist/modules/messages/transmission/MessagePlain.js"), exports);
6278
6230
  __exportStar(__webpack_require__(/*! ./messages/transmission/MessageSignature */ "./dist/modules/messages/transmission/MessageSignature.js"), exports);
6279
6231
  __exportStar(__webpack_require__(/*! ./messages/transmission/MessageSigned */ "./dist/modules/messages/transmission/MessageSigned.js"), exports);
6280
6232
  __exportStar(__webpack_require__(/*! ./relationships/backbone/BackboneGetRelationships */ "./dist/modules/relationships/backbone/BackboneGetRelationships.js"), exports);
@@ -6293,10 +6245,10 @@ __exportStar(__webpack_require__(/*! ./relationships/transmission/changes/Relati
6293
6245
  __exportStar(__webpack_require__(/*! ./relationships/transmission/changes/RelationshipChangeType */ "./dist/modules/relationships/transmission/changes/RelationshipChangeType.js"), exports);
6294
6246
  __exportStar(__webpack_require__(/*! ./relationships/transmission/RelationshipStatus */ "./dist/modules/relationships/transmission/RelationshipStatus.js"), exports);
6295
6247
  __exportStar(__webpack_require__(/*! ./relationships/transmission/requests/RelationshipCreationChangeRequestCipher */ "./dist/modules/relationships/transmission/requests/RelationshipCreationChangeRequestCipher.js"), exports);
6296
- __exportStar(__webpack_require__(/*! ./relationships/transmission/requests/RelationshipCreationChangeRequestContent */ "./dist/modules/relationships/transmission/requests/RelationshipCreationChangeRequestContent.js"), exports);
6248
+ __exportStar(__webpack_require__(/*! ./relationships/transmission/requests/RelationshipCreationChangeRequestContentWrapper */ "./dist/modules/relationships/transmission/requests/RelationshipCreationChangeRequestContentWrapper.js"), exports);
6297
6249
  __exportStar(__webpack_require__(/*! ./relationships/transmission/requests/RelationshipCreationChangeRequestSigned */ "./dist/modules/relationships/transmission/requests/RelationshipCreationChangeRequestSigned.js"), exports);
6298
6250
  __exportStar(__webpack_require__(/*! ./relationships/transmission/responses/RelationshipCreationChangeResponseCipher */ "./dist/modules/relationships/transmission/responses/RelationshipCreationChangeResponseCipher.js"), exports);
6299
- __exportStar(__webpack_require__(/*! ./relationships/transmission/responses/RelationshipCreationChangeResponseContent */ "./dist/modules/relationships/transmission/responses/RelationshipCreationChangeResponseContent.js"), exports);
6251
+ __exportStar(__webpack_require__(/*! ./relationships/transmission/responses/RelationshipCreationChangeResponseContentWrapper */ "./dist/modules/relationships/transmission/responses/RelationshipCreationChangeResponseContentWrapper.js"), exports);
6300
6252
  __exportStar(__webpack_require__(/*! ./relationships/transmission/responses/RelationshipCreationChangeResponseSigned */ "./dist/modules/relationships/transmission/responses/RelationshipCreationChangeResponseSigned.js"), exports);
6301
6253
  __exportStar(__webpack_require__(/*! ./relationshipTemplates/backbone/BackboneGetRelationshipTemplates */ "./dist/modules/relationshipTemplates/backbone/BackboneGetRelationshipTemplates.js"), exports);
6302
6254
  __exportStar(__webpack_require__(/*! ./relationshipTemplates/backbone/BackbonePostRelationshipTemplates */ "./dist/modules/relationshipTemplates/backbone/BackbonePostRelationshipTemplates.js"), exports);
@@ -6305,7 +6257,7 @@ __exportStar(__webpack_require__(/*! ./relationshipTemplates/local/CachedRelatio
6305
6257
  __exportStar(__webpack_require__(/*! ./relationshipTemplates/local/RelationshipTemplate */ "./dist/modules/relationshipTemplates/local/RelationshipTemplate.js"), exports);
6306
6258
  __exportStar(__webpack_require__(/*! ./relationshipTemplates/local/SendRelationshipTemplateParameters */ "./dist/modules/relationshipTemplates/local/SendRelationshipTemplateParameters.js"), exports);
6307
6259
  __exportStar(__webpack_require__(/*! ./relationshipTemplates/RelationshipTemplateController */ "./dist/modules/relationshipTemplates/RelationshipTemplateController.js"), exports);
6308
- __exportStar(__webpack_require__(/*! ./relationshipTemplates/transmission/RelationshipTemplateContent */ "./dist/modules/relationshipTemplates/transmission/RelationshipTemplateContent.js"), exports);
6260
+ __exportStar(__webpack_require__(/*! ./relationshipTemplates/transmission/RelationshipTemplateContentWrapper */ "./dist/modules/relationshipTemplates/transmission/RelationshipTemplateContentWrapper.js"), exports);
6309
6261
  __exportStar(__webpack_require__(/*! ./relationshipTemplates/transmission/RelationshipTemplatePublicKey */ "./dist/modules/relationshipTemplates/transmission/RelationshipTemplatePublicKey.js"), exports);
6310
6262
  __exportStar(__webpack_require__(/*! ./relationshipTemplates/transmission/RelationshipTemplateReference */ "./dist/modules/relationshipTemplates/transmission/RelationshipTemplateReference.js"), exports);
6311
6263
  __exportStar(__webpack_require__(/*! ./relationshipTemplates/transmission/RelationshipTemplateSigned */ "./dist/modules/relationshipTemplates/transmission/RelationshipTemplateSigned.js"), exports);
@@ -6377,9 +6329,9 @@ const MessageClient_1 = __webpack_require__(/*! ./backbone/MessageClient */ "./d
6377
6329
  const CachedMessage_1 = __webpack_require__(/*! ./local/CachedMessage */ "./dist/modules/messages/local/CachedMessage.js");
6378
6330
  const Message_1 = __webpack_require__(/*! ./local/Message */ "./dist/modules/messages/local/Message.js");
6379
6331
  const SendMessageParameters_1 = __webpack_require__(/*! ./local/SendMessageParameters */ "./dist/modules/messages/local/SendMessageParameters.js");
6332
+ const MessageContentWrapper_1 = __webpack_require__(/*! ./transmission/MessageContentWrapper */ "./dist/modules/messages/transmission/MessageContentWrapper.js");
6380
6333
  const MessageEnvelope_1 = __webpack_require__(/*! ./transmission/MessageEnvelope */ "./dist/modules/messages/transmission/MessageEnvelope.js");
6381
6334
  const MessageEnvelopeRecipient_1 = __webpack_require__(/*! ./transmission/MessageEnvelopeRecipient */ "./dist/modules/messages/transmission/MessageEnvelopeRecipient.js");
6382
- const MessagePlain_1 = __webpack_require__(/*! ./transmission/MessagePlain */ "./dist/modules/messages/transmission/MessagePlain.js");
6383
6335
  const MessageSignature_1 = __webpack_require__(/*! ./transmission/MessageSignature */ "./dist/modules/messages/transmission/MessageSignature.js");
6384
6336
  const MessageSigned_1 = __webpack_require__(/*! ./transmission/MessageSigned */ "./dist/modules/messages/transmission/MessageSigned.js");
6385
6337
  class MessageController extends TransportController_1.TransportController {
@@ -6543,7 +6495,7 @@ class MessageController extends TransportController_1.TransportController {
6543
6495
  fileReferences.push(file.toFileReference());
6544
6496
  publicAttachmentArray.push(file.id);
6545
6497
  }
6546
- const plaintext = MessagePlain_1.MessagePlain.from({
6498
+ const plaintext = MessageContentWrapper_1.MessageContentWrapper.from({
6547
6499
  content: parameters.content,
6548
6500
  recipients: addressArray,
6549
6501
  createdAt: core_1.CoreDate.utc(),
@@ -6613,7 +6565,7 @@ class MessageController extends TransportController_1.TransportController {
6613
6565
  this.log.trace(`Decrypting own envelope with id ${envelope.id.toString()}...`);
6614
6566
  const plaintextMessageBuffer = await core_1.CoreCrypto.decrypt(envelope.cipher, secretKey);
6615
6567
  const signedMessage = MessageSigned_1.MessageSigned.deserialize(plaintextMessageBuffer.toUtf8());
6616
- const messagePlain = MessagePlain_1.MessagePlain.from(JSON.parse(signedMessage.message));
6568
+ const messagePlain = MessageContentWrapper_1.MessageContentWrapper.from(JSON.parse(signedMessage.message));
6617
6569
  return messagePlain;
6618
6570
  }
6619
6571
  async decryptPeerEnvelope(envelope, relationship) {
@@ -6630,7 +6582,7 @@ class MessageController extends TransportController_1.TransportController {
6630
6582
  if (!signature) {
6631
6583
  throw core_1.TransportErrors.messages.signatureListMismatch(envelope.id.toString());
6632
6584
  }
6633
- const messagePlain = MessagePlain_1.MessagePlain.from(JSON.parse(signedMessage.message));
6585
+ const messagePlain = MessageContentWrapper_1.MessageContentWrapper.from(JSON.parse(signedMessage.message));
6634
6586
  if (signedMessage.signatures.length !== messagePlain.recipients.length) {
6635
6587
  this.log.debug(`Number of signatures does not match number of recipients from envelope ${envelope.id}.`);
6636
6588
  }
@@ -7023,6 +6975,83 @@ exports.SendMessageParameters = SendMessageParameters;
7023
6975
 
7024
6976
  /***/ }),
7025
6977
 
6978
+ /***/ "./dist/modules/messages/transmission/MessageContentWrapper.js":
6979
+ /*!*********************************************************************!*\
6980
+ !*** ./dist/modules/messages/transmission/MessageContentWrapper.js ***!
6981
+ \*********************************************************************/
6982
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
6983
+
6984
+ "use strict";
6985
+
6986
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
6987
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
6988
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
6989
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6990
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6991
+ };
6992
+ var __metadata = (this && this.__metadata) || function (k, v) {
6993
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
6994
+ };
6995
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
6996
+ exports.MessageContentWrapper = void 0;
6997
+ const ts_serval_1 = __webpack_require__(/*! @js-soft/ts-serval */ "@js-soft/ts-serval");
6998
+ const core_1 = __webpack_require__(/*! ../../../core */ "./dist/core/index.js");
6999
+ const CoreAddress_1 = __webpack_require__(/*! ../../../core/types/CoreAddress */ "./dist/core/types/CoreAddress.js");
7000
+ const CoreDate_1 = __webpack_require__(/*! ../../../core/types/CoreDate */ "./dist/core/types/CoreDate.js");
7001
+ const FileReference_1 = __webpack_require__(/*! ../../files/transmission/FileReference */ "./dist/modules/files/transmission/FileReference.js");
7002
+ /**
7003
+ * MessageContentWrapper is a container for the actual message as [[IMessage]], its creationDate and
7004
+ * the list of recipients as [[IAddress]]. This container instance is then digitally signed
7005
+ * by the sender via an [[MessageSigned]] object.
7006
+ *
7007
+ * Insofar, the sender digitally signs the date of creation of this message (which could act as a
7008
+ * legal proof). Additionally, all recipients can - and must - check if they are addressed by
7009
+ * the sender. If a recipient is not in the signed list of recipients, the message needs to be
7010
+ * ignored (as the whole message could have been forwarded by bad party to a wrong recipient).
7011
+ */
7012
+ let MessageContentWrapper = class MessageContentWrapper extends core_1.CoreSerializable {
7013
+ constructor() {
7014
+ super(...arguments);
7015
+ this.attachments = [];
7016
+ }
7017
+ static preFrom(value) {
7018
+ if (typeof value.attachments === "undefined") {
7019
+ value.attachments = [];
7020
+ }
7021
+ return value;
7022
+ }
7023
+ static from(value) {
7024
+ return this.fromAny(value);
7025
+ }
7026
+ };
7027
+ __decorate([
7028
+ (0, ts_serval_1.validate)(),
7029
+ (0, ts_serval_1.serialize)({ type: FileReference_1.FileReference }),
7030
+ __metadata("design:type", Array)
7031
+ ], MessageContentWrapper.prototype, "attachments", void 0);
7032
+ __decorate([
7033
+ (0, ts_serval_1.validate)(),
7034
+ (0, ts_serval_1.serialize)(),
7035
+ __metadata("design:type", ts_serval_1.Serializable)
7036
+ ], MessageContentWrapper.prototype, "content", void 0);
7037
+ __decorate([
7038
+ (0, ts_serval_1.validate)(),
7039
+ (0, ts_serval_1.serialize)(),
7040
+ __metadata("design:type", CoreDate_1.CoreDate)
7041
+ ], MessageContentWrapper.prototype, "createdAt", void 0);
7042
+ __decorate([
7043
+ (0, ts_serval_1.validate)(),
7044
+ (0, ts_serval_1.serialize)({ type: CoreAddress_1.CoreAddress }),
7045
+ __metadata("design:type", Array)
7046
+ ], MessageContentWrapper.prototype, "recipients", void 0);
7047
+ MessageContentWrapper = __decorate([
7048
+ (0, ts_serval_1.type)("MessageContentWrapper")
7049
+ ], MessageContentWrapper);
7050
+ exports.MessageContentWrapper = MessageContentWrapper;
7051
+ //# sourceMappingURL=MessageContentWrapper.js.map
7052
+
7053
+ /***/ }),
7054
+
7026
7055
  /***/ "./dist/modules/messages/transmission/MessageEnvelope.js":
7027
7056
  /*!***************************************************************!*\
7028
7057
  !*** ./dist/modules/messages/transmission/MessageEnvelope.js ***!
@@ -7169,83 +7198,6 @@ exports.MessageEnvelopeRecipient = MessageEnvelopeRecipient;
7169
7198
 
7170
7199
  /***/ }),
7171
7200
 
7172
- /***/ "./dist/modules/messages/transmission/MessagePlain.js":
7173
- /*!************************************************************!*\
7174
- !*** ./dist/modules/messages/transmission/MessagePlain.js ***!
7175
- \************************************************************/
7176
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
7177
-
7178
- "use strict";
7179
-
7180
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
7181
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
7182
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
7183
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
7184
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7185
- };
7186
- var __metadata = (this && this.__metadata) || function (k, v) {
7187
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
7188
- };
7189
- Object.defineProperty(exports, "__esModule", ({ value: true }));
7190
- exports.MessagePlain = void 0;
7191
- const ts_serval_1 = __webpack_require__(/*! @js-soft/ts-serval */ "@js-soft/ts-serval");
7192
- const core_1 = __webpack_require__(/*! ../../../core */ "./dist/core/index.js");
7193
- const CoreAddress_1 = __webpack_require__(/*! ../../../core/types/CoreAddress */ "./dist/core/types/CoreAddress.js");
7194
- const CoreDate_1 = __webpack_require__(/*! ../../../core/types/CoreDate */ "./dist/core/types/CoreDate.js");
7195
- const FileReference_1 = __webpack_require__(/*! ../../files/transmission/FileReference */ "./dist/modules/files/transmission/FileReference.js");
7196
- /**
7197
- * MessagePlain is a container for the actual message as [[IMessage]], its creationDate and
7198
- * the list of recipients as [[IAddress]]. This container instance is then digitally signed
7199
- * by the sender via an [[MessageSigned]] object.
7200
- *
7201
- * Insofar, the sender digitally signs the date of creation of this message (which could act as a
7202
- * legal proof). Additionally, all recipients can - and must - check if they are addressed by
7203
- * the sender. If a recipient is not in the signed list of recipients, the message needs to be
7204
- * ignored (as the whole message could have been forwarded by bad party to a wrong recipient).
7205
- */
7206
- let MessagePlain = class MessagePlain extends core_1.CoreSerializable {
7207
- constructor() {
7208
- super(...arguments);
7209
- this.attachments = [];
7210
- }
7211
- static preFrom(value) {
7212
- if (typeof value.attachments === "undefined") {
7213
- value.attachments = [];
7214
- }
7215
- return value;
7216
- }
7217
- static from(value) {
7218
- return this.fromAny(value);
7219
- }
7220
- };
7221
- __decorate([
7222
- (0, ts_serval_1.validate)(),
7223
- (0, ts_serval_1.serialize)({ type: FileReference_1.FileReference }),
7224
- __metadata("design:type", Array)
7225
- ], MessagePlain.prototype, "attachments", void 0);
7226
- __decorate([
7227
- (0, ts_serval_1.validate)(),
7228
- (0, ts_serval_1.serialize)(),
7229
- __metadata("design:type", ts_serval_1.Serializable)
7230
- ], MessagePlain.prototype, "content", void 0);
7231
- __decorate([
7232
- (0, ts_serval_1.validate)(),
7233
- (0, ts_serval_1.serialize)(),
7234
- __metadata("design:type", CoreDate_1.CoreDate)
7235
- ], MessagePlain.prototype, "createdAt", void 0);
7236
- __decorate([
7237
- (0, ts_serval_1.validate)(),
7238
- (0, ts_serval_1.serialize)({ type: CoreAddress_1.CoreAddress }),
7239
- __metadata("design:type", Array)
7240
- ], MessagePlain.prototype, "recipients", void 0);
7241
- MessagePlain = __decorate([
7242
- (0, ts_serval_1.type)("MessagePlain")
7243
- ], MessagePlain);
7244
- exports.MessagePlain = MessagePlain;
7245
- //# sourceMappingURL=MessagePlain.js.map
7246
-
7247
- /***/ }),
7248
-
7249
7201
  /***/ "./dist/modules/messages/transmission/MessageSignature.js":
7250
7202
  /*!****************************************************************!*\
7251
7203
  !*** ./dist/modules/messages/transmission/MessageSignature.js ***!
@@ -7368,7 +7320,7 @@ const RelationshipTemplateClient_1 = __webpack_require__(/*! ./backbone/Relation
7368
7320
  const CachedRelationshipTemplate_1 = __webpack_require__(/*! ./local/CachedRelationshipTemplate */ "./dist/modules/relationshipTemplates/local/CachedRelationshipTemplate.js");
7369
7321
  const RelationshipTemplate_1 = __webpack_require__(/*! ./local/RelationshipTemplate */ "./dist/modules/relationshipTemplates/local/RelationshipTemplate.js");
7370
7322
  const SendRelationshipTemplateParameters_1 = __webpack_require__(/*! ./local/SendRelationshipTemplateParameters */ "./dist/modules/relationshipTemplates/local/SendRelationshipTemplateParameters.js");
7371
- const RelationshipTemplateContent_1 = __webpack_require__(/*! ./transmission/RelationshipTemplateContent */ "./dist/modules/relationshipTemplates/transmission/RelationshipTemplateContent.js");
7323
+ const RelationshipTemplateContentWrapper_1 = __webpack_require__(/*! ./transmission/RelationshipTemplateContentWrapper */ "./dist/modules/relationshipTemplates/transmission/RelationshipTemplateContentWrapper.js");
7372
7324
  const RelationshipTemplateReference_1 = __webpack_require__(/*! ./transmission/RelationshipTemplateReference */ "./dist/modules/relationshipTemplates/transmission/RelationshipTemplateReference.js");
7373
7325
  const RelationshipTemplateSigned_1 = __webpack_require__(/*! ./transmission/RelationshipTemplateSigned */ "./dist/modules/relationshipTemplates/transmission/RelationshipTemplateSigned.js");
7374
7326
  class RelationshipTemplateController extends TransportController_1.TransportController {
@@ -7384,11 +7336,8 @@ class RelationshipTemplateController extends TransportController_1.TransportCont
7384
7336
  }
7385
7337
  async sendRelationshipTemplate(parameters) {
7386
7338
  parameters = SendRelationshipTemplateParameters_1.SendRelationshipTemplateParameters.from(parameters);
7387
- if (parameters.maxNumberOfRelationships) {
7388
- this.log.warn("`maxNumberOfRelationships` is deprecated and will be removed in the future. Please use `maxNumberOfAllocations` instead.");
7389
- }
7390
7339
  const templateKey = await this.secrets.createTemplateKey();
7391
- const templateContent = RelationshipTemplateContent_1.RelationshipTemplateContent.from({
7340
+ const templateContent = RelationshipTemplateContentWrapper_1.RelationshipTemplateContentWrapper.from({
7392
7341
  content: parameters.content,
7393
7342
  identity: this.parent.identity.identity,
7394
7343
  templateKey: templateKey
@@ -7406,7 +7355,6 @@ class RelationshipTemplateController extends TransportController_1.TransportCont
7406
7355
  const backboneResponse = (await this.client.createRelationshipTemplate({
7407
7356
  expiresAt: parameters.expiresAt.toString(),
7408
7357
  maxNumberOfAllocations: parameters.maxNumberOfAllocations,
7409
- maxNumberOfRelationships: parameters.maxNumberOfRelationships,
7410
7358
  content: cipher.toBase64()
7411
7359
  })).value;
7412
7360
  const templateCache = CachedRelationshipTemplate_1.CachedRelationshipTemplate.from({
@@ -7417,7 +7365,6 @@ class RelationshipTemplateController extends TransportController_1.TransportCont
7417
7365
  expiresAt: parameters.expiresAt,
7418
7366
  identity: this.parent.identity.identity,
7419
7367
  maxNumberOfAllocations: parameters.maxNumberOfAllocations,
7420
- maxNumberOfRelationships: parameters.maxNumberOfRelationships,
7421
7368
  templateKey: templateKey
7422
7369
  });
7423
7370
  const template = RelationshipTemplate_1.RelationshipTemplate.from({
@@ -7442,7 +7389,6 @@ class RelationshipTemplateController extends TransportController_1.TransportCont
7442
7389
  if (ids.length < 1) {
7443
7390
  return [];
7444
7391
  }
7445
- // TODO: JSSNMSHDD-2820 (check for items that couldn't be fetched e.g. because it is expired)
7446
7392
  const resultItems = (await this.client.getRelationshipTemplates({ ids })).value;
7447
7393
  const promises = [];
7448
7394
  for await (const resultItem of resultItems) {
@@ -7481,11 +7427,11 @@ class RelationshipTemplateController extends TransportController_1.TransportCont
7481
7427
  template.isOwn = this.parent.identity.isMe(cachedTemplate.createdBy);
7482
7428
  }
7483
7429
  async decryptRelationshipTemplate(response, secretKey) {
7484
- var _a, _b;
7430
+ var _a;
7485
7431
  const cipher = crypto_1.CryptoCipher.fromBase64(response.content);
7486
7432
  const signedTemplateBuffer = await this.secrets.decryptTemplate(cipher, secretKey);
7487
7433
  const signedTemplate = RelationshipTemplateSigned_1.RelationshipTemplateSigned.deserialize(signedTemplateBuffer.toUtf8());
7488
- const templateContent = RelationshipTemplateContent_1.RelationshipTemplateContent.deserialize(signedTemplate.serializedTemplate);
7434
+ const templateContent = RelationshipTemplateContentWrapper_1.RelationshipTemplateContentWrapper.deserialize(signedTemplate.serializedTemplate);
7489
7435
  const templateSignatureValid = await this.secrets.verifyTemplate(crypto_1.CoreBuffer.fromUtf8(signedTemplate.serializedTemplate), signedTemplate.deviceSignature, templateContent.identity.publicKey);
7490
7436
  if (!templateSignatureValid) {
7491
7437
  throw core_1.TransportErrors.general.signatureNotValid("template");
@@ -7498,7 +7444,6 @@ class RelationshipTemplateController extends TransportController_1.TransportCont
7498
7444
  expiresAt: response.expiresAt ? core_1.CoreDate.from(response.expiresAt) : undefined,
7499
7445
  identity: templateContent.identity,
7500
7446
  maxNumberOfAllocations: (_a = response.maxNumberOfAllocations) !== null && _a !== void 0 ? _a : undefined,
7501
- maxNumberOfRelationships: (_b = response.maxNumberOfRelationships) !== null && _b !== void 0 ? _b : undefined,
7502
7447
  templateKey: templateContent.templateKey
7503
7448
  });
7504
7449
  return cachedTemplate;
@@ -7643,7 +7588,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
7643
7588
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
7644
7589
  };
7645
7590
  Object.defineProperty(exports, "__esModule", ({ value: true }));
7646
- exports.validateMaxNumberOfAllocations = exports.validateMaxNumberOfRelationships = exports.CachedRelationshipTemplate = void 0;
7591
+ exports.validateMaxNumberOfAllocations = exports.CachedRelationshipTemplate = void 0;
7647
7592
  const ts_serval_1 = __webpack_require__(/*! @js-soft/ts-serval */ "@js-soft/ts-serval");
7648
7593
  const core_1 = __webpack_require__(/*! ../../../core */ "./dist/core/index.js");
7649
7594
  const CoreId_1 = __webpack_require__(/*! ../../../core/types/CoreId */ "./dist/core/types/CoreId.js");
@@ -7694,24 +7639,10 @@ __decorate([
7694
7639
  (0, ts_serval_1.serialize)(),
7695
7640
  __metadata("design:type", Number)
7696
7641
  ], CachedRelationshipTemplate.prototype, "maxNumberOfAllocations", void 0);
7697
- __decorate([
7698
- (0, ts_serval_1.validate)({ nullable: true, customValidator: validateMaxNumberOfRelationships }),
7699
- (0, ts_serval_1.serialize)(),
7700
- __metadata("design:type", Number)
7701
- ], CachedRelationshipTemplate.prototype, "maxNumberOfRelationships", void 0);
7702
7642
  CachedRelationshipTemplate = __decorate([
7703
7643
  (0, ts_serval_1.type)("CachedRelationshipTemplate")
7704
7644
  ], CachedRelationshipTemplate);
7705
7645
  exports.CachedRelationshipTemplate = CachedRelationshipTemplate;
7706
- function validateMaxNumberOfRelationships(value) {
7707
- if (value === undefined)
7708
- return;
7709
- if (value <= 0) {
7710
- return "maxNumberOfRelationships must be greater than 0";
7711
- }
7712
- return;
7713
- }
7714
- exports.validateMaxNumberOfRelationships = validateMaxNumberOfRelationships;
7715
7646
  function validateMaxNumberOfAllocations(value) {
7716
7647
  if (value === undefined)
7717
7648
  return;
@@ -7841,22 +7772,12 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7841
7772
  var __metadata = (this && this.__metadata) || function (k, v) {
7842
7773
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
7843
7774
  };
7844
- var SendRelationshipTemplateParameters_1;
7845
7775
  Object.defineProperty(exports, "__esModule", ({ value: true }));
7846
7776
  exports.SendRelationshipTemplateParameters = void 0;
7847
7777
  const ts_serval_1 = __webpack_require__(/*! @js-soft/ts-serval */ "@js-soft/ts-serval");
7848
- const ts_simple_nameof_1 = __webpack_require__(/*! ts-simple-nameof */ "./node_modules/ts-simple-nameof/index.js");
7849
7778
  const core_1 = __webpack_require__(/*! ../../../core */ "./dist/core/index.js");
7850
7779
  const CachedRelationshipTemplate_1 = __webpack_require__(/*! ./CachedRelationshipTemplate */ "./dist/modules/relationshipTemplates/local/CachedRelationshipTemplate.js");
7851
- let SendRelationshipTemplateParameters = SendRelationshipTemplateParameters_1 = class SendRelationshipTemplateParameters extends core_1.CoreSerializable {
7852
- static postFrom(value) {
7853
- if (!(value instanceof SendRelationshipTemplateParameters_1))
7854
- throw new Error("this should never happen");
7855
- if (value.maxNumberOfAllocations && value.maxNumberOfRelationships) {
7856
- throw new ts_serval_1.ValidationError(SendRelationshipTemplateParameters_1.name, (0, ts_simple_nameof_1.nameof)((x) => x.maxNumberOfAllocations), `You cannot specify both ${(0, ts_simple_nameof_1.nameof)((x) => x.maxNumberOfAllocations)} and ${(0, ts_simple_nameof_1.nameof)((x) => x.maxNumberOfRelationships)}.`);
7857
- }
7858
- return value;
7859
- }
7780
+ let SendRelationshipTemplateParameters = class SendRelationshipTemplateParameters extends core_1.CoreSerializable {
7860
7781
  static from(value) {
7861
7782
  return this.fromAny(value);
7862
7783
  }
@@ -7876,12 +7797,7 @@ __decorate([
7876
7797
  (0, ts_serval_1.serialize)(),
7877
7798
  __metadata("design:type", Number)
7878
7799
  ], SendRelationshipTemplateParameters.prototype, "maxNumberOfAllocations", void 0);
7879
- __decorate([
7880
- (0, ts_serval_1.validate)({ nullable: true, customValidator: CachedRelationshipTemplate_1.validateMaxNumberOfRelationships }),
7881
- (0, ts_serval_1.serialize)(),
7882
- __metadata("design:type", Number)
7883
- ], SendRelationshipTemplateParameters.prototype, "maxNumberOfRelationships", void 0);
7884
- SendRelationshipTemplateParameters = SendRelationshipTemplateParameters_1 = __decorate([
7800
+ SendRelationshipTemplateParameters = __decorate([
7885
7801
  (0, ts_serval_1.type)("SendRelationshipTemplateParameters")
7886
7802
  ], SendRelationshipTemplateParameters);
7887
7803
  exports.SendRelationshipTemplateParameters = SendRelationshipTemplateParameters;
@@ -7889,10 +7805,10 @@ exports.SendRelationshipTemplateParameters = SendRelationshipTemplateParameters;
7889
7805
 
7890
7806
  /***/ }),
7891
7807
 
7892
- /***/ "./dist/modules/relationshipTemplates/transmission/RelationshipTemplateContent.js":
7893
- /*!****************************************************************************************!*\
7894
- !*** ./dist/modules/relationshipTemplates/transmission/RelationshipTemplateContent.js ***!
7895
- \****************************************************************************************/
7808
+ /***/ "./dist/modules/relationshipTemplates/transmission/RelationshipTemplateContentWrapper.js":
7809
+ /*!***********************************************************************************************!*\
7810
+ !*** ./dist/modules/relationshipTemplates/transmission/RelationshipTemplateContentWrapper.js ***!
7811
+ \***********************************************************************************************/
7896
7812
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
7897
7813
 
7898
7814
  "use strict";
@@ -7907,12 +7823,12 @@ var __metadata = (this && this.__metadata) || function (k, v) {
7907
7823
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
7908
7824
  };
7909
7825
  Object.defineProperty(exports, "__esModule", ({ value: true }));
7910
- exports.RelationshipTemplateContent = void 0;
7826
+ exports.RelationshipTemplateContentWrapper = void 0;
7911
7827
  const ts_serval_1 = __webpack_require__(/*! @js-soft/ts-serval */ "@js-soft/ts-serval");
7912
7828
  const core_1 = __webpack_require__(/*! ../../../core */ "./dist/core/index.js");
7913
7829
  const Identity_1 = __webpack_require__(/*! ../../accounts/data/Identity */ "./dist/modules/accounts/data/Identity.js");
7914
7830
  const RelationshipTemplatePublicKey_1 = __webpack_require__(/*! ./RelationshipTemplatePublicKey */ "./dist/modules/relationshipTemplates/transmission/RelationshipTemplatePublicKey.js");
7915
- let RelationshipTemplateContent = class RelationshipTemplateContent extends core_1.CoreSerializable {
7831
+ let RelationshipTemplateContentWrapper = class RelationshipTemplateContentWrapper extends core_1.CoreSerializable {
7916
7832
  static from(value) {
7917
7833
  return this.fromAny(value);
7918
7834
  }
@@ -7921,22 +7837,22 @@ __decorate([
7921
7837
  (0, ts_serval_1.validate)(),
7922
7838
  (0, ts_serval_1.serialize)(),
7923
7839
  __metadata("design:type", Identity_1.Identity)
7924
- ], RelationshipTemplateContent.prototype, "identity", void 0);
7840
+ ], RelationshipTemplateContentWrapper.prototype, "identity", void 0);
7925
7841
  __decorate([
7926
7842
  (0, ts_serval_1.validate)(),
7927
7843
  (0, ts_serval_1.serialize)(),
7928
7844
  __metadata("design:type", RelationshipTemplatePublicKey_1.RelationshipTemplatePublicKey)
7929
- ], RelationshipTemplateContent.prototype, "templateKey", void 0);
7845
+ ], RelationshipTemplateContentWrapper.prototype, "templateKey", void 0);
7930
7846
  __decorate([
7931
7847
  (0, ts_serval_1.validate)(),
7932
7848
  (0, ts_serval_1.serialize)(),
7933
7849
  __metadata("design:type", ts_serval_1.Serializable)
7934
- ], RelationshipTemplateContent.prototype, "content", void 0);
7935
- RelationshipTemplateContent = __decorate([
7936
- (0, ts_serval_1.type)("RelationshipTemplateContent")
7937
- ], RelationshipTemplateContent);
7938
- exports.RelationshipTemplateContent = RelationshipTemplateContent;
7939
- //# sourceMappingURL=RelationshipTemplateContent.js.map
7850
+ ], RelationshipTemplateContentWrapper.prototype, "content", void 0);
7851
+ RelationshipTemplateContentWrapper = __decorate([
7852
+ (0, ts_serval_1.type)("RelationshipTemplateContentWrapper")
7853
+ ], RelationshipTemplateContentWrapper);
7854
+ exports.RelationshipTemplateContentWrapper = RelationshipTemplateContentWrapper;
7855
+ //# sourceMappingURL=RelationshipTemplateContentWrapper.js.map
7940
7856
 
7941
7857
  /***/ }),
7942
7858
 
@@ -8367,10 +8283,10 @@ const RelationshipChangeStatus_1 = __webpack_require__(/*! ./transmission/change
8367
8283
  const RelationshipChangeType_1 = __webpack_require__(/*! ./transmission/changes/RelationshipChangeType */ "./dist/modules/relationships/transmission/changes/RelationshipChangeType.js");
8368
8284
  const RelationshipStatus_1 = __webpack_require__(/*! ./transmission/RelationshipStatus */ "./dist/modules/relationships/transmission/RelationshipStatus.js");
8369
8285
  const RelationshipCreationChangeRequestCipher_1 = __webpack_require__(/*! ./transmission/requests/RelationshipCreationChangeRequestCipher */ "./dist/modules/relationships/transmission/requests/RelationshipCreationChangeRequestCipher.js");
8370
- const RelationshipCreationChangeRequestContent_1 = __webpack_require__(/*! ./transmission/requests/RelationshipCreationChangeRequestContent */ "./dist/modules/relationships/transmission/requests/RelationshipCreationChangeRequestContent.js");
8286
+ const RelationshipCreationChangeRequestContentWrapper_1 = __webpack_require__(/*! ./transmission/requests/RelationshipCreationChangeRequestContentWrapper */ "./dist/modules/relationships/transmission/requests/RelationshipCreationChangeRequestContentWrapper.js");
8371
8287
  const RelationshipCreationChangeRequestSigned_1 = __webpack_require__(/*! ./transmission/requests/RelationshipCreationChangeRequestSigned */ "./dist/modules/relationships/transmission/requests/RelationshipCreationChangeRequestSigned.js");
8372
8288
  const RelationshipCreationChangeResponseCipher_1 = __webpack_require__(/*! ./transmission/responses/RelationshipCreationChangeResponseCipher */ "./dist/modules/relationships/transmission/responses/RelationshipCreationChangeResponseCipher.js");
8373
- const RelationshipCreationChangeResponseContent_1 = __webpack_require__(/*! ./transmission/responses/RelationshipCreationChangeResponseContent */ "./dist/modules/relationships/transmission/responses/RelationshipCreationChangeResponseContent.js");
8289
+ const RelationshipCreationChangeResponseContentWrapper_1 = __webpack_require__(/*! ./transmission/responses/RelationshipCreationChangeResponseContentWrapper */ "./dist/modules/relationships/transmission/responses/RelationshipCreationChangeResponseContentWrapper.js");
8374
8290
  const RelationshipCreationChangeResponseSigned_1 = __webpack_require__(/*! ./transmission/responses/RelationshipCreationChangeResponseSigned */ "./dist/modules/relationships/transmission/responses/RelationshipCreationChangeResponseSigned.js");
8375
8291
  class RelationshipsController extends core_1.TransportController {
8376
8292
  constructor(parent, secrets) {
@@ -8527,7 +8443,7 @@ class RelationshipsController extends core_1.TransportController {
8527
8443
  throw TransportErrors_1.TransportErrors.general.cacheEmpty(RelationshipTemplate_1.RelationshipTemplate, template.id.toString());
8528
8444
  }
8529
8445
  const requestPublic = await this.secrets.createRequestorSecrets(template.cache, relationshipSecretId);
8530
- const requestContent = RelationshipCreationChangeRequestContent_1.RelationshipCreationChangeRequestContent.from({
8446
+ const requestContent = RelationshipCreationChangeRequestContentWrapper_1.RelationshipCreationChangeRequestContentWrapper.from({
8531
8447
  content: content,
8532
8448
  identity: this.parent.identity.identity,
8533
8449
  templateId: template.id
@@ -8615,7 +8531,7 @@ class RelationshipsController extends core_1.TransportController {
8615
8531
  if (!relationshipSignatureValid) {
8616
8532
  throw TransportErrors_1.TransportErrors.general.signatureNotValid("relationshipRequest");
8617
8533
  }
8618
- const requestContent = RelationshipCreationChangeRequestContent_1.RelationshipCreationChangeRequestContent.deserialize(signedRequest.serializedRequest);
8534
+ const requestContent = RelationshipCreationChangeRequestContentWrapper_1.RelationshipCreationChangeRequestContentWrapper.deserialize(signedRequest.serializedRequest);
8619
8535
  if (!requestContent.templateId.equals(templateId)) {
8620
8536
  throw new Error("The relationship request contains a wrong template id.");
8621
8537
  }
@@ -8654,7 +8570,7 @@ class RelationshipsController extends core_1.TransportController {
8654
8570
  if (!relationshipSignatureValid) {
8655
8571
  throw TransportErrors_1.TransportErrors.general.signatureNotValid("relationshipResponse");
8656
8572
  }
8657
- const responseContent = RelationshipCreationChangeResponseContent_1.RelationshipCreationChangeResponseContent.deserialize(signedResponse.serializedResponse);
8573
+ const responseContent = RelationshipCreationChangeResponseContentWrapper_1.RelationshipCreationChangeResponseContentWrapper.deserialize(signedResponse.serializedResponse);
8658
8574
  if (!responseContent.relationshipId.equals(change.relationshipId)) {
8659
8575
  throw new Error("The relationship response contains a wrong relationship id.");
8660
8576
  }
@@ -8771,7 +8687,7 @@ class RelationshipsController extends core_1.TransportController {
8771
8687
  return relationship;
8772
8688
  }
8773
8689
  async encryptRevokeContent(relationship, content) {
8774
- const responseContent = RelationshipCreationChangeResponseContent_1.RelationshipCreationChangeResponseContent.from({
8690
+ const responseContent = RelationshipCreationChangeResponseContentWrapper_1.RelationshipCreationChangeResponseContentWrapper.from({
8775
8691
  relationshipId: relationship.id,
8776
8692
  content: content
8777
8693
  });
@@ -8794,7 +8710,7 @@ class RelationshipsController extends core_1.TransportController {
8794
8710
  }
8795
8711
  async encryptAcceptRejectContent(relationship, content) {
8796
8712
  const publicResponseCrypto = await this.secrets.getPublicResponse(relationship.relationshipSecretId);
8797
- const responseContent = RelationshipCreationChangeResponseContent_1.RelationshipCreationChangeResponseContent.from({
8713
+ const responseContent = RelationshipCreationChangeResponseContentWrapper_1.RelationshipCreationChangeResponseContentWrapper.from({
8798
8714
  relationshipId: relationship.id,
8799
8715
  content: content
8800
8716
  });
@@ -9549,10 +9465,10 @@ exports.RelationshipCreationChangeRequestCipher = RelationshipCreationChangeRequ
9549
9465
 
9550
9466
  /***/ }),
9551
9467
 
9552
- /***/ "./dist/modules/relationships/transmission/requests/RelationshipCreationChangeRequestContent.js":
9553
- /*!******************************************************************************************************!*\
9554
- !*** ./dist/modules/relationships/transmission/requests/RelationshipCreationChangeRequestContent.js ***!
9555
- \******************************************************************************************************/
9468
+ /***/ "./dist/modules/relationships/transmission/requests/RelationshipCreationChangeRequestContentWrapper.js":
9469
+ /*!*************************************************************************************************************!*\
9470
+ !*** ./dist/modules/relationships/transmission/requests/RelationshipCreationChangeRequestContentWrapper.js ***!
9471
+ \*************************************************************************************************************/
9556
9472
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
9557
9473
 
9558
9474
  "use strict";
@@ -9567,11 +9483,11 @@ var __metadata = (this && this.__metadata) || function (k, v) {
9567
9483
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9568
9484
  };
9569
9485
  Object.defineProperty(exports, "__esModule", ({ value: true }));
9570
- exports.RelationshipCreationChangeRequestContent = void 0;
9486
+ exports.RelationshipCreationChangeRequestContentWrapper = void 0;
9571
9487
  const ts_serval_1 = __webpack_require__(/*! @js-soft/ts-serval */ "@js-soft/ts-serval");
9572
9488
  const core_1 = __webpack_require__(/*! ../../../../core */ "./dist/core/index.js");
9573
9489
  const Identity_1 = __webpack_require__(/*! ../../../accounts/data/Identity */ "./dist/modules/accounts/data/Identity.js");
9574
- let RelationshipCreationChangeRequestContent = class RelationshipCreationChangeRequestContent extends core_1.CoreSerializable {
9490
+ let RelationshipCreationChangeRequestContentWrapper = class RelationshipCreationChangeRequestContentWrapper extends core_1.CoreSerializable {
9575
9491
  static from(value) {
9576
9492
  return this.fromAny(value);
9577
9493
  }
@@ -9580,22 +9496,22 @@ __decorate([
9580
9496
  (0, ts_serval_1.validate)(),
9581
9497
  (0, ts_serval_1.serialize)(),
9582
9498
  __metadata("design:type", Identity_1.Identity)
9583
- ], RelationshipCreationChangeRequestContent.prototype, "identity", void 0);
9499
+ ], RelationshipCreationChangeRequestContentWrapper.prototype, "identity", void 0);
9584
9500
  __decorate([
9585
9501
  (0, ts_serval_1.validate)(),
9586
9502
  (0, ts_serval_1.serialize)(),
9587
9503
  __metadata("design:type", ts_serval_1.Serializable)
9588
- ], RelationshipCreationChangeRequestContent.prototype, "content", void 0);
9504
+ ], RelationshipCreationChangeRequestContentWrapper.prototype, "content", void 0);
9589
9505
  __decorate([
9590
9506
  (0, ts_serval_1.validate)(),
9591
9507
  (0, ts_serval_1.serialize)(),
9592
9508
  __metadata("design:type", core_1.CoreId)
9593
- ], RelationshipCreationChangeRequestContent.prototype, "templateId", void 0);
9594
- RelationshipCreationChangeRequestContent = __decorate([
9595
- (0, ts_serval_1.type)("RelationshipCreationChangeRequestContent")
9596
- ], RelationshipCreationChangeRequestContent);
9597
- exports.RelationshipCreationChangeRequestContent = RelationshipCreationChangeRequestContent;
9598
- //# sourceMappingURL=RelationshipCreationChangeRequestContent.js.map
9509
+ ], RelationshipCreationChangeRequestContentWrapper.prototype, "templateId", void 0);
9510
+ RelationshipCreationChangeRequestContentWrapper = __decorate([
9511
+ (0, ts_serval_1.type)("RelationshipCreationChangeRequestContentWrapper")
9512
+ ], RelationshipCreationChangeRequestContentWrapper);
9513
+ exports.RelationshipCreationChangeRequestContentWrapper = RelationshipCreationChangeRequestContentWrapper;
9514
+ //# sourceMappingURL=RelationshipCreationChangeRequestContentWrapper.js.map
9599
9515
 
9600
9516
  /***/ }),
9601
9517
 
@@ -9697,10 +9613,10 @@ exports.RelationshipCreationChangeResponseCipher = RelationshipCreationChangeRes
9697
9613
 
9698
9614
  /***/ }),
9699
9615
 
9700
- /***/ "./dist/modules/relationships/transmission/responses/RelationshipCreationChangeResponseContent.js":
9701
- /*!********************************************************************************************************!*\
9702
- !*** ./dist/modules/relationships/transmission/responses/RelationshipCreationChangeResponseContent.js ***!
9703
- \********************************************************************************************************/
9616
+ /***/ "./dist/modules/relationships/transmission/responses/RelationshipCreationChangeResponseContentWrapper.js":
9617
+ /*!***************************************************************************************************************!*\
9618
+ !*** ./dist/modules/relationships/transmission/responses/RelationshipCreationChangeResponseContentWrapper.js ***!
9619
+ \***************************************************************************************************************/
9704
9620
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
9705
9621
 
9706
9622
  "use strict";
@@ -9715,10 +9631,10 @@ var __metadata = (this && this.__metadata) || function (k, v) {
9715
9631
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9716
9632
  };
9717
9633
  Object.defineProperty(exports, "__esModule", ({ value: true }));
9718
- exports.RelationshipCreationChangeResponseContent = void 0;
9634
+ exports.RelationshipCreationChangeResponseContentWrapper = void 0;
9719
9635
  const ts_serval_1 = __webpack_require__(/*! @js-soft/ts-serval */ "@js-soft/ts-serval");
9720
9636
  const core_1 = __webpack_require__(/*! ../../../../core */ "./dist/core/index.js");
9721
- let RelationshipCreationChangeResponseContent = class RelationshipCreationChangeResponseContent extends core_1.CoreSerializable {
9637
+ let RelationshipCreationChangeResponseContentWrapper = class RelationshipCreationChangeResponseContentWrapper extends core_1.CoreSerializable {
9722
9638
  static from(value) {
9723
9639
  return this.fromAny(value);
9724
9640
  }
@@ -9727,17 +9643,17 @@ __decorate([
9727
9643
  (0, ts_serval_1.validate)(),
9728
9644
  (0, ts_serval_1.serialize)(),
9729
9645
  __metadata("design:type", ts_serval_1.Serializable)
9730
- ], RelationshipCreationChangeResponseContent.prototype, "content", void 0);
9646
+ ], RelationshipCreationChangeResponseContentWrapper.prototype, "content", void 0);
9731
9647
  __decorate([
9732
9648
  (0, ts_serval_1.validate)(),
9733
9649
  (0, ts_serval_1.serialize)(),
9734
9650
  __metadata("design:type", core_1.CoreId)
9735
- ], RelationshipCreationChangeResponseContent.prototype, "relationshipId", void 0);
9736
- RelationshipCreationChangeResponseContent = __decorate([
9737
- (0, ts_serval_1.type)("RelationshipCreationChangeResponseContent")
9738
- ], RelationshipCreationChangeResponseContent);
9739
- exports.RelationshipCreationChangeResponseContent = RelationshipCreationChangeResponseContent;
9740
- //# sourceMappingURL=RelationshipCreationChangeResponseContent.js.map
9651
+ ], RelationshipCreationChangeResponseContentWrapper.prototype, "relationshipId", void 0);
9652
+ RelationshipCreationChangeResponseContentWrapper = __decorate([
9653
+ (0, ts_serval_1.type)("RelationshipCreationChangeResponseContentWrapper")
9654
+ ], RelationshipCreationChangeResponseContentWrapper);
9655
+ exports.RelationshipCreationChangeResponseContentWrapper = RelationshipCreationChangeResponseContentWrapper;
9656
+ //# sourceMappingURL=RelationshipCreationChangeResponseContentWrapper.js.map
9741
9657
 
9742
9658
  /***/ }),
9743
9659
 
@@ -9944,7 +9860,6 @@ class SecretController extends TransportController_1.TransportController {
9944
9860
  async createExchangeKey(name = "", description = "", validTo) {
9945
9861
  const exchangeKeypair = await core_1.CoreCrypto.generateExchangeKeypair();
9946
9862
  const secretContainer = await this.storeSecret(exchangeKeypair, name, description, validTo);
9947
- // TODO: JSSNMSHDD-2485 (wipe private key)
9948
9863
  return [exchangeKeypair.publicKey, secretContainer];
9949
9864
  }
9950
9865
  async getBaseKey() {
@@ -11661,7 +11576,6 @@ class TokenController extends TransportController_1.TransportController {
11661
11576
  if (ids.length < 1) {
11662
11577
  return [];
11663
11578
  }
11664
- // TODO: JSSNMSHDD-2820 (check for items that couldn't be fetched e.g. because it is expired)
11665
11579
  const resultItems = (await this.client.getTokens({ ids })).value;
11666
11580
  const promises = [];
11667
11581
  for await (const resultItem of resultItems) {