@webiny/api-file-manager-s3 0.0.0-unstable.496cf268ac → 0.0.0-unstable.5387e5f7c8
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.
- package/FileManagerS3Feature.d.ts +9 -0
- package/FileManagerS3Feature.js +27 -0
- package/FileManagerS3Feature.js.map +1 -0
- package/README.md +11 -1
- package/assetDelivery/abstractions.d.ts +11 -0
- package/assetDelivery/abstractions.js +7 -0
- package/assetDelivery/abstractions.js.map +1 -0
- package/assetDelivery/assetDeliveryConfig.d.ts +2 -0
- package/assetDelivery/assetDeliveryConfig.js +13 -0
- package/assetDelivery/assetDeliveryConfig.js.map +1 -0
- package/assetDelivery/createAssetDelivery.d.ts +3 -0
- package/assetDelivery/createAssetDelivery.js +9 -0
- package/assetDelivery/createAssetDelivery.js.map +1 -0
- package/assetDelivery/feature.d.ts +5 -0
- package/assetDelivery/feature.js +36 -0
- package/assetDelivery/feature.js.map +1 -0
- package/assetDelivery/index.d.ts +8 -0
- package/assetDelivery/index.js +8 -0
- package/assetDelivery/s3/LazySharpTransform.d.ts +34 -0
- package/assetDelivery/s3/LazySharpTransform.js +34 -0
- package/assetDelivery/s3/LazySharpTransform.js.map +1 -0
- package/assetDelivery/s3/S3AssetResolver.d.ts +14 -0
- package/assetDelivery/s3/S3AssetResolver.js +39 -0
- package/assetDelivery/s3/S3AssetResolver.js.map +1 -0
- package/assetDelivery/s3/S3ContentsReader.d.ts +8 -0
- package/assetDelivery/s3/S3ContentsReader.js +17 -0
- package/assetDelivery/s3/S3ContentsReader.js.map +1 -0
- package/assetDelivery/s3/S3ErrorAssetReply.d.ts +4 -0
- package/assetDelivery/s3/S3ErrorAssetReply.js +14 -0
- package/assetDelivery/s3/S3ErrorAssetReply.js.map +1 -0
- package/assetDelivery/s3/S3OutputStrategy.d.ts +15 -0
- package/assetDelivery/s3/S3OutputStrategy.js +40 -0
- package/assetDelivery/s3/S3OutputStrategy.js.map +1 -0
- package/assetDelivery/s3/S3RedirectAssetReply.d.ts +4 -0
- package/assetDelivery/s3/S3RedirectAssetReply.js +17 -0
- package/assetDelivery/s3/S3RedirectAssetReply.js.map +1 -0
- package/assetDelivery/s3/S3StreamAssetReply.d.ts +5 -0
- package/assetDelivery/s3/S3StreamAssetReply.js +17 -0
- package/assetDelivery/s3/S3StreamAssetReply.js.map +1 -0
- package/assetDelivery/s3/SharpTransform.d.ts +26 -0
- package/assetDelivery/s3/SharpTransform.js +173 -0
- package/assetDelivery/s3/SharpTransform.js.map +1 -0
- package/assetDelivery/s3/transformation/AssetKeyGenerator.d.ts +8 -0
- package/assetDelivery/s3/transformation/AssetKeyGenerator.js +21 -0
- package/assetDelivery/s3/transformation/AssetKeyGenerator.js.map +1 -0
- package/assetDelivery/s3/transformation/CallableContentsReader.d.ts +10 -0
- package/assetDelivery/s3/transformation/CallableContentsReader.js +11 -0
- package/assetDelivery/s3/transformation/CallableContentsReader.js.map +1 -0
- package/assetDelivery/s3/transformation/WidthCollection.d.ts +7 -0
- package/assetDelivery/s3/transformation/WidthCollection.js +19 -0
- package/assetDelivery/s3/transformation/WidthCollection.js.map +1 -0
- package/assetDelivery/s3/transformation/utils.d.ts +9 -0
- package/assetDelivery/s3/transformation/utils.js +31 -0
- package/assetDelivery/s3/transformation/utils.js.map +1 -0
- package/assetDelivery/threatDetection/ObjectKey.d.ts +7 -0
- package/assetDelivery/threatDetection/ObjectKey.js +18 -0
- package/assetDelivery/threatDetection/ObjectKey.js.map +1 -0
- package/assetDelivery/threatDetection/createThreatDetectionEventHandler.d.ts +22 -0
- package/assetDelivery/threatDetection/createThreatDetectionEventHandler.js +53 -0
- package/assetDelivery/threatDetection/createThreatDetectionEventHandler.js.map +1 -0
- package/assetDelivery/threatDetection/createThreatDetectionPluginLoader.d.ts +2 -0
- package/assetDelivery/threatDetection/createThreatDetectionPluginLoader.js +5 -0
- package/assetDelivery/threatDetection/createThreatDetectionPluginLoader.js.map +1 -0
- package/assetDelivery/threatDetection/index.d.ts +2 -0
- package/assetDelivery/threatDetection/index.js +2 -0
- package/assetDelivery/threatDetection/processThreatScanResult.d.ts +3 -0
- package/assetDelivery/threatDetection/processThreatScanResult.js +61 -0
- package/assetDelivery/threatDetection/processThreatScanResult.js.map +1 -0
- package/assetDelivery/threatDetection/types.d.ts +9 -0
- package/assetDelivery/threatDetection/types.js +0 -0
- package/assetDelivery/types.d.ts +13 -0
- package/assetDelivery/types.js +0 -0
- package/enterprise/ApplyThreatScanning/CreateFileWithThreatScanDecorator.d.ts +13 -0
- package/enterprise/ApplyThreatScanning/CreateFileWithThreatScanDecorator.js +28 -0
- package/enterprise/ApplyThreatScanning/CreateFileWithThreatScanDecorator.js.map +1 -0
- package/enterprise/ApplyThreatScanning/feature.d.ts +4 -0
- package/enterprise/ApplyThreatScanning/feature.js +11 -0
- package/enterprise/ApplyThreatScanning/feature.js.map +1 -0
- package/features/DeleteFileFromBucket/DeleteFileFromBucketHandler.d.ts +15 -0
- package/features/DeleteFileFromBucket/DeleteFileFromBucketHandler.js +35 -0
- package/features/DeleteFileFromBucket/DeleteFileFromBucketHandler.js.map +1 -0
- package/features/DeleteFileFromBucket/DeleteS3FolderTask.d.ts +37 -0
- package/features/DeleteFileFromBucket/DeleteS3FolderTask.js +57 -0
- package/features/DeleteFileFromBucket/DeleteS3FolderTask.js.map +1 -0
- package/features/DeleteFileFromBucket/feature.d.ts +4 -0
- package/features/DeleteFileFromBucket/feature.js +13 -0
- package/features/DeleteFileFromBucket/feature.js.map +1 -0
- package/features/ExtractMetadata/ExtractMetadataHandler.d.ts +11 -0
- package/features/ExtractMetadata/ExtractMetadataHandler.js +25 -0
- package/features/ExtractMetadata/ExtractMetadataHandler.js.map +1 -0
- package/features/ExtractMetadata/ExtractMetadataTask.d.ts +29 -0
- package/features/ExtractMetadata/ExtractMetadataTask.js +99 -0
- package/features/ExtractMetadata/ExtractMetadataTask.js.map +1 -0
- package/features/ExtractMetadata/feature.d.ts +4 -0
- package/features/ExtractMetadata/feature.js +13 -0
- package/features/ExtractMetadata/feature.js.map +1 -0
- package/features/FlushCache/FlushCacheOnFileDeleteHandler.d.ts +12 -0
- package/features/FlushCache/FlushCacheOnFileDeleteHandler.js +28 -0
- package/features/FlushCache/FlushCacheOnFileDeleteHandler.js.map +1 -0
- package/features/FlushCache/FlushCacheOnFileUpdateHandler.d.ts +12 -0
- package/features/FlushCache/FlushCacheOnFileUpdateHandler.js +31 -0
- package/features/FlushCache/FlushCacheOnFileUpdateHandler.js.map +1 -0
- package/features/FlushCache/InvalidateCacheTask.d.ts +31 -0
- package/features/FlushCache/InvalidateCacheTask.js +84 -0
- package/features/FlushCache/InvalidateCacheTask.js.map +1 -0
- package/features/FlushCache/feature.d.ts +4 -0
- package/features/FlushCache/feature.js +15 -0
- package/features/FlushCache/feature.js.map +1 -0
- package/features/GetFileContentsById/GetFileContentsByIdUseCase.d.ts +13 -0
- package/features/GetFileContentsById/GetFileContentsByIdUseCase.js +40 -0
- package/features/GetFileContentsById/GetFileContentsByIdUseCase.js.map +1 -0
- package/features/GetFileContentsById/feature.d.ts +4 -0
- package/features/GetFileContentsById/feature.js +11 -0
- package/features/GetFileContentsById/feature.js.map +1 -0
- package/features/GetFileContentsByKey/GetFileContentsByKeyUseCase.d.ts +13 -0
- package/features/GetFileContentsByKey/GetFileContentsByKeyUseCase.js +40 -0
- package/features/GetFileContentsByKey/GetFileContentsByKeyUseCase.js.map +1 -0
- package/features/GetFileContentsByKey/feature.d.ts +4 -0
- package/features/GetFileContentsByKey/feature.js +11 -0
- package/features/GetFileContentsByKey/feature.js.map +1 -0
- package/features/WriteFileMetadata/MetadataReader.d.ts +14 -0
- package/features/WriteFileMetadata/MetadataReader.js +13 -0
- package/features/WriteFileMetadata/MetadataReader.js.map +1 -0
- package/features/WriteFileMetadata/MetadataWriter.d.ts +10 -0
- package/features/WriteFileMetadata/MetadataWriter.js +28 -0
- package/features/WriteFileMetadata/MetadataWriter.js.map +1 -0
- package/features/WriteFileMetadata/WriteMetadataAfterBatchCreateHandler.d.ts +12 -0
- package/features/WriteFileMetadata/WriteMetadataAfterBatchCreateHandler.js +23 -0
- package/features/WriteFileMetadata/WriteMetadataAfterBatchCreateHandler.js.map +1 -0
- package/features/WriteFileMetadata/WriteMetadataAfterCreateHandler.d.ts +12 -0
- package/features/WriteFileMetadata/WriteMetadataAfterCreateHandler.js +25 -0
- package/features/WriteFileMetadata/WriteMetadataAfterCreateHandler.js.map +1 -0
- package/features/WriteFileMetadata/feature.d.ts +4 -0
- package/features/WriteFileMetadata/feature.js +13 -0
- package/features/WriteFileMetadata/feature.js.map +1 -0
- package/graphql/S3GraphQLSchema.d.ts +10 -0
- package/graphql/S3GraphQLSchema.js +233 -0
- package/graphql/S3GraphQLSchema.js.map +1 -0
- package/graphql/checkPermissions.d.ts +5 -0
- package/graphql/checkPermissions.js +22 -0
- package/graphql/checkPermissions.js.map +1 -0
- package/index.d.ts +4 -2
- package/index.js +3 -11
- package/multiPartUpload/CompleteMultiPartUploadUseCase.d.ts +15 -0
- package/multiPartUpload/CompleteMultiPartUploadUseCase.js +55 -0
- package/multiPartUpload/CompleteMultiPartUploadUseCase.js.map +1 -0
- package/multiPartUpload/CreateMultiPartUploadUseCase.d.ts +20 -0
- package/multiPartUpload/CreateMultiPartUploadUseCase.js +34 -0
- package/multiPartUpload/CreateMultiPartUploadUseCase.js.map +1 -0
- package/package.json +37 -26
- package/types.d.ts +11 -9
- package/types.js +1 -5
- package/utils/CdnPathsGenerator.d.ts +3 -0
- package/utils/CdnPathsGenerator.js +11 -0
- package/utils/CdnPathsGenerator.js.map +1 -0
- package/utils/FileExtension.d.ts +6 -0
- package/utils/FileExtension.js +16 -0
- package/utils/FileExtension.js.map +1 -0
- package/utils/FileKey.d.ts +11 -0
- package/utils/FileKey.js +33 -0
- package/utils/FileKey.js.map +1 -0
- package/utils/FileKey.test.d.ts +1 -0
- package/utils/FileKey.test.js +59 -0
- package/utils/FileKey.test.js.map +1 -0
- package/utils/FileNormalizer.d.ts +18 -0
- package/utils/FileNormalizer.js +41 -0
- package/utils/FileNormalizer.js.map +1 -0
- package/utils/FileUploadModifier.d.ts +36 -0
- package/utils/FileUploadModifier.js +41 -0
- package/utils/FileUploadModifier.js.map +1 -0
- package/utils/createFileNormalizerFromContext.d.ts +3 -0
- package/utils/createFileNormalizerFromContext.js +9 -0
- package/utils/createFileNormalizerFromContext.js.map +1 -0
- package/utils/getPresignedPostPayload.d.ts +4 -3
- package/utils/getPresignedPostPayload.js +40 -80
- package/utils/getPresignedPostPayload.js.map +1 -1
- package/utils/mimeTypes.js +8 -19
- package/utils/mimeTypes.js.map +1 -1
- package/utils/uploadFileToS3.d.ts +2 -4
- package/utils/uploadFileToS3.js +13 -23
- package/utils/uploadFileToS3.js.map +1 -1
- package/index.js.map +0 -1
- package/plugins/checkBasePermissions.d.ts +0 -5
- package/plugins/checkBasePermissions.js +0 -24
- package/plugins/checkBasePermissions.js.map +0 -1
- package/plugins/checkPermission.d.ts +0 -4
- package/plugins/checkPermission.js +0 -25
- package/plugins/checkPermission.js.map +0 -1
- package/plugins/fileStorageS3.d.ts +0 -3
- package/plugins/fileStorageS3.js +0 -55
- package/plugins/fileStorageS3.js.map +0 -1
- package/plugins/graphqlFileStorageS3.d.ts +0 -4
- package/plugins/graphqlFileStorageS3.js +0 -108
- package/plugins/graphqlFileStorageS3.js.map +0 -1
- package/types.js.map +0 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type Container } from "@webiny/feature/api";
|
|
2
|
+
import type { AssetDeliveryParams } from "./assetDelivery/types.js";
|
|
3
|
+
export interface FileManagerS3FeatureConfig {
|
|
4
|
+
assetDelivery?: AssetDeliveryParams;
|
|
5
|
+
}
|
|
6
|
+
export declare const FileManagerS3Feature: {
|
|
7
|
+
name: string;
|
|
8
|
+
register(container: Container, context?: FileManagerS3FeatureConfig | undefined): void;
|
|
9
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { createFeature } from "@webiny/feature/api";
|
|
2
|
+
import { S3GraphQLSchema } from "./graphql/S3GraphQLSchema.js";
|
|
3
|
+
import { DeleteFileFromBucketFeature } from "./features/DeleteFileFromBucket/feature.js";
|
|
4
|
+
import { WriteFileMetadataFeature } from "./features/WriteFileMetadata/feature.js";
|
|
5
|
+
import { ApplyThreatScanningFeature } from "./enterprise/ApplyThreatScanning/feature.js";
|
|
6
|
+
import { FlushCacheFeature } from "./features/FlushCache/feature.js";
|
|
7
|
+
import { ExtractMetadataFeature } from "./features/ExtractMetadata/feature.js";
|
|
8
|
+
import { GetFileContentsByIdFeature } from "./features/GetFileContentsById/feature.js";
|
|
9
|
+
import { GetFileContentsByKeyFeature } from "./features/GetFileContentsByKey/feature.js";
|
|
10
|
+
import { createS3AssetDeliveryFeature } from "./assetDelivery/feature.js";
|
|
11
|
+
const FileManagerS3Feature = createFeature({
|
|
12
|
+
name: "FileManagerS3",
|
|
13
|
+
register (container, config = {}) {
|
|
14
|
+
createS3AssetDeliveryFeature(config.assetDelivery).register(container);
|
|
15
|
+
FlushCacheFeature.register(container);
|
|
16
|
+
DeleteFileFromBucketFeature.register(container);
|
|
17
|
+
ExtractMetadataFeature.register(container);
|
|
18
|
+
WriteFileMetadataFeature.register(container);
|
|
19
|
+
GetFileContentsByIdFeature.register(container);
|
|
20
|
+
GetFileContentsByKeyFeature.register(container);
|
|
21
|
+
container.register(S3GraphQLSchema);
|
|
22
|
+
ApplyThreatScanningFeature.register(container);
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
export { FileManagerS3Feature };
|
|
26
|
+
|
|
27
|
+
//# sourceMappingURL=FileManagerS3Feature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FileManagerS3Feature.js","sources":["../src/FileManagerS3Feature.ts"],"sourcesContent":["import { type Container, createFeature } from \"@webiny/feature/api\";\nimport { S3GraphQLSchema } from \"./graphql/S3GraphQLSchema.js\";\nimport { DeleteFileFromBucketFeature } from \"~/features/DeleteFileFromBucket/feature.js\";\nimport { WriteFileMetadataFeature } from \"~/features/WriteFileMetadata/feature.js\";\nimport { ApplyThreatScanningFeature } from \"~/enterprise/ApplyThreatScanning/feature.js\";\nimport { FlushCacheFeature } from \"~/features/FlushCache/feature.js\";\nimport { ExtractMetadataFeature } from \"~/features/ExtractMetadata/feature.js\";\nimport { GetFileContentsByIdFeature } from \"~/features/GetFileContentsById/feature.js\";\nimport { GetFileContentsByKeyFeature } from \"~/features/GetFileContentsByKey/feature.js\";\nimport { createS3AssetDeliveryFeature } from \"./assetDelivery/feature.js\";\nimport type { AssetDeliveryParams } from \"./assetDelivery/types.js\";\n\nexport interface FileManagerS3FeatureConfig {\n assetDelivery?: AssetDeliveryParams;\n}\n\nexport const FileManagerS3Feature = createFeature({\n name: \"FileManagerS3\",\n register(container: Container, config: FileManagerS3FeatureConfig = {}) {\n // Register S3-specific asset delivery implementations (S3AssetResolver, S3OutputStrategy).\n // These replace the null implementations from AssetDeliveryFeature in FileManagerAppFeature.\n createS3AssetDeliveryFeature(config.assetDelivery).register(container);\n\n // S3 file-operation features.\n FlushCacheFeature.register(container);\n DeleteFileFromBucketFeature.register(container);\n ExtractMetadataFeature.register(container);\n WriteFileMetadataFeature.register(container);\n GetFileContentsByIdFeature.register(container);\n GetFileContentsByKeyFeature.register(container);\n\n // Static S3 GraphQL schema (extends FmQuery/FmMutation) — a DI-native\n // CoreGraphQLSchemaFactory contributor (declares its resolver dependencies).\n container.register(S3GraphQLSchema);\n\n // Threat scanning is WCP-gated, but the license is per-request (loaded post-register). Register\n // unconditionally; CreateFileWithThreatScanDecorator + the GuardDuty event handler both guard\n // on canUseFileManagerThreatDetection() at request time and no-op/pass-through when unlicensed.\n ApplyThreatScanningFeature.register(container);\n }\n});\n"],"names":["FileManagerS3Feature","createFeature","container","config","createS3AssetDeliveryFeature","FlushCacheFeature","DeleteFileFromBucketFeature","ExtractMetadataFeature","WriteFileMetadataFeature","GetFileContentsByIdFeature","GetFileContentsByKeyFeature","S3GraphQLSchema","ApplyThreatScanningFeature"],"mappings":";;;;;;;;;;AAgBO,MAAMA,uBAAuBC,cAAc;IAC9C,MAAM;IACN,UAASC,SAAoB,EAAEC,SAAqC,CAAC,CAAC;QAGlEC,6BAA6BD,OAAO,aAAa,EAAE,QAAQ,CAACD;QAG5DG,kBAAkB,QAAQ,CAACH;QAC3BI,4BAA4B,QAAQ,CAACJ;QACrCK,uBAAuB,QAAQ,CAACL;QAChCM,yBAAyB,QAAQ,CAACN;QAClCO,2BAA2B,QAAQ,CAACP;QACpCQ,4BAA4B,QAAQ,CAACR;QAIrCA,UAAU,QAAQ,CAACS;QAKnBC,2BAA2B,QAAQ,CAACV;IACxC;AACJ"}
|
package/README.md
CHANGED
|
@@ -1 +1,11 @@
|
|
|
1
|
-
# @webiny/api-file-manager-s3
|
|
1
|
+
# @webiny/api-file-manager-s3
|
|
2
|
+
|
|
3
|
+
> [!NOTE]
|
|
4
|
+
> This package is part of the [Webiny](https://www.webiny.com) monorepo.
|
|
5
|
+
> It’s **included in every Webiny project by default** and is not meant to be used as a standalone package.
|
|
6
|
+
|
|
7
|
+
📘 **Documentation:** [https://www.webiny.com/docs](https://www.webiny.com/docs)
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
_This README file is automatically generated during the publish process._
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { S3 } from "@webiny/aws-sdk/client-s3/index.js";
|
|
2
|
+
import type { ImageFormat } from "@webiny/api-file-manager/features/assetDelivery/transformation/index.js";
|
|
3
|
+
export interface IS3AssetDeliveryConfig {
|
|
4
|
+
presignedUrlTtl: number;
|
|
5
|
+
imageResizeWidths: number[];
|
|
6
|
+
imageQuality?: Partial<Record<ImageFormat, number>>;
|
|
7
|
+
assetStreamingMaxSize: number;
|
|
8
|
+
}
|
|
9
|
+
export declare const S3AssetDeliveryConfig: import("@webiny/di").Abstraction<IS3AssetDeliveryConfig>;
|
|
10
|
+
export declare const S3Client: import("@webiny/di").Abstraction<S3>;
|
|
11
|
+
export declare const S3Bucket: import("@webiny/di").Abstraction<string>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createAbstraction } from "@webiny/feature/api";
|
|
2
|
+
const S3AssetDeliveryConfig = createAbstraction("AssetDelivery/S3Config");
|
|
3
|
+
const S3Client = createAbstraction("AssetDelivery/S3Client");
|
|
4
|
+
const S3Bucket = createAbstraction("AssetDelivery/S3Bucket");
|
|
5
|
+
export { S3AssetDeliveryConfig, S3Bucket, S3Client };
|
|
6
|
+
|
|
7
|
+
//# sourceMappingURL=abstractions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assetDelivery/abstractions.js","sources":["../../src/assetDelivery/abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { S3 } from \"@webiny/aws-sdk/client-s3/index.js\";\nimport type { ImageFormat } from \"@webiny/api-file-manager/features/assetDelivery/transformation/index.js\";\n\nexport interface IS3AssetDeliveryConfig {\n presignedUrlTtl: number;\n imageResizeWidths: number[];\n imageQuality?: Partial<Record<ImageFormat, number>>;\n assetStreamingMaxSize: number;\n}\n\nexport const S3AssetDeliveryConfig =\n createAbstraction<IS3AssetDeliveryConfig>(\"AssetDelivery/S3Config\");\n\nexport const S3Client = createAbstraction<S3>(\"AssetDelivery/S3Client\");\n\nexport const S3Bucket = createAbstraction<string>(\"AssetDelivery/S3Bucket\");\n"],"names":["S3AssetDeliveryConfig","createAbstraction","S3Client","S3Bucket"],"mappings":";AAWO,MAAMA,wBACTC,kBAA0C;AAEvC,MAAMC,WAAWD,kBAAsB;AAEvC,MAAME,WAAWF,kBAA0B"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { createRegisterExtensionPlugin } from "@webiny/handler";
|
|
2
|
+
import { createS3AssetDeliveryFeature } from "./feature.js";
|
|
3
|
+
const assetDeliveryConfig = (params)=>{
|
|
4
|
+
const feature = createS3AssetDeliveryFeature(params);
|
|
5
|
+
return [
|
|
6
|
+
createRegisterExtensionPlugin((context)=>{
|
|
7
|
+
feature.register(context.container);
|
|
8
|
+
})
|
|
9
|
+
];
|
|
10
|
+
};
|
|
11
|
+
export { assetDeliveryConfig };
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=assetDeliveryConfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assetDelivery/assetDeliveryConfig.js","sources":["../../src/assetDelivery/assetDeliveryConfig.ts"],"sourcesContent":["import { createRegisterExtensionPlugin } from \"@webiny/handler\";\nimport type { AssetDeliveryParams } from \"~/assetDelivery/types.js\";\nimport { createS3AssetDeliveryFeature } from \"~/assetDelivery/feature.js\";\n\nexport const assetDeliveryConfig = (params: AssetDeliveryParams) => {\n const feature = createS3AssetDeliveryFeature(params);\n\n return [\n createRegisterExtensionPlugin(context => {\n feature.register(context.container);\n })\n ];\n};\n"],"names":["assetDeliveryConfig","params","feature","createS3AssetDeliveryFeature","createRegisterExtensionPlugin","context"],"mappings":";;AAIO,MAAMA,sBAAsB,CAACC;IAChC,MAAMC,UAAUC,6BAA6BF;IAE7C,OAAO;QACHG,8BAA8BC,CAAAA;YAC1BH,QAAQ,QAAQ,CAACG,QAAQ,SAAS;QACtC;KACH;AACL"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { createAssetDeliveryPluginLoader } from "@webiny/api-file-manager";
|
|
2
|
+
import { createThreatDetectionPluginLoader } from "./threatDetection/index.js";
|
|
3
|
+
const createAssetDelivery = (params = {})=>[
|
|
4
|
+
createAssetDeliveryPluginLoader(()=>import("./assetDeliveryConfig.js").then(({ assetDeliveryConfig })=>assetDeliveryConfig(params))),
|
|
5
|
+
createThreatDetectionPluginLoader(()=>import("./threatDetection/createThreatDetectionEventHandler.js").then(({ createThreatDetectionEventHandler })=>createThreatDetectionEventHandler()))
|
|
6
|
+
];
|
|
7
|
+
export { createAssetDelivery };
|
|
8
|
+
|
|
9
|
+
//# sourceMappingURL=createAssetDelivery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assetDelivery/createAssetDelivery.js","sources":["../../src/assetDelivery/createAssetDelivery.ts"],"sourcesContent":["import { createAssetDeliveryPluginLoader } from \"@webiny/api-file-manager\";\nimport type { PluginFactory } from \"@webiny/plugins/types.js\";\nimport { createThreatDetectionPluginLoader } from \"~/assetDelivery/threatDetection/index.js\";\nimport type { AssetDeliveryParams } from \"~/assetDelivery/types.js\";\n\nexport const createAssetDelivery = (params: AssetDeliveryParams = {}): PluginFactory[] => {\n return [\n /**\n * We only want to load this plugin in the context of the Asset Delivery Lambda function.\n */\n createAssetDeliveryPluginLoader(() => {\n return import(\n /* webpackChunkName: \"s3AssetDelivery\" */ \"./assetDeliveryConfig.js\"\n ).then(({ assetDeliveryConfig }) => assetDeliveryConfig(params));\n }),\n /**\n * We only want to load this plugin in the context of the Threat Detection Lambda function.\n */\n createThreatDetectionPluginLoader(() => {\n return import(\n /* webpackChunkName: \"threatDetectionEventHandler\" */ \"./threatDetection/createThreatDetectionEventHandler.js\"\n ).then(({ createThreatDetectionEventHandler }) => createThreatDetectionEventHandler());\n })\n ];\n};\n"],"names":["createAssetDelivery","params","createAssetDeliveryPluginLoader","assetDeliveryConfig","createThreatDetectionPluginLoader","createThreatDetectionEventHandler"],"mappings":";;AAKO,MAAMA,sBAAsB,CAACC,SAA8B,CAAC,CAAC,GACzD;QAIHC,gCAAgC,IACrB,MAAM,CAAN,4BAEL,IAAI,CAAC,CAAC,EAAEC,mBAAmB,EAAE,GAAKA,oBAAoBF;QAK5DG,kCAAkC,IACvB,MAAM,CAAN,0DAEL,IAAI,CAAC,CAAC,EAAEC,iCAAiC,EAAE,GAAKA;KAEzD"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { createFeature } from "@webiny/feature/api";
|
|
2
|
+
import { createS3 } from "@webiny/aws-sdk/client-s3/index.js";
|
|
3
|
+
import { S3AssetDeliveryConfig, S3Bucket, S3Client } from "./abstractions.js";
|
|
4
|
+
import { S3AssetResolverImpl } from "./s3/S3AssetResolver.js";
|
|
5
|
+
import { S3OutputStrategyImpl } from "./s3/S3OutputStrategy.js";
|
|
6
|
+
import { LazySharpTransformImpl } from "./s3/LazySharpTransform.js";
|
|
7
|
+
const createS3AssetDeliveryFeature = (params = {})=>createFeature({
|
|
8
|
+
name: "AssetDelivery/S3",
|
|
9
|
+
register (container) {
|
|
10
|
+
container.registerFactory(S3Client, ()=>createS3());
|
|
11
|
+
container.registerInstance(S3Bucket, process.env.S3_BUCKET);
|
|
12
|
+
container.registerInstance(S3AssetDeliveryConfig, {
|
|
13
|
+
presignedUrlTtl: params.presignedUrlTtl ?? 3600,
|
|
14
|
+
imageResizeWidths: params.imageResizeWidths ?? [
|
|
15
|
+
128,
|
|
16
|
+
384,
|
|
17
|
+
640,
|
|
18
|
+
750,
|
|
19
|
+
828,
|
|
20
|
+
1080,
|
|
21
|
+
1200,
|
|
22
|
+
1920,
|
|
23
|
+
2048,
|
|
24
|
+
3840
|
|
25
|
+
],
|
|
26
|
+
imageQuality: params.imageQuality ?? {},
|
|
27
|
+
assetStreamingMaxSize: params.assetStreamingMaxSize ?? 4718592
|
|
28
|
+
});
|
|
29
|
+
container.register(S3AssetResolverImpl);
|
|
30
|
+
container.register(S3OutputStrategyImpl);
|
|
31
|
+
if ("asset-delivery" === process.env.WEBINY_FUNCTION_TYPE) container.register(LazySharpTransformImpl).inSingletonScope();
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
export { createS3AssetDeliveryFeature };
|
|
35
|
+
|
|
36
|
+
//# sourceMappingURL=feature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assetDelivery/feature.js","sources":["../../src/assetDelivery/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { createS3 } from \"@webiny/aws-sdk/client-s3/index.js\";\nimport { S3Client, S3Bucket, S3AssetDeliveryConfig } from \"./abstractions.js\";\nimport type { AssetDeliveryParams } from \"./types.js\";\nimport { S3AssetResolverImpl } from \"./s3/S3AssetResolver.js\";\nimport { S3OutputStrategyImpl } from \"./s3/S3OutputStrategy.js\";\nimport { LazySharpTransformImpl } from \"./s3/LazySharpTransform.js\";\n\nexport const createS3AssetDeliveryFeature = (params: AssetDeliveryParams = {}) => {\n return createFeature({\n name: \"AssetDelivery/S3\",\n register(container) {\n // register() runs for every request, so build the client only when something resolves\n // it, and reuse it across requests. Building it here cost every request an S3 client.\n container.registerFactory(S3Client, () => createS3());\n container.registerInstance(S3Bucket, process.env.S3_BUCKET as string);\n container.registerInstance(S3AssetDeliveryConfig, {\n presignedUrlTtl: params.presignedUrlTtl ?? 3600,\n imageResizeWidths: params.imageResizeWidths ?? [\n 128, 384, 640, 750, 828, 1080, 1200, 1920, 2048, 3840\n ],\n imageQuality: params.imageQuality ?? {},\n assetStreamingMaxSize: params.assetStreamingMaxSize ?? 4718592\n });\n\n container.register(S3AssetResolverImpl);\n container.register(S3OutputStrategyImpl);\n\n if (process.env.WEBINY_FUNCTION_TYPE === \"asset-delivery\") {\n // Registered eagerly; `sharp` is still loaded lazily, inside the handler.\n container.register(LazySharpTransformImpl).inSingletonScope();\n }\n }\n });\n};\n"],"names":["createS3AssetDeliveryFeature","params","createFeature","container","S3Client","createS3","S3Bucket","process","S3AssetDeliveryConfig","S3AssetResolverImpl","S3OutputStrategyImpl","LazySharpTransformImpl"],"mappings":";;;;;;AAQO,MAAMA,+BAA+B,CAACC,SAA8B,CAAC,CAAC,GAClEC,cAAc;QACjB,MAAM;QACN,UAASC,SAAS;YAGdA,UAAU,eAAe,CAACC,UAAU,IAAMC;YAC1CF,UAAU,gBAAgB,CAACG,UAAUC,QAAQ,GAAG,CAAC,SAAS;YAC1DJ,UAAU,gBAAgB,CAACK,uBAAuB;gBAC9C,iBAAiBP,OAAO,eAAe,IAAI;gBAC3C,mBAAmBA,OAAO,iBAAiB,IAAI;oBAC3C;oBAAK;oBAAK;oBAAK;oBAAK;oBAAK;oBAAM;oBAAM;oBAAM;oBAAM;iBACpD;gBACD,cAAcA,OAAO,YAAY,IAAI,CAAC;gBACtC,uBAAuBA,OAAO,qBAAqB,IAAI;YAC3D;YAEAE,UAAU,QAAQ,CAACM;YACnBN,UAAU,QAAQ,CAACO;YAEnB,IAAIH,AAAqC,qBAArCA,QAAQ,GAAG,CAAC,oBAAoB,EAEhCJ,UAAU,QAAQ,CAACQ,wBAAwB,gBAAgB;QAEnE;IACJ"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { S3AssetResolver } from "./s3/S3AssetResolver.js";
|
|
2
|
+
export { S3OutputStrategy } from "./s3/S3OutputStrategy.js";
|
|
3
|
+
export { S3ContentsReader } from "./s3/S3ContentsReader.js";
|
|
4
|
+
export { S3ErrorAssetReply } from "./s3/S3ErrorAssetReply.js";
|
|
5
|
+
export { S3RedirectAssetReply } from "./s3/S3RedirectAssetReply.js";
|
|
6
|
+
export { S3StreamAssetReply } from "./s3/S3StreamAssetReply.js";
|
|
7
|
+
export { SharpTransform } from "./s3/SharpTransform.js";
|
|
8
|
+
export { CallableContentsReader } from "./s3/transformation/CallableContentsReader.js";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { S3AssetResolver } from "./s3/S3AssetResolver.js";
|
|
2
|
+
export { S3OutputStrategy } from "./s3/S3OutputStrategy.js";
|
|
3
|
+
export { S3ContentsReader } from "./s3/S3ContentsReader.js";
|
|
4
|
+
export { S3ErrorAssetReply } from "./s3/S3ErrorAssetReply.js";
|
|
5
|
+
export { S3RedirectAssetReply } from "./s3/S3RedirectAssetReply.js";
|
|
6
|
+
export { S3StreamAssetReply } from "./s3/S3StreamAssetReply.js";
|
|
7
|
+
export { SharpTransform } from "./s3/SharpTransform.js";
|
|
8
|
+
export { CallableContentsReader } from "./s3/transformation/CallableContentsReader.js";
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { S3 } from "@webiny/aws-sdk/client-s3/index.js";
|
|
2
|
+
import { IdentityContext } from "@webiny/api-core/features/security/IdentityContext/index.js";
|
|
3
|
+
import { GetFileUseCase } from "@webiny/api-file-manager/features/file/GetFile/index.js";
|
|
4
|
+
import { ImageAssetTypeHandler } from "@webiny/api-file-manager/features/assetDelivery/assetTypes/image/index.js";
|
|
5
|
+
import type { Asset } from "@webiny/api-file-manager/delivery/AssetDelivery/Asset.js";
|
|
6
|
+
import type { AssetRequest } from "@webiny/api-file-manager/delivery/AssetDelivery/AssetRequest.js";
|
|
7
|
+
import type { IS3AssetDeliveryConfig } from "../../assetDelivery/abstractions.js";
|
|
8
|
+
/**
|
|
9
|
+
* Defers loading `sharp` until an image is actually transformed.
|
|
10
|
+
*
|
|
11
|
+
* The dynamic import is deliberate — it keeps `sharp` out of the main bundle (note the
|
|
12
|
+
* `webpackChunkName`). That import is async and DI resolution is not, which is why this used to be
|
|
13
|
+
* a per-request `RequestContextInitializer` that imported the module and then registered the real
|
|
14
|
+
* handler. `IAssetTypeHandler` has a single async method, so the import can be awaited there
|
|
15
|
+
* instead.
|
|
16
|
+
*
|
|
17
|
+
* The constructed handler IS memoized: the initializer registered it `.inSingletonScope()`, and
|
|
18
|
+
* nothing below caches the instance (Node caches the module, not the object built from it).
|
|
19
|
+
*/
|
|
20
|
+
declare class LazySharpTransform implements ImageAssetTypeHandler.Interface {
|
|
21
|
+
private readonly s3;
|
|
22
|
+
private readonly bucket;
|
|
23
|
+
private readonly config;
|
|
24
|
+
private readonly identityContext;
|
|
25
|
+
private readonly getFile;
|
|
26
|
+
private handler;
|
|
27
|
+
constructor(s3: S3, bucket: string, config: IS3AssetDeliveryConfig, identityContext: IdentityContext.Interface, getFile: GetFileUseCase.Interface);
|
|
28
|
+
private resolveHandler;
|
|
29
|
+
handle(assetRequest: AssetRequest, asset: Asset): Promise<Asset>;
|
|
30
|
+
}
|
|
31
|
+
export declare const LazySharpTransformImpl: typeof LazySharpTransform & {
|
|
32
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-file-manager/features/assetDelivery/abstractions/AssetType.js").IAssetTypeHandler>;
|
|
33
|
+
};
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { IdentityContext } from "@webiny/api-core/features/security/IdentityContext/index.js";
|
|
2
|
+
import { GetFileUseCase } from "@webiny/api-file-manager/features/file/GetFile/index.js";
|
|
3
|
+
import { ImageAssetTypeHandler } from "@webiny/api-file-manager/features/assetDelivery/assetTypes/image/index.js";
|
|
4
|
+
import { S3AssetDeliveryConfig, S3Bucket, S3Client } from "../abstractions.js";
|
|
5
|
+
class LazySharpTransform {
|
|
6
|
+
constructor(s3, bucket, config, identityContext, getFile){
|
|
7
|
+
this.s3 = s3;
|
|
8
|
+
this.bucket = bucket;
|
|
9
|
+
this.config = config;
|
|
10
|
+
this.identityContext = identityContext;
|
|
11
|
+
this.getFile = getFile;
|
|
12
|
+
this.handler = null;
|
|
13
|
+
}
|
|
14
|
+
resolveHandler() {
|
|
15
|
+
if (!this.handler) this.handler = import("./SharpTransform.js").then(({ SharpTransform })=>new SharpTransform(this.s3, this.bucket, this.config, this.identityContext, this.getFile));
|
|
16
|
+
return this.handler;
|
|
17
|
+
}
|
|
18
|
+
async handle(assetRequest, asset) {
|
|
19
|
+
return (await this.resolveHandler()).handle(assetRequest, asset);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
const LazySharpTransformImpl = ImageAssetTypeHandler.createImplementation({
|
|
23
|
+
implementation: LazySharpTransform,
|
|
24
|
+
dependencies: [
|
|
25
|
+
S3Client,
|
|
26
|
+
S3Bucket,
|
|
27
|
+
S3AssetDeliveryConfig,
|
|
28
|
+
IdentityContext,
|
|
29
|
+
GetFileUseCase
|
|
30
|
+
]
|
|
31
|
+
});
|
|
32
|
+
export { LazySharpTransformImpl };
|
|
33
|
+
|
|
34
|
+
//# sourceMappingURL=LazySharpTransform.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assetDelivery/s3/LazySharpTransform.js","sources":["../../../src/assetDelivery/s3/LazySharpTransform.ts"],"sourcesContent":["import type { S3 } from \"@webiny/aws-sdk/client-s3/index.js\";\nimport { IdentityContext } from \"@webiny/api-core/features/security/IdentityContext/index.js\";\nimport { GetFileUseCase } from \"@webiny/api-file-manager/features/file/GetFile/index.js\";\nimport { ImageAssetTypeHandler } from \"@webiny/api-file-manager/features/assetDelivery/assetTypes/image/index.js\";\nimport type { Asset } from \"@webiny/api-file-manager/delivery/AssetDelivery/Asset.js\";\nimport type { AssetRequest } from \"@webiny/api-file-manager/delivery/AssetDelivery/AssetRequest.js\";\nimport { S3AssetDeliveryConfig, S3Bucket, S3Client } from \"~/assetDelivery/abstractions.js\";\nimport type { IS3AssetDeliveryConfig } from \"~/assetDelivery/abstractions.js\";\n\n/**\n * Defers loading `sharp` until an image is actually transformed.\n *\n * The dynamic import is deliberate — it keeps `sharp` out of the main bundle (note the\n * `webpackChunkName`). That import is async and DI resolution is not, which is why this used to be\n * a per-request `RequestContextInitializer` that imported the module and then registered the real\n * handler. `IAssetTypeHandler` has a single async method, so the import can be awaited there\n * instead.\n *\n * The constructed handler IS memoized: the initializer registered it `.inSingletonScope()`, and\n * nothing below caches the instance (Node caches the module, not the object built from it).\n */\nclass LazySharpTransform implements ImageAssetTypeHandler.Interface {\n private handler: Promise<ImageAssetTypeHandler.Interface> | null = null;\n\n constructor(\n private readonly s3: S3,\n private readonly bucket: string,\n private readonly config: IS3AssetDeliveryConfig,\n private readonly identityContext: IdentityContext.Interface,\n private readonly getFile: GetFileUseCase.Interface\n ) {}\n\n private resolveHandler(): Promise<ImageAssetTypeHandler.Interface> {\n if (!this.handler) {\n this.handler = import(\n /* webpackChunkName: \"s3AssetDelivery\" */ \"./SharpTransform.js\"\n ).then(\n ({ SharpTransform }) =>\n new SharpTransform(\n this.s3,\n this.bucket,\n this.config,\n this.identityContext,\n this.getFile\n )\n );\n }\n return this.handler;\n }\n\n async handle(assetRequest: AssetRequest, asset: Asset): Promise<Asset> {\n return (await this.resolveHandler()).handle(assetRequest, asset);\n }\n}\n\nexport const LazySharpTransformImpl = ImageAssetTypeHandler.createImplementation({\n implementation: LazySharpTransform,\n dependencies: [S3Client, S3Bucket, S3AssetDeliveryConfig, IdentityContext, GetFileUseCase]\n});\n"],"names":["LazySharpTransform","s3","bucket","config","identityContext","getFile","SharpTransform","assetRequest","asset","LazySharpTransformImpl","ImageAssetTypeHandler","S3Client","S3Bucket","S3AssetDeliveryConfig","IdentityContext","GetFileUseCase"],"mappings":";;;;AAqBA,MAAMA;IAGF,YACqBC,EAAM,EACNC,MAAc,EACdC,MAA8B,EAC9BC,eAA0C,EAC1CC,OAAiC,CACpD;aALmBJ,EAAE,GAAFA;aACAC,MAAM,GAANA;aACAC,MAAM,GAANA;aACAC,eAAe,GAAfA;aACAC,OAAO,GAAPA;aAPb,OAAO,GAAoD;IAQhE;IAEK,iBAA2D;QAC/D,IAAI,CAAC,IAAI,CAAC,OAAO,EACb,IAAI,CAAC,OAAO,GAAG,MAAM,CAAN,uBAEb,IAAI,CACF,CAAC,EAAEC,cAAc,EAAE,GACf,IAAIA,eACA,IAAI,CAAC,EAAE,EACP,IAAI,CAAC,MAAM,EACX,IAAI,CAAC,MAAM,EACX,IAAI,CAAC,eAAe,EACpB,IAAI,CAAC,OAAO;QAI5B,OAAO,IAAI,CAAC,OAAO;IACvB;IAEA,MAAM,OAAOC,YAA0B,EAAEC,KAAY,EAAkB;QACnE,OAAQ,OAAM,IAAI,CAAC,cAAc,EAAC,EAAG,MAAM,CAACD,cAAcC;IAC9D;AACJ;AAEO,MAAMC,yBAAyBC,sBAAsB,oBAAoB,CAAC;IAC7E,gBAAgBV;IAChB,cAAc;QAACW;QAAUC;QAAUC;QAAuBC;QAAiBC;KAAe;AAC9F"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { S3 } from "@webiny/aws-sdk/client-s3/index.js";
|
|
2
|
+
import type { AssetRequest, AssetResolver } from "@webiny/api-file-manager";
|
|
3
|
+
import { Asset } from "@webiny/api-file-manager";
|
|
4
|
+
import { GlobalKeyValueStore } from "@webiny/api-core/features/keyValueStore/index.js";
|
|
5
|
+
export declare class S3AssetResolver implements AssetResolver {
|
|
6
|
+
private keyValueStore;
|
|
7
|
+
private s3;
|
|
8
|
+
private bucket;
|
|
9
|
+
constructor(keyValueStore: GlobalKeyValueStore.Interface, s3: S3, bucket: string);
|
|
10
|
+
resolve(request: AssetRequest): Promise<Asset | undefined>;
|
|
11
|
+
}
|
|
12
|
+
export declare const S3AssetResolverImpl: typeof S3AssetResolver & {
|
|
13
|
+
__abstraction: import("@webiny/di").Abstraction<AssetResolver>;
|
|
14
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Asset } from "@webiny/api-file-manager";
|
|
2
|
+
import { AssetResolver } from "@webiny/api-file-manager/features/assetDelivery/abstractions.js";
|
|
3
|
+
import { GlobalKeyValueStore } from "@webiny/api-core/features/keyValueStore/index.js";
|
|
4
|
+
import { S3ContentsReader } from "../index.js";
|
|
5
|
+
import { ObjectKey } from "../threatDetection/ObjectKey.js";
|
|
6
|
+
import { S3Bucket, S3Client } from "../abstractions.js";
|
|
7
|
+
class S3AssetResolver {
|
|
8
|
+
constructor(keyValueStore, s3, bucket){
|
|
9
|
+
this.keyValueStore = keyValueStore;
|
|
10
|
+
this.s3 = s3;
|
|
11
|
+
this.bucket = bucket;
|
|
12
|
+
}
|
|
13
|
+
async resolve(request) {
|
|
14
|
+
const fileId = ObjectKey.from(request.getKey()).id();
|
|
15
|
+
const result = await this.keyValueStore.get(`FileManager/File/${fileId}/Metadata`);
|
|
16
|
+
if (result.isFail()) return;
|
|
17
|
+
const metadata = result.value;
|
|
18
|
+
const asset = new Asset({
|
|
19
|
+
id: metadata.id,
|
|
20
|
+
tenant: metadata.tenant,
|
|
21
|
+
size: metadata.size,
|
|
22
|
+
contentType: metadata.contentType,
|
|
23
|
+
key: metadata.bucketKey
|
|
24
|
+
});
|
|
25
|
+
asset.setContentsReader(new S3ContentsReader(this.s3, this.bucket));
|
|
26
|
+
return asset;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
const S3AssetResolverImpl = AssetResolver.createImplementation({
|
|
30
|
+
implementation: S3AssetResolver,
|
|
31
|
+
dependencies: [
|
|
32
|
+
GlobalKeyValueStore,
|
|
33
|
+
S3Client,
|
|
34
|
+
S3Bucket
|
|
35
|
+
]
|
|
36
|
+
});
|
|
37
|
+
export { S3AssetResolver, S3AssetResolverImpl };
|
|
38
|
+
|
|
39
|
+
//# sourceMappingURL=S3AssetResolver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assetDelivery/s3/S3AssetResolver.js","sources":["../../../src/assetDelivery/s3/S3AssetResolver.ts"],"sourcesContent":["import type { S3 } from \"@webiny/aws-sdk/client-s3/index.js\";\nimport type { AssetRequest, AssetResolver } from \"@webiny/api-file-manager\";\nimport { Asset } from \"@webiny/api-file-manager\";\nimport { AssetResolver as AssetResolverAbstraction } from \"@webiny/api-file-manager/features/assetDelivery/abstractions.js\";\nimport { GlobalKeyValueStore } from \"@webiny/api-core/features/keyValueStore/index.js\";\nimport { S3ContentsReader } from \"~/assetDelivery/index.js\";\nimport { ObjectKey } from \"~/assetDelivery/threatDetection/ObjectKey.js\";\nimport { S3Client, S3Bucket } from \"~/assetDelivery/abstractions.js\";\n\ninterface AssetMetadata {\n id: string;\n tenant: string;\n size: number;\n contentType: string;\n bucketKey: string;\n}\n\nexport class S3AssetResolver implements AssetResolver {\n constructor(\n private keyValueStore: GlobalKeyValueStore.Interface,\n private s3: S3,\n private bucket: string\n ) {}\n\n async resolve(request: AssetRequest): Promise<Asset | undefined> {\n const fileId = ObjectKey.from(request.getKey()).id();\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 const metadata = result.value;\n\n const asset = new Asset({\n id: metadata.id,\n tenant: metadata.tenant,\n size: metadata.size,\n contentType: metadata.contentType,\n key: metadata.bucketKey\n });\n\n asset.setContentsReader(new S3ContentsReader(this.s3, this.bucket));\n\n return asset;\n }\n}\n\nexport const S3AssetResolverImpl = AssetResolverAbstraction.createImplementation({\n implementation: S3AssetResolver,\n dependencies: [GlobalKeyValueStore, S3Client, S3Bucket]\n});\n"],"names":["S3AssetResolver","keyValueStore","s3","bucket","request","fileId","ObjectKey","result","metadata","asset","Asset","S3ContentsReader","S3AssetResolverImpl","AssetResolverAbstraction","GlobalKeyValueStore","S3Client","S3Bucket"],"mappings":";;;;;;AAiBO,MAAMA;IACT,YACYC,aAA4C,EAC5CC,EAAM,EACNC,MAAc,CACxB;aAHUF,aAAa,GAAbA;aACAC,EAAE,GAAFA;aACAC,MAAM,GAANA;IACT;IAEH,MAAM,QAAQC,OAAqB,EAA8B;QAC7D,MAAMC,SAASC,UAAU,IAAI,CAACF,QAAQ,MAAM,IAAI,EAAE;QAClD,MAAMG,SAAS,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,CACvC,CAAC,iBAAiB,EAAEF,OAAO,SAAS,CAAC;QAGzC,IAAIE,OAAO,MAAM,IACb;QAGJ,MAAMC,WAAWD,OAAO,KAAK;QAE7B,MAAME,QAAQ,IAAIC,MAAM;YACpB,IAAIF,SAAS,EAAE;YACf,QAAQA,SAAS,MAAM;YACvB,MAAMA,SAAS,IAAI;YACnB,aAAaA,SAAS,WAAW;YACjC,KAAKA,SAAS,SAAS;QAC3B;QAEAC,MAAM,iBAAiB,CAAC,IAAIE,iBAAiB,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,MAAM;QAEjE,OAAOF;IACX;AACJ;AAEO,MAAMG,sBAAsBC,cAAAA,oBAA6C,CAAC;IAC7E,gBAAgBb;IAChB,cAAc;QAACc;QAAqBC;QAAUC;KAAS;AAC3D"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { S3 } from "@webiny/aws-sdk/client-s3/index.js";
|
|
2
|
+
import type { Asset, AssetContentsReader } from "@webiny/api-file-manager";
|
|
3
|
+
export declare class S3ContentsReader implements AssetContentsReader {
|
|
4
|
+
private s3;
|
|
5
|
+
private readonly bucket;
|
|
6
|
+
constructor(s3: S3, bucket: string);
|
|
7
|
+
read(asset: Asset): Promise<Buffer>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
class S3ContentsReader {
|
|
2
|
+
constructor(s3, bucket){
|
|
3
|
+
this.s3 = s3;
|
|
4
|
+
this.bucket = bucket;
|
|
5
|
+
}
|
|
6
|
+
async read(asset) {
|
|
7
|
+
const { Body } = await this.s3.getObject({
|
|
8
|
+
Bucket: this.bucket,
|
|
9
|
+
Key: asset.getKey()
|
|
10
|
+
});
|
|
11
|
+
if (!Body) throw Error(`Unable to read ${asset.getKey()}!`);
|
|
12
|
+
return Buffer.from(await Body.transformToByteArray());
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
export { S3ContentsReader };
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=S3ContentsReader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assetDelivery/s3/S3ContentsReader.js","sources":["../../../src/assetDelivery/s3/S3ContentsReader.ts"],"sourcesContent":["import type { S3 } from \"@webiny/aws-sdk/client-s3/index.js\";\nimport type { Asset, AssetContentsReader } from \"@webiny/api-file-manager\";\n\nexport class S3ContentsReader implements AssetContentsReader {\n private s3: S3;\n private readonly bucket: string;\n\n constructor(s3: S3, bucket: string) {\n this.s3 = s3;\n this.bucket = bucket;\n }\n\n async read(asset: Asset): Promise<Buffer> {\n const { Body } = await this.s3.getObject({\n Bucket: this.bucket,\n Key: asset.getKey()\n });\n\n if (!Body) {\n throw Error(`Unable to read ${asset.getKey()}!`);\n }\n\n return Buffer.from(await Body.transformToByteArray());\n }\n}\n"],"names":["S3ContentsReader","s3","bucket","asset","Body","Error","Buffer"],"mappings":"AAGO,MAAMA;IAIT,YAAYC,EAAM,EAAEC,MAAc,CAAE;QAChC,IAAI,CAAC,EAAE,GAAGD;QACV,IAAI,CAAC,MAAM,GAAGC;IAClB;IAEA,MAAM,KAAKC,KAAY,EAAmB;QACtC,MAAM,EAAEC,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,EAAE,CAAC,SAAS,CAAC;YACrC,QAAQ,IAAI,CAAC,MAAM;YACnB,KAAKD,MAAM,MAAM;QACrB;QAEA,IAAI,CAACC,MACD,MAAMC,MAAM,CAAC,eAAe,EAAEF,MAAM,MAAM,GAAG,CAAC,CAAC;QAGnD,OAAOG,OAAO,IAAI,CAAC,MAAMF,KAAK,oBAAoB;IACtD;AACJ"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { AssetReply } from "@webiny/api-file-manager";
|
|
2
|
+
class S3ErrorAssetReply extends AssetReply {
|
|
3
|
+
constructor(message){
|
|
4
|
+
super({
|
|
5
|
+
code: 400,
|
|
6
|
+
body: ()=>({
|
|
7
|
+
error: message
|
|
8
|
+
})
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
export { S3ErrorAssetReply };
|
|
13
|
+
|
|
14
|
+
//# sourceMappingURL=S3ErrorAssetReply.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assetDelivery/s3/S3ErrorAssetReply.js","sources":["../../../src/assetDelivery/s3/S3ErrorAssetReply.ts"],"sourcesContent":["import { AssetReply } from \"@webiny/api-file-manager\";\n\nexport class S3ErrorAssetReply extends AssetReply {\n constructor(message: string) {\n super({\n code: 400,\n body: () => ({ error: message })\n });\n }\n}\n"],"names":["S3ErrorAssetReply","AssetReply","message"],"mappings":";AAEO,MAAMA,0BAA0BC;IACnC,YAAYC,OAAe,CAAE;QACzB,KAAK,CAAC;YACF,MAAM;YACN,MAAM,IAAO;oBAAE,OAAOA;gBAAQ;QAClC;IACJ;AACJ"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Asset, AssetOutputStrategy, AssetReply } from "@webiny/api-file-manager";
|
|
2
|
+
import type { S3 } from "@webiny/aws-sdk/client-s3/index.js";
|
|
3
|
+
import type { IS3AssetDeliveryConfig } from "../../assetDelivery/abstractions.js";
|
|
4
|
+
export declare class S3OutputStrategy implements AssetOutputStrategy {
|
|
5
|
+
private readonly s3;
|
|
6
|
+
private readonly bucket;
|
|
7
|
+
private readonly presignedUrlTtl;
|
|
8
|
+
private readonly assetStreamingMaxSize;
|
|
9
|
+
constructor(s3: S3, bucket: string, config: IS3AssetDeliveryConfig);
|
|
10
|
+
output(asset: Asset): Promise<AssetReply>;
|
|
11
|
+
protected getPresignedUrl(asset: Asset): Promise<string>;
|
|
12
|
+
}
|
|
13
|
+
export declare const S3OutputStrategyImpl: typeof S3OutputStrategy & {
|
|
14
|
+
__abstraction: import("@webiny/di").Abstraction<AssetOutputStrategy>;
|
|
15
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { AssetOutputStrategy } from "@webiny/api-file-manager/features/assetDelivery/abstractions.js";
|
|
2
|
+
import { GetObjectCommand, getSignedUrl } from "@webiny/aws-sdk/client-s3/index.js";
|
|
3
|
+
import { S3RedirectAssetReply } from "./S3RedirectAssetReply.js";
|
|
4
|
+
import { S3StreamAssetReply } from "./S3StreamAssetReply.js";
|
|
5
|
+
import { S3AssetDeliveryConfig, S3Bucket, S3Client } from "../abstractions.js";
|
|
6
|
+
class S3OutputStrategy {
|
|
7
|
+
constructor(s3, bucket, config){
|
|
8
|
+
this.s3 = s3;
|
|
9
|
+
this.bucket = bucket;
|
|
10
|
+
this.presignedUrlTtl = config.presignedUrlTtl;
|
|
11
|
+
this.assetStreamingMaxSize = config.assetStreamingMaxSize;
|
|
12
|
+
}
|
|
13
|
+
async output(asset) {
|
|
14
|
+
if (asset.getSize() > this.assetStreamingMaxSize) {
|
|
15
|
+
console.log(`Asset size is greater than ${this.assetStreamingMaxSize}; redirecting to a presigned S3 URL.`);
|
|
16
|
+
return new S3RedirectAssetReply(await this.getPresignedUrl(asset), this.presignedUrlTtl);
|
|
17
|
+
}
|
|
18
|
+
console.log(`Asset size is smaller than ${this.assetStreamingMaxSize}; streaming directly from Lambda function.`);
|
|
19
|
+
return new S3StreamAssetReply(asset);
|
|
20
|
+
}
|
|
21
|
+
getPresignedUrl(asset) {
|
|
22
|
+
return getSignedUrl(this.s3, new GetObjectCommand({
|
|
23
|
+
Bucket: this.bucket,
|
|
24
|
+
Key: asset.getKey()
|
|
25
|
+
}), {
|
|
26
|
+
expiresIn: this.presignedUrlTtl
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
const S3OutputStrategyImpl = AssetOutputStrategy.createImplementation({
|
|
31
|
+
implementation: S3OutputStrategy,
|
|
32
|
+
dependencies: [
|
|
33
|
+
S3Client,
|
|
34
|
+
S3Bucket,
|
|
35
|
+
S3AssetDeliveryConfig
|
|
36
|
+
]
|
|
37
|
+
});
|
|
38
|
+
export { S3OutputStrategy, S3OutputStrategyImpl };
|
|
39
|
+
|
|
40
|
+
//# sourceMappingURL=S3OutputStrategy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assetDelivery/s3/S3OutputStrategy.js","sources":["../../../src/assetDelivery/s3/S3OutputStrategy.ts"],"sourcesContent":["import type { Asset, AssetOutputStrategy, AssetReply } from \"@webiny/api-file-manager\";\nimport { AssetOutputStrategy as AssetOutputStrategyAbstraction } from \"@webiny/api-file-manager/features/assetDelivery/abstractions.js\";\nimport type { S3 } from \"@webiny/aws-sdk/client-s3/index.js\";\nimport { GetObjectCommand, getSignedUrl } from \"@webiny/aws-sdk/client-s3/index.js\";\nimport { S3RedirectAssetReply } from \"~/assetDelivery/s3/S3RedirectAssetReply.js\";\nimport { S3StreamAssetReply } from \"~/assetDelivery/s3/S3StreamAssetReply.js\";\nimport { S3Client, S3Bucket, S3AssetDeliveryConfig } from \"~/assetDelivery/abstractions.js\";\nimport type { IS3AssetDeliveryConfig } from \"~/assetDelivery/abstractions.js\";\n\nexport class S3OutputStrategy implements AssetOutputStrategy {\n private readonly s3: S3;\n private readonly bucket: string;\n private readonly presignedUrlTtl: number;\n private readonly assetStreamingMaxSize: number;\n\n constructor(s3: S3, bucket: string, config: IS3AssetDeliveryConfig) {\n this.s3 = s3;\n this.bucket = bucket;\n this.presignedUrlTtl = config.presignedUrlTtl;\n this.assetStreamingMaxSize = config.assetStreamingMaxSize;\n }\n\n async output(asset: Asset): Promise<AssetReply> {\n if (asset.getSize() > this.assetStreamingMaxSize) {\n console.log(\n `Asset size is greater than ${this.assetStreamingMaxSize}; redirecting to a presigned S3 URL.`\n );\n\n return new S3RedirectAssetReply(\n await this.getPresignedUrl(asset),\n this.presignedUrlTtl\n );\n }\n\n console.log(\n `Asset size is smaller than ${this.assetStreamingMaxSize}; streaming directly from Lambda function.`\n );\n return new S3StreamAssetReply(asset);\n }\n\n protected getPresignedUrl(asset: Asset) {\n return getSignedUrl(\n this.s3,\n new GetObjectCommand({\n Bucket: this.bucket,\n Key: asset.getKey()\n }),\n { expiresIn: this.presignedUrlTtl }\n );\n }\n}\n\nexport const S3OutputStrategyImpl = AssetOutputStrategyAbstraction.createImplementation({\n implementation: S3OutputStrategy,\n dependencies: [S3Client, S3Bucket, S3AssetDeliveryConfig]\n});\n"],"names":["S3OutputStrategy","s3","bucket","config","asset","console","S3RedirectAssetReply","S3StreamAssetReply","getSignedUrl","GetObjectCommand","S3OutputStrategyImpl","AssetOutputStrategyAbstraction","S3Client","S3Bucket","S3AssetDeliveryConfig"],"mappings":";;;;;AASO,MAAMA;IAMT,YAAYC,EAAM,EAAEC,MAAc,EAAEC,MAA8B,CAAE;QAChE,IAAI,CAAC,EAAE,GAAGF;QACV,IAAI,CAAC,MAAM,GAAGC;QACd,IAAI,CAAC,eAAe,GAAGC,OAAO,eAAe;QAC7C,IAAI,CAAC,qBAAqB,GAAGA,OAAO,qBAAqB;IAC7D;IAEA,MAAM,OAAOC,KAAY,EAAuB;QAC5C,IAAIA,MAAM,OAAO,KAAK,IAAI,CAAC,qBAAqB,EAAE;YAC9CC,QAAQ,GAAG,CACP,CAAC,2BAA2B,EAAE,IAAI,CAAC,qBAAqB,CAAC,oCAAoC,CAAC;YAGlG,OAAO,IAAIC,qBACP,MAAM,IAAI,CAAC,eAAe,CAACF,QAC3B,IAAI,CAAC,eAAe;QAE5B;QAEAC,QAAQ,GAAG,CACP,CAAC,2BAA2B,EAAE,IAAI,CAAC,qBAAqB,CAAC,0CAA0C,CAAC;QAExG,OAAO,IAAIE,mBAAmBH;IAClC;IAEU,gBAAgBA,KAAY,EAAE;QACpC,OAAOI,aACH,IAAI,CAAC,EAAE,EACP,IAAIC,iBAAiB;YACjB,QAAQ,IAAI,CAAC,MAAM;YACnB,KAAKL,MAAM,MAAM;QACrB,IACA;YAAE,WAAW,IAAI,CAAC,eAAe;QAAC;IAE1C;AACJ;AAEO,MAAMM,uBAAuBC,oBAAAA,oBAAmD,CAAC;IACpF,gBAAgBX;IAChB,cAAc;QAACY;QAAUC;QAAUC;KAAsB;AAC7D"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { AssetReply } from "@webiny/api-file-manager";
|
|
2
|
+
import { ResponseHeaders } from "@webiny/handler";
|
|
3
|
+
class S3RedirectAssetReply extends AssetReply {
|
|
4
|
+
constructor(url, cacheDuration){
|
|
5
|
+
super({
|
|
6
|
+
code: 301,
|
|
7
|
+
headers: ResponseHeaders.create({
|
|
8
|
+
location: url,
|
|
9
|
+
"cache-control": "public, max-age=" + cacheDuration
|
|
10
|
+
}),
|
|
11
|
+
body: ()=>""
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
export { S3RedirectAssetReply };
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=S3RedirectAssetReply.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assetDelivery/s3/S3RedirectAssetReply.js","sources":["../../../src/assetDelivery/s3/S3RedirectAssetReply.ts"],"sourcesContent":["import { AssetReply } from \"@webiny/api-file-manager\";\nimport { ResponseHeaders } from \"@webiny/handler\";\n\nexport class S3RedirectAssetReply extends AssetReply {\n constructor(url: string, cacheDuration: number) {\n super({\n code: 301,\n headers: ResponseHeaders.create({\n location: url,\n \"cache-control\": \"public, max-age=\" + cacheDuration\n }),\n body: () => \"\"\n });\n }\n}\n"],"names":["S3RedirectAssetReply","AssetReply","url","cacheDuration","ResponseHeaders"],"mappings":";;AAGO,MAAMA,6BAA6BC;IACtC,YAAYC,GAAW,EAAEC,aAAqB,CAAE;QAC5C,KAAK,CAAC;YACF,MAAM;YACN,SAASC,gBAAgB,MAAM,CAAC;gBAC5B,UAAUF;gBACV,iBAAiB,qBAAqBC;YAC1C;YACA,MAAM,IAAM;QAChB;IACJ;AACJ"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { AssetReply } from "@webiny/api-file-manager";
|
|
2
|
+
import { ResponseHeaders } from "@webiny/handler";
|
|
3
|
+
class S3StreamAssetReply extends AssetReply {
|
|
4
|
+
constructor(asset){
|
|
5
|
+
super({
|
|
6
|
+
code: 200,
|
|
7
|
+
headers: ResponseHeaders.create({
|
|
8
|
+
"cache-control": "public, max-age=31536000",
|
|
9
|
+
"content-type": asset.getContentType()
|
|
10
|
+
}),
|
|
11
|
+
body: ()=>asset.getContents()
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
export { S3StreamAssetReply };
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=S3StreamAssetReply.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assetDelivery/s3/S3StreamAssetReply.js","sources":["../../../src/assetDelivery/s3/S3StreamAssetReply.ts"],"sourcesContent":["import type { Asset } from \"@webiny/api-file-manager\";\nimport { AssetReply } from \"@webiny/api-file-manager\";\nimport { ResponseHeaders } from \"@webiny/handler\";\n\nexport class S3StreamAssetReply extends AssetReply {\n constructor(asset: Asset) {\n super({\n code: 200,\n headers: ResponseHeaders.create({\n \"cache-control\": `public, max-age=${86400 * 365}`,\n \"content-type\": asset.getContentType()\n }),\n body: () => asset.getContents()\n });\n }\n}\n"],"names":["S3StreamAssetReply","AssetReply","asset","ResponseHeaders"],"mappings":";;AAIO,MAAMA,2BAA2BC;IACpC,YAAYC,KAAY,CAAE;QACtB,KAAK,CAAC;YACF,MAAM;YACN,SAASC,gBAAgB,MAAM,CAAC;gBAC5B,iBAAiB;gBACjB,gBAAgBD,MAAM,cAAc;YACxC;YACA,MAAM,IAAMA,MAAM,WAAW;QACjC;IACJ;AACJ"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { S3 } from "@webiny/aws-sdk/client-s3/index.js";
|
|
2
|
+
import { IdentityContext } from "@webiny/api-core/features/security/IdentityContext/index.js";
|
|
3
|
+
import { GetFileUseCase } from "@webiny/api-file-manager/features/file/GetFile/index.js";
|
|
4
|
+
import { ImageAssetTypeHandler } from "@webiny/api-file-manager/features/assetDelivery/assetTypes/image/index.js";
|
|
5
|
+
import type { Asset } from "@webiny/api-file-manager/delivery/AssetDelivery/Asset.js";
|
|
6
|
+
import type { AssetRequest } from "@webiny/api-file-manager/delivery/AssetDelivery/AssetRequest.js";
|
|
7
|
+
import type { IS3AssetDeliveryConfig } from "../../assetDelivery/abstractions.js";
|
|
8
|
+
export declare class SharpTransform implements ImageAssetTypeHandler.Interface {
|
|
9
|
+
private readonly s3;
|
|
10
|
+
private readonly bucket;
|
|
11
|
+
private readonly imageResizeWidths;
|
|
12
|
+
private readonly imageQuality;
|
|
13
|
+
private readonly identityContext;
|
|
14
|
+
private readonly getFile;
|
|
15
|
+
private transformer?;
|
|
16
|
+
constructor(s3: S3, bucket: string, config: IS3AssetDeliveryConfig, identityContext: IdentityContext.Interface, getFile: GetFileUseCase.Interface);
|
|
17
|
+
private getTransformer;
|
|
18
|
+
handle(assetRequest: AssetRequest, asset: Asset): Promise<Asset>;
|
|
19
|
+
private loadAssetCrop;
|
|
20
|
+
private transformAsset;
|
|
21
|
+
private optimizeAsset;
|
|
22
|
+
private isAssetAnimated;
|
|
23
|
+
}
|
|
24
|
+
export declare const SharpTransformImpl: typeof SharpTransform & {
|
|
25
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-file-manager/features/assetDelivery/abstractions/AssetType").IAssetTypeHandler>;
|
|
26
|
+
};
|