@tomei/media 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. package/.commitlintrc.json +22 -0
  2. package/.eslintrc.js +66 -0
  3. package/.husky/commit-msg +4 -0
  4. package/.husky/pre-commit +4 -0
  5. package/.prettierrc +4 -0
  6. package/.prettierrc copy +4 -0
  7. package/README.md +93 -0
  8. package/dist/base/base.medias.d.ts +37 -0
  9. package/dist/base/base.medias.js +161 -0
  10. package/dist/base/base.medias.js.map +1 -0
  11. package/dist/base/base.repository.abstract.d.ts +12 -0
  12. package/dist/base/base.repository.abstract.js +22 -0
  13. package/dist/base/base.repository.abstract.js.map +1 -0
  14. package/dist/base/base.repository.interface.d.ts +9 -0
  15. package/dist/base/base.repository.interface.js +3 -0
  16. package/dist/base/base.repository.interface.js.map +1 -0
  17. package/dist/common/common.module.d.ts +2 -0
  18. package/dist/common/common.module.js +23 -0
  19. package/dist/common/common.module.js.map +1 -0
  20. package/dist/common/common.service.d.ts +13 -0
  21. package/dist/common/common.service.js +108 -0
  22. package/dist/common/common.service.js.map +1 -0
  23. package/dist/common/dto/add-field-translation.dto.d.ts +7 -0
  24. package/dist/common/dto/add-field-translation.dto.js +42 -0
  25. package/dist/common/dto/add-field-translation.dto.js.map +1 -0
  26. package/dist/common/dto/get-media.dto.d.ts +5 -0
  27. package/dist/common/dto/get-media.dto.js +29 -0
  28. package/dist/common/dto/get-media.dto.js.map +1 -0
  29. package/dist/dto/external-media.dto.d.ts +10 -0
  30. package/dist/dto/external-media.dto.js +70 -0
  31. package/dist/dto/external-media.dto.js.map +1 -0
  32. package/dist/dto/internal-medias.dto.d.ts +12 -0
  33. package/dist/dto/internal-medias.dto.js +87 -0
  34. package/dist/dto/internal-medias.dto.js.map +1 -0
  35. package/dist/entities/medias.entity.d.ts +21 -0
  36. package/dist/entities/medias.entity.js +152 -0
  37. package/dist/entities/medias.entity.js.map +1 -0
  38. package/dist/enum/index.d.ts +2 -0
  39. package/dist/enum/index.js +6 -0
  40. package/dist/enum/index.js.map +1 -0
  41. package/dist/enum/medias.enum.d.ts +5 -0
  42. package/dist/enum/medias.enum.js +10 -0
  43. package/dist/enum/medias.enum.js.map +1 -0
  44. package/dist/helpers/error.d.ts +1 -0
  45. package/dist/helpers/error.js +14 -0
  46. package/dist/helpers/error.js.map +1 -0
  47. package/dist/helpers/index.d.ts +2 -0
  48. package/dist/helpers/index.js +6 -0
  49. package/dist/helpers/index.js.map +1 -0
  50. package/dist/index.d.ts +6 -0
  51. package/dist/index.js +14 -0
  52. package/dist/index.js.map +1 -0
  53. package/dist/interfaces/base.medias-attr.interface.d.ts +20 -0
  54. package/dist/interfaces/base.medias-attr.interface.js +3 -0
  55. package/dist/interfaces/base.medias-attr.interface.js.map +1 -0
  56. package/dist/interfaces/medias.repository.interface.d.ts +3 -0
  57. package/dist/interfaces/medias.repository.interface.js +3 -0
  58. package/dist/interfaces/medias.repository.interface.js.map +1 -0
  59. package/dist/medias.controller.d.ts +25 -0
  60. package/dist/medias.controller.js +225 -0
  61. package/dist/medias.controller.js.map +1 -0
  62. package/dist/medias.d.ts +42 -0
  63. package/dist/medias.js +373 -0
  64. package/dist/medias.js.map +1 -0
  65. package/dist/medias.module.d.ts +2 -0
  66. package/dist/medias.module.js +32 -0
  67. package/dist/medias.module.js.map +1 -0
  68. package/dist/medias.repository.d.ts +16 -0
  69. package/dist/medias.repository.js +47 -0
  70. package/dist/medias.repository.js.map +1 -0
  71. package/dist/pipe/append-id.pipe.d.ts +6 -0
  72. package/dist/pipe/append-id.pipe.js +28 -0
  73. package/dist/pipe/append-id.pipe.js.map +1 -0
  74. package/dist/pipe/validate-enum.pipe.d.ts +6 -0
  75. package/dist/pipe/validate-enum.pipe.js +34 -0
  76. package/dist/pipe/validate-enum.pipe.js.map +1 -0
  77. package/dist/pipe/validate-id.pipe.d.ts +6 -0
  78. package/dist/pipe/validate-id.pipe.js +31 -0
  79. package/dist/pipe/validate-id.pipe.js.map +1 -0
  80. package/dist/pipe/validate-search.pipe.d.ts +7 -0
  81. package/dist/pipe/validate-search.pipe.js +46 -0
  82. package/dist/pipe/validate-search.pipe.js.map +1 -0
  83. package/dist/responses/deleted.response.d.ts +3 -0
  84. package/dist/responses/deleted.response.js +21 -0
  85. package/dist/responses/deleted.response.js.map +1 -0
  86. package/dist/responses/pagination.response.d.ts +5 -0
  87. package/dist/responses/pagination.response.js +26 -0
  88. package/dist/responses/pagination.response.js.map +1 -0
  89. package/dist/tsconfig.tsbuildinfo +1 -0
  90. package/nest-cli.json +19 -0
  91. package/package.json +60 -0
  92. package/src/base/base.medias.ts +200 -0
  93. package/src/base/base.repository.abstract.ts +28 -0
  94. package/src/base/base.repository.interface.ts +9 -0
  95. package/src/common/common.module.ts +10 -0
  96. package/src/common/common.service.ts +109 -0
  97. package/src/common/dto/add-field-translation.dto.ts +23 -0
  98. package/src/common/dto/get-media.dto.ts +12 -0
  99. package/src/dto/external-media.dto.ts +49 -0
  100. package/src/dto/internal-medias.dto.ts +64 -0
  101. package/src/entities/medias.entity.ts +125 -0
  102. package/src/enum/index.ts +3 -0
  103. package/src/enum/medias.enum.ts +5 -0
  104. package/src/helpers/error.ts +12 -0
  105. package/src/helpers/index.ts +3 -0
  106. package/src/index.ts +13 -0
  107. package/src/interfaces/base.medias-attr.interface.ts +21 -0
  108. package/src/interfaces/medias.repository.interface.ts +4 -0
  109. package/src/medias.controller.ts +244 -0
  110. package/src/medias.module.ts +19 -0
  111. package/src/medias.repository.ts +44 -0
  112. package/src/medias.ts +494 -0
  113. package/src/pipe/append-id.pipe.ts +15 -0
  114. package/src/pipe/validate-enum.pipe.ts +31 -0
  115. package/src/pipe/validate-id.pipe.ts +18 -0
  116. package/src/pipe/validate-search.pipe.ts +41 -0
  117. package/src/responses/deleted.response.ts +6 -0
  118. package/src/responses/pagination.response.ts +10 -0
  119. package/tsconfig.build.json +4 -0
  120. package/tsconfig.json +30 -0
  121. package/tslint.json +18 -0
@@ -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
+ __decorate([
17
+ (0, class_validator_1.IsNotEmpty)(),
18
+ (0, class_validator_1.IsString)(),
19
+ __metadata("design:type", String)
20
+ ], AddFieldTranslationDto.prototype, "ObjectTable", void 0);
21
+ __decorate([
22
+ (0, class_validator_1.IsNotEmpty)(),
23
+ (0, class_validator_1.IsString)(),
24
+ __metadata("design:type", String)
25
+ ], AddFieldTranslationDto.prototype, "ObjectField", void 0);
26
+ __decorate([
27
+ (0, class_validator_1.IsNotEmpty)(),
28
+ (0, class_validator_1.IsString)(),
29
+ __metadata("design:type", String)
30
+ ], AddFieldTranslationDto.prototype, "ObjectId", void 0);
31
+ __decorate([
32
+ (0, class_validator_1.IsNotEmpty)(),
33
+ (0, class_validator_1.IsString)(),
34
+ __metadata("design:type", String)
35
+ ], AddFieldTranslationDto.prototype, "LanguageCode", void 0);
36
+ __decorate([
37
+ (0, class_validator_1.IsNotEmpty)(),
38
+ (0, class_validator_1.IsString)(),
39
+ __metadata("design:type", String)
40
+ ], AddFieldTranslationDto.prototype, "Translation", void 0);
41
+ exports.AddFieldTranslationDto = AddFieldTranslationDto;
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;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;AAnBtB,wDAoBC"}
@@ -0,0 +1,5 @@
1
+ export declare class GetMediaDto {
2
+ ObjectID?: string;
3
+ ObjectType?: string;
4
+ Title: string;
5
+ }
@@ -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
+ __decorate([
17
+ (0, class_validator_1.IsString)(),
18
+ __metadata("design:type", String)
19
+ ], GetMediaDto.prototype, "ObjectID", void 0);
20
+ __decorate([
21
+ (0, class_validator_1.IsString)(),
22
+ __metadata("design:type", String)
23
+ ], GetMediaDto.prototype, "ObjectType", void 0);
24
+ __decorate([
25
+ (0, class_validator_1.IsString)(),
26
+ __metadata("design:type", String)
27
+ ], GetMediaDto.prototype, "Title", void 0);
28
+ exports.GetMediaDto = GetMediaDto;
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;AAPC;IADC,IAAA,0BAAQ,GAAE;;6CACO;AAGlB;IADC,IAAA,0BAAQ,GAAE;;+CACS;AAGpB;IADC,IAAA,0BAAQ,GAAE;;0CACG;AARhB,kCASC"}
@@ -0,0 +1,10 @@
1
+ import { MediaType } from '../enum/medias.enum';
2
+ export declare class ExternalMediaDto {
3
+ ObjectId: string;
4
+ ObjectType: string;
5
+ Type: MediaType;
6
+ URL: string;
7
+ ExternalSource: string;
8
+ Title: string;
9
+ Description: string;
10
+ }
@@ -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
+ __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
+ ], ExternalMediaDto.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
+ ], ExternalMediaDto.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
+ ], ExternalMediaDto.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: 'URL whre the file stored' }),
46
+ __metadata("design:type", String)
47
+ ], ExternalMediaDto.prototype, "URL", void 0);
48
+ __decorate([
49
+ (0, class_validator_1.IsNotEmpty)(),
50
+ (0, class_validator_1.IsString)(),
51
+ (0, class_validator_1.MaxLength)(200),
52
+ (0, swagger_1.ApiProperty)({ type: String, description: 'external source of the file' }),
53
+ __metadata("design:type", String)
54
+ ], ExternalMediaDto.prototype, "ExternalSource", void 0);
55
+ __decorate([
56
+ (0, class_validator_1.IsNotEmpty)(),
57
+ (0, class_validator_1.IsString)(),
58
+ (0, class_validator_1.MaxLength)(100),
59
+ (0, swagger_1.ApiProperty)({ type: String, description: 'title of the media' }),
60
+ __metadata("design:type", String)
61
+ ], ExternalMediaDto.prototype, "Title", void 0);
62
+ __decorate([
63
+ (0, class_validator_1.IsNotEmpty)(),
64
+ (0, class_validator_1.IsString)(),
65
+ (0, class_validator_1.MaxLength)(1000),
66
+ (0, swagger_1.ApiProperty)({ type: String, description: 'Description of the media' }),
67
+ __metadata("design:type", String)
68
+ ], ExternalMediaDto.prototype, "Description", void 0);
69
+ exports.ExternalMediaDto = ExternalMediaDto;
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;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;AA3CtB,4CA4CC"}
@@ -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
+ __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
+ //# 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;AAtDC;IAJC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,2BAAS,EAAC,EAAE,CAAC;IACb,I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AAA,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;AA1DxB,4CA2DC"}
@@ -0,0 +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
+ }
@@ -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.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
+ __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
+ ], MediasModel.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
+ ], MediasModel.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
+ ], MediasModel.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
+ ], MediasModel.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
+ ], MediasModel.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
+ ], MediasModel.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
+ ], MediasModel.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
+ ], MediasModel.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
+ ], MediasModel.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
+ ], MediasModel.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
+ ], MediasModel.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
+ ], MediasModel.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
+ ], MediasModel.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
+ ], MediasModel.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
+ ], MediasModel.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
+ ], MediasModel.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
+ ], MediasModel.prototype, "UpdatedById", void 0);
148
+ MediasModel = __decorate([
149
+ (0, sequelize_typescript_1.Table)({ tableName: 'common_Media', createdAt: false, updatedAt: false })
150
+ ], MediasModel);
151
+ exports.MediasModel = MediasModel;
152
+ //# 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,+DAM8B;AAC9B,kCAAoC;AAGpC,IAAa,WAAW,GAAxB,MAAa,WAAY,SAAQ,4BAAK;CAiHrC,CAAA;AA3GC;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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AK,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;GAC5D,WAAW,CAiHvB;AAjHY,kCAAW"}
@@ -0,0 +1,2 @@
1
+ import { MediaType } from './medias.enum';
2
+ export { MediaType };
@@ -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"}
@@ -0,0 +1,5 @@
1
+ export declare enum MediaType {
2
+ Photo = "Photo",
3
+ Video = "Video",
4
+ Document = "Document"
5
+ }
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MediaType = void 0;
4
+ var MediaType;
5
+ (function (MediaType) {
6
+ MediaType["Photo"] = "Photo";
7
+ MediaType["Video"] = "Video";
8
+ MediaType["Document"] = "Document";
9
+ })(MediaType = exports.MediaType || (exports.MediaType = {}));
10
+ //# sourceMappingURL=medias.enum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"medias.enum.js","sourceRoot":"","sources":["../../src/enum/medias.enum.ts"],"names":[],"mappings":";;;AAAA,IAAY,SAIX;AAJD,WAAY,SAAS;IACnB,4BAAe,CAAA;IACf,4BAAe,CAAA;IACf,kCAAqB,CAAA;AACvB,CAAC,EAJW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAIpB"}
@@ -0,0 +1 @@
1
+ export declare function throwException(err: any): void;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.throwException = void 0;
4
+ const common_1 = require("@nestjs/common");
5
+ function throwException(err) {
6
+ if (err.response) {
7
+ throw err;
8
+ }
9
+ else {
10
+ throw new common_1.HttpException('Something went wrong. Please see application log.', err.statusCode);
11
+ }
12
+ }
13
+ exports.throwException = throwException;
14
+ //# sourceMappingURL=error.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error.js","sourceRoot":"","sources":["../../src/helpers/error.ts"],"names":[],"mappings":";;;AAAA,2CAA+C;AAE/C,SAAgB,cAAc,CAAC,GAAG;IAChC,IAAI,GAAG,CAAC,QAAQ,EAAE;QAChB,MAAM,GAAG,CAAC;KACX;SAAM;QACL,MAAM,IAAI,sBAAa,CACrB,mDAAmD,EACnD,GAAG,CAAC,UAAU,CACf,CAAC;KACH;AACH,CAAC;AATD,wCASC"}
@@ -0,0 +1,2 @@
1
+ import { throwException } from './error';
2
+ export { throwException };
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.throwException = void 0;
4
+ const error_1 = require("./error");
5
+ Object.defineProperty(exports, "throwException", { enumerable: true, get: function () { return error_1.throwException; } });
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":";;;AAAA,mCAAyC;AAEhC,+FAFA,sBAAc,OAEA"}
@@ -0,0 +1,6 @@
1
+ import { MediasModule } from "./medias.module";
2
+ import { MediasController } from "./medias.controller";
3
+ import { MediasRepository } from "./medias.repository";
4
+ import { MediasModel } from "./entities/medias.entity";
5
+ import { Medias } from "./medias";
6
+ export { MediasModule, MediasController, MediasRepository, MediasModel, Medias, };
package/dist/index.js ADDED
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Medias = exports.MediasModel = exports.MediasRepository = exports.MediasController = exports.MediasModule = void 0;
4
+ const medias_module_1 = require("./medias.module");
5
+ Object.defineProperty(exports, "MediasModule", { enumerable: true, get: function () { return medias_module_1.MediasModule; } });
6
+ const medias_controller_1 = require("./medias.controller");
7
+ Object.defineProperty(exports, "MediasController", { enumerable: true, get: function () { return medias_controller_1.MediasController; } });
8
+ const medias_repository_1 = require("./medias.repository");
9
+ Object.defineProperty(exports, "MediasRepository", { enumerable: true, get: function () { return medias_repository_1.MediasRepository; } });
10
+ const medias_entity_1 = require("./entities/medias.entity");
11
+ Object.defineProperty(exports, "MediasModel", { enumerable: true, get: function () { return medias_entity_1.MediasModel; } });
12
+ const medias_1 = require("./medias");
13
+ Object.defineProperty(exports, "Medias", { enumerable: true, get: function () { return medias_1.Medias; } });
14
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,mDAA+C;AAO3C,6FAPK,4BAAY,OAOL;AANhB,2DAAuD;AAOnD,iGAPK,oCAAgB,OAOL;AANpB,2DAAuD;AAOnD,iGAPK,oCAAgB,OAOL;AANpB,4DAAuD;AAOnD,4FAPK,2BAAW,OAOL;AANf,qCAAkC;AAO9B,uFAPK,eAAM,OAOL"}
@@ -0,0 +1,20 @@
1
+ import { MediaType } from '../enum/medias.enum';
2
+ export interface IBaseMediasAttr {
3
+ MediaId: string;
4
+ ObjectId: string;
5
+ ObjectType: string;
6
+ Title: string;
7
+ Description: string;
8
+ Type: MediaType;
9
+ IsExternalYN: string;
10
+ ExternalSource: string;
11
+ IsEncryptedYN: string;
12
+ FileName: string;
13
+ FileExtension: string;
14
+ FilePath: string;
15
+ URL: string;
16
+ CreatedAt: Date;
17
+ UpdatedAt: Date;
18
+ CreatedById: string;
19
+ UpdatedById: string;
20
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=base.medias-attr.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base.medias-attr.interface.js","sourceRoot":"","sources":["../../src/interfaces/base.medias-attr.interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ import { IBaseRepository } from '../base/base.repository.interface';
2
+ import { MediasModel } from '../entities/medias.entity';
3
+ export declare type IMediasRepository = IBaseRepository<MediasModel>;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=medias.repository.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"medias.repository.interface.js","sourceRoot":"","sources":["../../src/interfaces/medias.repository.interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,25 @@
1
+ /// <reference types="multer" />
2
+ import { StreamableFile } from '@nestjs/common';
3
+ import { CommonService } from './common/common.service';
4
+ import { ExternalMediaDto } from './dto/external-media.dto';
5
+ import { InternalMediaDto } from './dto/internal-medias.dto';
6
+ import { MediasModel } from './entities/medias.entity';
7
+ import { IBaseMediasAttr } from './interfaces/base.medias-attr.interface';
8
+ import { IMediasRepository } from './interfaces/medias.repository.interface';
9
+ import { Response } from 'express';
10
+ export declare class MediasController {
11
+ private readonly mediaRepository;
12
+ private readonly commonService;
13
+ constructor(mediaRepository: IMediasRepository, commonService: CommonService);
14
+ createInternal(fileStream: Express.Multer.File, createMedia: InternalMediaDto): Promise<MediasModel>;
15
+ createExternal(createMedia: ExternalMediaDto): Promise<IBaseMediasAttr>;
16
+ findAll(rows: number, page: number, search: string): Promise<{
17
+ count: number;
18
+ rows: MediasModel[];
19
+ }>;
20
+ findOne(id: string): Promise<MediasModel>;
21
+ getFile(id: string, res: Response): Promise<StreamableFile>;
22
+ delete(id: string): Promise<any>;
23
+ updateExternal(id: string, updatedMedia: ExternalMediaDto): Promise<void>;
24
+ updateInternal(fileStream: Express.Multer.File, id: string, updatedMedia: InternalMediaDto): Promise<IBaseMediasAttr>;
25
+ }