@nmshd/runtime 2.0.0-alpha.2 → 2.0.0-alpha.5
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.
- package/dist/Runtime.js +0 -6
- package/dist/Runtime.js.map +1 -1
- package/dist/buildInformation.js +5 -5
- package/dist/dataViews/DataViewExpander.js +24 -19
- package/dist/dataViews/DataViewExpander.js.map +1 -1
- package/dist/events/index.d.ts +1 -0
- package/dist/events/index.js +1 -0
- package/dist/events/index.js.map +1 -1
- package/dist/events/transport/PeerRelationshipTemplateLoadedEvent.d.ts +6 -0
- package/dist/events/transport/PeerRelationshipTemplateLoadedEvent.js +12 -0
- package/dist/events/transport/PeerRelationshipTemplateLoadedEvent.js.map +1 -0
- package/dist/extensibility/ConsumptionServices.d.ts +2 -4
- package/dist/extensibility/ConsumptionServices.js +1 -7
- package/dist/extensibility/ConsumptionServices.js.map +1 -1
- package/dist/extensibility/facades/consumption/index.d.ts +0 -2
- package/dist/extensibility/facades/consumption/index.js +0 -2
- package/dist/extensibility/facades/consumption/index.js.map +1 -1
- package/dist/useCases/common/Schemas.d.ts +0 -15
- package/dist/useCases/common/Schemas.js +35 -510
- package/dist/useCases/common/Schemas.js.map +1 -1
- package/dist/useCases/common/index.d.ts +0 -1
- package/dist/useCases/common/index.js +0 -1
- package/dist/useCases/common/index.js.map +1 -1
- package/dist/useCases/consumption/index.d.ts +0 -2
- package/dist/useCases/consumption/index.js +0 -2
- package/dist/useCases/consumption/index.js.map +1 -1
- package/dist/useCases/consumption/requests/CheckPrerequisitesOfIncomingRequest.d.ts +1 -1
- package/dist/useCases/consumption/requests/CompleteIncomingRequest.d.ts +1 -1
- package/dist/useCases/consumption/requests/CompleteOutgoingRequest.d.ts +1 -1
- package/dist/useCases/consumption/requests/GetIncomingRequest.d.ts +1 -1
- package/dist/useCases/consumption/requests/GetOutgoingRequest.d.ts +1 -1
- package/dist/useCases/consumption/requests/RequireManualDecisionOfIncomingRequest.d.ts +1 -1
- package/dist/useCases/consumption/requests/SentOutgoingRequest.d.ts +1 -1
- package/dist/useCases/transport/relationshipTemplates/LoadPeerRelationshipTemplate.d.ts +3 -2
- package/dist/useCases/transport/relationshipTemplates/LoadPeerRelationshipTemplate.js +13 -5
- package/dist/useCases/transport/relationshipTemplates/LoadPeerRelationshipTemplate.js.map +1 -1
- package/lib-web/nmshd.runtime.js +156 -1942
- package/lib-web/nmshd.runtime.js.map +1 -1
- package/lib-web/nmshd.runtime.min.js +3 -3
- package/lib-web/nmshd.runtime.min.js.map +1 -1
- package/package.json +13 -13
- package/dist/extensibility/facades/consumption/RelationshipInfoFacade.d.ts +0 -18
- package/dist/extensibility/facades/consumption/RelationshipInfoFacade.js +0 -61
- package/dist/extensibility/facades/consumption/RelationshipInfoFacade.js.map +0 -1
- package/dist/extensibility/facades/consumption/SharedItemsFacade.d.ts +0 -24
- package/dist/extensibility/facades/consumption/SharedItemsFacade.js +0 -79
- package/dist/extensibility/facades/consumption/SharedItemsFacade.js.map +0 -1
- package/dist/useCases/common/validation/RelationshipAttributeDTOValidator.d.ts +0 -6
- package/dist/useCases/common/validation/RelationshipAttributeDTOValidator.js +0 -16
- package/dist/useCases/common/validation/RelationshipAttributeDTOValidator.js.map +0 -1
- package/dist/useCases/consumption/relationshipInfo/CreateRelationshipInfo.d.ts +0 -26
- package/dist/useCases/consumption/relationshipInfo/CreateRelationshipInfo.js +0 -75
- package/dist/useCases/consumption/relationshipInfo/CreateRelationshipInfo.js.map +0 -1
- package/dist/useCases/consumption/relationshipInfo/DeleteRelationshipInfo.d.ts +0 -18
- package/dist/useCases/consumption/relationshipInfo/DeleteRelationshipInfo.js +0 -54
- package/dist/useCases/consumption/relationshipInfo/DeleteRelationshipInfo.js.map +0 -1
- package/dist/useCases/consumption/relationshipInfo/DeleteRelationshipInfoByRelationship.d.ts +0 -18
- package/dist/useCases/consumption/relationshipInfo/DeleteRelationshipInfoByRelationship.js +0 -54
- package/dist/useCases/consumption/relationshipInfo/DeleteRelationshipInfoByRelationship.js.map +0 -1
- package/dist/useCases/consumption/relationshipInfo/GetRelationshipInfo.d.ts +0 -17
- package/dist/useCases/consumption/relationshipInfo/GetRelationshipInfo.js +0 -50
- package/dist/useCases/consumption/relationshipInfo/GetRelationshipInfo.js.map +0 -1
- package/dist/useCases/consumption/relationshipInfo/GetRelationshipInfoByRelationship.d.ts +0 -17
- package/dist/useCases/consumption/relationshipInfo/GetRelationshipInfoByRelationship.js +0 -49
- package/dist/useCases/consumption/relationshipInfo/GetRelationshipInfoByRelationship.js.map +0 -1
- package/dist/useCases/consumption/relationshipInfo/RelationshipAttributeMapper.d.ts +0 -6
- package/dist/useCases/consumption/relationshipInfo/RelationshipAttributeMapper.js +0 -17
- package/dist/useCases/consumption/relationshipInfo/RelationshipAttributeMapper.js.map +0 -1
- package/dist/useCases/consumption/relationshipInfo/RelationshipInfoMapper.d.ts +0 -6
- package/dist/useCases/consumption/relationshipInfo/RelationshipInfoMapper.js +0 -25
- package/dist/useCases/consumption/relationshipInfo/RelationshipInfoMapper.js.map +0 -1
- package/dist/useCases/consumption/relationshipInfo/RelationshipThemeMapper.d.ts +0 -6
- package/dist/useCases/consumption/relationshipInfo/RelationshipThemeMapper.js +0 -18
- package/dist/useCases/consumption/relationshipInfo/RelationshipThemeMapper.js.map +0 -1
- package/dist/useCases/consumption/relationshipInfo/UpdateRelationshipInfo.d.ts +0 -31
- package/dist/useCases/consumption/relationshipInfo/UpdateRelationshipInfo.js +0 -71
- package/dist/useCases/consumption/relationshipInfo/UpdateRelationshipInfo.js.map +0 -1
- package/dist/useCases/consumption/relationshipInfo/index.d.ts +0 -6
- package/dist/useCases/consumption/relationshipInfo/index.js +0 -23
- package/dist/useCases/consumption/relationshipInfo/index.js.map +0 -1
- package/dist/useCases/consumption/sharedItems/CreateSharedItem.d.ts +0 -26
- package/dist/useCases/consumption/sharedItems/CreateSharedItem.js +0 -71
- package/dist/useCases/consumption/sharedItems/CreateSharedItem.js.map +0 -1
- package/dist/useCases/consumption/sharedItems/DeleteSharedItem.d.ts +0 -17
- package/dist/useCases/consumption/sharedItems/DeleteSharedItem.js +0 -53
- package/dist/useCases/consumption/sharedItems/DeleteSharedItem.js.map +0 -1
- package/dist/useCases/consumption/sharedItems/GetSharedItem.d.ts +0 -16
- package/dist/useCases/consumption/sharedItems/GetSharedItem.js +0 -47
- package/dist/useCases/consumption/sharedItems/GetSharedItem.js.map +0 -1
- package/dist/useCases/consumption/sharedItems/GetSharedItems.d.ts +0 -13
- package/dist/useCases/consumption/sharedItems/GetSharedItems.js +0 -59
- package/dist/useCases/consumption/sharedItems/GetSharedItems.js.map +0 -1
- package/dist/useCases/consumption/sharedItems/GetSharedItemsByAddress.d.ts +0 -16
- package/dist/useCases/consumption/sharedItems/GetSharedItemsByAddress.js +0 -46
- package/dist/useCases/consumption/sharedItems/GetSharedItemsByAddress.js.map +0 -1
- package/dist/useCases/consumption/sharedItems/GetSharedItemsByReference.d.ts +0 -16
- package/dist/useCases/consumption/sharedItems/GetSharedItemsByReference.js +0 -47
- package/dist/useCases/consumption/sharedItems/GetSharedItemsByReference.js.map +0 -1
- package/dist/useCases/consumption/sharedItems/GetSharedItemsSharedByAddress.d.ts +0 -16
- package/dist/useCases/consumption/sharedItems/GetSharedItemsSharedByAddress.js +0 -46
- package/dist/useCases/consumption/sharedItems/GetSharedItemsSharedByAddress.js.map +0 -1
- package/dist/useCases/consumption/sharedItems/GetSharedItemsSharedWithAddress.d.ts +0 -16
- package/dist/useCases/consumption/sharedItems/GetSharedItemsSharedWithAddress.js +0 -46
- package/dist/useCases/consumption/sharedItems/GetSharedItemsSharedWithAddress.js.map +0 -1
- package/dist/useCases/consumption/sharedItems/SharedItemsMapper.d.ts +0 -6
- package/dist/useCases/consumption/sharedItems/SharedItemsMapper.js +0 -24
- package/dist/useCases/consumption/sharedItems/SharedItemsMapper.js.map +0 -1
- package/dist/useCases/consumption/sharedItems/UpdateSharedItem.d.ts +0 -19
- package/dist/useCases/consumption/sharedItems/UpdateSharedItem.js +0 -57
- package/dist/useCases/consumption/sharedItems/UpdateSharedItem.js.map +0 -1
- package/dist/useCases/consumption/sharedItems/index.d.ts +0 -10
- package/dist/useCases/consumption/sharedItems/index.js +0 -27
- package/dist/useCases/consumption/sharedItems/index.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GetRelationshipInfo.js","sourceRoot":"","sources":["../../../../src/useCases/consumption/relationshipInfo/GetRelationshipInfo.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gDAA2C;AAC3C,oDAAkG;AAClG,gDAA0C;AAC1C,6DAAwD;AACxD,mDAAwC;AAExC,yCAA2C;AAC3C,8DAA2D;AAC3D,kDAA+C;AAC/C,qEAAkE;AAMlE,MAAM,mCAAoC,SAAQ,uCAA6C;IAC3F;QACI,KAAK,EAAE,CAAC;QAER,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,oBAAW,CAAC,QAAQ,CAAC,4BAAc,CAAC,gBAAgB,CAAC,CAAC,CAAC;IACpG,CAAC;CACJ;AAED,IAAa,0BAA0B,GAAvC,MAAa,0BAA2B,SAAQ,iBAAwD;IACpG,YAA4C,0BAAsD,EAAU,SAA8C;QACtJ,KAAK,CAAC,SAAS,CAAC,CAAC;QADuB,+BAA0B,GAA1B,0BAA0B,CAA4B;IAElG,CAAC;IAES,KAAK,CAAC,eAAe,CAAC,OAAmC;QAC/D,MAAM,gBAAgB,GAAG,MAAM,IAAI,CAAC,0BAA0B,CAAC,mBAAmB,CAAC,kBAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC;QAC5G,IAAI,CAAC,gBAAgB,EAAE;YACnB,OAAO,iBAAM,CAAC,IAAI,CAAC,6BAAa,CAAC,OAAO,CAAC,cAAc,CAAC,8BAAgB,CAAC,CAAC,CAAC;SAC9E;QACD,OAAO,iBAAM,CAAC,EAAE,CAAC,+CAAsB,CAAC,qBAAqB,CAAC,gBAAgB,CAAC,CAAC,CAAC;IACrF,CAAC;CACJ,CAAA;AAZY,0BAA0B;IACf,WAAA,uBAAM,CAAA;IAA2E,WAAA,uBAAM,CAAA;qCAAnC,wCAA0B,EAAqB,mCAAmC;GADjJ,0BAA0B,CAYtC;AAZY,gEAA0B"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Result } from "@js-soft/ts-utils";
|
|
2
|
-
import { RelationshipInfoController } from "@nmshd/consumption";
|
|
3
|
-
import { RelationshipInfoDTO } from "../../../types";
|
|
4
|
-
import { RuntimeValidator } from "../../common";
|
|
5
|
-
import { UseCase } from "../../common/UseCase";
|
|
6
|
-
export interface GetRelationshipInfoByRelationshipRequest {
|
|
7
|
-
relationshipId: string;
|
|
8
|
-
}
|
|
9
|
-
declare class GetRelationshipInfoRequestValidator extends RuntimeValidator<GetRelationshipInfoByRelationshipRequest> {
|
|
10
|
-
constructor();
|
|
11
|
-
}
|
|
12
|
-
export declare class GetRelationshipInfoByRelationshipUseCase extends UseCase<GetRelationshipInfoByRelationshipRequest, RelationshipInfoDTO> {
|
|
13
|
-
private readonly relationshipInfoController;
|
|
14
|
-
constructor(relationshipInfoController: RelationshipInfoController, validator: GetRelationshipInfoRequestValidator);
|
|
15
|
-
protected executeInternal(request: GetRelationshipInfoByRelationshipRequest): Promise<Result<RelationshipInfoDTO>>;
|
|
16
|
-
}
|
|
17
|
-
export {};
|
|
@@ -1,49 +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.GetRelationshipInfoByRelationshipUseCase = 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
|
-
const RuntimeErrors_1 = require("../../common/RuntimeErrors");
|
|
22
|
-
const UseCase_1 = require("../../common/UseCase");
|
|
23
|
-
const RelationshipInfoMapper_1 = require("./RelationshipInfoMapper");
|
|
24
|
-
class GetRelationshipInfoRequestValidator extends common_1.RuntimeValidator {
|
|
25
|
-
constructor() {
|
|
26
|
-
super();
|
|
27
|
-
this.validateIfAny((x) => x.relationshipId).fulfills(common_1.IdValidator.required(transport_1.BackboneIds.relationship));
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
let GetRelationshipInfoByRelationshipUseCase = class GetRelationshipInfoByRelationshipUseCase extends UseCase_1.UseCase {
|
|
31
|
-
constructor(relationshipInfoController, validator) {
|
|
32
|
-
super(validator);
|
|
33
|
-
this.relationshipInfoController = relationshipInfoController;
|
|
34
|
-
}
|
|
35
|
-
async executeInternal(request) {
|
|
36
|
-
const relationshipInfo = await this.relationshipInfoController.getRelationshipInfoByRelationship(transport_1.CoreId.from(request.relationshipId));
|
|
37
|
-
if (!relationshipInfo) {
|
|
38
|
-
return ts_utils_1.Result.fail(RuntimeErrors_1.RuntimeErrors.general.recordNotFound(consumption_1.RelationshipInfo));
|
|
39
|
-
}
|
|
40
|
-
return ts_utils_1.Result.ok(RelationshipInfoMapper_1.RelationshipInfoMapper.toRelationshipInfoDTO(relationshipInfo));
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
GetRelationshipInfoByRelationshipUseCase = __decorate([
|
|
44
|
-
__param(0, typescript_ioc_1.Inject),
|
|
45
|
-
__param(1, typescript_ioc_1.Inject),
|
|
46
|
-
__metadata("design:paramtypes", [consumption_1.RelationshipInfoController, GetRelationshipInfoRequestValidator])
|
|
47
|
-
], GetRelationshipInfoByRelationshipUseCase);
|
|
48
|
-
exports.GetRelationshipInfoByRelationshipUseCase = GetRelationshipInfoByRelationshipUseCase;
|
|
49
|
-
//# sourceMappingURL=GetRelationshipInfoByRelationship.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GetRelationshipInfoByRelationship.js","sourceRoot":"","sources":["../../../../src/useCases/consumption/relationshipInfo/GetRelationshipInfoByRelationship.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gDAA2C;AAC3C,oDAAkF;AAClF,gDAAuD;AACvD,mDAAwC;AAExC,yCAA6D;AAC7D,8DAA2D;AAC3D,kDAA+C;AAC/C,qEAAkE;AAMlE,MAAM,mCAAoC,SAAQ,yBAA0D;IACxG;QACI,KAAK,EAAE,CAAC;QAER,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,QAAQ,CAAC,oBAAW,CAAC,QAAQ,CAAC,uBAAW,CAAC,YAAY,CAAC,CAAC,CAAC;IACzG,CAAC;CACJ;AAED,IAAa,wCAAwC,GAArD,MAAa,wCAAyC,SAAQ,iBAAsE;IAChI,YAA4C,0BAAsD,EAAU,SAA8C;QACtJ,KAAK,CAAC,SAAS,CAAC,CAAC;QADuB,+BAA0B,GAA1B,0BAA0B,CAA4B;IAElG,CAAC;IAES,KAAK,CAAC,eAAe,CAAC,OAAiD;QAC7E,MAAM,gBAAgB,GAAG,MAAM,IAAI,CAAC,0BAA0B,CAAC,iCAAiC,CAAC,kBAAM,CAAC,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC;QACtI,IAAI,CAAC,gBAAgB,EAAE;YACnB,OAAO,iBAAM,CAAC,IAAI,CAAC,6BAAa,CAAC,OAAO,CAAC,cAAc,CAAC,8BAAgB,CAAC,CAAC,CAAC;SAC9E;QACD,OAAO,iBAAM,CAAC,EAAE,CAAC,+CAAsB,CAAC,qBAAqB,CAAC,gBAAgB,CAAC,CAAC,CAAC;IACrF,CAAC;CACJ,CAAA;AAZY,wCAAwC;IAC7B,WAAA,uBAAM,CAAA;IAA2E,WAAA,uBAAM,CAAA;qCAAnC,wCAA0B,EAAqB,mCAAmC;GADjJ,wCAAwC,CAYpD;AAZY,4FAAwC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { RelationshipAttribute } from "@nmshd/consumption";
|
|
2
|
-
import { RelationshipAttributeDTO } from "../../../types";
|
|
3
|
-
export declare class RelationshipAttributeMapper {
|
|
4
|
-
static toRelationshipAttributeDTO(relationshipAttribute: RelationshipAttribute): RelationshipAttributeDTO;
|
|
5
|
-
static toRelationshipAttributeDTOList(relationshipAttributes: RelationshipAttribute[]): RelationshipAttributeDTO[];
|
|
6
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RelationshipAttributeMapper = void 0;
|
|
4
|
-
class RelationshipAttributeMapper {
|
|
5
|
-
static toRelationshipAttributeDTO(relationshipAttribute) {
|
|
6
|
-
return {
|
|
7
|
-
name: relationshipAttribute.name,
|
|
8
|
-
content: relationshipAttribute.content.toJSON(),
|
|
9
|
-
sharedItem: relationshipAttribute.sharedItem.toString()
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
static toRelationshipAttributeDTOList(relationshipAttributes) {
|
|
13
|
-
return relationshipAttributes.map((elem) => this.toRelationshipAttributeDTO(elem));
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
exports.RelationshipAttributeMapper = RelationshipAttributeMapper;
|
|
17
|
-
//# sourceMappingURL=RelationshipAttributeMapper.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RelationshipAttributeMapper.js","sourceRoot":"","sources":["../../../../src/useCases/consumption/relationshipInfo/RelationshipAttributeMapper.ts"],"names":[],"mappings":";;;AAIA,MAAa,2BAA2B;IAC7B,MAAM,CAAC,0BAA0B,CAAC,qBAA4C;QACjF,OAAO;YACH,IAAI,EAAE,qBAAqB,CAAC,IAAI;YAChC,OAAO,EAAE,qBAAqB,CAAC,OAAO,CAAC,MAAM,EAAmB;YAChE,UAAU,EAAE,qBAAqB,CAAC,UAAU,CAAC,QAAQ,EAAE;SAC1D,CAAC;IACN,CAAC;IAEM,MAAM,CAAC,8BAA8B,CAAC,sBAA+C;QACxF,OAAO,sBAAsB,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,0BAA0B,CAAC,IAAI,CAAC,CAAC,CAAC;IACvF,CAAC;CACJ;AAZD,kEAYC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { RelationshipInfo } from "@nmshd/consumption";
|
|
2
|
-
import { RelationshipInfoDTO } from "../../../types";
|
|
3
|
-
export declare class RelationshipInfoMapper {
|
|
4
|
-
static toRelationshipInfoDTO(relationshipInfo: RelationshipInfo): RelationshipInfoDTO;
|
|
5
|
-
static toRelationshipInfoDTOList(relationshipInfoList: RelationshipInfo[]): RelationshipInfoDTO[];
|
|
6
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RelationshipInfoMapper = void 0;
|
|
4
|
-
const RelationshipAttributeMapper_1 = require("./RelationshipAttributeMapper");
|
|
5
|
-
const RelationshipThemeMapper_1 = require("./RelationshipThemeMapper");
|
|
6
|
-
class RelationshipInfoMapper {
|
|
7
|
-
static toRelationshipInfoDTO(relationshipInfo) {
|
|
8
|
-
return {
|
|
9
|
-
id: relationshipInfo.id.toString(),
|
|
10
|
-
relationshipId: relationshipInfo.relationshipId.toString(),
|
|
11
|
-
attributes: RelationshipAttributeMapper_1.RelationshipAttributeMapper.toRelationshipAttributeDTOList(relationshipInfo.attributes),
|
|
12
|
-
isPinned: relationshipInfo.isPinned,
|
|
13
|
-
title: relationshipInfo.title,
|
|
14
|
-
description: relationshipInfo.description,
|
|
15
|
-
userTitle: relationshipInfo.userTitle,
|
|
16
|
-
userDescription: relationshipInfo.userDescription,
|
|
17
|
-
theme: relationshipInfo.theme ? RelationshipThemeMapper_1.RelationshipThemeMapper.toRelationshipThemeDTO(relationshipInfo.theme) : undefined
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
static toRelationshipInfoDTOList(relationshipInfoList) {
|
|
21
|
-
return relationshipInfoList.map((elem) => this.toRelationshipInfoDTO(elem));
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
exports.RelationshipInfoMapper = RelationshipInfoMapper;
|
|
25
|
-
//# sourceMappingURL=RelationshipInfoMapper.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RelationshipInfoMapper.js","sourceRoot":"","sources":["../../../../src/useCases/consumption/relationshipInfo/RelationshipInfoMapper.ts"],"names":[],"mappings":";;;AAEA,+EAA4E;AAC5E,uEAAoE;AAEpE,MAAa,sBAAsB;IACxB,MAAM,CAAC,qBAAqB,CAAC,gBAAkC;QAClE,OAAO;YACH,EAAE,EAAE,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE;YAClC,cAAc,EAAE,gBAAgB,CAAC,cAAc,CAAC,QAAQ,EAAE;YAC1D,UAAU,EAAE,yDAA2B,CAAC,8BAA8B,CAAC,gBAAgB,CAAC,UAAU,CAAC;YACnG,QAAQ,EAAE,gBAAgB,CAAC,QAAQ;YACnC,KAAK,EAAE,gBAAgB,CAAC,KAAK;YAC7B,WAAW,EAAE,gBAAgB,CAAC,WAAW;YACzC,SAAS,EAAE,gBAAgB,CAAC,SAAS;YACrC,eAAe,EAAE,gBAAgB,CAAC,eAAe;YACjD,KAAK,EAAE,gBAAgB,CAAC,KAAK,CAAC,CAAC,CAAC,iDAAuB,CAAC,sBAAsB,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS;SACrH,CAAC;IACN,CAAC;IAEM,MAAM,CAAC,yBAAyB,CAAC,oBAAwC;QAC5E,OAAO,oBAAoB,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC,CAAC;IAChF,CAAC;CACJ;AAlBD,wDAkBC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { RelationshipTheme } from "@nmshd/consumption";
|
|
2
|
-
import { RelationshipThemeDTO } from "../../../types";
|
|
3
|
-
export declare class RelationshipThemeMapper {
|
|
4
|
-
static toRelationshipThemeDTO(relationshipTheme: RelationshipTheme): RelationshipThemeDTO;
|
|
5
|
-
static toRelationshipThemeDTOList(relationshipThemes: RelationshipTheme[]): RelationshipThemeDTO[];
|
|
6
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RelationshipThemeMapper = void 0;
|
|
4
|
-
class RelationshipThemeMapper {
|
|
5
|
-
static toRelationshipThemeDTO(relationshipTheme) {
|
|
6
|
-
return {
|
|
7
|
-
image: relationshipTheme.image,
|
|
8
|
-
imageBar: relationshipTheme.imageBar,
|
|
9
|
-
backgroundColor: relationshipTheme.backgroundColor,
|
|
10
|
-
foregroundColor: relationshipTheme.foregroundColor
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
static toRelationshipThemeDTOList(relationshipThemes) {
|
|
14
|
-
return relationshipThemes.map((elem) => this.toRelationshipThemeDTO(elem));
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
exports.RelationshipThemeMapper = RelationshipThemeMapper;
|
|
18
|
-
//# sourceMappingURL=RelationshipThemeMapper.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RelationshipThemeMapper.js","sourceRoot":"","sources":["../../../../src/useCases/consumption/relationshipInfo/RelationshipThemeMapper.ts"],"names":[],"mappings":";;;AAGA,MAAa,uBAAuB;IACzB,MAAM,CAAC,sBAAsB,CAAC,iBAAoC;QACrE,OAAO;YACH,KAAK,EAAE,iBAAiB,CAAC,KAAK;YAC9B,QAAQ,EAAE,iBAAiB,CAAC,QAAQ;YACpC,eAAe,EAAE,iBAAiB,CAAC,eAAe;YAClD,eAAe,EAAE,iBAAiB,CAAC,eAAe;SACrD,CAAC;IACN,CAAC;IAEM,MAAM,CAAC,0BAA0B,CAAC,kBAAuC;QAC5E,OAAO,kBAAkB,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,CAAC,CAAC;IAC/E,CAAC;CACJ;AAbD,0DAaC"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { Result } from "@js-soft/ts-utils";
|
|
2
|
-
import { RelationshipInfoController } from "@nmshd/consumption";
|
|
3
|
-
import { AccountController } from "@nmshd/transport";
|
|
4
|
-
import { RelationshipAttributeDTO, RelationshipInfoDTO, RelationshipThemeDTO } from "../../../types";
|
|
5
|
-
import { RuntimeValidator } from "../../common";
|
|
6
|
-
import { UseCase } from "../../common/UseCase";
|
|
7
|
-
/**
|
|
8
|
-
* Overwrite a RelationshipInfo's attributes with the request's corresponding
|
|
9
|
-
* fields. Undefined fields in the request will leave the corresponding
|
|
10
|
-
* RelationshipInfo's attributes untouched.
|
|
11
|
-
*/
|
|
12
|
-
export interface UpdateRelationshipInfoRequest {
|
|
13
|
-
id: string;
|
|
14
|
-
attributes?: RelationshipAttributeDTO[];
|
|
15
|
-
isPinned?: boolean;
|
|
16
|
-
title?: string;
|
|
17
|
-
description?: string;
|
|
18
|
-
userTitle?: string;
|
|
19
|
-
userDescription?: string;
|
|
20
|
-
theme?: RelationshipThemeDTO;
|
|
21
|
-
}
|
|
22
|
-
declare class UpdateRelationshipInfoRequestValidator extends RuntimeValidator<UpdateRelationshipInfoRequest> {
|
|
23
|
-
constructor();
|
|
24
|
-
}
|
|
25
|
-
export declare class UpdateRelationshipInfoUseCase extends UseCase<UpdateRelationshipInfoRequest, RelationshipInfoDTO> {
|
|
26
|
-
private readonly relationshipInfoController;
|
|
27
|
-
private readonly accountController;
|
|
28
|
-
constructor(relationshipInfoController: RelationshipInfoController, accountController: AccountController, validator: UpdateRelationshipInfoRequestValidator);
|
|
29
|
-
protected executeInternal(request: UpdateRelationshipInfoRequest): Promise<Result<RelationshipInfoDTO>>;
|
|
30
|
-
}
|
|
31
|
-
export {};
|
|
@@ -1,71 +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.UpdateRelationshipInfoUseCase = 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
|
-
const RuntimeErrors_1 = require("../../common/RuntimeErrors");
|
|
22
|
-
const UseCase_1 = require("../../common/UseCase");
|
|
23
|
-
const RelationshipInfoMapper_1 = require("./RelationshipInfoMapper");
|
|
24
|
-
class UpdateRelationshipInfoRequestValidator extends common_1.RuntimeValidator {
|
|
25
|
-
constructor() {
|
|
26
|
-
super();
|
|
27
|
-
this.validateIfAny((x) => x.id).fulfills(common_1.IdValidator.required(consumption_1.ConsumptionIds.relationshipInfo));
|
|
28
|
-
this.validateIfEachAny((x) => x.attributes).fulfills(common_1.RelationshipAttributeDTOValidator.required());
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
let UpdateRelationshipInfoUseCase = class UpdateRelationshipInfoUseCase extends UseCase_1.UseCase {
|
|
32
|
-
constructor(relationshipInfoController, accountController, validator) {
|
|
33
|
-
super(validator);
|
|
34
|
-
this.relationshipInfoController = relationshipInfoController;
|
|
35
|
-
this.accountController = accountController;
|
|
36
|
-
}
|
|
37
|
-
async executeInternal(request) {
|
|
38
|
-
const relationshipInfo = await this.relationshipInfoController.getRelationshipInfo(transport_1.CoreId.from(request.id));
|
|
39
|
-
if (!relationshipInfo) {
|
|
40
|
-
return ts_utils_1.Result.fail(RuntimeErrors_1.RuntimeErrors.general.recordNotFound(consumption_1.RelationshipInfo));
|
|
41
|
-
}
|
|
42
|
-
if (request.attributes !== undefined) {
|
|
43
|
-
relationshipInfo.attributes = await Promise.all(request.attributes.map((a) => {
|
|
44
|
-
return consumption_1.RelationshipAttribute.from({
|
|
45
|
-
name: a.name,
|
|
46
|
-
content: a.content,
|
|
47
|
-
sharedItem: transport_1.CoreId.from(a.sharedItem)
|
|
48
|
-
});
|
|
49
|
-
}));
|
|
50
|
-
}
|
|
51
|
-
relationshipInfo.isPinned = request.isPinned === undefined ? relationshipInfo.isPinned : request.isPinned;
|
|
52
|
-
relationshipInfo.title = request.title === undefined ? relationshipInfo.title : request.title;
|
|
53
|
-
relationshipInfo.description = request.description === undefined ? relationshipInfo.description : request.description;
|
|
54
|
-
relationshipInfo.userTitle = request.userTitle === undefined ? relationshipInfo.userTitle : request.userTitle;
|
|
55
|
-
relationshipInfo.userDescription = request.userDescription === undefined ? relationshipInfo.userDescription : request.userDescription;
|
|
56
|
-
relationshipInfo.theme = request.theme === undefined ? relationshipInfo.theme : consumption_1.RelationshipTheme.from(request.theme);
|
|
57
|
-
await this.relationshipInfoController.updateRelationshipInfo(relationshipInfo);
|
|
58
|
-
await this.accountController.syncDatawallet();
|
|
59
|
-
return ts_utils_1.Result.ok(RelationshipInfoMapper_1.RelationshipInfoMapper.toRelationshipInfoDTO(relationshipInfo));
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
UpdateRelationshipInfoUseCase = __decorate([
|
|
63
|
-
__param(0, typescript_ioc_1.Inject),
|
|
64
|
-
__param(1, typescript_ioc_1.Inject),
|
|
65
|
-
__param(2, typescript_ioc_1.Inject),
|
|
66
|
-
__metadata("design:paramtypes", [consumption_1.RelationshipInfoController,
|
|
67
|
-
transport_1.AccountController,
|
|
68
|
-
UpdateRelationshipInfoRequestValidator])
|
|
69
|
-
], UpdateRelationshipInfoUseCase);
|
|
70
|
-
exports.UpdateRelationshipInfoUseCase = UpdateRelationshipInfoUseCase;
|
|
71
|
-
//# sourceMappingURL=UpdateRelationshipInfo.js.map
|
|
@@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AAC,+BAAiB,CAAC,IAAI,CAAC,OAAO,CAAC,KAA2B,CAAC,CAAC;QAE5I,MAAM,IAAI,CAAC,0BAA0B,CAAC,sBAAsB,CAAC,gBAAgB,CAAC,CAAC;QAC/E,MAAM,IAAI,CAAC,iBAAiB,CAAC,cAAc,EAAE,CAAC;QAC9C,OAAO,iBAAM,CAAC,EAAE,CAAC,+CAAsB,CAAC,qBAAqB,CAAC,gBAAgB,CAAC,CAAC,CAAC;IACrF,CAAC;CACJ,CAAA;AArCY,6BAA6B;IAEjC,WAAA,uBAAM,CAAA;IACN,WAAA,uBAAM,CAAA;IACN,WAAA,uBAAM,CAAA;qCAF8C,wCAA0B;QACnC,6BAAiB;QAC1C,sCAAsC;GAJpD,6BAA6B,CAqCzC;AArCY,sEAA6B"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export * from "./CreateRelationshipInfo";
|
|
2
|
-
export * from "./DeleteRelationshipInfo";
|
|
3
|
-
export * from "./DeleteRelationshipInfoByRelationship";
|
|
4
|
-
export * from "./GetRelationshipInfo";
|
|
5
|
-
export * from "./GetRelationshipInfoByRelationship";
|
|
6
|
-
export * from "./UpdateRelationshipInfo";
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./CreateRelationshipInfo"), exports);
|
|
18
|
-
__exportStar(require("./DeleteRelationshipInfo"), exports);
|
|
19
|
-
__exportStar(require("./DeleteRelationshipInfoByRelationship"), exports);
|
|
20
|
-
__exportStar(require("./GetRelationshipInfo"), exports);
|
|
21
|
-
__exportStar(require("./GetRelationshipInfoByRelationship"), exports);
|
|
22
|
-
__exportStar(require("./UpdateRelationshipInfo"), exports);
|
|
23
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/useCases/consumption/relationshipInfo/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2DAAyC;AACzC,2DAAyC;AACzC,yEAAuD;AACvD,wDAAsC;AACtC,sEAAoD;AACpD,2DAAyC"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { Result } from "@js-soft/ts-utils";
|
|
2
|
-
import { SharedItemsController } from "@nmshd/consumption";
|
|
3
|
-
import { AccountController } from "@nmshd/transport";
|
|
4
|
-
import { SharedItemDTO } from "../../../types";
|
|
5
|
-
import { RuntimeValidator, UseCase } from "../../common";
|
|
6
|
-
export interface CreateSharedItemRequest {
|
|
7
|
-
tags?: string[];
|
|
8
|
-
sharedBy: string;
|
|
9
|
-
sharedWith: string;
|
|
10
|
-
sharedAt: string;
|
|
11
|
-
reference?: string;
|
|
12
|
-
content: any;
|
|
13
|
-
succeedsItem?: string;
|
|
14
|
-
succeedsAt?: string;
|
|
15
|
-
expiresAt?: string;
|
|
16
|
-
}
|
|
17
|
-
declare class CreateSharedItemRequestValidator extends RuntimeValidator<CreateSharedItemRequest> {
|
|
18
|
-
constructor();
|
|
19
|
-
}
|
|
20
|
-
export declare class CreateSharedItemUseCase extends UseCase<CreateSharedItemRequest, SharedItemDTO> {
|
|
21
|
-
private readonly sharedItemsController;
|
|
22
|
-
private readonly accountController;
|
|
23
|
-
constructor(sharedItemsController: SharedItemsController, accountController: AccountController, validator: CreateSharedItemRequestValidator);
|
|
24
|
-
protected executeInternal(request: CreateSharedItemRequest): Promise<Result<SharedItemDTO>>;
|
|
25
|
-
}
|
|
26
|
-
export {};
|
|
@@ -1,71 +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.CreateSharedItemUseCase = 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
|
-
const SharedItemsMapper_1 = require("./SharedItemsMapper");
|
|
22
|
-
class CreateSharedItemRequestValidator extends common_1.RuntimeValidator {
|
|
23
|
-
constructor() {
|
|
24
|
-
super();
|
|
25
|
-
this.validateIfEachString((x) => x.tags)
|
|
26
|
-
.isDefined()
|
|
27
|
-
.whenDefined();
|
|
28
|
-
this.validateIfString((x) => x.sharedBy).fulfills(common_1.AddressValidator.required());
|
|
29
|
-
this.validateIfString((x) => x.sharedWith).fulfills(common_1.AddressValidator.required());
|
|
30
|
-
this.validateIfString((x) => x.sharedAt).fulfills(common_1.DateValidator.required());
|
|
31
|
-
this.validateIfString((x) => x.reference).fulfills(common_1.IdValidator.optional(transport_1.TransportIds.generic));
|
|
32
|
-
this.validateIfString((x) => x.content).isDefined();
|
|
33
|
-
this.validateIfString((x) => x.succeedsItem).fulfills(common_1.IdValidator.optional(consumption_1.ConsumptionIds.sharedItem));
|
|
34
|
-
this.validateIfString((x) => x.succeedsAt).fulfills(common_1.DateValidator.optional());
|
|
35
|
-
this.validateIfString((x) => x.expiresAt).fulfills(common_1.DateValidator.optional());
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
let CreateSharedItemUseCase = class CreateSharedItemUseCase extends common_1.UseCase {
|
|
39
|
-
constructor(sharedItemsController, accountController, validator) {
|
|
40
|
-
super(validator);
|
|
41
|
-
this.sharedItemsController = sharedItemsController;
|
|
42
|
-
this.accountController = accountController;
|
|
43
|
-
}
|
|
44
|
-
async executeInternal(request) {
|
|
45
|
-
const sharedItem = consumption_1.SharedItem.from({
|
|
46
|
-
id: await consumption_1.ConsumptionIds.sharedItem.generate(),
|
|
47
|
-
tags: request.tags,
|
|
48
|
-
sharedBy: transport_1.CoreAddress.from(request.sharedBy),
|
|
49
|
-
sharedWith: transport_1.CoreAddress.from(request.sharedWith),
|
|
50
|
-
sharedAt: transport_1.CoreDate.from(request.sharedAt),
|
|
51
|
-
reference: request.reference ? transport_1.CoreId.from(request.reference) : undefined,
|
|
52
|
-
content: request.content,
|
|
53
|
-
succeedsItem: request.succeedsItem ? transport_1.CoreId.from(request.succeedsItem) : undefined,
|
|
54
|
-
succeedsAt: request.succeedsAt ? transport_1.CoreDate.from(request.succeedsAt) : undefined,
|
|
55
|
-
expiresAt: request.expiresAt ? transport_1.CoreDate.from(request.expiresAt) : undefined
|
|
56
|
-
});
|
|
57
|
-
await this.sharedItemsController.createSharedItem(sharedItem);
|
|
58
|
-
await this.accountController.syncDatawallet();
|
|
59
|
-
return ts_utils_1.Result.ok(SharedItemsMapper_1.SharedItemsMapper.toSharedItemDTO(sharedItem));
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
CreateSharedItemUseCase = __decorate([
|
|
63
|
-
__param(0, typescript_ioc_1.Inject),
|
|
64
|
-
__param(1, typescript_ioc_1.Inject),
|
|
65
|
-
__param(2, typescript_ioc_1.Inject),
|
|
66
|
-
__metadata("design:paramtypes", [consumption_1.SharedItemsController,
|
|
67
|
-
transport_1.AccountController,
|
|
68
|
-
CreateSharedItemRequestValidator])
|
|
69
|
-
], CreateSharedItemUseCase);
|
|
70
|
-
exports.CreateSharedItemUseCase = CreateSharedItemUseCase;
|
|
71
|
-
//# sourceMappingURL=CreateSharedItem.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CreateSharedItem.js","sourceRoot":"","sources":["../../../../src/useCases/consumption/sharedItems/CreateSharedItem.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gDAA2C;AAC3C,oDAAuF;AACvF,gDAAkG;AAClG,mDAAwC;AAExC,yCAAuG;AACvG,2DAAwD;AAcxD,MAAM,gCAAiC,SAAQ,yBAAyC;IACpF;QACI,KAAK,EAAE,CAAC;QAER,IAAI,CAAC,oBAAoB,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;aACnC,SAAS,EAAE;aACX,WAAW,EAAE,CAAC;QAEnB,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,yBAAgB,CAAC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,CAAC,UAAU,CAAC,CAAC,CAAC;IACpE,CAAC;CACJ,CAAA;AA5BY,uBAAuB;IAE3B,WAAA,uBAAM,CAAA;IACN,WAAA,uBAAM,CAAA;IACN,WAAA,uBAAM,CAAA;qCAFyC,mCAAqB;QACzB,6BAAiB;QAC1C,gCAAgC;GAJ9C,uBAAuB,CA4BnC;AA5BY,0DAAuB"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Result } from "@js-soft/ts-utils";
|
|
2
|
-
import { SharedItemsController } from "@nmshd/consumption";
|
|
3
|
-
import { AccountController } from "@nmshd/transport";
|
|
4
|
-
import { RuntimeValidator, UseCase } from "../../common";
|
|
5
|
-
export interface DeleteSharedItemRequest {
|
|
6
|
-
id: string;
|
|
7
|
-
}
|
|
8
|
-
declare class DeleteSharedItemRequestValidator extends RuntimeValidator<DeleteSharedItemRequest> {
|
|
9
|
-
constructor();
|
|
10
|
-
}
|
|
11
|
-
export declare class DeleteSharedItemUseCase extends UseCase<DeleteSharedItemRequest, void> {
|
|
12
|
-
private readonly sharedItemsController;
|
|
13
|
-
private readonly accountController;
|
|
14
|
-
constructor(sharedItemsController: SharedItemsController, accountController: AccountController, validator: DeleteSharedItemRequestValidator);
|
|
15
|
-
protected executeInternal(request: DeleteSharedItemRequest): Promise<Result<void>>;
|
|
16
|
-
}
|
|
17
|
-
export {};
|
|
@@ -1,53 +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.DeleteSharedItemUseCase = 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 __1 = require("../..");
|
|
21
|
-
const common_1 = require("../../common");
|
|
22
|
-
class DeleteSharedItemRequestValidator extends common_1.RuntimeValidator {
|
|
23
|
-
constructor() {
|
|
24
|
-
super();
|
|
25
|
-
this.validateIfString((x) => x.id).fulfills(common_1.IdValidator.required(consumption_1.ConsumptionIds.sharedItem));
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
let DeleteSharedItemUseCase = class DeleteSharedItemUseCase extends common_1.UseCase {
|
|
29
|
-
constructor(sharedItemsController, accountController, validator) {
|
|
30
|
-
super(validator);
|
|
31
|
-
this.sharedItemsController = sharedItemsController;
|
|
32
|
-
this.accountController = accountController;
|
|
33
|
-
}
|
|
34
|
-
async executeInternal(request) {
|
|
35
|
-
const sharedItem = await this.sharedItemsController.getSharedItem(transport_1.CoreId.from(request.id));
|
|
36
|
-
if (!sharedItem) {
|
|
37
|
-
return ts_utils_1.Result.fail(__1.RuntimeErrors.general.recordNotFound(consumption_1.SharedItem));
|
|
38
|
-
}
|
|
39
|
-
await this.sharedItemsController.deleteSharedItem(sharedItem);
|
|
40
|
-
await this.accountController.syncDatawallet();
|
|
41
|
-
return ts_utils_1.Result.ok(undefined);
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
DeleteSharedItemUseCase = __decorate([
|
|
45
|
-
__param(0, typescript_ioc_1.Inject),
|
|
46
|
-
__param(1, typescript_ioc_1.Inject),
|
|
47
|
-
__param(2, typescript_ioc_1.Inject),
|
|
48
|
-
__metadata("design:paramtypes", [consumption_1.SharedItemsController,
|
|
49
|
-
transport_1.AccountController,
|
|
50
|
-
DeleteSharedItemRequestValidator])
|
|
51
|
-
], DeleteSharedItemUseCase);
|
|
52
|
-
exports.DeleteSharedItemUseCase = DeleteSharedItemUseCase;
|
|
53
|
-
//# sourceMappingURL=DeleteSharedItem.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DeleteSharedItem.js","sourceRoot":"","sources":["../../../../src/useCases/consumption/sharedItems/DeleteSharedItem.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gDAA2C;AAC3C,oDAAuF;AACvF,gDAA6D;AAC7D,mDAAwC;AACxC,6BAAsC;AACtC,yCAAsE;AAMtE,MAAM,gCAAiC,SAAQ,yBAAyC;IACpF;QACI,KAAK,EAAE,CAAC;QAER,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,oBAAW,CAAC,QAAQ,CAAC,4BAAc,CAAC,UAAU,CAAC,CAAC,CAAC;IACjG,CAAC;CACJ;AAED,IAAa,uBAAuB,GAApC,MAAa,uBAAwB,SAAQ,gBAAsC;IAC/E,YAC6B,qBAA4C,EAC5C,iBAAoC,EACrD,SAA2C;QAEnD,KAAK,CAAC,SAAS,CAAC,CAAC;QAJQ,0BAAqB,GAArB,qBAAqB,CAAuB;QAC5C,sBAAiB,GAAjB,iBAAiB,CAAmB;IAIjE,CAAC;IAES,KAAK,CAAC,eAAe,CAAC,OAAgC;QAC5D,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,qBAAqB,CAAC,aAAa,CAAC,kBAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC;QAC3F,IAAI,CAAC,UAAU,EAAE;YACb,OAAO,iBAAM,CAAC,IAAI,CAAC,iBAAa,CAAC,OAAO,CAAC,cAAc,CAAC,wBAAU,CAAC,CAAC,CAAC;SACxE;QAED,MAAM,IAAI,CAAC,qBAAqB,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC;QAC9D,MAAM,IAAI,CAAC,iBAAiB,CAAC,cAAc,EAAE,CAAC;QAE9C,OAAO,iBAAM,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC;IAChC,CAAC;CACJ,CAAA;AApBY,uBAAuB;IAE3B,WAAA,uBAAM,CAAA;IACN,WAAA,uBAAM,CAAA;IACN,WAAA,uBAAM,CAAA;qCAFyC,mCAAqB;QACzB,6BAAiB;QAC1C,gCAAgC;GAJ9C,uBAAuB,CAoBnC;AApBY,0DAAuB"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Result } from "@js-soft/ts-utils";
|
|
2
|
-
import { SharedItemsController } from "@nmshd/consumption";
|
|
3
|
-
import { SharedItemDTO } from "../../../types";
|
|
4
|
-
import { RuntimeValidator, UseCase } from "../../common";
|
|
5
|
-
export interface GetSharedItemRequest {
|
|
6
|
-
id: string;
|
|
7
|
-
}
|
|
8
|
-
declare class GetSharedItemRequestValidator extends RuntimeValidator<GetSharedItemRequest> {
|
|
9
|
-
constructor();
|
|
10
|
-
}
|
|
11
|
-
export declare class GetSharedItemUseCase extends UseCase<GetSharedItemRequest, SharedItemDTO> {
|
|
12
|
-
private readonly sharedItemsController;
|
|
13
|
-
constructor(sharedItemsController: SharedItemsController, validator: GetSharedItemRequestValidator);
|
|
14
|
-
protected executeInternal(request: GetSharedItemRequest): Promise<Result<SharedItemDTO>>;
|
|
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.GetSharedItemUseCase = 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
|
-
const SharedItemsMapper_1 = require("./SharedItemsMapper");
|
|
22
|
-
class GetSharedItemRequestValidator extends common_1.RuntimeValidator {
|
|
23
|
-
constructor() {
|
|
24
|
-
super();
|
|
25
|
-
this.validateIfString((x) => x.id).fulfills(common_1.IdValidator.required(consumption_1.ConsumptionIds.sharedItem));
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
let GetSharedItemUseCase = class GetSharedItemUseCase extends common_1.UseCase {
|
|
29
|
-
constructor(sharedItemsController, validator) {
|
|
30
|
-
super(validator);
|
|
31
|
-
this.sharedItemsController = sharedItemsController;
|
|
32
|
-
}
|
|
33
|
-
async executeInternal(request) {
|
|
34
|
-
const sharedItem = await this.sharedItemsController.getSharedItem(transport_1.CoreId.from(request.id));
|
|
35
|
-
if (!sharedItem) {
|
|
36
|
-
return ts_utils_1.Result.fail(common_1.RuntimeErrors.general.recordNotFound(consumption_1.SharedItem));
|
|
37
|
-
}
|
|
38
|
-
return ts_utils_1.Result.ok(SharedItemsMapper_1.SharedItemsMapper.toSharedItemDTO(sharedItem));
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
GetSharedItemUseCase = __decorate([
|
|
42
|
-
__param(0, typescript_ioc_1.Inject),
|
|
43
|
-
__param(1, typescript_ioc_1.Inject),
|
|
44
|
-
__metadata("design:paramtypes", [consumption_1.SharedItemsController, GetSharedItemRequestValidator])
|
|
45
|
-
], GetSharedItemUseCase);
|
|
46
|
-
exports.GetSharedItemUseCase = GetSharedItemUseCase;
|
|
47
|
-
//# sourceMappingURL=GetSharedItem.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GetSharedItem.js","sourceRoot":"","sources":["../../../../src/useCases/consumption/sharedItems/GetSharedItem.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gDAA2C;AAC3C,oDAAuF;AACvF,gDAA0C;AAC1C,mDAAwC;AAExC,yCAAqF;AACrF,2DAAwD;AAMxD,MAAM,6BAA8B,SAAQ,yBAAsC;IAC9E;QACI,KAAK,EAAE,CAAC;QAER,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,oBAAW,CAAC,QAAQ,CAAC,4BAAc,CAAC,UAAU,CAAC,CAAC,CAAC;IACjG,CAAC;CACJ;AAED,IAAa,oBAAoB,GAAjC,MAAa,oBAAqB,SAAQ,gBAA4C;IAClF,YAA4C,qBAA4C,EAAU,SAAwC;QACtI,KAAK,CAAC,SAAS,CAAC,CAAC;QADuB,0BAAqB,GAArB,qBAAqB,CAAuB;IAExF,CAAC;IAES,KAAK,CAAC,eAAe,CAAC,OAA6B;QACzD,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,qBAAqB,CAAC,aAAa,CAAC,kBAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC;QAC3F,IAAI,CAAC,UAAU,EAAE;YACb,OAAO,iBAAM,CAAC,IAAI,CAAC,sBAAa,CAAC,OAAO,CAAC,cAAc,CAAC,wBAAU,CAAC,CAAC,CAAC;SACxE;QAED,OAAO,iBAAM,CAAC,EAAE,CAAC,qCAAiB,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC,CAAC;IACpE,CAAC;CACJ,CAAA;AAbY,oBAAoB;IACT,WAAA,uBAAM,CAAA;IAAiE,WAAA,uBAAM,CAAA;qCAA9B,mCAAqB,EAAqB,6BAA6B;GADjI,oBAAoB,CAahC;AAbY,oDAAoB"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Result } from "@js-soft/ts-utils";
|
|
2
|
-
import { SharedItemsController } from "@nmshd/consumption";
|
|
3
|
-
import { SharedItemDTO } from "../../../types";
|
|
4
|
-
import { RuntimeValidator, UseCase } from "../../common";
|
|
5
|
-
export interface GetSharedItemsRequest {
|
|
6
|
-
query?: any;
|
|
7
|
-
}
|
|
8
|
-
export declare class GetSharedItemsUseCase extends UseCase<GetSharedItemsRequest, SharedItemDTO[]> {
|
|
9
|
-
private readonly sharedItemsController;
|
|
10
|
-
private static readonly queryTranslator;
|
|
11
|
-
constructor(sharedItemsController: SharedItemsController, validator: RuntimeValidator);
|
|
12
|
-
protected executeInternal(request: GetSharedItemsRequest): Promise<Result<SharedItemDTO[]>>;
|
|
13
|
-
}
|