@webiny/api-file-manager-s3 6.3.0 → 6.4.0-beta.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/assetDelivery/assetDeliveryConfig.js +32 -39
  2. package/assetDelivery/assetDeliveryConfig.js.map +1 -1
  3. package/assetDelivery/createAssetDelivery.js +5 -19
  4. package/assetDelivery/createAssetDelivery.js.map +1 -1
  5. package/assetDelivery/index.js +0 -2
  6. package/assetDelivery/s3/S3AssetResolver.js +21 -22
  7. package/assetDelivery/s3/S3AssetResolver.js.map +1 -1
  8. package/assetDelivery/s3/S3ContentsReader.js +13 -16
  9. package/assetDelivery/s3/S3ContentsReader.js.map +1 -1
  10. package/assetDelivery/s3/S3ErrorAssetReply.js +10 -9
  11. package/assetDelivery/s3/S3ErrorAssetReply.js.map +1 -1
  12. package/assetDelivery/s3/S3OutputStrategy.js +23 -27
  13. package/assetDelivery/s3/S3OutputStrategy.js.map +1 -1
  14. package/assetDelivery/s3/S3RedirectAssetReply.js +12 -11
  15. package/assetDelivery/s3/S3RedirectAssetReply.js.map +1 -1
  16. package/assetDelivery/s3/S3StreamAssetReply.js +12 -11
  17. package/assetDelivery/s3/S3StreamAssetReply.js.map +1 -1
  18. package/assetDelivery/s3/SharpTransform.js +139 -169
  19. package/assetDelivery/s3/SharpTransform.js.map +1 -1
  20. package/assetDelivery/s3/transformation/AssetKeyGenerator.js +18 -17
  21. package/assetDelivery/s3/transformation/AssetKeyGenerator.js.map +1 -1
  22. package/assetDelivery/s3/transformation/CallableContentsReader.js +8 -7
  23. package/assetDelivery/s3/transformation/CallableContentsReader.js.map +1 -1
  24. package/assetDelivery/s3/transformation/WidthCollection.js +15 -16
  25. package/assetDelivery/s3/transformation/WidthCollection.js.map +1 -1
  26. package/assetDelivery/s3/transformation/utils.js +24 -30
  27. package/assetDelivery/s3/transformation/utils.js.map +1 -1
  28. package/assetDelivery/threatDetection/ObjectKey.js +15 -14
  29. package/assetDelivery/threatDetection/ObjectKey.js.map +1 -1
  30. package/assetDelivery/threatDetection/createThreatDetectionEventHandler.js +28 -42
  31. package/assetDelivery/threatDetection/createThreatDetectionEventHandler.js.map +1 -1
  32. package/assetDelivery/threatDetection/createThreatDetectionPluginLoader.js +2 -3
  33. package/assetDelivery/threatDetection/createThreatDetectionPluginLoader.js.map +1 -1
  34. package/assetDelivery/threatDetection/index.js +0 -2
  35. package/assetDelivery/threatDetection/processThreatScanResult.js +48 -54
  36. package/assetDelivery/threatDetection/processThreatScanResult.js.map +1 -1
  37. package/assetDelivery/threatDetection/types.js +0 -3
  38. package/assetDelivery/types.js +0 -3
  39. package/enterprise/ApplyThreatScanning/CreateFileWithThreatScanDecorator.js +17 -13
  40. package/enterprise/ApplyThreatScanning/CreateFileWithThreatScanDecorator.js.map +1 -1
  41. package/enterprise/ApplyThreatScanning/feature.js +6 -5
  42. package/enterprise/ApplyThreatScanning/feature.js.map +1 -1
  43. package/features/DeleteFileFromBucket/DeleteFileFromBucketHandler.js +26 -27
  44. package/features/DeleteFileFromBucket/DeleteFileFromBucketHandler.js.map +1 -1
  45. package/features/DeleteFileFromBucket/DeleteS3FolderTask.js +40 -51
  46. package/features/DeleteFileFromBucket/DeleteS3FolderTask.js.map +1 -1
  47. package/features/DeleteFileFromBucket/feature.js +7 -6
  48. package/features/DeleteFileFromBucket/feature.js.map +1 -1
  49. package/features/ExtractMetadata/ExtractMetadataHandler.js +18 -19
  50. package/features/ExtractMetadata/ExtractMetadataHandler.js.map +1 -1
  51. package/features/ExtractMetadata/ExtractMetadataTask.js +75 -114
  52. package/features/ExtractMetadata/ExtractMetadataTask.js.map +1 -1
  53. package/features/ExtractMetadata/feature.js +7 -6
  54. package/features/ExtractMetadata/feature.js.map +1 -1
  55. package/features/FlushCache/FlushCacheOnFileDeleteHandler.js +20 -19
  56. package/features/FlushCache/FlushCacheOnFileDeleteHandler.js.map +1 -1
  57. package/features/FlushCache/FlushCacheOnFileUpdateHandler.js +22 -26
  58. package/features/FlushCache/FlushCacheOnFileUpdateHandler.js.map +1 -1
  59. package/features/FlushCache/InvalidateCacheTask.js +63 -75
  60. package/features/FlushCache/InvalidateCacheTask.js.map +1 -1
  61. package/features/FlushCache/feature.js +8 -7
  62. package/features/FlushCache/feature.js.map +1 -1
  63. package/features/GetFileContentsById/GetFileContentsByIdUseCase.d.ts +13 -0
  64. package/features/GetFileContentsById/GetFileContentsByIdUseCase.js +40 -0
  65. package/features/GetFileContentsById/GetFileContentsByIdUseCase.js.map +1 -0
  66. package/features/GetFileContentsById/feature.d.ts +4 -0
  67. package/features/GetFileContentsById/feature.js +11 -0
  68. package/features/GetFileContentsById/feature.js.map +1 -0
  69. package/features/GetFileContentsByKey/GetFileContentsByKeyUseCase.d.ts +13 -0
  70. package/features/GetFileContentsByKey/GetFileContentsByKeyUseCase.js +40 -0
  71. package/features/GetFileContentsByKey/GetFileContentsByKeyUseCase.js.map +1 -0
  72. package/features/GetFileContentsByKey/feature.d.ts +4 -0
  73. package/features/GetFileContentsByKey/feature.js +11 -0
  74. package/features/GetFileContentsByKey/feature.js.map +1 -0
  75. package/features/WriteFileMetadata/MetadataReader.js +9 -10
  76. package/features/WriteFileMetadata/MetadataReader.js.map +1 -1
  77. package/features/WriteFileMetadata/MetadataWriter.js +23 -25
  78. package/features/WriteFileMetadata/MetadataWriter.js.map +1 -1
  79. package/features/WriteFileMetadata/WriteMetadataAfterBatchCreateHandler.js +14 -12
  80. package/features/WriteFileMetadata/WriteMetadataAfterBatchCreateHandler.js.map +1 -1
  81. package/features/WriteFileMetadata/WriteMetadataAfterCreateHandler.js +16 -12
  82. package/features/WriteFileMetadata/WriteMetadataAfterCreateHandler.js.map +1 -1
  83. package/features/WriteFileMetadata/feature.js +7 -6
  84. package/features/WriteFileMetadata/feature.js.map +1 -1
  85. package/graphql/checkPermissions.js +17 -32
  86. package/graphql/checkPermissions.js.map +1 -1
  87. package/graphql/schema.js +99 -102
  88. package/graphql/schema.js.map +1 -1
  89. package/index.js +19 -13
  90. package/index.js.map +1 -1
  91. package/multiPartUpload/CompleteMultiPartUploadUseCase.js +50 -53
  92. package/multiPartUpload/CompleteMultiPartUploadUseCase.js.map +1 -1
  93. package/multiPartUpload/CreateMultiPartUploadUseCase.js +31 -38
  94. package/multiPartUpload/CreateMultiPartUploadUseCase.js.map +1 -1
  95. package/package.json +17 -17
  96. package/types.js +0 -2
  97. package/utils/CdnPathsGenerator.js +8 -4
  98. package/utils/CdnPathsGenerator.js.map +1 -1
  99. package/utils/FileExtension.js +12 -13
  100. package/utils/FileExtension.js.map +1 -1
  101. package/utils/FileKey.js +29 -21
  102. package/utils/FileKey.js.map +1 -1
  103. package/utils/FileKey.test.js +49 -49
  104. package/utils/FileKey.test.js.map +1 -1
  105. package/utils/FileNormalizer.js +34 -35
  106. package/utils/FileNormalizer.js.map +1 -1
  107. package/utils/FileUploadModifier.js +32 -32
  108. package/utils/FileUploadModifier.js.map +1 -1
  109. package/utils/createFileNormalizerFromContext.js +5 -4
  110. package/utils/createFileNormalizerFromContext.js.map +1 -1
  111. package/utils/getPresignedPostPayload.js +36 -33
  112. package/utils/getPresignedPostPayload.js.map +1 -1
  113. package/utils/mimeTypes.js +6 -10
  114. package/utils/mimeTypes.js.map +1 -1
  115. package/utils/uploadFileToS3.js +11 -10
  116. package/utils/uploadFileToS3.js.map +1 -1
  117. package/assetDelivery/index.js.map +0 -1
  118. package/assetDelivery/threatDetection/index.js.map +0 -1
  119. package/assetDelivery/threatDetection/types.js.map +0 -1
  120. package/assetDelivery/types.js.map +0 -1
  121. package/types.js.map +0 -1
@@ -2,86 +2,74 @@ import { ServiceDiscovery } from "@webiny/api";
2
2
  import { CloudFront } from "@webiny/aws-sdk/client-cloudfront/index.js";
3
3
  import { TaskDefinition } from "@webiny/api-core/features/task/TaskDefinition/index.js";
4
4
  import { executeWithRetry } from "@webiny/utils";
5
- class ReturnContinue extends Error {}
5
+ class ReturnContinue extends Error {
6
+ }
6
7
  class InvalidateCloudfrontCacheTask {
7
- id = "cloudfrontInvalidateCache";
8
- title = "Invalidate CloudFront Cache";
9
- description = "A task to invalidate Cloudfront cache by given paths.";
10
- maxIterations = 100;
11
- isPrivate = true;
12
- selfCleanup = ["onSuccess", "onAbort"];
13
- continueIfCode = ["TooManyInvalidationsInProgress", "Throttling"];
14
- async run({
15
- input,
16
- controller
17
- }) {
18
- if (controller.runtime.isAborted()) {
19
- return controller.response.aborted();
20
- }
21
- const manifest = await ServiceDiscovery.load();
22
- if (!manifest) {
23
- return controller.response.error({
24
- message: `Unable to invalidate cache due to a missing service manifest.`,
25
- code: "MISSING_SERVICE_MANIFEST",
26
- data: {
27
- manifest: "api"
8
+ async run({ input, controller }) {
9
+ if (controller.runtime.isAborted()) return controller.response.aborted();
10
+ const manifest = await ServiceDiscovery.load();
11
+ if (!manifest) return controller.response.error({
12
+ message: "Unable to invalidate cache due to a missing service manifest.",
13
+ code: "MISSING_SERVICE_MANIFEST",
14
+ data: {
15
+ manifest: "api"
16
+ }
17
+ });
18
+ const { distributionId } = manifest.api.cloudfront;
19
+ const invalidateCache = ()=>this.invalidateCache(input.caller, distributionId, input.paths);
20
+ try {
21
+ await executeWithRetry(invalidateCache, {
22
+ minTimeout: 2000,
23
+ retries: 10000,
24
+ onFailedAttempt: ({ error })=>{
25
+ if (this.continueIfCode.includes(error.name)) throw new ReturnContinue();
26
+ if (error.message.includes("not authorized to perform")) throw error;
27
+ if (controller.runtime.isCloseToTimeout()) throw new ReturnContinue();
28
+ }
29
+ });
30
+ } catch (error) {
31
+ if (error instanceof ReturnContinue) return controller.response.continue(input);
32
+ return controller.response.error({
33
+ message: error.message,
34
+ code: "EXECUTE_WITH_RETRY_FAILED",
35
+ data: input.paths
36
+ });
28
37
  }
29
- });
38
+ return controller.response.done();
30
39
  }
31
- const {
32
- distributionId
33
- } = manifest.api.cloudfront;
34
- const invalidateCache = () => {
35
- return this.invalidateCache(input.caller, distributionId, input.paths);
36
- };
37
- try {
38
- await executeWithRetry(invalidateCache, {
39
- minTimeout: 2000,
40
- // instead of forever: true
41
- retries: 10000,
42
- onFailedAttempt: ({
43
- error
44
- }) => {
45
- if (this.continueIfCode.includes(error.name)) {
46
- throw new ReturnContinue();
47
- }
48
- if (error.message.includes("not authorized to perform")) {
49
- throw error;
50
- }
51
- if (controller.runtime.isCloseToTimeout()) {
52
- throw new ReturnContinue();
53
- }
54
- }
55
- });
56
- } catch (error) {
57
- if (error instanceof ReturnContinue) {
58
- return controller.response.continue(input);
59
- }
60
- return controller.response.error({
61
- message: error.message,
62
- code: "EXECUTE_WITH_RETRY_FAILED",
63
- data: input.paths
64
- });
40
+ async invalidateCache(caller, distributionId, paths) {
41
+ const cloudfront = new CloudFront();
42
+ await cloudfront.createInvalidation({
43
+ DistributionId: distributionId,
44
+ InvalidationBatch: {
45
+ CallerReference: `${new Date().getTime()}-${caller}`,
46
+ Paths: {
47
+ Quantity: paths.length,
48
+ Items: paths
49
+ }
50
+ }
51
+ });
52
+ }
53
+ constructor(){
54
+ this.id = "cloudfrontInvalidateCache";
55
+ this.title = "Invalidate CloudFront Cache";
56
+ this.description = "A task to invalidate Cloudfront cache by given paths.";
57
+ this.maxIterations = 100;
58
+ this.isPrivate = true;
59
+ this.selfCleanup = [
60
+ "onSuccess",
61
+ "onAbort"
62
+ ];
63
+ this.continueIfCode = [
64
+ "TooManyInvalidationsInProgress",
65
+ "Throttling"
66
+ ];
65
67
  }
66
- return controller.response.done();
67
- }
68
- async invalidateCache(caller, distributionId, paths) {
69
- const cloudfront = new CloudFront();
70
- await cloudfront.createInvalidation({
71
- DistributionId: distributionId,
72
- InvalidationBatch: {
73
- CallerReference: `${new Date().getTime()}-${caller}`,
74
- Paths: {
75
- Quantity: paths.length,
76
- Items: paths
77
- }
78
- }
79
- });
80
- }
81
68
  }
82
- export const InvalidateCloudfrontCacheTaskDefinition = TaskDefinition.createImplementation({
83
- implementation: InvalidateCloudfrontCacheTask,
84
- dependencies: []
69
+ const InvalidateCloudfrontCacheTaskDefinition = TaskDefinition.createImplementation({
70
+ implementation: InvalidateCloudfrontCacheTask,
71
+ dependencies: []
85
72
  });
73
+ export { InvalidateCloudfrontCacheTaskDefinition };
86
74
 
87
75
  //# sourceMappingURL=InvalidateCacheTask.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["ServiceDiscovery","CloudFront","TaskDefinition","executeWithRetry","ReturnContinue","Error","InvalidateCloudfrontCacheTask","id","title","description","maxIterations","isPrivate","selfCleanup","continueIfCode","run","input","controller","runtime","isAborted","response","aborted","manifest","load","error","message","code","data","distributionId","api","cloudfront","invalidateCache","caller","paths","minTimeout","retries","onFailedAttempt","includes","name","isCloseToTimeout","continue","done","createInvalidation","DistributionId","InvalidationBatch","CallerReference","Date","getTime","Paths","Quantity","length","Items","InvalidateCloudfrontCacheTaskDefinition","createImplementation","implementation","dependencies"],"sources":["InvalidateCacheTask.ts"],"sourcesContent":["import { ServiceDiscovery } from \"@webiny/api\";\nimport { CloudFront } from \"@webiny/aws-sdk/client-cloudfront/index.js\";\nimport { TaskDefinition } from \"@webiny/api-core/features/task/TaskDefinition/index.js\";\nimport { executeWithRetry } from \"@webiny/utils\";\n\nclass ReturnContinue extends Error {}\n\nexport interface InvalidateCacheInput {\n /**\n * Caller of the task (e.g., `fm-before-update`, `fm-after-delete`).\n */\n caller: string;\n /**\n * Cache paths to invalidate.\n */\n paths: string[];\n}\n\nclass InvalidateCloudfrontCacheTask implements TaskDefinition.Interface<InvalidateCacheInput> {\n id = \"cloudfrontInvalidateCache\";\n title = \"Invalidate CloudFront Cache\";\n description = \"A task to invalidate Cloudfront cache by given paths.\";\n maxIterations = 100;\n isPrivate = true;\n\n selfCleanup = [\"onSuccess\" as const, \"onAbort\" as const];\n\n private continueIfCode = [\"TooManyInvalidationsInProgress\", \"Throttling\"];\n\n public async run({ input, controller }: TaskDefinition.RunParams<InvalidateCacheInput>) {\n if (controller.runtime.isAborted()) {\n return controller.response.aborted();\n }\n\n const manifest = await ServiceDiscovery.load();\n\n if (!manifest) {\n return controller.response.error({\n message: `Unable to invalidate cache due to a missing service manifest.`,\n code: \"MISSING_SERVICE_MANIFEST\",\n data: {\n manifest: \"api\"\n }\n });\n }\n\n const { distributionId } = manifest.api.cloudfront;\n\n const invalidateCache = () => {\n return this.invalidateCache(input.caller, distributionId as string, input.paths);\n };\n\n try {\n await executeWithRetry(invalidateCache, {\n minTimeout: 2000,\n // instead of forever: true\n retries: 10000,\n onFailedAttempt: ({ error }) => {\n if (this.continueIfCode.includes(error.name)) {\n throw new ReturnContinue();\n }\n\n if (error.message.includes(\"not authorized to perform\")) {\n throw error;\n }\n\n if (controller.runtime.isCloseToTimeout()) {\n throw new ReturnContinue();\n }\n }\n });\n } catch (error) {\n if (error instanceof ReturnContinue) {\n return controller.response.continue(input);\n }\n\n return controller.response.error({\n message: error.message,\n code: \"EXECUTE_WITH_RETRY_FAILED\",\n data: input.paths\n });\n }\n\n return controller.response.done();\n }\n\n private async invalidateCache(\n caller: string,\n distributionId: string,\n paths: string[]\n ): Promise<void> {\n const cloudfront = new CloudFront();\n await cloudfront.createInvalidation({\n DistributionId: distributionId,\n InvalidationBatch: {\n CallerReference: `${new Date().getTime()}-${caller}`,\n Paths: {\n Quantity: paths.length,\n Items: paths\n }\n }\n });\n }\n}\n\nexport const InvalidateCloudfrontCacheTaskDefinition = TaskDefinition.createImplementation({\n implementation: InvalidateCloudfrontCacheTask,\n dependencies: []\n});\n"],"mappings":"AAAA,SAASA,gBAAgB,QAAQ,aAAa;AAC9C,SAASC,UAAU,QAAQ,4CAA4C;AACvE,SAASC,cAAc,QAAQ,wDAAwD;AACvF,SAASC,gBAAgB,QAAQ,eAAe;AAEhD,MAAMC,cAAc,SAASC,KAAK,CAAC;AAanC,MAAMC,6BAA6B,CAA2D;EAC1FC,EAAE,GAAG,2BAA2B;EAChCC,KAAK,GAAG,6BAA6B;EACrCC,WAAW,GAAG,uDAAuD;EACrEC,aAAa,GAAG,GAAG;EACnBC,SAAS,GAAG,IAAI;EAEhBC,WAAW,GAAG,CAAC,WAAW,EAAW,SAAS,CAAU;EAEhDC,cAAc,GAAG,CAAC,gCAAgC,EAAE,YAAY,CAAC;EAEzE,MAAaC,GAAGA,CAAC;IAAEC,KAAK;IAAEC;EAA2D,CAAC,EAAE;IACpF,IAAIA,UAAU,CAACC,OAAO,CAACC,SAAS,CAAC,CAAC,EAAE;MAChC,OAAOF,UAAU,CAACG,QAAQ,CAACC,OAAO,CAAC,CAAC;IACxC;IAEA,MAAMC,QAAQ,GAAG,MAAMrB,gBAAgB,CAACsB,IAAI,CAAC,CAAC;IAE9C,IAAI,CAACD,QAAQ,EAAE;MACX,OAAOL,UAAU,CAACG,QAAQ,CAACI,KAAK,CAAC;QAC7BC,OAAO,EAAE,+DAA+D;QACxEC,IAAI,EAAE,0BAA0B;QAChCC,IAAI,EAAE;UACFL,QAAQ,EAAE;QACd;MACJ,CAAC,CAAC;IACN;IAEA,MAAM;MAAEM;IAAe,CAAC,GAAGN,QAAQ,CAACO,GAAG,CAACC,UAAU;IAElD,MAAMC,eAAe,GAAGA,CAAA,KAAM;MAC1B,OAAO,IAAI,CAACA,eAAe,CAACf,KAAK,CAACgB,MAAM,EAAEJ,cAAc,EAAYZ,KAAK,CAACiB,KAAK,CAAC;IACpF,CAAC;IAED,IAAI;MACA,MAAM7B,gBAAgB,CAAC2B,eAAe,EAAE;QACpCG,UAAU,EAAE,IAAI;QAChB;QACAC,OAAO,EAAE,KAAK;QACdC,eAAe,EAAEA,CAAC;UAAEZ;QAAM,CAAC,KAAK;UAC5B,IAAI,IAAI,CAACV,cAAc,CAACuB,QAAQ,CAACb,KAAK,CAACc,IAAI,CAAC,EAAE;YAC1C,MAAM,IAAIjC,cAAc,CAAC,CAAC;UAC9B;UAEA,IAAImB,KAAK,CAACC,OAAO,CAACY,QAAQ,CAAC,2BAA2B,CAAC,EAAE;YACrD,MAAMb,KAAK;UACf;UAEA,IAAIP,UAAU,CAACC,OAAO,CAACqB,gBAAgB,CAAC,CAAC,EAAE;YACvC,MAAM,IAAIlC,cAAc,CAAC,CAAC;UAC9B;QACJ;MACJ,CAAC,CAAC;IACN,CAAC,CAAC,OAAOmB,KAAK,EAAE;MACZ,IAAIA,KAAK,YAAYnB,cAAc,EAAE;QACjC,OAAOY,UAAU,CAACG,QAAQ,CAACoB,QAAQ,CAACxB,KAAK,CAAC;MAC9C;MAEA,OAAOC,UAAU,CAACG,QAAQ,CAACI,KAAK,CAAC;QAC7BC,OAAO,EAAED,KAAK,CAACC,OAAO;QACtBC,IAAI,EAAE,2BAA2B;QACjCC,IAAI,EAAEX,KAAK,CAACiB;MAChB,CAAC,CAAC;IACN;IAEA,OAAOhB,UAAU,CAACG,QAAQ,CAACqB,IAAI,CAAC,CAAC;EACrC;EAEA,MAAcV,eAAeA,CACzBC,MAAc,EACdJ,cAAsB,EACtBK,KAAe,EACF;IACb,MAAMH,UAAU,GAAG,IAAI5B,UAAU,CAAC,CAAC;IACnC,MAAM4B,UAAU,CAACY,kBAAkB,CAAC;MAChCC,cAAc,EAAEf,cAAc;MAC9BgB,iBAAiB,EAAE;QACfC,eAAe,EAAE,GAAG,IAAIC,IAAI,CAAC,CAAC,CAACC,OAAO,CAAC,CAAC,IAAIf,MAAM,EAAE;QACpDgB,KAAK,EAAE;UACHC,QAAQ,EAAEhB,KAAK,CAACiB,MAAM;UACtBC,KAAK,EAAElB;QACX;MACJ;IACJ,CAAC,CAAC;EACN;AACJ;AAEA,OAAO,MAAMmB,uCAAuC,GAAGjD,cAAc,CAACkD,oBAAoB,CAAC;EACvFC,cAAc,EAAE/C,6BAA6B;EAC7CgD,YAAY,EAAE;AAClB,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"features/FlushCache/InvalidateCacheTask.js","sources":["../../../src/features/FlushCache/InvalidateCacheTask.ts"],"sourcesContent":["import { ServiceDiscovery } from \"@webiny/api\";\nimport { CloudFront } from \"@webiny/aws-sdk/client-cloudfront/index.js\";\nimport { TaskDefinition } from \"@webiny/api-core/features/task/TaskDefinition/index.js\";\nimport { executeWithRetry } from \"@webiny/utils\";\n\nclass ReturnContinue extends Error {}\n\nexport interface InvalidateCacheInput {\n /**\n * Caller of the task (e.g., `fm-before-update`, `fm-after-delete`).\n */\n caller: string;\n /**\n * Cache paths to invalidate.\n */\n paths: string[];\n}\n\nclass InvalidateCloudfrontCacheTask implements TaskDefinition.Interface<InvalidateCacheInput> {\n id = \"cloudfrontInvalidateCache\";\n title = \"Invalidate CloudFront Cache\";\n description = \"A task to invalidate Cloudfront cache by given paths.\";\n maxIterations = 100;\n isPrivate = true;\n\n selfCleanup = [\"onSuccess\" as const, \"onAbort\" as const];\n\n private continueIfCode = [\"TooManyInvalidationsInProgress\", \"Throttling\"];\n\n public async run({ input, controller }: TaskDefinition.RunParams<InvalidateCacheInput>) {\n if (controller.runtime.isAborted()) {\n return controller.response.aborted();\n }\n\n const manifest = await ServiceDiscovery.load();\n\n if (!manifest) {\n return controller.response.error({\n message: `Unable to invalidate cache due to a missing service manifest.`,\n code: \"MISSING_SERVICE_MANIFEST\",\n data: {\n manifest: \"api\"\n }\n });\n }\n\n const { distributionId } = manifest.api.cloudfront;\n\n const invalidateCache = () => {\n return this.invalidateCache(input.caller, distributionId as string, input.paths);\n };\n\n try {\n await executeWithRetry(invalidateCache, {\n minTimeout: 2000,\n // instead of forever: true\n retries: 10000,\n onFailedAttempt: ({ error }) => {\n if (this.continueIfCode.includes(error.name)) {\n throw new ReturnContinue();\n }\n\n if (error.message.includes(\"not authorized to perform\")) {\n throw error;\n }\n\n if (controller.runtime.isCloseToTimeout()) {\n throw new ReturnContinue();\n }\n }\n });\n } catch (error) {\n if (error instanceof ReturnContinue) {\n return controller.response.continue(input);\n }\n\n return controller.response.error({\n message: error.message,\n code: \"EXECUTE_WITH_RETRY_FAILED\",\n data: input.paths\n });\n }\n\n return controller.response.done();\n }\n\n private async invalidateCache(\n caller: string,\n distributionId: string,\n paths: string[]\n ): Promise<void> {\n const cloudfront = new CloudFront();\n await cloudfront.createInvalidation({\n DistributionId: distributionId,\n InvalidationBatch: {\n CallerReference: `${new Date().getTime()}-${caller}`,\n Paths: {\n Quantity: paths.length,\n Items: paths\n }\n }\n });\n }\n}\n\nexport const InvalidateCloudfrontCacheTaskDefinition = TaskDefinition.createImplementation({\n implementation: InvalidateCloudfrontCacheTask,\n dependencies: []\n});\n"],"names":["ReturnContinue","Error","InvalidateCloudfrontCacheTask","input","controller","manifest","ServiceDiscovery","distributionId","invalidateCache","executeWithRetry","error","caller","paths","cloudfront","CloudFront","Date","InvalidateCloudfrontCacheTaskDefinition","TaskDefinition"],"mappings":";;;;AAKA,MAAMA,uBAAuBC;AAAO;AAapC,MAAMC;IAWF,MAAa,IAAI,EAAEC,KAAK,EAAEC,UAAU,EAAkD,EAAE;QACpF,IAAIA,WAAW,OAAO,CAAC,SAAS,IAC5B,OAAOA,WAAW,QAAQ,CAAC,OAAO;QAGtC,MAAMC,WAAW,MAAMC,iBAAiB,IAAI;QAE5C,IAAI,CAACD,UACD,OAAOD,WAAW,QAAQ,CAAC,KAAK,CAAC;YAC7B,SAAS;YACT,MAAM;YACN,MAAM;gBACF,UAAU;YACd;QACJ;QAGJ,MAAM,EAAEG,cAAc,EAAE,GAAGF,SAAS,GAAG,CAAC,UAAU;QAElD,MAAMG,kBAAkB,IACb,IAAI,CAAC,eAAe,CAACL,MAAM,MAAM,EAAEI,gBAA0BJ,MAAM,KAAK;QAGnF,IAAI;YACA,MAAMM,iBAAiBD,iBAAiB;gBACpC,YAAY;gBAEZ,SAAS;gBACT,iBAAiB,CAAC,EAAEE,KAAK,EAAE;oBACvB,IAAI,IAAI,CAAC,cAAc,CAAC,QAAQ,CAACA,MAAM,IAAI,GACvC,MAAM,IAAIV;oBAGd,IAAIU,MAAM,OAAO,CAAC,QAAQ,CAAC,8BACvB,MAAMA;oBAGV,IAAIN,WAAW,OAAO,CAAC,gBAAgB,IACnC,MAAM,IAAIJ;gBAElB;YACJ;QACJ,EAAE,OAAOU,OAAO;YACZ,IAAIA,iBAAiBV,gBACjB,OAAOI,WAAW,QAAQ,CAAC,QAAQ,CAACD;YAGxC,OAAOC,WAAW,QAAQ,CAAC,KAAK,CAAC;gBAC7B,SAASM,MAAM,OAAO;gBACtB,MAAM;gBACN,MAAMP,MAAM,KAAK;YACrB;QACJ;QAEA,OAAOC,WAAW,QAAQ,CAAC,IAAI;IACnC;IAEA,MAAc,gBACVO,MAAc,EACdJ,cAAsB,EACtBK,KAAe,EACF;QACb,MAAMC,aAAa,IAAIC;QACvB,MAAMD,WAAW,kBAAkB,CAAC;YAChC,gBAAgBN;YAChB,mBAAmB;gBACf,iBAAiB,GAAG,IAAIQ,OAAO,OAAO,GAAG,CAAC,EAAEJ,QAAQ;gBACpD,OAAO;oBACH,UAAUC,MAAM,MAAM;oBACtB,OAAOA;gBACX;YACJ;QACJ;IACJ;;aAnFA,EAAE,GAAG;aACL,KAAK,GAAG;aACR,WAAW,GAAG;aACd,aAAa,GAAG;aAChB,SAAS,GAAG;aAEZ,WAAW,GAAG;YAAC;YAAsB;SAAmB;aAEhD,cAAc,GAAG;YAAC;YAAkC;SAAa;;AA4E7E;AAEO,MAAMI,0CAA0CC,eAAe,oBAAoB,CAAC;IACvF,gBAAgBf;IAChB,cAAc,EAAE;AACpB"}
@@ -2,13 +2,14 @@ import { createFeature } from "@webiny/feature/api";
2
2
  import { FlushCacheOnFileDeleteHandler } from "./FlushCacheOnFileDeleteHandler.js";
3
3
  import { FlushCacheOnFileUpdateHandler } from "./FlushCacheOnFileUpdateHandler.js";
4
4
  import { InvalidateCloudfrontCacheTaskDefinition } from "./InvalidateCacheTask.js";
5
- export const FlushCacheFeature = createFeature({
6
- name: "FileManagerS3/FlushCache",
7
- register(container) {
8
- container.register(FlushCacheOnFileDeleteHandler);
9
- container.register(FlushCacheOnFileUpdateHandler);
10
- container.register(InvalidateCloudfrontCacheTaskDefinition);
11
- }
5
+ const FlushCacheFeature = createFeature({
6
+ name: "FileManagerS3/FlushCache",
7
+ register (container) {
8
+ container.register(FlushCacheOnFileDeleteHandler);
9
+ container.register(FlushCacheOnFileUpdateHandler);
10
+ container.register(InvalidateCloudfrontCacheTaskDefinition);
11
+ }
12
12
  });
13
+ export { FlushCacheFeature };
13
14
 
14
15
  //# sourceMappingURL=feature.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createFeature","FlushCacheOnFileDeleteHandler","FlushCacheOnFileUpdateHandler","InvalidateCloudfrontCacheTaskDefinition","FlushCacheFeature","name","register","container"],"sources":["feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { FlushCacheOnFileDeleteHandler } from \"./FlushCacheOnFileDeleteHandler.js\";\nimport { FlushCacheOnFileUpdateHandler } from \"./FlushCacheOnFileUpdateHandler.js\";\nimport { InvalidateCloudfrontCacheTaskDefinition } from \"./InvalidateCacheTask.js\";\n\nexport const FlushCacheFeature = createFeature({\n name: \"FileManagerS3/FlushCache\",\n register(container) {\n container.register(FlushCacheOnFileDeleteHandler);\n container.register(FlushCacheOnFileUpdateHandler);\n container.register(InvalidateCloudfrontCacheTaskDefinition);\n }\n});\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ,qBAAqB;AACnD,SAASC,6BAA6B;AACtC,SAASC,6BAA6B;AACtC,SAASC,uCAAuC;AAEhD,OAAO,MAAMC,iBAAiB,GAAGJ,aAAa,CAAC;EAC3CK,IAAI,EAAE,0BAA0B;EAChCC,QAAQA,CAACC,SAAS,EAAE;IAChBA,SAAS,CAACD,QAAQ,CAACL,6BAA6B,CAAC;IACjDM,SAAS,CAACD,QAAQ,CAACJ,6BAA6B,CAAC;IACjDK,SAAS,CAACD,QAAQ,CAACH,uCAAuC,CAAC;EAC/D;AACJ,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"features/FlushCache/feature.js","sources":["../../../src/features/FlushCache/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { FlushCacheOnFileDeleteHandler } from \"./FlushCacheOnFileDeleteHandler.js\";\nimport { FlushCacheOnFileUpdateHandler } from \"./FlushCacheOnFileUpdateHandler.js\";\nimport { InvalidateCloudfrontCacheTaskDefinition } from \"./InvalidateCacheTask.js\";\n\nexport const FlushCacheFeature = createFeature({\n name: \"FileManagerS3/FlushCache\",\n register(container) {\n container.register(FlushCacheOnFileDeleteHandler);\n container.register(FlushCacheOnFileUpdateHandler);\n container.register(InvalidateCloudfrontCacheTaskDefinition);\n }\n});\n"],"names":["FlushCacheFeature","createFeature","container","FlushCacheOnFileDeleteHandler","FlushCacheOnFileUpdateHandler","InvalidateCloudfrontCacheTaskDefinition"],"mappings":";;;;AAKO,MAAMA,oBAAoBC,cAAc;IAC3C,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,QAAQ,CAACC;QACnBD,UAAU,QAAQ,CAACE;QACnBF,UAAU,QAAQ,CAACG;IACvB;AACJ"}
@@ -0,0 +1,13 @@
1
+ import { Result } from "@webiny/feature/api";
2
+ import { GlobalKeyValueStore } from "@webiny/api-core/features/keyValueStore/index.js";
3
+ import { GetFileContentsByIdUseCase } from "@webiny/api-file-manager/features/file/GetFileContentsById/index.js";
4
+ import type { FileContents } from "@webiny/api-file-manager/features/file/GetFileContentsById/index.js";
5
+ declare class GetFileContentsByIdUseCaseImpl implements GetFileContentsByIdUseCase.Interface {
6
+ private metadataReader;
7
+ constructor(keyValueStore: GlobalKeyValueStore.Interface);
8
+ execute(fileId: string): Promise<Result<FileContents, GetFileContentsByIdUseCase.Error>>;
9
+ }
10
+ export declare const GetFileContentsByIdUseCaseImplementation: typeof GetFileContentsByIdUseCaseImpl & {
11
+ __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-file-manager/features/file/GetFileContentsById/abstractions").IGetFileContentsByIdUseCase>;
12
+ };
13
+ export {};
@@ -0,0 +1,40 @@
1
+ import { Result } from "@webiny/feature/api";
2
+ import { S3 } from "@webiny/aws-sdk/client-s3/index.js";
3
+ import { GlobalKeyValueStore } from "@webiny/api-core/features/keyValueStore/index.js";
4
+ import { GetFileContentsByIdUseCase } from "@webiny/api-file-manager/features/file/GetFileContentsById/index.js";
5
+ import { FileNotFoundError, FilePersistenceError } from "@webiny/api-file-manager/domain/file/errors.js";
6
+ import { MetadataReader } from "../WriteFileMetadata/MetadataReader.js";
7
+ class GetFileContentsByIdUseCaseImpl {
8
+ constructor(keyValueStore){
9
+ this.metadataReader = new MetadataReader(keyValueStore);
10
+ }
11
+ async execute(fileId) {
12
+ const metadata = await this.metadataReader.read(fileId);
13
+ if (!metadata) return Result.fail(new FileNotFoundError(fileId));
14
+ try {
15
+ const s3 = new S3();
16
+ const bucket = String(process.env.S3_BUCKET);
17
+ const response = await s3.getObject({
18
+ Bucket: bucket,
19
+ Key: metadata.bucketKey
20
+ });
21
+ if (!response.Body) return Result.fail(new FileNotFoundError(fileId));
22
+ const buffer = Buffer.from(await response.Body.transformToByteArray());
23
+ return Result.ok({
24
+ buffer,
25
+ contentType: metadata.contentType
26
+ });
27
+ } catch (error) {
28
+ return Result.fail(new FilePersistenceError(error instanceof Error ? error : new Error(String(error))));
29
+ }
30
+ }
31
+ }
32
+ const GetFileContentsByIdUseCaseImplementation = GetFileContentsByIdUseCase.createImplementation({
33
+ implementation: GetFileContentsByIdUseCaseImpl,
34
+ dependencies: [
35
+ GlobalKeyValueStore
36
+ ]
37
+ });
38
+ export { GetFileContentsByIdUseCaseImplementation };
39
+
40
+ //# sourceMappingURL=GetFileContentsByIdUseCase.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/GetFileContentsById/GetFileContentsByIdUseCase.js","sources":["../../../src/features/GetFileContentsById/GetFileContentsByIdUseCase.ts"],"sourcesContent":["import { Result } from \"@webiny/feature/api\";\nimport { S3 } from \"@webiny/aws-sdk/client-s3/index.js\";\nimport { GlobalKeyValueStore } from \"@webiny/api-core/features/keyValueStore/index.js\";\nimport { GetFileContentsByIdUseCase } from \"@webiny/api-file-manager/features/file/GetFileContentsById/index.js\";\nimport type { FileContents } from \"@webiny/api-file-manager/features/file/GetFileContentsById/index.js\";\nimport {\n FileNotFoundError,\n FilePersistenceError\n} from \"@webiny/api-file-manager/domain/file/errors.js\";\nimport { MetadataReader } from \"~/features/WriteFileMetadata/MetadataReader.js\";\n\nclass GetFileContentsByIdUseCaseImpl implements GetFileContentsByIdUseCase.Interface {\n private metadataReader: MetadataReader;\n\n constructor(keyValueStore: GlobalKeyValueStore.Interface) {\n this.metadataReader = new MetadataReader(keyValueStore);\n }\n\n async execute(fileId: string): Promise<Result<FileContents, GetFileContentsByIdUseCase.Error>> {\n const metadata = await this.metadataReader.read(fileId);\n if (!metadata) {\n return Result.fail(new FileNotFoundError(fileId));\n }\n\n try {\n const s3 = new S3();\n const bucket = String(process.env.S3_BUCKET);\n const response = await s3.getObject({ Bucket: bucket, Key: metadata.bucketKey });\n\n if (!response.Body) {\n return Result.fail(new FileNotFoundError(fileId));\n }\n\n const buffer = Buffer.from(await response.Body.transformToByteArray());\n return Result.ok({ buffer, contentType: metadata.contentType });\n } catch (error) {\n return Result.fail(\n new FilePersistenceError(error instanceof Error ? error : new Error(String(error)))\n );\n }\n }\n}\n\nexport const GetFileContentsByIdUseCaseImplementation =\n GetFileContentsByIdUseCase.createImplementation({\n implementation: GetFileContentsByIdUseCaseImpl,\n dependencies: [GlobalKeyValueStore]\n });\n"],"names":["GetFileContentsByIdUseCaseImpl","keyValueStore","MetadataReader","fileId","metadata","Result","FileNotFoundError","s3","S3","bucket","String","process","response","buffer","Buffer","error","FilePersistenceError","Error","GetFileContentsByIdUseCaseImplementation","GetFileContentsByIdUseCase","GlobalKeyValueStore"],"mappings":";;;;;;AAWA,MAAMA;IAGF,YAAYC,aAA4C,CAAE;QACtD,IAAI,CAAC,cAAc,GAAG,IAAIC,eAAeD;IAC7C;IAEA,MAAM,QAAQE,MAAc,EAAmE;QAC3F,MAAMC,WAAW,MAAM,IAAI,CAAC,cAAc,CAAC,IAAI,CAACD;QAChD,IAAI,CAACC,UACD,OAAOC,OAAO,IAAI,CAAC,IAAIC,kBAAkBH;QAG7C,IAAI;YACA,MAAMI,KAAK,IAAIC;YACf,MAAMC,SAASC,OAAOC,QAAQ,GAAG,CAAC,SAAS;YAC3C,MAAMC,WAAW,MAAML,GAAG,SAAS,CAAC;gBAAE,QAAQE;gBAAQ,KAAKL,SAAS,SAAS;YAAC;YAE9E,IAAI,CAACQ,SAAS,IAAI,EACd,OAAOP,OAAO,IAAI,CAAC,IAAIC,kBAAkBH;YAG7C,MAAMU,SAASC,OAAO,IAAI,CAAC,MAAMF,SAAS,IAAI,CAAC,oBAAoB;YACnE,OAAOP,OAAO,EAAE,CAAC;gBAAEQ;gBAAQ,aAAaT,SAAS,WAAW;YAAC;QACjE,EAAE,OAAOW,OAAO;YACZ,OAAOV,OAAO,IAAI,CACd,IAAIW,qBAAqBD,iBAAiBE,QAAQF,QAAQ,IAAIE,MAAMP,OAAOK;QAEnF;IACJ;AACJ;AAEO,MAAMG,2CACTC,2BAA2B,oBAAoB,CAAC;IAC5C,gBAAgBnB;IAChB,cAAc;QAACoB;KAAoB;AACvC"}
@@ -0,0 +1,4 @@
1
+ export declare const GetFileContentsByIdFeature: {
2
+ name: string;
3
+ register(container: import("@webiny/di").Container): void;
4
+ };
@@ -0,0 +1,11 @@
1
+ import { createFeature } from "@webiny/feature/api";
2
+ import { GetFileContentsByIdUseCaseImplementation } from "./GetFileContentsByIdUseCase.js";
3
+ const GetFileContentsByIdFeature = createFeature({
4
+ name: "FileManagerS3/GetFileContentsById",
5
+ register (container) {
6
+ container.register(GetFileContentsByIdUseCaseImplementation);
7
+ }
8
+ });
9
+ export { GetFileContentsByIdFeature };
10
+
11
+ //# sourceMappingURL=feature.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/GetFileContentsById/feature.js","sources":["../../../src/features/GetFileContentsById/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { GetFileContentsByIdUseCaseImplementation } from \"./GetFileContentsByIdUseCase.js\";\n\nexport const GetFileContentsByIdFeature = createFeature({\n name: \"FileManagerS3/GetFileContentsById\",\n register(container) {\n container.register(GetFileContentsByIdUseCaseImplementation);\n }\n});\n"],"names":["GetFileContentsByIdFeature","createFeature","container","GetFileContentsByIdUseCaseImplementation"],"mappings":";;AAGO,MAAMA,6BAA6BC,cAAc;IACpD,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,QAAQ,CAACC;IACvB;AACJ"}
@@ -0,0 +1,13 @@
1
+ import { Result } from "@webiny/feature/api";
2
+ import { TenantContext } from "@webiny/api-core/features/tenancy/TenantContext/index.js";
3
+ import { GetFileContentsByKeyUseCase } from "@webiny/api-file-manager/features/file/GetFileContentsByKey/index.js";
4
+ import type { FileContents } from "@webiny/api-file-manager/features/file/GetFileContentsById/index.js";
5
+ declare class GetFileContentsByKeyUseCaseImpl implements GetFileContentsByKeyUseCase.Interface {
6
+ private tenantContext;
7
+ constructor(tenantContext: TenantContext.Interface);
8
+ execute(key: string): Promise<Result<FileContents, GetFileContentsByKeyUseCase.Error>>;
9
+ }
10
+ export declare const GetFileContentsByKeyUseCaseImplementation: typeof GetFileContentsByKeyUseCaseImpl & {
11
+ __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-file-manager/features/file/GetFileContentsByKey/abstractions").IGetFileContentsByKeyUseCase>;
12
+ };
13
+ export {};
@@ -0,0 +1,40 @@
1
+ import { Result } from "@webiny/feature/api";
2
+ import { S3 } from "@webiny/aws-sdk/client-s3/index.js";
3
+ import { TenantContext } from "@webiny/api-core/features/tenancy/TenantContext/index.js";
4
+ import { GetFileContentsByKeyUseCase } from "@webiny/api-file-manager/features/file/GetFileContentsByKey/index.js";
5
+ import { FileNotFoundError, FilePersistenceError } from "@webiny/api-file-manager/domain/file/errors.js";
6
+ class GetFileContentsByKeyUseCaseImpl {
7
+ constructor(tenantContext){
8
+ this.tenantContext = tenantContext;
9
+ }
10
+ async execute(key) {
11
+ const tenant = this.tenantContext.getTenant();
12
+ const bucketKey = `tenants/${tenant.id}/files/${key}`;
13
+ try {
14
+ const s3 = new S3();
15
+ const bucket = String(process.env.S3_BUCKET);
16
+ const response = await s3.getObject({
17
+ Bucket: bucket,
18
+ Key: bucketKey
19
+ });
20
+ if (!response.Body) return Result.fail(new FileNotFoundError(key));
21
+ const buffer = Buffer.from(await response.Body.transformToByteArray());
22
+ const contentType = response.ContentType || "application/octet-stream";
23
+ return Result.ok({
24
+ buffer,
25
+ contentType
26
+ });
27
+ } catch (error) {
28
+ return Result.fail(new FilePersistenceError(error instanceof Error ? error : new Error(String(error))));
29
+ }
30
+ }
31
+ }
32
+ const GetFileContentsByKeyUseCaseImplementation = GetFileContentsByKeyUseCase.createImplementation({
33
+ implementation: GetFileContentsByKeyUseCaseImpl,
34
+ dependencies: [
35
+ TenantContext
36
+ ]
37
+ });
38
+ export { GetFileContentsByKeyUseCaseImplementation };
39
+
40
+ //# sourceMappingURL=GetFileContentsByKeyUseCase.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/GetFileContentsByKey/GetFileContentsByKeyUseCase.js","sources":["../../../src/features/GetFileContentsByKey/GetFileContentsByKeyUseCase.ts"],"sourcesContent":["import { Result } from \"@webiny/feature/api\";\nimport { S3 } from \"@webiny/aws-sdk/client-s3/index.js\";\nimport { TenantContext } from \"@webiny/api-core/features/tenancy/TenantContext/index.js\";\nimport { GetFileContentsByKeyUseCase } from \"@webiny/api-file-manager/features/file/GetFileContentsByKey/index.js\";\nimport type { FileContents } from \"@webiny/api-file-manager/features/file/GetFileContentsById/index.js\";\nimport {\n FileNotFoundError,\n FilePersistenceError\n} from \"@webiny/api-file-manager/domain/file/errors.js\";\n\nclass GetFileContentsByKeyUseCaseImpl implements GetFileContentsByKeyUseCase.Interface {\n constructor(private tenantContext: TenantContext.Interface) {}\n\n async execute(key: string): Promise<Result<FileContents, GetFileContentsByKeyUseCase.Error>> {\n const tenant = this.tenantContext.getTenant();\n const bucketKey = `tenants/${tenant.id}/files/${key}`;\n\n try {\n const s3 = new S3();\n const bucket = String(process.env.S3_BUCKET);\n const response = await s3.getObject({ Bucket: bucket, Key: bucketKey });\n\n if (!response.Body) {\n return Result.fail(new FileNotFoundError(key));\n }\n\n const buffer = Buffer.from(await response.Body.transformToByteArray());\n const contentType = response.ContentType || \"application/octet-stream\";\n return Result.ok({ buffer, contentType });\n } catch (error) {\n return Result.fail(\n new FilePersistenceError(error instanceof Error ? error : new Error(String(error)))\n );\n }\n }\n}\n\nexport const GetFileContentsByKeyUseCaseImplementation =\n GetFileContentsByKeyUseCase.createImplementation({\n implementation: GetFileContentsByKeyUseCaseImpl,\n dependencies: [TenantContext]\n });\n"],"names":["GetFileContentsByKeyUseCaseImpl","tenantContext","key","tenant","bucketKey","s3","S3","bucket","String","process","response","Result","FileNotFoundError","buffer","Buffer","contentType","error","FilePersistenceError","Error","GetFileContentsByKeyUseCaseImplementation","GetFileContentsByKeyUseCase","TenantContext"],"mappings":";;;;;AAUA,MAAMA;IACF,YAAoBC,aAAsC,CAAE;aAAxCA,aAAa,GAAbA;IAAyC;IAE7D,MAAM,QAAQC,GAAW,EAAoE;QACzF,MAAMC,SAAS,IAAI,CAAC,aAAa,CAAC,SAAS;QAC3C,MAAMC,YAAY,CAAC,QAAQ,EAAED,OAAO,EAAE,CAAC,OAAO,EAAED,KAAK;QAErD,IAAI;YACA,MAAMG,KAAK,IAAIC;YACf,MAAMC,SAASC,OAAOC,QAAQ,GAAG,CAAC,SAAS;YAC3C,MAAMC,WAAW,MAAML,GAAG,SAAS,CAAC;gBAAE,QAAQE;gBAAQ,KAAKH;YAAU;YAErE,IAAI,CAACM,SAAS,IAAI,EACd,OAAOC,OAAO,IAAI,CAAC,IAAIC,kBAAkBV;YAG7C,MAAMW,SAASC,OAAO,IAAI,CAAC,MAAMJ,SAAS,IAAI,CAAC,oBAAoB;YACnE,MAAMK,cAAcL,SAAS,WAAW,IAAI;YAC5C,OAAOC,OAAO,EAAE,CAAC;gBAAEE;gBAAQE;YAAY;QAC3C,EAAE,OAAOC,OAAO;YACZ,OAAOL,OAAO,IAAI,CACd,IAAIM,qBAAqBD,iBAAiBE,QAAQF,QAAQ,IAAIE,MAAMV,OAAOQ;QAEnF;IACJ;AACJ;AAEO,MAAMG,4CACTC,4BAA4B,oBAAoB,CAAC;IAC7C,gBAAgBpB;IAChB,cAAc;QAACqB;KAAc;AACjC"}
@@ -0,0 +1,4 @@
1
+ export declare const GetFileContentsByKeyFeature: {
2
+ name: string;
3
+ register(container: import("@webiny/di").Container): void;
4
+ };
@@ -0,0 +1,11 @@
1
+ import { createFeature } from "@webiny/feature/api";
2
+ import { GetFileContentsByKeyUseCaseImplementation } from "./GetFileContentsByKeyUseCase.js";
3
+ const GetFileContentsByKeyFeature = createFeature({
4
+ name: "FileManagerS3/GetFileContentsByKey",
5
+ register (container) {
6
+ container.register(GetFileContentsByKeyUseCaseImplementation);
7
+ }
8
+ });
9
+ export { GetFileContentsByKeyFeature };
10
+
11
+ //# sourceMappingURL=feature.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/GetFileContentsByKey/feature.js","sources":["../../../src/features/GetFileContentsByKey/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { GetFileContentsByKeyUseCaseImplementation } from \"./GetFileContentsByKeyUseCase.js\";\n\nexport const GetFileContentsByKeyFeature = createFeature({\n name: \"FileManagerS3/GetFileContentsByKey\",\n register(container) {\n container.register(GetFileContentsByKeyUseCaseImplementation);\n }\n});\n"],"names":["GetFileContentsByKeyFeature","createFeature","container","GetFileContentsByKeyUseCaseImplementation"],"mappings":";;AAGO,MAAMA,8BAA8BC,cAAc;IACrD,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,QAAQ,CAACC;IACvB;AACJ"}
@@ -1,14 +1,13 @@
1
- export class MetadataReader {
2
- constructor(keyValueStore) {
3
- this.keyValueStore = keyValueStore;
4
- }
5
- async read(fileId) {
6
- const result = await this.keyValueStore.get(`FileManager/File/${fileId}/Metadata`);
7
- if (result.isFail()) {
8
- return undefined;
1
+ class MetadataReader {
2
+ constructor(keyValueStore){
3
+ this.keyValueStore = keyValueStore;
4
+ }
5
+ async read(fileId) {
6
+ const result = await this.keyValueStore.get(`FileManager/File/${fileId}/Metadata`);
7
+ if (result.isFail()) return;
8
+ return result.value;
9
9
  }
10
- return result.value;
11
- }
12
10
  }
11
+ export { MetadataReader };
13
12
 
14
13
  //# sourceMappingURL=MetadataReader.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["MetadataReader","constructor","keyValueStore","read","fileId","result","get","isFail","undefined","value"],"sources":["MetadataReader.ts"],"sourcesContent":["import { GlobalKeyValueStore } from \"@webiny/api-core/features/keyValueStore/index.js\";\n\ninterface AssetMetadata {\n id: string;\n tenant: string;\n size: number;\n contentType: string;\n bucketKey: string;\n}\n\nexport class MetadataReader {\n constructor(private keyValueStore: GlobalKeyValueStore.Interface) {}\n\n async read(fileId: string): Promise<AssetMetadata | undefined> {\n const result = await this.keyValueStore.get<AssetMetadata>(\n `FileManager/File/${fileId}/Metadata`\n );\n\n if (result.isFail()) {\n return undefined;\n }\n\n return result.value;\n }\n}\n"],"mappings":"AAUA,OAAO,MAAMA,cAAc,CAAC;EACxBC,WAAWA,CAASC,aAA4C,EAAE;IAAA,KAA9CA,aAA4C,GAA5CA,aAA4C;EAAG;EAEnE,MAAMC,IAAIA,CAACC,MAAc,EAAsC;IAC3D,MAAMC,MAAM,GAAG,MAAM,IAAI,CAACH,aAAa,CAACI,GAAG,CACvC,oBAAoBF,MAAM,WAC9B,CAAC;IAED,IAAIC,MAAM,CAACE,MAAM,CAAC,CAAC,EAAE;MACjB,OAAOC,SAAS;IACpB;IAEA,OAAOH,MAAM,CAACI,KAAK;EACvB;AACJ","ignoreList":[]}
1
+ {"version":3,"file":"features/WriteFileMetadata/MetadataReader.js","sources":["../../../src/features/WriteFileMetadata/MetadataReader.ts"],"sourcesContent":["import { GlobalKeyValueStore } from \"@webiny/api-core/features/keyValueStore/index.js\";\n\ninterface AssetMetadata {\n id: string;\n tenant: string;\n size: number;\n contentType: string;\n bucketKey: string;\n}\n\nexport class MetadataReader {\n constructor(private keyValueStore: GlobalKeyValueStore.Interface) {}\n\n async read(fileId: string): Promise<AssetMetadata | undefined> {\n const result = await this.keyValueStore.get<AssetMetadata>(\n `FileManager/File/${fileId}/Metadata`\n );\n\n if (result.isFail()) {\n return undefined;\n }\n\n return result.value;\n }\n}\n"],"names":["MetadataReader","keyValueStore","fileId","result"],"mappings":"AAUO,MAAMA;IACT,YAAoBC,aAA4C,CAAE;aAA9CA,aAAa,GAAbA;IAA+C;IAEnE,MAAM,KAAKC,MAAc,EAAsC;QAC3D,MAAMC,SAAS,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,CACvC,CAAC,iBAAiB,EAAED,OAAO,SAAS,CAAC;QAGzC,IAAIC,OAAO,MAAM,IACb;QAGJ,OAAOA,OAAO,KAAK;IACvB;AACJ"}
@@ -1,28 +1,26 @@
1
- export class MetadataWriter {
2
- constructor(tenantContext, keyValueStore) {
3
- this.tenantContext = tenantContext;
4
- this.keyValueStore = keyValueStore;
5
- }
6
- async write(files) {
7
- /**
8
- * We need to write each file with retry.
9
- */
10
- const writers = files.map(async file => {
11
- const metadata = this.getMetadata(file);
12
- await this.keyValueStore.set(`FileManager/File/${file.id}/Metadata`, metadata);
13
- });
14
- await Promise.all(writers);
15
- }
16
- getMetadata(file) {
17
- const tenant = this.tenantContext.getTenant();
18
- return {
19
- id: file.id,
20
- bucketKey: `tenants/${tenant.id}/files/${file.key}`,
21
- tenant: tenant.id,
22
- size: file.size,
23
- contentType: file.type
24
- };
25
- }
1
+ class MetadataWriter {
2
+ constructor(tenantContext, keyValueStore){
3
+ this.tenantContext = tenantContext;
4
+ this.keyValueStore = keyValueStore;
5
+ }
6
+ async write(files) {
7
+ const writers = files.map(async (file)=>{
8
+ const metadata = this.getMetadata(file);
9
+ await this.keyValueStore.set(`FileManager/File/${file.id}/Metadata`, metadata);
10
+ });
11
+ await Promise.all(writers);
12
+ }
13
+ getMetadata(file) {
14
+ const tenant = this.tenantContext.getTenant();
15
+ return {
16
+ id: file.id,
17
+ bucketKey: `tenants/${tenant.id}/files/${file.key}`,
18
+ tenant: tenant.id,
19
+ size: file.size,
20
+ contentType: file.type
21
+ };
22
+ }
26
23
  }
24
+ export { MetadataWriter };
27
25
 
28
26
  //# sourceMappingURL=MetadataWriter.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["MetadataWriter","constructor","tenantContext","keyValueStore","write","files","writers","map","file","metadata","getMetadata","set","id","Promise","all","tenant","getTenant","bucketKey","key","size","contentType","type"],"sources":["MetadataWriter.ts"],"sourcesContent":["import { TenantContext } from \"@webiny/api-core/features/tenancy/TenantContext/index.js\";\nimport type { File } from \"@webiny/api-file-manager/domain/file/types.js\";\nimport { GlobalKeyValueStore } from \"@webiny/api-core/features/keyValueStore/index.js\";\n\nexport class MetadataWriter {\n constructor(\n private tenantContext: TenantContext.Interface,\n private keyValueStore: GlobalKeyValueStore.Interface\n ) {}\n\n async write(files: File[]) {\n /**\n * We need to write each file with retry.\n */\n const writers = files.map(async file => {\n const metadata = this.getMetadata(file);\n await this.keyValueStore.set(`FileManager/File/${file.id}/Metadata`, metadata);\n });\n\n await Promise.all(writers);\n }\n\n private getMetadata(file: File) {\n const tenant = this.tenantContext.getTenant();\n return {\n id: file.id,\n bucketKey: `tenants/${tenant.id}/files/${file.key}`,\n tenant: tenant.id,\n size: file.size,\n contentType: file.type\n };\n }\n}\n"],"mappings":"AAIA,OAAO,MAAMA,cAAc,CAAC;EACxBC,WAAWA,CACCC,aAAsC,EACtCC,aAA4C,EACtD;IAAA,KAFUD,aAAsC,GAAtCA,aAAsC;IAAA,KACtCC,aAA4C,GAA5CA,aAA4C;EACrD;EAEH,MAAMC,KAAKA,CAACC,KAAa,EAAE;IACvB;AACR;AACA;IACQ,MAAMC,OAAO,GAAGD,KAAK,CAACE,GAAG,CAAC,MAAMC,IAAI,IAAI;MACpC,MAAMC,QAAQ,GAAG,IAAI,CAACC,WAAW,CAACF,IAAI,CAAC;MACvC,MAAM,IAAI,CAACL,aAAa,CAACQ,GAAG,CAAC,oBAAoBH,IAAI,CAACI,EAAE,WAAW,EAAEH,QAAQ,CAAC;IAClF,CAAC,CAAC;IAEF,MAAMI,OAAO,CAACC,GAAG,CAACR,OAAO,CAAC;EAC9B;EAEQI,WAAWA,CAACF,IAAU,EAAE;IAC5B,MAAMO,MAAM,GAAG,IAAI,CAACb,aAAa,CAACc,SAAS,CAAC,CAAC;IAC7C,OAAO;MACHJ,EAAE,EAAEJ,IAAI,CAACI,EAAE;MACXK,SAAS,EAAE,WAAWF,MAAM,CAACH,EAAE,UAAUJ,IAAI,CAACU,GAAG,EAAE;MACnDH,MAAM,EAAEA,MAAM,CAACH,EAAE;MACjBO,IAAI,EAAEX,IAAI,CAACW,IAAI;MACfC,WAAW,EAAEZ,IAAI,CAACa;IACtB,CAAC;EACL;AACJ","ignoreList":[]}
1
+ {"version":3,"file":"features/WriteFileMetadata/MetadataWriter.js","sources":["../../../src/features/WriteFileMetadata/MetadataWriter.ts"],"sourcesContent":["import { TenantContext } from \"@webiny/api-core/features/tenancy/TenantContext/index.js\";\nimport type { File } from \"@webiny/api-file-manager/domain/file/types.js\";\nimport { GlobalKeyValueStore } from \"@webiny/api-core/features/keyValueStore/index.js\";\n\nexport class MetadataWriter {\n constructor(\n private tenantContext: TenantContext.Interface,\n private keyValueStore: GlobalKeyValueStore.Interface\n ) {}\n\n async write(files: File[]) {\n /**\n * We need to write each file with retry.\n */\n const writers = files.map(async file => {\n const metadata = this.getMetadata(file);\n await this.keyValueStore.set(`FileManager/File/${file.id}/Metadata`, metadata);\n });\n\n await Promise.all(writers);\n }\n\n private getMetadata(file: File) {\n const tenant = this.tenantContext.getTenant();\n return {\n id: file.id,\n bucketKey: `tenants/${tenant.id}/files/${file.key}`,\n tenant: tenant.id,\n size: file.size,\n contentType: file.type\n };\n }\n}\n"],"names":["MetadataWriter","tenantContext","keyValueStore","files","writers","file","metadata","Promise","tenant"],"mappings":"AAIO,MAAMA;IACT,YACYC,aAAsC,EACtCC,aAA4C,CACtD;aAFUD,aAAa,GAAbA;aACAC,aAAa,GAAbA;IACT;IAEH,MAAM,MAAMC,KAAa,EAAE;QAIvB,MAAMC,UAAUD,MAAM,GAAG,CAAC,OAAME;YAC5B,MAAMC,WAAW,IAAI,CAAC,WAAW,CAACD;YAClC,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,iBAAiB,EAAEA,KAAK,EAAE,CAAC,SAAS,CAAC,EAAEC;QACzE;QAEA,MAAMC,QAAQ,GAAG,CAACH;IACtB;IAEQ,YAAYC,IAAU,EAAE;QAC5B,MAAMG,SAAS,IAAI,CAAC,aAAa,CAAC,SAAS;QAC3C,OAAO;YACH,IAAIH,KAAK,EAAE;YACX,WAAW,CAAC,QAAQ,EAAEG,OAAO,EAAE,CAAC,OAAO,EAAEH,KAAK,GAAG,EAAE;YACnD,QAAQG,OAAO,EAAE;YACjB,MAAMH,KAAK,IAAI;YACf,aAAaA,KAAK,IAAI;QAC1B;IACJ;AACJ"}
@@ -3,19 +3,21 @@ import { FileAfterBatchCreateEventHandler } from "@webiny/api-file-manager/featu
3
3
  import { MetadataWriter } from "./MetadataWriter.js";
4
4
  import { GlobalKeyValueStore } from "@webiny/api-core/features/keyValueStore/index.js";
5
5
  class WriteMetadataAfterBatchCreateHandlerImpl {
6
- constructor(tenantContext, keyValueStore) {
7
- this.metadataWriter = new MetadataWriter(tenantContext, keyValueStore);
8
- }
9
- async handle(event) {
10
- const {
11
- files
12
- } = event.payload;
13
- await this.metadataWriter.write(files);
14
- }
6
+ constructor(tenantContext, keyValueStore){
7
+ this.metadataWriter = new MetadataWriter(tenantContext, keyValueStore);
8
+ }
9
+ async handle(event) {
10
+ const { files } = event.payload;
11
+ await this.metadataWriter.write(files);
12
+ }
15
13
  }
16
- export const WriteMetadataAfterBatchCreateHandler = FileAfterBatchCreateEventHandler.createImplementation({
17
- implementation: WriteMetadataAfterBatchCreateHandlerImpl,
18
- dependencies: [TenantContext, GlobalKeyValueStore]
14
+ const WriteMetadataAfterBatchCreateHandler = FileAfterBatchCreateEventHandler.createImplementation({
15
+ implementation: WriteMetadataAfterBatchCreateHandlerImpl,
16
+ dependencies: [
17
+ TenantContext,
18
+ GlobalKeyValueStore
19
+ ]
19
20
  });
21
+ export { WriteMetadataAfterBatchCreateHandler };
20
22
 
21
23
  //# sourceMappingURL=WriteMetadataAfterBatchCreateHandler.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["TenantContext","FileAfterBatchCreateEventHandler","MetadataWriter","GlobalKeyValueStore","WriteMetadataAfterBatchCreateHandlerImpl","constructor","tenantContext","keyValueStore","metadataWriter","handle","event","files","payload","write","WriteMetadataAfterBatchCreateHandler","createImplementation","implementation","dependencies"],"sources":["WriteMetadataAfterBatchCreateHandler.ts"],"sourcesContent":["import { TenantContext } from \"@webiny/api-core/features/tenancy/TenantContext/index.js\";\nimport { FileAfterBatchCreateEventHandler } from \"@webiny/api-file-manager/features/file/CreateFilesInBatch/events.js\";\nimport { MetadataWriter } from \"./MetadataWriter.js\";\nimport { GlobalKeyValueStore } from \"@webiny/api-core/features/keyValueStore/index.js\";\n\nclass WriteMetadataAfterBatchCreateHandlerImpl\n implements FileAfterBatchCreateEventHandler.Interface\n{\n private readonly metadataWriter: MetadataWriter;\n\n constructor(\n tenantContext: TenantContext.Interface,\n keyValueStore: GlobalKeyValueStore.Interface\n ) {\n this.metadataWriter = new MetadataWriter(tenantContext, keyValueStore);\n }\n\n async handle(event: FileAfterBatchCreateEventHandler.Event): Promise<void> {\n const { files } = event.payload;\n await this.metadataWriter.write(files);\n }\n}\n\nexport const WriteMetadataAfterBatchCreateHandler =\n FileAfterBatchCreateEventHandler.createImplementation({\n implementation: WriteMetadataAfterBatchCreateHandlerImpl,\n dependencies: [TenantContext, GlobalKeyValueStore]\n });\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ,0DAA0D;AACxF,SAASC,gCAAgC,QAAQ,qEAAqE;AACtH,SAASC,cAAc;AACvB,SAASC,mBAAmB,QAAQ,kDAAkD;AAEtF,MAAMC,wCAAwC,CAE9C;EAGIC,WAAWA,CACPC,aAAsC,EACtCC,aAA4C,EAC9C;IACE,IAAI,CAACC,cAAc,GAAG,IAAIN,cAAc,CAACI,aAAa,EAAEC,aAAa,CAAC;EAC1E;EAEA,MAAME,MAAMA,CAACC,KAA6C,EAAiB;IACvE,MAAM;MAAEC;IAAM,CAAC,GAAGD,KAAK,CAACE,OAAO;IAC/B,MAAM,IAAI,CAACJ,cAAc,CAACK,KAAK,CAACF,KAAK,CAAC;EAC1C;AACJ;AAEA,OAAO,MAAMG,oCAAoC,GAC7Cb,gCAAgC,CAACc,oBAAoB,CAAC;EAClDC,cAAc,EAAEZ,wCAAwC;EACxDa,YAAY,EAAE,CAACjB,aAAa,EAAEG,mBAAmB;AACrD,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"features/WriteFileMetadata/WriteMetadataAfterBatchCreateHandler.js","sources":["../../../src/features/WriteFileMetadata/WriteMetadataAfterBatchCreateHandler.ts"],"sourcesContent":["import { TenantContext } from \"@webiny/api-core/features/tenancy/TenantContext/index.js\";\nimport { FileAfterBatchCreateEventHandler } from \"@webiny/api-file-manager/features/file/CreateFilesInBatch/events.js\";\nimport { MetadataWriter } from \"./MetadataWriter.js\";\nimport { GlobalKeyValueStore } from \"@webiny/api-core/features/keyValueStore/index.js\";\n\nclass WriteMetadataAfterBatchCreateHandlerImpl\n implements FileAfterBatchCreateEventHandler.Interface\n{\n private readonly metadataWriter: MetadataWriter;\n\n constructor(\n tenantContext: TenantContext.Interface,\n keyValueStore: GlobalKeyValueStore.Interface\n ) {\n this.metadataWriter = new MetadataWriter(tenantContext, keyValueStore);\n }\n\n async handle(event: FileAfterBatchCreateEventHandler.Event): Promise<void> {\n const { files } = event.payload;\n await this.metadataWriter.write(files);\n }\n}\n\nexport const WriteMetadataAfterBatchCreateHandler =\n FileAfterBatchCreateEventHandler.createImplementation({\n implementation: WriteMetadataAfterBatchCreateHandlerImpl,\n dependencies: [TenantContext, GlobalKeyValueStore]\n });\n"],"names":["WriteMetadataAfterBatchCreateHandlerImpl","tenantContext","keyValueStore","MetadataWriter","event","files","WriteMetadataAfterBatchCreateHandler","FileAfterBatchCreateEventHandler","TenantContext","GlobalKeyValueStore"],"mappings":";;;;AAKA,MAAMA;IAKF,YACIC,aAAsC,EACtCC,aAA4C,CAC9C;QACE,IAAI,CAAC,cAAc,GAAG,IAAIC,eAAeF,eAAeC;IAC5D;IAEA,MAAM,OAAOE,KAA6C,EAAiB;QACvE,MAAM,EAAEC,KAAK,EAAE,GAAGD,MAAM,OAAO;QAC/B,MAAM,IAAI,CAAC,cAAc,CAAC,KAAK,CAACC;IACpC;AACJ;AAEO,MAAMC,uCACTC,iCAAiC,oBAAoB,CAAC;IAClD,gBAAgBP;IAChB,cAAc;QAACQ;QAAeC;KAAoB;AACtD"}
@@ -3,19 +3,23 @@ import { MetadataWriter } from "./MetadataWriter.js";
3
3
  import { TenantContext } from "@webiny/api-core/features/tenancy/TenantContext/index.js";
4
4
  import { GlobalKeyValueStore } from "@webiny/api-core/features/keyValueStore/index.js";
5
5
  class WriteMetadataAfterCreateHandlerImpl {
6
- constructor(tenantContext, keyValueStore) {
7
- this.metadataWriter = new MetadataWriter(tenantContext, keyValueStore);
8
- }
9
- async handle(event) {
10
- const {
11
- file
12
- } = event.payload;
13
- await this.metadataWriter.write([file]);
14
- }
6
+ constructor(tenantContext, keyValueStore){
7
+ this.metadataWriter = new MetadataWriter(tenantContext, keyValueStore);
8
+ }
9
+ async handle(event) {
10
+ const { file } = event.payload;
11
+ await this.metadataWriter.write([
12
+ file
13
+ ]);
14
+ }
15
15
  }
16
- export const WriteMetadataAfterCreateHandler = FileAfterCreateEventHandler.createImplementation({
17
- implementation: WriteMetadataAfterCreateHandlerImpl,
18
- dependencies: [TenantContext, GlobalKeyValueStore]
16
+ const WriteMetadataAfterCreateHandler = FileAfterCreateEventHandler.createImplementation({
17
+ implementation: WriteMetadataAfterCreateHandlerImpl,
18
+ dependencies: [
19
+ TenantContext,
20
+ GlobalKeyValueStore
21
+ ]
19
22
  });
23
+ export { WriteMetadataAfterCreateHandler };
20
24
 
21
25
  //# sourceMappingURL=WriteMetadataAfterCreateHandler.js.map