@darraghor/nest-backend-libs 3.7.0 → 3.8.1
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/organisation-subscriptions/organisation-subscriptions.controller.d.ts +3 -3
- package/dist/organisation-subscriptions/organisation-subscriptions.controller.js +16 -13
- package/dist/organisation-subscriptions/organisation-subscriptions.controller.js.map +1 -1
- package/dist/organisation-subscriptions/organisation-subscriptions.service.d.ts +6 -3
- package/dist/organisation-subscriptions/organisation-subscriptions.service.js +10 -7
- package/dist/organisation-subscriptions/organisation-subscriptions.service.js.map +1 -1
- package/dist/root-app/app.controller.d.ts +4 -4
- package/dist/root-app/app.controller.js +7 -7
- package/dist/root-app/app.controller.js.map +1 -1
- package/dist/root-app/app.service.d.ts +4 -1
- package/dist/root-app/app.service.js +12 -1
- package/dist/root-app/app.service.js.map +1 -1
- package/package.json +1 -1
|
@@ -6,7 +6,7 @@ import { BooleanResult } from "../root-app/dtos/boolean-result.js";
|
|
|
6
6
|
export declare class OrganisationSubscriptionsController {
|
|
7
7
|
private readonly osrService;
|
|
8
8
|
constructor(osrService: OrganisationSubscriptionService);
|
|
9
|
-
findAll(
|
|
10
|
-
addSubscription(
|
|
11
|
-
deleteSubscription(
|
|
9
|
+
findAll(orgUuid: string, request: RequestWithUser): Promise<OrganisationSubscriptionRecord[]>;
|
|
10
|
+
addSubscription(orgUuid: string, body: SaveOrganisationSubscriptionRecordDto): Promise<OrganisationSubscriptionRecord[]>;
|
|
11
|
+
deleteSubscription(orgUuId: string, uuid: string): Promise<BooleanResult>;
|
|
12
12
|
}
|
|
@@ -25,24 +25,27 @@ let OrganisationSubscriptionsController = class OrganisationSubscriptionsControl
|
|
|
25
25
|
constructor(osrService) {
|
|
26
26
|
this.osrService = osrService;
|
|
27
27
|
}
|
|
28
|
-
async findAll(
|
|
29
|
-
return this.osrService.findAllForOwnerOfOrg(
|
|
28
|
+
async findAll(orgUuid, request) {
|
|
29
|
+
return this.osrService.findAllForOwnerOfOrg(orgUuid, request.user.id);
|
|
30
30
|
}
|
|
31
|
-
async addSubscription(
|
|
32
|
-
return this.osrService.save([body],
|
|
31
|
+
async addSubscription(orgUuid, body) {
|
|
32
|
+
return this.osrService.save([body], orgUuid);
|
|
33
33
|
}
|
|
34
|
-
async deleteSubscription(
|
|
35
|
-
const isDeleted = await this.osrService.delete(
|
|
34
|
+
async deleteSubscription(orgUuId, uuid) {
|
|
35
|
+
const isDeleted = await this.osrService.delete({
|
|
36
|
+
orgUuId,
|
|
37
|
+
subScriptionUuid: uuid,
|
|
38
|
+
});
|
|
36
39
|
return { result: isDeleted };
|
|
37
40
|
}
|
|
38
41
|
};
|
|
39
42
|
__decorate([
|
|
40
43
|
Get(),
|
|
41
44
|
ApiOkResponse({ type: [OrganisationSubscriptionRecord] }),
|
|
42
|
-
__param(0, Param("
|
|
45
|
+
__param(0, Param("orgUuid")),
|
|
43
46
|
__param(1, Request()),
|
|
44
47
|
__metadata("design:type", Function),
|
|
45
|
-
__metadata("design:paramtypes", [
|
|
48
|
+
__metadata("design:paramtypes", [String, Object]),
|
|
46
49
|
__metadata("design:returntype", Promise)
|
|
47
50
|
], OrganisationSubscriptionsController.prototype, "findAll", null);
|
|
48
51
|
__decorate([
|
|
@@ -50,10 +53,10 @@ __decorate([
|
|
|
50
53
|
ApiOperation({ tags: ["SuperPower"] }),
|
|
51
54
|
Post(),
|
|
52
55
|
ApiOkResponse({ type: [OrganisationSubscriptionRecord] }),
|
|
53
|
-
__param(0, Param("
|
|
56
|
+
__param(0, Param("orgUuid")),
|
|
54
57
|
__param(1, Body()),
|
|
55
58
|
__metadata("design:type", Function),
|
|
56
|
-
__metadata("design:paramtypes", [
|
|
59
|
+
__metadata("design:paramtypes", [String, SaveOrganisationSubscriptionRecordDto]),
|
|
57
60
|
__metadata("design:returntype", Promise)
|
|
58
61
|
], OrganisationSubscriptionsController.prototype, "addSubscription", null);
|
|
59
62
|
__decorate([
|
|
@@ -61,16 +64,16 @@ __decorate([
|
|
|
61
64
|
ApiOperation({ tags: ["SuperPower"] }),
|
|
62
65
|
Delete(":uuid"),
|
|
63
66
|
ApiOkResponse({ type: BooleanResult }),
|
|
64
|
-
__param(0, Param("
|
|
67
|
+
__param(0, Param("orgUuid")),
|
|
65
68
|
__param(1, Param("uuid")),
|
|
66
69
|
__metadata("design:type", Function),
|
|
67
|
-
__metadata("design:paramtypes", [
|
|
70
|
+
__metadata("design:paramtypes", [String, String]),
|
|
68
71
|
__metadata("design:returntype", Promise)
|
|
69
72
|
], OrganisationSubscriptionsController.prototype, "deleteSubscription", null);
|
|
70
73
|
OrganisationSubscriptionsController = __decorate([
|
|
71
74
|
ApiBearerAuth(),
|
|
72
75
|
UseGuards(DefaultAuthGuard, ClaimsAuthorisationGuard),
|
|
73
|
-
Controller("organisation/:
|
|
76
|
+
Controller("organisation/:orgUuid/subscriptions"),
|
|
74
77
|
ApiTags("Organisation Subscriptions"),
|
|
75
78
|
__metadata("design:paramtypes", [OrganisationSubscriptionService])
|
|
76
79
|
], OrganisationSubscriptionsController);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organisation-subscriptions.controller.js","sourceRoot":"","sources":["../../src/organisation-subscriptions/organisation-subscriptions.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,gDAAgD;AAChD,OAAO,EACH,UAAU,EACV,OAAO,EACP,KAAK,EACL,GAAG,EACH,IAAI,EACJ,IAAI,EACJ,MAAM,EACN,SAAS,GACZ,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACH,aAAa,EACb,aAAa,EACb,YAAY,EACZ,OAAO,GACV,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAC,8BAA8B,EAAC,MAAM,gDAAgD,CAAC;AAC9F,OAAO,EAAC,+BAA+B,EAAC,MAAM,yCAAyC,CAAC;AACxF,OAAO,EAAC,qCAAqC,EAAC,MAAM,oCAAoC,CAAC;AACzF,OAAO,EAAC,aAAa,EAAC,MAAM,oCAAoC,CAAC;AACjE,OAAO,EAAC,mBAAmB,EAAC,MAAM,0DAA0D,CAAC;AAC7F,OAAO,EAAC,gBAAgB,EAAC,MAAM,6CAA6C,CAAC;AAC7E,OAAO,EAAC,wBAAwB,EAAC,MAAM,qDAAqD,CAAC;AAMtF,IAAM,mCAAmC,GAAzC,MAAM,mCAAmC;IACf;IAA7B,YAA6B,UAA2C;QAA3C,eAAU,GAAV,UAAU,CAAiC;IAAG,CAAC;IAItE,AAAN,KAAK,CAAC,OAAO,
|
|
1
|
+
{"version":3,"file":"organisation-subscriptions.controller.js","sourceRoot":"","sources":["../../src/organisation-subscriptions/organisation-subscriptions.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,gDAAgD;AAChD,OAAO,EACH,UAAU,EACV,OAAO,EACP,KAAK,EACL,GAAG,EACH,IAAI,EACJ,IAAI,EACJ,MAAM,EACN,SAAS,GACZ,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACH,aAAa,EACb,aAAa,EACb,YAAY,EACZ,OAAO,GACV,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAC,8BAA8B,EAAC,MAAM,gDAAgD,CAAC;AAC9F,OAAO,EAAC,+BAA+B,EAAC,MAAM,yCAAyC,CAAC;AACxF,OAAO,EAAC,qCAAqC,EAAC,MAAM,oCAAoC,CAAC;AACzF,OAAO,EAAC,aAAa,EAAC,MAAM,oCAAoC,CAAC;AACjE,OAAO,EAAC,mBAAmB,EAAC,MAAM,0DAA0D,CAAC;AAC7F,OAAO,EAAC,gBAAgB,EAAC,MAAM,6CAA6C,CAAC;AAC7E,OAAO,EAAC,wBAAwB,EAAC,MAAM,qDAAqD,CAAC;AAMtF,IAAM,mCAAmC,GAAzC,MAAM,mCAAmC;IACf;IAA7B,YAA6B,UAA2C;QAA3C,eAAU,GAAV,UAAU,CAAiC;IAAG,CAAC;IAItE,AAAN,KAAK,CAAC,OAAO,CACS,OAAe,EACtB,OAAwB;QAEnC,OAAO,IAAI,CAAC,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AAC,CAAA;;;;6EAOjB;AApCQ,mCAAmC;IAJ/C,aAAa,EAAE;IACf,SAAS,CAAC,gBAAgB,EAAE,wBAAwB,CAAC;IACrD,UAAU,CAAC,qCAAqC,CAAC;IACjD,OAAO,CAAC,4BAA4B,CAAC;qCAEO,+BAA+B;GAD/D,mCAAmC,CAqC/C"}
|
|
@@ -12,10 +12,13 @@ export declare class OrganisationSubscriptionService {
|
|
|
12
12
|
private readonly logger;
|
|
13
13
|
constructor(orgRepo: Repository<Organisation>, orgSubRepository: Repository<OrganisationSubscriptionRecord>, paymentSessionService: PaymentSessionService, queue: Queue);
|
|
14
14
|
private notFoundMessage;
|
|
15
|
-
findAllForOwnerOfOrg(
|
|
15
|
+
findAllForOwnerOfOrg(orgUuid: string, currentUserId: number): Promise<OrganisationSubscriptionRecord[]>;
|
|
16
16
|
findOne(subscriptionUuid: string): Promise<OrganisationSubscriptionRecord>;
|
|
17
17
|
findAllForOrg(orgUuid: string): Promise<OrganisationSubscriptionRecord[]>;
|
|
18
18
|
findAll(): Promise<OrganisationSubscriptionRecord[]>;
|
|
19
|
-
save(subRecordDtoCollection: SaveOrganisationSubscriptionRecordDto[],
|
|
20
|
-
delete(
|
|
19
|
+
save(subRecordDtoCollection: SaveOrganisationSubscriptionRecordDto[], orgUuid?: string): Promise<OrganisationSubscriptionRecord[]>;
|
|
20
|
+
delete({ subScriptionUuid, orgUuId, }: {
|
|
21
|
+
orgUuId: string;
|
|
22
|
+
subScriptionUuid: string;
|
|
23
|
+
}): Promise<boolean>;
|
|
21
24
|
}
|
|
@@ -32,11 +32,11 @@ let OrganisationSubscriptionService = OrganisationSubscriptionService_1 = class
|
|
|
32
32
|
this.queue = queue;
|
|
33
33
|
}
|
|
34
34
|
notFoundMessage = "Organisation not found or you are not owner of it";
|
|
35
|
-
async findAllForOwnerOfOrg(
|
|
35
|
+
async findAllForOwnerOfOrg(orgUuid, currentUserId) {
|
|
36
36
|
// find the org if the user is owner
|
|
37
37
|
const org = await this.orgRepo.findOne({
|
|
38
38
|
where: {
|
|
39
|
-
|
|
39
|
+
uuid: orgUuid,
|
|
40
40
|
memberships: {
|
|
41
41
|
userId: currentUserId,
|
|
42
42
|
roles: {
|
|
@@ -87,7 +87,7 @@ let OrganisationSubscriptionService = OrganisationSubscriptionService_1 = class
|
|
|
87
87
|
return this.orgSubRepository.find();
|
|
88
88
|
}
|
|
89
89
|
// eslint-disable-next-line sonarjs/cognitive-complexity
|
|
90
|
-
async save(subRecordDtoCollection,
|
|
90
|
+
async save(subRecordDtoCollection, orgUuid) {
|
|
91
91
|
const results = [];
|
|
92
92
|
for (const subRecord of subRecordDtoCollection) {
|
|
93
93
|
let shouldRaiseEvent = false;
|
|
@@ -99,7 +99,7 @@ let OrganisationSubscriptionService = OrganisationSubscriptionService_1 = class
|
|
|
99
99
|
if (!existingSubscription) {
|
|
100
100
|
// if no existing subscription then create a new one, get the org
|
|
101
101
|
let org;
|
|
102
|
-
if (
|
|
102
|
+
if (orgUuid === undefined) {
|
|
103
103
|
if (!subRecord.millerPaymentReferenceUuid) {
|
|
104
104
|
this.logger.error("No organisation uuid or payment reference uuid provided. Cannot match this payment to a customer", subRecord);
|
|
105
105
|
throw new NotFoundException("No organisation uuid or payment reference uuid provided. Cannot match this payment to a customer");
|
|
@@ -117,7 +117,7 @@ let OrganisationSubscriptionService = OrganisationSubscriptionService_1 = class
|
|
|
117
117
|
org =
|
|
118
118
|
(await this.orgRepo.findOne({
|
|
119
119
|
where: {
|
|
120
|
-
|
|
120
|
+
uuid: orgUuid,
|
|
121
121
|
},
|
|
122
122
|
})) || undefined;
|
|
123
123
|
}
|
|
@@ -164,10 +164,13 @@ let OrganisationSubscriptionService = OrganisationSubscriptionService_1 = class
|
|
|
164
164
|
}
|
|
165
165
|
return results;
|
|
166
166
|
}
|
|
167
|
-
async delete(
|
|
167
|
+
async delete({ subScriptionUuid, orgUuId, }) {
|
|
168
168
|
const result = await this.orgSubRepository.findOne({
|
|
169
169
|
where: {
|
|
170
|
-
uuid:
|
|
170
|
+
uuid: subScriptionUuid,
|
|
171
|
+
organisation: {
|
|
172
|
+
uuid: orgUuId,
|
|
173
|
+
},
|
|
171
174
|
},
|
|
172
175
|
relations: {
|
|
173
176
|
organisation: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organisation-subscriptions.service.js","sourceRoot":"","sources":["../../src/organisation-subscriptions/organisation-subscriptions.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,cAAc,CAAC;AACzC,OAAO,EAAC,UAAU,EAAE,MAAM,EAAE,iBAAiB,EAAC,MAAM,gBAAgB,CAAC;AACrE,OAAO,EAAC,gBAAgB,EAAC,MAAM,iBAAiB,CAAC;AAEjD,OAAO,EAAC,UAAU,EAAC,MAAM,SAAS,CAAC;AACnC,OAAO,EAAC,KAAK,EAAC,MAAM,kCAAkC,CAAC;AACvD,OAAO,EAAC,YAAY,EAAC,MAAM,iDAAiD,CAAC;AAC7E,OAAO,EAAC,qBAAqB,EAAC,MAAM,gDAAgD,CAAC;AACrF,OAAO,EAAC,8BAA8B,EAAC,MAAM,gDAAgD,CAAC;AAIvF,IAAM,+BAA+B,uCAArC,MAAM,+BAA+B;IAI5B;IAEA;IACS;IAET;IARK,MAAM,GAAG,IAAI,MAAM,CAAC,iCAA+B,CAAC,IAAI,CAAC,CAAC;IAC3E,YAEY,OAAiC,EAEjC,gBAA4D,EACnD,qBAA4C,EAErD,KAAY;QALZ,YAAO,GAAP,OAAO,CAA0B;QAEjC,qBAAgB,GAAhB,gBAAgB,CAA4C;QACnD,0BAAqB,GAArB,qBAAqB,CAAuB;QAErD,UAAK,GAAL,KAAK,CAAO;IACrB,CAAC;IAEI,eAAe,GACnB,mDAAmD,CAAC;IACxD,KAAK,CAAC,oBAAoB,CACtB,
|
|
1
|
+
{"version":3,"file":"organisation-subscriptions.service.js","sourceRoot":"","sources":["../../src/organisation-subscriptions/organisation-subscriptions.service.ts"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OAAO,CAAC;IACnB,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,EACT,gBAAgB,EAChB,OAAO,GAIV;QACG,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC;YAC/C,KAAK,EAAE;gBACH,IAAI,EAAE,gBAAgB;gBACtB,YAAY,EAAE;oBACV,IAAI,EAAE,OAAO;iBAChB;aACJ;YACD,SAAS,EAAE;gBACP,YAAY,EAAE,IAAI;aACrB;SACJ,CAAC,CAAC;QACH,IAAI,CAAC,MAAM,EAAE,CAAC;YACV,MAAM,IAAI,iBAAiB,CAAC,wBAAwB,CAAC,CAAC;QAC1D,CAAC;QAED,MAAM,IAAI,CAAC,gBAAgB,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QAC/C,MAAM,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC;YACjB,gBAAgB,EAAE,MAAM,CAAC,YAAY,CAAC,IAAI;YAC1C,gBAAgB,EAAE,MAAM,CAAC,IAAI;YAC7B,UAAU,EAAE,MAAM,CAAC,WAAW;YAC9B,MAAM,EAAE,KAAK;SAChB,CAAC,CAAC;QACH,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ,CAAA;AA3NY,+BAA+B;IAD3C,UAAU,EAAE;IAIJ,WAAA,gBAAgB,CAAC,YAAY,CAAC,CAAA;IAE9B,WAAA,gBAAgB,CAAC,8BAA8B,CAAC,CAAA;IAGhD,WAAA,WAAW,CAAC,iCAAiC,CAAC,CAAA;qCAJ9B,UAAU;QAED,UAAU;QACI,qBAAqB;GAPxD,+BAA+B,CA2N3C"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { RequestWithUser } from "../authorization/models/RequestWithUser.js";
|
|
2
|
-
import { AppService } from "./app.service.js";
|
|
2
|
+
import { AppService, HealthResponse } from "./app.service.js";
|
|
3
3
|
export declare class AppController {
|
|
4
4
|
private readonly appService;
|
|
5
5
|
private readonly logger;
|
|
6
6
|
constructor(appService: AppService);
|
|
7
|
-
getHello():
|
|
8
|
-
getHelloAuthorized(request: RequestWithUser):
|
|
9
|
-
getHelloSuperAdmin(request: RequestWithUser):
|
|
7
|
+
getHello(): HealthResponse;
|
|
8
|
+
getHelloAuthorized(request: RequestWithUser): HealthResponse;
|
|
9
|
+
getHelloSuperAdmin(request: RequestWithUser): HealthResponse;
|
|
10
10
|
}
|
|
@@ -17,7 +17,7 @@ import { ApiBearerAuth, ApiOkResponse, ApiOperation, ApiTags, } from "@nestjs/sw
|
|
|
17
17
|
import { ClaimsAuthorisationGuard } from "../authorization/guards/ClaimsAuthorisationGuard.js";
|
|
18
18
|
import { DefaultAuthGuard } from "../authorization/guards/DefaultAuthGuard.js";
|
|
19
19
|
import { MandatoryUserClaims } from "../index.js";
|
|
20
|
-
import { AppService } from "./app.service.js";
|
|
20
|
+
import { AppService, HealthResponse } from "./app.service.js";
|
|
21
21
|
let AppController = AppController_1 = class AppController {
|
|
22
22
|
appService;
|
|
23
23
|
logger = new Logger(AppController_1.name);
|
|
@@ -42,20 +42,20 @@ let AppController = AppController_1 = class AppController {
|
|
|
42
42
|
};
|
|
43
43
|
__decorate([
|
|
44
44
|
Get(),
|
|
45
|
-
ApiOkResponse({ type:
|
|
45
|
+
ApiOkResponse({ type: HealthResponse }),
|
|
46
46
|
__metadata("design:type", Function),
|
|
47
47
|
__metadata("design:paramtypes", []),
|
|
48
|
-
__metadata("design:returntype",
|
|
48
|
+
__metadata("design:returntype", void 0)
|
|
49
49
|
], AppController.prototype, "getHello", null);
|
|
50
50
|
__decorate([
|
|
51
51
|
UseGuards(DefaultAuthGuard),
|
|
52
52
|
ApiBearerAuth(),
|
|
53
53
|
Get("is-authorised"),
|
|
54
|
-
ApiOkResponse({ type:
|
|
54
|
+
ApiOkResponse({ type: HealthResponse }),
|
|
55
55
|
__param(0, Request()),
|
|
56
56
|
__metadata("design:type", Function),
|
|
57
57
|
__metadata("design:paramtypes", [Object]),
|
|
58
|
-
__metadata("design:returntype",
|
|
58
|
+
__metadata("design:returntype", void 0)
|
|
59
59
|
], AppController.prototype, "getHelloAuthorized", null);
|
|
60
60
|
__decorate([
|
|
61
61
|
UseGuards(DefaultAuthGuard, ClaimsAuthorisationGuard),
|
|
@@ -63,11 +63,11 @@ __decorate([
|
|
|
63
63
|
MandatoryUserClaims("read:all"),
|
|
64
64
|
ApiOperation({ tags: ["SuperPower"] }),
|
|
65
65
|
Get("is-super-admin"),
|
|
66
|
-
ApiOkResponse({ type:
|
|
66
|
+
ApiOkResponse({ type: HealthResponse }),
|
|
67
67
|
__param(0, Request()),
|
|
68
68
|
__metadata("design:type", Function),
|
|
69
69
|
__metadata("design:paramtypes", [Object]),
|
|
70
|
-
__metadata("design:returntype",
|
|
70
|
+
__metadata("design:returntype", void 0)
|
|
71
71
|
], AppController.prototype, "getHelloSuperAdmin", null);
|
|
72
72
|
AppController = AppController_1 = __decorate([
|
|
73
73
|
Controller(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.controller.js","sourceRoot":"","sources":["../../src/root-app/app.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mDAAmD;AACnD,OAAO,EAAC,UAAU,EAAE,GAAG,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAC,MAAM,gBAAgB,CAAC;AAC3E,OAAO,EACH,aAAa,EACb,aAAa,EACb,YAAY,EACZ,OAAO,GACV,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAC,wBAAwB,EAAC,MAAM,qDAAqD,CAAC;AAC7F,OAAO,EAAC,gBAAgB,EAAC,MAAM,6CAA6C,CAAC;AAE7E,OAAO,EAAC,mBAAmB,EAAC,MAAM,aAAa,CAAC;AAChD,OAAO,EAAC,UAAU,EAAC,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"app.controller.js","sourceRoot":"","sources":["../../src/root-app/app.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mDAAmD;AACnD,OAAO,EAAC,UAAU,EAA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EAAE;IACL,aAAa,CAAC,EAAC,IAAI,EAAE,cAAc,EAAC,CAAC;;;;6CAGrC;AAMD;IAJC,SAAS,CAAC,gBAAgB,CAAC;IAC3B,aAAa,EAAE;IACf,GAAG,CAAC,eAAe,CAAC;IACpB,aAAa,CAAC,EAAC,IAAI,EAAE,cAAc,EAAC,CAAC;IAClB,WAAA,OAAO,EAAE,CAAA;;;;uDAK5B;AAQD;IANC,SAAS,CAAC,gBAAgB,EAAE,wBAAwB,CAAC;IACrD,aAAa,EAAE;IACf,mBAAmB,CAAC,UAAU,CAAC;IAC/B,YAAY,CAAC,EAAC,IAAI,EAAE,CAAC,YAAY,CAAC,EAAC,CAAC;IACpC,GAAG,CAAC,gBAAgB,CAAC;IACrB,aAAa,CAAC,EAAC,IAAI,EAAE,cAAc,EAAC,CAAC;IAClB,WAAA,OAAO,EAAE,CAAA;;;;uDAK5B;AAhCQ,aAAa;IAFzB,UAAU,EAAE;IACZ,OAAO,CAAC,qBAAqB,CAAC;qCAGc,UAAU;GAF1C,aAAa,CAiCzB"}
|
|
@@ -4,10 +4,21 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
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;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
7
10
|
import { Injectable } from "@nestjs/common";
|
|
11
|
+
import { ApiProperty } from "@nestjs/swagger";
|
|
12
|
+
export class HealthResponse {
|
|
13
|
+
result;
|
|
14
|
+
}
|
|
15
|
+
__decorate([
|
|
16
|
+
ApiProperty(),
|
|
17
|
+
__metadata("design:type", String)
|
|
18
|
+
], HealthResponse.prototype, "result", void 0);
|
|
8
19
|
let AppService = class AppService {
|
|
9
20
|
getHello() {
|
|
10
|
-
return
|
|
21
|
+
return { result: "Healthy and running" };
|
|
11
22
|
}
|
|
12
23
|
};
|
|
13
24
|
AppService = __decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.service.js","sourceRoot":"","sources":["../../src/root-app/app.service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"app.service.js","sourceRoot":"","sources":["../../src/root-app/app.service.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAC,WAAW,EAAC,MAAM,iBAAiB,CAAC;AAE5C,MAAM,OAAO,cAAc;IAEvB,MAAM,CAAU;CACnB;AADG;IADC,WAAW,EAAE;;8CACE;AAGb,IAAM,UAAU,GAAhB,MAAM,UAAU;IACnB,QAAQ;QACJ,OAAO,EAAC,MAAM,EAAE,qBAAqB,EAAC,CAAC;IAC3C,CAAC;CACJ,CAAA;AAJY,UAAU;IADtB,UAAU,EAAE;GACA,UAAU,CAItB"}
|
package/package.json
CHANGED