@solidxai/core 0.1.12-beta.2 → 0.1.12-beta.3

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 (128) hide show
  1. package/.claude/settings.local.json +16 -0
  2. package/CLAUDE.md +26 -0
  3. package/dist/constants/media-file-types.d.ts +5 -0
  4. package/dist/constants/media-file-types.d.ts.map +1 -0
  5. package/dist/constants/media-file-types.js +27 -0
  6. package/dist/constants/media-file-types.js.map +1 -0
  7. package/dist/controllers/media.controller.d.ts +14 -11
  8. package/dist/controllers/media.controller.d.ts.map +1 -1
  9. package/dist/controllers/media.controller.js +72 -33
  10. package/dist/controllers/media.controller.js.map +1 -1
  11. package/dist/dtos/create-media.dto.d.ts +1 -0
  12. package/dist/dtos/create-media.dto.d.ts.map +1 -1
  13. package/dist/dtos/create-media.dto.js +7 -1
  14. package/dist/dtos/create-media.dto.js.map +1 -1
  15. package/dist/dtos/update-media.dto.d.ts +1 -0
  16. package/dist/dtos/update-media.dto.d.ts.map +1 -1
  17. package/dist/dtos/update-media.dto.js +7 -1
  18. package/dist/dtos/update-media.dto.js.map +1 -1
  19. package/dist/entities/media.entity.d.ts +1 -0
  20. package/dist/entities/media.entity.d.ts.map +1 -1
  21. package/dist/entities/media.entity.js +9 -1
  22. package/dist/entities/media.entity.js.map +1 -1
  23. package/dist/enums/auth-type.enum.d.ts +2 -1
  24. package/dist/enums/auth-type.enum.d.ts.map +1 -1
  25. package/dist/enums/auth-type.enum.js +1 -0
  26. package/dist/enums/auth-type.enum.js.map +1 -1
  27. package/dist/guards/authentication.guard.d.ts +3 -1
  28. package/dist/guards/authentication.guard.d.ts.map +1 -1
  29. package/dist/guards/authentication.guard.js +5 -1
  30. package/dist/guards/authentication.guard.js.map +1 -1
  31. package/dist/guards/media-signed-url.guard.d.ts +9 -0
  32. package/dist/guards/media-signed-url.guard.d.ts.map +1 -0
  33. package/dist/guards/media-signed-url.guard.js +49 -0
  34. package/dist/guards/media-signed-url.guard.js.map +1 -0
  35. package/dist/helpers/field-crud-managers/MediaFieldCrudManager.d.ts.map +1 -1
  36. package/dist/helpers/field-crud-managers/MediaFieldCrudManager.js +10 -13
  37. package/dist/helpers/field-crud-managers/MediaFieldCrudManager.js.map +1 -1
  38. package/dist/repository/media.repository.d.ts.map +1 -1
  39. package/dist/repository/media.repository.js +2 -0
  40. package/dist/repository/media.repository.js.map +1 -1
  41. package/dist/seeders/seed-data/solid-core-metadata.json +88 -3
  42. package/dist/services/media-download-url.service.d.ts +21 -0
  43. package/dist/services/media-download-url.service.d.ts.map +1 -0
  44. package/dist/services/media-download-url.service.js +67 -0
  45. package/dist/services/media-download-url.service.js.map +1 -0
  46. package/dist/services/media-storage.utils.d.ts +27 -0
  47. package/dist/services/media-storage.utils.d.ts.map +1 -0
  48. package/dist/services/media-storage.utils.js +82 -0
  49. package/dist/services/media-storage.utils.js.map +1 -0
  50. package/dist/services/media.service.d.ts +20 -4
  51. package/dist/services/media.service.d.ts.map +1 -1
  52. package/dist/services/media.service.js +157 -55
  53. package/dist/services/media.service.js.map +1 -1
  54. package/dist/services/mediaStorageProviders/file-s3-storage-provider.d.ts +4 -4
  55. package/dist/services/mediaStorageProviders/file-s3-storage-provider.d.ts.map +1 -1
  56. package/dist/services/mediaStorageProviders/file-s3-storage-provider.js +37 -63
  57. package/dist/services/mediaStorageProviders/file-s3-storage-provider.js.map +1 -1
  58. package/dist/services/mediaStorageProviders/file-storage-provider.d.ts +5 -5
  59. package/dist/services/mediaStorageProviders/file-storage-provider.d.ts.map +1 -1
  60. package/dist/services/mediaStorageProviders/file-storage-provider.js +37 -38
  61. package/dist/services/mediaStorageProviders/file-storage-provider.js.map +1 -1
  62. package/dist/solid-core.module.d.ts.map +1 -1
  63. package/dist/solid-core.module.js +11 -1
  64. package/dist/solid-core.module.js.map +1 -1
  65. package/dist/subscribers/audit.subscriber.js +1 -1
  66. package/dist/subscribers/audit.subscriber.js.map +1 -1
  67. package/package.json +1 -1
  68. package/src/constants/media-file-types.ts +44 -0
  69. package/src/controllers/media.controller.ts +44 -24
  70. package/src/dtos/create-media.dto.ts +8 -3
  71. package/src/dtos/update-media.dto.ts +8 -3
  72. package/src/entities/media.entity.ts +4 -1
  73. package/src/enums/auth-type.enum.ts +1 -0
  74. package/src/guards/authentication.guard.ts +3 -0
  75. package/src/guards/media-signed-url.guard.ts +41 -0
  76. package/src/helpers/field-crud-managers/MediaFieldCrudManager.ts +12 -24
  77. package/src/repository/media.repository.ts +2 -0
  78. package/src/seeders/seed-data/solid-core-metadata.json +88 -3
  79. package/src/services/1.js +6 -0
  80. package/src/services/media-download-url.service.ts +67 -0
  81. package/src/services/media-storage.utils.ts +79 -0
  82. package/src/services/media.service.ts +189 -59
  83. package/src/services/mediaStorageProviders/file-s3-storage-provider.ts +52 -76
  84. package/src/services/mediaStorageProviders/file-storage-provider.ts +44 -48
  85. package/src/solid-core.module.ts +21 -2
  86. package/src/subscribers/audit.subscriber.ts +1 -1
  87. package/dist-tests/api/authenticate.spec.js +0 -119
  88. package/dist-tests/api/authenticate.spec.js.map +0 -1
  89. package/dist-tests/api/crud-service.findOne.cityMaster.spec.js +0 -97
  90. package/dist-tests/api/crud-service.findOne.cityMaster.spec.js.map +0 -1
  91. package/dist-tests/api/ping.spec.js +0 -21
  92. package/dist-tests/api/ping.spec.js.map +0 -1
  93. package/dist-tests/helpers/auth.js +0 -41
  94. package/dist-tests/helpers/auth.js.map +0 -1
  95. package/dist-tests/helpers/env.js +0 -11
  96. package/dist-tests/helpers/env.js.map +0 -1
  97. package/docs/agent-builder/notebook-lm-prompt-for-agent-builder.md +0 -136
  98. package/docs/agent-builder/team-ready-note-agent-builder.md +0 -305
  99. package/docs/agent-hub-grooming.md +0 -301
  100. package/docs/dashboards/AGENTIC_DASHBOARD_IMPLEMENTATION_PLAN.md +0 -438
  101. package/docs/dashboards/dashboard-curl-smoke-tests.txt +0 -146
  102. package/docs/dashboards/delete-legacy-dashboard-metadata.sql +0 -172
  103. package/docs/datasource-introspection-ddl-analysis.md +0 -326
  104. package/docs/datasource-introspection-implementation-plan.md +0 -306
  105. package/docs/grouping-enhancements.md +0 -89
  106. package/docs/java-spring/README.md +0 -3
  107. package/docs/java-spring/solid-core-module-deep-dive-report.md +0 -1317
  108. package/docs/module-package-import-handoff.md +0 -691
  109. package/docs/seed-changes.md +0 -65
  110. package/docs/test-data-workflow.md +0 -200
  111. package/docs/type-declaration-import-issue.md +0 -24
  112. package/docs/workflow/business-automation-example-notes.md +0 -309
  113. package/docs/workflow/data-engineering-pipeline-example-notes.md +0 -330
  114. package/docs/workflow/foreach-example-notes.md +0 -187
  115. package/docs/workflow/hello-world-example-notes.md +0 -271
  116. package/docs/workflow/kestra-concepts-plugins-blueprints.md +0 -315
  117. package/docs/workflow/loop-until-example-notes.md +0 -198
  118. package/docs/workflow/microservices-and-apis-example-notes.md +0 -264
  119. package/docs/workflow/samples.md +0 -25
  120. package/docs/workflow/what-is-kestra.md +0 -79
  121. package/docs/workflow/workflow-core-module-handoff-summary.md +0 -191
  122. package/docs/workflow/workflow-module-brd.md +0 -185
  123. package/docs/workflow/workflow-module-domain-model.md +0 -252
  124. package/docs/workflow/workflow-module-metadata-dsl.md +0 -302
  125. package/docs/workflow/workflow-module-technical-spec.md +0 -293
  126. package/docs/workflow/workflow-node-type-contracts.md +0 -635
  127. package/docs/workflow/workflow-node-ui-metadata-contract.md +0 -1262
  128. package/docs/workflow/workflow-solidx-model-field-spec.md +0 -284
@@ -0,0 +1,16 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "Bash(node -e:*)",
5
+ "WebFetch(domain:docs.solidxai.com)",
6
+ "WebFetch(domain:github.com)",
7
+ "Read(//Users/oswald/projects/Solid_Starters/solidctl/**)",
8
+ "Read(//Users/oswald/projects/Solid_Starters/**)",
9
+ "Bash(find /Users/oswald/projects/Solid_Starters/solid-core-module -type d -name migration* -o -name *database*)",
10
+ "Bash(node verify-imports.js)"
11
+ ],
12
+ "additionalDirectories": [
13
+ "/Users/oswald/projects/Solid_Starters/solidctl"
14
+ ]
15
+ }
16
+ }
package/CLAUDE.md ADDED
@@ -0,0 +1,26 @@
1
+ # This is the SolidX API project.
2
+ This is included as a dependency in consuming projects.
3
+
4
+ # SolidX UI
5
+ # The corresponding UI project is at the below path:
6
+ /Users/oswald/projects/Solid_Starters/solid-core-ui
7
+
8
+ # SolidX Docs
9
+ # The documentation project is at the below path:
10
+ /Users/oswald/projects/solidxai-docs
11
+
12
+ # SolidX Agent
13
+ # The agent project which has the skills for helping users configure, build and use SolidX is at the below path:
14
+ /Users/oswald/projects/Solid_Starters/agent
15
+
16
+ # SolidX Control Plane Commands
17
+ # The control plane commands for managing SolidX instances are in the below path:
18
+ /Users/oswald/projects/Solid_Starters/solidctl
19
+
20
+ # Testing reference project
21
+ # This is the reference library management project that is used for testing and development of SolidX features. It is located at the below path:
22
+ /Users/oswald/projects/Solid_Starters/solid-library-management
23
+
24
+ # Code Builder project
25
+ # This is the project that contains the code builder which generates code based on user input and templates. It is located at the below path:
26
+ /Users/oswald/projects/Solid_Starters/solid-code-builder
@@ -0,0 +1,5 @@
1
+ export type MediaCategory = 'image' | 'audio' | 'video' | 'file' | 'pdf';
2
+ export declare const DANGEROUS_EXTENSIONS: Set<string>;
3
+ export declare const EXT_TO_MEDIA_TYPE: Record<string, MediaCategory>;
4
+ export declare const INLINE_SAFE_EXTENSIONS: Set<string>;
5
+ //# sourceMappingURL=media-file-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"media-file-types.d.ts","sourceRoot":"","sources":["../../src/constants/media-file-types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,GAAG,KAAK,CAAC;AAazE,eAAO,MAAM,oBAAoB,aAI/B,CAAC;AASH,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAM3D,CAAC;AAMF,eAAO,MAAM,sBAAsB,aAKjC,CAAC"}
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.INLINE_SAFE_EXTENSIONS = exports.EXT_TO_MEDIA_TYPE = exports.DANGEROUS_EXTENSIONS = void 0;
4
+ const IMAGE_EXTENSIONS = ['png', 'jpg', 'jpeg', 'webp', 'gif', 'bmp', 'tiff', 'heic', 'heif'];
5
+ const AUDIO_EXTENSIONS = ['mp3', 'wav', 'ogg', 'aac', 'm4a', 'flac', 'webm'];
6
+ const VIDEO_EXTENSIONS = ['mp4', 'mov', 'avi', 'mkv', 'mpeg', 'mpg', '3gp', '3g2', 'webm', 'ogg'];
7
+ const DOCUMENT_EXTENSIONS = ['txt', 'md', 'csv', 'json', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'zip', 'rar', '7z'];
8
+ const PDF_EXTENSION = 'pdf';
9
+ exports.DANGEROUS_EXTENSIONS = new Set([
10
+ 'html', 'htm', 'xhtml', 'svg', 'xml',
11
+ 'js', 'mjs', 'php', 'phtml', 'jsp', 'asp', 'aspx',
12
+ 'exe', 'sh', 'bat', 'cmd', 'ps1', 'jar', 'dll',
13
+ ]);
14
+ exports.EXT_TO_MEDIA_TYPE = {
15
+ ...Object.fromEntries(IMAGE_EXTENSIONS.map((ext) => [ext, 'image'])),
16
+ ...Object.fromEntries(AUDIO_EXTENSIONS.map((ext) => [ext, 'audio'])),
17
+ ...Object.fromEntries(VIDEO_EXTENSIONS.map((ext) => [ext, 'video'])),
18
+ ...Object.fromEntries(DOCUMENT_EXTENSIONS.map((ext) => [ext, 'file'])),
19
+ [PDF_EXTENSION]: 'pdf',
20
+ };
21
+ exports.INLINE_SAFE_EXTENSIONS = new Set([
22
+ ...IMAGE_EXTENSIONS,
23
+ ...AUDIO_EXTENSIONS,
24
+ ...VIDEO_EXTENSIONS,
25
+ PDF_EXTENSION,
26
+ ]);
27
+ //# sourceMappingURL=media-file-types.js.map
@@ -0,0 +1 @@
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,gBAAgB,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,OAAgB,CAAC,CAAC,CAAC;IAC7E,GAAG,MAAM,CAAC,WAAW,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,OAAgB,CAAC,CAAC,CAAC;IAC7E,GAAG,MAAM,CAAC,WAAW,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,MAAe,CAAC,CAAC,CAAC;IAC/E,CAAC,aAAa,CAAC,EAAE,KAAK;CACzB,CAAC;AAMW,QAAA,sBAAsB,GAAG,IAAI,GAAG,CAAS;IAClD,GAAG,gBAAgB;IACnB,GAAG,gBAAgB;IACnB,GAAG,gBAAgB;IACnB,aAAa;CAChB,CAAC,CAAC","sourcesContent":["export type MediaCategory = 'image' | 'audio' | 'video' | 'file' | 'pdf';\n\nconst IMAGE_EXTENSIONS = ['png', 'jpg', 'jpeg', 'webp', 'gif', 'bmp', 'tiff', 'heic', 'heif'];\nconst AUDIO_EXTENSIONS = ['mp3', 'wav', 'ogg', 'aac', 'm4a', 'flac', 'webm'];\nconst VIDEO_EXTENSIONS = ['mp4', 'mov', 'avi', 'mkv', 'mpeg', 'mpg', '3gp', '3g2', 'webm', 'ogg'];\nconst DOCUMENT_EXTENSIONS = ['txt', 'md', 'csv', 'json', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'zip', 'rar', '7z'];\nconst PDF_EXTENSION = 'pdf';\n\n/**\n * Extensions that must never be accepted as media uploads, regardless of declared mimetype or\n * admin-configured mediaTypes allowlist. Checked before any other resolution so a spoofed\n * Content-Type (e.g. application/octet-stream on an .html file) can't bypass this.\n */\nexport const DANGEROUS_EXTENSIONS = new Set([\n 'html', 'htm', 'xhtml', 'svg', 'xml',\n 'js', 'mjs', 'php', 'phtml', 'jsp', 'asp', 'aspx',\n 'exe', 'sh', 'bat', 'cmd', 'ps1', 'jar', 'dll',\n]);\n\n/**\n * Single source of truth for extension -> coarse media category. Shared by upload-time\n * validation (MediaFieldCrudManager) and serve-time header hardening (ServeStaticModule), so\n * both agree on which extensions belong to which category and neither drifts out of sync.\n * webm/ogg are shared between AUDIO_EXTENSIONS and VIDEO_EXTENSIONS - last one wins here, they\n * default to 'video' since that's the more common upload case.\n */\nexport const EXT_TO_MEDIA_TYPE: Record<string, MediaCategory> = {\n ...Object.fromEntries(IMAGE_EXTENSIONS.map((ext) => [ext, 'image' as const])),\n ...Object.fromEntries(AUDIO_EXTENSIONS.map((ext) => [ext, 'audio' as const])),\n ...Object.fromEntries(VIDEO_EXTENSIONS.map((ext) => [ext, 'video' as const])),\n ...Object.fromEntries(DOCUMENT_EXTENSIONS.map((ext) => [ext, 'file' as const])),\n [PDF_EXTENSION]: 'pdf',\n};\n\n/**\n * Extensions safe to serve inline with their natural Content-Type; everything else served from\n * media-files-storage is forced to application/octet-stream + Content-Disposition: attachment.\n */\nexport const INLINE_SAFE_EXTENSIONS = new Set<string>([\n ...IMAGE_EXTENSIONS,\n ...AUDIO_EXTENSIONS,\n ...VIDEO_EXTENSIONS,\n PDF_EXTENSION,\n]);\n"]}
@@ -1,25 +1,28 @@
1
1
  import { CreateMediaDto } from '../dtos/create-media.dto';
2
+ import { SolidRequestContextDto } from '../dtos/solid-request-context.dto';
2
3
  import { UpdateMediaDto } from '../dtos/update-media.dto';
3
4
  import { MediaService } from '../services/media.service';
5
+ import { Response } from 'express';
4
6
  export declare class MediaController {
5
7
  private readonly service;
6
8
  constructor(service: MediaService);
7
- create(createDto: CreateMediaDto, files: Array<Express.Multer.File>): Promise<import("..").Media>;
8
- insertMany(createDtos: CreateMediaDto[], filesArray?: Express.Multer.File[][]): Promise<import("..").Media[]>;
9
- update(id: number, updateDto: UpdateMediaDto, files: Array<Express.Multer.File>): Promise<import("..").Media>;
10
- partialUpdate(id: number, updateDto: UpdateMediaDto, files: Array<Express.Multer.File>): Promise<import("..").Media>;
11
- upload(files: Array<Express.Multer.File>, createDto: CreateMediaDto): Promise<any[]>;
12
- recoverMany(ids: number[]): Promise<{
9
+ create(createDto: CreateMediaDto, files: Array<Express.Multer.File>, solidRequestContext: SolidRequestContextDto): Promise<import("..").Media>;
10
+ insertMany(createDtos: CreateMediaDto[], filesArray: Express.Multer.File[][], solidRequestContext: SolidRequestContextDto): Promise<import("..").Media[]>;
11
+ update(id: number, updateDto: UpdateMediaDto, files: Array<Express.Multer.File>, solidRequestContext: SolidRequestContextDto): Promise<import("..").Media>;
12
+ partialUpdate(id: number, updateDto: UpdateMediaDto, files: Array<Express.Multer.File>, solidRequestContext: SolidRequestContextDto): Promise<import("..").Media>;
13
+ upload(files: Array<Express.Multer.File>, createDto: CreateMediaDto, solidRequestContext: SolidRequestContextDto): Promise<any[]>;
14
+ recoverMany(ids: number[], solidRequestContext: SolidRequestContextDto): Promise<{
13
15
  message: string;
14
16
  recoveredIds: number[];
15
17
  }>;
16
- recover(id: number): Promise<{
18
+ recover(id: number, solidRequestContext: SolidRequestContextDto): Promise<{
17
19
  message: string;
18
20
  data: import("..").Media;
19
21
  }>;
20
- findMany(query: any): Promise<any>;
21
- findOne(id: string, query: any): Promise<import("..").Media>;
22
- deleteMany(ids: number[]): Promise<any>;
23
- delete(id: number): Promise<import("..").Media>;
22
+ findMany(query: any, solidRequestContext: SolidRequestContextDto): Promise<any>;
23
+ download(id: string, disposition: string, res: Response, solidRequestContext: SolidRequestContextDto): Promise<void>;
24
+ findOne(id: string, query: any, solidRequestContext: SolidRequestContextDto): Promise<import("..").Media>;
25
+ deleteMany(ids: number[], solidRequestContext: SolidRequestContextDto): Promise<any>;
26
+ delete(id: number, solidRequestContext: SolidRequestContextDto): Promise<import("..").Media>;
24
27
  }
25
28
  //# sourceMappingURL=media.controller.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"media.controller.d.ts","sourceRoot":"","sources":["../../src/controllers/media.controller.ts"],"names":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,CAAc,EAAE,EAAE,MAAM,EAAwB,WAAW,EAAE,MAAM,EAAS,GAAG,EAAE,QAAQ,EAAkC,mBAAmB,EAAE,sBAAsB;IAc9K,OAAO,CAAc,EAAE,EAAE,MAAM,EAAW,KAAK,EAAE,GAAG,EAAkC,mBAAmB,EAAE,sBAAsB;IAMjI,UAAU,CAAS,GAAG,EAAE,MAAM,EAAE,EAAkC,mBAAmB,EAAE,sBAAsB;IAM7G,MAAM,CAAc,EAAE,EAAE,MAAM,EAAkC,mBAAmB,EAAE,sBAAsB;CAKlH"}
@@ -17,7 +17,11 @@ const openapi = require("@nestjs/swagger");
17
17
  const common_1 = require("@nestjs/common");
18
18
  const platform_express_1 = require("@nestjs/platform-express");
19
19
  const swagger_1 = require("@nestjs/swagger");
20
+ const auth_decorator_1 = require("../decorators/auth.decorator");
21
+ const auth_type_enum_1 = require("../enums/auth-type.enum");
20
22
  const create_media_dto_1 = require("../dtos/create-media.dto");
23
+ const solid_request_context_decorator_1 = require("../decorators/solid-request-context.decorator");
24
+ const solid_request_context_dto_1 = require("../dtos/solid-request-context.dto");
21
25
  const update_media_dto_1 = require("../dtos/update-media.dto");
22
26
  const media_service_1 = require("../services/media.service");
23
27
  var ShowSoftDeleted;
@@ -29,38 +33,48 @@ let MediaController = class MediaController {
29
33
  constructor(service) {
30
34
  this.service = service;
31
35
  }
32
- create(createDto, files) {
33
- return this.service.create(createDto, files);
36
+ create(createDto, files, solidRequestContext) {
37
+ return this.service.create(createDto, files, solidRequestContext);
34
38
  }
35
- insertMany(createDtos, filesArray = []) {
36
- return this.service.insertMany(createDtos, filesArray);
39
+ insertMany(createDtos, filesArray = [], solidRequestContext) {
40
+ return this.service.insertMany(createDtos, filesArray, solidRequestContext);
37
41
  }
38
- update(id, updateDto, files) {
39
- return this.service.update(id, updateDto, files);
42
+ update(id, updateDto, files, solidRequestContext) {
43
+ return this.service.update(id, updateDto, files, false, solidRequestContext);
40
44
  }
41
- partialUpdate(id, updateDto, files) {
42
- return this.service.update(id, updateDto, files, true);
45
+ partialUpdate(id, updateDto, files, solidRequestContext) {
46
+ return this.service.update(id, updateDto, files, true, solidRequestContext);
43
47
  }
44
- upload(files, createDto) {
45
- return this.service.upload(createDto, files);
48
+ upload(files, createDto, solidRequestContext) {
49
+ return this.service.upload(createDto, files, solidRequestContext);
46
50
  }
47
- async recoverMany(ids) {
48
- return this.service.recoverMany(ids);
51
+ async recoverMany(ids, solidRequestContext) {
52
+ return this.service.recoverMany(ids, solidRequestContext);
49
53
  }
50
- async recover(id) {
51
- return this.service.recover(id);
54
+ async recover(id, solidRequestContext) {
55
+ return this.service.recover(id, solidRequestContext);
52
56
  }
53
- async findMany(query) {
54
- return this.service.find(query);
57
+ async findMany(query, solidRequestContext) {
58
+ return this.service.find(query, solidRequestContext);
55
59
  }
56
- async findOne(id, query) {
57
- return this.service.findOne(+id, query);
60
+ async download(id, disposition, res, solidRequestContext) {
61
+ const media = await this.service.findOne(+id, {}, solidRequestContext);
62
+ const { stream, fileName, mimeType } = await this.service.fileDownloadStream(media);
63
+ const contentDisposition = disposition === 'attachment' ? 'attachment' : 'inline';
64
+ res.setHeader('Content-Disposition', `${contentDisposition}; filename="${fileName}"`);
65
+ res.setHeader('Content-Type', mimeType);
66
+ res.setHeader('Cross-Origin-Resource-Policy', 'cross-origin');
67
+ res.setHeader('Access-Control-Expose-Headers', 'Content-Disposition, Content-Type');
68
+ stream.pipe(res);
58
69
  }
59
- async deleteMany(ids) {
60
- return this.service.deleteMany(ids);
70
+ async findOne(id, query, solidRequestContext) {
71
+ return this.service.findOne(+id, query, solidRequestContext);
61
72
  }
62
- async delete(id) {
63
- return this.service.delete(id);
73
+ async deleteMany(ids, solidRequestContext) {
74
+ return this.service.deleteMany(ids, solidRequestContext);
75
+ }
76
+ async delete(id, solidRequestContext) {
77
+ return this.service.delete(id, solidRequestContext);
64
78
  }
65
79
  };
66
80
  exports.MediaController = MediaController;
@@ -71,8 +85,9 @@ __decorate([
71
85
  openapi.ApiResponse({ status: 201, type: require("../entities/media.entity").Media }),
72
86
  __param(0, (0, common_1.Body)()),
73
87
  __param(1, (0, common_1.UploadedFiles)()),
88
+ __param(2, (0, solid_request_context_decorator_1.SolidRequestContextDecorator)()),
74
89
  __metadata("design:type", Function),
75
- __metadata("design:paramtypes", [create_media_dto_1.CreateMediaDto, Array]),
90
+ __metadata("design:paramtypes", [create_media_dto_1.CreateMediaDto, Array, solid_request_context_dto_1.SolidRequestContextDto]),
76
91
  __metadata("design:returntype", void 0)
77
92
  ], MediaController.prototype, "create", null);
78
93
  __decorate([
@@ -82,8 +97,9 @@ __decorate([
82
97
  openapi.ApiResponse({ status: 201, type: [require("../entities/media.entity").Media] }),
83
98
  __param(0, (0, common_1.Body)()),
84
99
  __param(1, (0, common_1.UploadedFiles)()),
100
+ __param(2, (0, solid_request_context_decorator_1.SolidRequestContextDecorator)()),
85
101
  __metadata("design:type", Function),
86
- __metadata("design:paramtypes", [Array, Array]),
102
+ __metadata("design:paramtypes", [Array, Array, solid_request_context_dto_1.SolidRequestContextDto]),
87
103
  __metadata("design:returntype", void 0)
88
104
  ], MediaController.prototype, "insertMany", null);
89
105
  __decorate([
@@ -94,8 +110,9 @@ __decorate([
94
110
  __param(0, (0, common_1.Param)('id')),
95
111
  __param(1, (0, common_1.Body)()),
96
112
  __param(2, (0, common_1.UploadedFiles)()),
113
+ __param(3, (0, solid_request_context_decorator_1.SolidRequestContextDecorator)()),
97
114
  __metadata("design:type", Function),
98
- __metadata("design:paramtypes", [Number, update_media_dto_1.UpdateMediaDto, Array]),
115
+ __metadata("design:paramtypes", [Number, update_media_dto_1.UpdateMediaDto, Array, solid_request_context_dto_1.SolidRequestContextDto]),
99
116
  __metadata("design:returntype", void 0)
100
117
  ], MediaController.prototype, "update", null);
101
118
  __decorate([
@@ -106,8 +123,9 @@ __decorate([
106
123
  __param(0, (0, common_1.Param)('id')),
107
124
  __param(1, (0, common_1.Body)()),
108
125
  __param(2, (0, common_1.UploadedFiles)()),
126
+ __param(3, (0, solid_request_context_decorator_1.SolidRequestContextDecorator)()),
109
127
  __metadata("design:type", Function),
110
- __metadata("design:paramtypes", [Number, update_media_dto_1.UpdateMediaDto, Array]),
128
+ __metadata("design:paramtypes", [Number, update_media_dto_1.UpdateMediaDto, Array, solid_request_context_dto_1.SolidRequestContextDto]),
111
129
  __metadata("design:returntype", void 0)
112
130
  ], MediaController.prototype, "partialUpdate", null);
113
131
  __decorate([
@@ -117,8 +135,9 @@ __decorate([
117
135
  openapi.ApiResponse({ status: 201, type: [Object] }),
118
136
  __param(0, (0, common_1.UploadedFiles)()),
119
137
  __param(1, (0, common_1.Body)()),
138
+ __param(2, (0, solid_request_context_decorator_1.SolidRequestContextDecorator)()),
120
139
  __metadata("design:type", Function),
121
- __metadata("design:paramtypes", [Array, create_media_dto_1.CreateMediaDto]),
140
+ __metadata("design:paramtypes", [Array, create_media_dto_1.CreateMediaDto, solid_request_context_dto_1.SolidRequestContextDto]),
122
141
  __metadata("design:returntype", void 0)
123
142
  ], MediaController.prototype, "upload", null);
124
143
  __decorate([
@@ -126,8 +145,9 @@ __decorate([
126
145
  (0, common_1.Post)('/bulk-recover'),
127
146
  openapi.ApiResponse({ status: 201 }),
128
147
  __param(0, (0, common_1.Body)()),
148
+ __param(1, (0, solid_request_context_decorator_1.SolidRequestContextDecorator)()),
129
149
  __metadata("design:type", Function),
130
- __metadata("design:paramtypes", [Array]),
150
+ __metadata("design:paramtypes", [Array, solid_request_context_dto_1.SolidRequestContextDto]),
131
151
  __metadata("design:returntype", Promise)
132
152
  ], MediaController.prototype, "recoverMany", null);
133
153
  __decorate([
@@ -135,8 +155,9 @@ __decorate([
135
155
  (0, common_1.Get)('/recover/:id'),
136
156
  openapi.ApiResponse({ status: 200 }),
137
157
  __param(0, (0, common_1.Param)('id')),
158
+ __param(1, (0, solid_request_context_decorator_1.SolidRequestContextDecorator)()),
138
159
  __metadata("design:type", Function),
139
- __metadata("design:paramtypes", [Number]),
160
+ __metadata("design:paramtypes", [Number, solid_request_context_dto_1.SolidRequestContextDto]),
140
161
  __metadata("design:returntype", Promise)
141
162
  ], MediaController.prototype, "recover", null);
142
163
  __decorate([
@@ -153,18 +174,34 @@ __decorate([
153
174
  (0, common_1.Get)(),
154
175
  openapi.ApiResponse({ status: 200, type: Object }),
155
176
  __param(0, (0, common_1.Query)()),
177
+ __param(1, (0, solid_request_context_decorator_1.SolidRequestContextDecorator)()),
156
178
  __metadata("design:type", Function),
157
- __metadata("design:paramtypes", [Object]),
179
+ __metadata("design:paramtypes", [Object, solid_request_context_dto_1.SolidRequestContextDto]),
158
180
  __metadata("design:returntype", Promise)
159
181
  ], MediaController.prototype, "findMany", null);
182
+ __decorate([
183
+ (0, auth_decorator_1.Auth)(auth_type_enum_1.AuthType.MediaSignedUrl),
184
+ (0, swagger_1.ApiQuery)({ name: 'token', required: true, type: String, description: "Short-lived signed token obtained from a private Media record's URL - not entered manually." }),
185
+ (0, swagger_1.ApiQuery)({ name: 'disposition', required: false, enum: ['inline', 'attachment'], description: "'inline' (default) renders/previews in the browser, matching public media. Pass 'attachment' to force a browser download (e.g. from a download button)." }),
186
+ (0, common_1.Get)(':id/download'),
187
+ openapi.ApiResponse({ status: 200 }),
188
+ __param(0, (0, common_1.Param)('id')),
189
+ __param(1, (0, common_1.Query)('disposition')),
190
+ __param(2, (0, common_1.Res)()),
191
+ __param(3, (0, solid_request_context_decorator_1.SolidRequestContextDecorator)()),
192
+ __metadata("design:type", Function),
193
+ __metadata("design:paramtypes", [String, String, Object, solid_request_context_dto_1.SolidRequestContextDto]),
194
+ __metadata("design:returntype", Promise)
195
+ ], MediaController.prototype, "download", null);
160
196
  __decorate([
161
197
  (0, swagger_1.ApiBearerAuth)("jwt"),
162
198
  (0, common_1.Get)(':id'),
163
199
  openapi.ApiResponse({ status: 200, type: require("../entities/media.entity").Media }),
164
200
  __param(0, (0, common_1.Param)('id')),
165
201
  __param(1, (0, common_1.Query)()),
202
+ __param(2, (0, solid_request_context_decorator_1.SolidRequestContextDecorator)()),
166
203
  __metadata("design:type", Function),
167
- __metadata("design:paramtypes", [String, Object]),
204
+ __metadata("design:paramtypes", [String, Object, solid_request_context_dto_1.SolidRequestContextDto]),
168
205
  __metadata("design:returntype", Promise)
169
206
  ], MediaController.prototype, "findOne", null);
170
207
  __decorate([
@@ -172,8 +209,9 @@ __decorate([
172
209
  (0, common_1.Delete)('/bulk'),
173
210
  openapi.ApiResponse({ status: 200, type: Object }),
174
211
  __param(0, (0, common_1.Body)()),
212
+ __param(1, (0, solid_request_context_decorator_1.SolidRequestContextDecorator)()),
175
213
  __metadata("design:type", Function),
176
- __metadata("design:paramtypes", [Array]),
214
+ __metadata("design:paramtypes", [Array, solid_request_context_dto_1.SolidRequestContextDto]),
177
215
  __metadata("design:returntype", Promise)
178
216
  ], MediaController.prototype, "deleteMany", null);
179
217
  __decorate([
@@ -181,8 +219,9 @@ __decorate([
181
219
  (0, common_1.Delete)(':id'),
182
220
  openapi.ApiResponse({ status: 200, type: require("../entities/media.entity").Media }),
183
221
  __param(0, (0, common_1.Param)('id')),
222
+ __param(1, (0, solid_request_context_decorator_1.SolidRequestContextDecorator)()),
184
223
  __metadata("design:type", Function),
185
- __metadata("design:paramtypes", [Number]),
224
+ __metadata("design:paramtypes", [Number, solid_request_context_dto_1.SolidRequestContextDto]),
186
225
  __metadata("design:returntype", Promise)
187
226
  ], MediaController.prototype, "delete", null);
188
227
  exports.MediaController = MediaController = __decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"media.controller.js","sourceRoot":"","sources":["../../src/controllers/media.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAA+H;AAC/H,+DAA+D;AAC/D,6CAAmE;AAEnE,+DAA2D;AAC3D,+DAA2D;AAC3D,6DAA0D;AAE1D,IAAK,eAGJ;AAHD,WAAK,eAAe;IAClB,0CAAuB,CAAA;IACvB,0CAAuB,CAAA;AACzB,CAAC,EAHI,eAAe,KAAf,eAAe,QAGnB;AAMM,IAAM,e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';\nimport { AnyFilesInterceptor } from \"@nestjs/platform-express\";\nimport { ApiBearerAuth, ApiQuery, ApiTags } from '@nestjs/swagger';\nimport { Public } from 'src/decorators/public.decorator';\nimport { CreateMediaDto } from 'src/dtos/create-media.dto';\nimport { UpdateMediaDto } from 'src/dtos/update-media.dto';\nimport { MediaService } from 'src/services/media.service';\n\nenum ShowSoftDeleted {\n INCLUSIVE = \"inclusive\",\n EXCLUSIVE = \"exclusive\",\n}\n\n@ApiTags('Solid Core')\n@Controller('media')\n// @UseGuards(ThrottlerGuard)\n// @SkipThrottle({ short: true, login: true, burst: true, sustained: true }) //Skip all\nexport class MediaController {\n constructor(private readonly service: MediaService) {}\n\n @ApiBearerAuth(\"jwt\")\n @Post()\n @UseInterceptors(AnyFilesInterceptor())\n create(@Body() createDto: CreateMediaDto, @UploadedFiles() files: Array<Express.Multer.File>) {\n return this.service.create(createDto, files);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Post('/bulk')\n @UseInterceptors(AnyFilesInterceptor())\n insertMany(@Body() createDtos: CreateMediaDto[], @UploadedFiles() filesArray: Express.Multer.File[][] = []) {\n return this.service.insertMany(createDtos, filesArray);\n }\n\n\n @ApiBearerAuth(\"jwt\")\n @Put(':id')\n @UseInterceptors(AnyFilesInterceptor())\n update(@Param('id') id: number, @Body() updateDto: UpdateMediaDto, @UploadedFiles() files: Array<Express.Multer.File>) {\n return this.service.update(id, updateDto, files);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Patch(':id')\n @UseInterceptors(AnyFilesInterceptor())\n partialUpdate(@Param('id') id: number, @Body() updateDto: UpdateMediaDto, @UploadedFiles() files: Array<Express.Multer.File>) {\n return this.service.update(id, updateDto, files, true);\n }\n\n // @Public()\n // @SkipThrottle({ short: false, login: true, burst: true, sustained: true }) //Enable the short throttle only\n @ApiBearerAuth(\"jwt\")\n @Post('/upload')\n @UseInterceptors(AnyFilesInterceptor())\n upload(@UploadedFiles() files: Array<Express.Multer.File>, @Body() createDto: CreateMediaDto, ) {\n // this.logger.log(`Creating a new model: ${JSON.stringify(createDto)}`);\n return this.service.upload(createDto, files);\n }\n\n\n @ApiBearerAuth(\"jwt\")\n @Post('/bulk-recover')\n async recoverMany(@Body() ids: number[]) {\n return this.service.recoverMany(ids);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Get('/recover/:id')\n async recover(@Param('id') id: number) {\n return this.service.recover(id);\n }\n \n @ApiBearerAuth(\"jwt\")\n @ApiQuery({ name: 'showSoftDeleted', required: false, enum: ShowSoftDeleted })\n @ApiQuery({ name: 'limit', required: false, type: Number })\n @ApiQuery({ name: 'offset', required: false, type: Number })\n @ApiQuery({ name: 'fields', required: false, type: Array })\n @ApiQuery({ name: 'sort', required: false, type: Array }) \n @ApiQuery({ name: 'groupBy', required: false, type: Array })\n @ApiQuery({ name: 'populate', required: false, type: Array })\n @ApiQuery({ name: 'populateMedia', required: false, type: Array })\n @ApiQuery({ name: 'filters', required: false, type: Array })\n @Get()\n async findMany(@Query() query: any) { \n return this.service.find(query); \n }\n\n @ApiBearerAuth(\"jwt\")\n @Get(':id')\n async findOne(@Param('id') id: string, @Query() query: any) {\n return this.service.findOne(+id, query);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Delete('/bulk')\n async deleteMany(@Body() ids: number[]) {\n return this.service.deleteMany(ids);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Delete(':id')\n async delete(@Param('id') id: number) {\n return this.service.delete(id);\n }\n\n\n}\n"]}
1
+ {"version":3,"file":"media.controller.js","sourceRoot":"","sources":["../../src/controllers/media.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAoI;AACpI,+DAA+D;AAC/D,6CAAmE;AACnE,iEAAqD;AACrD,4DAAoD;AACpD,+DAA2D;AAC3D,mGAA8F;AAC9F,iFAA4E;AAC5E,+DAA2D;AAC3D,6DAA0D;AAG1D,IAAK,eAGJ;AAHD,WAAK,eAAe;IAClB,0CAAuB,CAAA;IACvB,0CAAuB,CAAA;A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AAK,EAAE,IAAI,EAAE,CAAC,QAAQ,EAAE,YAAY,CAAC,EAAE,WAAW,EAAE,yJAAyJ,EAAE,CAAC;IAC1P,IAAA,YAAG,EAAC,cAAc,CAAC;;IACJ,WAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;IAAc,WAAA,IAAA,cAAK,EAAC,aAAa,CAAC,CAAA;IAAuB,WAAA,IAAA,YAAG,GAAE,CAAA;IAAiB,WAAA,IAAA,8DAA4B,GAAE,CAAA;;6DAAsB,kDAAsB;;+CAUnL;AAIK;IAFL,IAAA,uBAAa,EAAC,KAAK,CAAC;IACpB,IAAA,YAAG,EAAC,KAAK,CAAC;;IACI,WAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;IAAc,WAAA,IAAA,cAAK,GAAE,CAAA;IAAc,WAAA,IAAA,8DAA4B,GAAE,CAAA;;qDAAsB,kDAAsB;;8CAEtI;AAIK;IAFL,IAAA,uBAAa,EAAC,KAAK,CAAC;IACpB,IAAA,eAAM,EAAC,OAAO,CAAC;;IACE,WAAA,IAAA,aAAI,GAAE,CAAA;IAAiB,WAAA,IAAA,8DAA4B,GAAE,CAAA;;4CAAsB,kDAAsB;;iDAElH;AAIK;IAFL,IAAA,uBAAa,EAAC,KAAK,CAAC;IACpB,IAAA,eAAM,EAAC,KAAK,CAAC;;IACA,WAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;IAAc,WAAA,IAAA,8DAA4B,GAAE,CAAA;;6CAAsB,kDAAsB;;6CAEhH;0BAtGU,eAAe;IAJ3B,IAAA,iBAAO,EAAC,YAAY,CAAC;IACrB,IAAA,mBAAU,EAAC,OAAO,CAAC;qCAIoB,4BAAY;GADvC,eAAe,CAyG3B","sourcesContent":["import { Body, Controller, Delete, Get, Param, Patch, Post, Put, Query, Res, UploadedFiles, UseInterceptors } from '@nestjs/common';\nimport { AnyFilesInterceptor } from \"@nestjs/platform-express\";\nimport { ApiBearerAuth, ApiQuery, ApiTags } from '@nestjs/swagger';\nimport { Auth } from 'src/decorators/auth.decorator';\nimport { AuthType } from 'src/enums/auth-type.enum';\nimport { CreateMediaDto } from 'src/dtos/create-media.dto';\nimport { SolidRequestContextDecorator } from 'src/decorators/solid-request-context.decorator';\nimport { SolidRequestContextDto } from 'src/dtos/solid-request-context.dto';\nimport { UpdateMediaDto } from 'src/dtos/update-media.dto';\nimport { MediaService } from 'src/services/media.service';\nimport { Response } from 'express';\n\nenum ShowSoftDeleted {\n INCLUSIVE = \"inclusive\",\n EXCLUSIVE = \"exclusive\",\n}\n\n@ApiTags('Solid Core')\n@Controller('media')\n// @UseGuards(ThrottlerGuard)\n// @SkipThrottle({ short: true, login: true, burst: true, sustained: true }) //Skip all\nexport class MediaController {\n constructor(private readonly service: MediaService) {}\n\n @ApiBearerAuth(\"jwt\")\n @Post()\n @UseInterceptors(AnyFilesInterceptor())\n create(@Body() createDto: CreateMediaDto, @UploadedFiles() files: Array<Express.Multer.File>, @SolidRequestContextDecorator() solidRequestContext: SolidRequestContextDto) {\n return this.service.create(createDto, files, solidRequestContext);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Post('/bulk')\n @UseInterceptors(AnyFilesInterceptor())\n insertMany(@Body() createDtos: CreateMediaDto[], @UploadedFiles() filesArray: Express.Multer.File[][] = [], @SolidRequestContextDecorator() solidRequestContext: SolidRequestContextDto) {\n return this.service.insertMany(createDtos, filesArray, solidRequestContext);\n }\n\n\n @ApiBearerAuth(\"jwt\")\n @Put(':id')\n @UseInterceptors(AnyFilesInterceptor())\n update(@Param('id') id: number, @Body() updateDto: UpdateMediaDto, @UploadedFiles() files: Array<Express.Multer.File>, @SolidRequestContextDecorator() solidRequestContext: SolidRequestContextDto) {\n return this.service.update(id, updateDto, files, false, solidRequestContext);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Patch(':id')\n @UseInterceptors(AnyFilesInterceptor())\n partialUpdate(@Param('id') id: number, @Body() updateDto: UpdateMediaDto, @UploadedFiles() files: Array<Express.Multer.File>, @SolidRequestContextDecorator() solidRequestContext: SolidRequestContextDto) {\n return this.service.update(id, updateDto, files, true, solidRequestContext);\n }\n\n // @Public()\n // @SkipThrottle({ short: false, login: true, burst: true, sustained: true }) //Enable the short throttle only\n @ApiBearerAuth(\"jwt\")\n @Post('/upload')\n @UseInterceptors(AnyFilesInterceptor())\n upload(@UploadedFiles() files: Array<Express.Multer.File>, @Body() createDto: CreateMediaDto, @SolidRequestContextDecorator() solidRequestContext: SolidRequestContextDto) {\n // this.logger.log(`Creating a new model: ${JSON.stringify(createDto)}`);\n return this.service.upload(createDto, files, solidRequestContext);\n }\n\n\n @ApiBearerAuth(\"jwt\")\n @Post('/bulk-recover')\n async recoverMany(@Body() ids: number[], @SolidRequestContextDecorator() solidRequestContext: SolidRequestContextDto) {\n return this.service.recoverMany(ids, solidRequestContext);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Get('/recover/:id')\n async recover(@Param('id') id: number, @SolidRequestContextDecorator() solidRequestContext: SolidRequestContextDto) {\n return this.service.recover(id, solidRequestContext);\n }\n \n @ApiBearerAuth(\"jwt\")\n @ApiQuery({ name: 'showSoftDeleted', required: false, enum: ShowSoftDeleted })\n @ApiQuery({ name: 'limit', required: false, type: Number })\n @ApiQuery({ name: 'offset', required: false, type: Number })\n @ApiQuery({ name: 'fields', required: false, type: Array })\n @ApiQuery({ name: 'sort', required: false, type: Array }) \n @ApiQuery({ name: 'groupBy', required: false, type: Array })\n @ApiQuery({ name: 'populate', required: false, type: Array })\n @ApiQuery({ name: 'populateMedia', required: false, type: Array })\n @ApiQuery({ name: 'filters', required: false, type: Array })\n @Get()\n async findMany(@Query() query: any, @SolidRequestContextDecorator() solidRequestContext: SolidRequestContextDto) {\n return this.service.find(query, solidRequestContext);\n }\n\n @Auth(AuthType.MediaSignedUrl)\n @ApiQuery({ name: 'token', required: true, type: String, description: \"Short-lived signed token obtained from a private Media record's URL - not entered manually.\" })\n @ApiQuery({ name: 'disposition', required: false, enum: ['inline', 'attachment'], description: \"'inline' (default) renders/previews in the browser, matching public media. Pass 'attachment' to force a browser download (e.g. from a download button).\" })\n @Get(':id/download')\n async download(@Param('id') id: string, @Query('disposition') disposition: string, @Res() res: Response, @SolidRequestContextDecorator() solidRequestContext: SolidRequestContextDto) {\n const media = await this.service.findOne(+id, {}, solidRequestContext);\n const { stream, fileName, mimeType } = await this.service.fileDownloadStream(media);\n\n const contentDisposition = disposition === 'attachment' ? 'attachment' : 'inline';\n res.setHeader('Content-Disposition', `${contentDisposition}; filename=\"${fileName}\"`);\n res.setHeader('Content-Type', mimeType);\n res.setHeader('Cross-Origin-Resource-Policy', 'cross-origin');\n res.setHeader('Access-Control-Expose-Headers', 'Content-Disposition, Content-Type');\n stream.pipe(res);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Get(':id')\n async findOne(@Param('id') id: string, @Query() query: any, @SolidRequestContextDecorator() solidRequestContext: SolidRequestContextDto) {\n return this.service.findOne(+id, query, solidRequestContext);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Delete('/bulk')\n async deleteMany(@Body() ids: number[], @SolidRequestContextDecorator() solidRequestContext: SolidRequestContextDto) {\n return this.service.deleteMany(ids, solidRequestContext);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Delete(':id')\n async delete(@Param('id') id: number, @SolidRequestContextDecorator() solidRequestContext: SolidRequestContextDto) {\n return this.service.delete(id, solidRequestContext);\n }\n\n\n}\n"]}
@@ -1,5 +1,6 @@
1
1
  export declare class CreateMediaDto {
2
2
  entityId: number;
3
+ isPublic?: boolean;
3
4
  relativeUri: string;
4
5
  fileSize: number;
5
6
  mimeType: string;
@@ -1 +1 @@
1
- {"version":3,"file":"create-media.dto.d.ts","sourceRoot":"","sources":["../../src/dtos/create-media.dto.ts"],"names":[],"mappings":"AAGA,qBAAa,cAAc;IAI3B,QAAQ,EAAE,MAAM,CAAC;IAKjB,WAAW,EAAE,MAAM,CAAC;IAKpB,QAAQ,EAAE,MAAM,CAAC;IAKjB,QAAQ,EAAE,MAAM,CAAC;IAKjB,gBAAgB,EAAE,MAAM,CAAC;IAKzB,eAAe,EAAE,MAAM,CAAC;IAKxB,oBAAoB,EAAE,MAAM,CAAC;IAK7B,8BAA8B,EAAE,MAAM,CAAC;IAKvC,mCAAmC,EAAE,MAAM,CAAC;IAK5C,eAAe,EAAE,MAAM,CAAC;IAKxB,oBAAoB,EAAE,MAAM,CAAC;CAC5B"}
1
+ {"version":3,"file":"create-media.dto.d.ts","sourceRoot":"","sources":["../../src/dtos/create-media.dto.ts"],"names":[],"mappings":"AAGA,qBAAa,cAAc;IAI3B,QAAQ,EAAE,MAAM,CAAC;IAKjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IAKnB,WAAW,EAAE,MAAM,CAAC;IAKpB,QAAQ,EAAE,MAAM,CAAC;IAKjB,QAAQ,EAAE,MAAM,CAAC;IAKjB,gBAAgB,EAAE,MAAM,CAAC;IAKzB,eAAe,EAAE,MAAM,CAAC;IAKxB,oBAAoB,EAAE,MAAM,CAAC;IAK7B,8BAA8B,EAAE,MAAM,CAAC;IAKvC,mCAAmC,EAAE,MAAM,CAAC;IAK5C,eAAe,EAAE,MAAM,CAAC;IAKxB,oBAAoB,EAAE,MAAM,CAAC;CAC5B"}
@@ -16,7 +16,7 @@ const class_validator_1 = require("class-validator");
16
16
  const class_validator_2 = require("class-validator");
17
17
  class CreateMediaDto {
18
18
  static _OPENAPI_METADATA_FACTORY() {
19
- return { entityId: { required: true, type: () => Number }, relativeUri: { required: true, type: () => String }, fileSize: { required: true, type: () => Number }, mimeType: { required: true, type: () => String }, originalFileName: { required: true, type: () => String }, modelMetadataId: { required: true, type: () => Number }, modelMetadataUserKey: { required: true, type: () => String }, mediaStorageProviderMetadataId: { required: true, type: () => Number }, mediaStorageProviderMetadataUserKey: { required: true, type: () => String }, fieldMetadataId: { required: true, type: () => Number }, fieldMetadataUserKey: { required: true, type: () => String } };
19
+ return { entityId: { required: true, type: () => Number }, isPublic: { required: false, type: () => Boolean }, relativeUri: { required: true, type: () => String }, fileSize: { required: true, type: () => Number }, mimeType: { required: true, type: () => String }, originalFileName: { required: true, type: () => String }, modelMetadataId: { required: true, type: () => Number }, modelMetadataUserKey: { required: true, type: () => String }, mediaStorageProviderMetadataId: { required: true, type: () => Number }, mediaStorageProviderMetadataUserKey: { required: true, type: () => String }, fieldMetadataId: { required: true, type: () => Number }, fieldMetadataUserKey: { required: true, type: () => String } };
20
20
  }
21
21
  }
22
22
  exports.CreateMediaDto = CreateMediaDto;
@@ -26,6 +26,12 @@ __decorate([
26
26
  (0, swagger_1.ApiProperty)(),
27
27
  __metadata("design:type", Number)
28
28
  ], CreateMediaDto.prototype, "entityId", void 0);
29
+ __decorate([
30
+ (0, class_validator_2.IsOptional)(),
31
+ (0, class_validator_1.IsBoolean)(),
32
+ (0, swagger_1.ApiPropertyOptional)({ default: true }),
33
+ __metadata("design:type", Boolean)
34
+ ], CreateMediaDto.prototype, "isPublic", void 0);
29
35
  __decorate([
30
36
  (0, class_validator_2.IsOptional)(),
31
37
  (0, class_validator_2.IsString)(),
@@ -1 +1 @@
1
- {"version":3,"file":"create-media.dto.js","sourceRoot":"","sources":["../../src/dtos/create-media.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,6CAA8C;AAC9C,qDAAwC;AACxC,qDAAmE;AACnE,MAAa,cAAc;;;;CAuD1B;AAvDD,wCAuDC;AAnDD;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,uBAAK,GAAE;IACP,IAAA,qBAAW,GAAE;;gDACG;AAKjB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAW,GAAE;;mDACM;AAKpB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,uBAAK,GAAE;IACP,IAAA,qBAAW,GAAE;;gDACG;AAKjB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAW,GAAE;;gDACG;AAKjB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAW,GAAE;;wDACW;AAKzB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,uBAAK,GAAE;IACP,IAAA,qBAAW,GAAE;;uDACU;AAKxB;IAHC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;IACZ,IAAA,qBAAW,GAAE;;4DACe;AAK7B;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,uBAAK,GAAE;IACP,IAAA,qBAAW,GAAE;;sEACyB;AAKvC;IAHC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;IACZ,IAAA,qBAAW,GAAE;;2EAC8B;AAK5C;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,uBAAK,GAAE;IACP,IAAA,qBAAW,GAAE;;uDACU;AAKxB;IAHC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;IACZ,IAAA,qBAAW,GAAE;;4DACe","sourcesContent":["import { ApiProperty } from '@nestjs/swagger';\nimport { IsInt } from 'class-validator';\nimport { IsNotEmpty, IsString, IsOptional } from 'class-validator';\nexport class CreateMediaDto {\n@IsNotEmpty()\n@IsInt()\n@ApiProperty()\nentityId: number;\n\n@IsOptional()\n@IsString()\n@ApiProperty()\nrelativeUri: string;\n\n@IsOptional()\n@IsInt()\n@ApiProperty()\nfileSize: number;\n\n@IsOptional()\n@IsString()\n@ApiProperty()\nmimeType: string;\n\n@IsOptional()\n@IsString()\n@ApiProperty()\noriginalFileName: string;\n\n@IsOptional()\n@IsInt()\n@ApiProperty()\nmodelMetadataId: number;\n\n@IsString()\n@IsOptional()\n@ApiProperty()\nmodelMetadataUserKey: string;\n\n@IsOptional()\n@IsInt()\n@ApiProperty()\nmediaStorageProviderMetadataId: number;\n\n@IsString()\n@IsOptional()\n@ApiProperty()\nmediaStorageProviderMetadataUserKey: string;\n\n@IsOptional()\n@IsInt()\n@ApiProperty()\nfieldMetadataId: number;\n\n@IsString()\n@IsOptional()\n@ApiProperty()\nfieldMetadataUserKey: string;\n}"]}
1
+ {"version":3,"file":"create-media.dto.js","sourceRoot":"","sources":["../../src/dtos/create-media.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,6CAAmE;AACnE,qDAAmD;AACnD,qDAAmE;AACnE,MAAa,cAAc;;;;CA4D1B;AA5DD,wCA4DC;AAxDD;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,uBAAK,GAAE;IACP,IAAA,qBAAW,GAAE;;gDACG;AAKjB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,2BAAS,GAAE;IACX,IAAA,6BAAmB,EAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;gDACpB;AAKnB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAW,GAAE;;mDACM;AAKpB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,uBAAK,GAAE;IACP,IAAA,qBAAW,GAAE;;gDACG;AAKjB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAW,GAAE;;gDACG;AAKjB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAW,GAAE;;wDACW;AAKzB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,uBAAK,GAAE;IACP,IAAA,qBAAW,GAAE;;uDACU;AAKxB;IAHC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;IACZ,IAAA,qBAAW,GAAE;;4DACe;AAK7B;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,uBAAK,GAAE;IACP,IAAA,qBAAW,GAAE;;sEACyB;AAKvC;IAHC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;IACZ,IAAA,qBAAW,GAAE;;2EAC8B;AAK5C;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,uBAAK,GAAE;IACP,IAAA,qBAAW,GAAE;;uDACU;AAKxB;IAHC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;IACZ,IAAA,qBAAW,GAAE;;4DACe","sourcesContent":["import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';\nimport { IsBoolean, IsInt } from 'class-validator';\nimport { IsNotEmpty, IsString, IsOptional } from 'class-validator';\nexport class CreateMediaDto {\n@IsNotEmpty()\n@IsInt()\n@ApiProperty()\nentityId: number;\n\n@IsOptional()\n@IsBoolean()\n@ApiPropertyOptional({ default: true })\nisPublic?: boolean;\n\n@IsOptional()\n@IsString()\n@ApiProperty()\nrelativeUri: string;\n\n@IsOptional()\n@IsInt()\n@ApiProperty()\nfileSize: number;\n\n@IsOptional()\n@IsString()\n@ApiProperty()\nmimeType: string;\n\n@IsOptional()\n@IsString()\n@ApiProperty()\noriginalFileName: string;\n\n@IsOptional()\n@IsInt()\n@ApiProperty()\nmodelMetadataId: number;\n\n@IsString()\n@IsOptional()\n@ApiProperty()\nmodelMetadataUserKey: string;\n\n@IsOptional()\n@IsInt()\n@ApiProperty()\nmediaStorageProviderMetadataId: number;\n\n@IsString()\n@IsOptional()\n@ApiProperty()\nmediaStorageProviderMetadataUserKey: string;\n\n@IsOptional()\n@IsInt()\n@ApiProperty()\nfieldMetadataId: number;\n\n@IsString()\n@IsOptional()\n@ApiProperty()\nfieldMetadataUserKey: string;\n}\n"]}
@@ -1,6 +1,7 @@
1
1
  export declare class UpdateMediaDto {
2
2
  id: number;
3
3
  entityId: number;
4
+ isPublic?: boolean;
4
5
  relativeUri: string;
5
6
  fileSize: number;
6
7
  mimeType: string;
@@ -1 +1 @@
1
- {"version":3,"file":"update-media.dto.d.ts","sourceRoot":"","sources":["../../src/dtos/update-media.dto.ts"],"names":[],"mappings":"AAEA,qBAAa,cAAc;IAGvB,EAAE,EAAE,MAAM,CAAC;IAMf,QAAQ,EAAE,MAAM,CAAC;IAKjB,WAAW,EAAE,MAAM,CAAC;IAKpB,QAAQ,EAAE,MAAM,CAAC;IAKjB,QAAQ,EAAE,MAAM,CAAC;IAKjB,gBAAgB,EAAE,MAAM,CAAC;IAKzB,eAAe,EAAE,MAAM,CAAC;IAKxB,oBAAoB,EAAE,MAAM,CAAC;IAK7B,8BAA8B,EAAE,MAAM,CAAC;IAKvC,mCAAmC,EAAE,MAAM,CAAC;IAK5C,eAAe,EAAE,MAAM,CAAC;IAKxB,oBAAoB,EAAE,MAAM,CAAC;CAC5B"}
1
+ {"version":3,"file":"update-media.dto.d.ts","sourceRoot":"","sources":["../../src/dtos/update-media.dto.ts"],"names":[],"mappings":"AAEA,qBAAa,cAAc;IAGvB,EAAE,EAAE,MAAM,CAAC;IAMf,QAAQ,EAAE,MAAM,CAAC;IAKjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IAKnB,WAAW,EAAE,MAAM,CAAC;IAKpB,QAAQ,EAAE,MAAM,CAAC;IAKjB,QAAQ,EAAE,MAAM,CAAC;IAKjB,gBAAgB,EAAE,MAAM,CAAC;IAKzB,eAAe,EAAE,MAAM,CAAC;IAKxB,oBAAoB,EAAE,MAAM,CAAC;IAK7B,8BAA8B,EAAE,MAAM,CAAC;IAKvC,mCAAmC,EAAE,MAAM,CAAC;IAK5C,eAAe,EAAE,MAAM,CAAC;IAKxB,oBAAoB,EAAE,MAAM,CAAC;CAC5B"}
@@ -15,7 +15,7 @@ const class_validator_1 = require("class-validator");
15
15
  const swagger_1 = require("@nestjs/swagger");
16
16
  class UpdateMediaDto {
17
17
  static _OPENAPI_METADATA_FACTORY() {
18
- return { id: { required: true, type: () => Number }, entityId: { required: true, type: () => Number }, relativeUri: { required: true, type: () => String }, fileSize: { required: true, type: () => Number }, mimeType: { required: true, type: () => String }, originalFileName: { required: true, type: () => String }, modelMetadataId: { required: true, type: () => Number }, modelMetadataUserKey: { required: true, type: () => String }, mediaStorageProviderMetadataId: { required: true, type: () => Number }, mediaStorageProviderMetadataUserKey: { required: true, type: () => String }, fieldMetadataId: { required: true, type: () => Number }, fieldMetadataUserKey: { required: true, type: () => String } };
18
+ return { id: { required: true, type: () => Number }, entityId: { required: true, type: () => Number }, isPublic: { required: false, type: () => Boolean }, relativeUri: { required: true, type: () => String }, fileSize: { required: true, type: () => Number }, mimeType: { required: true, type: () => String }, originalFileName: { required: true, type: () => String }, modelMetadataId: { required: true, type: () => Number }, modelMetadataUserKey: { required: true, type: () => String }, mediaStorageProviderMetadataId: { required: true, type: () => Number }, mediaStorageProviderMetadataUserKey: { required: true, type: () => String }, fieldMetadataId: { required: true, type: () => Number }, fieldMetadataUserKey: { required: true, type: () => String } };
19
19
  }
20
20
  }
21
21
  exports.UpdateMediaDto = UpdateMediaDto;
@@ -31,6 +31,12 @@ __decorate([
31
31
  (0, swagger_1.ApiProperty)(),
32
32
  __metadata("design:type", Number)
33
33
  ], UpdateMediaDto.prototype, "entityId", void 0);
34
+ __decorate([
35
+ (0, class_validator_1.IsOptional)(),
36
+ (0, class_validator_1.IsBoolean)(),
37
+ (0, swagger_1.ApiPropertyOptional)({ default: true }),
38
+ __metadata("design:type", Boolean)
39
+ ], UpdateMediaDto.prototype, "isPublic", void 0);
34
40
  __decorate([
35
41
  (0, class_validator_1.IsOptional)(),
36
42
  (0, class_validator_1.IsString)(),
@@ -1 +1 @@
1
- {"version":3,"file":"update-media.dto.js","sourceRoot":"","sources":["../../src/dtos/update-media.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,qDAAyE;AACzE,6CAA8C;AAC9C,MAAa,cAAc;;;;CA4D1B;AA5DD,wCA4DC;AAzDG;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,uBAAK,GAAE;;0CACG;AAMf;IAJC,IAAA,4BAAU,GAAE;IACZ,IAAA,4BAAU,GAAE;IACZ,IAAA,uBAAK,GAAE;IACP,IAAA,qBAAW,GAAE;;gDACG;AAKjB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAW,GAAE;;mDACM;AAKpB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,uBAAK,GAAE;IACP,IAAA,qBAAW,GAAE;;gDACG;AAKjB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAW,GAAE;;gDACG;AAKjB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAW,GAAE;;wDACW;AAKzB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,uBAAK,GAAE;IACP,IAAA,qBAAW,GAAE;;uDACU;AAKxB;IAHC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;IACZ,IAAA,qBAAW,GAAE;;4DACe;AAK7B;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,uBAAK,GAAE;IACP,IAAA,qBAAW,GAAE;;sEACyB;AAKvC;IAHC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;IACZ,IAAA,qBAAW,GAAE;;2EAC8B;AAK5C;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,uBAAK,GAAE;IACP,IAAA,qBAAW,GAAE;;uDACU;AAKxB;IAHC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;IACZ,IAAA,qBAAW,GAAE;;4DACe","sourcesContent":["import { IsInt,IsOptional, IsNotEmpty, IsString } from 'class-validator';\nimport { ApiProperty } from '@nestjs/swagger';\nexport class UpdateMediaDto {\n @IsOptional()\n @IsInt()\n id: number;\n\n@IsNotEmpty()\n@IsOptional()\n@IsInt()\n@ApiProperty()\nentityId: number;\n\n@IsOptional()\n@IsString()\n@ApiProperty()\nrelativeUri: string;\n\n@IsOptional()\n@IsInt()\n@ApiProperty()\nfileSize: number;\n\n@IsOptional()\n@IsString()\n@ApiProperty()\nmimeType: string;\n\n@IsOptional()\n@IsString()\n@ApiProperty()\noriginalFileName: string;\n\n@IsOptional()\n@IsInt()\n@ApiProperty()\nmodelMetadataId: number;\n\n@IsString()\n@IsOptional()\n@ApiProperty()\nmodelMetadataUserKey: string;\n\n@IsOptional()\n@IsInt()\n@ApiProperty()\nmediaStorageProviderMetadataId: number;\n\n@IsString()\n@IsOptional()\n@ApiProperty()\nmediaStorageProviderMetadataUserKey: string;\n\n@IsOptional()\n@IsInt()\n@ApiProperty()\nfieldMetadataId: number;\n\n@IsString()\n@IsOptional()\n@ApiProperty()\nfieldMetadataUserKey: string;\n}"]}
1
+ {"version":3,"file":"update-media.dto.js","sourceRoot":"","sources":["../../src/dtos/update-media.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,qDAAoF;AACpF,6CAAmE;AACnE,MAAa,cAAc;;;;CAiE1B;AAjED,wCAiEC;AA9DG;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,uBAAK,GAAE;;0CACG;AAMf;IAJC,IAAA,4BAAU,GAAE;IACZ,IAAA,4BAAU,GAAE;IACZ,IAAA,uBAAK,GAAE;IACP,IAAA,qBAAW,GAAE;;gDACG;AAKjB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,2BAAS,GAAE;IACX,IAAA,6BAAmB,EAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;gDACpB;AAKnB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAW,GAAE;;mDACM;AAKpB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,uBAAK,GAAE;IACP,IAAA,qBAAW,GAAE;;gDACG;AAKjB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAW,GAAE;;gDACG;AAKjB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAW,GAAE;;wDACW;AAKzB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,uBAAK,GAAE;IACP,IAAA,qBAAW,GAAE;;uDACU;AAKxB;IAHC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;IACZ,IAAA,qBAAW,GAAE;;4DACe;AAK7B;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,uBAAK,GAAE;IACP,IAAA,qBAAW,GAAE;;sEACyB;AAKvC;IAHC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;IACZ,IAAA,qBAAW,GAAE;;2EAC8B;AAK5C;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,uBAAK,GAAE;IACP,IAAA,qBAAW,GAAE;;uDACU;AAKxB;IAHC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;IACZ,IAAA,qBAAW,GAAE;;4DACe","sourcesContent":["import { IsBoolean, IsInt,IsOptional, IsNotEmpty, IsString } from 'class-validator';\nimport { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';\nexport class UpdateMediaDto {\n @IsOptional()\n @IsInt()\n id: number;\n\n@IsNotEmpty()\n@IsOptional()\n@IsInt()\n@ApiProperty()\nentityId: number;\n\n@IsOptional()\n@IsBoolean()\n@ApiPropertyOptional({ default: true })\nisPublic?: boolean;\n\n@IsOptional()\n@IsString()\n@ApiProperty()\nrelativeUri: string;\n\n@IsOptional()\n@IsInt()\n@ApiProperty()\nfileSize: number;\n\n@IsOptional()\n@IsString()\n@ApiProperty()\nmimeType: string;\n\n@IsOptional()\n@IsString()\n@ApiProperty()\noriginalFileName: string;\n\n@IsOptional()\n@IsInt()\n@ApiProperty()\nmodelMetadataId: number;\n\n@IsString()\n@IsOptional()\n@ApiProperty()\nmodelMetadataUserKey: string;\n\n@IsOptional()\n@IsInt()\n@ApiProperty()\nmediaStorageProviderMetadataId: number;\n\n@IsString()\n@IsOptional()\n@ApiProperty()\nmediaStorageProviderMetadataUserKey: string;\n\n@IsOptional()\n@IsInt()\n@ApiProperty()\nfieldMetadataId: number;\n\n@IsString()\n@IsOptional()\n@ApiProperty()\nfieldMetadataUserKey: string;\n}\n"]}
@@ -4,6 +4,7 @@ import { MediaStorageProviderMetadata } from '../entities/media-storage-provider
4
4
  import { FieldMetadata } from '../entities/field-metadata.entity';
5
5
  export declare class Media extends CommonEntity {
6
6
  entityId: number;
7
+ isPublic: boolean;
7
8
  relativeUri: string;
8
9
  fileSize: number;
9
10
  mimeType: string;
@@ -1 +1 @@
1
- {"version":3,"file":"media.entity.d.ts","sourceRoot":"","sources":["../../src/entities/media.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AAEzD,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAAE,4BAA4B,EAAE,MAAM,qDAAqD,CAAC;AACnG,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAA;AAClE,qBACa,KAAM,SAAQ,YAAY;IAGnC,QAAQ,EAAE,MAAM,CAAC;IAGjB,WAAW,EAAE,MAAM,CAAC;IAIpB,QAAQ,EAAE,MAAM,CAAC;IAGjB,QAAQ,EAAE,MAAM,CAAC;IAGjB,gBAAgB,EAAE,MAAM,CAAC;IAKzB,aAAa,EAAE,aAAa,CAAC;IAK7B,4BAA4B,EAAE,4BAA4B,CAAC;IAK3D,aAAa,EAAE,aAAa,CAAC;CAChC"}
1
+ {"version":3,"file":"media.entity.d.ts","sourceRoot":"","sources":["../../src/entities/media.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AAEzD,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAAE,4BAA4B,EAAE,MAAM,qDAAqD,CAAC;AACnG,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAA;AAClE,qBACa,KAAM,SAAQ,YAAY;IAGnC,QAAQ,EAAE,MAAM,CAAC;IAGjB,QAAQ,EAAE,OAAO,CAAQ;IAGzB,WAAW,EAAE,MAAM,CAAC;IAIpB,QAAQ,EAAE,MAAM,CAAC;IAGjB,QAAQ,EAAE,MAAM,CAAC;IAGjB,gBAAgB,EAAE,MAAM,CAAC;IAKzB,aAAa,EAAE,aAAa,CAAC;IAK7B,4BAA4B,EAAE,4BAA4B,CAAC;IAK3D,aAAa,EAAE,aAAa,CAAC;CAChC"}
@@ -17,8 +17,12 @@ const model_metadata_entity_1 = require("./model-metadata.entity");
17
17
  const media_storage_provider_metadata_entity_1 = require("./media-storage-provider-metadata.entity");
18
18
  const field_metadata_entity_1 = require("./field-metadata.entity");
19
19
  let Media = class Media extends common_entity_1.CommonEntity {
20
+ constructor() {
21
+ super(...arguments);
22
+ this.isPublic = true;
23
+ }
20
24
  static _OPENAPI_METADATA_FACTORY() {
21
- return { entityId: { required: true, type: () => Number }, relativeUri: { required: true, type: () => String }, fileSize: { required: true, type: () => Number }, mimeType: { required: true, type: () => String }, originalFileName: { required: true, type: () => String }, modelMetadata: { required: true, type: () => require("./model-metadata.entity").ModelMetadata }, mediaStorageProviderMetadata: { required: true, type: () => require("./media-storage-provider-metadata.entity").MediaStorageProviderMetadata }, fieldMetadata: { required: true, type: () => require("./field-metadata.entity").FieldMetadata } };
25
+ return { entityId: { required: true, type: () => Number }, isPublic: { required: true, type: () => Boolean, default: true }, relativeUri: { required: true, type: () => String }, fileSize: { required: true, type: () => Number }, mimeType: { required: true, type: () => String }, originalFileName: { required: true, type: () => String }, modelMetadata: { required: true, type: () => require("./model-metadata.entity").ModelMetadata }, mediaStorageProviderMetadata: { required: true, type: () => require("./media-storage-provider-metadata.entity").MediaStorageProviderMetadata }, fieldMetadata: { required: true, type: () => require("./field-metadata.entity").FieldMetadata } };
22
26
  }
23
27
  };
24
28
  exports.Media = Media;
@@ -27,6 +31,10 @@ __decorate([
27
31
  (0, typeorm_1.Column)({ type: "integer" }),
28
32
  __metadata("design:type", Number)
29
33
  ], Media.prototype, "entityId", void 0);
34
+ __decorate([
35
+ (0, typeorm_1.Column)({ name: "is_public", default: true }),
36
+ __metadata("design:type", Boolean)
37
+ ], Media.prototype, "isPublic", void 0);
30
38
  __decorate([
31
39
  (0, typeorm_1.Column)({ type: "varchar", nullable: true }),
32
40
  __metadata("design:type", String)
@@ -1 +1 @@
1
- {"version":3,"file":"media.entity.js","sourceRoot":"","sources":["../../src/entities/media.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mDAAyD;AACzD,qCAAuE;AACvE,mEAAmE;AACnE,qGAAmG;AACnG,mEAAkE;AAE3D,IAAM,KAAK,GAAX,MAAM,KAAM,SAAQ,4BAAY;;;;CAgCtC,CAAA;AAhCY,sBAAK;AAGd;IAFC,IAAA,eAAK,GAAE;IACP,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;uCACX;AAGjB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;0CACxB;AAIpB;IAFC,IAAA,eAAK,GAAE;IACP,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;uCAC3B;AAGjB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;uCAC3B;AAGjB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CACnB;AAKzB;IAHC,IAAA,eAAK,GAAE;IACP,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,qCAAa,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IACnD,IAAA,oBAAU,GAAE;8BACE,qCAAa;4CAAC;AAK7B;IAHC,IAAA,eAAK,GAAE;IACP,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,qEAA4B,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IAClE,IAAA,oBAAU,GAAE;8BACiB,qEAA4B;2DAAC;AAK3D;IAHC,IAAA,eAAK,GAAE;IACP,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,qCAAa,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IACnD,IAAA,oBAAU,GAAE;8BACE,qCAAa;4CAAC;gBA/BpB,KAAK;IADjB,IAAA,gBAAM,EAAC,UAAU,CAAC;GACN,KAAK,CAgCjB","sourcesContent":["import { CommonEntity } from 'src/entities/common.entity'\nimport { Entity, Column, Index, JoinColumn, ManyToOne } from 'typeorm';\nimport { ModelMetadata } from 'src/entities/model-metadata.entity';\nimport { MediaStorageProviderMetadata } from 'src/entities/media-storage-provider-metadata.entity';\nimport { FieldMetadata } from 'src/entities/field-metadata.entity'\n@Entity(\"ss_media\")\nexport class Media extends CommonEntity {\n @Index()\n @Column({ type: \"integer\" })\n entityId: number;\n\n @Column({ type: \"varchar\", nullable: true })\n relativeUri: string;\n\n @Index()\n @Column({ type: \"integer\", nullable: true })\n fileSize: number;\n\n @Column({ type: \"varchar\", nullable: true })\n mimeType: string;\n\n @Column({ type: \"varchar\", nullable: true })\n originalFileName: string;\n\n @Index()\n @ManyToOne(() => ModelMetadata, { nullable: false })\n @JoinColumn()\n modelMetadata: ModelMetadata;\n\n @Index()\n @ManyToOne(() => MediaStorageProviderMetadata, { nullable: false })\n @JoinColumn()\n mediaStorageProviderMetadata: MediaStorageProviderMetadata;\n\n @Index()\n @ManyToOne(() => FieldMetadata, { nullable: false })\n @JoinColumn()\n fieldMetadata: FieldMetadata;\n}"]}
1
+ {"version":3,"file":"media.entity.js","sourceRoot":"","sources":["../../src/entities/media.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mDAAyD;AACzD,qCAAuE;AACvE,mEAAmE;AACnE,qGAAmG;AACnG,mEAAkE;AAE3D,IAAM,KAAK,GAAX,MAAM,KAAM,SAAQ,4BAAY;IAAhC;;QAMH,aAAQ,GAAY,IAAI,CAAC;KA6B5B;;6HA7BuB,IAAI;;CA6B3B,CAAA;AAnCY,sBAAK;AAGd;IAFC,I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entity'\nimport { Entity, Column, Index, JoinColumn, ManyToOne } from 'typeorm';\nimport { ModelMetadata } from 'src/entities/model-metadata.entity';\nimport { MediaStorageProviderMetadata } from 'src/entities/media-storage-provider-metadata.entity';\nimport { FieldMetadata } from 'src/entities/field-metadata.entity'\n@Entity(\"ss_media\")\nexport class Media extends CommonEntity {\n @Index()\n @Column({ type: \"integer\" })\n entityId: number;\n\n @Column({ name: \"is_public\", default: true })\n isPublic: boolean = true;\n\n @Column({ type: \"varchar\", nullable: true })\n relativeUri: string;\n\n @Index()\n @Column({ type: \"integer\", nullable: true })\n fileSize: number;\n\n @Column({ type: \"varchar\", nullable: true })\n mimeType: string;\n\n @Column({ type: \"varchar\", nullable: true })\n originalFileName: string;\n\n @Index()\n @ManyToOne(() => ModelMetadata, { nullable: false })\n @JoinColumn()\n modelMetadata: ModelMetadata;\n\n @Index()\n @ManyToOne(() => MediaStorageProviderMetadata, { nullable: false })\n @JoinColumn()\n mediaStorageProviderMetadata: MediaStorageProviderMetadata;\n\n @Index()\n @ManyToOne(() => FieldMetadata, { nullable: false })\n @JoinColumn()\n fieldMetadata: FieldMetadata;\n}\n"]}
@@ -1,6 +1,7 @@
1
1
  export declare enum AuthType {
2
2
  Bearer = 0,
3
3
  ApiKey = 1,
4
- None = 2
4
+ None = 2,
5
+ MediaSignedUrl = 3
5
6
  }
6
7
  //# sourceMappingURL=auth-type.enum.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"auth-type.enum.d.ts","sourceRoot":"","sources":["../../src/enums/auth-type.enum.ts"],"names":[],"mappings":"AAAA,oBAAY,QAAQ;IAChB,MAAM,IAAA;IACN,MAAM,IAAA;IACN,IAAI,IAAA;CACP"}
1
+ {"version":3,"file":"auth-type.enum.d.ts","sourceRoot":"","sources":["../../src/enums/auth-type.enum.ts"],"names":[],"mappings":"AAAA,oBAAY,QAAQ;IAChB,MAAM,IAAA;IACN,MAAM,IAAA;IACN,IAAI,IAAA;IACJ,cAAc,IAAA;CACjB"}
@@ -6,5 +6,6 @@ var AuthType;
6
6
  AuthType[AuthType["Bearer"] = 0] = "Bearer";
7
7
  AuthType[AuthType["ApiKey"] = 1] = "ApiKey";
8
8
  AuthType[AuthType["None"] = 2] = "None";
9
+ AuthType[AuthType["MediaSignedUrl"] = 3] = "MediaSignedUrl";
9
10
  })(AuthType || (exports.AuthType = AuthType = {}));
10
11
  //# sourceMappingURL=auth-type.enum.js.map