@revisium/core 1.4.2 → 1.5.0-alpha.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.
Files changed (33) hide show
  1. package/dist/package.json +1 -1
  2. package/dist/src/api/rest-api/endpoint/dto/get-endpoint-result.dto.d.ts +10 -0
  3. package/dist/src/api/rest-api/endpoint/dto/get-endpoint-result.dto.js +37 -0
  4. package/dist/src/api/rest-api/endpoint/dto/get-endpoint-result.dto.js.map +1 -0
  5. package/dist/src/api/rest-api/endpoint/dto/index.d.ts +1 -0
  6. package/dist/src/api/rest-api/endpoint/dto/index.js +18 -0
  7. package/dist/src/api/rest-api/endpoint/dto/index.js.map +1 -0
  8. package/dist/src/api/rest-api/endpoint/endpoint-by-id.controller.d.ts +10 -0
  9. package/dist/src/api/rest-api/endpoint/{endpointByIdController.js → endpoint-by-id.controller.js} +25 -4
  10. package/dist/src/api/rest-api/endpoint/endpoint-by-id.controller.js.map +1 -0
  11. package/dist/src/api/rest-api/rest-api.module.js +4 -3
  12. package/dist/src/api/rest-api/rest-api.module.js.map +1 -1
  13. package/dist/src/features/endpoint/endpoint.module.js +3 -1
  14. package/dist/src/features/endpoint/endpoint.module.js.map +1 -1
  15. package/dist/src/features/endpoint/queries/endpoint-api.service.d.ts +7 -0
  16. package/dist/src/features/endpoint/queries/endpoint-api.service.js +29 -0
  17. package/dist/src/features/endpoint/queries/endpoint-api.service.js.map +1 -0
  18. package/dist/src/features/endpoint/queries/handlers/get-endpoint-relatives.handler.d.ts +45 -0
  19. package/dist/src/features/endpoint/queries/handlers/get-endpoint-relatives.handler.js +58 -0
  20. package/dist/src/features/endpoint/queries/handlers/get-endpoint-relatives.handler.js.map +1 -0
  21. package/dist/src/features/endpoint/queries/handlers/index.d.ts +2 -1
  22. package/dist/src/features/endpoint/queries/handlers/index.js +2 -0
  23. package/dist/src/features/endpoint/queries/handlers/index.js.map +1 -1
  24. package/dist/src/features/endpoint/queries/impl/get-endpoint-relatives.query.d.ts +16 -0
  25. package/dist/src/features/endpoint/queries/impl/get-endpoint-relatives.query.js +10 -0
  26. package/dist/src/features/endpoint/queries/impl/get-endpoint-relatives.query.js.map +1 -0
  27. package/dist/src/features/endpoint/queries/impl/index.d.ts +1 -0
  28. package/dist/src/features/endpoint/queries/impl/index.js +1 -0
  29. package/dist/src/features/endpoint/queries/impl/index.js.map +1 -1
  30. package/dist/tsconfig.build.tsbuildinfo +1 -1
  31. package/package.json +1 -1
  32. package/dist/src/api/rest-api/endpoint/endpointByIdController.d.ts +0 -6
  33. package/dist/src/api/rest-api/endpoint/endpointByIdController.js.map +0 -1
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@revisium/core",
3
- "version": "1.4.2",
3
+ "version": "1.5.0-alpha.1",
4
4
  "description": "Revisium is a tool (UI/API) inspired by JSON (JSON Schema) and Git, designed to provide a flexible and low-level headless CMS solution.",
5
5
  "private": false,
6
6
  "homepage": "https://revisium.io",
@@ -0,0 +1,10 @@
1
+ import { BranchModel } from '../../../../api/rest-api/branch/model';
2
+ import { EndpointModel } from '../../../../api/rest-api/endpoint/model';
3
+ import { ProjectModel } from '../../../../api/rest-api/project/model';
4
+ import { RevisionModel } from '../../../../api/rest-api/revision/model';
5
+ export declare class GetEndpointResultDto {
6
+ endpoint: EndpointModel;
7
+ revision: RevisionModel;
8
+ branch: BranchModel;
9
+ project: ProjectModel;
10
+ }
@@ -0,0 +1,37 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.GetEndpointResultDto = void 0;
13
+ const swagger_1 = require("@nestjs/swagger");
14
+ const model_1 = require("../../branch/model");
15
+ const model_2 = require("../model");
16
+ const model_3 = require("../../project/model");
17
+ const model_4 = require("../../revision/model");
18
+ class GetEndpointResultDto {
19
+ }
20
+ exports.GetEndpointResultDto = GetEndpointResultDto;
21
+ __decorate([
22
+ (0, swagger_1.ApiProperty)({ type: model_2.EndpointModel }),
23
+ __metadata("design:type", model_2.EndpointModel)
24
+ ], GetEndpointResultDto.prototype, "endpoint", void 0);
25
+ __decorate([
26
+ (0, swagger_1.ApiProperty)({ type: model_4.RevisionModel }),
27
+ __metadata("design:type", model_4.RevisionModel)
28
+ ], GetEndpointResultDto.prototype, "revision", void 0);
29
+ __decorate([
30
+ (0, swagger_1.ApiProperty)({ type: model_1.BranchModel }),
31
+ __metadata("design:type", model_1.BranchModel)
32
+ ], GetEndpointResultDto.prototype, "branch", void 0);
33
+ __decorate([
34
+ (0, swagger_1.ApiProperty)({ type: model_3.ProjectModel }),
35
+ __metadata("design:type", model_3.ProjectModel)
36
+ ], GetEndpointResultDto.prototype, "project", void 0);
37
+ //# sourceMappingURL=get-endpoint-result.dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-endpoint-result.dto.js","sourceRoot":"","sources":["../../../../../../src/api/rest-api/endpoint/dto/get-endpoint-result.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAA8C;AAC9C,8CAA4D;AAC5D,oCAAgE;AAChE,+CAA8D;AAC9D,gDAAgE;AAEhE,MAAa,oBAAoB;CAYhC;AAZD,oDAYC;AAVC;IADC,IAAA,qBAAW,EAAC,EAAE,IAAI,EAAE,qBAAa,EAAE,CAAC;8BAC3B,qBAAa;sDAAC;AAGxB;IADC,IAAA,qBAAW,EAAC,EAAE,IAAI,EAAE,qBAAa,EAAE,CAAC;8BAC3B,qBAAa;sDAAC;AAGxB;IADC,IAAA,qBAAW,EAAC,EAAE,IAAI,EAAE,mBAAW,EAAE,CAAC;8BAC3B,mBAAW;oDAAC;AAGpB;IADC,IAAA,qBAAW,EAAC,EAAE,IAAI,EAAE,oBAAY,EAAE,CAAC;8BAC3B,oBAAY;qDAAC"}
@@ -0,0 +1 @@
1
+ export * from './get-endpoint-result.dto';
@@ -0,0 +1,18 @@
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("./get-endpoint-result.dto"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/api/rest-api/endpoint/dto/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4DAA0C"}
@@ -0,0 +1,10 @@
1
+ import { CommandBus } from '@nestjs/cqrs';
2
+ import { GetEndpointResultDto } from '../../../api/rest-api/endpoint/dto';
3
+ import { EndpointApiService } from '../../../features/endpoint/queries/endpoint-api.service';
4
+ export declare class EndpointByIdController {
5
+ private readonly commandBus;
6
+ private readonly endpointApi;
7
+ constructor(commandBus: CommandBus, endpointApi: EndpointApiService);
8
+ endpointRelatives(endpointId: string): Promise<GetEndpointResultDto>;
9
+ deleteEndpoint(endpointId: string): Promise<true>;
10
+ }
@@ -16,15 +16,22 @@ exports.EndpointByIdController = void 0;
16
16
  const common_1 = require("@nestjs/common");
17
17
  const cqrs_1 = require("@nestjs/cqrs");
18
18
  const swagger_1 = require("@nestjs/swagger");
19
+ const dto_1 = require("./dto");
19
20
  const consts_1 = require("../../../features/auth/consts");
20
21
  const http_jwt_auth_guard_service_1 = require("../../../features/auth/guards/jwt/http-jwt-auth-guard.service");
22
+ const optional_http_jwt_auth_guard_service_1 = require("../../../features/auth/guards/jwt/optional-http-jwt-auth-guard.service");
21
23
  const permission_params_1 = require("../../../features/auth/guards/permission-params");
22
24
  const project_guard_1 = require("../../../features/auth/guards/project.guard");
23
25
  const impl_1 = require("../../../features/endpoint/commands/impl");
26
+ const endpoint_api_service_1 = require("../../../features/endpoint/queries/endpoint-api.service");
24
27
  const rest_metrics_interceptor_1 = require("../../../infrastructure/metrics/rest/rest-metrics.interceptor");
25
28
  let EndpointByIdController = class EndpointByIdController {
26
- constructor(commandBus) {
29
+ constructor(commandBus, endpointApi) {
27
30
  this.commandBus = commandBus;
31
+ this.endpointApi = endpointApi;
32
+ }
33
+ async endpointRelatives(endpointId) {
34
+ return this.endpointApi.getEndpointRelatives({ endpointId });
28
35
  }
29
36
  async deleteEndpoint(endpointId) {
30
37
  await this.commandBus.execute(new impl_1.DeleteEndpointCommand({ endpointId }));
@@ -33,6 +40,20 @@ let EndpointByIdController = class EndpointByIdController {
33
40
  };
34
41
  exports.EndpointByIdController = EndpointByIdController;
35
42
  __decorate([
43
+ (0, common_1.UseGuards)(optional_http_jwt_auth_guard_service_1.OptionalHttpJwtAuthGuard, project_guard_1.HTTPProjectGuard),
44
+ (0, common_1.Get)('relatives'),
45
+ (0, swagger_1.ApiOperation)({
46
+ operationId: 'endpointRelatives',
47
+ summary: 'Retrieve all related entities for a given endpoint',
48
+ }),
49
+ (0, swagger_1.ApiOkResponse)({ type: dto_1.GetEndpointResultDto }),
50
+ __param(0, (0, common_1.Param)('endpointId')),
51
+ __metadata("design:type", Function),
52
+ __metadata("design:paramtypes", [String]),
53
+ __metadata("design:returntype", Promise)
54
+ ], EndpointByIdController.prototype, "endpointRelatives", null);
55
+ __decorate([
56
+ (0, common_1.UseGuards)(http_jwt_auth_guard_service_1.HttpJwtAuthGuard, project_guard_1.HTTPProjectGuard),
36
57
  (0, common_1.Delete)(),
37
58
  (0, permission_params_1.PermissionParams)({
38
59
  action: consts_1.PermissionAction.delete,
@@ -47,7 +68,6 @@ __decorate([
47
68
  ], EndpointByIdController.prototype, "deleteEndpoint", null);
48
69
  exports.EndpointByIdController = EndpointByIdController = __decorate([
49
70
  (0, common_1.UseInterceptors)(rest_metrics_interceptor_1.RestMetricsInterceptor),
50
- (0, common_1.UseGuards)(http_jwt_auth_guard_service_1.HttpJwtAuthGuard, project_guard_1.HTTPProjectGuard),
51
71
  (0, permission_params_1.PermissionParams)({
52
72
  action: consts_1.PermissionAction.read,
53
73
  subject: consts_1.PermissionSubject.Project,
@@ -55,6 +75,7 @@ exports.EndpointByIdController = EndpointByIdController = __decorate([
55
75
  (0, common_1.Controller)('/endpoints/:endpointId'),
56
76
  (0, swagger_1.ApiBearerAuth)('access-token'),
57
77
  (0, swagger_1.ApiTags)('Endpoint'),
58
- __metadata("design:paramtypes", [cqrs_1.CommandBus])
78
+ __metadata("design:paramtypes", [cqrs_1.CommandBus,
79
+ endpoint_api_service_1.EndpointApiService])
59
80
  ], EndpointByIdController);
60
- //# sourceMappingURL=endpointByIdController.js.map
81
+ //# sourceMappingURL=endpoint-by-id.controller.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"endpoint-by-id.controller.js","sourceRoot":"","sources":["../../../../../src/api/rest-api/endpoint/endpoint-by-id.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAOwB;AACxB,uCAA0C;AAC1C,6CAKyB;A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AAa,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;IACX,WAAA,IAAA,cAAK,EAAC,YAAY,CAAC,CAAA;;;;4DAIxC;iCA/BU,sBAAsB;IARlC,IAAA,wBAAe,EAAC,iDAAsB,CAAC;IACvC,IAAA,oCAAgB,EAAC;QAChB,MAAM,EAAE,yBAAgB,CAAC,IAAI;QAC7B,OAAO,EAAE,0BAAiB,CAAC,OAAO;KACnC,CAAC;IACD,IAAA,mBAAU,EAAC,wBAAwB,CAAC;IACpC,IAAA,uBAAa,EAAC,cAAc,CAAC;IAC7B,IAAA,iBAAO,EAAC,UAAU,CAAC;qCAGa,iBAAU;QACT,yCAAkB;GAHvC,sBAAsB,CAgClC"}
@@ -10,11 +10,12 @@ exports.RestApiModule = void 0;
10
10
  const common_1 = require("@nestjs/common");
11
11
  const cqrs_1 = require("@nestjs/cqrs");
12
12
  const auth_module_1 = require("../../features/auth/auth.module");
13
+ const endpoint_module_1 = require("../../features/endpoint/endpoint.module");
13
14
  const metrics_module_1 = require("../../infrastructure/metrics/metrics.module");
14
15
  const auth_controller_1 = require("./auth/auth.controller");
15
16
  const branch_by_name_controller_1 = require("./branch/branch-by-name.controller");
16
17
  const configuration_controller_1 = require("./configuration/configuration.controller");
17
- const endpointByIdController_1 = require("./endpoint/endpointByIdController");
18
+ const endpoint_by_id_controller_1 = require("./endpoint/endpoint-by-id.controller");
18
19
  const project_controller_1 = require("./project/project.controller");
19
20
  const organization_controller_1 = require("./organization/organization.controller");
20
21
  const revision_by_id_controller_1 = require("./revision/revision-by-id.controller");
@@ -26,7 +27,7 @@ let RestApiModule = class RestApiModule {
26
27
  exports.RestApiModule = RestApiModule;
27
28
  exports.RestApiModule = RestApiModule = __decorate([
28
29
  (0, common_1.Module)({
29
- imports: [cqrs_1.CqrsModule, auth_module_1.AuthModule, metrics_module_1.MetricsModule],
30
+ imports: [cqrs_1.CqrsModule, auth_module_1.AuthModule, metrics_module_1.MetricsModule, endpoint_module_1.EndpointModule],
30
31
  controllers: [
31
32
  auth_controller_1.AuthController,
32
33
  user_controller_1.UserController,
@@ -36,7 +37,7 @@ exports.RestApiModule = RestApiModule = __decorate([
36
37
  revision_by_id_controller_1.RevisionByIdController,
37
38
  table_by_id_controller_1.TableByIdController,
38
39
  row_by_id_controller_1.RowByIdController,
39
- endpointByIdController_1.EndpointByIdController,
40
+ endpoint_by_id_controller_1.EndpointByIdController,
40
41
  configuration_controller_1.ConfigurationController,
41
42
  ],
42
43
  })
@@ -1 +1 @@
1
- {"version":3,"file":"rest-api.module.js","sourceRoot":"","sources":["../../../../src/api/rest-api/rest-api.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,uCAA0C;AAC1C,iEAA2D;AAC3D,gFAA0E;AAC1E,4DAAuE;AACvE,kFAA2F;AAC3F,uFAAkG;AAClG,8EAA0F;AAC1F,qEAAgF;AAChF,oFAA+F;AAC/F,oFAA6F;AAC7F,qEAA8E;AAC9E,2EAAoF;AACpF,4DAAuE;AAiBhE,IAAM,aAAa,GAAnB,MAAM,aAAa;CAAG,CAAA;AAAhB,sCAAa;wBAAb,aAAa;IAfzB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,iBAAU,EAAE,wBAAU,EAAE,8BAAa,CAAC;QAChD,WAAW,EAAE;YACX,gCAAc;YACd,gCAAc;YACd,gDAAsB;YACtB,sCAAiB;YACjB,kDAAsB;YACtB,kDAAsB;YACtB,4CAAmB;YACnB,wCAAiB;YACjB,+CAAsB;YACtB,kDAAuB;SACxB;KACF,CAAC;GACW,aAAa,CAAG"}
1
+ {"version":3,"file":"rest-api.module.js","sourceRoot":"","sources":["../../../../src/api/rest-api/rest-api.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,uCAA0C;AAC1C,iEAA2D;AAC3D,6EAAuE;AACvE,gFAA0E;AAC1E,4DAAuE;AACvE,kFAA2F;AAC3F,uFAAkG;AAClG,oFAA6F;AAC7F,qEAAgF;AAChF,oFAA+F;AAC/F,oFAA6F;AAC7F,qEAA8E;AAC9E,2EAAoF;AACpF,4DAAuE;AAiBhE,IAAM,aAAa,GAAnB,MAAM,aAAa;CAAG,CAAA;AAAhB,sCAAa;wBAAb,aAAa;IAfzB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,iBAAU,EAAE,wBAAU,EAAE,8BAAa,EAAE,gCAAc,CAAC;QAChE,WAAW,EAAE;YACX,gCAAc;YACd,gCAAc;YACd,gDAAsB;YACtB,sCAAiB;YACjB,kDAAsB;YACtB,kDAAsB;YACtB,4CAAmB;YACnB,wCAAiB;YACjB,kDAAsB;YACtB,kDAAuB;SACxB;KACF,CAAC;GACW,aAAa,CAAG"}
@@ -9,6 +9,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.EndpointModule = void 0;
10
10
  const common_1 = require("@nestjs/common");
11
11
  const cqrs_1 = require("@nestjs/cqrs");
12
+ const endpoint_api_service_1 = require("./queries/endpoint-api.service");
12
13
  const database_module_1 = require("../../infrastructure/database/database.module");
13
14
  const handlers_1 = require("./commands/handlers");
14
15
  const handlers_2 = require("./queries/handlers");
@@ -19,7 +20,8 @@ exports.EndpointModule = EndpointModule;
19
20
  exports.EndpointModule = EndpointModule = __decorate([
20
21
  (0, common_1.Module)({
21
22
  imports: [cqrs_1.CqrsModule, database_module_1.DatabaseModule, notification_module_1.NotificationModule],
22
- providers: [...handlers_1.ENDPOINT_COMMANDS, ...handlers_2.ENDPOINT_QUERIES],
23
+ providers: [endpoint_api_service_1.EndpointApiService, ...handlers_1.ENDPOINT_COMMANDS, ...handlers_2.ENDPOINT_QUERIES],
24
+ exports: [endpoint_api_service_1.EndpointApiService],
23
25
  })
24
26
  ], EndpointModule);
25
27
  //# sourceMappingURL=endpoint.module.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"endpoint.module.js","sourceRoot":"","sources":["../../../../src/features/endpoint/endpoint.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,uCAA0C;AAC1C,mFAA6E;AAC7E,kDAA4E;AAC5E,iDAA0E;AAC1E,+FAAyF;AAMlF,IAAM,cAAc,GAApB,MAAM,cAAc;CAAG,CAAA;AAAjB,wCAAc;yBAAd,cAAc;IAJ1B,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,iBAAU,EAAE,gCAAc,EAAE,wCAAkB,CAAC;QACzD,SAAS,EAAE,CAAC,GAAG,4BAAiB,EAAE,GAAG,2BAAgB,CAAC;KACvD,CAAC;GACW,cAAc,CAAG"}
1
+ {"version":3,"file":"endpoint.module.js","sourceRoot":"","sources":["../../../../src/features/endpoint/endpoint.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,uCAA0C;AAC1C,yEAAwF;AACxF,mFAA6E;AAC7E,kDAA4E;AAC5E,iDAA0E;AAC1E,+FAAyF;AAOlF,IAAM,cAAc,GAApB,MAAM,cAAc;CAAG,CAAA;AAAjB,wCAAc;yBAAd,cAAc;IAL1B,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,iBAAU,EAAE,gCAAc,EAAE,wCAAkB,CAAC;QACzD,SAAS,EAAE,CAAC,yCAAkB,EAAE,GAAG,4BAAiB,EAAE,GAAG,2BAAgB,CAAC;QAC1E,OAAO,EAAE,CAAC,yCAAkB,CAAC;KAC9B,CAAC;GACW,cAAc,CAAG"}
@@ -0,0 +1,7 @@
1
+ import { QueryBus } from '@nestjs/cqrs';
2
+ import { GetEndpointRelativesQueryData, GetEndpointRelativesQueryReturnType } from '../../../features/endpoint/queries/impl';
3
+ export declare class EndpointApiService {
4
+ private readonly queryBus;
5
+ constructor(queryBus: QueryBus);
6
+ getEndpointRelatives(data: GetEndpointRelativesQueryData): Promise<GetEndpointRelativesQueryReturnType>;
7
+ }
@@ -0,0 +1,29 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.EndpointApiService = void 0;
13
+ const common_1 = require("@nestjs/common");
14
+ const cqrs_1 = require("@nestjs/cqrs");
15
+ const impl_1 = require("./impl");
16
+ let EndpointApiService = class EndpointApiService {
17
+ constructor(queryBus) {
18
+ this.queryBus = queryBus;
19
+ }
20
+ getEndpointRelatives(data) {
21
+ return this.queryBus.execute(new impl_1.GetEndpointRelativesQuery(data));
22
+ }
23
+ };
24
+ exports.EndpointApiService = EndpointApiService;
25
+ exports.EndpointApiService = EndpointApiService = __decorate([
26
+ (0, common_1.Injectable)(),
27
+ __metadata("design:paramtypes", [cqrs_1.QueryBus])
28
+ ], EndpointApiService);
29
+ //# sourceMappingURL=endpoint-api.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"endpoint-api.service.js","sourceRoot":"","sources":["../../../../../src/features/endpoint/queries/endpoint-api.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,uCAAwC;AACxC,iCAI4C;AAGrC,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAC7B,YAA6B,QAAkB;QAAlB,aAAQ,GAAR,QAAQ,CAAU;IAAG,CAAC;IAE5C,oBAAoB,CAAC,IAAmC;QAC7D,OAAO,IAAI,CAAC,QAAQ,CAAC,OAAO,CAG1B,IAAI,gCAAyB,CAAC,IAAI,CAAC,CAAC,CAAC;IACzC,CAAC;CACF,CAAA;AATY,gDAAkB;6BAAlB,kBAAkB;IAD9B,IAAA,mBAAU,GAAE;qCAE4B,eAAQ;GADpC,kBAAkB,CAS9B"}
@@ -0,0 +1,45 @@
1
+ import { IQueryHandler } from '@nestjs/cqrs';
2
+ import { GetEndpointRelativesQuery, GetEndpointRelativesQueryReturnType } from '../../../../features/endpoint/queries/impl';
3
+ import { PrismaService } from '../../../../infrastructure/database/prisma.service';
4
+ export declare class GetEndpointRelativesHandler implements IQueryHandler<GetEndpointRelativesQuery, GetEndpointRelativesQueryReturnType> {
5
+ private readonly prisma;
6
+ constructor(prisma: PrismaService);
7
+ execute({ data }: GetEndpointRelativesQuery): Promise<{
8
+ endpoint: {
9
+ type: import(".prisma/client").$Enums.EndpointType;
10
+ id: string;
11
+ createdAt: Date;
12
+ isDeleted: boolean;
13
+ revisionId: string;
14
+ versionId: string;
15
+ };
16
+ revision: {
17
+ id: string;
18
+ createdAt: Date;
19
+ sequence: number;
20
+ comment: string;
21
+ isHead: boolean;
22
+ isDraft: boolean;
23
+ isStart: boolean;
24
+ hasChanges: boolean;
25
+ branchId: string;
26
+ parentId: string | null;
27
+ };
28
+ branch: {
29
+ id: string;
30
+ name: string;
31
+ createdAt: Date;
32
+ isRoot: boolean;
33
+ projectId: string;
34
+ };
35
+ project: {
36
+ id: string;
37
+ name: string;
38
+ createdAt: Date;
39
+ organizationId: string;
40
+ isPublic: boolean;
41
+ isDeleted: boolean;
42
+ };
43
+ }>;
44
+ private getRelatives;
45
+ }
@@ -0,0 +1,58 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.GetEndpointRelativesHandler = void 0;
13
+ const common_1 = require("@nestjs/common");
14
+ const cqrs_1 = require("@nestjs/cqrs");
15
+ const impl_1 = require("../impl");
16
+ const prisma_service_1 = require("../../../../infrastructure/database/prisma.service");
17
+ let GetEndpointRelativesHandler = class GetEndpointRelativesHandler {
18
+ constructor(prisma) {
19
+ this.prisma = prisma;
20
+ }
21
+ async execute({ data }) {
22
+ const result = await this.getRelatives(data.endpointId);
23
+ if (!result) {
24
+ throw new common_1.NotFoundException('No endpoint found.');
25
+ }
26
+ const { revision: revisionResult, ...endpoint } = result;
27
+ const { branch: branchResult, ...revision } = revisionResult;
28
+ const { project, ...branch } = branchResult;
29
+ return {
30
+ endpoint,
31
+ revision,
32
+ branch,
33
+ project,
34
+ };
35
+ }
36
+ getRelatives(endpointId) {
37
+ return this.prisma.endpoint.findUnique({
38
+ where: { id: endpointId },
39
+ include: {
40
+ revision: {
41
+ include: {
42
+ branch: {
43
+ include: {
44
+ project: true,
45
+ },
46
+ },
47
+ },
48
+ },
49
+ },
50
+ });
51
+ }
52
+ };
53
+ exports.GetEndpointRelativesHandler = GetEndpointRelativesHandler;
54
+ exports.GetEndpointRelativesHandler = GetEndpointRelativesHandler = __decorate([
55
+ (0, cqrs_1.QueryHandler)(impl_1.GetEndpointRelativesQuery),
56
+ __metadata("design:paramtypes", [prisma_service_1.PrismaService])
57
+ ], GetEndpointRelativesHandler);
58
+ //# sourceMappingURL=get-endpoint-relatives.handler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-endpoint-relatives.handler.js","sourceRoot":"","sources":["../../../../../../src/features/endpoint/queries/handlers/get-endpoint-relatives.handler.ts"],"names":[],"m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-endpoint.handler';
2
+ import { GetEndpointRelativesHandler } from '../../../../features/endpoint/queries/handlers/get-endpoint-relatives.handler';
2
3
  import { GetRevisionByEndpointIdHandler } from '../../../../features/endpoint/queries/handlers/get-revision-by-endpoint-id.handler';
3
- export declare const ENDPOINT_QUERIES: (typeof GetCreatedEndpointHandler | typeof GetRevisionByEndpointIdHandler)[];
4
+ export declare const ENDPOINT_QUERIES: (typeof GetCreatedEndpointHandler | typeof GetEndpointRelativesHandler | typeof GetRevisionByEndpointIdHandler)[];
@@ -2,9 +2,11 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ENDPOINT_QUERIES = void 0;
4
4
  const get_created_endpoint_handler_1 = require("./get-created-endpoint.handler");
5
+ const get_endpoint_relatives_handler_1 = require("./get-endpoint-relatives.handler");
5
6
  const get_revision_by_endpoint_id_handler_1 = require("./get-revision-by-endpoint-id.handler");
6
7
  exports.ENDPOINT_QUERIES = [
7
8
  get_created_endpoint_handler_1.GetCreatedEndpointHandler,
8
9
  get_revision_by_endpoint_id_handler_1.GetRevisionByEndpointIdHandler,
10
+ get_endpoint_relatives_handler_1.GetEndpointRelativesHandler,
9
11
  ];
10
12
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/features/endpoint/queries/handlers/index.ts"],"names":[],"mappings":";;;AAAA,iFAAgH;AAChH,+FAA4H;AAE/G,QAAA,gBAAgB,GAAG;IAC9B,wDAAyB;IACzB,oEAA8B;CAC/B,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/features/endpoint/queries/handlers/index.ts"],"names":[],"mappings":";;;AAAA,iFAAgH;AAChH,qFAAoH;AACpH,+FAA4H;AAE/G,QAAA,gBAAgB,GAAG;IAC9B,wDAAyB;IACzB,oEAA8B;IAC9B,4DAA2B;CAC5B,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { Branch, Endpoint, Project, Revision } from '@prisma/client';
2
+ export declare class GetEndpointRelativesQuery {
3
+ readonly data: {
4
+ readonly endpointId: string;
5
+ };
6
+ constructor(data: {
7
+ readonly endpointId: string;
8
+ });
9
+ }
10
+ export type GetEndpointRelativesQueryData = GetEndpointRelativesQuery['data'];
11
+ export type GetEndpointRelativesQueryReturnType = {
12
+ endpoint: Endpoint;
13
+ revision: Revision;
14
+ branch: Branch;
15
+ project: Project;
16
+ };
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetEndpointRelativesQuery = void 0;
4
+ class GetEndpointRelativesQuery {
5
+ constructor(data) {
6
+ this.data = data;
7
+ }
8
+ }
9
+ exports.GetEndpointRelativesQuery = GetEndpointRelativesQuery;
10
+ //# sourceMappingURL=get-endpoint-relatives.query.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-endpoint-relatives.query.js","sourceRoot":"","sources":["../../../../../../src/features/endpoint/queries/impl/get-endpoint-relatives.query.ts"],"names":[],"mappings":";;;AAEA,MAAa,yBAAyB;IACpC,YAA4B,IAAqC;QAArC,SAAI,GAAJ,IAAI,CAAiC;IAAG,CAAC;CACtE;AAFD,8DAEC"}
@@ -1,2 +1,3 @@
1
1
  export * from '../../../../features/endpoint/queries/impl/get-created-endpoint.query';
2
2
  export * from '../../../../features/endpoint/queries/impl/get-revision-by-endpoint-id.query';
3
+ export * from '../../../../features/endpoint/queries/impl/get-endpoint-relatives.query';
@@ -16,4 +16,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./get-created-endpoint.query"), exports);
18
18
  __exportStar(require("./get-revision-by-endpoint-id.query"), exports);
19
+ __exportStar(require("./get-endpoint-relatives.query"), exports);
19
20
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/features/endpoint/queries/impl/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+DAA8E;AAC9E,sEAAqF"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/features/endpoint/queries/impl/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+DAA8E;AAC9E,sEAAqF;AACrF,iEAAgF"}