@nmshd/runtime 2.0.0-alpha.10 → 2.0.0-alpha.13

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 (89) hide show
  1. package/dist/buildInformation.js +5 -5
  2. package/dist/dataViews/DataViewExpander.d.ts +15 -21
  3. package/dist/dataViews/DataViewExpander.js +160 -207
  4. package/dist/dataViews/DataViewExpander.js.map +1 -1
  5. package/dist/dataViews/DataViewObject.d.ts +1 -1
  6. package/dist/dataViews/consumption/ConsumptionAttributeDVO.d.ts +65 -0
  7. package/dist/dataViews/{content/AttributeDVO.js → consumption/ConsumptionAttributeDVO.js} +1 -1
  8. package/dist/dataViews/consumption/ConsumptionAttributeDVO.js.map +1 -0
  9. package/dist/dataViews/consumption/ConsumptionRequestDVO.d.ts +26 -0
  10. package/dist/dataViews/consumption/{StoredAttributeDVO.js → ConsumptionRequestDVO.js} +1 -1
  11. package/dist/dataViews/consumption/ConsumptionRequestDVO.js.map +1 -0
  12. package/dist/dataViews/consumption/index.d.ts +2 -1
  13. package/dist/dataViews/consumption/index.js +2 -1
  14. package/dist/dataViews/consumption/index.js.map +1 -1
  15. package/dist/dataViews/content/RequestDVOs.d.ts +14 -18
  16. package/dist/dataViews/content/index.d.ts +0 -1
  17. package/dist/dataViews/content/index.js +0 -1
  18. package/dist/dataViews/content/index.js.map +1 -1
  19. package/dist/extensibility/facades/consumption/AttributesFacade.d.ts +4 -10
  20. package/dist/extensibility/facades/consumption/AttributesFacade.js +6 -24
  21. package/dist/extensibility/facades/consumption/AttributesFacade.js.map +1 -1
  22. package/dist/types/consumption/ConsumptionAttributeDTO.d.ts +6 -2
  23. package/dist/useCases/common/Schemas.d.ts +1 -4
  24. package/dist/useCases/common/Schemas.js +427 -96
  25. package/dist/useCases/common/Schemas.js.map +1 -1
  26. package/dist/useCases/consumption/attributes/AttributeMapper.d.ts +0 -2
  27. package/dist/useCases/consumption/attributes/AttributeMapper.js +6 -9
  28. package/dist/useCases/consumption/attributes/AttributeMapper.js.map +1 -1
  29. package/dist/useCases/consumption/attributes/CreateAttribute.d.ts +6 -6
  30. package/dist/useCases/consumption/attributes/CreateAttribute.js +13 -9
  31. package/dist/useCases/consumption/attributes/CreateAttribute.js.map +1 -1
  32. package/dist/useCases/consumption/attributes/CreateShareAttributeCopy.d.ts +29 -0
  33. package/dist/useCases/consumption/attributes/{DeleteAttributeByName.js → CreateShareAttributeCopy.js} +23 -18
  34. package/dist/useCases/consumption/attributes/CreateShareAttributeCopy.js.map +1 -0
  35. package/dist/useCases/consumption/attributes/DeleteAttribute.d.ts +7 -4
  36. package/dist/useCases/consumption/attributes/DeleteAttribute.js +10 -7
  37. package/dist/useCases/consumption/attributes/DeleteAttribute.js.map +1 -1
  38. package/dist/useCases/consumption/attributes/ExtendedAttributeValue.d.ts +10 -0
  39. package/dist/{dataViews/consumption/MatchedAttributesDVO.js → useCases/consumption/attributes/ExtendedAttributeValue.js} +1 -1
  40. package/dist/useCases/consumption/attributes/ExtendedAttributeValue.js.map +1 -0
  41. package/dist/useCases/consumption/attributes/GetAllValid.js +1 -1
  42. package/dist/useCases/consumption/attributes/GetAllValid.js.map +1 -1
  43. package/dist/useCases/consumption/attributes/GetAttribute.d.ts +7 -4
  44. package/dist/useCases/consumption/attributes/GetAttribute.js +10 -7
  45. package/dist/useCases/consumption/attributes/GetAttribute.js.map +1 -1
  46. package/dist/useCases/consumption/attributes/GetAttributes.d.ts +29 -6
  47. package/dist/useCases/consumption/attributes/GetAttributes.js +108 -12
  48. package/dist/useCases/consumption/attributes/GetAttributes.js.map +1 -1
  49. package/dist/useCases/consumption/attributes/SucceedAttribute.d.ts +10 -7
  50. package/dist/useCases/consumption/attributes/SucceedAttribute.js +14 -10
  51. package/dist/useCases/consumption/attributes/SucceedAttribute.js.map +1 -1
  52. package/dist/useCases/consumption/attributes/UpdateAttribute.d.ts +9 -6
  53. package/dist/useCases/consumption/attributes/UpdateAttribute.js +14 -15
  54. package/dist/useCases/consumption/attributes/UpdateAttribute.js.map +1 -1
  55. package/dist/useCases/consumption/attributes/index.d.ts +1 -4
  56. package/dist/useCases/consumption/attributes/index.js +1 -4
  57. package/dist/useCases/consumption/attributes/index.js.map +1 -1
  58. package/dist/useCases/consumption/requests/CompleteIncomingRequest.d.ts +1 -1
  59. package/dist/useCases/consumption/requests/RequestValidationResultMapper.js +2 -2
  60. package/dist/useCases/consumption/requests/RequestValidationResultMapper.js.map +1 -1
  61. package/dist/useCases/transport/challenges/{ValidateChallange.d.ts → ValidateChallenge.d.ts} +0 -0
  62. package/dist/useCases/transport/challenges/{ValidateChallange.js → ValidateChallenge.js} +1 -1
  63. package/dist/useCases/transport/challenges/{ValidateChallange.js.map → ValidateChallenge.js.map} +1 -1
  64. package/dist/useCases/transport/challenges/index.d.ts +1 -1
  65. package/dist/useCases/transport/challenges/index.js +1 -1
  66. package/dist/useCases/transport/messages/GetMessages.js +0 -1
  67. package/dist/useCases/transport/messages/GetMessages.js.map +1 -1
  68. package/lib-web/nmshd.runtime.js +853 -646
  69. package/lib-web/nmshd.runtime.js.map +1 -1
  70. package/lib-web/nmshd.runtime.min.js +3 -3
  71. package/lib-web/nmshd.runtime.min.js.map +1 -1
  72. package/package.json +7 -7
  73. package/dist/dataViews/consumption/MatchedAttributesDVO.d.ts +0 -8
  74. package/dist/dataViews/consumption/MatchedAttributesDVO.js.map +0 -1
  75. package/dist/dataViews/consumption/StoredAttributeDVO.d.ts +0 -6
  76. package/dist/dataViews/consumption/StoredAttributeDVO.js.map +0 -1
  77. package/dist/dataViews/content/AttributeDVO.d.ts +0 -14
  78. package/dist/dataViews/content/AttributeDVO.js.map +0 -1
  79. package/dist/useCases/consumption/attributes/DeleteAttributeByName.d.ts +0 -17
  80. package/dist/useCases/consumption/attributes/DeleteAttributeByName.js.map +0 -1
  81. package/dist/useCases/consumption/attributes/GetAttributeByName.d.ts +0 -16
  82. package/dist/useCases/consumption/attributes/GetAttributeByName.js +0 -47
  83. package/dist/useCases/consumption/attributes/GetAttributeByName.js.map +0 -1
  84. package/dist/useCases/consumption/attributes/GetAttributesByNames.d.ts +0 -16
  85. package/dist/useCases/consumption/attributes/GetAttributesByNames.js +0 -42
  86. package/dist/useCases/consumption/attributes/GetAttributesByNames.js.map +0 -1
  87. package/dist/useCases/consumption/attributes/GetHistoryByName.d.ts +0 -16
  88. package/dist/useCases/consumption/attributes/GetHistoryByName.js +0 -47
  89. package/dist/useCases/consumption/attributes/GetHistoryByName.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nmshd/runtime",
3
- "version": "2.0.0-alpha.10",
3
+ "version": "2.0.0-alpha.13",
4
4
  "description": "The Enmeshed client runtime.",
5
5
  "homepage": "https://enmeshed.eu",
6
6
  "license": "MIT",
@@ -55,8 +55,8 @@
55
55
  "@js-soft/logging-abstractions": "1.0.0",
56
56
  "@js-soft/ts-serval": "2.0.3",
57
57
  "@js-soft/ts-utils": "^1.1.2",
58
- "@nmshd/consumption": "2.0.0-alpha.12",
59
- "@nmshd/content": "2.0.0-alpha.14",
58
+ "@nmshd/consumption": "2.0.0-alpha.19",
59
+ "@nmshd/content": "2.0.0-alpha.25",
60
60
  "@nmshd/crypto": "2.0.1",
61
61
  "@nmshd/transport": "2.0.0-alpha.1",
62
62
  "ajv": "^8.11.0",
@@ -81,18 +81,18 @@
81
81
  "@types/jest-expect-message": "^1.0.3",
82
82
  "@types/json-stringify-safe": "^5.0.0",
83
83
  "@types/luxon": "^2.3.2",
84
- "@types/node": "^17.0.34",
84
+ "@types/node": "^17.0.36",
85
85
  "@types/qrcode": "^1.4.2",
86
86
  "@types/qs": "^6.9.7",
87
- "eslint": "^8.15.0",
87
+ "eslint": "^8.16.0",
88
88
  "jest": "^28.1.0",
89
89
  "madge": "^5.0.1",
90
90
  "nodemon": "^2.0.16",
91
91
  "prettier": "^2.6.2",
92
- "ts-jest": "^28.0.2",
92
+ "ts-jest": "^28.0.3",
93
93
  "ts-json-schema-generator": "^1.0.0",
94
94
  "tsconfig-paths": "^4.0.0",
95
- "typescript": "^4.6.4",
95
+ "typescript": "^4.7.2",
96
96
  "webpack": "^5.72.1",
97
97
  "webpack-cli": "^4.9.2"
98
98
  },
@@ -1,8 +0,0 @@
1
- import { DataViewObject } from "../DataViewObject";
2
- import { StoredAttributeDVO } from "./StoredAttributeDVO";
3
- export interface MatchedAttributesDVO extends DataViewObject {
4
- type: "MatchedAttributesDVO";
5
- matches: StoredAttributeDVO[];
6
- matchCount: number;
7
- bestMatch?: StoredAttributeDVO;
8
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"MatchedAttributesDVO.js","sourceRoot":"","sources":["../../../src/dataViews/consumption/MatchedAttributesDVO.ts"],"names":[],"mappings":""}
@@ -1,6 +0,0 @@
1
- import { AttributeDVO } from "../content/AttributeDVO";
2
- export interface StoredAttributeDVO extends Omit<AttributeDVO, "type"> {
3
- type: "StoredAttributeDVO";
4
- sharedItems: string[];
5
- sharedItemCount: number;
6
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"StoredAttributeDVO.js","sourceRoot":"","sources":["../../../src/dataViews/consumption/StoredAttributeDVO.ts"],"names":[],"mappings":""}
@@ -1,14 +0,0 @@
1
- import { DataViewObject } from "../DataViewObject";
2
- export interface AttributeMetadata {
3
- key?: string;
4
- tags?: string[];
5
- validFrom?: string;
6
- validTo?: string;
7
- label?: string;
8
- dataType?: string;
9
- }
10
- export interface AttributeDVO extends DataViewObject {
11
- type: "AttributeDVO";
12
- value?: any;
13
- isOwn: boolean;
14
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"AttributeDVO.js","sourceRoot":"","sources":["../../../src/dataViews/content/AttributeDVO.ts"],"names":[],"mappings":""}
@@ -1,17 +0,0 @@
1
- import { Result } from "@js-soft/ts-utils";
2
- import { ConsumptionAttributesController } from "@nmshd/consumption";
3
- import { AccountController } from "@nmshd/transport";
4
- import { RuntimeValidator, UseCase } from "../../common";
5
- export interface DeleteAttributeByNameRequest {
6
- name: string;
7
- }
8
- declare class DeleteAttributeByNameRequestValidator extends RuntimeValidator<DeleteAttributeByNameRequest> {
9
- constructor();
10
- }
11
- export declare class DeleteAttributeByNameUseCase extends UseCase<DeleteAttributeByNameRequest, void> {
12
- private readonly attributeController;
13
- private readonly accountController;
14
- constructor(attributeController: ConsumptionAttributesController, accountController: AccountController, validator: DeleteAttributeByNameRequestValidator);
15
- protected executeInternal(request: DeleteAttributeByNameRequest): Promise<Result<void>>;
16
- }
17
- export {};
@@ -1 +0,0 @@
1
- {"version":3,"file":"DeleteAttributeByName.js","sourceRoot":"","sources":["../../../../src/useCases/consumption/attributes/DeleteAttributeByName.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gDAA2C;AAC3C,oDAA2F;AAC3F,gDAAqD;AACrD,mDAAwC;AACxC,yCAAwE;AAMxE,MAAM,qCAAsC,SAAQ,yBAA8C;IAC9F;QACI,KAAK,EAAE,CAAC;QAER,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,CAAC;IACrD,CAAC;CACJ;AAED,IAAa,4BAA4B,GAAzC,MAAa,4BAA6B,SAAQ,gBAA2C;IACzF,YAC6B,mBAAoD,EACpD,iBAAoC,EACrD,SAAgD;QAExD,KAAK,CAAC,SAAS,CAAC,CAAC;QAJQ,wBAAmB,GAAnB,mBAAmB,CAAiC;QACpD,sBAAiB,GAAjB,iBAAiB,CAAmB;IAIjE,CAAC;IAES,KAAK,CAAC,eAAe,CAAC,OAAqC;QACjE,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC,kBAAkB,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAClF,IAAI,CAAC,SAAS,EAAE;YACZ,OAAO,iBAAM,CAAC,IAAI,CAAC,sBAAa,CAAC,OAAO,CAAC,cAAc,CAAC,kCAAoB,CAAC,CAAC,CAAC;SAClF;QAED,MAAM,IAAI,CAAC,mBAAmB,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;QAC1D,MAAM,IAAI,CAAC,iBAAiB,CAAC,cAAc,EAAE,CAAC;QAE9C,OAAO,iBAAM,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC;IAChC,CAAC;CACJ,CAAA;AApBY,4BAA4B;IAEhC,WAAA,uBAAM,CAAA;IACN,WAAA,uBAAM,CAAA;IACN,WAAA,uBAAM,CAAA;qCAFuC,6CAA+B;QACjC,6BAAiB;QAC1C,qCAAqC;GAJnD,4BAA4B,CAoBxC;AApBY,oEAA4B"}
@@ -1,16 +0,0 @@
1
- import { Result } from "@js-soft/ts-utils";
2
- import { ConsumptionAttributesController } from "@nmshd/consumption";
3
- import { ConsumptionAttributeDTO } from "../../../types";
4
- import { RuntimeValidator, UseCase } from "../../common";
5
- export interface GetAttributeByNameRequest {
6
- name: string;
7
- }
8
- declare class GetAttributeByNameRequestValidator extends RuntimeValidator<GetAttributeByNameRequest> {
9
- constructor();
10
- }
11
- export declare class GetAttributeByNameUseCase extends UseCase<GetAttributeByNameRequest, ConsumptionAttributeDTO> {
12
- private readonly attributeController;
13
- constructor(attributeController: ConsumptionAttributesController, validator: GetAttributeByNameRequestValidator);
14
- protected executeInternal(request: GetAttributeByNameRequest): Promise<Result<ConsumptionAttributeDTO>>;
15
- }
16
- export {};
@@ -1,47 +0,0 @@
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.GetAttributeByNameUseCase = void 0;
16
- const ts_utils_1 = require("@js-soft/ts-utils");
17
- const consumption_1 = require("@nmshd/consumption");
18
- const content_1 = require("@nmshd/content");
19
- const typescript_ioc_1 = require("typescript-ioc");
20
- const common_1 = require("../../common");
21
- const AttributeMapper_1 = require("./AttributeMapper");
22
- class GetAttributeByNameRequestValidator extends common_1.RuntimeValidator {
23
- constructor() {
24
- super();
25
- this.validateIfString((d) => d.name).isNotEmpty();
26
- }
27
- }
28
- let GetAttributeByNameUseCase = class GetAttributeByNameUseCase extends common_1.UseCase {
29
- constructor(attributeController, validator) {
30
- super(validator);
31
- this.attributeController = attributeController;
32
- }
33
- async executeInternal(request) {
34
- const attribute = await this.attributeController.getAttributeByName(request.name);
35
- if (!attribute) {
36
- return ts_utils_1.Result.fail(common_1.RuntimeErrors.general.recordNotFound(content_1.Attribute));
37
- }
38
- return ts_utils_1.Result.ok(AttributeMapper_1.AttributeMapper.toAttributeDTO(attribute));
39
- }
40
- };
41
- GetAttributeByNameUseCase = __decorate([
42
- __param(0, typescript_ioc_1.Inject),
43
- __param(1, typescript_ioc_1.Inject),
44
- __metadata("design:paramtypes", [consumption_1.ConsumptionAttributesController, GetAttributeByNameRequestValidator])
45
- ], GetAttributeByNameUseCase);
46
- exports.GetAttributeByNameUseCase = GetAttributeByNameUseCase;
47
- //# sourceMappingURL=GetAttributeByName.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"GetAttributeByName.js","sourceRoot":"","sources":["../../../../src/useCases/consumption/attributes/GetAttributeByName.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gDAA2C;AAC3C,oDAAqE;AACrE,4CAA2C;AAC3C,mDAAwC;AAExC,yCAAwE;AACxE,uDAAoD;AAMpD,MAAM,kCAAmC,SAAQ,yBAA2C;IACxF;QACI,KAAK,EAAE,CAAC;QAER,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,CAAC;IACtD,CAAC;CACJ;AAED,IAAa,yBAAyB,GAAtC,MAAa,yBAA0B,SAAQ,gBAA2D;IACtG,YAA4C,mBAAoD,EAAU,SAA6C;QACnJ,KAAK,CAAC,SAAS,CAAC,CAAC;QADuB,wBAAmB,GAAnB,mBAAmB,CAAiC;IAEhG,CAAC;IAES,KAAK,CAAC,eAAe,CAAC,OAAkC;QAC9D,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC,kBAAkB,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAClF,IAAI,CAAC,SAAS,EAAE;YACZ,OAAO,iBAAM,CAAC,IAAI,CAAC,sBAAa,CAAC,OAAO,CAAC,cAAc,CAAC,mBAAS,CAAC,CAAC,CAAC;SACvE;QAED,OAAO,iBAAM,CAAC,EAAE,CAAC,iCAAe,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC,CAAC;IAChE,CAAC;CACJ,CAAA;AAbY,yBAAyB;IACd,WAAA,uBAAM,CAAA;IAAyE,WAAA,uBAAM,CAAA;qCAAxC,6CAA+B,EAAqB,kCAAkC;GAD9I,yBAAyB,CAarC;AAbY,8DAAyB"}
@@ -1,16 +0,0 @@
1
- import { Result } from "@js-soft/ts-utils";
2
- import { ConsumptionAttributesController } from "@nmshd/consumption";
3
- import { ConsumptionAttributeDTO } from "../../../types";
4
- import { RuntimeValidator, UseCase } from "../../common";
5
- export interface GetAttributesByNamesRequest {
6
- }
7
- declare class GetAttributesByNamesRequestValidator extends RuntimeValidator<GetAttributesByNamesRequest> {
8
- constructor();
9
- }
10
- export declare type GetAttributesByNamesResponse = Record<string, ConsumptionAttributeDTO>;
11
- export declare class GetAttributesByNamesUseCase extends UseCase<GetAttributesByNamesRequest, GetAttributesByNamesResponse> {
12
- private readonly attributeController;
13
- constructor(attributeController: ConsumptionAttributesController, validator: GetAttributesByNamesRequestValidator);
14
- protected executeInternal(_request: GetAttributesByNamesRequest): Promise<Result<GetAttributesByNamesResponse>>;
15
- }
16
- export {};
@@ -1,42 +0,0 @@
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.GetAttributesByNamesUseCase = void 0;
16
- const ts_utils_1 = require("@js-soft/ts-utils");
17
- const consumption_1 = require("@nmshd/consumption");
18
- const typescript_ioc_1 = require("typescript-ioc");
19
- const common_1 = require("../../common");
20
- const AttributeMapper_1 = require("./AttributeMapper");
21
- class GetAttributesByNamesRequestValidator extends common_1.RuntimeValidator {
22
- constructor() {
23
- super();
24
- }
25
- }
26
- let GetAttributesByNamesUseCase = class GetAttributesByNamesUseCase extends common_1.UseCase {
27
- constructor(attributeController, validator) {
28
- super(validator);
29
- this.attributeController = attributeController;
30
- }
31
- async executeInternal(_request) {
32
- const attributes = await this.attributeController.getAttributesByName();
33
- return ts_utils_1.Result.ok(AttributeMapper_1.AttributeMapper.toGetAttributesByNamesResponse(attributes));
34
- }
35
- };
36
- GetAttributesByNamesUseCase = __decorate([
37
- __param(0, typescript_ioc_1.Inject),
38
- __param(1, typescript_ioc_1.Inject),
39
- __metadata("design:paramtypes", [consumption_1.ConsumptionAttributesController, GetAttributesByNamesRequestValidator])
40
- ], GetAttributesByNamesUseCase);
41
- exports.GetAttributesByNamesUseCase = GetAttributesByNamesUseCase;
42
- //# sourceMappingURL=GetAttributesByNames.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"GetAttributesByNames.js","sourceRoot":"","sources":["../../../../src/useCases/consumption/attributes/GetAttributesByNames.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gDAA2C;AAC3C,oDAAqE;AACrE,mDAAwC;AAExC,yCAAyD;AACzD,uDAAoD;AAIpD,MAAM,oCAAqC,SAAQ,yBAA6C;IAC5F;QACI,KAAK,EAAE,CAAC;IACZ,CAAC;CACJ;AAID,IAAa,2BAA2B,GAAxC,MAAa,2BAA4B,SAAQ,gBAAkE;IAC/G,YAA4C,mBAAoD,EAAU,SAA+C;QACrJ,KAAK,CAAC,SAAS,CAAC,CAAC;QADuB,wBAAmB,GAAnB,mBAAmB,CAAiC;IAEhG,CAAC;IAES,KAAK,CAAC,eAAe,CAAC,QAAqC;QACjE,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC,mBAAmB,EAAE,CAAC;QACxE,OAAO,iBAAM,CAAC,EAAE,CAAC,iCAAe,CAAC,8BAA8B,CAAC,UAAU,CAAC,CAAC,CAAC;IACjF,CAAC;CACJ,CAAA;AATY,2BAA2B;IAChB,WAAA,uBAAM,CAAA;IAAyE,WAAA,uBAAM,CAAA;qCAAxC,6CAA+B,EAAqB,oCAAoC;GADhJ,2BAA2B,CASvC;AATY,kEAA2B"}
@@ -1,16 +0,0 @@
1
- import { Result } from "@js-soft/ts-utils";
2
- import { ConsumptionAttributesController } from "@nmshd/consumption";
3
- import { ConsumptionAttributeDTO } from "../../../types";
4
- import { RuntimeValidator, UseCase } from "../../common";
5
- export interface GetHistoryByNameRequest {
6
- name: string;
7
- }
8
- declare class GetHistoryByNameRequestValidator extends RuntimeValidator<GetHistoryByNameRequest> {
9
- constructor();
10
- }
11
- export declare class GetHistoryByNameUseCase extends UseCase<GetHistoryByNameRequest, ConsumptionAttributeDTO[]> {
12
- private readonly attributeController;
13
- constructor(attributeController: ConsumptionAttributesController, validator: GetHistoryByNameRequestValidator);
14
- protected executeInternal(request: GetHistoryByNameRequest): Promise<Result<ConsumptionAttributeDTO[]>>;
15
- }
16
- export {};
@@ -1,47 +0,0 @@
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.GetHistoryByNameUseCase = void 0;
16
- const ts_utils_1 = require("@js-soft/ts-utils");
17
- const consumption_1 = require("@nmshd/consumption");
18
- const content_1 = require("@nmshd/content");
19
- const typescript_ioc_1 = require("typescript-ioc");
20
- const common_1 = require("../../common");
21
- const AttributeMapper_1 = require("./AttributeMapper");
22
- class GetHistoryByNameRequestValidator extends common_1.RuntimeValidator {
23
- constructor() {
24
- super();
25
- this.validateIfString((x) => x.name).isDefined();
26
- }
27
- }
28
- let GetHistoryByNameUseCase = class GetHistoryByNameUseCase extends common_1.UseCase {
29
- constructor(attributeController, validator) {
30
- super(validator);
31
- this.attributeController = attributeController;
32
- }
33
- async executeInternal(request) {
34
- const attributes = await this.attributeController.getAttributeHistoryByName(request.name);
35
- if (attributes.length === 0) {
36
- return ts_utils_1.Result.fail(common_1.RuntimeErrors.general.recordNotFound(content_1.Attribute));
37
- }
38
- return ts_utils_1.Result.ok(AttributeMapper_1.AttributeMapper.toAttributeDTOList(attributes));
39
- }
40
- };
41
- GetHistoryByNameUseCase = __decorate([
42
- __param(0, typescript_ioc_1.Inject),
43
- __param(1, typescript_ioc_1.Inject),
44
- __metadata("design:paramtypes", [consumption_1.ConsumptionAttributesController, GetHistoryByNameRequestValidator])
45
- ], GetHistoryByNameUseCase);
46
- exports.GetHistoryByNameUseCase = GetHistoryByNameUseCase;
47
- //# sourceMappingURL=GetHistoryByName.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"GetHistoryByName.js","sourceRoot":"","sources":["../../../../src/useCases/consumption/attributes/GetHistoryByName.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gDAA2C;AAC3C,oDAAqE;AACrE,4CAA2C;AAC3C,mDAAwC;AAExC,yCAAwE;AACxE,uDAAoD;AAMpD,MAAM,gCAAiC,SAAQ,yBAAyC;IACpF;QACI,KAAK,EAAE,CAAC;QAER,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,CAAC;IACrD,CAAC;CACJ;AAED,IAAa,uBAAuB,GAApC,MAAa,uBAAwB,SAAQ,gBAA2D;IACpG,YAA4C,mBAAoD,EAAU,SAA2C;QACjJ,KAAK,CAAC,SAAS,CAAC,CAAC;QADuB,wBAAmB,GAAnB,mBAAmB,CAAiC;IAEhG,CAAC;IAES,KAAK,CAAC,eAAe,CAAC,OAAgC;QAC5D,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC,yBAAyB,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAC1F,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE;YACzB,OAAO,iBAAM,CAAC,IAAI,CAAC,sBAAa,CAAC,OAAO,CAAC,cAAc,CAAC,mBAAS,CAAC,CAAC,CAAC;SACvE;QACD,OAAO,iBAAM,CAAC,EAAE,CAAC,iCAAe,CAAC,kBAAkB,CAAC,UAAU,CAAC,CAAC,CAAC;IACrE,CAAC;CACJ,CAAA;AAZY,uBAAuB;IACZ,WAAA,uBAAM,CAAA;IAAyE,WAAA,uBAAM,CAAA;qCAAxC,6CAA+B,EAAqB,gCAAgC;GAD5I,uBAAuB,CAYnC;AAZY,0DAAuB"}