@nmshd/runtime 4.13.2 → 4.14.0

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 (25) hide show
  1. package/dist/buildInformation.js +4 -4
  2. package/dist/extensibility/facades/consumption/AttributesFacade.d.ts +4 -2
  3. package/dist/extensibility/facades/consumption/AttributesFacade.d.ts.map +1 -1
  4. package/dist/extensibility/facades/consumption/AttributesFacade.js +8 -2
  5. package/dist/extensibility/facades/consumption/AttributesFacade.js.map +1 -1
  6. package/dist/modules/RequestModule.d.ts.map +1 -1
  7. package/dist/modules/RequestModule.js +6 -2
  8. package/dist/modules/RequestModule.js.map +1 -1
  9. package/dist/useCases/common/RuntimeErrors.d.ts +4 -0
  10. package/dist/useCases/common/RuntimeErrors.d.ts.map +1 -1
  11. package/dist/useCases/common/RuntimeErrors.js +6 -0
  12. package/dist/useCases/common/RuntimeErrors.js.map +1 -1
  13. package/dist/useCases/common/Schemas.d.ts +1 -0
  14. package/dist/useCases/common/Schemas.d.ts.map +1 -1
  15. package/dist/useCases/common/Schemas.js +25 -3
  16. package/dist/useCases/common/Schemas.js.map +1 -1
  17. package/dist/useCases/consumption/attributes/DeleteSharedAttributesForRejectedOrRevokedRelationship.d.ts +19 -0
  18. package/dist/useCases/consumption/attributes/DeleteSharedAttributesForRejectedOrRevokedRelationship.d.ts.map +1 -0
  19. package/dist/useCases/consumption/attributes/DeleteSharedAttributesForRejectedOrRevokedRelationship.js +68 -0
  20. package/dist/useCases/consumption/attributes/DeleteSharedAttributesForRejectedOrRevokedRelationship.js.map +1 -0
  21. package/dist/useCases/consumption/attributes/index.d.ts +1 -0
  22. package/dist/useCases/consumption/attributes/index.d.ts.map +1 -1
  23. package/dist/useCases/consumption/attributes/index.js +1 -0
  24. package/dist/useCases/consumption/attributes/index.js.map +1 -1
  25. package/package.json +1 -1
@@ -0,0 +1,19 @@
1
+ import { Result } from "@js-soft/ts-utils";
2
+ import { AttributesController } from "@nmshd/consumption";
3
+ import { AccountController, RelationshipsController } from "@nmshd/transport";
4
+ import { RelationshipIdString, SchemaRepository, SchemaValidator, UseCase } from "../../common";
5
+ export interface DeleteSharedAttributesForRejectedOrRevokedRelationshipRequest {
6
+ relationshipId: RelationshipIdString;
7
+ }
8
+ declare class Validator extends SchemaValidator<DeleteSharedAttributesForRejectedOrRevokedRelationshipRequest> {
9
+ constructor(schemaRepository: SchemaRepository);
10
+ }
11
+ export declare class DeleteSharedAttributesForRejectedOrRevokedRelationshipUseCase extends UseCase<DeleteSharedAttributesForRejectedOrRevokedRelationshipRequest, void> {
12
+ private readonly attributesController;
13
+ private readonly relationshipsController;
14
+ private readonly accountController;
15
+ constructor(attributesController: AttributesController, relationshipsController: RelationshipsController, accountController: AccountController, validator: Validator);
16
+ protected executeInternal(request: DeleteSharedAttributesForRejectedOrRevokedRelationshipRequest): Promise<Result<void>>;
17
+ }
18
+ export {};
19
+ //# sourceMappingURL=DeleteSharedAttributesForRejectedOrRevokedRelationship.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DeleteSharedAttributesForRejectedOrRevokedRelationship.d.ts","sourceRoot":"","sources":["../../../../src/useCases/consumption/attributes/DeleteSharedAttributesForRejectedOrRevokedRelationship.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAwB,uBAAuB,EAAsB,MAAM,kBAAkB,CAAC;AAExH,OAAO,EAAE,oBAAoB,EAAiB,gBAAgB,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE/G,MAAM,WAAW,6DAA6D;IAC1E,cAAc,EAAE,oBAAoB,CAAC;CACxC;AAED,cAAM,SAAU,SAAQ,eAAe,CAAC,6DAA6D,CAAC;gBACvE,gBAAgB,EAAE,gBAAgB;CAGhE;AAED,qBAAa,6DAA8D,SAAQ,OAAO,CAAC,6DAA6D,EAAE,IAAI,CAAC;IAE/I,OAAO,CAAC,QAAQ,CAAC,oBAAoB;IACrC,OAAO,CAAC,QAAQ,CAAC,uBAAuB;IACxC,OAAO,CAAC,QAAQ,CAAC,iBAAiB;gBAFjB,oBAAoB,EAAE,oBAAoB,EAC1C,uBAAuB,EAAE,uBAAuB,EAChD,iBAAiB,EAAE,iBAAiB,EACrD,SAAS,EAAE,SAAS;cAKhB,eAAe,CAAC,OAAO,EAAE,6DAA6D,GAAG,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;CAyBjI"}
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ 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;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.DeleteSharedAttributesForRejectedOrRevokedRelationshipUseCase = void 0;
16
+ const ts_utils_1 = require("@js-soft/ts-utils");
17
+ const consumption_1 = require("@nmshd/consumption");
18
+ const transport_1 = require("@nmshd/transport");
19
+ const typescript_ioc_1 = require("typescript-ioc");
20
+ const common_1 = require("../../common");
21
+ let Validator = class Validator extends common_1.SchemaValidator {
22
+ constructor(schemaRepository) {
23
+ super(schemaRepository.getSchema("DeleteSharedAttributesForRejectedOrRevokedRelationshipRequest"));
24
+ }
25
+ };
26
+ Validator = __decorate([
27
+ __param(0, typescript_ioc_1.Inject),
28
+ __metadata("design:paramtypes", [common_1.SchemaRepository])
29
+ ], Validator);
30
+ let DeleteSharedAttributesForRejectedOrRevokedRelationshipUseCase = class DeleteSharedAttributesForRejectedOrRevokedRelationshipUseCase extends common_1.UseCase {
31
+ constructor(attributesController, relationshipsController, accountController, validator) {
32
+ super(validator);
33
+ this.attributesController = attributesController;
34
+ this.relationshipsController = relationshipsController;
35
+ this.accountController = accountController;
36
+ }
37
+ async executeInternal(request) {
38
+ const relationship = await this.relationshipsController.getRelationship(transport_1.CoreId.from(request.relationshipId));
39
+ if (!relationship) {
40
+ return ts_utils_1.Result.fail(common_1.RuntimeErrors.general.recordNotFound(transport_1.Relationship));
41
+ }
42
+ if (!(relationship.status === transport_1.RelationshipStatus.Rejected || relationship.status === transport_1.RelationshipStatus.Revoked)) {
43
+ return ts_utils_1.Result.fail(common_1.RuntimeErrors.relationships.isNeitherRejectedNorRevoked());
44
+ }
45
+ const sharedAttributes = await this.attributesController.getLocalAttributes({ "shareInfo.peer": relationship.peer.address.toString() });
46
+ for (const sharedAttribute of sharedAttributes) {
47
+ const validationResult = await this.attributesController.validateFullAttributeDeletionProcess(sharedAttribute);
48
+ if (validationResult.isError()) {
49
+ return ts_utils_1.Result.fail(validationResult.error);
50
+ }
51
+ await this.attributesController.executeFullAttributeDeletionProcess(sharedAttribute);
52
+ }
53
+ await this.accountController.syncDatawallet();
54
+ return ts_utils_1.Result.ok(undefined);
55
+ }
56
+ };
57
+ exports.DeleteSharedAttributesForRejectedOrRevokedRelationshipUseCase = DeleteSharedAttributesForRejectedOrRevokedRelationshipUseCase;
58
+ exports.DeleteSharedAttributesForRejectedOrRevokedRelationshipUseCase = DeleteSharedAttributesForRejectedOrRevokedRelationshipUseCase = __decorate([
59
+ __param(0, typescript_ioc_1.Inject),
60
+ __param(1, typescript_ioc_1.Inject),
61
+ __param(2, typescript_ioc_1.Inject),
62
+ __param(3, typescript_ioc_1.Inject),
63
+ __metadata("design:paramtypes", [consumption_1.AttributesController,
64
+ transport_1.RelationshipsController,
65
+ transport_1.AccountController,
66
+ Validator])
67
+ ], DeleteSharedAttributesForRejectedOrRevokedRelationshipUseCase);
68
+ //# sourceMappingURL=DeleteSharedAttributesForRejectedOrRevokedRelationship.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DeleteSharedAttributesForRejectedOrRevokedRelationship.js","sourceRoot":"","sources":["../../../../src/useCases/consumption/attributes/DeleteSharedAttributesForRejectedOrRevokedRelationship.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gDAA2C;AAC3C,oDAA0D;AAC1D,gDAAwH;AACxH,mDAAwC;AACxC,yCAA+G;AAM/G,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,wBAA8E;IAClG,YAA2B,gBAAkC;QACzD,KAAK,CAAC,gBAAgB,CAAC,SAAS,CAAC,+DAA+D,CAAC,CAAC,CAAC;IACvG,CAAC;CACJ,CAAA;AAJK,SAAS;IACS,WAAA,uBAAM,CAAA;qCAAmB,yBAAgB;GAD3D,SAAS,CAId;AAED,IAAa,6DAA6D,GAA1E,MAAa,6DAA8D,SAAQ,gBAA4E;IAC3J,YAC6B,oBAA0C,EAC1C,uBAAgD,EAChD,iBAAoC,EACrD,SAAoB;QAE5B,KAAK,CAAC,SAAS,CAAC,CAAC;QALQ,yBAAoB,GAApB,oBAAoB,CAAsB;QAC1C,4BAAuB,GAAvB,uBAAuB,CAAyB;QAChD,sBAAiB,GAAjB,iBAAiB,CAAmB;IAIjE,CAAC;IAES,KAAK,CAAC,eAAe,CAAC,OAAsE;QAClG,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,uBAAuB,CAAC,eAAe,CAAC,kBAAM,CAAC,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC;QAC7G,IAAI,CAAC,YAAY,EAAE,CAAC;YAChB,OAAO,iBAAM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"./CreateRepositoryAttribute";
4
4
  export * from "./DeleteOwnSharedAttributeAndNotifyPeer";
5
5
  export * from "./DeletePeerSharedAttributeAndNotifyOwner";
6
6
  export * from "./DeleteRepositoryAttribute";
7
+ export * from "./DeleteSharedAttributesForRejectedOrRevokedRelationship";
7
8
  export * from "./DeleteThirdPartyOwnedRelationshipAttributeAndNotifyPeer";
8
9
  export * from "./ExecuteIdentityAttributeQuery";
9
10
  export * from "./ExecuteIQLQuery";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/useCases/consumption/attributes/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,uCAAuC,CAAC;AACtD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yCAAyC,CAAC;AACxD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2DAA2D,CAAC;AAC1E,cAAc,iCAAiC,CAAC;AAChD,cAAc,mBAAmB,CAAC;AAClC,cAAc,qCAAqC,CAAC;AACpD,cAAc,+CAA+C,CAAC;AAC9D,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,0CAA0C,CAAC;AACzD,cAAc,0BAA0B,CAAC;AACzC,cAAc,gDAAgD,CAAC;AAC/D,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6CAA6C,CAAC;AAC5D,cAAc,8BAA8B,CAAC;AAC7C,cAAc,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/useCases/consumption/attributes/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,uCAAuC,CAAC;AACtD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yCAAyC,CAAC;AACxD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0DAA0D,CAAC;AACzE,cAAc,2DAA2D,CAAC;AAC1E,cAAc,iCAAiC,CAAC;AAChD,cAAc,mBAAmB,CAAC;AAClC,cAAc,qCAAqC,CAAC;AACpD,cAAc,+CAA+C,CAAC;AAC9D,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,0CAA0C,CAAC;AACzD,cAAc,0BAA0B,CAAC;AACzC,cAAc,gDAAgD,CAAC;AAC/D,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6CAA6C,CAAC;AAC5D,cAAc,8BAA8B,CAAC;AAC7C,cAAc,oBAAoB,CAAC"}
@@ -20,6 +20,7 @@ __exportStar(require("./CreateRepositoryAttribute"), exports);
20
20
  __exportStar(require("./DeleteOwnSharedAttributeAndNotifyPeer"), exports);
21
21
  __exportStar(require("./DeletePeerSharedAttributeAndNotifyOwner"), exports);
22
22
  __exportStar(require("./DeleteRepositoryAttribute"), exports);
23
+ __exportStar(require("./DeleteSharedAttributesForRejectedOrRevokedRelationship"), exports);
23
24
  __exportStar(require("./DeleteThirdPartyOwnedRelationshipAttributeAndNotifyPeer"), exports);
24
25
  __exportStar(require("./ExecuteIdentityAttributeQuery"), exports);
25
26
  __exportStar(require("./ExecuteIQLQuery"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/useCases/consumption/attributes/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAkC;AAClC,wEAAsD;AACtD,8DAA4C;AAC5C,0EAAwD;AACxD,4EAA0D;AAC1D,8DAA4C;AAC5C,4FAA0E;AAC1E,kEAAgD;AAChD,oDAAkC;AAClC,sEAAoD;AACpD,gFAA8D;AAC9D,iDAA+B;AAC/B,kDAAgC;AAChC,2DAAyC;AACzC,4DAA0C;AAC1C,4DAA0C;AAC1C,iEAA+C;AAC/C,2EAAyD;AACzD,2DAAyC;AACzC,iFAA+D;AAC/D,6DAA2C;AAC3C,8EAA4D;AAC5D,+DAA6C;AAC7C,qDAAmC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/useCases/consumption/attributes/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAkC;AAClC,wEAAsD;AACtD,8DAA4C;AAC5C,0EAAwD;AACxD,4EAA0D;AAC1D,8DAA4C;AAC5C,2FAAyE;AACzE,4FAA0E;AAC1E,kEAAgD;AAChD,oDAAkC;AAClC,sEAAoD;AACpD,gFAA8D;AAC9D,iDAA+B;AAC/B,kDAAgC;AAChC,2DAAyC;AACzC,4DAA0C;AAC1C,4DAA0C;AAC1C,iEAA+C;AAC/C,2EAAyD;AACzD,2DAAyC;AACzC,iFAA+D;AAC/D,6DAA2C;AAC3C,8EAA4D;AAC5D,+DAA6C;AAC7C,qDAAmC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nmshd/runtime",
3
- "version": "4.13.2",
3
+ "version": "4.14.0",
4
4
  "description": "The enmeshed client runtime.",
5
5
  "homepage": "https://enmeshed.eu",
6
6
  "repository": {