@owox/backend 0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +144 -0
- package/dist/app.module.js +39 -0
- package/dist/common/authorization-context/authorization.context.js +21 -0
- package/dist/common/common.module.js +21 -0
- package/dist/common/exceptions/access-validation.exception.js +15 -0
- package/dist/common/exceptions/base-exception.filter.js +30 -0
- package/dist/common/exceptions/base.exception.js +3 -0
- package/dist/common/exceptions/business-violation.exception.js +14 -0
- package/dist/common/resolver/type-resolver.js +33 -0
- package/dist/common/resolver/typed-component.resolver.js +3 -0
- package/dist/common/scheduler/facades/scheduler-facade.impl.js +55 -0
- package/dist/common/scheduler/scheduler.module.js +32 -0
- package/dist/common/scheduler/services/fetchers/time-based-trigger-fetcher.factory.js +24 -0
- package/dist/common/scheduler/services/fetchers/time-based-trigger-fetcher.service.js +82 -0
- package/dist/common/scheduler/services/graceful-shutdown.service.js +96 -0
- package/dist/common/scheduler/services/runners/abstract-trigger-runner.service.js +82 -0
- package/dist/common/scheduler/services/runners/direct-trigger-runner.service.js +14 -0
- package/dist/common/scheduler/services/runners/pubsub-trigger-runner.service.js +145 -0
- package/dist/common/scheduler/services/runners/trigger-runner.factory.js +87 -0
- package/dist/common/scheduler/services/runners/trigger-runner.interface.js +3 -0
- package/dist/common/scheduler/services/system-time.service.js +20 -0
- package/dist/common/scheduler/shared/entities/scheduled-trigger.entity.js +47 -0
- package/dist/common/scheduler/shared/entities/time-based-trigger.entity.js +72 -0
- package/dist/common/scheduler/shared/scheduler.facade.js +5 -0
- package/dist/common/scheduler/shared/time-based-trigger-handler.interface.js +3 -0
- package/dist/config/database.config.js +31 -0
- package/dist/config/express-static.config.js +33 -0
- package/dist/config/global-pipes.config.js +12 -0
- package/dist/config/swagger.config.js +16 -0
- package/dist/data-marts/controllers/data-mart.controller.js +182 -0
- package/dist/data-marts/controllers/data-storage.controller.js +124 -0
- package/dist/data-marts/controllers/spec/data-mart.api.js +43 -0
- package/dist/data-marts/controllers/spec/data-storage.api.js +29 -0
- package/dist/data-marts/data-marts.module.js +65 -0
- package/dist/data-marts/data-storage-types/athena/schemas/athena-config.schema.js +10 -0
- package/dist/data-marts/data-storage-types/athena/schemas/athena-credentials.schema.js +12 -0
- package/dist/data-marts/data-storage-types/athena/services/athena-access.validator.js +39 -0
- package/dist/data-marts/data-storage-types/athena/services/athena-title.generator.js +24 -0
- package/dist/data-marts/data-storage-types/bigquery/schemas/bigquery-config.schema.js +9 -0
- package/dist/data-marts/data-storage-types/bigquery/schemas/bigquery-credentials.schema.js +11 -0
- package/dist/data-marts/data-storage-types/bigquery/services/bigquery-access.validator.js +39 -0
- package/dist/data-marts/data-storage-types/bigquery/services/bigquery-title.generator.js +24 -0
- package/dist/data-marts/data-storage-types/data-storage-config.type.js +3 -0
- package/dist/data-marts/data-storage-types/data-storage-facades.js +7 -0
- package/dist/data-marts/data-storage-types/data-storage-providers.js +27 -0
- package/dist/data-marts/data-storage-types/enums/data-storage-type.enum.js +20 -0
- package/dist/data-marts/data-storage-types/facades/data-storage-access.facade.js +38 -0
- package/dist/data-marts/data-storage-types/facades/data-storage-title.facade.js +38 -0
- package/dist/data-marts/data-storage-types/interfaces/data-storage-access-validator.interface.js +15 -0
- package/dist/data-marts/data-storage-types/interfaces/data-storage-title-generator.interface.js +3 -0
- package/dist/data-marts/dto/domain/create-data-mart.command.js +17 -0
- package/dist/data-marts/dto/domain/create-data-storage.command.js +13 -0
- package/dist/data-marts/dto/domain/data-mart.dto.js +27 -0
- package/dist/data-marts/dto/domain/data-storage.dto.js +25 -0
- package/dist/data-marts/dto/domain/delete-data-mart.command.js +15 -0
- package/dist/data-marts/dto/domain/delete-data-storage.command.js +13 -0
- package/dist/data-marts/dto/domain/get-data-mart.command.js +15 -0
- package/dist/data-marts/dto/domain/get-data-storage.command.js +13 -0
- package/dist/data-marts/dto/domain/list-data-marts.command.js +13 -0
- package/dist/data-marts/dto/domain/list-data-storages.command.js +11 -0
- package/dist/data-marts/dto/domain/publish-data-mart.command.js +15 -0
- package/dist/data-marts/dto/domain/update-data-mart-definition.command.js +19 -0
- package/dist/data-marts/dto/domain/update-data-mart-description.command.js +17 -0
- package/dist/data-marts/dto/domain/update-data-mart-title.command.js +17 -0
- package/dist/data-marts/dto/domain/update-data-storage.command.js +19 -0
- package/dist/data-marts/dto/presentation/create-data-mart-request-api.dto.js +32 -0
- package/dist/data-marts/dto/presentation/create-data-mart-response-api.dto.js +27 -0
- package/dist/data-marts/dto/presentation/create-data-storage-api.dto.js +25 -0
- package/dist/data-marts/dto/presentation/data-mart-response-api.dto.js +65 -0
- package/dist/data-marts/dto/presentation/data-storage-list-response-api.dto.js +43 -0
- package/dist/data-marts/dto/presentation/data-storage-response-api.dto.js +64 -0
- package/dist/data-marts/dto/presentation/update-data-mart-definition-api.dto.js +31 -0
- package/dist/data-marts/dto/presentation/update-data-mart-description-api.dto.js +27 -0
- package/dist/data-marts/dto/presentation/update-data-mart-title-api.dto.js +25 -0
- package/dist/data-marts/dto/presentation/update-data-storage-api.dto.js +50 -0
- package/dist/data-marts/dto/schemas/data-mart-table-definitions/data-mart-definition.js +3 -0
- package/dist/data-marts/dto/schemas/data-mart-table-definitions/sql-definition.schema.js +8 -0
- package/dist/data-marts/dto/schemas/data-mart-table-definitions/table-definition.schema.js +8 -0
- package/dist/data-marts/dto/schemas/data-mart-table-definitions/table-pattern-definition.schema.js +8 -0
- package/dist/data-marts/dto/schemas/data-mart-table-definitions/view-definition.schema.js +8 -0
- package/dist/data-marts/entities/data-mart.entity.js +84 -0
- package/dist/data-marts/entities/data-storage.entity.js +66 -0
- package/dist/data-marts/enums/data-mart-definition-type.enum.js +11 -0
- package/dist/data-marts/enums/data-mart-status.enum.js +9 -0
- package/dist/data-marts/mappers/data-mart.mapper.js +87 -0
- package/dist/data-marts/mappers/data-storage.mapper.js +75 -0
- package/dist/data-marts/services/data-mart.service.js +44 -0
- package/dist/data-marts/services/data-storage.service.js +39 -0
- package/dist/data-marts/use-cases/create-data-mart.service.js +51 -0
- package/dist/data-marts/use-cases/create-data-storage.service.js +44 -0
- package/dist/data-marts/use-cases/delete-data-mart.service.js +39 -0
- package/dist/data-marts/use-cases/delete-data-storage.service.js +52 -0
- package/dist/data-marts/use-cases/get-data-mart.service.js +34 -0
- package/dist/data-marts/use-cases/get-data-storage.service.js +34 -0
- package/dist/data-marts/use-cases/list-data-marts.service.js +42 -0
- package/dist/data-marts/use-cases/list-data-storages.service.js +42 -0
- package/dist/data-marts/use-cases/publish-data-mart.service.js +54 -0
- package/dist/data-marts/use-cases/update-data-mart-definition.service.js +51 -0
- package/dist/data-marts/use-cases/update-data-mart-description.service.js +46 -0
- package/dist/data-marts/use-cases/update-data-mart-title.service.js +46 -0
- package/dist/data-marts/use-cases/update-data-storage.service.js +53 -0
- package/dist/main.js +33 -0
- package/dist/public/assets/index-BZJIHZWS.js +502 -0
- package/dist/public/assets/index-BpZgB8Pl.css +1 -0
- package/dist/public/favicon.png +0 -0
- package/dist/public/index.html +14 -0
- package/package.json +106 -0
|
@@ -0,0 +1,64 @@
|
|
|
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.DataStorageResponseApiDto = void 0;
|
|
13
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
+
const data_storage_type_enum_1 = require("../../data-storage-types/enums/data-storage-type.enum");
|
|
15
|
+
class DataStorageResponseApiDto {
|
|
16
|
+
id;
|
|
17
|
+
title;
|
|
18
|
+
type;
|
|
19
|
+
projectId;
|
|
20
|
+
credentials;
|
|
21
|
+
config;
|
|
22
|
+
createdAt;
|
|
23
|
+
modifiedAt;
|
|
24
|
+
}
|
|
25
|
+
exports.DataStorageResponseApiDto = DataStorageResponseApiDto;
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, swagger_1.ApiProperty)({ example: 'abc123e4-5678-90ab-cdef-1234567890ab' }),
|
|
28
|
+
__metadata("design:type", String)
|
|
29
|
+
], DataStorageResponseApiDto.prototype, "id", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, swagger_1.ApiProperty)({ example: 'title' }),
|
|
32
|
+
__metadata("design:type", String)
|
|
33
|
+
], DataStorageResponseApiDto.prototype, "title", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, swagger_1.ApiProperty)({ enum: data_storage_type_enum_1.DataStorageType, example: data_storage_type_enum_1.DataStorageType.GOOGLE_BIGQUERY }),
|
|
36
|
+
__metadata("design:type", String)
|
|
37
|
+
], DataStorageResponseApiDto.prototype, "type", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, swagger_1.ApiProperty)({ example: 'my-project' }),
|
|
40
|
+
__metadata("design:type", String)
|
|
41
|
+
], DataStorageResponseApiDto.prototype, "projectId", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, swagger_1.ApiProperty)({
|
|
44
|
+
type: 'object',
|
|
45
|
+
additionalProperties: true,
|
|
46
|
+
}),
|
|
47
|
+
__metadata("design:type", Object)
|
|
48
|
+
], DataStorageResponseApiDto.prototype, "credentials", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, swagger_1.ApiProperty)({
|
|
51
|
+
type: 'object',
|
|
52
|
+
additionalProperties: true,
|
|
53
|
+
}),
|
|
54
|
+
__metadata("design:type", Object)
|
|
55
|
+
], DataStorageResponseApiDto.prototype, "config", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
(0, swagger_1.ApiProperty)({ example: '2024-01-01T12:00:00.000Z' }),
|
|
58
|
+
__metadata("design:type", Date)
|
|
59
|
+
], DataStorageResponseApiDto.prototype, "createdAt", void 0);
|
|
60
|
+
__decorate([
|
|
61
|
+
(0, swagger_1.ApiProperty)({ example: '2024-01-02T15:30:00.000Z' }),
|
|
62
|
+
__metadata("design:type", Date)
|
|
63
|
+
], DataStorageResponseApiDto.prototype, "modifiedAt", void 0);
|
|
64
|
+
//# sourceMappingURL=data-storage-response-api.dto.js.map
|
|
@@ -0,0 +1,31 @@
|
|
|
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.UpdateDataMartDefinitionApiDto = void 0;
|
|
13
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
+
const data_mart_definition_type_enum_1 = require("../../enums/data-mart-definition-type.enum");
|
|
15
|
+
const class_validator_1 = require("class-validator");
|
|
16
|
+
class UpdateDataMartDefinitionApiDto {
|
|
17
|
+
definitionType;
|
|
18
|
+
definition;
|
|
19
|
+
}
|
|
20
|
+
exports.UpdateDataMartDefinitionApiDto = UpdateDataMartDefinitionApiDto;
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, swagger_1.ApiProperty)({ enum: data_mart_definition_type_enum_1.DataMartDefinitionType, example: data_mart_definition_type_enum_1.DataMartDefinitionType.SQL }),
|
|
23
|
+
(0, class_validator_1.IsEnum)(data_mart_definition_type_enum_1.DataMartDefinitionType),
|
|
24
|
+
__metadata("design:type", String)
|
|
25
|
+
], UpdateDataMartDefinitionApiDto.prototype, "definitionType", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, swagger_1.ApiProperty)({ type: () => Object, required: true }),
|
|
28
|
+
(0, class_validator_1.IsNotEmptyObject)(),
|
|
29
|
+
__metadata("design:type", Object)
|
|
30
|
+
], UpdateDataMartDefinitionApiDto.prototype, "definition", void 0);
|
|
31
|
+
//# sourceMappingURL=update-data-mart-definition-api.dto.js.map
|
|
@@ -0,0 +1,27 @@
|
|
|
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.UpdateDataMartDescriptionApiDto = void 0;
|
|
13
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
class UpdateDataMartDescriptionApiDto {
|
|
16
|
+
description;
|
|
17
|
+
}
|
|
18
|
+
exports.UpdateDataMartDescriptionApiDto = UpdateDataMartDescriptionApiDto;
|
|
19
|
+
__decorate([
|
|
20
|
+
(0, swagger_1.ApiProperty)({ required: false, nullable: true }),
|
|
21
|
+
(0, class_validator_1.IsOptional)(),
|
|
22
|
+
(0, class_validator_1.ValidateIf)(obj => obj.description !== null),
|
|
23
|
+
(0, class_validator_1.IsString)(),
|
|
24
|
+
(0, class_validator_1.MinLength)(1),
|
|
25
|
+
__metadata("design:type", String)
|
|
26
|
+
], UpdateDataMartDescriptionApiDto.prototype, "description", void 0);
|
|
27
|
+
//# sourceMappingURL=update-data-mart-description-api.dto.js.map
|
|
@@ -0,0 +1,25 @@
|
|
|
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.UpdateDataMartTitleApiDto = void 0;
|
|
13
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
class UpdateDataMartTitleApiDto {
|
|
16
|
+
title;
|
|
17
|
+
}
|
|
18
|
+
exports.UpdateDataMartTitleApiDto = UpdateDataMartTitleApiDto;
|
|
19
|
+
__decorate([
|
|
20
|
+
(0, swagger_1.ApiProperty)({ required: true }),
|
|
21
|
+
(0, class_validator_1.IsString)(),
|
|
22
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
23
|
+
__metadata("design:type", String)
|
|
24
|
+
], UpdateDataMartTitleApiDto.prototype, "title", void 0);
|
|
25
|
+
//# sourceMappingURL=update-data-mart-title-api.dto.js.map
|
|
@@ -0,0 +1,50 @@
|
|
|
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.UpdateDataStorageApiDto = void 0;
|
|
13
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
class UpdateDataStorageApiDto {
|
|
16
|
+
title;
|
|
17
|
+
credentials;
|
|
18
|
+
config;
|
|
19
|
+
}
|
|
20
|
+
exports.UpdateDataStorageApiDto = UpdateDataStorageApiDto;
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, swagger_1.ApiProperty)({
|
|
23
|
+
type: 'string',
|
|
24
|
+
description: 'Custom title for the data storage',
|
|
25
|
+
required: true,
|
|
26
|
+
maxLength: 255,
|
|
27
|
+
}),
|
|
28
|
+
(0, class_validator_1.IsString)(),
|
|
29
|
+
(0, class_validator_1.MaxLength)(255, { message: 'Title must be 255 characters or less' }),
|
|
30
|
+
__metadata("design:type", String)
|
|
31
|
+
], UpdateDataStorageApiDto.prototype, "title", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, swagger_1.ApiProperty)({
|
|
34
|
+
type: 'object',
|
|
35
|
+
additionalProperties: true,
|
|
36
|
+
description: 'Credentials required for the selected storage type',
|
|
37
|
+
}),
|
|
38
|
+
(0, class_validator_1.IsObject)(),
|
|
39
|
+
__metadata("design:type", Object)
|
|
40
|
+
], UpdateDataStorageApiDto.prototype, "credentials", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, swagger_1.ApiProperty)({
|
|
43
|
+
type: 'object',
|
|
44
|
+
additionalProperties: true,
|
|
45
|
+
description: 'Configuration specific to the storage type',
|
|
46
|
+
}),
|
|
47
|
+
(0, class_validator_1.IsObject)(),
|
|
48
|
+
__metadata("design:type", Object)
|
|
49
|
+
], UpdateDataStorageApiDto.prototype, "config", void 0);
|
|
50
|
+
//# sourceMappingURL=update-data-storage-api.dto.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SqlDefinitionSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.SqlDefinitionSchema = zod_1.z.object({
|
|
6
|
+
sqlQuery: zod_1.z.string().min(1, 'sql query is required'),
|
|
7
|
+
});
|
|
8
|
+
//# sourceMappingURL=sql-definition.schema.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TableDefinitionSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.TableDefinitionSchema = zod_1.z.object({
|
|
6
|
+
fullyQualifiedName: zod_1.z.string().min(1, 'fully qualified name is required'),
|
|
7
|
+
});
|
|
8
|
+
//# sourceMappingURL=table-definition.schema.js.map
|
package/dist/data-marts/dto/schemas/data-mart-table-definitions/table-pattern-definition.schema.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TablePatternDefinitionSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.TablePatternDefinitionSchema = zod_1.z.object({
|
|
6
|
+
pattern: zod_1.z.string().min(2, 'pattern is required'),
|
|
7
|
+
});
|
|
8
|
+
//# sourceMappingURL=table-pattern-definition.schema.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ViewDefinitionSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.ViewDefinitionSchema = zod_1.z.object({
|
|
6
|
+
fullyQualifiedName: zod_1.z.string().min(1, 'fully qualified name is required'),
|
|
7
|
+
});
|
|
8
|
+
//# sourceMappingURL=view-definition.schema.js.map
|
|
@@ -0,0 +1,84 @@
|
|
|
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.DataMart = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const data_storage_entity_1 = require("./data-storage.entity");
|
|
15
|
+
const data_mart_status_enum_1 = require("../enums/data-mart-status.enum");
|
|
16
|
+
const data_mart_definition_type_enum_1 = require("../enums/data-mart-definition-type.enum");
|
|
17
|
+
let DataMart = class DataMart {
|
|
18
|
+
id;
|
|
19
|
+
title;
|
|
20
|
+
storage;
|
|
21
|
+
definitionType;
|
|
22
|
+
definition;
|
|
23
|
+
status;
|
|
24
|
+
description;
|
|
25
|
+
projectId;
|
|
26
|
+
createdById;
|
|
27
|
+
deletedAt;
|
|
28
|
+
createdAt;
|
|
29
|
+
modifiedAt;
|
|
30
|
+
};
|
|
31
|
+
exports.DataMart = DataMart;
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
34
|
+
__metadata("design:type", String)
|
|
35
|
+
], DataMart.prototype, "id", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, typeorm_1.Column)(),
|
|
38
|
+
__metadata("design:type", String)
|
|
39
|
+
], DataMart.prototype, "title", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, typeorm_1.ManyToOne)(() => data_storage_entity_1.DataStorage, { eager: true, cascade: true }),
|
|
42
|
+
(0, typeorm_1.JoinColumn)(),
|
|
43
|
+
__metadata("design:type", data_storage_entity_1.DataStorage)
|
|
44
|
+
], DataMart.prototype, "storage", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
47
|
+
__metadata("design:type", String)
|
|
48
|
+
], DataMart.prototype, "definitionType", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, typeorm_1.Column)({ type: 'json', nullable: true }),
|
|
51
|
+
__metadata("design:type", Object)
|
|
52
|
+
], DataMart.prototype, "definition", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
(0, typeorm_1.Column)({ default: data_mart_status_enum_1.DataMartStatus.DRAFT }),
|
|
55
|
+
__metadata("design:type", String)
|
|
56
|
+
], DataMart.prototype, "status", void 0);
|
|
57
|
+
__decorate([
|
|
58
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: true }),
|
|
59
|
+
__metadata("design:type", String)
|
|
60
|
+
], DataMart.prototype, "description", void 0);
|
|
61
|
+
__decorate([
|
|
62
|
+
(0, typeorm_1.Column)(),
|
|
63
|
+
__metadata("design:type", String)
|
|
64
|
+
], DataMart.prototype, "projectId", void 0);
|
|
65
|
+
__decorate([
|
|
66
|
+
(0, typeorm_1.Column)(),
|
|
67
|
+
__metadata("design:type", String)
|
|
68
|
+
], DataMart.prototype, "createdById", void 0);
|
|
69
|
+
__decorate([
|
|
70
|
+
(0, typeorm_1.DeleteDateColumn)({ nullable: true }),
|
|
71
|
+
__metadata("design:type", Date)
|
|
72
|
+
], DataMart.prototype, "deletedAt", void 0);
|
|
73
|
+
__decorate([
|
|
74
|
+
(0, typeorm_1.CreateDateColumn)(),
|
|
75
|
+
__metadata("design:type", Date)
|
|
76
|
+
], DataMart.prototype, "createdAt", void 0);
|
|
77
|
+
__decorate([
|
|
78
|
+
(0, typeorm_1.UpdateDateColumn)(),
|
|
79
|
+
__metadata("design:type", Date)
|
|
80
|
+
], DataMart.prototype, "modifiedAt", void 0);
|
|
81
|
+
exports.DataMart = DataMart = __decorate([
|
|
82
|
+
(0, typeorm_1.Entity)()
|
|
83
|
+
], DataMart);
|
|
84
|
+
//# sourceMappingURL=data-mart.entity.js.map
|
|
@@ -0,0 +1,66 @@
|
|
|
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.DataStorage = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const data_storage_type_enum_1 = require("../data-storage-types/enums/data-storage-type.enum");
|
|
15
|
+
let DataStorage = class DataStorage {
|
|
16
|
+
id;
|
|
17
|
+
type;
|
|
18
|
+
projectId;
|
|
19
|
+
title;
|
|
20
|
+
credentials;
|
|
21
|
+
config;
|
|
22
|
+
deletedAt;
|
|
23
|
+
createdAt;
|
|
24
|
+
modifiedAt;
|
|
25
|
+
};
|
|
26
|
+
exports.DataStorage = DataStorage;
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
29
|
+
__metadata("design:type", String)
|
|
30
|
+
], DataStorage.prototype, "id", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, typeorm_1.Column)(),
|
|
33
|
+
__metadata("design:type", String)
|
|
34
|
+
], DataStorage.prototype, "type", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, typeorm_1.Column)(),
|
|
37
|
+
__metadata("design:type", String)
|
|
38
|
+
], DataStorage.prototype, "projectId", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, typeorm_1.Column)({ length: 255, nullable: true }),
|
|
41
|
+
__metadata("design:type", String)
|
|
42
|
+
], DataStorage.prototype, "title", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, typeorm_1.Column)({ type: 'json', nullable: true }),
|
|
45
|
+
__metadata("design:type", Object)
|
|
46
|
+
], DataStorage.prototype, "credentials", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, typeorm_1.Column)({ type: 'json', nullable: true }),
|
|
49
|
+
__metadata("design:type", Object)
|
|
50
|
+
], DataStorage.prototype, "config", void 0);
|
|
51
|
+
__decorate([
|
|
52
|
+
(0, typeorm_1.DeleteDateColumn)({ nullable: true }),
|
|
53
|
+
__metadata("design:type", Date)
|
|
54
|
+
], DataStorage.prototype, "deletedAt", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
(0, typeorm_1.CreateDateColumn)(),
|
|
57
|
+
__metadata("design:type", Date)
|
|
58
|
+
], DataStorage.prototype, "createdAt", void 0);
|
|
59
|
+
__decorate([
|
|
60
|
+
(0, typeorm_1.UpdateDateColumn)(),
|
|
61
|
+
__metadata("design:type", Date)
|
|
62
|
+
], DataStorage.prototype, "modifiedAt", void 0);
|
|
63
|
+
exports.DataStorage = DataStorage = __decorate([
|
|
64
|
+
(0, typeorm_1.Entity)()
|
|
65
|
+
], DataStorage);
|
|
66
|
+
//# sourceMappingURL=data-storage.entity.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DataMartDefinitionType = void 0;
|
|
4
|
+
var DataMartDefinitionType;
|
|
5
|
+
(function (DataMartDefinitionType) {
|
|
6
|
+
DataMartDefinitionType["SQL"] = "SQL";
|
|
7
|
+
DataMartDefinitionType["TABLE"] = "TABLE";
|
|
8
|
+
DataMartDefinitionType["VIEW"] = "VIEW";
|
|
9
|
+
DataMartDefinitionType["TABLE_PATTERN"] = "TABLE_PATTERN";
|
|
10
|
+
})(DataMartDefinitionType || (exports.DataMartDefinitionType = DataMartDefinitionType = {}));
|
|
11
|
+
//# sourceMappingURL=data-mart-definition-type.enum.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DataMartStatus = void 0;
|
|
4
|
+
var DataMartStatus;
|
|
5
|
+
(function (DataMartStatus) {
|
|
6
|
+
DataMartStatus["DRAFT"] = "DRAFT";
|
|
7
|
+
DataMartStatus["PUBLISHED"] = "PUBLISHED";
|
|
8
|
+
})(DataMartStatus || (exports.DataMartStatus = DataMartStatus = {}));
|
|
9
|
+
//# sourceMappingURL=data-mart-status.enum.js.map
|
|
@@ -0,0 +1,87 @@
|
|
|
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.DataMartMapper = void 0;
|
|
13
|
+
const common_1 = require("@nestjs/common");
|
|
14
|
+
const create_data_mart_command_1 = require("../dto/domain/create-data-mart.command");
|
|
15
|
+
const data_mart_dto_1 = require("../dto/domain/data-mart.dto");
|
|
16
|
+
const update_data_mart_definition_command_1 = require("../dto/domain/update-data-mart-definition.command");
|
|
17
|
+
const get_data_mart_command_1 = require("../dto/domain/get-data-mart.command");
|
|
18
|
+
const list_data_marts_command_1 = require("../dto/domain/list-data-marts.command");
|
|
19
|
+
const update_data_mart_title_command_1 = require("../dto/domain/update-data-mart-title.command");
|
|
20
|
+
const update_data_mart_description_command_1 = require("../dto/domain/update-data-mart-description.command");
|
|
21
|
+
const publish_data_mart_command_1 = require("../dto/domain/publish-data-mart.command");
|
|
22
|
+
const data_storage_mapper_1 = require("./data-storage.mapper");
|
|
23
|
+
const delete_data_mart_command_1 = require("../dto/domain/delete-data-mart.command");
|
|
24
|
+
let DataMartMapper = class DataMartMapper {
|
|
25
|
+
dataStorageMapper;
|
|
26
|
+
constructor(dataStorageMapper) {
|
|
27
|
+
this.dataStorageMapper = dataStorageMapper;
|
|
28
|
+
}
|
|
29
|
+
toCreateDomainCommand(context, dto) {
|
|
30
|
+
return new create_data_mart_command_1.CreateDataMartCommand(context.projectId, context.userId, dto.title, dto.storageId);
|
|
31
|
+
}
|
|
32
|
+
toDomainDto(entity) {
|
|
33
|
+
return new data_mart_dto_1.DataMartDto(entity.id, entity.title, entity.status, this.dataStorageMapper.toDomainDto(entity.storage), entity.createdAt, entity.modifiedAt, entity.definitionType, entity.definition, entity.description);
|
|
34
|
+
}
|
|
35
|
+
toDomainDtoList(entities) {
|
|
36
|
+
return entities.map(entity => this.toDomainDto(entity));
|
|
37
|
+
}
|
|
38
|
+
toCreateResponse(dto) {
|
|
39
|
+
return {
|
|
40
|
+
id: dto.id,
|
|
41
|
+
title: dto.title,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
toResponse(dto) {
|
|
45
|
+
return {
|
|
46
|
+
id: dto.id,
|
|
47
|
+
title: dto.title,
|
|
48
|
+
status: dto.status,
|
|
49
|
+
storage: this.dataStorageMapper.toApiResponse(dto.storage),
|
|
50
|
+
definitionType: dto.definitionType,
|
|
51
|
+
definition: dto.definition,
|
|
52
|
+
description: dto.description,
|
|
53
|
+
createdAt: dto.createdAt,
|
|
54
|
+
modifiedAt: dto.modifiedAt,
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
toResponseList(dtos) {
|
|
58
|
+
return dtos.map(dto => this.toResponse(dto));
|
|
59
|
+
}
|
|
60
|
+
toUpdateDefinitionCommand(id, context, dto) {
|
|
61
|
+
return new update_data_mart_definition_command_1.UpdateDataMartDefinitionCommand(id, context.projectId, context.userId, dto.definitionType, dto.definition);
|
|
62
|
+
}
|
|
63
|
+
toGetCommand(id, context) {
|
|
64
|
+
return new get_data_mart_command_1.GetDataMartCommand(id, context.projectId, context.userId);
|
|
65
|
+
}
|
|
66
|
+
toListCommand(context) {
|
|
67
|
+
return new list_data_marts_command_1.ListDataMartsCommand(context.projectId, context.userId);
|
|
68
|
+
}
|
|
69
|
+
toUpdateTitleCommand(id, context, dto) {
|
|
70
|
+
return new update_data_mart_title_command_1.UpdateDataMartTitleCommand(id, context.projectId, context.userId, dto.title);
|
|
71
|
+
}
|
|
72
|
+
toUpdateDescriptionCommand(id, context, dto) {
|
|
73
|
+
return new update_data_mart_description_command_1.UpdateDataMartDescriptionCommand(id, context.projectId, context.userId, dto.description);
|
|
74
|
+
}
|
|
75
|
+
toPublishCommand(id, context) {
|
|
76
|
+
return new publish_data_mart_command_1.PublishDataMartCommand(id, context.projectId, context.userId);
|
|
77
|
+
}
|
|
78
|
+
toDeleteCommand(id, context) {
|
|
79
|
+
return new delete_data_mart_command_1.DeleteDataMartCommand(id, context.projectId, context.userId);
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
exports.DataMartMapper = DataMartMapper;
|
|
83
|
+
exports.DataMartMapper = DataMartMapper = __decorate([
|
|
84
|
+
(0, common_1.Injectable)(),
|
|
85
|
+
__metadata("design:paramtypes", [data_storage_mapper_1.DataStorageMapper])
|
|
86
|
+
], DataMartMapper);
|
|
87
|
+
//# sourceMappingURL=data-mart.mapper.js.map
|
|
@@ -0,0 +1,75 @@
|
|
|
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.DataStorageMapper = void 0;
|
|
13
|
+
const data_storage_dto_1 = require("../dto/domain/data-storage.dto");
|
|
14
|
+
const create_data_storage_command_1 = require("../dto/domain/create-data-storage.command");
|
|
15
|
+
const update_data_storage_command_1 = require("../dto/domain/update-data-storage.command");
|
|
16
|
+
const data_storage_title_facade_1 = require("../data-storage-types/facades/data-storage-title.facade");
|
|
17
|
+
const common_1 = require("@nestjs/common");
|
|
18
|
+
const get_data_storage_command_1 = require("../dto/domain/get-data-storage.command");
|
|
19
|
+
const delete_data_storage_command_1 = require("../dto/domain/delete-data-storage.command");
|
|
20
|
+
const list_data_storages_command_1 = require("../dto/domain/list-data-storages.command");
|
|
21
|
+
const data_storage_type_enum_1 = require("../data-storage-types/enums/data-storage-type.enum");
|
|
22
|
+
let DataStorageMapper = class DataStorageMapper {
|
|
23
|
+
dataStorageTitleFacade;
|
|
24
|
+
constructor(dataStorageTitleFacade) {
|
|
25
|
+
this.dataStorageTitleFacade = dataStorageTitleFacade;
|
|
26
|
+
}
|
|
27
|
+
toCreateCommand(context, dto) {
|
|
28
|
+
return new create_data_storage_command_1.CreateDataStorageCommand(context.projectId, dto.type);
|
|
29
|
+
}
|
|
30
|
+
toUpdateCommand(id, context, dto) {
|
|
31
|
+
return new update_data_storage_command_1.UpdateDataStorageCommand(id, context.projectId, dto.credentials, dto.config, dto.title.trim());
|
|
32
|
+
}
|
|
33
|
+
toDomainDto(dataStorage) {
|
|
34
|
+
return new data_storage_dto_1.DataStorageDto(dataStorage.id, dataStorage.title || (0, data_storage_type_enum_1.toHumanReadable)(dataStorage.type), dataStorage.type, dataStorage.projectId, dataStorage.credentials, dataStorage.config, dataStorage.createdAt, dataStorage.modifiedAt);
|
|
35
|
+
}
|
|
36
|
+
toDomainDtoList(dataStorages) {
|
|
37
|
+
return dataStorages.map(dataStorage => this.toDomainDto(dataStorage));
|
|
38
|
+
}
|
|
39
|
+
toApiResponse(dataStorageDto) {
|
|
40
|
+
return {
|
|
41
|
+
id: dataStorageDto.id,
|
|
42
|
+
title: dataStorageDto.title,
|
|
43
|
+
type: dataStorageDto.type,
|
|
44
|
+
projectId: dataStorageDto.projectId,
|
|
45
|
+
credentials: dataStorageDto.credentials,
|
|
46
|
+
config: dataStorageDto.config,
|
|
47
|
+
createdAt: dataStorageDto.createdAt,
|
|
48
|
+
modifiedAt: dataStorageDto.modifiedAt,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
toGetCommand(id, context) {
|
|
52
|
+
return new get_data_storage_command_1.GetDataStorageCommand(id, context.projectId);
|
|
53
|
+
}
|
|
54
|
+
toListCommand(context) {
|
|
55
|
+
return new list_data_storages_command_1.ListDataStoragesCommand(context.projectId);
|
|
56
|
+
}
|
|
57
|
+
toResponseList(dataStorages) {
|
|
58
|
+
return dataStorages.map(dataStorageDto => ({
|
|
59
|
+
id: dataStorageDto.id,
|
|
60
|
+
title: dataStorageDto.title,
|
|
61
|
+
type: dataStorageDto.type,
|
|
62
|
+
createdAt: dataStorageDto.createdAt,
|
|
63
|
+
modifiedAt: dataStorageDto.modifiedAt,
|
|
64
|
+
}));
|
|
65
|
+
}
|
|
66
|
+
toDeleteCommand(id, context) {
|
|
67
|
+
return new delete_data_storage_command_1.DeleteDataStorageCommand(id, context.projectId);
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
exports.DataStorageMapper = DataStorageMapper;
|
|
71
|
+
exports.DataStorageMapper = DataStorageMapper = __decorate([
|
|
72
|
+
(0, common_1.Injectable)(),
|
|
73
|
+
__metadata("design:paramtypes", [data_storage_title_facade_1.DataStorageTitleFacade])
|
|
74
|
+
], DataStorageMapper);
|
|
75
|
+
//# sourceMappingURL=data-storage.mapper.js.map
|
|
@@ -0,0 +1,44 @@
|
|
|
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.DataMartService = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const typeorm_1 = require("@nestjs/typeorm");
|
|
18
|
+
const typeorm_2 = require("typeorm");
|
|
19
|
+
const data_mart_entity_1 = require("../entities/data-mart.entity");
|
|
20
|
+
let DataMartService = class DataMartService {
|
|
21
|
+
dataMartRepository;
|
|
22
|
+
constructor(dataMartRepository) {
|
|
23
|
+
this.dataMartRepository = dataMartRepository;
|
|
24
|
+
}
|
|
25
|
+
async getByIdAndProjectIdAndUserId(id, projectId, userId) {
|
|
26
|
+
const entity = await this.dataMartRepository.findOne({
|
|
27
|
+
where: { id, projectId, createdById: userId },
|
|
28
|
+
});
|
|
29
|
+
if (!entity) {
|
|
30
|
+
throw new common_1.NotFoundException(`DataMart with id ${id} and projectId ${projectId} and userId ${userId} not found`);
|
|
31
|
+
}
|
|
32
|
+
return entity;
|
|
33
|
+
}
|
|
34
|
+
async findByStorage(storage) {
|
|
35
|
+
return this.dataMartRepository.find({ where: { storage: { id: storage.id } } });
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
exports.DataMartService = DataMartService;
|
|
39
|
+
exports.DataMartService = DataMartService = __decorate([
|
|
40
|
+
(0, common_1.Injectable)(),
|
|
41
|
+
__param(0, (0, typeorm_1.InjectRepository)(data_mart_entity_1.DataMart)),
|
|
42
|
+
__metadata("design:paramtypes", [typeorm_2.Repository])
|
|
43
|
+
], DataMartService);
|
|
44
|
+
//# sourceMappingURL=data-mart.service.js.map
|