@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.
Files changed (119) hide show
  1. package/.commitlintrc.json +22 -22
  2. package/.gitlab-ci.yml +16 -16
  3. package/.husky/commit-msg +15 -15
  4. package/.husky/pre-commit +7 -7
  5. package/.prettierrc +4 -4
  6. package/README.md +93 -93
  7. package/dist/base/base.medias.d.ts +38 -0
  8. package/dist/base/base.medias.js +175 -0
  9. package/dist/base/base.medias.js.map +1 -0
  10. package/dist/base/base.repository.abstract.d.ts +12 -0
  11. package/dist/base/base.repository.abstract.js +22 -0
  12. package/dist/base/base.repository.abstract.js.map +1 -0
  13. package/dist/base/base.repository.interface.d.ts +9 -0
  14. package/dist/base/base.repository.interface.js +3 -0
  15. package/dist/base/base.repository.interface.js.map +1 -0
  16. package/dist/common/common.module.d.ts +2 -0
  17. package/dist/common/common.module.js +23 -0
  18. package/dist/common/common.module.js.map +1 -0
  19. package/dist/common/common.service.d.ts +13 -0
  20. package/dist/common/common.service.js +106 -0
  21. package/dist/common/common.service.js.map +1 -0
  22. package/dist/common/dto/add-field-translation.dto.d.ts +7 -0
  23. package/dist/common/dto/add-field-translation.dto.js +42 -0
  24. package/dist/common/dto/add-field-translation.dto.js.map +1 -0
  25. package/dist/common/dto/get-media.dto.d.ts +5 -0
  26. package/dist/common/dto/get-media.dto.js +29 -0
  27. package/dist/common/dto/get-media.dto.js.map +1 -0
  28. package/dist/database.d.ts +4 -0
  29. package/dist/database.js +16 -0
  30. package/dist/database.js.map +1 -0
  31. package/dist/dto/external-media.dto.d.ts +10 -0
  32. package/dist/dto/external-media.dto.js +70 -0
  33. package/dist/dto/external-media.dto.js.map +1 -0
  34. package/dist/dto/internal-medias.dto.d.ts +12 -0
  35. package/dist/dto/internal-medias.dto.js +87 -0
  36. package/dist/dto/internal-medias.dto.js.map +1 -0
  37. package/dist/entities/medias.entity.d.ts +23 -0
  38. package/dist/entities/medias.entity.js +160 -0
  39. package/dist/entities/medias.entity.js.map +1 -0
  40. package/dist/enum/index.d.ts +2 -0
  41. package/dist/enum/index.js +6 -0
  42. package/dist/enum/index.js.map +1 -0
  43. package/dist/enum/medias.enum.d.ts +5 -0
  44. package/dist/enum/medias.enum.js +10 -0
  45. package/dist/enum/medias.enum.js.map +1 -0
  46. package/dist/helpers/error.d.ts +1 -0
  47. package/dist/helpers/error.js +13 -0
  48. package/dist/helpers/error.js.map +1 -0
  49. package/dist/helpers/index.d.ts +2 -0
  50. package/dist/helpers/index.js +6 -0
  51. package/dist/helpers/index.js.map +1 -0
  52. package/dist/index.d.ts +12 -0
  53. package/dist/index.js +22 -0
  54. package/dist/index.js.map +1 -0
  55. package/dist/interfaces/base.medias-attr.interface.d.ts +20 -0
  56. package/dist/interfaces/base.medias-attr.interface.js +3 -0
  57. package/dist/interfaces/base.medias-attr.interface.js.map +1 -0
  58. package/dist/interfaces/medias.repository.interface.d.ts +3 -0
  59. package/dist/interfaces/medias.repository.interface.js +3 -0
  60. package/dist/interfaces/medias.repository.interface.js.map +1 -0
  61. package/dist/medias.d.ts +65 -0
  62. package/dist/medias.js +564 -0
  63. package/dist/medias.js.map +1 -0
  64. package/dist/medias.repository.d.ts +8 -0
  65. package/dist/medias.repository.js +56 -0
  66. package/dist/medias.repository.js.map +1 -0
  67. package/dist/pipe/append-id.pipe.d.ts +6 -0
  68. package/dist/pipe/append-id.pipe.js +28 -0
  69. package/dist/pipe/append-id.pipe.js.map +1 -0
  70. package/dist/pipe/validate-enum.pipe.d.ts +6 -0
  71. package/dist/pipe/validate-enum.pipe.js +34 -0
  72. package/dist/pipe/validate-enum.pipe.js.map +1 -0
  73. package/dist/pipe/validate-id.pipe.d.ts +6 -0
  74. package/dist/pipe/validate-id.pipe.js +31 -0
  75. package/dist/pipe/validate-id.pipe.js.map +1 -0
  76. package/dist/pipe/validate-search.pipe.d.ts +7 -0
  77. package/dist/pipe/validate-search.pipe.js +46 -0
  78. package/dist/pipe/validate-search.pipe.js.map +1 -0
  79. package/dist/responses/deleted.response.d.ts +3 -0
  80. package/dist/responses/deleted.response.js +21 -0
  81. package/dist/responses/deleted.response.js.map +1 -0
  82. package/dist/responses/pagination.response.d.ts +5 -0
  83. package/dist/responses/pagination.response.js +26 -0
  84. package/dist/responses/pagination.response.js.map +1 -0
  85. package/dist/tsconfig.tsbuildinfo +1 -0
  86. package/eslint.config.mjs +58 -58
  87. package/migration/0001-add-defaultyn-hiddenyn-to-media-table.js +36 -36
  88. package/migration/media-migration.js +82 -82
  89. package/nest-cli.json +18 -18
  90. package/package.json +79 -79
  91. package/sonar-project.properties +12 -12
  92. package/src/base/base.medias.ts +210 -210
  93. package/src/base/base.repository.abstract.ts +28 -28
  94. package/src/base/base.repository.interface.ts +9 -9
  95. package/src/common/common.module.ts +10 -10
  96. package/src/common/common.service.ts +107 -107
  97. package/src/common/dto/add-field-translation.dto.ts +23 -23
  98. package/src/common/dto/get-media.dto.ts +12 -12
  99. package/src/database.ts +16 -16
  100. package/src/dto/external-media.dto.ts +49 -49
  101. package/src/dto/internal-medias.dto.ts +64 -64
  102. package/src/entities/medias.entity.ts +125 -125
  103. package/src/enum/index.ts +3 -3
  104. package/src/enum/medias.enum.ts +5 -5
  105. package/src/helpers/error.ts +12 -12
  106. package/src/helpers/index.ts +3 -3
  107. package/src/index.ts +24 -24
  108. package/src/interfaces/base.medias-attr.interface.ts +21 -21
  109. package/src/interfaces/medias.repository.interface.ts +4 -4
  110. package/src/medias.repository.ts +55 -55
  111. package/src/medias.ts +769 -769
  112. package/src/pipe/append-id.pipe.ts +15 -15
  113. package/src/pipe/validate-enum.pipe.ts +31 -31
  114. package/src/pipe/validate-id.pipe.ts +18 -18
  115. package/src/pipe/validate-search.pipe.ts +44 -44
  116. package/src/responses/deleted.response.ts +6 -6
  117. package/src/responses/pagination.response.ts +10 -10
  118. package/tsconfig.build.json +4 -4
  119. package/tsconfig.json +30 -30
@@ -1,107 +1,107 @@
1
- import {
2
- HttpException,
3
- Injectable,
4
- InternalServerErrorException,
5
- } from '@nestjs/common';
6
- import { ConfigService } from '@nestjs/config';
7
- import axios from 'axios';
8
- import * as cuid from 'cuid';
9
- import { omit, omitBy, keys, pick } from 'lodash';
10
- import { AddFieldTranslationDto } from './dto/add-field-translation.dto';
11
- import { GetMediaDto } from './dto/get-media.dto';
12
- @Injectable()
13
- export class CommonService {
14
- private readonly commonApiUrl: string;
15
-
16
- constructor(private configService: ConfigService) {
17
- this.commonApiUrl = this.configService.get('COMMON_API_URL');
18
- }
19
-
20
- handleAxiosError(err) {
21
- if (err.response) {
22
- throw new HttpException(err.response.data, err.response.status);
23
- } else if (err.request) {
24
- throw new HttpException(err.request, 500);
25
- } else {
26
- throw new InternalServerErrorException(err.message);
27
- }
28
- }
29
-
30
- async addActivityHistory(record, entity, method) {
31
- const activity =
32
- method === 'create'
33
- ? 'Insert new'
34
- : method === 'update'
35
- ? 'Update'
36
- : 'Delete';
37
-
38
- const filteredRecord = omit(record.EntityValueAfter, [
39
- 'CreatedById',
40
- 'CreatedAt',
41
- 'UpdatedById',
42
- 'UpdatedAt',
43
- ]);
44
-
45
- const filteredRecordBefore = pick(
46
- record.EntityValueBefore,
47
- keys(filteredRecord),
48
- );
49
-
50
- const payload = {
51
- Action: record.Action || (method === 'create' ? 'Insert' : activity),
52
- Activity: record.Activity || `${activity} ${entity}`,
53
- Description: record.Description || `${activity} details of ${entity}`,
54
- EntityType: record?.EntityType || entity,
55
- EntityValueBefore:
56
- method === 'create'
57
- ? JSON.stringify({})
58
- : method === 'update'
59
- ? filteredRecordBefore
60
- : record.EntityValueBefore,
61
- EntityValueAfter: JSON.stringify(filteredRecord),
62
- PerformedById: record.PerformedById,
63
- PerformedAt: record.PerformedAt || Date.now(),
64
- EntityId: record.EntityId ? record.EntityId : cuid(),
65
- };
66
-
67
- try {
68
- const { data } = await axios.post(
69
- `${this.commonApiUrl}/activity-histories`,
70
- payload,
71
- );
72
- return data.EntityId;
73
- } catch (err) {
74
- this.handleAxiosError(err);
75
- }
76
- }
77
-
78
- async getList(listName: string): Promise<[]> {
79
- try {
80
- const { data } = await axios.get(`${this.commonApiUrl}/lists/items`, {
81
- params: { ListName: listName },
82
- });
83
- return data?.rows;
84
- } catch (err) {
85
- this.handleAxiosError(err);
86
- }
87
- }
88
-
89
- async addFieldTranslation(payload: AddFieldTranslationDto) {
90
- try {
91
- await axios.post(`${this.commonApiUrl}/field-translations`, payload);
92
- } catch (err) {
93
- this.handleAxiosError(err);
94
- }
95
- }
96
-
97
- async getMedia(query: GetMediaDto) {
98
- try {
99
- const { data } = await axios.get(`${this.commonApiUrl}/medias`, {
100
- params: query,
101
- });
102
- return data?.rows;
103
- } catch (err) {
104
- this.handleAxiosError(err);
105
- }
106
- }
107
- }
1
+ import {
2
+ HttpException,
3
+ Injectable,
4
+ InternalServerErrorException,
5
+ } from '@nestjs/common';
6
+ import { ConfigService } from '@nestjs/config';
7
+ import axios from 'axios';
8
+ import * as cuid from 'cuid';
9
+ import { omit, omitBy, keys, pick } from 'lodash';
10
+ import { AddFieldTranslationDto } from './dto/add-field-translation.dto';
11
+ import { GetMediaDto } from './dto/get-media.dto';
12
+ @Injectable()
13
+ export class CommonService {
14
+ private readonly commonApiUrl: string;
15
+
16
+ constructor(private configService: ConfigService) {
17
+ this.commonApiUrl = this.configService.get('COMMON_API_URL');
18
+ }
19
+
20
+ handleAxiosError(err) {
21
+ if (err.response) {
22
+ throw new HttpException(err.response.data, err.response.status);
23
+ } else if (err.request) {
24
+ throw new HttpException(err.request, 500);
25
+ } else {
26
+ throw new InternalServerErrorException(err.message);
27
+ }
28
+ }
29
+
30
+ async addActivityHistory(record, entity, method) {
31
+ const activity =
32
+ method === 'create'
33
+ ? 'Insert new'
34
+ : method === 'update'
35
+ ? 'Update'
36
+ : 'Delete';
37
+
38
+ const filteredRecord = omit(record.EntityValueAfter, [
39
+ 'CreatedById',
40
+ 'CreatedAt',
41
+ 'UpdatedById',
42
+ 'UpdatedAt',
43
+ ]);
44
+
45
+ const filteredRecordBefore = pick(
46
+ record.EntityValueBefore,
47
+ keys(filteredRecord),
48
+ );
49
+
50
+ const payload = {
51
+ Action: record.Action || (method === 'create' ? 'Insert' : activity),
52
+ Activity: record.Activity || `${activity} ${entity}`,
53
+ Description: record.Description || `${activity} details of ${entity}`,
54
+ EntityType: record?.EntityType || entity,
55
+ EntityValueBefore:
56
+ method === 'create'
57
+ ? JSON.stringify({})
58
+ : method === 'update'
59
+ ? filteredRecordBefore
60
+ : record.EntityValueBefore,
61
+ EntityValueAfter: JSON.stringify(filteredRecord),
62
+ PerformedById: record.PerformedById,
63
+ PerformedAt: record.PerformedAt || Date.now(),
64
+ EntityId: record.EntityId ? record.EntityId : cuid(),
65
+ };
66
+
67
+ try {
68
+ const { data } = await axios.post(
69
+ `${this.commonApiUrl}/activity-histories`,
70
+ payload,
71
+ );
72
+ return data.EntityId;
73
+ } catch (err) {
74
+ this.handleAxiosError(err);
75
+ }
76
+ }
77
+
78
+ async getList(listName: string): Promise<[]> {
79
+ try {
80
+ const { data } = await axios.get(`${this.commonApiUrl}/lists/items`, {
81
+ params: { ListName: listName },
82
+ });
83
+ return data?.rows;
84
+ } catch (err) {
85
+ this.handleAxiosError(err);
86
+ }
87
+ }
88
+
89
+ async addFieldTranslation(payload: AddFieldTranslationDto) {
90
+ try {
91
+ await axios.post(`${this.commonApiUrl}/field-translations`, payload);
92
+ } catch (err) {
93
+ this.handleAxiosError(err);
94
+ }
95
+ }
96
+
97
+ async getMedia(query: GetMediaDto) {
98
+ try {
99
+ const { data } = await axios.get(`${this.commonApiUrl}/medias`, {
100
+ params: query,
101
+ });
102
+ return data?.rows;
103
+ } catch (err) {
104
+ this.handleAxiosError(err);
105
+ }
106
+ }
107
+ }
@@ -1,23 +1,23 @@
1
- import { IsNotEmpty, IsString } from 'class-validator';
2
-
3
- export class AddFieldTranslationDto {
4
- @IsNotEmpty()
5
- @IsString()
6
- ObjectTable: string;
7
-
8
- @IsNotEmpty()
9
- @IsString()
10
- ObjectField: string;
11
-
12
- @IsNotEmpty()
13
- @IsString()
14
- ObjectId: string;
15
-
16
- @IsNotEmpty()
17
- @IsString()
18
- LanguageCode: string;
19
-
20
- @IsNotEmpty()
21
- @IsString()
22
- Translation: string;
23
- }
1
+ import { IsNotEmpty, IsString } from 'class-validator';
2
+
3
+ export class AddFieldTranslationDto {
4
+ @IsNotEmpty()
5
+ @IsString()
6
+ ObjectTable: string;
7
+
8
+ @IsNotEmpty()
9
+ @IsString()
10
+ ObjectField: string;
11
+
12
+ @IsNotEmpty()
13
+ @IsString()
14
+ ObjectId: string;
15
+
16
+ @IsNotEmpty()
17
+ @IsString()
18
+ LanguageCode: string;
19
+
20
+ @IsNotEmpty()
21
+ @IsString()
22
+ Translation: string;
23
+ }
@@ -1,12 +1,12 @@
1
- import { IsString } from 'class-validator';
2
-
3
- export class GetMediaDto {
4
- @IsString()
5
- ObjectID?: string;
6
-
7
- @IsString()
8
- ObjectType?: string;
9
-
10
- @IsString()
11
- Title?: string;
12
- }
1
+ import { IsString } from 'class-validator';
2
+
3
+ export class GetMediaDto {
4
+ @IsString()
5
+ ObjectID?: string;
6
+
7
+ @IsString()
8
+ ObjectType?: string;
9
+
10
+ @IsString()
11
+ Title?: string;
12
+ }
package/src/database.ts CHANGED
@@ -1,16 +1,16 @@
1
- import { Sequelize, SequelizeOptions } from 'sequelize-typescript';
2
- import { MediasModel } from './entities/medias.entity';
3
-
4
- const sequelize: any = {};
5
-
6
- function init(key: string, sequelizeOptions: SequelizeOptions) {
7
- const s = new Sequelize(sequelizeOptions);
8
- s.addModels([MediasModel]);
9
- sequelize[key] = s;
10
- }
11
-
12
- function getConnection(key: string) {
13
- return sequelize[key];
14
- }
15
-
16
- export { init, getConnection };
1
+ import { Sequelize, SequelizeOptions } from 'sequelize-typescript';
2
+ import { MediasModel } from './entities/medias.entity';
3
+
4
+ const sequelize: any = {};
5
+
6
+ function init(key: string, sequelizeOptions: SequelizeOptions) {
7
+ const s = new Sequelize(sequelizeOptions);
8
+ s.addModels([MediasModel]);
9
+ sequelize[key] = s;
10
+ }
11
+
12
+ function getConnection(key: string) {
13
+ return sequelize[key];
14
+ }
15
+
16
+ export { init, getConnection };
@@ -1,49 +1,49 @@
1
- import { ApiProperty } from '@nestjs/swagger';
2
- import { IsEnum, IsNotEmpty, IsString, MaxLength } from 'class-validator';
3
- import { MediaType } from '../enum/medias.enum';
4
-
5
- export class ExternalMediaDto {
6
- @IsNotEmpty()
7
- @IsString()
8
- @MaxLength(30)
9
- @ApiProperty({ type: String, description: 'ObjectID' })
10
- ObjectId: string;
11
-
12
- @IsNotEmpty()
13
- @IsString()
14
- @MaxLength(200)
15
- @ApiProperty({ type: String, description: 'ObjectType' })
16
- ObjectType: string;
17
-
18
- @IsNotEmpty()
19
- @ApiProperty({
20
- type: String,
21
- description: 'Enum either Photo, Video, Document',
22
- })
23
- @IsEnum(MediaType)
24
- Type: MediaType;
25
-
26
- @IsNotEmpty()
27
- @IsString()
28
- @MaxLength(200)
29
- @ApiProperty({ type: String, description: 'URL whre the file stored' })
30
- URL: string;
31
-
32
- @IsNotEmpty()
33
- @IsString()
34
- @MaxLength(200)
35
- @ApiProperty({ type: String, description: 'external source of the file' })
36
- ExternalSource: string;
37
-
38
- @IsNotEmpty()
39
- @IsString()
40
- @MaxLength(100)
41
- @ApiProperty({ type: String, description: 'title of the media' })
42
- Title: string;
43
-
44
- @IsNotEmpty()
45
- @IsString()
46
- @MaxLength(1000)
47
- @ApiProperty({ type: String, description: 'Description of the media' })
48
- Description: string;
49
- }
1
+ import { ApiProperty } from '@nestjs/swagger';
2
+ import { IsEnum, IsNotEmpty, IsString, MaxLength } from 'class-validator';
3
+ import { MediaType } from '../enum/medias.enum';
4
+
5
+ export class ExternalMediaDto {
6
+ @IsNotEmpty()
7
+ @IsString()
8
+ @MaxLength(30)
9
+ @ApiProperty({ type: String, description: 'ObjectID' })
10
+ ObjectId: string;
11
+
12
+ @IsNotEmpty()
13
+ @IsString()
14
+ @MaxLength(200)
15
+ @ApiProperty({ type: String, description: 'ObjectType' })
16
+ ObjectType: string;
17
+
18
+ @IsNotEmpty()
19
+ @ApiProperty({
20
+ type: String,
21
+ description: 'Enum either Photo, Video, Document',
22
+ })
23
+ @IsEnum(MediaType)
24
+ Type: MediaType;
25
+
26
+ @IsNotEmpty()
27
+ @IsString()
28
+ @MaxLength(200)
29
+ @ApiProperty({ type: String, description: 'URL whre the file stored' })
30
+ URL: string;
31
+
32
+ @IsNotEmpty()
33
+ @IsString()
34
+ @MaxLength(200)
35
+ @ApiProperty({ type: String, description: 'external source of the file' })
36
+ ExternalSource: string;
37
+
38
+ @IsNotEmpty()
39
+ @IsString()
40
+ @MaxLength(100)
41
+ @ApiProperty({ type: String, description: 'title of the media' })
42
+ Title: string;
43
+
44
+ @IsNotEmpty()
45
+ @IsString()
46
+ @MaxLength(1000)
47
+ @ApiProperty({ type: String, description: 'Description of the media' })
48
+ Description: string;
49
+ }
@@ -1,64 +1,64 @@
1
- import { ApiProperty } from '@nestjs/swagger';
2
- import { IsEnum, IsNotEmpty, IsString, MaxLength } from 'class-validator';
3
- import { MediaType } from '../enum/medias.enum';
4
-
5
- export class InternalMediaDto {
6
- @IsNotEmpty()
7
- @IsString()
8
- @MaxLength(30)
9
- @ApiProperty({ type: String, description: 'ObjectID' })
10
- ObjectId: string;
11
-
12
- @IsNotEmpty()
13
- @IsString()
14
- @MaxLength(200)
15
- @ApiProperty({ type: String, description: 'ObjectType' })
16
- ObjectType: string;
17
-
18
- @IsNotEmpty()
19
- @ApiProperty({
20
- type: String,
21
- description: 'Enum either Photo, Video, Document',
22
- })
23
- @IsEnum(MediaType)
24
- Type: MediaType;
25
-
26
- @IsNotEmpty()
27
- @IsString()
28
- @MaxLength(200)
29
- @ApiProperty({ type: String, description: 'file name without extension' })
30
- FileName: string;
31
-
32
- @IsNotEmpty()
33
- @IsString()
34
- @MaxLength(10)
35
- @ApiProperty({ type: String, description: 'extention of file in jpg etc' })
36
- FileExtension: string;
37
-
38
- @ApiProperty({
39
- type: String,
40
- description: 'File stream buffer',
41
- format: 'binary',
42
- })
43
- FileStream: any;
44
-
45
- @IsNotEmpty()
46
- @IsString()
47
- @MaxLength(100)
48
- @ApiProperty({ type: String, description: 'title of the media' })
49
- Title: string;
50
-
51
- @IsNotEmpty()
52
- @IsString()
53
- @MaxLength(1000)
54
- @ApiProperty({ type: String, description: 'Description of the media' })
55
- Description: string;
56
-
57
- @IsNotEmpty()
58
- @IsEnum(['N', 'Y'])
59
- @ApiProperty({
60
- type: String,
61
- description: 'Option if media needed to be encryped : Y or N',
62
- })
63
- IsEncryptedYN: string;
64
- }
1
+ import { ApiProperty } from '@nestjs/swagger';
2
+ import { IsEnum, IsNotEmpty, IsString, MaxLength } from 'class-validator';
3
+ import { MediaType } from '../enum/medias.enum';
4
+
5
+ export class InternalMediaDto {
6
+ @IsNotEmpty()
7
+ @IsString()
8
+ @MaxLength(30)
9
+ @ApiProperty({ type: String, description: 'ObjectID' })
10
+ ObjectId: string;
11
+
12
+ @IsNotEmpty()
13
+ @IsString()
14
+ @MaxLength(200)
15
+ @ApiProperty({ type: String, description: 'ObjectType' })
16
+ ObjectType: string;
17
+
18
+ @IsNotEmpty()
19
+ @ApiProperty({
20
+ type: String,
21
+ description: 'Enum either Photo, Video, Document',
22
+ })
23
+ @IsEnum(MediaType)
24
+ Type: MediaType;
25
+
26
+ @IsNotEmpty()
27
+ @IsString()
28
+ @MaxLength(200)
29
+ @ApiProperty({ type: String, description: 'file name without extension' })
30
+ FileName: string;
31
+
32
+ @IsNotEmpty()
33
+ @IsString()
34
+ @MaxLength(10)
35
+ @ApiProperty({ type: String, description: 'extention of file in jpg etc' })
36
+ FileExtension: string;
37
+
38
+ @ApiProperty({
39
+ type: String,
40
+ description: 'File stream buffer',
41
+ format: 'binary',
42
+ })
43
+ FileStream: any;
44
+
45
+ @IsNotEmpty()
46
+ @IsString()
47
+ @MaxLength(100)
48
+ @ApiProperty({ type: String, description: 'title of the media' })
49
+ Title: string;
50
+
51
+ @IsNotEmpty()
52
+ @IsString()
53
+ @MaxLength(1000)
54
+ @ApiProperty({ type: String, description: 'Description of the media' })
55
+ Description: string;
56
+
57
+ @IsNotEmpty()
58
+ @IsEnum(['N', 'Y'])
59
+ @ApiProperty({
60
+ type: String,
61
+ description: 'Option if media needed to be encryped : Y or N',
62
+ })
63
+ IsEncryptedYN: string;
64
+ }