@nmshd/runtime 2.0.0-beta.1 → 2.0.0-beta.2

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 (30) hide show
  1. package/dist/buildInformation.js +4 -4
  2. package/dist/extensibility/facades/consumption/AttributesFacade.d.ts +6 -4
  3. package/dist/extensibility/facades/consumption/AttributesFacade.js +11 -5
  4. package/dist/extensibility/facades/consumption/AttributesFacade.js.map +1 -1
  5. package/dist/useCases/common/Schemas.d.ts +2 -1
  6. package/dist/useCases/common/Schemas.js +302 -59
  7. package/dist/useCases/common/Schemas.js.map +1 -1
  8. package/dist/useCases/consumption/attributes/GetAttributes.d.ts +3 -1
  9. package/dist/useCases/consumption/attributes/GetAttributes.js +9 -2
  10. package/dist/useCases/consumption/attributes/GetAttributes.js.map +1 -1
  11. package/dist/useCases/consumption/attributes/GetPeerAttributes.d.ts +27 -0
  12. package/dist/useCases/consumption/attributes/GetPeerAttributes.js +48 -0
  13. package/dist/useCases/consumption/attributes/GetPeerAttributes.js.map +1 -0
  14. package/dist/useCases/consumption/attributes/GetSharedToPeerAttributes.d.ts +30 -0
  15. package/dist/useCases/consumption/attributes/GetSharedToPeerAttributes.js +52 -0
  16. package/dist/useCases/consumption/attributes/GetSharedToPeerAttributes.js.map +1 -0
  17. package/dist/useCases/consumption/attributes/index.d.ts +2 -1
  18. package/dist/useCases/consumption/attributes/index.js +2 -1
  19. package/dist/useCases/consumption/attributes/index.js.map +1 -1
  20. package/dist/useCases/consumption/settings/GetSettings.d.ts +0 -1
  21. package/dist/useCases/consumption/settings/GetSettings.js +0 -1
  22. package/dist/useCases/consumption/settings/GetSettings.js.map +1 -1
  23. package/lib-web/nmshd.runtime.js +411 -153
  24. package/lib-web/nmshd.runtime.js.map +1 -1
  25. package/lib-web/nmshd.runtime.min.js +3 -3
  26. package/lib-web/nmshd.runtime.min.js.map +1 -1
  27. package/package.json +1 -1
  28. package/dist/useCases/consumption/attributes/GetValidAttributes.d.ts +0 -35
  29. package/dist/useCases/consumption/attributes/GetValidAttributes.js +0 -108
  30. package/dist/useCases/consumption/attributes/GetValidAttributes.js.map +0 -1
@@ -436,10 +436,10 @@ const content_1 = __webpack_require__(/*! @nmshd/content */ "@nmshd/content");
436
436
  const crypto_1 = __webpack_require__(/*! @nmshd/crypto */ "@nmshd/crypto");
437
437
  const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
438
438
  exports.buildInformation = {
439
- version: "2.0.0-beta.1",
440
- build: "87",
441
- date: "2022-07-20T09:42:24+00:00",
442
- commit: "df92f6ab9c9af4892b2129aa7956354ea967ed1e",
439
+ version: "2.0.0-beta.2",
440
+ build: "88",
441
+ date: "2022-07-20T13:11:40+00:00",
442
+ commit: "b0f4fb5fba9d441e73f60a9882a0fcb0837abf6c",
443
443
  dependencies: {"@js-soft/docdb-querytranslator":"1.1.0","@js-soft/logging-abstractions":"1.0.0","@js-soft/ts-serval":"2.0.3","@js-soft/ts-utils":"^2.0.1","@nmshd/consumption":"2.0.0-alpha.30","@nmshd/content":"2.0.0-alpha.45","@nmshd/crypto":"2.0.1","@nmshd/transport":"2.0.0-alpha.3","ajv":"^8.11.0","ajv-errors":"^3.0.0","ajv-formats":"^2.1.1","fluent-ts-validator":"3.0.3","json-stringify-safe":"^5.0.1","luxon":"^3.0.1","qrcode":"1.5.1","reflect-metadata":"0.1.13","ts-simple-nameof":"1.3.1","typescript-ioc":"3.2.2"},
444
444
  libraries: {
445
445
  serval: ts_serval_1.buildInformation,
@@ -2641,11 +2641,12 @@ exports.AttributesFacade = void 0;
2641
2641
  const typescript_ioc_1 = __webpack_require__(/*! typescript-ioc */ "./node_modules/typescript-ioc/dist/typescript-ioc.js");
2642
2642
  const useCases_1 = __webpack_require__(/*! ../../../useCases */ "./dist/useCases/index.js");
2643
2643
  let AttributesFacade = class AttributesFacade {
2644
- constructor(createAttributeUseCase, createSharedAttributeCopyUseCase, deleteAttributeUseCase, getValidAttributesUseCase, getAttributeUseCase, getAttributesUseCase, succeedAttributeUseCase, updateAttributeUseCase, executeIdentityAttributeQueryUseCase, executeRelationshipAttributeQueryUseCase) {
2644
+ constructor(createAttributeUseCase, createSharedAttributeCopyUseCase, deleteAttributeUseCase, getPeerAttributesUseCase, getSharedToPeerAttributesUseCase, getAttributeUseCase, getAttributesUseCase, succeedAttributeUseCase, updateAttributeUseCase, executeIdentityAttributeQueryUseCase, executeRelationshipAttributeQueryUseCase) {
2645
2645
  this.createAttributeUseCase = createAttributeUseCase;
2646
2646
  this.createSharedAttributeCopyUseCase = createSharedAttributeCopyUseCase;
2647
2647
  this.deleteAttributeUseCase = deleteAttributeUseCase;
2648
- this.getValidAttributesUseCase = getValidAttributesUseCase;
2648
+ this.getPeerAttributesUseCase = getPeerAttributesUseCase;
2649
+ this.getSharedToPeerAttributesUseCase = getSharedToPeerAttributesUseCase;
2649
2650
  this.getAttributeUseCase = getAttributeUseCase;
2650
2651
  this.getAttributesUseCase = getAttributesUseCase;
2651
2652
  this.succeedAttributeUseCase = succeedAttributeUseCase;
@@ -2662,8 +2663,11 @@ let AttributesFacade = class AttributesFacade {
2662
2663
  async deleteAttribute(request) {
2663
2664
  return await this.deleteAttributeUseCase.execute(request);
2664
2665
  }
2665
- async getValidAttributes(request) {
2666
- return await this.getValidAttributesUseCase.execute(request);
2666
+ async getPeerAttributes(request) {
2667
+ return await this.getPeerAttributesUseCase.execute(request);
2668
+ }
2669
+ async getSharedToPeerAttributes(request) {
2670
+ return await this.getSharedToPeerAttributesUseCase.execute(request);
2667
2671
  }
2668
2672
  async getAttribute(request) {
2669
2673
  return await this.getAttributeUseCase.execute(request);
@@ -2695,10 +2699,12 @@ AttributesFacade = __decorate([
2695
2699
  __param(7, typescript_ioc_1.Inject),
2696
2700
  __param(8, typescript_ioc_1.Inject),
2697
2701
  __param(9, typescript_ioc_1.Inject),
2702
+ __param(10, typescript_ioc_1.Inject),
2698
2703
  __metadata("design:paramtypes", [useCases_1.CreateAttributeUseCase,
2699
2704
  useCases_1.CreateSharedAttributeCopyUseCase,
2700
2705
  useCases_1.DeleteAttributeUseCase,
2701
- useCases_1.GetValidAttributesUseCase,
2706
+ useCases_1.GetPeerAttributesUseCase,
2707
+ useCases_1.GetSharedToPeerAttributesUseCase,
2702
2708
  useCases_1.GetAttributeUseCase,
2703
2709
  useCases_1.GetAttributesUseCase,
2704
2710
  useCases_1.SucceedAttributeUseCase,
@@ -5141,8 +5147,8 @@ exports.JsonSchema = JsonSchema;
5141
5147
  "use strict";
5142
5148
 
5143
5149
  Object.defineProperty(exports, "__esModule", ({ value: true }));
5144
- exports.GetDeviceRequest = exports.DeleteDeviceRequest = exports.CreateDeviceOnboardingTokenRequest = exports.CreateDeviceRequest = exports.ValidateChallengeRequest = exports.CreateChallengeRequest = exports.CreateDeviceChallengeRequest = exports.CreateIdentityChallengeRequest = exports.CreateRelationshipChallengeRequest = exports.SyncEverythingRequest = exports.DownloadAttachmentRequest = exports.DownloadFileRequest = exports.SyncDatawalletRequest = exports.RegisterPushNotificationTokenRequest = exports.UpdateSettingRequest = exports.GetSettingsRequest = exports.GetSettingRequest = exports.DeleteSettingRequest = exports.CreateSettingRequest = exports.SentOutgoingRequestRequest = exports.RequireManualDecisionOfIncomingRequestRequest = exports.ReceivedIncomingRequestRequest = exports.GetOutgoingRequestsRequest = exports.GetOutgoingRequestRequest = exports.GetIncomingRequestsRequest = exports.GetIncomingRequestRequest = exports.CreateAndCompleteOutgoingRequestFromRelationshipCreationChangeRequest = exports.CompleteOutgoingRequestRequest = exports.CompleteIncomingRequestRequest = exports.CheckPrerequisitesOfIncomingRequestRequest = exports.RejectIncomingRequestRequest = exports.CreateOutgoingRequestRequest = exports.AcceptIncomingRequestRequest = exports.UpdateDraftRequest = exports.GetDraftsRequest = exports.GetDraftRequest = exports.DeleteDraftRequest = exports.CreateDraftRequest = exports.UpdateAttributeRequest = exports.SucceedAttributeRequest = exports.GetValidAttributesRequest = exports.GetAttributesRequest = exports.GetAttributeRequest = exports.ExecuteRelationshipAttributeQueryRequest = exports.ExecuteIdentityAttributeQueryRequest = exports.DeleteAttributeRequest = exports.CreateSharedAttributeCopyRequest = exports.CreateAttributeRequest = exports.LoadPeerTokenAnonymousByTruncatedReferenceRequest = exports.LoadPeerTokenAnonymousByIdAndKeyRequest = void 0;
5145
- exports.LoadPeerTokenRequest = exports.GetTokensRequest = exports.GetTokenRequest = exports.GetQRCodeForTokenRequest = exports.CreateOwnTokenRequest = exports.LoadPeerRelationshipTemplateRequest = exports.LoadPeerRelationshipTemplateViaReferenceRequest = exports.LoadPeerRelationshipTemplateViaSecretRequest = exports.GetRelationshipTemplatesRequest = exports.GetRelationshipTemplateRequest = exports.CreateTokenQrCodeForOwnTemplateRequest = exports.CreateTokenForOwnTemplateRequest = exports.CreateQrCodeForOwnTemplateRequest = exports.CreateOwnRelationshipTemplateRequest = exports.RevokeRelationshipChangeRequest = exports.RejectRelationshipChangeRequest = exports.GetRelationshipsRequest = exports.GetRelationshipByAddressRequest = exports.GetRelationshipRequest = exports.GetAttributesForRelationshipRequest = exports.CreateRelationshipChangeRequest = exports.CreateRelationshipRequest = exports.AcceptRelationshipChangeRequest = exports.SendMessageRequest = exports.GetMessagesRequest = exports.GetMessageRequest = exports.GetAttachmentMetadataRequest = exports.CheckIdentityRequest = exports.UploadOwnFileRequest = exports.LoadPeerFileRequest = exports.LoadPeerFileViaReferenceRequest = exports.LoadPeerFileViaSecretRequest = exports.GetFilesRequest = exports.GetFileRequest = exports.CreateTokenQrCodeForFileRequest = exports.CreateTokenForFileRequest = exports.CreateQrCodeForFileRequest = exports.UpdateDeviceRequest = exports.GetDeviceOnboardingInfoRequest = void 0;
5150
+ exports.DeleteDeviceRequest = exports.CreateDeviceOnboardingTokenRequest = exports.CreateDeviceRequest = exports.ValidateChallengeRequest = exports.CreateChallengeRequest = exports.CreateDeviceChallengeRequest = exports.CreateIdentityChallengeRequest = exports.CreateRelationshipChallengeRequest = exports.SyncEverythingRequest = exports.DownloadAttachmentRequest = exports.DownloadFileRequest = exports.SyncDatawalletRequest = exports.RegisterPushNotificationTokenRequest = exports.UpdateSettingRequest = exports.GetSettingsRequest = exports.GetSettingRequest = exports.DeleteSettingRequest = exports.CreateSettingRequest = exports.SentOutgoingRequestRequest = exports.RequireManualDecisionOfIncomingRequestRequest = exports.ReceivedIncomingRequestRequest = exports.GetOutgoingRequestsRequest = exports.GetOutgoingRequestRequest = exports.GetIncomingRequestsRequest = exports.GetIncomingRequestRequest = exports.CreateAndCompleteOutgoingRequestFromRelationshipCreationChangeRequest = exports.CompleteOutgoingRequestRequest = exports.CompleteIncomingRequestRequest = exports.CheckPrerequisitesOfIncomingRequestRequest = exports.RejectIncomingRequestRequest = exports.CreateOutgoingRequestRequest = exports.AcceptIncomingRequestRequest = exports.UpdateDraftRequest = exports.GetDraftsRequest = exports.GetDraftRequest = exports.DeleteDraftRequest = exports.CreateDraftRequest = exports.UpdateAttributeRequest = exports.SucceedAttributeRequest = exports.GetSharedToPeerAttributesRequest = exports.GetPeerAttributesRequest = exports.GetAttributesRequest = exports.GetAttributeRequest = exports.ExecuteRelationshipAttributeQueryRequest = exports.ExecuteIdentityAttributeQueryRequest = exports.DeleteAttributeRequest = exports.CreateSharedAttributeCopyRequest = exports.CreateAttributeRequest = exports.LoadPeerTokenAnonymousByTruncatedReferenceRequest = exports.LoadPeerTokenAnonymousByIdAndKeyRequest = void 0;
5151
+ exports.LoadPeerTokenRequest = exports.GetTokensRequest = exports.GetTokenRequest = exports.GetQRCodeForTokenRequest = exports.CreateOwnTokenRequest = exports.LoadPeerRelationshipTemplateRequest = exports.LoadPeerRelationshipTemplateViaReferenceRequest = exports.LoadPeerRelationshipTemplateViaSecretRequest = exports.GetRelationshipTemplatesRequest = exports.GetRelationshipTemplateRequest = exports.CreateTokenQrCodeForOwnTemplateRequest = exports.CreateTokenForOwnTemplateRequest = exports.CreateQrCodeForOwnTemplateRequest = exports.CreateOwnRelationshipTemplateRequest = exports.RevokeRelationshipChangeRequest = exports.RejectRelationshipChangeRequest = exports.GetRelationshipsRequest = exports.GetRelationshipByAddressRequest = exports.GetRelationshipRequest = exports.GetAttributesForRelationshipRequest = exports.CreateRelationshipChangeRequest = exports.CreateRelationshipRequest = exports.AcceptRelationshipChangeRequest = exports.SendMessageRequest = exports.GetMessagesRequest = exports.GetMessageRequest = exports.GetAttachmentMetadataRequest = exports.CheckIdentityRequest = exports.UploadOwnFileRequest = exports.LoadPeerFileRequest = exports.LoadPeerFileViaReferenceRequest = exports.LoadPeerFileViaSecretRequest = exports.GetFilesRequest = exports.GetFileRequest = exports.CreateTokenQrCodeForFileRequest = exports.CreateTokenForFileRequest = exports.CreateQrCodeForFileRequest = exports.UpdateDeviceRequest = exports.GetDeviceOnboardingInfoRequest = exports.GetDeviceRequest = void 0;
5146
5152
  exports.LoadPeerTokenAnonymousByIdAndKeyRequest = {
5147
5153
  "$schema": "http://json-schema.org/draft-07/schema#",
5148
5154
  "$ref": "#/definitions/LoadPeerTokenAnonymousByIdAndKeyRequest",
@@ -5805,6 +5811,9 @@ exports.GetAttributesRequest = {
5805
5811
  "properties": {
5806
5812
  "query": {
5807
5813
  "$ref": "#/definitions/GetAttributesRequestQuery"
5814
+ },
5815
+ "onlyValid": {
5816
+ "type": "boolean"
5808
5817
  }
5809
5818
  },
5810
5819
  "additionalProperties": false
@@ -6015,89 +6024,342 @@ exports.GetAttributesRequest = {
6015
6024
  }
6016
6025
  }
6017
6026
  };
6018
- exports.GetValidAttributesRequest = {
6027
+ exports.GetPeerAttributesRequest = {
6019
6028
  "$schema": "http://json-schema.org/draft-07/schema#",
6020
- "$ref": "#/definitions/GetValidAttributesRequest",
6029
+ "$ref": "#/definitions/GetPeerAttributesRequest",
6021
6030
  "definitions": {
6022
- "GetValidAttributesRequest": {
6031
+ "GetPeerAttributesRequest": {
6023
6032
  "type": "object",
6024
6033
  "properties": {
6034
+ "peer": {
6035
+ "type": "string"
6036
+ },
6037
+ "onlyValid": {
6038
+ "type": "boolean"
6039
+ },
6025
6040
  "query": {
6026
- "$ref": "#/definitions/GetValidAttributesRequestQuery"
6041
+ "$ref": "#/definitions/GetPeerAttributesRequestQuery"
6027
6042
  }
6028
6043
  },
6044
+ "required": [
6045
+ "peer"
6046
+ ],
6029
6047
  "additionalProperties": false
6030
6048
  },
6031
- "GetValidAttributesRequestQuery": {
6049
+ "GetPeerAttributesRequestQuery": {
6032
6050
  "type": "object",
6033
6051
  "properties": {
6034
- "content": {
6035
- "type": "object",
6036
- "properties": {
6037
- "@type": {
6052
+ "createdAt": {
6053
+ "type": "string"
6054
+ },
6055
+ "content.@type": {
6056
+ "anyOf": [
6057
+ {
6058
+ "type": "string"
6059
+ },
6060
+ {
6061
+ "type": "array",
6062
+ "items": {
6063
+ "type": "string"
6064
+ }
6065
+ }
6066
+ ]
6067
+ },
6068
+ "content.tags": {
6069
+ "anyOf": [
6070
+ {
6038
6071
  "type": "string"
6039
6072
  },
6040
- "tags": {
6073
+ {
6041
6074
  "type": "array",
6042
6075
  "items": {
6043
6076
  "type": "string"
6044
6077
  }
6078
+ }
6079
+ ]
6080
+ },
6081
+ "content.validFrom": {
6082
+ "anyOf": [
6083
+ {
6084
+ "type": "string"
6045
6085
  },
6046
- "owner": {
6086
+ {
6087
+ "type": "array",
6088
+ "items": {
6089
+ "type": "string"
6090
+ }
6091
+ }
6092
+ ]
6093
+ },
6094
+ "content.validTo": {
6095
+ "anyOf": [
6096
+ {
6047
6097
  "type": "string"
6048
6098
  },
6049
- "key": {
6099
+ {
6100
+ "type": "array",
6101
+ "items": {
6102
+ "type": "string"
6103
+ }
6104
+ }
6105
+ ]
6106
+ },
6107
+ "content.key": {
6108
+ "anyOf": [
6109
+ {
6050
6110
  "type": "string"
6051
6111
  },
6052
- "isTechnical": {
6053
- "type": "boolean"
6112
+ {
6113
+ "type": "array",
6114
+ "items": {
6115
+ "type": "string"
6116
+ }
6117
+ }
6118
+ ]
6119
+ },
6120
+ "content.isTechnical": {
6121
+ "anyOf": [
6122
+ {
6123
+ "type": "string"
6054
6124
  },
6055
- "confidentiality": {
6056
- "$ref": "#/definitions/RelationshipAttributeConfidentiality"
6125
+ {
6126
+ "type": "array",
6127
+ "items": {
6128
+ "type": "string"
6129
+ }
6130
+ }
6131
+ ]
6132
+ },
6133
+ "content.confidentiality": {
6134
+ "anyOf": [
6135
+ {
6136
+ "type": "string"
6057
6137
  },
6058
- "value": {
6059
- "type": "object",
6060
- "properties": {
6061
- "@type": {
6062
- "type": "string"
6063
- }
6064
- },
6065
- "additionalProperties": false
6138
+ {
6139
+ "type": "array",
6140
+ "items": {
6141
+ "type": "string"
6142
+ }
6066
6143
  }
6067
- },
6068
- "additionalProperties": false
6144
+ ]
6069
6145
  },
6070
- "succeeds": {
6146
+ "content.value.@type": {
6147
+ "anyOf": [
6148
+ {
6149
+ "type": "string"
6150
+ },
6151
+ {
6152
+ "type": "array",
6153
+ "items": {
6154
+ "type": "string"
6155
+ }
6156
+ }
6157
+ ]
6158
+ },
6159
+ "shareInfo": {
6160
+ "anyOf": [
6161
+ {
6162
+ "type": "string"
6163
+ },
6164
+ {
6165
+ "type": "array",
6166
+ "items": {
6167
+ "type": "string"
6168
+ }
6169
+ }
6170
+ ]
6171
+ },
6172
+ "shareInfo.requestReference": {
6173
+ "anyOf": [
6174
+ {
6175
+ "type": "string"
6176
+ },
6177
+ {
6178
+ "type": "array",
6179
+ "items": {
6180
+ "type": "string"
6181
+ }
6182
+ }
6183
+ ]
6184
+ }
6185
+ },
6186
+ "additionalProperties": false
6187
+ }
6188
+ }
6189
+ };
6190
+ exports.GetSharedToPeerAttributesRequest = {
6191
+ "$schema": "http://json-schema.org/draft-07/schema#",
6192
+ "$ref": "#/definitions/GetSharedToPeerAttributesRequest",
6193
+ "definitions": {
6194
+ "GetSharedToPeerAttributesRequest": {
6195
+ "type": "object",
6196
+ "properties": {
6197
+ "peer": {
6071
6198
  "type": "string"
6072
6199
  },
6073
- "succeededBy": {
6200
+ "onlyValid": {
6201
+ "type": "boolean"
6202
+ },
6203
+ "query": {
6204
+ "$ref": "#/definitions/GetSharedToPeerAttributesRequestQuery"
6205
+ }
6206
+ },
6207
+ "required": [
6208
+ "peer"
6209
+ ],
6210
+ "additionalProperties": false
6211
+ },
6212
+ "GetSharedToPeerAttributesRequestQuery": {
6213
+ "type": "object",
6214
+ "properties": {
6215
+ "createdAt": {
6074
6216
  "type": "string"
6075
6217
  },
6218
+ "content.@type": {
6219
+ "anyOf": [
6220
+ {
6221
+ "type": "string"
6222
+ },
6223
+ {
6224
+ "type": "array",
6225
+ "items": {
6226
+ "type": "string"
6227
+ }
6228
+ }
6229
+ ]
6230
+ },
6231
+ "content.tags": {
6232
+ "anyOf": [
6233
+ {
6234
+ "type": "string"
6235
+ },
6236
+ {
6237
+ "type": "array",
6238
+ "items": {
6239
+ "type": "string"
6240
+ }
6241
+ }
6242
+ ]
6243
+ },
6244
+ "content.validFrom": {
6245
+ "anyOf": [
6246
+ {
6247
+ "type": "string"
6248
+ },
6249
+ {
6250
+ "type": "array",
6251
+ "items": {
6252
+ "type": "string"
6253
+ }
6254
+ }
6255
+ ]
6256
+ },
6257
+ "content.validTo": {
6258
+ "anyOf": [
6259
+ {
6260
+ "type": "string"
6261
+ },
6262
+ {
6263
+ "type": "array",
6264
+ "items": {
6265
+ "type": "string"
6266
+ }
6267
+ }
6268
+ ]
6269
+ },
6270
+ "content.key": {
6271
+ "anyOf": [
6272
+ {
6273
+ "type": "string"
6274
+ },
6275
+ {
6276
+ "type": "array",
6277
+ "items": {
6278
+ "type": "string"
6279
+ }
6280
+ }
6281
+ ]
6282
+ },
6283
+ "content.isTechnical": {
6284
+ "anyOf": [
6285
+ {
6286
+ "type": "string"
6287
+ },
6288
+ {
6289
+ "type": "array",
6290
+ "items": {
6291
+ "type": "string"
6292
+ }
6293
+ }
6294
+ ]
6295
+ },
6296
+ "content.confidentiality": {
6297
+ "anyOf": [
6298
+ {
6299
+ "type": "string"
6300
+ },
6301
+ {
6302
+ "type": "array",
6303
+ "items": {
6304
+ "type": "string"
6305
+ }
6306
+ }
6307
+ ]
6308
+ },
6309
+ "content.value.@type": {
6310
+ "anyOf": [
6311
+ {
6312
+ "type": "string"
6313
+ },
6314
+ {
6315
+ "type": "array",
6316
+ "items": {
6317
+ "type": "string"
6318
+ }
6319
+ }
6320
+ ]
6321
+ },
6076
6322
  "shareInfo": {
6077
- "type": "object",
6078
- "properties": {
6079
- "requestReference": {
6323
+ "anyOf": [
6324
+ {
6080
6325
  "type": "string"
6081
6326
  },
6082
- "peer": {
6327
+ {
6328
+ "type": "array",
6329
+ "items": {
6330
+ "type": "string"
6331
+ }
6332
+ }
6333
+ ]
6334
+ },
6335
+ "shareInfo.requestReference": {
6336
+ "anyOf": [
6337
+ {
6083
6338
  "type": "string"
6084
6339
  },
6085
- "sourceAttribute": {
6340
+ {
6341
+ "type": "array",
6342
+ "items": {
6343
+ "type": "string"
6344
+ }
6345
+ }
6346
+ ]
6347
+ },
6348
+ "shareInfo.sourceAttribute": {
6349
+ "anyOf": [
6350
+ {
6086
6351
  "type": "string"
6352
+ },
6353
+ {
6354
+ "type": "array",
6355
+ "items": {
6356
+ "type": "string"
6357
+ }
6087
6358
  }
6088
- },
6089
- "additionalProperties": false
6359
+ ]
6090
6360
  }
6091
6361
  },
6092
- "additionalProperties": {}
6093
- },
6094
- "RelationshipAttributeConfidentiality": {
6095
- "type": "string",
6096
- "enum": [
6097
- "public",
6098
- "private",
6099
- "protected"
6100
- ]
6362
+ "additionalProperties": false
6101
6363
  }
6102
6364
  }
6103
6365
  };
@@ -9650,19 +9912,6 @@ exports.GetSettingsRequest = {
9650
9912
  }
9651
9913
  ]
9652
9914
  },
9653
- "deletedAt": {
9654
- "anyOf": [
9655
- {
9656
- "type": "string"
9657
- },
9658
- {
9659
- "type": "array",
9660
- "items": {
9661
- "type": "string"
9662
- }
9663
- }
9664
- ]
9665
- },
9666
9915
  "succeedsItem": {
9667
9916
  "anyOf": [
9668
9917
  {
@@ -11924,9 +12173,16 @@ let GetAttributesUseCase = class GetAttributesUseCase extends common_1.UseCase {
11924
12173
  this.attributeController = attributeController;
11925
12174
  }
11926
12175
  async executeInternal(request) {
11927
- const flattenedQuery = (0, flattenObject_1.flattenObject)(request.query);
12176
+ const query = request.query ?? {};
12177
+ const flattenedQuery = (0, flattenObject_1.flattenObject)(query);
11928
12178
  const dbQuery = GetAttributesUseCase.queryTranslator.parse(flattenedQuery);
11929
- const attributes = await this.attributeController.getLocalAttributes(dbQuery);
12179
+ let attributes;
12180
+ if (request.onlyValid) {
12181
+ attributes = await this.attributeController.getValidLocalAttributes(dbQuery);
12182
+ }
12183
+ else {
12184
+ attributes = await this.attributeController.getLocalAttributes(dbQuery);
12185
+ }
11930
12186
  return ts_utils_1.Result.ok(AttributeMapper_1.AttributeMapper.toAttributeDTOList(attributes));
11931
12187
  }
11932
12188
  };
@@ -12038,10 +12294,10 @@ exports.GetAttributesUseCase = GetAttributesUseCase;
12038
12294
 
12039
12295
  /***/ }),
12040
12296
 
12041
- /***/ "./dist/useCases/consumption/attributes/GetValidAttributes.js":
12042
- /*!********************************************************************!*\
12043
- !*** ./dist/useCases/consumption/attributes/GetValidAttributes.js ***!
12044
- \********************************************************************/
12297
+ /***/ "./dist/useCases/consumption/attributes/GetPeerAttributes.js":
12298
+ /*!*******************************************************************!*\
12299
+ !*** ./dist/useCases/consumption/attributes/GetPeerAttributes.js ***!
12300
+ \*******************************************************************/
12045
12301
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
12046
12302
 
12047
12303
  "use strict";
@@ -12059,100 +12315,102 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
12059
12315
  return function (target, key) { decorator(target, key, paramIndex); }
12060
12316
  };
12061
12317
  Object.defineProperty(exports, "__esModule", ({ value: true }));
12062
- exports.GetValidAttributesUseCase = void 0;
12063
- const docdb_querytranslator_1 = __webpack_require__(/*! @js-soft/docdb-querytranslator */ "./node_modules/@js-soft/docdb-querytranslator/dist/index.js");
12318
+ exports.GetPeerAttributesUseCase = void 0;
12064
12319
  const ts_utils_1 = __webpack_require__(/*! @js-soft/ts-utils */ "./node_modules/@js-soft/ts-utils/dist/index.js");
12065
12320
  const consumption_1 = __webpack_require__(/*! @nmshd/consumption */ "@nmshd/consumption");
12066
- const ts_simple_nameof_1 = __webpack_require__(/*! ts-simple-nameof */ "./node_modules/ts-simple-nameof/index.js");
12067
12321
  const typescript_ioc_1 = __webpack_require__(/*! typescript-ioc */ "./node_modules/typescript-ioc/dist/typescript-ioc.js");
12068
12322
  const common_1 = __webpack_require__(/*! ../../common */ "./dist/useCases/common/index.js");
12069
12323
  const flattenObject_1 = __webpack_require__(/*! ../requests/flattenObject */ "./dist/useCases/consumption/requests/flattenObject.js");
12070
12324
  const AttributeMapper_1 = __webpack_require__(/*! ./AttributeMapper */ "./dist/useCases/consumption/attributes/AttributeMapper.js");
12071
- let GetValidAttributesUseCase = class GetValidAttributesUseCase extends common_1.UseCase {
12325
+ const GetAttributes_1 = __webpack_require__(/*! ./GetAttributes */ "./dist/useCases/consumption/attributes/GetAttributes.js");
12326
+ let GetPeerAttributesUseCase = class GetPeerAttributesUseCase extends common_1.UseCase {
12072
12327
  constructor(attributeController) {
12073
12328
  super();
12074
12329
  this.attributeController = attributeController;
12075
12330
  }
12076
12331
  async executeInternal(request) {
12077
- const flattenedQuery = (0, flattenObject_1.flattenObject)(request.query);
12078
- const dbQuery = GetValidAttributesUseCase.queryTranslator.parse(flattenedQuery);
12079
- const attributes = await this.attributeController.getValidLocalAttributes(dbQuery);
12332
+ const query = request.query ?? {};
12333
+ query["content.owner"] = request.peer;
12334
+ const flattenedQuery = (0, flattenObject_1.flattenObject)(query);
12335
+ const dbQuery = GetAttributes_1.GetAttributesUseCase.queryTranslator.parse(flattenedQuery);
12336
+ let attributes;
12337
+ if (request.onlyValid) {
12338
+ attributes = await this.attributeController.getValidLocalAttributes(dbQuery);
12339
+ }
12340
+ else {
12341
+ attributes = await this.attributeController.getLocalAttributes(dbQuery);
12342
+ }
12080
12343
  return ts_utils_1.Result.ok(AttributeMapper_1.AttributeMapper.toAttributeDTOList(attributes));
12081
12344
  }
12082
12345
  };
12083
- GetValidAttributesUseCase.queryTranslator = new docdb_querytranslator_1.QueryTranslator({
12084
- whitelist: {
12085
- [(0, ts_simple_nameof_1.nameof)((x) => x.succeeds)]: true,
12086
- [(0, ts_simple_nameof_1.nameof)((x) => x.succeededBy)]: true,
12087
- // content.abstractAttribute
12088
- [`${(0, ts_simple_nameof_1.nameof)((x) => x.content)}.${(0, ts_simple_nameof_1.nameof)((x) => x.owner)}`]: true,
12089
- [`${(0, ts_simple_nameof_1.nameof)((x) => x.content)}.@type`]: true,
12090
- // content.identityAttribute
12091
- [`${(0, ts_simple_nameof_1.nameof)((x) => x.content)}.${(0, ts_simple_nameof_1.nameof)((x) => x.tags)}`]: true,
12092
- [`${(0, ts_simple_nameof_1.nameof)((x) => x.content)}.${(0, ts_simple_nameof_1.nameof)((x) => x.value)}.@type`]: true,
12093
- // content.relationshipAttribute
12094
- [`${(0, ts_simple_nameof_1.nameof)((x) => x.content)}.${(0, ts_simple_nameof_1.nameof)((x) => x.key)}`]: true,
12095
- [`${(0, ts_simple_nameof_1.nameof)((x) => x.content)}.${(0, ts_simple_nameof_1.nameof)((x) => x.isTechnical)}`]: true,
12096
- [`${(0, ts_simple_nameof_1.nameof)((x) => x.content)}.${(0, ts_simple_nameof_1.nameof)((x) => x.confidentiality)}`]: true,
12097
- // content.shareInfo
12098
- [`${(0, ts_simple_nameof_1.nameof)((x) => x.shareInfo)}.${(0, ts_simple_nameof_1.nameof)((x) => x.peer)}`]: true,
12099
- [`${(0, ts_simple_nameof_1.nameof)((x) => x.shareInfo)}.${(0, ts_simple_nameof_1.nameof)((x) => x.requestReference)}`]: true,
12100
- [`${(0, ts_simple_nameof_1.nameof)((x) => x.shareInfo)}.${(0, ts_simple_nameof_1.nameof)((x) => x.sourceAttribute)}`]: true
12101
- },
12102
- alias: {
12103
- [(0, ts_simple_nameof_1.nameof)((x) => x.succeeds)]: [(0, ts_simple_nameof_1.nameof)((x) => x.succeeds)],
12104
- [(0, ts_simple_nameof_1.nameof)((x) => x.succeededBy)]: [(0, ts_simple_nameof_1.nameof)((x) => x.succeededBy)],
12105
- // content.abstractAttribute
12106
- [`${(0, ts_simple_nameof_1.nameof)((x) => x.content)}.${(0, ts_simple_nameof_1.nameof)((x) => x.owner)}`]: [
12107
- `${(0, ts_simple_nameof_1.nameof)((x) => x.content)}.${(0, ts_simple_nameof_1.nameof)((x) => x.owner)}`
12108
- ],
12109
- [`${(0, ts_simple_nameof_1.nameof)((x) => x.content)}.@type`]: [`${(0, ts_simple_nameof_1.nameof)((x) => x.content)}.@type`],
12110
- // content.identityAttribute
12111
- [`${(0, ts_simple_nameof_1.nameof)((x) => x.content)}.${(0, ts_simple_nameof_1.nameof)((x) => x.tags)}`]: [
12112
- `${(0, ts_simple_nameof_1.nameof)((x) => x.content)}.${(0, ts_simple_nameof_1.nameof)((x) => x.tags)}`
12113
- ],
12114
- [`${(0, ts_simple_nameof_1.nameof)((x) => x.content)}.${(0, ts_simple_nameof_1.nameof)((x) => x.value)}.@type`]: [
12115
- `${(0, ts_simple_nameof_1.nameof)((x) => x.content)}.${(0, ts_simple_nameof_1.nameof)((x) => x.value)}.@type`
12116
- ],
12117
- // content.relationshipAttribute
12118
- [`${(0, ts_simple_nameof_1.nameof)((x) => x.content)}.${(0, ts_simple_nameof_1.nameof)((x) => x.key)}`]: [
12119
- `${(0, ts_simple_nameof_1.nameof)((x) => x.content)}.${(0, ts_simple_nameof_1.nameof)((x) => x.key)}`
12120
- ],
12121
- [`${(0, ts_simple_nameof_1.nameof)((x) => x.content)}.${(0, ts_simple_nameof_1.nameof)((x) => x.isTechnical)}`]: [
12122
- `${(0, ts_simple_nameof_1.nameof)((x) => x.content)}.${(0, ts_simple_nameof_1.nameof)((x) => x.isTechnical)}`
12123
- ],
12124
- [`${(0, ts_simple_nameof_1.nameof)((x) => x.content)}.${(0, ts_simple_nameof_1.nameof)((x) => x.confidentiality)}`]: [
12125
- `${(0, ts_simple_nameof_1.nameof)((x) => x.content)}.${(0, ts_simple_nameof_1.nameof)((x) => x.confidentiality)}`
12126
- ],
12127
- // content.shareInfo
12128
- [`${(0, ts_simple_nameof_1.nameof)((x) => x.shareInfo)}.${(0, ts_simple_nameof_1.nameof)((x) => x.peer)}`]: [
12129
- `${(0, ts_simple_nameof_1.nameof)((x) => x.shareInfo)}.${(0, ts_simple_nameof_1.nameof)((x) => x.peer)}`
12130
- ],
12131
- [`${(0, ts_simple_nameof_1.nameof)((x) => x.shareInfo)}.${(0, ts_simple_nameof_1.nameof)((x) => x.requestReference)}`]: [
12132
- `${(0, ts_simple_nameof_1.nameof)((x) => x.shareInfo)}.${(0, ts_simple_nameof_1.nameof)((x) => x.requestReference)}`
12133
- ],
12134
- [`${(0, ts_simple_nameof_1.nameof)((x) => x.shareInfo)}.${(0, ts_simple_nameof_1.nameof)((x) => x.sourceAttribute)}`]: [
12135
- `${(0, ts_simple_nameof_1.nameof)((x) => x.shareInfo)}.${(0, ts_simple_nameof_1.nameof)((x) => x.sourceAttribute)}`
12136
- ]
12137
- },
12138
- custom: {
12139
- // content.tags
12140
- [`${(0, ts_simple_nameof_1.nameof)((x) => x.content)}.${(0, ts_simple_nameof_1.nameof)((x) => x.tags)}`]: (query, input) => {
12141
- const allowedTags = [];
12142
- for (const tag of input) {
12143
- const tagQuery = { [`${(0, ts_simple_nameof_1.nameof)((x) => x.content)}.${(0, ts_simple_nameof_1.nameof)((x) => x.tags)}`]: { $contains: tag } };
12144
- allowedTags.push(tagQuery);
12145
- }
12146
- query["$or"] = allowedTags;
12346
+ GetPeerAttributesUseCase = __decorate([
12347
+ __param(0, typescript_ioc_1.Inject),
12348
+ __metadata("design:paramtypes", [consumption_1.LocalAttributesController])
12349
+ ], GetPeerAttributesUseCase);
12350
+ exports.GetPeerAttributesUseCase = GetPeerAttributesUseCase;
12351
+ //# sourceMappingURL=GetPeerAttributes.js.map
12352
+
12353
+ /***/ }),
12354
+
12355
+ /***/ "./dist/useCases/consumption/attributes/GetSharedToPeerAttributes.js":
12356
+ /*!***************************************************************************!*\
12357
+ !*** ./dist/useCases/consumption/attributes/GetSharedToPeerAttributes.js ***!
12358
+ \***************************************************************************/
12359
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
12360
+
12361
+ "use strict";
12362
+
12363
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
12364
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
12365
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
12366
+ 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;
12367
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
12368
+ };
12369
+ var __metadata = (this && this.__metadata) || function (k, v) {
12370
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
12371
+ };
12372
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12373
+ return function (target, key) { decorator(target, key, paramIndex); }
12374
+ };
12375
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
12376
+ exports.GetSharedToPeerAttributesUseCase = void 0;
12377
+ const ts_utils_1 = __webpack_require__(/*! @js-soft/ts-utils */ "./node_modules/@js-soft/ts-utils/dist/index.js");
12378
+ const consumption_1 = __webpack_require__(/*! @nmshd/consumption */ "@nmshd/consumption");
12379
+ const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
12380
+ const typescript_ioc_1 = __webpack_require__(/*! typescript-ioc */ "./node_modules/typescript-ioc/dist/typescript-ioc.js");
12381
+ const common_1 = __webpack_require__(/*! ../../common */ "./dist/useCases/common/index.js");
12382
+ const flattenObject_1 = __webpack_require__(/*! ../requests/flattenObject */ "./dist/useCases/consumption/requests/flattenObject.js");
12383
+ const AttributeMapper_1 = __webpack_require__(/*! ./AttributeMapper */ "./dist/useCases/consumption/attributes/AttributeMapper.js");
12384
+ const GetAttributes_1 = __webpack_require__(/*! ./GetAttributes */ "./dist/useCases/consumption/attributes/GetAttributes.js");
12385
+ let GetSharedToPeerAttributesUseCase = class GetSharedToPeerAttributesUseCase extends common_1.UseCase {
12386
+ constructor(attributeController, identityController) {
12387
+ super();
12388
+ this.attributeController = attributeController;
12389
+ this.identityController = identityController;
12390
+ }
12391
+ async executeInternal(request) {
12392
+ const query = request.query ?? {};
12393
+ query["content.owner"] = this.identityController.address.toString();
12394
+ query["shareInfo.peer"] = request.peer;
12395
+ const flattenedQuery = (0, flattenObject_1.flattenObject)(query);
12396
+ const dbQuery = GetAttributes_1.GetAttributesUseCase.queryTranslator.parse(flattenedQuery);
12397
+ let attributes;
12398
+ if (request.onlyValid) {
12399
+ attributes = await this.attributeController.getValidLocalAttributes(dbQuery);
12147
12400
  }
12401
+ else {
12402
+ attributes = await this.attributeController.getLocalAttributes(dbQuery);
12403
+ }
12404
+ return ts_utils_1.Result.ok(AttributeMapper_1.AttributeMapper.toAttributeDTOList(attributes));
12148
12405
  }
12149
- });
12150
- GetValidAttributesUseCase = __decorate([
12406
+ };
12407
+ GetSharedToPeerAttributesUseCase = __decorate([
12151
12408
  __param(0, typescript_ioc_1.Inject),
12152
- __metadata("design:paramtypes", [consumption_1.LocalAttributesController])
12153
- ], GetValidAttributesUseCase);
12154
- exports.GetValidAttributesUseCase = GetValidAttributesUseCase;
12155
- //# sourceMappingURL=GetValidAttributes.js.map
12409
+ __param(1, typescript_ioc_1.Inject),
12410
+ __metadata("design:paramtypes", [consumption_1.LocalAttributesController, transport_1.IdentityController])
12411
+ ], GetSharedToPeerAttributesUseCase);
12412
+ exports.GetSharedToPeerAttributesUseCase = GetSharedToPeerAttributesUseCase;
12413
+ //# sourceMappingURL=GetSharedToPeerAttributes.js.map
12156
12414
 
12157
12415
  /***/ }),
12158
12416
 
@@ -12337,7 +12595,8 @@ __exportStar(__webpack_require__(/*! ./ExecuteIdentityAttributeQuery */ "./dist/
12337
12595
  __exportStar(__webpack_require__(/*! ./ExecuteRelationshipAttributeQuery */ "./dist/useCases/consumption/attributes/ExecuteRelationshipAttributeQuery.js"), exports);
12338
12596
  __exportStar(__webpack_require__(/*! ./GetAttribute */ "./dist/useCases/consumption/attributes/GetAttribute.js"), exports);
12339
12597
  __exportStar(__webpack_require__(/*! ./GetAttributes */ "./dist/useCases/consumption/attributes/GetAttributes.js"), exports);
12340
- __exportStar(__webpack_require__(/*! ./GetValidAttributes */ "./dist/useCases/consumption/attributes/GetValidAttributes.js"), exports);
12598
+ __exportStar(__webpack_require__(/*! ./GetPeerAttributes */ "./dist/useCases/consumption/attributes/GetPeerAttributes.js"), exports);
12599
+ __exportStar(__webpack_require__(/*! ./GetSharedToPeerAttributes */ "./dist/useCases/consumption/attributes/GetSharedToPeerAttributes.js"), exports);
12341
12600
  __exportStar(__webpack_require__(/*! ./SucceedAttribute */ "./dist/useCases/consumption/attributes/SucceedAttribute.js"), exports);
12342
12601
  __exportStar(__webpack_require__(/*! ./UpdateAttribute */ "./dist/useCases/consumption/attributes/UpdateAttribute.js"), exports);
12343
12602
  //# sourceMappingURL=index.js.map
@@ -14305,7 +14564,6 @@ GetSettingsUseCase.queryTranslator = new docdb_querytranslator_1.QueryTranslator
14305
14564
  [(0, ts_simple_nameof_1.nameof)((c) => c.scope)]: true,
14306
14565
  [(0, ts_simple_nameof_1.nameof)((c) => c.reference)]: true,
14307
14566
  [(0, ts_simple_nameof_1.nameof)((c) => c.createdAt)]: true,
14308
- [(0, ts_simple_nameof_1.nameof)((c) => c.deletedAt)]: true,
14309
14567
  [(0, ts_simple_nameof_1.nameof)((c) => c.succeedsItem)]: true,
14310
14568
  [(0, ts_simple_nameof_1.nameof)((c) => c.succeedsAt)]: true
14311
14569
  }