yegara 1.0.30 → 1.0.32
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/src/generics/drizzle/services/relation-crud.service.js.map +1 -1
- package/dist/src/generics/typeorm/controllers/dto/id.dto.d.ts +12 -0
- package/dist/src/generics/typeorm/controllers/dto/id.dto.js +59 -0
- package/dist/src/generics/typeorm/controllers/dto/id.dto.js.map +1 -0
- package/dist/src/generics/typeorm/controllers/dto/index.d.ts +2 -0
- package/dist/src/generics/typeorm/controllers/dto/index.js +19 -0
- package/dist/src/generics/typeorm/controllers/dto/index.js.map +1 -0
- package/dist/src/generics/typeorm/controllers/file-crud.controller.d.ts +2 -0
- package/dist/src/generics/typeorm/controllers/file-crud.controller.js +125 -0
- package/dist/src/generics/typeorm/controllers/file-crud.controller.js.map +1 -0
- package/dist/src/generics/typeorm/controllers/index.d.ts +2 -0
- package/dist/src/generics/typeorm/controllers/index.js +2 -0
- package/dist/src/generics/typeorm/controllers/index.js.map +1 -1
- package/dist/src/generics/typeorm/services/file-crud.service.d.ts +117 -0
- package/dist/src/generics/typeorm/services/file-crud.service.js +113 -0
- package/dist/src/generics/typeorm/services/file-crud.service.js.map +1 -0
- package/dist/src/generics/typeorm/services/index.d.ts +1 -0
- package/dist/src/generics/typeorm/services/index.js +1 -0
- package/dist/src/generics/typeorm/services/index.js.map +1 -1
- package/dist/src/modules/index.d.ts +1 -0
- package/dist/src/modules/index.js +1 -0
- package/dist/src/modules/index.js.map +1 -1
- package/dist/src/modules/minio/index.d.ts +4 -0
- package/dist/src/modules/minio/index.js +21 -0
- package/dist/src/modules/minio/index.js.map +1 -0
- package/dist/src/modules/minio/minio.config.d.ts +8 -0
- package/dist/src/modules/minio/minio.config.js +11 -0
- package/dist/src/modules/minio/minio.config.js.map +1 -0
- package/dist/src/modules/minio/minio.module.d.ts +2 -0
- package/dist/src/modules/minio/minio.module.js +24 -0
- package/dist/src/modules/minio/minio.module.js.map +1 -0
- package/dist/src/modules/minio/minio.service.d.ts +22 -0
- package/dist/src/modules/minio/minio.service.js +136 -0
- package/dist/src/modules/minio/minio.service.js.map +1 -0
- package/dist/src/modules/minio/minio.type.d.ts +27 -0
- package/dist/src/modules/minio/minio.type.js +72 -0
- package/dist/src/modules/minio/minio.type.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"relation-crud.service.js","sourceRoot":"","sources":["../../../../../src/generics/drizzle/services/relation-crud.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,6CAAkD;AAClD,6DAA2D;AAIpD,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IAC7B,YACuB,EAAuB,EACzB,MAA+B,EAC/B,WAAoC,EACpC,YAAqC,EACrC,cAAsB,EACtB,eAAuB;QALrB,OAAE,GAAF,EAAE,CAAqB;QACzB,WAAM,GAAN,MAAM,CAAyB;QAC/B,gBAAW,GAAX,WAAW,CAAyB;QACpC,iBAAY,GAAZ,YAAY,CAAyB;QACrC,mBAAc,GAAd,cAAc,CAAQ;QACtB,oBAAe,GAAf,eAAe,CAAQ;
|
|
1
|
+
{"version":3,"file":"relation-crud.service.js","sourceRoot":"","sources":["../../../../../src/generics/drizzle/services/relation-crud.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,6CAAkD;AAClD,6DAA2D;AAIpD,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IAC7B,YACuB,EAAuB,EACzB,MAA+B,EAC/B,WAAoC,EACpC,YAAqC,EACrC,cAAsB,EACtB,eAAuB;QALrB,OAAE,GAAF,EAAE,CAAqB;QACzB,WAAM,GAAN,MAAM,CAAyB;QAC/B,gBAAW,GAAX,WAAW,CAAyB;QACpC,iBAAY,GAAZ,YAAY,CAAyB;QACrC,mBAAc,GAAd,cAAc,CAAQ;QACtB,oBAAe,GAAf,eAAe,CA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;iBAC5G,SAAS,EAAE,CAAA;YAEhB,OAAO,MAAM,CAAA;QACjB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,OAAO,CAAC,KAAK,CAAC,uBAAuB,EAAE,KAAK,CAAC,CAAC;YAC9C,MAAM,KAAK,CAAC;QAChB,CAAC;IACL,CAAC;CAEJ,CAAA;AA1FY,oDAAoB;+BAApB,oBAAoB;IADhC,IAAA,mBAAU,GAAE;qCAGkB,8BAAc;GAFhC,oBAAoB,CA0FhC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare class IdParamDto {
|
|
2
|
+
id: string;
|
|
3
|
+
}
|
|
4
|
+
export declare class OptionalIdParamDto {
|
|
5
|
+
id: string;
|
|
6
|
+
}
|
|
7
|
+
export declare class IsCurrentDto {
|
|
8
|
+
isCurrent: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare class UploadFileStatusDto {
|
|
11
|
+
uploadedSuccessfully: boolean;
|
|
12
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
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.UploadFileStatusDto = exports.IsCurrentDto = exports.OptionalIdParamDto = exports.IdParamDto = void 0;
|
|
13
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
class IdParamDto {
|
|
16
|
+
}
|
|
17
|
+
exports.IdParamDto = IdParamDto;
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, swagger_1.ApiProperty)({
|
|
20
|
+
description: "A valid UUID",
|
|
21
|
+
}),
|
|
22
|
+
(0, class_validator_1.IsUUID)(),
|
|
23
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
24
|
+
__metadata("design:type", String)
|
|
25
|
+
], IdParamDto.prototype, "id", void 0);
|
|
26
|
+
class OptionalIdParamDto {
|
|
27
|
+
}
|
|
28
|
+
exports.OptionalIdParamDto = OptionalIdParamDto;
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, swagger_1.ApiProperty)({
|
|
31
|
+
description: "A valid UUID",
|
|
32
|
+
}),
|
|
33
|
+
(0, class_validator_1.IsUUID)(),
|
|
34
|
+
(0, class_validator_1.IsOptional)(),
|
|
35
|
+
__metadata("design:type", String)
|
|
36
|
+
], OptionalIdParamDto.prototype, "id", void 0);
|
|
37
|
+
class IsCurrentDto {
|
|
38
|
+
}
|
|
39
|
+
exports.IsCurrentDto = IsCurrentDto;
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, swagger_1.ApiProperty)({
|
|
42
|
+
description: "A boolean",
|
|
43
|
+
}),
|
|
44
|
+
(0, class_validator_1.IsBoolean)(),
|
|
45
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
46
|
+
__metadata("design:type", Boolean)
|
|
47
|
+
], IsCurrentDto.prototype, "isCurrent", void 0);
|
|
48
|
+
class UploadFileStatusDto {
|
|
49
|
+
}
|
|
50
|
+
exports.UploadFileStatusDto = UploadFileStatusDto;
|
|
51
|
+
__decorate([
|
|
52
|
+
(0, swagger_1.ApiProperty)({
|
|
53
|
+
description: "A boolean",
|
|
54
|
+
}),
|
|
55
|
+
(0, class_validator_1.IsBoolean)(),
|
|
56
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
57
|
+
__metadata("design:type", Boolean)
|
|
58
|
+
], UploadFileStatusDto.prototype, "uploadedSuccessfully", void 0);
|
|
59
|
+
//# sourceMappingURL=id.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"id.dto.js","sourceRoot":"","sources":["../../../../../../src/generics/typeorm/controllers/dto/id.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAA8C;AAC9C,qDAA4E;AAE5E,MAAa,UAAU;CAOtB;AAPD,gCAOC;AADA;IALC,IAAA,qBAAW,EAAC;QACZ,WAAW,EAAE,cAAc;KAC3B,CAAC;IACD,IAAA,wBAAM,GAAE;IACR,IAAA,4BAAU,GAAE;;sCACF;AAGZ,MAAa,kBAAkB;CAO9B;AAPD,gDAOC;AADA;IALC,IAAA,qBAAW,EAAC;QACZ,WAAW,EAAE,cAAc;KAC3B,CAAC;IACD,IAAA,wBAAM,GAAE;IACR,IAAA,4BAAU,GAAE;;8CACF;AAGZ,MAAa,YAAY;CAOxB;AAPD,oCAOC;AADA;IALC,IAAA,qBAAW,EAAC;QACZ,WAAW,EAAE,WAAW;KACxB,CAAC;IACD,IAAA,2BAAS,GAAE;IACX,IAAA,4BAAU,GAAE;;+CACM;AAGpB,MAAa,mBAAmB;CAO/B;AAPD,kDAOC;AADA;IALC,IAAA,qBAAW,EAAC;QACZ,WAAW,EAAE,WAAW;KACxB,CAAC;IACD,IAAA,2BAAS,GAAE;IACX,IAAA,4BAAU,GAAE;;iEACiB"}
|
|
@@ -0,0 +1,19 @@
|
|
|
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("./id.dto"), exports);
|
|
18
|
+
__exportStar(require("./validate.dto"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/generics/typeorm/controllers/dto/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,iDAA+B"}
|
|
@@ -0,0 +1,125 @@
|
|
|
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.FileCrudController = FileCrudController;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
18
|
+
const validate_dto_1 = require("./dto/validate.dto");
|
|
19
|
+
const id_dto_1 = require("./dto/id.dto");
|
|
20
|
+
const file_crud_service_1 = require("../services/file-crud.service");
|
|
21
|
+
function FileCrudController(options) {
|
|
22
|
+
let FileCrudControllerHost = class FileCrudControllerHost {
|
|
23
|
+
constructor(fileCrudService) {
|
|
24
|
+
this.fileCrudService = fileCrudService;
|
|
25
|
+
}
|
|
26
|
+
async create(itemData) {
|
|
27
|
+
if (options === null || options === void 0 ? void 0 : options.createDto)
|
|
28
|
+
await (0, validate_dto_1.validateDto)(options.createDto, itemData);
|
|
29
|
+
return await this.fileCrudService.create(itemData);
|
|
30
|
+
}
|
|
31
|
+
async findAll(itemData) {
|
|
32
|
+
return await this.fileCrudService.findAll(itemData.id);
|
|
33
|
+
}
|
|
34
|
+
async findAllWithPresigned(itemData) {
|
|
35
|
+
return await this.fileCrudService.findAllWithPresigned(itemData.id);
|
|
36
|
+
}
|
|
37
|
+
async findOne(idParamDto) {
|
|
38
|
+
return await this.fileCrudService.findOne(idParamDto.id);
|
|
39
|
+
}
|
|
40
|
+
async update(param, itemData) {
|
|
41
|
+
if (options === null || options === void 0 ? void 0 : options.updateDto)
|
|
42
|
+
await (0, validate_dto_1.validateDto)(options.updateDto, itemData);
|
|
43
|
+
return await this.fileCrudService.update(param.id, itemData);
|
|
44
|
+
}
|
|
45
|
+
async changeStatus(param, body) {
|
|
46
|
+
return await this.fileCrudService.changeStatus(param.id, body.isCurrent);
|
|
47
|
+
}
|
|
48
|
+
async delete(param) {
|
|
49
|
+
return await this.fileCrudService.delete(param.id);
|
|
50
|
+
}
|
|
51
|
+
async uploadStatus(param, body) {
|
|
52
|
+
return await this.fileCrudService.uploadStatus(param.id, body.uploadedSuccessfully);
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
__decorate([
|
|
56
|
+
(0, common_1.Post)(""),
|
|
57
|
+
(0, swagger_1.ApiBody)({ type: options === null || options === void 0 ? void 0 : options.createDto }),
|
|
58
|
+
__param(0, (0, common_1.Body)()),
|
|
59
|
+
__metadata("design:type", Function),
|
|
60
|
+
__metadata("design:paramtypes", [Object]),
|
|
61
|
+
__metadata("design:returntype", Promise)
|
|
62
|
+
], FileCrudControllerHost.prototype, "create", null);
|
|
63
|
+
__decorate([
|
|
64
|
+
(0, common_1.Get)("/list/:id"),
|
|
65
|
+
__param(0, (0, common_1.Param)()),
|
|
66
|
+
__metadata("design:type", Function),
|
|
67
|
+
__metadata("design:paramtypes", [id_dto_1.IdParamDto]),
|
|
68
|
+
__metadata("design:returntype", Promise)
|
|
69
|
+
], FileCrudControllerHost.prototype, "findAll", null);
|
|
70
|
+
__decorate([
|
|
71
|
+
(0, common_1.Get)("/list-with-presigned/:id"),
|
|
72
|
+
__param(0, (0, common_1.Param)()),
|
|
73
|
+
__metadata("design:type", Function),
|
|
74
|
+
__metadata("design:paramtypes", [id_dto_1.IdParamDto]),
|
|
75
|
+
__metadata("design:returntype", Promise)
|
|
76
|
+
], FileCrudControllerHost.prototype, "findAllWithPresigned", null);
|
|
77
|
+
__decorate([
|
|
78
|
+
(0, common_1.Get)("/:id"),
|
|
79
|
+
__param(0, (0, common_1.Param)()),
|
|
80
|
+
__metadata("design:type", Function),
|
|
81
|
+
__metadata("design:paramtypes", [id_dto_1.IdParamDto]),
|
|
82
|
+
__metadata("design:returntype", Promise)
|
|
83
|
+
], FileCrudControllerHost.prototype, "findOne", null);
|
|
84
|
+
__decorate([
|
|
85
|
+
(0, common_1.Put)("/:id"),
|
|
86
|
+
(0, swagger_1.ApiBody)({ type: options === null || options === void 0 ? void 0 : options.updateDto }),
|
|
87
|
+
__param(0, (0, common_1.Param)()),
|
|
88
|
+
__param(1, (0, common_1.Body)()),
|
|
89
|
+
__metadata("design:type", Function),
|
|
90
|
+
__metadata("design:paramtypes", [id_dto_1.IdParamDto, Object]),
|
|
91
|
+
__metadata("design:returntype", Promise)
|
|
92
|
+
], FileCrudControllerHost.prototype, "update", null);
|
|
93
|
+
__decorate([
|
|
94
|
+
(0, common_1.Put)("/change-status/:id"),
|
|
95
|
+
__param(0, (0, common_1.Param)()),
|
|
96
|
+
__param(1, (0, common_1.Body)()),
|
|
97
|
+
__metadata("design:type", Function),
|
|
98
|
+
__metadata("design:paramtypes", [id_dto_1.IdParamDto,
|
|
99
|
+
id_dto_1.IsCurrentDto]),
|
|
100
|
+
__metadata("design:returntype", Promise)
|
|
101
|
+
], FileCrudControllerHost.prototype, "changeStatus", null);
|
|
102
|
+
__decorate([
|
|
103
|
+
(0, common_1.Delete)("/:id"),
|
|
104
|
+
__param(0, (0, common_1.Param)()),
|
|
105
|
+
__metadata("design:type", Function),
|
|
106
|
+
__metadata("design:paramtypes", [id_dto_1.IdParamDto]),
|
|
107
|
+
__metadata("design:returntype", Promise)
|
|
108
|
+
], FileCrudControllerHost.prototype, "delete", null);
|
|
109
|
+
__decorate([
|
|
110
|
+
(0, common_1.Patch)("/:id/upload-status"),
|
|
111
|
+
__param(0, (0, common_1.Param)()),
|
|
112
|
+
__param(1, (0, common_1.Body)()),
|
|
113
|
+
__metadata("design:type", Function),
|
|
114
|
+
__metadata("design:paramtypes", [id_dto_1.IdParamDto,
|
|
115
|
+
id_dto_1.UploadFileStatusDto]),
|
|
116
|
+
__metadata("design:returntype", Promise)
|
|
117
|
+
], FileCrudControllerHost.prototype, "uploadStatus", null);
|
|
118
|
+
FileCrudControllerHost = __decorate([
|
|
119
|
+
(0, common_1.Controller)(),
|
|
120
|
+
(0, swagger_1.ApiBearerAuth)(),
|
|
121
|
+
__metadata("design:paramtypes", [file_crud_service_1.FileCrudService])
|
|
122
|
+
], FileCrudControllerHost);
|
|
123
|
+
return FileCrudControllerHost;
|
|
124
|
+
}
|
|
125
|
+
//# sourceMappingURL=file-crud.controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-crud.controller.js","sourceRoot":"","sources":["../../../../../src/generics/typeorm/controllers/file-crud.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAOA,gDAqEC;AA5ED,2CAAwF;AACxF,6CAAyD;AACzD,qDAAiD;AACjD,yCAAiG;AACjG,qEAAgE;AAGhE,SAAgB,kBAAkB,CAAI,OAA4B;IACjE,IAEM,sBAAsB,GAF5B,MAEM,sBAAsB;QAC3B,YAA6B,eAAmC;YAAnC,oBAAe,GAAf,eAAe,CAAoB;QAAG,CAAC;QAI9D,AAAN,KAAK,CAAC,MAAM,CACH,QAAa;YAErB,IAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,SAAS;gBAAE,MAAM,IAAA,0BAAW,EAAC,OAAO,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;YACvE,OAAO,MAAM,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QACpD,CAAC;QAGK,AAAN,KAAK,CAAC,OAAO,CAAW,QAAoB;YAC3C,OAAO,MAAM,IAAI,CAAC,eAAe,CAAC,OAAO,CAAE,QAAQ,CAAC,EAAE,CAAC,CAAC;QACzD,CAAC;QAGK,AAAN,KAAK,CAAC,oBAAoB,CAAU,QAAoB;YACvD,OAAO,MAAM,IAAI,CAAC,eAAe,CAAC,oBAAoB,CACrD,QAAQ,CAAC,EAAE,CACX,CAAC;QACH,CAAC;QAGK,AAAN,KAAK,CAAC,OAAO,CAAU,UAAsB;YAC5C,OAAO,MAAM,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;QAC1D,CAAC;QAIK,AAAN,KAAK,CAAC,MAAM,CACF,KAAiB,EAClB,QAAa;YAErB,IAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,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AAC;QACX,IAAA,iBAAO,EAAC,EAAE,IAAI,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,SAAS,EAAE,CAAC;QAEpC,WAAA,IAAA,cAAK,GAAE,CAAA;QACP,WAAA,IAAA,aAAI,GAAE,CAAA;;yCADS,mBAAU;;wDAK1B;IAGK;QADL,IAAA,YAAG,EAAC,oBAAoB,CAAC;QAExB,WAAA,IAAA,cAAK,GAAE,CAAA;QACP,WAAA,IAAA,aAAI,GAAE,CAAA;;yCADS,mBAAU;YACZ,qBAAY;;8DAG1B;IAGK;QADL,IAAA,eAAM,EAAC,MAAM,CAAC;QAEb,WAAA,IAAA,cAAK,GAAE,CAAA;;yCAAQ,mBAAU;;wDAG1B;IAGK;QADL,IAAA,cAAK,EAAC,oBAAoB,CAAC;QAE1B,WAAA,IAAA,cAAK,GAAE,CAAA;QACP,WAAA,IAAA,aAAI,GAAE,CAAA;;yCADS,mBAAU;YACZ,4BAAmB;;8DAMjC;IA/DI,sBAAsB;QAF3B,IAAA,mBAAU,GAAE;QACZ,IAAA,uBAAa,GAAE;yCAE+B,mCAAe;OADxD,sBAAsB,CAgE3B;IACD,OAAO,sBAAsB,CAAC;AAC/B,CAAC"}
|
|
@@ -17,4 +17,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./extra-crud.controller"), exports);
|
|
18
18
|
__exportStar(require("./entity-crud.controller"), exports);
|
|
19
19
|
__exportStar(require("./relation-crud.controller"), exports);
|
|
20
|
+
__exportStar(require("./file-crud.controller"), exports);
|
|
21
|
+
__exportStar(require("./dto"), exports);
|
|
20
22
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/generics/typeorm/controllers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0DAAuC;AACvC,2DAAwC;AACxC,6DAA0C"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/generics/typeorm/controllers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0DAAuC;AACvC,2DAAwC;AACxC,6DAA0C;AAC1C,yDAAsC;AACtC,wCAAqB"}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { FileUploadService } from "src/modules/minio/minio.service";
|
|
2
|
+
import { EMinioBucket, MinioFileOptions } from "src/modules/minio/minio.type";
|
|
3
|
+
import { Repository } from "typeorm";
|
|
4
|
+
export declare class FileCrudService<T extends {
|
|
5
|
+
id?: string;
|
|
6
|
+
fileInfo?: MinioFileOptions;
|
|
7
|
+
}> {
|
|
8
|
+
protected readonly fileUploadService: FileUploadService;
|
|
9
|
+
private readonly repository;
|
|
10
|
+
readonly bucket: EMinioBucket;
|
|
11
|
+
private readonly parentFieldName?;
|
|
12
|
+
private readonly fileInfo?;
|
|
13
|
+
private readonly fileInfoKey;
|
|
14
|
+
constructor(fileUploadService: FileUploadService, repository: Repository<T>, bucket: EMinioBucket, parentFieldName?: string, fileInfo?: string);
|
|
15
|
+
create(itemData: any): Promise<{
|
|
16
|
+
fileInfo: MinioFileOptions;
|
|
17
|
+
presigned: string;
|
|
18
|
+
length: number;
|
|
19
|
+
toString(): string;
|
|
20
|
+
toLocaleString(): string;
|
|
21
|
+
toLocaleString(locales: string | string[], options?: Intl.NumberFormatOptions & Intl.DateTimeFormatOptions): string;
|
|
22
|
+
pop(): T;
|
|
23
|
+
push(...items: T[]): number;
|
|
24
|
+
concat(...items: ConcatArray<T>[]): T[];
|
|
25
|
+
concat(...items: (T | ConcatArray<T>)[]): T[];
|
|
26
|
+
join(separator?: string): string;
|
|
27
|
+
reverse(): T[];
|
|
28
|
+
shift(): T;
|
|
29
|
+
slice(start?: number, end?: number): T[];
|
|
30
|
+
sort(compareFn?: (a: T, b: T) => number): T[];
|
|
31
|
+
splice(start: number, deleteCount?: number): T[];
|
|
32
|
+
splice(start: number, deleteCount: number, ...items: T[]): T[];
|
|
33
|
+
unshift(...items: T[]): number;
|
|
34
|
+
indexOf(searchElement: T, fromIndex?: number): number;
|
|
35
|
+
lastIndexOf(searchElement: T, fromIndex?: number): number;
|
|
36
|
+
every<S extends T>(predicate: (value: T, index: number, array: T[]) => value is S, thisArg?: any): this is S[];
|
|
37
|
+
every(predicate: (value: T, index: number, array: T[]) => unknown, thisArg?: any): boolean;
|
|
38
|
+
some(predicate: (value: T, index: number, array: T[]) => unknown, thisArg?: any): boolean;
|
|
39
|
+
forEach(callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any): void;
|
|
40
|
+
map<U>(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[];
|
|
41
|
+
filter<S extends T>(predicate: (value: T, index: number, array: T[]) => value is S, thisArg?: any): S[];
|
|
42
|
+
filter(predicate: (value: T, index: number, array: T[]) => unknown, thisArg?: any): T[];
|
|
43
|
+
reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T): T;
|
|
44
|
+
reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T): T;
|
|
45
|
+
reduce<U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U;
|
|
46
|
+
reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T): T;
|
|
47
|
+
reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T): T;
|
|
48
|
+
reduceRight<U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U;
|
|
49
|
+
find<S extends T>(predicate: (value: T, index: number, obj: T[]) => value is S, thisArg?: any): S;
|
|
50
|
+
find(predicate: (value: T, index: number, obj: T[]) => unknown, thisArg?: any): T;
|
|
51
|
+
findIndex(predicate: (value: T, index: number, obj: T[]) => unknown, thisArg?: any): number;
|
|
52
|
+
fill(value: T, start?: number, end?: number): T[];
|
|
53
|
+
copyWithin(target: number, start: number, end?: number): T[];
|
|
54
|
+
entries(): ArrayIterator<[number, T]>;
|
|
55
|
+
keys(): ArrayIterator<number>;
|
|
56
|
+
values(): ArrayIterator<T>;
|
|
57
|
+
includes(searchElement: T, fromIndex?: number): boolean;
|
|
58
|
+
flatMap<U, This = undefined>(callback: (this: This, value: T, index: number, array: T[]) => U | readonly U[], thisArg?: This): U[];
|
|
59
|
+
flat<A, D extends number = 1>(this: A, depth?: D): FlatArray<A, D>[];
|
|
60
|
+
[Symbol.iterator](): ArrayIterator<T>;
|
|
61
|
+
[Symbol.unscopables]: {
|
|
62
|
+
[x: number]: boolean;
|
|
63
|
+
length?: boolean;
|
|
64
|
+
toString?: boolean;
|
|
65
|
+
toLocaleString?: boolean;
|
|
66
|
+
pop?: boolean;
|
|
67
|
+
push?: boolean;
|
|
68
|
+
concat?: boolean;
|
|
69
|
+
join?: boolean;
|
|
70
|
+
reverse?: boolean;
|
|
71
|
+
shift?: boolean;
|
|
72
|
+
slice?: boolean;
|
|
73
|
+
sort?: boolean;
|
|
74
|
+
splice?: boolean;
|
|
75
|
+
unshift?: boolean;
|
|
76
|
+
indexOf?: boolean;
|
|
77
|
+
lastIndexOf?: boolean;
|
|
78
|
+
every?: boolean;
|
|
79
|
+
some?: boolean;
|
|
80
|
+
forEach?: boolean;
|
|
81
|
+
map?: boolean;
|
|
82
|
+
filter?: boolean;
|
|
83
|
+
reduce?: boolean;
|
|
84
|
+
reduceRight?: boolean;
|
|
85
|
+
find?: boolean;
|
|
86
|
+
findIndex?: boolean;
|
|
87
|
+
fill?: boolean;
|
|
88
|
+
copyWithin?: boolean;
|
|
89
|
+
entries?: boolean;
|
|
90
|
+
keys?: boolean;
|
|
91
|
+
values?: boolean;
|
|
92
|
+
includes?: boolean;
|
|
93
|
+
flatMap?: boolean;
|
|
94
|
+
flat?: boolean;
|
|
95
|
+
[Symbol.iterator]?: boolean;
|
|
96
|
+
readonly [Symbol.unscopables]?: boolean;
|
|
97
|
+
at?: boolean;
|
|
98
|
+
};
|
|
99
|
+
at(index: number): T;
|
|
100
|
+
}>;
|
|
101
|
+
findAll(parentId?: string): Promise<{
|
|
102
|
+
count: number;
|
|
103
|
+
items: T[];
|
|
104
|
+
}>;
|
|
105
|
+
findAllWithPresigned(parentId?: string): Promise<{
|
|
106
|
+
count: number;
|
|
107
|
+
items: (T & {
|
|
108
|
+
fileInfo: any;
|
|
109
|
+
presigned: any;
|
|
110
|
+
})[];
|
|
111
|
+
}>;
|
|
112
|
+
findOne(id: string): Promise<any>;
|
|
113
|
+
update(id: string, itemData: any): Promise<any>;
|
|
114
|
+
changeStatus(id: string, isCurrent: boolean): Promise<void>;
|
|
115
|
+
delete(id: string): Promise<void>;
|
|
116
|
+
uploadStatus(itemId: string, uploadedSuccessfully: boolean): Promise<import("typeorm").UpdateResult>;
|
|
117
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
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.FileCrudService = void 0;
|
|
13
|
+
const common_1 = require("@nestjs/common");
|
|
14
|
+
const minio_service_1 = require("../../../modules/minio/minio.service");
|
|
15
|
+
const minio_type_1 = require("../../../modules/minio/minio.type");
|
|
16
|
+
const typeorm_1 = require("typeorm");
|
|
17
|
+
let FileCrudService = class FileCrudService {
|
|
18
|
+
constructor(fileUploadService, repository, bucket, parentFieldName, fileInfo) {
|
|
19
|
+
this.fileUploadService = fileUploadService;
|
|
20
|
+
this.repository = repository;
|
|
21
|
+
this.bucket = bucket;
|
|
22
|
+
this.parentFieldName = parentFieldName;
|
|
23
|
+
this.fileInfo = fileInfo;
|
|
24
|
+
this.fileInfoKey = fileInfo !== null && fileInfo !== void 0 ? fileInfo : "fileInfo";
|
|
25
|
+
}
|
|
26
|
+
async create(itemData) {
|
|
27
|
+
const fileInfo = await this.fileUploadService.getUploadPresiged(itemData[this.fileInfoKey], this.bucket);
|
|
28
|
+
const item = this.repository.create(Object.assign(Object.assign({}, itemData), { fileInfo: fileInfo.fileInfo }));
|
|
29
|
+
await this.repository.insert(item);
|
|
30
|
+
return Object.assign(Object.assign({}, item), { fileInfo: fileInfo.fileInfo, presigned: fileInfo.presigned });
|
|
31
|
+
}
|
|
32
|
+
async findAll(parentId) {
|
|
33
|
+
const where = {};
|
|
34
|
+
if (this.parentFieldName && parentId !== undefined) {
|
|
35
|
+
where[this.parentFieldName] = parentId;
|
|
36
|
+
}
|
|
37
|
+
const data = await this.repository.find({
|
|
38
|
+
where,
|
|
39
|
+
});
|
|
40
|
+
return {
|
|
41
|
+
count: data.length,
|
|
42
|
+
items: data
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
async findAllWithPresigned(parentId) {
|
|
46
|
+
const where = {};
|
|
47
|
+
if (this.parentFieldName && parentId !== undefined) {
|
|
48
|
+
where[this.parentFieldName] = parentId;
|
|
49
|
+
}
|
|
50
|
+
const items = await this.repository.find({
|
|
51
|
+
where,
|
|
52
|
+
});
|
|
53
|
+
const itemsWithPresigned = await Promise.all(items.map(async (item) => {
|
|
54
|
+
const fileInfo = item[this.fileInfoKey];
|
|
55
|
+
if (!fileInfo) {
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
const { fileInfo: info, presigned } = await this.fileUploadService.getDownloadPresigned(fileInfo);
|
|
59
|
+
return Object.assign(Object.assign({}, item), { fileInfo: info, presigned });
|
|
60
|
+
}));
|
|
61
|
+
return { count: items.length, items: itemsWithPresigned.filter(Boolean) };
|
|
62
|
+
}
|
|
63
|
+
async findOne(id) {
|
|
64
|
+
const file = await this.repository.findOne({
|
|
65
|
+
where: { id }
|
|
66
|
+
});
|
|
67
|
+
if (!file) {
|
|
68
|
+
return { file: null, fileInfo: null };
|
|
69
|
+
}
|
|
70
|
+
if (!file.uploadedSuccessfully) {
|
|
71
|
+
throw new common_1.BadRequestException(`File with id ${id} has not been yet uploaded successfully`);
|
|
72
|
+
}
|
|
73
|
+
const minioFileOptions = file.fileInfo;
|
|
74
|
+
const { fileInfo, presigned } = await this.fileUploadService.getDownloadPresigned(minioFileOptions);
|
|
75
|
+
return Object.assign(Object.assign({}, file), { fileInfo, presigned });
|
|
76
|
+
}
|
|
77
|
+
async update(id, itemData) {
|
|
78
|
+
var _a;
|
|
79
|
+
const file = (await this.repository.findOne({
|
|
80
|
+
where: { id }
|
|
81
|
+
}));
|
|
82
|
+
if (!file) {
|
|
83
|
+
throw new common_1.BadRequestException(`File with id ${id} not found`);
|
|
84
|
+
}
|
|
85
|
+
let minioResponse;
|
|
86
|
+
if (itemData.fileInfo) {
|
|
87
|
+
minioResponse = await this.fileUploadService.getUploadPresiged(itemData === null || itemData === void 0 ? void 0 : itemData.fileInfo, this.bucket);
|
|
88
|
+
itemData.uploadedSuccessfully = false;
|
|
89
|
+
}
|
|
90
|
+
await this.repository.update(id, Object.assign(Object.assign({}, itemData), { fileInfo: (_a = minioResponse === null || minioResponse === void 0 ? void 0 : minioResponse.fileInfo) !== null && _a !== void 0 ? _a : file.fileInfo }));
|
|
91
|
+
return Object.assign(Object.assign({}, itemData), minioResponse);
|
|
92
|
+
}
|
|
93
|
+
async changeStatus(id, isCurrent) {
|
|
94
|
+
await this.repository.update(id, {
|
|
95
|
+
isCurrent
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
async delete(id) {
|
|
99
|
+
await this.repository.delete(id);
|
|
100
|
+
}
|
|
101
|
+
async uploadStatus(itemId, uploadedSuccessfully) {
|
|
102
|
+
return await this.repository.update(itemId, {
|
|
103
|
+
status: uploadedSuccessfully ? "COMPLETED" : "FAILED",
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
exports.FileCrudService = FileCrudService;
|
|
108
|
+
exports.FileCrudService = FileCrudService = __decorate([
|
|
109
|
+
(0, common_1.Injectable)(),
|
|
110
|
+
__metadata("design:paramtypes", [minio_service_1.FileUploadService,
|
|
111
|
+
typeorm_1.Repository, String, String, String])
|
|
112
|
+
], FileCrudService);
|
|
113
|
+
//# sourceMappingURL=file-crud.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-crud.service.js","sourceRoot":"","sources":["../../../../../src/generics/typeorm/services/file-crud.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAiE;AAEjE,wEAAoE;AACpE,kEAA8E;AAC9E,qCAAqC;AAG9B,IAAM,eAAe,GAArB,MAAM,eAAe;IAK3B,YACoB,iBAAoC,EACpC,UAAyB,EAC5B,MAAoB,EACjB,eAAwB,EAC1B,QAAiB;QAJf,sBAAiB,GAAjB,iBAAiB,CAAmB;QACpC,eAAU,GAAV,UAAU,CAAe;QAC5B,WAAM,GAAN,MAAM,CAAc;QACjB,oBAAe,GAAf,eAAe,CAAS;QAC1B,aAAQ,GAAR,QAAQ,CAAS;QAElC,IAAI,CAAC,WAAW,GAAG,QAAQ,aAAR,QAAQ,cAAR,QAAQ,GAAI,UAAU,CAAC;IAC3C,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,QAAa;QACzB,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,iBAAiB,CAAC,iBAAiB,CAC9D,QAAQ,CAAC,IAAI,CAAC,WAAW,C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|
|
@@ -17,4 +17,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./entity-crud.service"), exports);
|
|
18
18
|
__exportStar(require("./extra-crud.service"), exports);
|
|
19
19
|
__exportStar(require("./relation-crud.service"), exports);
|
|
20
|
+
__exportStar(require("./file-crud.service"), exports);
|
|
20
21
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/generics/typeorm/services/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wDAAqC;AACrC,uDAAoC;AACpC,0DAAuC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/generics/typeorm/services/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wDAAqC;AACrC,uDAAoC;AACpC,0DAAuC;AACvC,sDAAmC"}
|
|
@@ -15,4 +15,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./auth"), exports);
|
|
18
|
+
__exportStar(require("./minio"), exports);
|
|
18
19
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAsB"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAsB;AACtB,0CAAuB"}
|
|
@@ -0,0 +1,21 @@
|
|
|
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("./minio.service"), exports);
|
|
18
|
+
__exportStar(require("./minio.module"), exports);
|
|
19
|
+
__exportStar(require("./minio.config"), exports);
|
|
20
|
+
__exportStar(require("./minio.type"), exports);
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/minio/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAAgC;AAChC,iDAA+B;AAC/B,iDAA+B;AAC/B,+CAA6B"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.minioConfig = void 0;
|
|
4
|
+
exports.minioConfig = {
|
|
5
|
+
endPoint: process.env.MINIO_ENDPOINT,
|
|
6
|
+
port: Number.parseInt(process.env.MINIO_PORT || "9000"),
|
|
7
|
+
useSSL: process.env.MINIO_USE_SSL === "true",
|
|
8
|
+
accessKey: process.env.MINIO_ACCESS_KEY,
|
|
9
|
+
secretKey: process.env.MINIO_SECRET_KEY,
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=minio.config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"minio.config.js","sourceRoot":"","sources":["../../../../src/modules/minio/minio.config.ts"],"names":[],"mappings":";;;AAQa,QAAA,WAAW,GAAiB;IACxC,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,cAAc;IACpC,IAAI,EAAE,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,IAAI,MAAM,CAAC;IACvD,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,aAAa,KAAK,MAAM;IAC5C,SAAS,EAAE,OAAO,CAAC,GAAG,CAAC,gBAAgB;IACvC,SAAS,EAAE,OAAO,CAAC,GAAG,CAAC,gBAAgB;CACvC,CAAC"}
|