@tomei/media 0.8.9 → 0.8.10
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/.commitlintrc.json +22 -22
- package/.gitlab-ci.yml +16 -16
- package/.husky/commit-msg +15 -15
- package/.husky/pre-commit +7 -7
- package/.prettierrc +4 -4
- package/README.md +93 -93
- package/dist/base/base.medias.d.ts +38 -0
- package/dist/base/base.medias.js +175 -0
- package/dist/base/base.medias.js.map +1 -0
- package/dist/base/base.repository.abstract.d.ts +12 -0
- package/dist/base/base.repository.abstract.js +22 -0
- package/dist/base/base.repository.abstract.js.map +1 -0
- package/dist/base/base.repository.interface.d.ts +9 -0
- package/dist/base/base.repository.interface.js +3 -0
- package/dist/base/base.repository.interface.js.map +1 -0
- package/dist/common/common.module.d.ts +2 -0
- package/dist/common/common.module.js +23 -0
- package/dist/common/common.module.js.map +1 -0
- package/dist/common/common.service.d.ts +13 -0
- package/dist/common/common.service.js +106 -0
- package/dist/common/common.service.js.map +1 -0
- package/dist/common/dto/add-field-translation.dto.d.ts +7 -0
- package/dist/common/dto/add-field-translation.dto.js +42 -0
- package/dist/common/dto/add-field-translation.dto.js.map +1 -0
- package/dist/common/dto/get-media.dto.d.ts +5 -0
- package/dist/common/dto/get-media.dto.js +29 -0
- package/dist/common/dto/get-media.dto.js.map +1 -0
- package/dist/database.d.ts +4 -0
- package/dist/database.js +16 -0
- package/dist/database.js.map +1 -0
- package/dist/dto/external-media.dto.d.ts +10 -0
- package/dist/dto/external-media.dto.js +70 -0
- package/dist/dto/external-media.dto.js.map +1 -0
- package/dist/dto/internal-medias.dto.d.ts +12 -0
- package/dist/dto/internal-medias.dto.js +87 -0
- package/dist/dto/internal-medias.dto.js.map +1 -0
- package/dist/entities/medias.entity.d.ts +23 -0
- package/dist/entities/medias.entity.js +160 -0
- package/dist/entities/medias.entity.js.map +1 -0
- package/dist/enum/index.d.ts +2 -0
- package/dist/enum/index.js +6 -0
- package/dist/enum/index.js.map +1 -0
- package/dist/enum/medias.enum.d.ts +5 -0
- package/dist/enum/medias.enum.js +10 -0
- package/dist/enum/medias.enum.js.map +1 -0
- package/dist/helpers/error.d.ts +1 -0
- package/dist/helpers/error.js +13 -0
- package/dist/helpers/error.js.map +1 -0
- package/dist/helpers/index.d.ts +2 -0
- package/dist/helpers/index.js +6 -0
- package/dist/helpers/index.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +22 -0
- package/dist/index.js.map +1 -0
- package/dist/interfaces/base.medias-attr.interface.d.ts +20 -0
- package/dist/interfaces/base.medias-attr.interface.js +3 -0
- package/dist/interfaces/base.medias-attr.interface.js.map +1 -0
- package/dist/interfaces/medias.repository.interface.d.ts +3 -0
- package/dist/interfaces/medias.repository.interface.js +3 -0
- package/dist/interfaces/medias.repository.interface.js.map +1 -0
- package/dist/medias.d.ts +65 -0
- package/dist/medias.js +564 -0
- package/dist/medias.js.map +1 -0
- package/dist/medias.repository.d.ts +8 -0
- package/dist/medias.repository.js +56 -0
- package/dist/medias.repository.js.map +1 -0
- package/dist/pipe/append-id.pipe.d.ts +6 -0
- package/dist/pipe/append-id.pipe.js +28 -0
- package/dist/pipe/append-id.pipe.js.map +1 -0
- package/dist/pipe/validate-enum.pipe.d.ts +6 -0
- package/dist/pipe/validate-enum.pipe.js +34 -0
- package/dist/pipe/validate-enum.pipe.js.map +1 -0
- package/dist/pipe/validate-id.pipe.d.ts +6 -0
- package/dist/pipe/validate-id.pipe.js +31 -0
- package/dist/pipe/validate-id.pipe.js.map +1 -0
- package/dist/pipe/validate-search.pipe.d.ts +7 -0
- package/dist/pipe/validate-search.pipe.js +46 -0
- package/dist/pipe/validate-search.pipe.js.map +1 -0
- package/dist/responses/deleted.response.d.ts +3 -0
- package/dist/responses/deleted.response.js +21 -0
- package/dist/responses/deleted.response.js.map +1 -0
- package/dist/responses/pagination.response.d.ts +5 -0
- package/dist/responses/pagination.response.js +26 -0
- package/dist/responses/pagination.response.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/eslint.config.mjs +58 -58
- package/migration/0001-add-defaultyn-hiddenyn-to-media-table.js +36 -36
- package/migration/media-migration.js +82 -82
- package/nest-cli.json +18 -18
- package/package.json +79 -79
- package/sonar-project.properties +12 -12
- package/src/base/base.medias.ts +210 -210
- package/src/base/base.repository.abstract.ts +28 -28
- package/src/base/base.repository.interface.ts +9 -9
- package/src/common/common.module.ts +10 -10
- package/src/common/common.service.ts +107 -107
- package/src/common/dto/add-field-translation.dto.ts +23 -23
- package/src/common/dto/get-media.dto.ts +12 -12
- package/src/database.ts +16 -16
- package/src/dto/external-media.dto.ts +49 -49
- package/src/dto/internal-medias.dto.ts +64 -64
- package/src/entities/medias.entity.ts +125 -125
- package/src/enum/index.ts +3 -3
- package/src/enum/medias.enum.ts +5 -5
- package/src/helpers/error.ts +12 -12
- package/src/helpers/index.ts +3 -3
- package/src/index.ts +24 -24
- package/src/interfaces/base.medias-attr.interface.ts +21 -21
- package/src/interfaces/medias.repository.interface.ts +4 -4
- package/src/medias.repository.ts +55 -55
- package/src/medias.ts +769 -769
- package/src/pipe/append-id.pipe.ts +15 -15
- package/src/pipe/validate-enum.pipe.ts +31 -31
- package/src/pipe/validate-id.pipe.ts +18 -18
- package/src/pipe/validate-search.pipe.ts +44 -44
- package/src/responses/deleted.response.ts +6 -6
- package/src/responses/pagination.response.ts +10 -10
- package/tsconfig.build.json +4 -4
- package/tsconfig.json +30 -30
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ConfigService } from '@nestjs/config';
|
|
2
|
+
import { AddFieldTranslationDto } from './dto/add-field-translation.dto';
|
|
3
|
+
import { GetMediaDto } from './dto/get-media.dto';
|
|
4
|
+
export declare class CommonService {
|
|
5
|
+
private configService;
|
|
6
|
+
private readonly commonApiUrl;
|
|
7
|
+
constructor(configService: ConfigService);
|
|
8
|
+
handleAxiosError(err: any): void;
|
|
9
|
+
addActivityHistory(record: any, entity: any, method: any): Promise<any>;
|
|
10
|
+
getList(listName: string): Promise<[]>;
|
|
11
|
+
addFieldTranslation(payload: AddFieldTranslationDto): Promise<void>;
|
|
12
|
+
getMedia(query: GetMediaDto): Promise<any>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
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.CommonService = void 0;
|
|
13
|
+
const common_1 = require("@nestjs/common");
|
|
14
|
+
const config_1 = require("@nestjs/config");
|
|
15
|
+
const axios_1 = require("axios");
|
|
16
|
+
const cuid = require("cuid");
|
|
17
|
+
const lodash_1 = require("lodash");
|
|
18
|
+
let CommonService = class CommonService {
|
|
19
|
+
constructor(configService) {
|
|
20
|
+
this.configService = configService;
|
|
21
|
+
this.commonApiUrl = this.configService.get('COMMON_API_URL');
|
|
22
|
+
}
|
|
23
|
+
handleAxiosError(err) {
|
|
24
|
+
if (err.response) {
|
|
25
|
+
throw new common_1.HttpException(err.response.data, err.response.status);
|
|
26
|
+
}
|
|
27
|
+
else if (err.request) {
|
|
28
|
+
throw new common_1.HttpException(err.request, 500);
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
throw new common_1.InternalServerErrorException(err.message);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
async addActivityHistory(record, entity, method) {
|
|
35
|
+
const activity = method === 'create'
|
|
36
|
+
? 'Insert new'
|
|
37
|
+
: method === 'update'
|
|
38
|
+
? 'Update'
|
|
39
|
+
: 'Delete';
|
|
40
|
+
const filteredRecord = (0, lodash_1.omit)(record.EntityValueAfter, [
|
|
41
|
+
'CreatedById',
|
|
42
|
+
'CreatedAt',
|
|
43
|
+
'UpdatedById',
|
|
44
|
+
'UpdatedAt',
|
|
45
|
+
]);
|
|
46
|
+
const filteredRecordBefore = (0, lodash_1.pick)(record.EntityValueBefore, (0, lodash_1.keys)(filteredRecord));
|
|
47
|
+
const payload = {
|
|
48
|
+
Action: record.Action || (method === 'create' ? 'Insert' : activity),
|
|
49
|
+
Activity: record.Activity || `${activity} ${entity}`,
|
|
50
|
+
Description: record.Description || `${activity} details of ${entity}`,
|
|
51
|
+
EntityType: (record === null || record === void 0 ? void 0 : record.EntityType) || entity,
|
|
52
|
+
EntityValueBefore: method === 'create'
|
|
53
|
+
? JSON.stringify({})
|
|
54
|
+
: method === 'update'
|
|
55
|
+
? filteredRecordBefore
|
|
56
|
+
: record.EntityValueBefore,
|
|
57
|
+
EntityValueAfter: JSON.stringify(filteredRecord),
|
|
58
|
+
PerformedById: record.PerformedById,
|
|
59
|
+
PerformedAt: record.PerformedAt || Date.now(),
|
|
60
|
+
EntityId: record.EntityId ? record.EntityId : cuid(),
|
|
61
|
+
};
|
|
62
|
+
try {
|
|
63
|
+
const { data } = await axios_1.default.post(`${this.commonApiUrl}/activity-histories`, payload);
|
|
64
|
+
return data.EntityId;
|
|
65
|
+
}
|
|
66
|
+
catch (err) {
|
|
67
|
+
this.handleAxiosError(err);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
async getList(listName) {
|
|
71
|
+
try {
|
|
72
|
+
const { data } = await axios_1.default.get(`${this.commonApiUrl}/lists/items`, {
|
|
73
|
+
params: { ListName: listName },
|
|
74
|
+
});
|
|
75
|
+
return data === null || data === void 0 ? void 0 : data.rows;
|
|
76
|
+
}
|
|
77
|
+
catch (err) {
|
|
78
|
+
this.handleAxiosError(err);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
async addFieldTranslation(payload) {
|
|
82
|
+
try {
|
|
83
|
+
await axios_1.default.post(`${this.commonApiUrl}/field-translations`, payload);
|
|
84
|
+
}
|
|
85
|
+
catch (err) {
|
|
86
|
+
this.handleAxiosError(err);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
async getMedia(query) {
|
|
90
|
+
try {
|
|
91
|
+
const { data } = await axios_1.default.get(`${this.commonApiUrl}/medias`, {
|
|
92
|
+
params: query,
|
|
93
|
+
});
|
|
94
|
+
return data === null || data === void 0 ? void 0 : data.rows;
|
|
95
|
+
}
|
|
96
|
+
catch (err) {
|
|
97
|
+
this.handleAxiosError(err);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
exports.CommonService = CommonService;
|
|
102
|
+
exports.CommonService = CommonService = __decorate([
|
|
103
|
+
(0, common_1.Injectable)(),
|
|
104
|
+
__metadata("design:paramtypes", [config_1.ConfigService])
|
|
105
|
+
], CommonService);
|
|
106
|
+
//# sourceMappingURL=common.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.service.js","sourceRoot":"","sources":["../../src/common/common.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAIwB;AACxB,2CAA+C;AAC/C,iCAA0B;AAC1B,6BAA6B;AAC7B,mCAAkD;AAI3C,IAAM,aAAa,GAAnB,MAAM,aAAa;IAGxB,YAAoB,aAA4B;QAA5B,kBAAa,GAAb,aAAa,CAAe;QAC9C,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;IAC/D,CAAC;IAED,gBAAgB,CAAC,GAAG;QAClB,IAAI,GAA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,eAAK,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,YAAY,qBAAqB,EAAE,OAAO,CAAC,CAAC;QACvE,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC;QAC7B,CAAC;IACH,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,KAAkB;QAC/B,IAAI,CAAC;YACH,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,eAAK,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,YAAY,SAAS,EAAE;gBAC9D,MAAM,EAAE,KAAK;aACd,CAAC,CAAC;YACH,OAAO,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,IAAI,CAAC;QACpB,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC;QAC7B,CAAC;IACH,CAAC;CACF,CAAA;AA9FY,sCAAa;wBAAb,aAAa;IADzB,IAAA,mBAAU,GAAE;qCAIwB,sBAAa;GAHrC,aAAa,CA8FzB"}
|
|
@@ -0,0 +1,42 @@
|
|
|
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.AddFieldTranslationDto = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
class AddFieldTranslationDto {
|
|
15
|
+
}
|
|
16
|
+
exports.AddFieldTranslationDto = AddFieldTranslationDto;
|
|
17
|
+
__decorate([
|
|
18
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
19
|
+
(0, class_validator_1.IsString)(),
|
|
20
|
+
__metadata("design:type", String)
|
|
21
|
+
], AddFieldTranslationDto.prototype, "ObjectTable", void 0);
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
24
|
+
(0, class_validator_1.IsString)(),
|
|
25
|
+
__metadata("design:type", String)
|
|
26
|
+
], AddFieldTranslationDto.prototype, "ObjectField", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
29
|
+
(0, class_validator_1.IsString)(),
|
|
30
|
+
__metadata("design:type", String)
|
|
31
|
+
], AddFieldTranslationDto.prototype, "ObjectId", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
34
|
+
(0, class_validator_1.IsString)(),
|
|
35
|
+
__metadata("design:type", String)
|
|
36
|
+
], AddFieldTranslationDto.prototype, "LanguageCode", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
39
|
+
(0, class_validator_1.IsString)(),
|
|
40
|
+
__metadata("design:type", String)
|
|
41
|
+
], AddFieldTranslationDto.prototype, "Translation", void 0);
|
|
42
|
+
//# sourceMappingURL=add-field-translation.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-field-translation.dto.js","sourceRoot":"","sources":["../../../src/common/dto/add-field-translation.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAuD;AAEvD,MAAa,sBAAsB;CAoBlC;AApBD,wDAoBC;AAjBC;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;2DACS;AAIpB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;2DACS;AAIpB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;wDACM;AAIjB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;4DACU;AAIrB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;2DACS"}
|
|
@@ -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.GetMediaDto = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
class GetMediaDto {
|
|
15
|
+
}
|
|
16
|
+
exports.GetMediaDto = GetMediaDto;
|
|
17
|
+
__decorate([
|
|
18
|
+
(0, class_validator_1.IsString)(),
|
|
19
|
+
__metadata("design:type", String)
|
|
20
|
+
], GetMediaDto.prototype, "ObjectID", void 0);
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, class_validator_1.IsString)(),
|
|
23
|
+
__metadata("design:type", String)
|
|
24
|
+
], GetMediaDto.prototype, "ObjectType", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, class_validator_1.IsString)(),
|
|
27
|
+
__metadata("design:type", String)
|
|
28
|
+
], GetMediaDto.prototype, "Title", void 0);
|
|
29
|
+
//# sourceMappingURL=get-media.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-media.dto.js","sourceRoot":"","sources":["../../../src/common/dto/get-media.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAA2C;AAE3C,MAAa,WAAW;CASvB;AATD,kCASC;AAPC;IADC,IAAA,0BAAQ,GAAE;;6CACO;AAGlB;IADC,IAAA,0BAAQ,GAAE;;+CACS;AAGpB;IADC,IAAA,0BAAQ,GAAE;;0CACI"}
|
package/dist/database.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.init = init;
|
|
4
|
+
exports.getConnection = getConnection;
|
|
5
|
+
const sequelize_typescript_1 = require("sequelize-typescript");
|
|
6
|
+
const medias_entity_1 = require("./entities/medias.entity");
|
|
7
|
+
const sequelize = {};
|
|
8
|
+
function init(key, sequelizeOptions) {
|
|
9
|
+
const s = new sequelize_typescript_1.Sequelize(sequelizeOptions);
|
|
10
|
+
s.addModels([medias_entity_1.MediasModel]);
|
|
11
|
+
sequelize[key] = s;
|
|
12
|
+
}
|
|
13
|
+
function getConnection(key) {
|
|
14
|
+
return sequelize[key];
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=database.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"database.js","sourceRoot":"","sources":["../src/database.ts"],"names":[],"mappings":";;AAeS,oBAAI;AAAE,sCAAa;AAf5B,+DAAmE;AACnE,4DAAuD;AAEvD,MAAM,SAAS,GAAQ,EAAE,CAAC;AAE1B,SAAS,IAAI,CAAC,GAAW,EAAE,gBAAkC;IAC3D,MAAM,CAAC,GAAG,IAAI,gCAAS,CAAC,gBAAgB,CAAC,CAAC;IAC1C,CAAC,CAAC,SAAS,CAAC,CAAC,2BAAW,CAAC,CAAC,CAAC;IAC3B,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AACrB,CAAC;AAED,SAAS,aAAa,CAAC,GAAW;IAChC,OAAO,SAAS,CAAC,GAAG,CAAC,CAAC;AACxB,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
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.ExternalMediaDto = void 0;
|
|
13
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
const medias_enum_1 = require("../enum/medias.enum");
|
|
16
|
+
class ExternalMediaDto {
|
|
17
|
+
}
|
|
18
|
+
exports.ExternalMediaDto = ExternalMediaDto;
|
|
19
|
+
__decorate([
|
|
20
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
21
|
+
(0, class_validator_1.IsString)(),
|
|
22
|
+
(0, class_validator_1.MaxLength)(30),
|
|
23
|
+
(0, swagger_1.ApiProperty)({ type: String, description: 'ObjectID' }),
|
|
24
|
+
__metadata("design:type", String)
|
|
25
|
+
], ExternalMediaDto.prototype, "ObjectId", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
28
|
+
(0, class_validator_1.IsString)(),
|
|
29
|
+
(0, class_validator_1.MaxLength)(200),
|
|
30
|
+
(0, swagger_1.ApiProperty)({ type: String, description: 'ObjectType' }),
|
|
31
|
+
__metadata("design:type", String)
|
|
32
|
+
], ExternalMediaDto.prototype, "ObjectType", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
35
|
+
(0, swagger_1.ApiProperty)({
|
|
36
|
+
type: String,
|
|
37
|
+
description: 'Enum either Photo, Video, Document',
|
|
38
|
+
}),
|
|
39
|
+
(0, class_validator_1.IsEnum)(medias_enum_1.MediaType),
|
|
40
|
+
__metadata("design:type", String)
|
|
41
|
+
], ExternalMediaDto.prototype, "Type", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
44
|
+
(0, class_validator_1.IsString)(),
|
|
45
|
+
(0, class_validator_1.MaxLength)(200),
|
|
46
|
+
(0, swagger_1.ApiProperty)({ type: String, description: 'URL whre the file stored' }),
|
|
47
|
+
__metadata("design:type", String)
|
|
48
|
+
], ExternalMediaDto.prototype, "URL", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
51
|
+
(0, class_validator_1.IsString)(),
|
|
52
|
+
(0, class_validator_1.MaxLength)(200),
|
|
53
|
+
(0, swagger_1.ApiProperty)({ type: String, description: 'external source of the file' }),
|
|
54
|
+
__metadata("design:type", String)
|
|
55
|
+
], ExternalMediaDto.prototype, "ExternalSource", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
58
|
+
(0, class_validator_1.IsString)(),
|
|
59
|
+
(0, class_validator_1.MaxLength)(100),
|
|
60
|
+
(0, swagger_1.ApiProperty)({ type: String, description: 'title of the media' }),
|
|
61
|
+
__metadata("design:type", String)
|
|
62
|
+
], ExternalMediaDto.prototype, "Title", void 0);
|
|
63
|
+
__decorate([
|
|
64
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
65
|
+
(0, class_validator_1.IsString)(),
|
|
66
|
+
(0, class_validator_1.MaxLength)(1000),
|
|
67
|
+
(0, swagger_1.ApiProperty)({ type: String, description: 'Description of the media' }),
|
|
68
|
+
__metadata("design:type", String)
|
|
69
|
+
], ExternalMediaDto.prototype, "Description", void 0);
|
|
70
|
+
//# sourceMappingURL=external-media.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"external-media.dto.js","sourceRoot":"","sources":["../../src/dto/external-media.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAA8C;AAC9C,qDAA0E;AAC1E,qDAAgD;AAEhD,MAAa,gBAAgB;CA4C5B;AA5CD,4CA4CC;AAvCC;IAJC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,2BAAS,EAAC,EAAE,CAAC;IACb,IAAA,qBAAW,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,CAAC;;kDACtC;AAMjB;IAJC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,2BAAS,EAAC,GAAG,CAAC;IACd,IAAA,qBAAW,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,YAAY,EAAE,CAAC;;oDACtC;AAQnB;IANC,IAAA,4BAAU,GAAE;IACZ,IAAA,qBAAW,EAAC;QACX,IAAI,EAAE,MAAM;QACZ,WAAW,EAAE,qCAAqC;KACnD,CAAC;IACD,IAAA,wBAAM,EAAC,uBAAS,CAAC;;8CACF;AAMhB;IAJC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,2BAAS,EAAC,GAAG,CAAC;IACd,IAAA,qBAAW,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,0BAA0B,EAAE,CAAC;;6CAC3D;AAMZ;IAJC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,2BAAS,EAAC,GAAG,CAAC;IACd,IAAA,qBAAW,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,6BAA6B,EAAE,CAAC;;wDACnD;AAMvB;IAJC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,2BAAS,EAAC,GAAG,CAAC;IACd,IAAA,qBAAW,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,oBAAoB,EAAE,CAAC;;+CACnD;AAMd;IAJC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,2BAAS,EAAC,IAAI,CAAC;IACf,IAAA,qBAAW,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,0BAA0B,EAAE,CAAC;;qDACnD"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { MediaType } from '../enum/medias.enum';
|
|
2
|
+
export declare class InternalMediaDto {
|
|
3
|
+
ObjectId: string;
|
|
4
|
+
ObjectType: string;
|
|
5
|
+
Type: MediaType;
|
|
6
|
+
FileName: string;
|
|
7
|
+
FileExtension: string;
|
|
8
|
+
FileStream: any;
|
|
9
|
+
Title: string;
|
|
10
|
+
Description: string;
|
|
11
|
+
IsEncryptedYN: string;
|
|
12
|
+
}
|
|
@@ -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.InternalMediaDto = void 0;
|
|
13
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
const medias_enum_1 = require("../enum/medias.enum");
|
|
16
|
+
class InternalMediaDto {
|
|
17
|
+
}
|
|
18
|
+
exports.InternalMediaDto = InternalMediaDto;
|
|
19
|
+
__decorate([
|
|
20
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
21
|
+
(0, class_validator_1.IsString)(),
|
|
22
|
+
(0, class_validator_1.MaxLength)(30),
|
|
23
|
+
(0, swagger_1.ApiProperty)({ type: String, description: 'ObjectID' }),
|
|
24
|
+
__metadata("design:type", String)
|
|
25
|
+
], InternalMediaDto.prototype, "ObjectId", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
28
|
+
(0, class_validator_1.IsString)(),
|
|
29
|
+
(0, class_validator_1.MaxLength)(200),
|
|
30
|
+
(0, swagger_1.ApiProperty)({ type: String, description: 'ObjectType' }),
|
|
31
|
+
__metadata("design:type", String)
|
|
32
|
+
], InternalMediaDto.prototype, "ObjectType", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
35
|
+
(0, swagger_1.ApiProperty)({
|
|
36
|
+
type: String,
|
|
37
|
+
description: 'Enum either Photo, Video, Document',
|
|
38
|
+
}),
|
|
39
|
+
(0, class_validator_1.IsEnum)(medias_enum_1.MediaType),
|
|
40
|
+
__metadata("design:type", String)
|
|
41
|
+
], InternalMediaDto.prototype, "Type", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
44
|
+
(0, class_validator_1.IsString)(),
|
|
45
|
+
(0, class_validator_1.MaxLength)(200),
|
|
46
|
+
(0, swagger_1.ApiProperty)({ type: String, description: 'file name without extension' }),
|
|
47
|
+
__metadata("design:type", String)
|
|
48
|
+
], InternalMediaDto.prototype, "FileName", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
51
|
+
(0, class_validator_1.IsString)(),
|
|
52
|
+
(0, class_validator_1.MaxLength)(10),
|
|
53
|
+
(0, swagger_1.ApiProperty)({ type: String, description: 'extention of file in jpg etc' }),
|
|
54
|
+
__metadata("design:type", String)
|
|
55
|
+
], InternalMediaDto.prototype, "FileExtension", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
(0, swagger_1.ApiProperty)({
|
|
58
|
+
type: String,
|
|
59
|
+
description: 'File stream buffer',
|
|
60
|
+
format: 'binary',
|
|
61
|
+
}),
|
|
62
|
+
__metadata("design:type", Object)
|
|
63
|
+
], InternalMediaDto.prototype, "FileStream", void 0);
|
|
64
|
+
__decorate([
|
|
65
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
66
|
+
(0, class_validator_1.IsString)(),
|
|
67
|
+
(0, class_validator_1.MaxLength)(100),
|
|
68
|
+
(0, swagger_1.ApiProperty)({ type: String, description: 'title of the media' }),
|
|
69
|
+
__metadata("design:type", String)
|
|
70
|
+
], InternalMediaDto.prototype, "Title", void 0);
|
|
71
|
+
__decorate([
|
|
72
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
73
|
+
(0, class_validator_1.IsString)(),
|
|
74
|
+
(0, class_validator_1.MaxLength)(1000),
|
|
75
|
+
(0, swagger_1.ApiProperty)({ type: String, description: 'Description of the media' }),
|
|
76
|
+
__metadata("design:type", String)
|
|
77
|
+
], InternalMediaDto.prototype, "Description", void 0);
|
|
78
|
+
__decorate([
|
|
79
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
80
|
+
(0, class_validator_1.IsEnum)(['N', 'Y']),
|
|
81
|
+
(0, swagger_1.ApiProperty)({
|
|
82
|
+
type: String,
|
|
83
|
+
description: 'Option if media needed to be encryped : Y or N',
|
|
84
|
+
}),
|
|
85
|
+
__metadata("design:type", String)
|
|
86
|
+
], InternalMediaDto.prototype, "IsEncryptedYN", void 0);
|
|
87
|
+
//# sourceMappingURL=internal-medias.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"internal-medias.dto.js","sourceRoot":"","sources":["../../src/dto/internal-medias.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAA8C;AAC9C,qDAA0E;AAC1E,qDAAgD;AAEhD,MAAa,gBAAgB;CA2D5B;AA3DD,4CA2DC;AAtDC;IAJC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,2BAAS,EAAC,EAAE,CAAC;IACb,IAAA,qBAAW,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,CAAC;;kDACtC;AAMjB;IAJC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,2BAAS,EAAC,GAAG,CAAC;IACd,IAAA,qBAAW,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,YAAY,EAAE,CAAC;;oDACtC;AAQnB;IANC,IAAA,4BAAU,GAAE;IACZ,IAAA,qBAAW,EAAC;QACX,IAAI,EAAE,MAAM;QACZ,WAAW,EAAE,qCAAqC;KACnD,CAAC;IACD,IAAA,wBAAM,EAAC,uBAAS,CAAC;;8CACF;AAMhB;IAJC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,2BAAS,EAAC,GAAG,CAAC;IACd,IAAA,qBAAW,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,6BAA6B,EAAE,CAAC;;kDACzD;AAMjB;IAJC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,2BAAS,EAAC,EAAE,CAAC;IACb,IAAA,qBAAW,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,8BAA8B,EAAE,CAAC;;uDACrD;AAOtB;IALC,IAAA,qBAAW,EAAC;QACX,IAAI,EAAE,MAAM;QACZ,WAAW,EAAE,oBAAoB;QACjC,MAAM,EAAE,QAAQ;KACjB,CAAC;;oDACc;AAMhB;IAJC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,2BAAS,EAAC,GAAG,CAAC;IACd,IAAA,qBAAW,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,oBAAoB,EAAE,CAAC;;+CACnD;AAMd;IAJC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,2BAAS,EAAC,IAAI,CAAC;IACf,IAAA,qBAAW,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,0BAA0B,EAAE,CAAC;;qDACnD;AAQpB;IANC,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,EAAC,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAClB,IAAA,qBAAW,EAAC;QACX,IAAI,EAAE,MAAM;QACZ,WAAW,EAAE,gDAAgD;KAC9D,CAAC;;uDACoB"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Model } from 'sequelize-typescript';
|
|
2
|
+
import { MediaType } from '../enum';
|
|
3
|
+
export declare class MediasModel extends Model {
|
|
4
|
+
MediaId: string;
|
|
5
|
+
ObjectId: string;
|
|
6
|
+
ObjectType: string;
|
|
7
|
+
Title: string;
|
|
8
|
+
Description: string;
|
|
9
|
+
Type: MediaType;
|
|
10
|
+
IsExternalYN: string;
|
|
11
|
+
ExternalSource: string;
|
|
12
|
+
IsEncryptedYN: string;
|
|
13
|
+
FileName: string;
|
|
14
|
+
FileExtension: string;
|
|
15
|
+
FilePath: string;
|
|
16
|
+
URL: string;
|
|
17
|
+
CreatedAt: Date;
|
|
18
|
+
CreatedById: string;
|
|
19
|
+
UpdatedAt: Date;
|
|
20
|
+
UpdatedById: string;
|
|
21
|
+
HiddenYN: string;
|
|
22
|
+
DefaultYN: string;
|
|
23
|
+
}
|
|
@@ -0,0 +1,160 @@
|
|
|
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.MediasModel = void 0;
|
|
13
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
+
const sequelize_typescript_1 = require("sequelize-typescript");
|
|
15
|
+
const enum_1 = require("../enum");
|
|
16
|
+
let MediasModel = class MediasModel extends sequelize_typescript_1.Model {
|
|
17
|
+
};
|
|
18
|
+
exports.MediasModel = MediasModel;
|
|
19
|
+
__decorate([
|
|
20
|
+
(0, sequelize_typescript_1.Column)({
|
|
21
|
+
primaryKey: true,
|
|
22
|
+
allowNull: false,
|
|
23
|
+
}),
|
|
24
|
+
(0, swagger_1.ApiProperty)({ type: String, description: 'MediaID' }),
|
|
25
|
+
__metadata("design:type", String)
|
|
26
|
+
], MediasModel.prototype, "MediaId", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, sequelize_typescript_1.Column)({
|
|
29
|
+
allowNull: false,
|
|
30
|
+
}),
|
|
31
|
+
(0, swagger_1.ApiProperty)({ type: String, description: 'ObjectID' }),
|
|
32
|
+
__metadata("design:type", String)
|
|
33
|
+
], MediasModel.prototype, "ObjectId", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, sequelize_typescript_1.Column)({
|
|
36
|
+
allowNull: false,
|
|
37
|
+
}),
|
|
38
|
+
(0, swagger_1.ApiProperty)({ type: String, description: 'ObjectType' }),
|
|
39
|
+
__metadata("design:type", String)
|
|
40
|
+
], MediasModel.prototype, "ObjectType", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, sequelize_typescript_1.Column)({
|
|
43
|
+
allowNull: true,
|
|
44
|
+
}),
|
|
45
|
+
(0, swagger_1.ApiProperty)({ type: String, description: 'title of the media' }),
|
|
46
|
+
__metadata("design:type", String)
|
|
47
|
+
], MediasModel.prototype, "Title", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, sequelize_typescript_1.Column)({
|
|
50
|
+
allowNull: true,
|
|
51
|
+
}),
|
|
52
|
+
(0, swagger_1.ApiProperty)({ type: String, description: 'Description of the media' }),
|
|
53
|
+
__metadata("design:type", String)
|
|
54
|
+
], MediasModel.prototype, "Description", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
(0, sequelize_typescript_1.Column)({
|
|
57
|
+
allowNull: false,
|
|
58
|
+
}),
|
|
59
|
+
(0, swagger_1.ApiProperty)({
|
|
60
|
+
type: String,
|
|
61
|
+
description: 'Enum either Photo, Video, Document',
|
|
62
|
+
}),
|
|
63
|
+
__metadata("design:type", String)
|
|
64
|
+
], MediasModel.prototype, "Type", void 0);
|
|
65
|
+
__decorate([
|
|
66
|
+
(0, sequelize_typescript_1.Column)({
|
|
67
|
+
allowNull: false,
|
|
68
|
+
}),
|
|
69
|
+
(0, swagger_1.ApiProperty)({ type: String, description: 'isExternal either Y, N' }),
|
|
70
|
+
__metadata("design:type", String)
|
|
71
|
+
], MediasModel.prototype, "IsExternalYN", void 0);
|
|
72
|
+
__decorate([
|
|
73
|
+
(0, sequelize_typescript_1.Column)({
|
|
74
|
+
allowNull: true,
|
|
75
|
+
}),
|
|
76
|
+
(0, swagger_1.ApiProperty)({ type: String, description: 'External surce for the file' }),
|
|
77
|
+
__metadata("design:type", String)
|
|
78
|
+
], MediasModel.prototype, "ExternalSource", void 0);
|
|
79
|
+
__decorate([
|
|
80
|
+
(0, sequelize_typescript_1.Column)({
|
|
81
|
+
allowNull: false,
|
|
82
|
+
}),
|
|
83
|
+
(0, swagger_1.ApiProperty)({ type: String, description: 'isExternal either Y, N' }),
|
|
84
|
+
__metadata("design:type", String)
|
|
85
|
+
], MediasModel.prototype, "IsEncryptedYN", void 0);
|
|
86
|
+
__decorate([
|
|
87
|
+
(0, sequelize_typescript_1.Column)({
|
|
88
|
+
allowNull: true,
|
|
89
|
+
}),
|
|
90
|
+
(0, swagger_1.ApiProperty)({ type: String, description: 'file name without extension' }),
|
|
91
|
+
__metadata("design:type", String)
|
|
92
|
+
], MediasModel.prototype, "FileName", void 0);
|
|
93
|
+
__decorate([
|
|
94
|
+
(0, sequelize_typescript_1.Column)({
|
|
95
|
+
allowNull: true,
|
|
96
|
+
}),
|
|
97
|
+
(0, swagger_1.ApiProperty)({ type: String, description: 'extention of file in jpg etc' }),
|
|
98
|
+
__metadata("design:type", String)
|
|
99
|
+
], MediasModel.prototype, "FileExtension", void 0);
|
|
100
|
+
__decorate([
|
|
101
|
+
(0, sequelize_typescript_1.Column)({
|
|
102
|
+
allowNull: true,
|
|
103
|
+
}),
|
|
104
|
+
(0, swagger_1.ApiProperty)({
|
|
105
|
+
type: String,
|
|
106
|
+
description: 'location on the media in term of path',
|
|
107
|
+
}),
|
|
108
|
+
__metadata("design:type", String)
|
|
109
|
+
], MediasModel.prototype, "FilePath", void 0);
|
|
110
|
+
__decorate([
|
|
111
|
+
(0, sequelize_typescript_1.Column)({
|
|
112
|
+
allowNull: true,
|
|
113
|
+
}),
|
|
114
|
+
(0, swagger_1.ApiProperty)({ type: String, description: 'URl of the media' }),
|
|
115
|
+
__metadata("design:type", String)
|
|
116
|
+
], MediasModel.prototype, "URL", void 0);
|
|
117
|
+
__decorate([
|
|
118
|
+
(0, swagger_1.ApiProperty)({
|
|
119
|
+
example: new Date(),
|
|
120
|
+
description: 'Timestamp for data creation.',
|
|
121
|
+
}),
|
|
122
|
+
(0, sequelize_typescript_1.Column)({ type: sequelize_typescript_1.DataType.DATE, allowNull: false }),
|
|
123
|
+
__metadata("design:type", Date)
|
|
124
|
+
], MediasModel.prototype, "CreatedAt", void 0);
|
|
125
|
+
__decorate([
|
|
126
|
+
(0, swagger_1.ApiProperty)({
|
|
127
|
+
example: '138140891dd211b288d34bc7b4312a49',
|
|
128
|
+
description: 'The CreatedById for Media.',
|
|
129
|
+
}),
|
|
130
|
+
(0, sequelize_typescript_1.Column)({ allowNull: false }),
|
|
131
|
+
__metadata("design:type", String)
|
|
132
|
+
], MediasModel.prototype, "CreatedById", void 0);
|
|
133
|
+
__decorate([
|
|
134
|
+
(0, swagger_1.ApiProperty)({
|
|
135
|
+
example: new Date(),
|
|
136
|
+
description: 'Timestamp for latest data modification',
|
|
137
|
+
}),
|
|
138
|
+
(0, sequelize_typescript_1.Column)({ type: sequelize_typescript_1.DataType.DATE, allowNull: true }),
|
|
139
|
+
__metadata("design:type", Date)
|
|
140
|
+
], MediasModel.prototype, "UpdatedAt", void 0);
|
|
141
|
+
__decorate([
|
|
142
|
+
(0, swagger_1.ApiProperty)({
|
|
143
|
+
example: '138140891dd211b288d34bc7b4312a49',
|
|
144
|
+
description: 'The UpdatedById for Media.',
|
|
145
|
+
}),
|
|
146
|
+
(0, sequelize_typescript_1.Column)({ allowNull: false }),
|
|
147
|
+
__metadata("design:type", String)
|
|
148
|
+
], MediasModel.prototype, "UpdatedById", void 0);
|
|
149
|
+
__decorate([
|
|
150
|
+
(0, sequelize_typescript_1.Column)({ allowNull: true }),
|
|
151
|
+
__metadata("design:type", String)
|
|
152
|
+
], MediasModel.prototype, "HiddenYN", void 0);
|
|
153
|
+
__decorate([
|
|
154
|
+
(0, sequelize_typescript_1.Column)({ allowNull: true }),
|
|
155
|
+
__metadata("design:type", String)
|
|
156
|
+
], MediasModel.prototype, "DefaultYN", void 0);
|
|
157
|
+
exports.MediasModel = MediasModel = __decorate([
|
|
158
|
+
(0, sequelize_typescript_1.Table)({ tableName: 'common_Media', createdAt: false, updatedAt: false })
|
|
159
|
+
], MediasModel);
|
|
160
|
+
//# sourceMappingURL=medias.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"medias.entity.js","sourceRoot":"","sources":["../../src/entities/medias.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAA8C;AAC9C,+DAAsE;AACtE,kCAAoC;AAG7B,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,4BAAK;CAuHrC,CAAA;AAvHY,kCAAW;AAMtB;IALC,IAAA,6BAAM,EAAC;QACN,UAAU,EAAE,IAAI;QAChB,SAAS,EAAE,KAAK;KACjB,CAAC;IACD,IAAA,qBAAW,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,CAAC;;4CACtC;AAMhB;IAJC,IAAA,6BAAM,EAAC;QACN,SAAS,EAAE,KAAK;KACjB,CAAC;IACD,IAAA,qBAAW,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,CAAC;;6CACtC;AAMjB;IAJC,IAAA,6BAAM,EAAC;QACN,SAAS,EA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C,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;gDACT;AAGpB;IADC,IAAA,6BAAM,EAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;;6CACX;AAGjB;IADC,IAAA,6BAAM,EAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;;8CACV;sBAtHP,WAAW;IADvB,IAAA,4BAAK,EAAC,EAAE,SAAS,EAAE,cAAc,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;GAC5D,WAAW,CAuHvB"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MediaType = void 0;
|
|
4
|
+
const medias_enum_1 = require("./medias.enum");
|
|
5
|
+
Object.defineProperty(exports, "MediaType", { enumerable: true, get: function () { return medias_enum_1.MediaType; } });
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/enum/index.ts"],"names":[],"mappings":";;;AAAA,+CAA0C;AAEjC,0FAFA,uBAAS,OAEA"}
|