@tomei/media 0.4.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/.commitlintrc.json +22 -22
  2. package/.eslintrc.js +66 -66
  3. package/.husky/commit-msg +4 -4
  4. package/.husky/pre-commit +4 -4
  5. package/.prettierrc +4 -4
  6. package/.prettierrc copy +3 -3
  7. package/README.md +93 -93
  8. package/dist/base/base.medias.d.ts +38 -38
  9. package/dist/base/base.medias.js +169 -169
  10. package/dist/base/base.repository.abstract.d.ts +12 -12
  11. package/dist/base/base.repository.abstract.js +21 -21
  12. package/dist/base/base.repository.interface.d.ts +9 -9
  13. package/dist/base/base.repository.interface.js +2 -2
  14. package/dist/base/index.d.ts +2 -0
  15. package/dist/base/index.js +6 -0
  16. package/dist/base/index.js.map +1 -0
  17. package/dist/common/common.module.d.ts +2 -2
  18. package/dist/common/common.module.js +22 -22
  19. package/dist/common/common.service.d.ts +13 -13
  20. package/dist/common/common.service.js +107 -107
  21. package/dist/common/common.service.spec.d.ts +0 -0
  22. package/dist/common/common.service.spec.js +5 -0
  23. package/dist/common/common.service.spec.js.map +1 -0
  24. package/dist/common/dto/add-field-translation.dto.d.ts +7 -7
  25. package/dist/common/dto/add-field-translation.dto.js +41 -41
  26. package/dist/common/dto/get-media.dto.d.ts +5 -5
  27. package/dist/common/dto/get-media.dto.js +28 -28
  28. package/dist/common/dto/get-media.dto.js.map +1 -1
  29. package/dist/dto/external-media.dto.d.ts +10 -10
  30. package/dist/dto/external-media.dto.js +69 -69
  31. package/dist/dto/internal-medias.dto.d.ts +12 -12
  32. package/dist/dto/internal-medias.dto.js +86 -86
  33. package/dist/dto/medias.dto.d.ts +12 -0
  34. package/dist/dto/medias.dto.js +88 -0
  35. package/dist/dto/medias.dto.js.map +1 -0
  36. package/dist/entities/index.d.ts +2 -0
  37. package/dist/entities/index.js +6 -0
  38. package/dist/entities/index.js.map +1 -0
  39. package/dist/entities/media.entity.d.ts +21 -0
  40. package/dist/entities/media.entity.js +152 -0
  41. package/dist/entities/media.entity.js.map +1 -0
  42. package/dist/entities/medias.entity.d.ts +21 -21
  43. package/dist/entities/medias.entity.js +151 -151
  44. package/dist/enum/index.d.ts +2 -2
  45. package/dist/enum/index.js +5 -5
  46. package/dist/enum/medias.enum.d.ts +5 -5
  47. package/dist/enum/medias.enum.js +9 -9
  48. package/dist/helpers/error.d.ts +1 -1
  49. package/dist/helpers/error.js +13 -13
  50. package/dist/helpers/index.d.ts +2 -2
  51. package/dist/helpers/index.js +5 -5
  52. package/dist/index.d.ts +11 -11
  53. package/dist/index.js +19 -19
  54. package/dist/interfaces/base.medias-attr.interface.d.ts +20 -20
  55. package/dist/interfaces/base.medias-attr.interface.js +2 -2
  56. package/dist/interfaces/commonService.interface.d.ts +17 -0
  57. package/dist/interfaces/commonService.interface.js +3 -0
  58. package/dist/interfaces/commonService.interface.js.map +1 -0
  59. package/dist/interfaces/index.d.ts +3 -0
  60. package/dist/interfaces/index.js +3 -0
  61. package/dist/interfaces/index.js.map +1 -0
  62. package/dist/interfaces/media.repository.interface.d.ts +10 -0
  63. package/dist/interfaces/media.repository.interface.js +3 -0
  64. package/dist/interfaces/media.repository.interface.js.map +1 -0
  65. package/dist/interfaces/medias-attr.interface.d.ts +22 -0
  66. package/dist/interfaces/medias-attr.interface.js +3 -0
  67. package/dist/interfaces/medias-attr.interface.js.map +1 -0
  68. package/dist/interfaces/medias.repository.interface.d.ts +3 -3
  69. package/dist/interfaces/medias.repository.interface.js +2 -2
  70. package/dist/medias.controller copy.d.ts +25 -0
  71. package/dist/medias.controller copy.js +225 -0
  72. package/dist/medias.controller copy.js.map +1 -0
  73. package/dist/medias.controller.d.ts +29 -25
  74. package/dist/medias.controller.js +119 -224
  75. package/dist/medias.controller.js.map +1 -1
  76. package/dist/medias.controller.old.d.ts +25 -0
  77. package/dist/medias.controller.old.js +225 -0
  78. package/dist/medias.controller.old.js.map +1 -0
  79. package/dist/medias.d.ts +62 -62
  80. package/dist/medias.js +507 -507
  81. package/dist/medias.module.d.ts +2 -2
  82. package/dist/medias.module.js +31 -34
  83. package/dist/medias.module.js.map +1 -1
  84. package/dist/medias.repository.d.ts +16 -16
  85. package/dist/medias.repository.js +46 -46
  86. package/dist/pipe/append-id.pipe.d.ts +6 -6
  87. package/dist/pipe/append-id.pipe.js +27 -27
  88. package/dist/pipe/validate-enum.pipe.d.ts +6 -6
  89. package/dist/pipe/validate-enum.pipe.js +33 -33
  90. package/dist/pipe/validate-id.pipe.d.ts +6 -6
  91. package/dist/pipe/validate-id.pipe.js +30 -30
  92. package/dist/pipe/validate-search.pipe.d.ts +7 -7
  93. package/dist/pipe/validate-search.pipe.js +45 -45
  94. package/dist/responses/deleted.response.d.ts +3 -3
  95. package/dist/responses/deleted.response.js +20 -20
  96. package/dist/responses/pagination.response.d.ts +5 -5
  97. package/dist/responses/pagination.response.js +25 -25
  98. package/dist/tsconfig.tsbuildinfo +1 -1
  99. package/migration/media-migration.js +82 -82
  100. package/package.json +72 -72
  101. package/src/base/base.medias.ts +209 -209
  102. package/src/common/common.module.ts +10 -10
  103. package/src/common/common.service.ts +109 -109
  104. package/src/common/dto/add-field-translation.dto.ts +23 -23
  105. package/src/common/dto/get-media.dto.ts +12 -12
  106. package/src/index.ts +22 -22
  107. package/src/medias.repository.ts +41 -41
  108. package/src/medias.ts +688 -688
  109. package/src/pipe/validate-search.pipe.ts +44 -44
  110. package/tsconfig.build.json +4 -4
  111. package/tslint.json +18 -18
@@ -1,87 +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
- __decorate([
19
- (0, class_validator_1.IsNotEmpty)(),
20
- (0, class_validator_1.IsString)(),
21
- (0, class_validator_1.MaxLength)(30),
22
- (0, swagger_1.ApiProperty)({ type: String, description: 'ObjectID' }),
23
- __metadata("design:type", String)
24
- ], InternalMediaDto.prototype, "ObjectId", void 0);
25
- __decorate([
26
- (0, class_validator_1.IsNotEmpty)(),
27
- (0, class_validator_1.IsString)(),
28
- (0, class_validator_1.MaxLength)(200),
29
- (0, swagger_1.ApiProperty)({ type: String, description: 'ObjectType' }),
30
- __metadata("design:type", String)
31
- ], InternalMediaDto.prototype, "ObjectType", void 0);
32
- __decorate([
33
- (0, class_validator_1.IsNotEmpty)(),
34
- (0, swagger_1.ApiProperty)({
35
- type: String,
36
- description: 'Enum either Photo, Video, Document',
37
- }),
38
- (0, class_validator_1.IsEnum)(medias_enum_1.MediaType),
39
- __metadata("design:type", String)
40
- ], InternalMediaDto.prototype, "Type", void 0);
41
- __decorate([
42
- (0, class_validator_1.IsNotEmpty)(),
43
- (0, class_validator_1.IsString)(),
44
- (0, class_validator_1.MaxLength)(200),
45
- (0, swagger_1.ApiProperty)({ type: String, description: 'file name without extension' }),
46
- __metadata("design:type", String)
47
- ], InternalMediaDto.prototype, "FileName", void 0);
48
- __decorate([
49
- (0, class_validator_1.IsNotEmpty)(),
50
- (0, class_validator_1.IsString)(),
51
- (0, class_validator_1.MaxLength)(10),
52
- (0, swagger_1.ApiProperty)({ type: String, description: 'extention of file in jpg etc' }),
53
- __metadata("design:type", String)
54
- ], InternalMediaDto.prototype, "FileExtension", void 0);
55
- __decorate([
56
- (0, swagger_1.ApiProperty)({
57
- type: String,
58
- description: 'File stream buffer',
59
- format: 'binary',
60
- }),
61
- __metadata("design:type", Object)
62
- ], InternalMediaDto.prototype, "FileStream", void 0);
63
- __decorate([
64
- (0, class_validator_1.IsNotEmpty)(),
65
- (0, class_validator_1.IsString)(),
66
- (0, class_validator_1.MaxLength)(100),
67
- (0, swagger_1.ApiProperty)({ type: String, description: 'title of the media' }),
68
- __metadata("design:type", String)
69
- ], InternalMediaDto.prototype, "Title", void 0);
70
- __decorate([
71
- (0, class_validator_1.IsNotEmpty)(),
72
- (0, class_validator_1.IsString)(),
73
- (0, class_validator_1.MaxLength)(1000),
74
- (0, swagger_1.ApiProperty)({ type: String, description: 'Description of the media' }),
75
- __metadata("design:type", String)
76
- ], InternalMediaDto.prototype, "Description", void 0);
77
- __decorate([
78
- (0, class_validator_1.IsNotEmpty)(),
79
- (0, class_validator_1.IsEnum)(['N', 'Y']),
80
- (0, swagger_1.ApiProperty)({
81
- type: String,
82
- description: 'Option if media needed to be encryped : Y or N',
83
- }),
84
- __metadata("design:type", String)
85
- ], InternalMediaDto.prototype, "IsEncryptedYN", void 0);
86
- exports.InternalMediaDto = InternalMediaDto;
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
+ __decorate([
19
+ (0, class_validator_1.IsNotEmpty)(),
20
+ (0, class_validator_1.IsString)(),
21
+ (0, class_validator_1.MaxLength)(30),
22
+ (0, swagger_1.ApiProperty)({ type: String, description: 'ObjectID' }),
23
+ __metadata("design:type", String)
24
+ ], InternalMediaDto.prototype, "ObjectId", void 0);
25
+ __decorate([
26
+ (0, class_validator_1.IsNotEmpty)(),
27
+ (0, class_validator_1.IsString)(),
28
+ (0, class_validator_1.MaxLength)(200),
29
+ (0, swagger_1.ApiProperty)({ type: String, description: 'ObjectType' }),
30
+ __metadata("design:type", String)
31
+ ], InternalMediaDto.prototype, "ObjectType", void 0);
32
+ __decorate([
33
+ (0, class_validator_1.IsNotEmpty)(),
34
+ (0, swagger_1.ApiProperty)({
35
+ type: String,
36
+ description: 'Enum either Photo, Video, Document',
37
+ }),
38
+ (0, class_validator_1.IsEnum)(medias_enum_1.MediaType),
39
+ __metadata("design:type", String)
40
+ ], InternalMediaDto.prototype, "Type", void 0);
41
+ __decorate([
42
+ (0, class_validator_1.IsNotEmpty)(),
43
+ (0, class_validator_1.IsString)(),
44
+ (0, class_validator_1.MaxLength)(200),
45
+ (0, swagger_1.ApiProperty)({ type: String, description: 'file name without extension' }),
46
+ __metadata("design:type", String)
47
+ ], InternalMediaDto.prototype, "FileName", void 0);
48
+ __decorate([
49
+ (0, class_validator_1.IsNotEmpty)(),
50
+ (0, class_validator_1.IsString)(),
51
+ (0, class_validator_1.MaxLength)(10),
52
+ (0, swagger_1.ApiProperty)({ type: String, description: 'extention of file in jpg etc' }),
53
+ __metadata("design:type", String)
54
+ ], InternalMediaDto.prototype, "FileExtension", void 0);
55
+ __decorate([
56
+ (0, swagger_1.ApiProperty)({
57
+ type: String,
58
+ description: 'File stream buffer',
59
+ format: 'binary',
60
+ }),
61
+ __metadata("design:type", Object)
62
+ ], InternalMediaDto.prototype, "FileStream", void 0);
63
+ __decorate([
64
+ (0, class_validator_1.IsNotEmpty)(),
65
+ (0, class_validator_1.IsString)(),
66
+ (0, class_validator_1.MaxLength)(100),
67
+ (0, swagger_1.ApiProperty)({ type: String, description: 'title of the media' }),
68
+ __metadata("design:type", String)
69
+ ], InternalMediaDto.prototype, "Title", void 0);
70
+ __decorate([
71
+ (0, class_validator_1.IsNotEmpty)(),
72
+ (0, class_validator_1.IsString)(),
73
+ (0, class_validator_1.MaxLength)(1000),
74
+ (0, swagger_1.ApiProperty)({ type: String, description: 'Description of the media' }),
75
+ __metadata("design:type", String)
76
+ ], InternalMediaDto.prototype, "Description", void 0);
77
+ __decorate([
78
+ (0, class_validator_1.IsNotEmpty)(),
79
+ (0, class_validator_1.IsEnum)(['N', 'Y']),
80
+ (0, swagger_1.ApiProperty)({
81
+ type: String,
82
+ description: 'Option if media needed to be encryped : Y or N',
83
+ }),
84
+ __metadata("design:type", String)
85
+ ], InternalMediaDto.prototype, "IsEncryptedYN", void 0);
86
+ exports.InternalMediaDto = InternalMediaDto;
87
87
  //# sourceMappingURL=internal-medias.dto.js.map
@@ -0,0 +1,12 @@
1
+ import { MediaType } from '../enum/medias.enum';
2
+ export declare class MediaDto {
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,88 @@
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.MediaDto = 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 MediaDto {
17
+ }
18
+ __decorate([
19
+ (0, class_validator_1.IsNotEmpty)(),
20
+ (0, class_validator_1.IsString)(),
21
+ (0, class_validator_1.MaxLength)(30),
22
+ (0, swagger_1.ApiProperty)({ type: String, description: 'ObjectID' }),
23
+ __metadata("design:type", String)
24
+ ], MediaDto.prototype, "ObjectId", void 0);
25
+ __decorate([
26
+ (0, class_validator_1.IsNotEmpty)(),
27
+ (0, class_validator_1.IsString)(),
28
+ (0, class_validator_1.MaxLength)(200),
29
+ (0, swagger_1.ApiProperty)({ type: String, description: 'ObjectType' }),
30
+ __metadata("design:type", String)
31
+ ], MediaDto.prototype, "ObjectType", void 0);
32
+ __decorate([
33
+ (0, class_validator_1.IsNotEmpty)(),
34
+ (0, swagger_1.ApiProperty)({
35
+ type: String,
36
+ description: 'Enum either Photo, Video, Document',
37
+ }),
38
+ (0, class_validator_1.IsEnum)(medias_enum_1.MediaType),
39
+ __metadata("design:type", String)
40
+ ], MediaDto.prototype, "Type", void 0);
41
+ __decorate([
42
+ (0, class_validator_1.IsNotEmpty)(),
43
+ (0, class_validator_1.IsString)(),
44
+ (0, class_validator_1.MaxLength)(200),
45
+ (0, swagger_1.ApiProperty)({ type: String, description: 'file name without extension' }),
46
+ __metadata("design:type", String)
47
+ ], MediaDto.prototype, "FileName", void 0);
48
+ __decorate([
49
+ (0, class_validator_1.IsNotEmpty)(),
50
+ (0, class_validator_1.IsString)(),
51
+ (0, class_validator_1.MaxLength)(10),
52
+ (0, swagger_1.ApiProperty)({ type: String, description: 'extention of file in jpg etc' }),
53
+ __metadata("design:type", String)
54
+ ], MediaDto.prototype, "FileExtension", void 0);
55
+ __decorate([
56
+ (0, class_validator_1.IsNotEmpty)(),
57
+ (0, swagger_1.ApiProperty)({
58
+ type: String,
59
+ description: 'File stream buffer',
60
+ format: 'binary',
61
+ }),
62
+ __metadata("design:type", Object)
63
+ ], MediaDto.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
+ ], MediaDto.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
+ ], MediaDto.prototype, "Description", void 0);
78
+ __decorate([
79
+ (0, class_validator_1.IsNotEmpty)(),
80
+ (0, class_validator_1.IsBoolean)(),
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
+ ], MediaDto.prototype, "IsEncryptedYN", void 0);
87
+ exports.MediaDto = MediaDto;
88
+ //# sourceMappingURL=medias.dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"medias.dto.js","sourceRoot":"","sources":["../../src/dto/medias.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAA8C;AAC9C,qDAMyB;AACzB,qDAAgD;AAEhD,MAAa,QAAQ;CA4DpB;AAvDC;IAJC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,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AAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,2BAAS,EAAC,IAAI,CAAC;IACf,IAAA,qBAAW,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,0BAA0B,EAAE,CAAC;;6CACnD;AAQpB;IANC,IAAA,4BAAU,GAAE;IACZ,IAAA,2BAAS,GAAE;IACX,IAAA,qBAAW,EAAC;QACX,IAAI,EAAE,MAAM;QACZ,WAAW,EAAE,gDAAgD;KAC9D,CAAC;;+CACoB;AA3DxB,4BA4DC"}
@@ -0,0 +1,2 @@
1
+ import { MediaModel } from './media.entity';
2
+ export { MediaModel };
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MediaModel = void 0;
4
+ const media_entity_1 = require("./media.entity");
5
+ Object.defineProperty(exports, "MediaModel", { enumerable: true, get: function () { return media_entity_1.MediaModel; } });
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/entities/index.ts"],"names":[],"mappings":";;;AAAA,iDAA4C;AAEnC,2FAFA,yBAAU,OAEA"}
@@ -0,0 +1,21 @@
1
+ import { Model } from 'sequelize-typescript';
2
+ import { MediaType } from '../enum/medias.enum';
3
+ export declare class MediaModel 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
+ }
@@ -0,0 +1,152 @@
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.MediaModel = void 0;
13
+ const swagger_1 = require("@nestjs/swagger");
14
+ const sequelize_typescript_1 = require("sequelize-typescript");
15
+ const medias_enum_1 = require("../enum/medias.enum");
16
+ let MediaModel = class MediaModel extends sequelize_typescript_1.Model {
17
+ };
18
+ __decorate([
19
+ (0, sequelize_typescript_1.Column)({
20
+ primaryKey: true,
21
+ allowNull: false,
22
+ }),
23
+ (0, swagger_1.ApiProperty)({ type: String, description: 'MediaID' }),
24
+ __metadata("design:type", String)
25
+ ], MediaModel.prototype, "MediaId", void 0);
26
+ __decorate([
27
+ (0, sequelize_typescript_1.Column)({
28
+ allowNull: false,
29
+ }),
30
+ (0, swagger_1.ApiProperty)({ type: String, description: 'ObjectID' }),
31
+ __metadata("design:type", String)
32
+ ], MediaModel.prototype, "ObjectId", void 0);
33
+ __decorate([
34
+ (0, sequelize_typescript_1.Column)({
35
+ allowNull: false,
36
+ }),
37
+ (0, swagger_1.ApiProperty)({ type: String, description: 'ObjectType' }),
38
+ __metadata("design:type", String)
39
+ ], MediaModel.prototype, "ObjectType", void 0);
40
+ __decorate([
41
+ (0, sequelize_typescript_1.Column)({
42
+ allowNull: true,
43
+ }),
44
+ (0, swagger_1.ApiProperty)({ type: String, description: 'title of the media' }),
45
+ __metadata("design:type", String)
46
+ ], MediaModel.prototype, "Title", void 0);
47
+ __decorate([
48
+ (0, sequelize_typescript_1.Column)({
49
+ allowNull: true,
50
+ }),
51
+ (0, swagger_1.ApiProperty)({ type: String, description: 'Description of the media' }),
52
+ __metadata("design:type", String)
53
+ ], MediaModel.prototype, "Description", void 0);
54
+ __decorate([
55
+ (0, sequelize_typescript_1.Column)({
56
+ allowNull: false,
57
+ }),
58
+ (0, swagger_1.ApiProperty)({
59
+ type: String,
60
+ description: 'Enum either Photo, Video, Document',
61
+ }),
62
+ __metadata("design:type", String)
63
+ ], MediaModel.prototype, "Type", void 0);
64
+ __decorate([
65
+ (0, sequelize_typescript_1.Column)({
66
+ allowNull: false,
67
+ }),
68
+ (0, swagger_1.ApiProperty)({ type: String, description: 'isExternal either Y, N' }),
69
+ __metadata("design:type", String)
70
+ ], MediaModel.prototype, "IsExternalYN", void 0);
71
+ __decorate([
72
+ (0, sequelize_typescript_1.Column)({
73
+ allowNull: true,
74
+ }),
75
+ (0, swagger_1.ApiProperty)({ type: String, description: 'External surce for the file' }),
76
+ __metadata("design:type", String)
77
+ ], MediaModel.prototype, "ExternalSource", void 0);
78
+ __decorate([
79
+ (0, sequelize_typescript_1.Column)({
80
+ allowNull: false,
81
+ }),
82
+ (0, swagger_1.ApiProperty)({ type: String, description: 'isExternal either Y, N' }),
83
+ __metadata("design:type", String)
84
+ ], MediaModel.prototype, "IsEncryptedYN", void 0);
85
+ __decorate([
86
+ (0, sequelize_typescript_1.Column)({
87
+ allowNull: true,
88
+ }),
89
+ (0, swagger_1.ApiProperty)({ type: String, description: 'file name without extension' }),
90
+ __metadata("design:type", String)
91
+ ], MediaModel.prototype, "FileName", void 0);
92
+ __decorate([
93
+ (0, sequelize_typescript_1.Column)({
94
+ allowNull: true,
95
+ }),
96
+ (0, swagger_1.ApiProperty)({ type: String, description: 'extention of file in jpg etc' }),
97
+ __metadata("design:type", String)
98
+ ], MediaModel.prototype, "FileExtension", void 0);
99
+ __decorate([
100
+ (0, sequelize_typescript_1.Column)({
101
+ allowNull: true,
102
+ }),
103
+ (0, swagger_1.ApiProperty)({
104
+ type: String,
105
+ description: 'location on the media in term of path',
106
+ }),
107
+ __metadata("design:type", String)
108
+ ], MediaModel.prototype, "FilePath", void 0);
109
+ __decorate([
110
+ (0, sequelize_typescript_1.Column)({
111
+ allowNull: true,
112
+ }),
113
+ (0, swagger_1.ApiProperty)({ type: String, description: 'URl of the media' }),
114
+ __metadata("design:type", String)
115
+ ], MediaModel.prototype, "URL", void 0);
116
+ __decorate([
117
+ (0, swagger_1.ApiProperty)({
118
+ example: new Date(),
119
+ description: 'Timestamp for data creation.',
120
+ }),
121
+ sequelize_typescript_1.CreatedAt,
122
+ __metadata("design:type", Date)
123
+ ], MediaModel.prototype, "CreatedAt", void 0);
124
+ __decorate([
125
+ (0, swagger_1.ApiProperty)({
126
+ example: '138140891dd211b288d34bc7b4312a49',
127
+ description: 'The CreatedById for Media.',
128
+ }),
129
+ (0, sequelize_typescript_1.Column)({ allowNull: false }),
130
+ __metadata("design:type", String)
131
+ ], MediaModel.prototype, "CreatedById", void 0);
132
+ __decorate([
133
+ (0, swagger_1.ApiProperty)({
134
+ example: new Date(),
135
+ description: 'Timestamp for latest data modification',
136
+ }),
137
+ sequelize_typescript_1.UpdatedAt,
138
+ __metadata("design:type", Date)
139
+ ], MediaModel.prototype, "UpdatedAt", void 0);
140
+ __decorate([
141
+ (0, swagger_1.ApiProperty)({
142
+ example: '138140891dd211b288d34bc7b4312a49',
143
+ description: 'The UpdatedById for Media.',
144
+ }),
145
+ (0, sequelize_typescript_1.Column)({ allowNull: false }),
146
+ __metadata("design:type", String)
147
+ ], MediaModel.prototype, "UpdatedById", void 0);
148
+ MediaModel = __decorate([
149
+ (0, sequelize_typescript_1.Table)({ tableName: 'common_Media', createdAt: false, updatedAt: false })
150
+ ], MediaModel);
151
+ exports.MediaModel = MediaModel;
152
+ //# sourceMappingURL=media.entity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"media.entity.js","sourceRoot":"","sources":["../../src/entities/media.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAA8C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,6BAAM,EAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;+CACT;AAOpB;IALC,IAAA,qBAAW,EAAC;QACX,OAAO,EAAE,IAAI,IAAI,EAAE;QACnB,WAAW,EAAE,wCAAwC;KACtD,CAAC;IACD,gCAAS;8BACC,IAAI;6CAAC;AAOhB;IALC,IAAA,qBAAW,EAAC;QACX,OAAO,EAAE,kCAAkC;QAC3C,WAAW,EAAE,4BAA4B;KAC1C,CAAC;IACD,IAAA,6BAAM,EAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;+CACT;AAhHT,UAAU;IADtB,IAAA,4BAAK,EAAC,EAAE,SAAS,EAAE,cAAc,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;GAC5D,UAAU,CAiHtB;AAjHY,gCAAU"}
@@ -1,21 +1,21 @@
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
- }
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
+ }