@webiny/api-file-manager 0.0.0-unstable.b14eaecf38 → 0.0.0-unstable.b6d7105cee
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/README.md +7 -13
- package/constants.d.ts +1 -0
- package/constants.js +4 -0
- package/constants.js.map +1 -0
- package/delivery/AssetDelivery/Asset.d.ts +29 -0
- package/delivery/AssetDelivery/Asset.js +56 -0
- package/delivery/AssetDelivery/Asset.js.map +1 -0
- package/delivery/AssetDelivery/AssetRequest.d.ts +26 -0
- package/delivery/AssetDelivery/AssetRequest.js +26 -0
- package/delivery/AssetDelivery/AssetRequest.js.map +1 -0
- package/delivery/AssetDelivery/abstractions/AssetReply.d.ts +26 -0
- package/delivery/AssetDelivery/abstractions/AssetReply.js +37 -0
- package/delivery/AssetDelivery/abstractions/AssetReply.js.map +1 -0
- package/delivery/AssetDelivery/createAssetDeliveryPluginLoader.d.ts +2 -0
- package/delivery/AssetDelivery/createAssetDeliveryPluginLoader.js +7 -0
- package/delivery/AssetDelivery/createAssetDeliveryPluginLoader.js.map +1 -0
- package/delivery/index.d.ts +7 -0
- package/delivery/index.js +4 -0
- package/delivery/setupAssetDelivery.d.ts +1 -0
- package/delivery/setupAssetDelivery.js +72 -0
- package/delivery/setupAssetDelivery.js.map +1 -0
- package/domain/file/abstractions.d.ts +9 -0
- package/domain/file/abstractions.js +5 -0
- package/domain/file/abstractions.js.map +1 -0
- package/domain/file/errors.d.ts +59 -0
- package/domain/file/errors.js +80 -0
- package/domain/file/errors.js.map +1 -0
- package/domain/file/file.model.d.ts +12 -0
- package/domain/file/file.model.js +69 -0
- package/domain/file/file.model.js.map +1 -0
- package/domain/file/types.d.ts +53 -0
- package/domain/identity/Identity.d.ts +9 -0
- package/domain/identity/Identity.js +12 -0
- package/domain/identity/Identity.js.map +1 -0
- package/domain/permissionsSchema.d.ts +16 -0
- package/domain/permissionsSchema.js +30 -0
- package/domain/permissionsSchema.js.map +1 -0
- package/domain/settings/constants.d.ts +1 -0
- package/domain/settings/constants.js +4 -0
- package/domain/settings/constants.js.map +1 -0
- package/domain/settings/errors.d.ts +18 -0
- package/domain/settings/errors.js +28 -0
- package/domain/settings/errors.js.map +1 -0
- package/domain/settings/types.d.ts +10 -0
- package/domain/settings/types.js +0 -0
- package/domain/settings/validation.d.ts +6 -0
- package/domain/settings/validation.js +27 -0
- package/domain/settings/validation.js.map +1 -0
- package/exports/api/file-manager/assetDelivery.d.ts +18 -0
- package/exports/api/file-manager/assetDelivery.js +15 -0
- package/exports/api/file-manager/file.d.ts +13 -0
- package/exports/api/file-manager/file.js +13 -0
- package/exports/api/file-manager/permissions.d.ts +1 -0
- package/exports/api/file-manager/permissions.js +1 -0
- package/exports/api/file-manager/settings.d.ts +3 -0
- package/exports/api/file-manager/settings.js +3 -0
- package/features/FileManagerFeature.d.ts +4 -0
- package/features/FileManagerFeature.js +43 -0
- package/features/FileManagerFeature.js.map +1 -0
- package/features/assetDelivery/Asset/Asset.d.ts +8 -0
- package/features/assetDelivery/Asset/Asset.js +14 -0
- package/features/assetDelivery/Asset/Asset.js.map +1 -0
- package/features/assetDelivery/Asset/abstractions.d.ts +10 -0
- package/features/assetDelivery/Asset/abstractions.js +5 -0
- package/features/assetDelivery/Asset/abstractions.js.map +1 -0
- package/features/assetDelivery/Asset/index.d.ts +1 -0
- package/features/assetDelivery/Asset/index.js +1 -0
- package/features/assetDelivery/AssetRequest/AssetRequest.d.ts +8 -0
- package/features/assetDelivery/AssetRequest/AssetRequest.js +14 -0
- package/features/assetDelivery/AssetRequest/AssetRequest.js.map +1 -0
- package/features/assetDelivery/AssetRequest/abstractions.d.ts +11 -0
- package/features/assetDelivery/AssetRequest/abstractions.js +5 -0
- package/features/assetDelivery/AssetRequest/abstractions.js.map +1 -0
- package/features/assetDelivery/AssetRequest/index.d.ts +1 -0
- package/features/assetDelivery/AssetRequest/index.js +1 -0
- package/features/assetDelivery/FilesAssetRequestResolver.d.ts +11 -0
- package/features/assetDelivery/FilesAssetRequestResolver.js +33 -0
- package/features/assetDelivery/FilesAssetRequestResolver.js.map +1 -0
- package/features/assetDelivery/NullAssetOutputStrategy.d.ts +8 -0
- package/features/assetDelivery/NullAssetOutputStrategy.js +14 -0
- package/features/assetDelivery/NullAssetOutputStrategy.js.map +1 -0
- package/features/assetDelivery/NullAssetReply.d.ts +5 -0
- package/features/assetDelivery/NullAssetReply.js +17 -0
- package/features/assetDelivery/NullAssetReply.js.map +1 -0
- package/features/assetDelivery/NullAssetResolver.d.ts +8 -0
- package/features/assetDelivery/NullAssetResolver.js +13 -0
- package/features/assetDelivery/NullAssetResolver.js.map +1 -0
- package/features/assetDelivery/ObjectKey/ObjectKey.d.ts +8 -0
- package/features/assetDelivery/ObjectKey/ObjectKey.js +28 -0
- package/features/assetDelivery/ObjectKey/ObjectKey.js.map +1 -0
- package/features/assetDelivery/ObjectKey/abstractions.d.ts +12 -0
- package/features/assetDelivery/ObjectKey/abstractions.js +5 -0
- package/features/assetDelivery/ObjectKey/abstractions.js.map +1 -0
- package/features/assetDelivery/ObjectKey/index.d.ts +1 -0
- package/features/assetDelivery/ObjectKey/index.js +1 -0
- package/features/assetDelivery/StreamAssetReply/StreamAssetReply.d.ts +8 -0
- package/features/assetDelivery/StreamAssetReply/StreamAssetReply.js +22 -0
- package/features/assetDelivery/StreamAssetReply/StreamAssetReply.js.map +1 -0
- package/features/assetDelivery/StreamAssetReply/abstractions.d.ts +11 -0
- package/features/assetDelivery/StreamAssetReply/abstractions.js +5 -0
- package/features/assetDelivery/StreamAssetReply/abstractions.js.map +1 -0
- package/features/assetDelivery/StreamAssetReply/index.d.ts +1 -0
- package/features/assetDelivery/StreamAssetReply/index.js +1 -0
- package/features/assetDelivery/abstractions/AssetAuthorizer.d.ts +9 -0
- package/features/assetDelivery/abstractions/AssetAuthorizer.js +5 -0
- package/features/assetDelivery/abstractions/AssetAuthorizer.js.map +1 -0
- package/features/assetDelivery/abstractions/AssetContentsReader.d.ts +9 -0
- package/features/assetDelivery/abstractions/AssetContentsReader.js +5 -0
- package/features/assetDelivery/abstractions/AssetContentsReader.js.map +1 -0
- package/features/assetDelivery/abstractions/AssetOutputStrategy.d.ts +11 -0
- package/features/assetDelivery/abstractions/AssetOutputStrategy.js +5 -0
- package/features/assetDelivery/abstractions/AssetOutputStrategy.js.map +1 -0
- package/features/assetDelivery/abstractions/AssetProcessor.d.ts +11 -0
- package/features/assetDelivery/abstractions/AssetProcessor.js +5 -0
- package/features/assetDelivery/abstractions/AssetProcessor.js.map +1 -0
- package/features/assetDelivery/abstractions/AssetRequestResolver.d.ts +11 -0
- package/features/assetDelivery/abstractions/AssetRequestResolver.js +5 -0
- package/features/assetDelivery/abstractions/AssetRequestResolver.js.map +1 -0
- package/features/assetDelivery/abstractions/AssetResolver.d.ts +11 -0
- package/features/assetDelivery/abstractions/AssetResolver.js +5 -0
- package/features/assetDelivery/abstractions/AssetResolver.js.map +1 -0
- package/features/assetDelivery/abstractions/AssetTransformationStrategy.d.ts +11 -0
- package/features/assetDelivery/abstractions/AssetTransformationStrategy.js +5 -0
- package/features/assetDelivery/abstractions/AssetTransformationStrategy.js.map +1 -0
- package/features/assetDelivery/abstractions/AssetType.d.ts +17 -0
- package/features/assetDelivery/abstractions/AssetType.js +5 -0
- package/features/assetDelivery/abstractions/AssetType.js.map +1 -0
- package/features/assetDelivery/assetTypes/image/AssetKeyGenerator.d.ts +12 -0
- package/features/assetDelivery/assetTypes/image/AssetKeyGenerator.js +30 -0
- package/features/assetDelivery/assetTypes/image/AssetKeyGenerator.js.map +1 -0
- package/features/assetDelivery/assetTypes/image/ImageAssetType.d.ts +9 -0
- package/features/assetDelivery/assetTypes/image/ImageAssetType.js +18 -0
- package/features/assetDelivery/assetTypes/image/ImageAssetType.js.map +1 -0
- package/features/assetDelivery/assetTypes/image/ImageAssetTypeHandler.d.ts +5 -0
- package/features/assetDelivery/assetTypes/image/ImageAssetTypeHandler.js +5 -0
- package/features/assetDelivery/assetTypes/image/ImageAssetTypeHandler.js.map +1 -0
- package/features/assetDelivery/assetTypes/image/WidthCollection.d.ts +8 -0
- package/features/assetDelivery/assetTypes/image/WidthCollection.js +22 -0
- package/features/assetDelivery/assetTypes/image/WidthCollection.js.map +1 -0
- package/features/assetDelivery/assetTypes/image/imageFormat.d.ts +26 -0
- package/features/assetDelivery/assetTypes/image/imageFormat.js +51 -0
- package/features/assetDelivery/assetTypes/image/imageFormat.js.map +1 -0
- package/features/assetDelivery/assetTypes/image/imageTypes.d.ts +39 -0
- package/features/assetDelivery/assetTypes/image/imageTypes.js +0 -0
- package/features/assetDelivery/assetTypes/image/index.d.ts +5 -0
- package/features/assetDelivery/assetTypes/image/index.js +4 -0
- package/features/assetDelivery/assetTypes/image/normalizeImageOptions.d.ts +6 -0
- package/features/assetDelivery/assetTypes/image/normalizeImageOptions.js +56 -0
- package/features/assetDelivery/assetTypes/image/normalizeImageOptions.js.map +1 -0
- package/features/assetDelivery/assetTypes/image/transformImage.d.ts +59 -0
- package/features/assetDelivery/assetTypes/image/transformImage.js +146 -0
- package/features/assetDelivery/assetTypes/image/transformImage.js.map +1 -0
- package/features/assetDelivery/assetTypes/image/utils.d.ts +26 -0
- package/features/assetDelivery/assetTypes/image/utils.js +47 -0
- package/features/assetDelivery/assetTypes/image/utils.js.map +1 -0
- package/features/assetDelivery/feature.d.ts +4 -0
- package/features/assetDelivery/feature.js +38 -0
- package/features/assetDelivery/feature.js.map +1 -0
- package/features/assetDelivery/privateFiles/NotAuthorizedAssetReply.d.ts +4 -0
- package/features/assetDelivery/privateFiles/NotAuthorizedAssetReply.js +20 -0
- package/features/assetDelivery/privateFiles/NotAuthorizedAssetReply.js.map +1 -0
- package/features/assetDelivery/privateFiles/NotAuthorizedOutputStrategy.d.ts +5 -0
- package/features/assetDelivery/privateFiles/NotAuthorizedOutputStrategy.js +9 -0
- package/features/assetDelivery/privateFiles/NotAuthorizedOutputStrategy.js.map +1 -0
- package/features/assetDelivery/privateFiles/PrivateAuthenticatedAuthorizer.d.ts +11 -0
- package/features/assetDelivery/privateFiles/PrivateAuthenticatedAuthorizer.js +26 -0
- package/features/assetDelivery/privateFiles/PrivateAuthenticatedAuthorizer.js.map +1 -0
- package/features/assetDelivery/privateFiles/PrivateCache.d.ts +8 -0
- package/features/assetDelivery/privateFiles/PrivateCache.js +22 -0
- package/features/assetDelivery/privateFiles/PrivateCache.js.map +1 -0
- package/features/assetDelivery/privateFiles/PrivateFileAssetRequestResolver.d.ts +12 -0
- package/features/assetDelivery/privateFiles/PrivateFileAssetRequestResolver.js +34 -0
- package/features/assetDelivery/privateFiles/PrivateFileAssetRequestResolver.js.map +1 -0
- package/features/assetDelivery/privateFiles/PrivateFilesAssetProcessor.d.ts +19 -0
- package/features/assetDelivery/privateFiles/PrivateFilesAssetProcessor.js +66 -0
- package/features/assetDelivery/privateFiles/PrivateFilesAssetProcessor.js.map +1 -0
- package/features/assetDelivery/privateFiles/PublicCache.d.ts +8 -0
- package/features/assetDelivery/privateFiles/PublicCache.js +22 -0
- package/features/assetDelivery/privateFiles/PublicCache.js.map +1 -0
- package/features/assetDelivery/privateFiles/RedirectToPrivateUrlOutputStrategy.d.ts +10 -0
- package/features/assetDelivery/privateFiles/RedirectToPrivateUrlOutputStrategy.js +24 -0
- package/features/assetDelivery/privateFiles/RedirectToPrivateUrlOutputStrategy.js.map +1 -0
- package/features/assetDelivery/privateFiles/RedirectToPublicUrlOutputStrategy.d.ts +10 -0
- package/features/assetDelivery/privateFiles/RedirectToPublicUrlOutputStrategy.js +24 -0
- package/features/assetDelivery/privateFiles/RedirectToPublicUrlOutputStrategy.js.map +1 -0
- package/features/assetDelivery/transformation/CallableContentsReader.d.ts +11 -0
- package/features/assetDelivery/transformation/CallableContentsReader.js +14 -0
- package/features/assetDelivery/transformation/CallableContentsReader.js.map +1 -0
- package/features/assetDelivery/transformation/TransformationAssetProcessor.d.ts +7 -0
- package/features/assetDelivery/transformation/TransformationAssetProcessor.js +25 -0
- package/features/assetDelivery/transformation/TransformationAssetProcessor.js.map +1 -0
- package/features/assetDelivery/transformation/index.d.ts +5 -0
- package/features/assetDelivery/transformation/index.js +4 -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/ExtractMetadataInput.d.ts +3 -0
- package/features/extractMetadata/ExtractMetadataInput.js +0 -0
- package/features/file/CreateFile/CreateFileRepository.d.ts +15 -0
- package/features/file/CreateFile/CreateFileRepository.js +32 -0
- package/features/file/CreateFile/CreateFileRepository.js.map +1 -0
- package/features/file/CreateFile/CreateFileUseCase.d.ts +21 -0
- package/features/file/CreateFile/CreateFileUseCase.js +83 -0
- package/features/file/CreateFile/CreateFileUseCase.js.map +1 -0
- package/features/file/CreateFile/abstractions.d.ts +60 -0
- package/features/file/CreateFile/abstractions.js +6 -0
- package/features/file/CreateFile/abstractions.js.map +1 -0
- package/features/file/CreateFile/events.d.ts +31 -0
- package/features/file/CreateFile/events.js +23 -0
- package/features/file/CreateFile/events.js.map +1 -0
- package/features/file/CreateFile/feature.d.ts +4 -0
- package/features/file/CreateFile/feature.js +13 -0
- package/features/file/CreateFile/feature.js.map +1 -0
- package/features/file/CreateFile/index.d.ts +2 -0
- package/features/file/CreateFile/index.js +2 -0
- package/features/file/CreateFilesInBatch/CreateFilesInBatchRepository.d.ts +13 -0
- package/features/file/CreateFilesInBatch/CreateFilesInBatchRepository.js +22 -0
- package/features/file/CreateFilesInBatch/CreateFilesInBatchRepository.js.map +1 -0
- package/features/file/CreateFilesInBatch/CreateFilesInBatchUseCase.d.ts +19 -0
- package/features/file/CreateFilesInBatch/CreateFilesInBatchUseCase.js +73 -0
- package/features/file/CreateFilesInBatch/CreateFilesInBatchUseCase.js.map +1 -0
- package/features/file/CreateFilesInBatch/abstractions.d.ts +42 -0
- package/features/file/CreateFilesInBatch/abstractions.js +6 -0
- package/features/file/CreateFilesInBatch/abstractions.js.map +1 -0
- package/features/file/CreateFilesInBatch/events.d.ts +31 -0
- package/features/file/CreateFilesInBatch/events.js +23 -0
- package/features/file/CreateFilesInBatch/events.js.map +1 -0
- package/features/file/CreateFilesInBatch/feature.d.ts +4 -0
- package/features/file/CreateFilesInBatch/feature.js +13 -0
- package/features/file/CreateFilesInBatch/feature.js.map +1 -0
- package/features/file/CreateFilesInBatch/index.d.ts +1 -0
- package/features/file/CreateFilesInBatch/index.js +1 -0
- package/features/file/DeleteFile/DeleteFileRepository.d.ts +15 -0
- package/features/file/DeleteFile/DeleteFileRepository.js +31 -0
- package/features/file/DeleteFile/DeleteFileRepository.js.map +1 -0
- package/features/file/DeleteFile/DeleteFileUseCase.d.ts +17 -0
- package/features/file/DeleteFile/DeleteFileUseCase.js +43 -0
- package/features/file/DeleteFile/DeleteFileUseCase.js.map +1 -0
- package/features/file/DeleteFile/abstractions.d.ts +39 -0
- package/features/file/DeleteFile/abstractions.js +6 -0
- package/features/file/DeleteFile/abstractions.js.map +1 -0
- package/features/file/DeleteFile/events.d.ts +29 -0
- package/features/file/DeleteFile/events.js +23 -0
- package/features/file/DeleteFile/events.js.map +1 -0
- package/features/file/DeleteFile/feature.d.ts +4 -0
- package/features/file/DeleteFile/feature.js +13 -0
- package/features/file/DeleteFile/feature.js.map +1 -0
- package/features/file/DeleteFile/index.d.ts +2 -0
- package/features/file/DeleteFile/index.js +2 -0
- package/features/file/FileUrlGenerator/FileUrlGenerator.d.ts +15 -0
- package/features/file/FileUrlGenerator/FileUrlGenerator.js +33 -0
- package/features/file/FileUrlGenerator/FileUrlGenerator.js.map +1 -0
- package/features/file/FileUrlGenerator/abstractions.d.ts +8 -0
- package/features/file/FileUrlGenerator/abstractions.js +5 -0
- package/features/file/FileUrlGenerator/abstractions.js.map +1 -0
- package/features/file/FileUrlGenerator/feature.d.ts +4 -0
- package/features/file/FileUrlGenerator/feature.js +11 -0
- package/features/file/FileUrlGenerator/feature.js.map +1 -0
- package/features/file/FileUrlGenerator/index.d.ts +1 -0
- package/features/file/FileUrlGenerator/index.js +1 -0
- package/features/file/GetFile/GetFileRepository.d.ts +15 -0
- package/features/file/GetFile/GetFileRepository.js +33 -0
- package/features/file/GetFile/GetFileRepository.js.map +1 -0
- package/features/file/GetFile/GetFileUseCase.d.ts +14 -0
- package/features/file/GetFile/GetFileUseCase.js +29 -0
- package/features/file/GetFile/GetFileUseCase.js.map +1 -0
- package/features/file/GetFile/abstractions.d.ts +40 -0
- package/features/file/GetFile/abstractions.js +6 -0
- package/features/file/GetFile/abstractions.js.map +1 -0
- package/features/file/GetFile/feature.d.ts +4 -0
- package/features/file/GetFile/feature.js +13 -0
- package/features/file/GetFile/feature.js.map +1 -0
- package/features/file/GetFile/index.d.ts +1 -0
- package/features/file/GetFile/index.js +1 -0
- package/features/file/GetFileByUrl/GetFileByUrlUseCase.d.ts +15 -0
- package/features/file/GetFileByUrl/GetFileByUrlUseCase.js +37 -0
- package/features/file/GetFileByUrl/GetFileByUrlUseCase.js.map +1 -0
- package/features/file/GetFileByUrl/abstractions.d.ts +18 -0
- package/features/file/GetFileByUrl/abstractions.js +5 -0
- package/features/file/GetFileByUrl/abstractions.js.map +1 -0
- package/features/file/GetFileByUrl/feature.d.ts +4 -0
- package/features/file/GetFileByUrl/feature.js +11 -0
- package/features/file/GetFileByUrl/feature.js.map +1 -0
- package/features/file/GetFileByUrl/index.d.ts +1 -0
- package/features/file/GetFileByUrl/index.js +1 -0
- package/features/file/GetFileContentsById/abstractions.d.ts +20 -0
- package/features/file/GetFileContentsById/abstractions.js +5 -0
- package/features/file/GetFileContentsById/abstractions.js.map +1 -0
- package/features/file/GetFileContentsById/index.d.ts +1 -0
- package/features/file/GetFileContentsById/index.js +1 -0
- package/features/file/GetFileContentsByKey/abstractions.d.ts +17 -0
- package/features/file/GetFileContentsByKey/abstractions.js +5 -0
- package/features/file/GetFileContentsByKey/abstractions.js.map +1 -0
- package/features/file/GetFileContentsByKey/index.d.ts +1 -0
- package/features/file/GetFileContentsByKey/index.js +1 -0
- package/features/file/ListFiles/ListFilesRepository.d.ts +18 -0
- package/features/file/ListFiles/ListFilesRepository.js +53 -0
- package/features/file/ListFiles/ListFilesRepository.js.map +1 -0
- package/features/file/ListFiles/ListFilesUseCase.d.ts +15 -0
- package/features/file/ListFiles/ListFilesUseCase.js +44 -0
- package/features/file/ListFiles/ListFilesUseCase.js.map +1 -0
- package/features/file/ListFiles/abstractions.d.ts +49 -0
- package/features/file/ListFiles/abstractions.js +6 -0
- package/features/file/ListFiles/abstractions.js.map +1 -0
- package/features/file/ListFiles/feature.d.ts +4 -0
- package/features/file/ListFiles/feature.js +13 -0
- package/features/file/ListFiles/feature.js.map +1 -0
- package/features/file/ListFiles/index.d.ts +1 -0
- package/features/file/ListFiles/index.js +1 -0
- package/features/file/ListImagesByTagTool/ListImagesByTagTool.d.ts +27 -0
- package/features/file/ListImagesByTagTool/ListImagesByTagTool.js +42 -0
- package/features/file/ListImagesByTagTool/ListImagesByTagTool.js.map +1 -0
- package/features/file/ListImagesByTagTool/feature.d.ts +4 -0
- package/features/file/ListImagesByTagTool/feature.js +11 -0
- package/features/file/ListImagesByTagTool/feature.js.map +1 -0
- package/features/file/ListTags/ListTagsRepository.d.ts +16 -0
- package/features/file/ListTags/ListTagsRepository.js +42 -0
- package/features/file/ListTags/ListTagsRepository.js.map +1 -0
- package/features/file/ListTags/ListTagsUseCase.d.ts +13 -0
- package/features/file/ListTags/ListTagsUseCase.js +31 -0
- package/features/file/ListTags/ListTagsUseCase.js.map +1 -0
- package/features/file/ListTags/abstractions.d.ts +45 -0
- package/features/file/ListTags/abstractions.js +6 -0
- package/features/file/ListTags/abstractions.js.map +1 -0
- package/features/file/ListTags/feature.d.ts +4 -0
- package/features/file/ListTags/feature.js +13 -0
- package/features/file/ListTags/feature.js.map +1 -0
- package/features/file/ListTags/index.d.ts +1 -0
- package/features/file/ListTags/index.js +1 -0
- package/features/file/UpdateFile/UpdateFileRepository.d.ts +15 -0
- package/features/file/UpdateFile/UpdateFileRepository.js +37 -0
- package/features/file/UpdateFile/UpdateFileRepository.js.map +1 -0
- package/features/file/UpdateFile/UpdateFileUseCase.d.ts +20 -0
- package/features/file/UpdateFile/UpdateFileUseCase.js +71 -0
- package/features/file/UpdateFile/UpdateFileUseCase.js.map +1 -0
- package/features/file/UpdateFile/abstractions.d.ts +56 -0
- package/features/file/UpdateFile/abstractions.js +6 -0
- package/features/file/UpdateFile/abstractions.js.map +1 -0
- package/features/file/UpdateFile/events.d.ts +34 -0
- package/features/file/UpdateFile/events.js +23 -0
- package/features/file/UpdateFile/events.js.map +1 -0
- package/features/file/UpdateFile/feature.d.ts +4 -0
- package/features/file/UpdateFile/feature.js +13 -0
- package/features/file/UpdateFile/feature.js.map +1 -0
- package/features/file/UpdateFile/index.d.ts +2 -0
- package/features/file/UpdateFile/index.js +2 -0
- package/features/file/shared/EntryToFileMapper.d.ts +5 -0
- package/features/file/shared/EntryToFileMapper.js +28 -0
- package/features/file/shared/EntryToFileMapper.js.map +1 -0
- package/features/file/shared/FileInputToEntryInputMapper.d.ts +5 -0
- package/features/file/shared/FileInputToEntryInputMapper.js +32 -0
- package/features/file/shared/FileInputToEntryInputMapper.js.map +1 -0
- package/features/file/shared/FileToEntryMapper.d.ts +5 -0
- package/features/file/shared/FileToEntryMapper.js +31 -0
- package/features/file/shared/FileToEntryMapper.js.map +1 -0
- package/features/permissions/abstractions.d.ts +21 -0
- package/features/permissions/abstractions.js +6 -0
- package/features/permissions/abstractions.js.map +1 -0
- package/features/permissions/feature.d.ts +4 -0
- package/features/permissions/feature.js +7 -0
- package/features/permissions/feature.js.map +1 -0
- package/features/settings/GetSettings/GetSettingsUseCase.d.ts +13 -0
- package/features/settings/GetSettings/GetSettingsUseCase.js +28 -0
- package/features/settings/GetSettings/GetSettingsUseCase.js.map +1 -0
- package/features/settings/GetSettings/abstractions.d.ts +18 -0
- package/features/settings/GetSettings/abstractions.js +5 -0
- package/features/settings/GetSettings/abstractions.js.map +1 -0
- package/features/settings/GetSettings/feature.d.ts +4 -0
- package/features/settings/GetSettings/feature.js +11 -0
- package/features/settings/GetSettings/feature.js.map +1 -0
- package/features/settings/SettingsInstaller/SettingsInstaller.d.ts +15 -0
- package/features/settings/SettingsInstaller/SettingsInstaller.js +36 -0
- package/features/settings/SettingsInstaller/SettingsInstaller.js.map +1 -0
- package/features/settings/SettingsInstaller/feature.d.ts +4 -0
- package/features/settings/SettingsInstaller/feature.js +11 -0
- package/features/settings/SettingsInstaller/feature.js.map +1 -0
- package/features/settings/UpdateSettings/UpdateSettingsUseCase.d.ts +18 -0
- package/features/settings/UpdateSettings/UpdateSettingsUseCase.js +55 -0
- package/features/settings/UpdateSettings/UpdateSettingsUseCase.js.map +1 -0
- package/features/settings/UpdateSettings/abstractions.d.ts +23 -0
- package/features/settings/UpdateSettings/abstractions.js +5 -0
- package/features/settings/UpdateSettings/abstractions.js.map +1 -0
- package/features/settings/UpdateSettings/events.d.ts +34 -0
- package/features/settings/UpdateSettings/events.js +23 -0
- package/features/settings/UpdateSettings/events.js.map +1 -0
- package/features/settings/UpdateSettings/feature.d.ts +4 -0
- package/features/settings/UpdateSettings/feature.js +11 -0
- package/features/settings/UpdateSettings/feature.js.map +1 -0
- package/features/settings/UpdateSettings/index.d.ts +2 -0
- package/features/settings/UpdateSettings/index.js +2 -0
- package/features/shared/abstractions.d.ts +1 -0
- package/features/shared/abstractions.js +1 -0
- package/features/upload/CompleteMultiPartUpload/abstractions.d.ts +12 -0
- package/features/upload/CompleteMultiPartUpload/abstractions.js +5 -0
- package/features/upload/CompleteMultiPartUpload/abstractions.js.map +1 -0
- package/features/upload/CompleteMultiPartUpload/index.d.ts +1 -0
- package/features/upload/CompleteMultiPartUpload/index.js +1 -0
- package/features/upload/CreateMultiPartUpload/abstractions.d.ts +14 -0
- package/features/upload/CreateMultiPartUpload/abstractions.js +5 -0
- package/features/upload/CreateMultiPartUpload/abstractions.js.map +1 -0
- package/features/upload/CreateMultiPartUpload/index.d.ts +1 -0
- package/features/upload/CreateMultiPartUpload/index.js +1 -0
- package/features/upload/GetUploadPayload/abstractions.d.ts +10 -0
- package/features/upload/GetUploadPayload/abstractions.js +5 -0
- package/features/upload/GetUploadPayload/abstractions.js.map +1 -0
- package/features/upload/GetUploadPayload/index.d.ts +1 -0
- package/features/upload/GetUploadPayload/index.js +1 -0
- package/features/upload/ReadFileMetadata/MetadataReader.d.ts +11 -0
- package/features/upload/ReadFileMetadata/MetadataReader.js +21 -0
- package/features/upload/ReadFileMetadata/MetadataReader.js.map +1 -0
- package/features/upload/ReadFileMetadata/abstractions.d.ts +15 -0
- package/features/upload/ReadFileMetadata/abstractions.js +5 -0
- package/features/upload/ReadFileMetadata/abstractions.js.map +1 -0
- package/features/upload/ReadFileMetadata/feature.d.ts +4 -0
- package/features/upload/ReadFileMetadata/feature.js +11 -0
- package/features/upload/ReadFileMetadata/feature.js.map +1 -0
- package/features/upload/ReadFileMetadata/index.d.ts +1 -0
- package/features/upload/ReadFileMetadata/index.js +1 -0
- package/features/upload/WriteFileMetadata/MetadataWriter.d.ts +14 -0
- package/features/upload/WriteFileMetadata/MetadataWriter.js +36 -0
- package/features/upload/WriteFileMetadata/MetadataWriter.js.map +1 -0
- package/features/upload/WriteFileMetadata/WriteMetadataAfterBatchCreateHandler.d.ts +11 -0
- package/features/upload/WriteFileMetadata/WriteMetadataAfterBatchCreateHandler.js +20 -0
- package/features/upload/WriteFileMetadata/WriteMetadataAfterBatchCreateHandler.js.map +1 -0
- package/features/upload/WriteFileMetadata/WriteMetadataAfterCreateHandler.d.ts +11 -0
- package/features/upload/WriteFileMetadata/WriteMetadataAfterCreateHandler.js +22 -0
- package/features/upload/WriteFileMetadata/WriteMetadataAfterCreateHandler.js.map +1 -0
- package/features/upload/WriteFileMetadata/WriteMetadataAfterUpdateHandler.d.ts +11 -0
- package/features/upload/WriteFileMetadata/WriteMetadataAfterUpdateHandler.js +22 -0
- package/features/upload/WriteFileMetadata/WriteMetadataAfterUpdateHandler.js.map +1 -0
- package/features/upload/WriteFileMetadata/abstractions.d.ts +9 -0
- package/features/upload/WriteFileMetadata/abstractions.js +5 -0
- package/features/upload/WriteFileMetadata/abstractions.js.map +1 -0
- package/features/upload/WriteFileMetadata/feature.d.ts +4 -0
- package/features/upload/WriteFileMetadata/feature.js +17 -0
- package/features/upload/WriteFileMetadata/feature.js.map +1 -0
- package/features/upload/index.d.ts +17 -0
- package/features/upload/index.js +10 -0
- package/features/upload/types.d.ts +28 -0
- package/features/upload/types.js +0 -0
- package/features/upload/utils/FileExtension.d.ts +6 -0
- package/features/upload/utils/FileExtension.js +16 -0
- package/features/upload/utils/FileExtension.js.map +1 -0
- package/features/upload/utils/FileKey.d.ts +11 -0
- package/features/upload/utils/FileKey.js +33 -0
- package/features/upload/utils/FileKey.js.map +1 -0
- package/features/upload/utils/FileNormalizer.d.ts +13 -0
- package/features/upload/utils/FileNormalizer.js +41 -0
- package/features/upload/utils/FileNormalizer.js.map +1 -0
- package/features/upload/utils/FileUploadModifier.d.ts +30 -0
- package/features/upload/utils/FileUploadModifier.js +39 -0
- package/features/upload/utils/FileUploadModifier.js.map +1 -0
- package/features/upload/utils/checkPermissions.d.ts +5 -0
- package/features/upload/utils/checkPermissions.js +22 -0
- package/features/upload/utils/checkPermissions.js.map +1 -0
- package/features/upload/utils/createFileNormalizerFromContext.d.ts +3 -0
- package/features/upload/utils/createFileNormalizerFromContext.js +9 -0
- package/features/upload/utils/createFileNormalizerFromContext.js.map +1 -0
- package/features/upload/utils/mimeTypes.d.ts +1 -0
- package/features/upload/utils/mimeTypes.js +9 -0
- package/features/upload/utils/mimeTypes.js.map +1 -0
- package/graphql/FmGraphQLSchema.d.ts +25 -0
- package/graphql/FmGraphQLSchema.js +450 -0
- package/graphql/FmGraphQLSchema.js.map +1 -0
- package/graphql/FmUploadGraphQLSchema.d.ts +11 -0
- package/graphql/FmUploadGraphQLSchema.js +229 -0
- package/graphql/FmUploadGraphQLSchema.js.map +1 -0
- package/index.d.ts +3 -5
- package/index.js +41 -66
- package/index.js.map +1 -1
- package/package.json +40 -40
- package/types.d.ts +2 -355
- package/types.js +1 -27
- package/createFileManager/checkBasePermissions.d.ts +0 -5
- package/createFileManager/checkBasePermissions.js +0 -24
- package/createFileManager/checkBasePermissions.js.map +0 -1
- package/createFileManager/files.crud.d.ts +0 -3
- package/createFileManager/files.crud.js +0 -318
- package/createFileManager/files.crud.js.map +0 -1
- package/createFileManager/filevalidation.disabled.js +0 -55
- package/createFileManager/filevalidation.disabled.js.map +0 -1
- package/createFileManager/index.d.ts +0 -13
- package/createFileManager/index.js +0 -20
- package/createFileManager/index.js.map +0 -1
- package/createFileManager/settings.crud.d.ts +0 -3
- package/createFileManager/settings.crud.js +0 -91
- package/createFileManager/settings.crud.js.map +0 -1
- package/createFileManager/system.crud.d.ts +0 -3
- package/createFileManager/system.crud.js +0 -86
- package/createFileManager/system.crud.js.map +0 -1
- package/graphql/index.d.ts +0 -3
- package/graphql/index.js +0 -288
- package/graphql/index.js.map +0 -1
- package/handlers/download/byAlias.d.ts +0 -6
- package/handlers/download/byAlias.js +0 -89
- package/handlers/download/byAlias.js.map +0 -1
- package/handlers/download/byExactKey.d.ts +0 -2
- package/handlers/download/byExactKey.js +0 -57
- package/handlers/download/byExactKey.js.map +0 -1
- package/handlers/download/extractFileInformation.d.ts +0 -9
- package/handlers/download/extractFileInformation.js +0 -20
- package/handlers/download/extractFileInformation.js.map +0 -1
- package/handlers/download/getS3Object.d.ts +0 -10
- package/handlers/download/getS3Object.js +0 -57
- package/handlers/download/getS3Object.js.map +0 -1
- package/handlers/download/index.d.ts +0 -2
- package/handlers/download/index.js +0 -27
- package/handlers/download/index.js.map +0 -1
- package/handlers/manage/index.d.ts +0 -5
- package/handlers/manage/index.js +0 -55
- package/handlers/manage/index.js.map +0 -1
- package/handlers/transform/index.d.ts +0 -2
- package/handlers/transform/index.js +0 -89
- package/handlers/transform/index.js.map +0 -1
- package/handlers/transform/legacyUtils.d.ts +0 -17
- package/handlers/transform/legacyUtils.js +0 -42
- package/handlers/transform/legacyUtils.js.map +0 -1
- package/handlers/transform/loaders/imageLoader.d.ts +0 -30
- package/handlers/transform/loaders/imageLoader.js +0 -94
- package/handlers/transform/loaders/imageLoader.js.map +0 -1
- package/handlers/transform/loaders/index.d.ts +0 -8
- package/handlers/transform/loaders/index.js +0 -10
- package/handlers/transform/loaders/index.js.map +0 -1
- package/handlers/transform/loaders/sanitizeImageTransformations.d.ts +0 -11
- package/handlers/transform/loaders/sanitizeImageTransformations.js +0 -45
- package/handlers/transform/loaders/sanitizeImageTransformations.js.map +0 -1
- package/handlers/transform/managers/imageManager.d.ts +0 -15
- package/handlers/transform/managers/imageManager.js +0 -74
- package/handlers/transform/managers/imageManager.js.map +0 -1
- package/handlers/transform/managers/index.d.ts +0 -5
- package/handlers/transform/managers/index.js +0 -10
- package/handlers/transform/managers/index.js.map +0 -1
- package/handlers/transform/optimizeImage.d.ts +0 -3
- package/handlers/transform/optimizeImage.js +0 -42
- package/handlers/transform/optimizeImage.js.map +0 -1
- package/handlers/transform/transformImage.d.ts +0 -10
- package/handlers/transform/transformImage.js +0 -25
- package/handlers/transform/transformImage.js.map +0 -1
- package/handlers/transform/utils.d.ts +0 -12
- package/handlers/transform/utils.js +0 -36
- package/handlers/transform/utils.js.map +0 -1
- package/handlers/types.d.ts +0 -8
- package/handlers/types.js +0 -5
- package/handlers/types.js.map +0 -1
- package/handlers/utils/getEnvironment.d.ts +0 -5
- package/handlers/utils/getEnvironment.js +0 -11
- package/handlers/utils/getEnvironment.js.map +0 -1
- package/handlers/utils/getObjectParams.d.ts +0 -9
- package/handlers/utils/getObjectParams.js +0 -21
- package/handlers/utils/getObjectParams.js.map +0 -1
- package/handlers/utils/index.d.ts +0 -2
- package/handlers/utils/index.js +0 -20
- package/handlers/utils/index.js.map +0 -1
- package/plugins/FilePhysicalStoragePlugin.d.ts +0 -21
- package/plugins/FilePhysicalStoragePlugin.js +0 -31
- package/plugins/FilePhysicalStoragePlugin.js.map +0 -1
- package/plugins/FileStorageTransformPlugin.d.ts +0 -34
- package/plugins/FileStorageTransformPlugin.js +0 -40
- package/plugins/FileStorageTransformPlugin.js.map +0 -1
- package/plugins/crud/files/validation.d.ts +0 -3
- package/plugins/crud/files/validation.js +0 -41
- package/plugins/crud/files/validation.js.map +0 -1
- package/plugins/crud/files.crud.d.ts +0 -4
- package/plugins/crud/files.crud.js +0 -431
- package/plugins/crud/files.crud.js.map +0 -1
- package/plugins/crud/settings.crud.d.ts +0 -5
- package/plugins/crud/settings.crud.js +0 -116
- package/plugins/crud/settings.crud.js.map +0 -1
- package/plugins/crud/system.crud.d.ts +0 -4
- package/plugins/crud/system.crud.js +0 -153
- package/plugins/crud/system.crud.js.map +0 -1
- package/plugins/crud/utils/checkBasePermissions.d.ts +0 -5
- package/plugins/crud/utils/checkBasePermissions.js +0 -33
- package/plugins/crud/utils/checkBasePermissions.js.map +0 -1
- package/plugins/crud/utils/createFileModel.d.ts +0 -5
- package/plugins/crud/utils/createFileModel.js +0 -77
- package/plugins/crud/utils/createFileModel.js.map +0 -1
- package/plugins/crud/utils/lifecycleEvents.d.ts +0 -6
- package/plugins/crud/utils/lifecycleEvents.js +0 -38
- package/plugins/crud/utils/lifecycleEvents.js.map +0 -1
- package/plugins/definitions/FilePhysicalStoragePlugin.d.ts +0 -21
- package/plugins/definitions/FilePhysicalStoragePlugin.js +0 -42
- package/plugins/definitions/FilePhysicalStoragePlugin.js.map +0 -1
- package/plugins/definitions/FilePlugin.d.ts +0 -136
- package/plugins/definitions/FilePlugin.js +0 -70
- package/plugins/definitions/FilePlugin.js.map +0 -1
- package/plugins/definitions/FileStorageTransformPlugin.d.ts +0 -34
- package/plugins/definitions/FileStorageTransformPlugin.js +0 -51
- package/plugins/definitions/FileStorageTransformPlugin.js.map +0 -1
- package/plugins/definitions/FilesStorageOperationsProviderPlugin.d.ts +0 -9
- package/plugins/definitions/FilesStorageOperationsProviderPlugin.js +0 -17
- package/plugins/definitions/FilesStorageOperationsProviderPlugin.js.map +0 -1
- package/plugins/definitions/InstallationPlugin.d.ts +0 -19
- package/plugins/definitions/InstallationPlugin.js +0 -42
- package/plugins/definitions/InstallationPlugin.js.map +0 -1
- package/plugins/definitions/SettingsStorageOperationsProviderPlugin.d.ts +0 -9
- package/plugins/definitions/SettingsStorageOperationsProviderPlugin.js +0 -17
- package/plugins/definitions/SettingsStorageOperationsProviderPlugin.js.map +0 -1
- package/plugins/definitions/SystemStorageOperationsProviderPlugin.d.ts +0 -9
- package/plugins/definitions/SystemStorageOperationsProviderPlugin.js +0 -17
- package/plugins/definitions/SystemStorageOperationsProviderPlugin.js.map +0 -1
- package/plugins/graphql.d.ts +0 -4
- package/plugins/graphql.js +0 -290
- package/plugins/graphql.js.map +0 -1
- package/plugins/index.d.ts +0 -2
- package/plugins/index.js +0 -27
- package/plugins/index.js.map +0 -1
- package/plugins/storage/FileStorage.d.ts +0 -30
- package/plugins/storage/FileStorage.js +0 -103
- package/plugins/storage/FileStorage.js.map +0 -1
- package/plugins/storage/index.d.ts +0 -4
- package/plugins/storage/index.js +0 -26
- package/plugins/storage/index.js.map +0 -1
- package/storage/FileStorage.d.ts +0 -32
- package/storage/FileStorage.js +0 -86
- package/storage/FileStorage.js.map +0 -1
- package/types/file.d.ts +0 -33
- package/types/file.js +0 -5
- package/types/file.js.map +0 -1
- package/types/file.lifecycle.d.ts +0 -40
- package/types/file.lifecycle.js +0 -5
- package/types/file.lifecycle.js.map +0 -1
- package/types.js.map +0 -1
- package/utils.d.ts +0 -4
- package/utils.js +0 -16
- package/utils.js.map +0 -1
- /package/{createFileManager/filevalidation.disabled.d.ts → domain/file/types.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/file/GetFile/feature.js","sources":["../../../../src/features/file/GetFile/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { GetFileRepository } from \"./GetFileRepository.js\";\nimport { GetFileUseCase } from \"./GetFileUseCase.js\";\n\nexport const GetFileFeature = createFeature({\n name: \"FileManager/GetFile\",\n register(container) {\n container.register(GetFileUseCase);\n container.register(GetFileRepository).inSingletonScope();\n }\n});\n"],"names":["GetFileFeature","createFeature","container","GetFileUseCase","GetFileRepository"],"mappings":";;;AAIO,MAAMA,iBAAiBC,cAAc;IACxC,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,QAAQ,CAACC;QACnBD,UAAU,QAAQ,CAACE,mBAAmB,gBAAgB;IAC1D;AACJ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { GetFileUseCase } from "./abstractions.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { GetFileUseCase } from "./abstractions.js";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Result } from "@webiny/feature/api";
|
|
2
|
+
import { GetFileByUrlUseCase as Abstraction } from "./abstractions.js";
|
|
3
|
+
import { ListFilesUseCase } from "../../../features/file/ListFiles/abstractions.js";
|
|
4
|
+
import { IdentityContext } from "@webiny/api-core/features/security/IdentityContext/index.js";
|
|
5
|
+
import type { File } from "../../../domain/file/types.js";
|
|
6
|
+
declare class GetFileByUrlUseCaseImpl implements Abstraction.Interface {
|
|
7
|
+
private readonly identityContext;
|
|
8
|
+
private readonly listFiles;
|
|
9
|
+
constructor(identityContext: IdentityContext.Interface, listFiles: ListFilesUseCase.Interface);
|
|
10
|
+
execute(url: string): Promise<Result<File | undefined, Abstraction.Error>>;
|
|
11
|
+
}
|
|
12
|
+
export declare const GetFileByUrlUseCase: typeof GetFileByUrlUseCaseImpl & {
|
|
13
|
+
__abstraction: import("@webiny/di").Abstraction<import("./abstractions.js").IGetFileByUrlUseCase>;
|
|
14
|
+
};
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Result } from "@webiny/feature/api";
|
|
2
|
+
import { GetFileByUrlUseCase } from "./abstractions.js";
|
|
3
|
+
import { ListFilesUseCase } from "../ListFiles/abstractions.js";
|
|
4
|
+
import { IdentityContext } from "@webiny/api-core/features/security/IdentityContext/index.js";
|
|
5
|
+
import { FileNotAuthorizedError } from "../../../domain/file/errors.js";
|
|
6
|
+
class GetFileByUrlUseCaseImpl {
|
|
7
|
+
constructor(identityContext, listFiles){
|
|
8
|
+
this.identityContext = identityContext;
|
|
9
|
+
this.listFiles = listFiles;
|
|
10
|
+
}
|
|
11
|
+
async execute(url) {
|
|
12
|
+
const identity = this.identityContext.getIdentity();
|
|
13
|
+
if (identity.isAnonymous()) return Result.fail(new FileNotAuthorizedError());
|
|
14
|
+
const { pathname } = new URL(url);
|
|
15
|
+
const query = pathname.replace("/files/", "").replace("/private/", "");
|
|
16
|
+
const filesResult = await this.listFiles.execute({
|
|
17
|
+
where: {
|
|
18
|
+
key: query
|
|
19
|
+
},
|
|
20
|
+
limit: 1
|
|
21
|
+
});
|
|
22
|
+
if (filesResult.isFail()) return Result.fail(filesResult.error);
|
|
23
|
+
const files = filesResult.value.items;
|
|
24
|
+
const file = files.length ? files[0] : void 0;
|
|
25
|
+
return Result.ok(file);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
const GetFileByUrlUseCase_GetFileByUrlUseCase = GetFileByUrlUseCase.createImplementation({
|
|
29
|
+
implementation: GetFileByUrlUseCaseImpl,
|
|
30
|
+
dependencies: [
|
|
31
|
+
IdentityContext,
|
|
32
|
+
ListFilesUseCase
|
|
33
|
+
]
|
|
34
|
+
});
|
|
35
|
+
export { GetFileByUrlUseCase_GetFileByUrlUseCase as GetFileByUrlUseCase };
|
|
36
|
+
|
|
37
|
+
//# sourceMappingURL=GetFileByUrlUseCase.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/file/GetFileByUrl/GetFileByUrlUseCase.js","sources":["../../../../src/features/file/GetFileByUrl/GetFileByUrlUseCase.ts"],"sourcesContent":["import { Result } from \"@webiny/feature/api\";\nimport { GetFileByUrlUseCase as Abstraction } from \"./abstractions.js\";\nimport { ListFilesUseCase } from \"~/features/file/ListFiles/abstractions.js\";\nimport { IdentityContext } from \"@webiny/api-core/features/security/IdentityContext/index.js\";\nimport { FileNotAuthorizedError } from \"~/domain/file/errors.js\";\nimport type { File } from \"~/domain/file/types.js\";\n\nclass GetFileByUrlUseCaseImpl implements Abstraction.Interface {\n public constructor(\n private readonly identityContext: IdentityContext.Interface,\n private readonly listFiles: ListFilesUseCase.Interface\n ) {}\n\n public async execute(url: string): Promise<Result<File | undefined, Abstraction.Error>> {\n const identity = this.identityContext.getIdentity();\n if (identity.isAnonymous()) {\n return Result.fail(new FileNotAuthorizedError());\n }\n\n const { pathname } = new URL(url);\n const query = pathname.replace(\"/files/\", \"\").replace(\"/private/\", \"\");\n\n const filesResult = await this.listFiles.execute({\n where: { key: query },\n limit: 1\n });\n\n if (filesResult.isFail()) {\n return Result.fail(filesResult.error);\n }\n\n const files = filesResult.value.items;\n const file = files.length ? files[0] : undefined;\n\n return Result.ok(file);\n }\n}\n\nexport const GetFileByUrlUseCase = Abstraction.createImplementation({\n implementation: GetFileByUrlUseCaseImpl,\n dependencies: [IdentityContext, ListFilesUseCase]\n});\n"],"names":["GetFileByUrlUseCaseImpl","identityContext","listFiles","url","identity","Result","FileNotAuthorizedError","pathname","URL","query","filesResult","files","file","undefined","GetFileByUrlUseCase","Abstraction","IdentityContext","ListFilesUseCase"],"mappings":";;;;;AAOA,MAAMA;IACF,YACqBC,eAA0C,EAC1CC,SAAqC,CACxD;aAFmBD,eAAe,GAAfA;aACAC,SAAS,GAATA;IAClB;IAEH,MAAa,QAAQC,GAAW,EAAwD;QACpF,MAAMC,WAAW,IAAI,CAAC,eAAe,CAAC,WAAW;QACjD,IAAIA,SAAS,WAAW,IACpB,OAAOC,OAAO,IAAI,CAAC,IAAIC;QAG3B,MAAM,EAAEC,QAAQ,EAAE,GAAG,IAAIC,IAAIL;QAC7B,MAAMM,QAAQF,SAAS,OAAO,CAAC,WAAW,IAAI,OAAO,CAAC,aAAa;QAEnE,MAAMG,cAAc,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC;YAC7C,OAAO;gBAAE,KAAKD;YAAM;YACpB,OAAO;QACX;QAEA,IAAIC,YAAY,MAAM,IAClB,OAAOL,OAAO,IAAI,CAACK,YAAY,KAAK;QAGxC,MAAMC,QAAQD,YAAY,KAAK,CAAC,KAAK;QACrC,MAAME,OAAOD,MAAM,MAAM,GAAGA,KAAK,CAAC,EAAE,GAAGE;QAEvC,OAAOR,OAAO,EAAE,CAACO;IACrB;AACJ;AAEO,MAAME,0CAAsBC,oBAAAA,oBAAgC,CAAC;IAChE,gBAAgBf;IAChB,cAAc;QAACgB;QAAiBC;KAAiB;AACrD"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Result } from "@webiny/feature/api";
|
|
2
|
+
import type { File } from "../../../domain/file/types.js";
|
|
3
|
+
import { FileNotAuthorizedError } from "../../../domain/file/errors.js";
|
|
4
|
+
import type { FilePersistenceError } from "../../../domain/file/errors.js";
|
|
5
|
+
export interface IGetFileByUrlUseCase {
|
|
6
|
+
execute(url: string): Promise<Result<File | undefined, UseCaseError>>;
|
|
7
|
+
}
|
|
8
|
+
export interface IGetFileByUrlUseCaseErrors {
|
|
9
|
+
notAuthorized: FileNotAuthorizedError;
|
|
10
|
+
persistence: FilePersistenceError;
|
|
11
|
+
}
|
|
12
|
+
type UseCaseError = IGetFileByUrlUseCaseErrors[keyof IGetFileByUrlUseCaseErrors];
|
|
13
|
+
export declare const GetFileByUrlUseCase: import("@webiny/di").Abstraction<IGetFileByUrlUseCase>;
|
|
14
|
+
export declare namespace GetFileByUrlUseCase {
|
|
15
|
+
type Interface = IGetFileByUrlUseCase;
|
|
16
|
+
type Error = UseCaseError;
|
|
17
|
+
}
|
|
18
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/file/GetFileByUrl/abstractions.js","sources":["../../../../src/features/file/GetFileByUrl/abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { Result } from \"@webiny/feature/api\";\nimport type { File } from \"~/domain/file/types.js\";\nimport { FileNotAuthorizedError } from \"~/domain/file/errors.js\";\nimport type { FilePersistenceError } from \"~/domain/file/errors.js\";\n\nexport interface IGetFileByUrlUseCase {\n execute(url: string): Promise<Result<File | undefined, UseCaseError>>;\n}\n\nexport interface IGetFileByUrlUseCaseErrors {\n notAuthorized: FileNotAuthorizedError;\n persistence: FilePersistenceError;\n}\n\ntype UseCaseError = IGetFileByUrlUseCaseErrors[keyof IGetFileByUrlUseCaseErrors];\n\n/* Retrieve a file by its public URL. */\nexport const GetFileByUrlUseCase = createAbstraction<IGetFileByUrlUseCase>(\"GetFileByUrlUseCase\");\n\nexport namespace GetFileByUrlUseCase {\n export type Interface = IGetFileByUrlUseCase;\n export type Error = UseCaseError;\n}\n"],"names":["GetFileByUrlUseCase","createAbstraction"],"mappings":";AAkBO,MAAMA,sBAAsBC,kBAAwC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createFeature } from "@webiny/feature/api";
|
|
2
|
+
import { GetFileByUrlUseCase } from "./GetFileByUrlUseCase.js";
|
|
3
|
+
const GetFileByUrlFeature = createFeature({
|
|
4
|
+
name: "FileManager/GetFileByUrl",
|
|
5
|
+
register (container) {
|
|
6
|
+
container.register(GetFileByUrlUseCase);
|
|
7
|
+
}
|
|
8
|
+
});
|
|
9
|
+
export { GetFileByUrlFeature };
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=feature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/file/GetFileByUrl/feature.js","sources":["../../../../src/features/file/GetFileByUrl/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { GetFileByUrlUseCase } from \"./GetFileByUrlUseCase.js\";\n\nexport const GetFileByUrlFeature = createFeature({\n name: \"FileManager/GetFileByUrl\",\n register(container) {\n container.register(GetFileByUrlUseCase);\n }\n});\n"],"names":["GetFileByUrlFeature","createFeature","container","GetFileByUrlUseCase"],"mappings":";;AAGO,MAAMA,sBAAsBC,cAAc;IAC7C,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,QAAQ,CAACC;IACvB;AACJ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { GetFileByUrlUseCase } from "./abstractions.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { GetFileByUrlUseCase } from "./abstractions.js";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Result } from "@webiny/feature/api";
|
|
2
|
+
import { type FileNotFoundError, type FilePersistenceError } from "../../../domain/file/errors.js";
|
|
3
|
+
export interface FileContents {
|
|
4
|
+
buffer: Buffer;
|
|
5
|
+
contentType: string;
|
|
6
|
+
}
|
|
7
|
+
export interface IGetFileContentsByIdUseCase {
|
|
8
|
+
execute(fileId: string): Promise<Result<FileContents, GetFileContentsByIdError>>;
|
|
9
|
+
}
|
|
10
|
+
export interface IGetFileContentsByIdUseCaseErrors {
|
|
11
|
+
notFound: FileNotFoundError;
|
|
12
|
+
persistence: FilePersistenceError;
|
|
13
|
+
}
|
|
14
|
+
type GetFileContentsByIdError = IGetFileContentsByIdUseCaseErrors[keyof IGetFileContentsByIdUseCaseErrors];
|
|
15
|
+
export declare const GetFileContentsByIdUseCase: import("@webiny/di").Abstraction<IGetFileContentsByIdUseCase>;
|
|
16
|
+
export declare namespace GetFileContentsByIdUseCase {
|
|
17
|
+
type Interface = IGetFileContentsByIdUseCase;
|
|
18
|
+
type Error = GetFileContentsByIdError;
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/file/GetFileContentsById/abstractions.js","sources":["../../../../src/features/file/GetFileContentsById/abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { Result } from \"@webiny/feature/api\";\nimport { type FileNotFoundError, type FilePersistenceError } from \"~/domain/file/errors.js\";\n\nexport interface FileContents {\n buffer: Buffer;\n contentType: string;\n}\n\nexport interface IGetFileContentsByIdUseCase {\n execute(fileId: string): Promise<Result<FileContents, GetFileContentsByIdError>>;\n}\n\nexport interface IGetFileContentsByIdUseCaseErrors {\n notFound: FileNotFoundError;\n persistence: FilePersistenceError;\n}\n\ntype GetFileContentsByIdError =\n IGetFileContentsByIdUseCaseErrors[keyof IGetFileContentsByIdUseCaseErrors];\n\nexport const GetFileContentsByIdUseCase = createAbstraction<IGetFileContentsByIdUseCase>(\n \"GetFileContentsByIdUseCase\"\n);\n\nexport namespace GetFileContentsByIdUseCase {\n export type Interface = IGetFileContentsByIdUseCase;\n export type Error = GetFileContentsByIdError;\n}\n"],"names":["GetFileContentsByIdUseCase","createAbstraction"],"mappings":";AAqBO,MAAMA,6BAA6BC,kBACtC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { GetFileContentsByIdUseCase, type FileContents } from "./abstractions.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { GetFileContentsByIdUseCase } from "./abstractions.js";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Result } from "@webiny/feature/api";
|
|
2
|
+
import type { FileContents } from "../../../features/file/GetFileContentsById/abstractions.js";
|
|
3
|
+
import { type FileNotFoundError, type FilePersistenceError } from "../../../domain/file/errors.js";
|
|
4
|
+
export interface IGetFileContentsByKeyUseCase {
|
|
5
|
+
execute(key: string): Promise<Result<FileContents, GetFileContentsByKeyError>>;
|
|
6
|
+
}
|
|
7
|
+
export interface IGetFileContentsByKeyUseCaseErrors {
|
|
8
|
+
notFound: FileNotFoundError;
|
|
9
|
+
persistence: FilePersistenceError;
|
|
10
|
+
}
|
|
11
|
+
type GetFileContentsByKeyError = IGetFileContentsByKeyUseCaseErrors[keyof IGetFileContentsByKeyUseCaseErrors];
|
|
12
|
+
export declare const GetFileContentsByKeyUseCase: import("@webiny/di").Abstraction<IGetFileContentsByKeyUseCase>;
|
|
13
|
+
export declare namespace GetFileContentsByKeyUseCase {
|
|
14
|
+
type Interface = IGetFileContentsByKeyUseCase;
|
|
15
|
+
type Error = GetFileContentsByKeyError;
|
|
16
|
+
}
|
|
17
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/file/GetFileContentsByKey/abstractions.js","sources":["../../../../src/features/file/GetFileContentsByKey/abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { Result } from \"@webiny/feature/api\";\nimport type { FileContents } from \"~/features/file/GetFileContentsById/abstractions.js\";\nimport { type FileNotFoundError, type FilePersistenceError } from \"~/domain/file/errors.js\";\n\nexport interface IGetFileContentsByKeyUseCase {\n execute(key: string): Promise<Result<FileContents, GetFileContentsByKeyError>>;\n}\n\nexport interface IGetFileContentsByKeyUseCaseErrors {\n notFound: FileNotFoundError;\n persistence: FilePersistenceError;\n}\n\ntype GetFileContentsByKeyError =\n IGetFileContentsByKeyUseCaseErrors[keyof IGetFileContentsByKeyUseCaseErrors];\n\nexport const GetFileContentsByKeyUseCase = createAbstraction<IGetFileContentsByKeyUseCase>(\n \"GetFileContentsByKeyUseCase\"\n);\n\nexport namespace GetFileContentsByKeyUseCase {\n export type Interface = IGetFileContentsByKeyUseCase;\n export type Error = GetFileContentsByKeyError;\n}\n"],"names":["GetFileContentsByKeyUseCase","createAbstraction"],"mappings":";AAiBO,MAAMA,8BAA8BC,kBACvC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { GetFileContentsByKeyUseCase } from "./abstractions.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { GetFileContentsByKeyUseCase } from "./abstractions.js";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Result } from "@webiny/feature/api";
|
|
2
|
+
import { ListLatestEntriesUseCase } from "@webiny/api-headless-cms/features/contentEntry/ListEntries/index.js";
|
|
3
|
+
import { ListFilesInput, ListFilesOutput, ListFilesRepository as RepositoryAbstraction } from "./abstractions.js";
|
|
4
|
+
import { FileModel } from "../../../domain/file/abstractions.js";
|
|
5
|
+
import { CmsWhereMapper } from "@webiny/api-headless-cms";
|
|
6
|
+
import { CmsSortMapper } from "@webiny/api-headless-cms";
|
|
7
|
+
declare class ListFilesRepositoryImpl implements RepositoryAbstraction.Interface {
|
|
8
|
+
private listLatestEntries;
|
|
9
|
+
private fileModel;
|
|
10
|
+
private cmsWhereMapper;
|
|
11
|
+
private cmsSortMapper;
|
|
12
|
+
constructor(listLatestEntries: ListLatestEntriesUseCase.Interface, fileModel: FileModel.Interface, cmsWhereMapper: CmsWhereMapper.Interface, cmsSortMapper: CmsSortMapper.Interface);
|
|
13
|
+
execute(input: ListFilesInput): Promise<Result<ListFilesOutput, RepositoryAbstraction.Error>>;
|
|
14
|
+
}
|
|
15
|
+
export declare const ListFilesRepository: typeof ListFilesRepositoryImpl & {
|
|
16
|
+
__abstraction: import("@webiny/di").Abstraction<import("./abstractions.js").IListFilesRepository>;
|
|
17
|
+
};
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Result } from "@webiny/feature/api";
|
|
2
|
+
import { ListLatestEntriesUseCase } from "@webiny/api-headless-cms/features/contentEntry/ListEntries/index.js";
|
|
3
|
+
import { ListFilesRepository } from "./abstractions.js";
|
|
4
|
+
import { FileModel } from "../../../domain/file/abstractions.js";
|
|
5
|
+
import { FilePersistenceError } from "../../../domain/file/errors.js";
|
|
6
|
+
import { EntryToFileMapper } from "../shared/EntryToFileMapper.js";
|
|
7
|
+
import { CmsSortMapper, CmsWhereMapper } from "@webiny/api-headless-cms";
|
|
8
|
+
class ListFilesRepositoryImpl {
|
|
9
|
+
constructor(listLatestEntries, fileModel, cmsWhereMapper, cmsSortMapper){
|
|
10
|
+
this.listLatestEntries = listLatestEntries;
|
|
11
|
+
this.fileModel = fileModel;
|
|
12
|
+
this.cmsWhereMapper = cmsWhereMapper;
|
|
13
|
+
this.cmsSortMapper = cmsSortMapper;
|
|
14
|
+
}
|
|
15
|
+
async execute(input) {
|
|
16
|
+
const where = this.cmsWhereMapper.map({
|
|
17
|
+
input: input.where || {},
|
|
18
|
+
fields: this.fileModel.fields
|
|
19
|
+
});
|
|
20
|
+
const sort = this.cmsSortMapper.map({
|
|
21
|
+
input: input.sort,
|
|
22
|
+
fields: this.fileModel.fields
|
|
23
|
+
});
|
|
24
|
+
const result = await this.listLatestEntries.execute(this.fileModel, {
|
|
25
|
+
where,
|
|
26
|
+
limit: input.limit || 40,
|
|
27
|
+
after: input.after || void 0,
|
|
28
|
+
sort: sort || [
|
|
29
|
+
"id_DESC"
|
|
30
|
+
],
|
|
31
|
+
search: input.search
|
|
32
|
+
});
|
|
33
|
+
if (result.isFail()) return Result.fail(new FilePersistenceError(result.error));
|
|
34
|
+
const { entries, meta } = result.value;
|
|
35
|
+
const files = entries.map((entry)=>EntryToFileMapper.toFile(entry));
|
|
36
|
+
return Result.ok({
|
|
37
|
+
items: files,
|
|
38
|
+
meta
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
const ListFilesRepository_ListFilesRepository = ListFilesRepository.createImplementation({
|
|
43
|
+
implementation: ListFilesRepositoryImpl,
|
|
44
|
+
dependencies: [
|
|
45
|
+
ListLatestEntriesUseCase,
|
|
46
|
+
FileModel,
|
|
47
|
+
CmsWhereMapper,
|
|
48
|
+
CmsSortMapper
|
|
49
|
+
]
|
|
50
|
+
});
|
|
51
|
+
export { ListFilesRepository_ListFilesRepository as ListFilesRepository };
|
|
52
|
+
|
|
53
|
+
//# sourceMappingURL=ListFilesRepository.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/file/ListFiles/ListFilesRepository.js","sources":["../../../../src/features/file/ListFiles/ListFilesRepository.ts"],"sourcesContent":["import { Result } from \"@webiny/feature/api\";\nimport { ListLatestEntriesUseCase } from \"@webiny/api-headless-cms/features/contentEntry/ListEntries/index.js\";\nimport {\n ListFilesInput,\n ListFilesOutput,\n ListFilesRepository as RepositoryAbstraction\n} from \"./abstractions.js\";\nimport { FileModel } from \"~/domain/file/abstractions.js\";\nimport { FilePersistenceError } from \"~/domain/file/errors.js\";\nimport { EntryToFileMapper } from \"../shared/EntryToFileMapper.js\";\nimport { CmsWhereMapper } from \"@webiny/api-headless-cms\";\nimport { CmsSortMapper } from \"@webiny/api-headless-cms\";\nimport { GenericRecord } from \"@webiny/api/types.js\";\n\nclass ListFilesRepositoryImpl implements RepositoryAbstraction.Interface {\n constructor(\n private listLatestEntries: ListLatestEntriesUseCase.Interface,\n private fileModel: FileModel.Interface,\n private cmsWhereMapper: CmsWhereMapper.Interface,\n private cmsSortMapper: CmsSortMapper.Interface\n ) {}\n\n async execute(\n input: ListFilesInput\n ): Promise<Result<ListFilesOutput, RepositoryAbstraction.Error>> {\n const where = this.cmsWhereMapper.map<GenericRecord>({\n input: input.where || {},\n fields: this.fileModel.fields\n });\n\n const sort = this.cmsSortMapper.map({\n input: input.sort,\n fields: this.fileModel.fields\n });\n\n const result = await this.listLatestEntries.execute(this.fileModel, {\n where,\n limit: input.limit || 40,\n after: input.after || undefined,\n sort: sort || [\"id_DESC\"],\n search: input.search\n });\n\n if (result.isFail()) {\n return Result.fail(new FilePersistenceError(result.error));\n }\n\n const { entries, meta } = result.value;\n\n const files = entries.map(entry => EntryToFileMapper.toFile(entry));\n\n return Result.ok({\n items: files,\n meta\n });\n }\n}\n\nexport const ListFilesRepository = RepositoryAbstraction.createImplementation({\n implementation: ListFilesRepositoryImpl,\n dependencies: [ListLatestEntriesUseCase, FileModel, CmsWhereMapper, CmsSortMapper]\n});\n"],"names":["ListFilesRepositoryImpl","listLatestEntries","fileModel","cmsWhereMapper","cmsSortMapper","input","where","sort","result","undefined","Result","FilePersistenceError","entries","meta","files","entry","EntryToFileMapper","ListFilesRepository","RepositoryAbstraction","ListLatestEntriesUseCase","FileModel","CmsWhereMapper","CmsSortMapper"],"mappings":";;;;;;;AAcA,MAAMA;IACF,YACYC,iBAAqD,EACrDC,SAA8B,EAC9BC,cAAwC,EACxCC,aAAsC,CAChD;aAJUH,iBAAiB,GAAjBA;aACAC,SAAS,GAATA;aACAC,cAAc,GAAdA;aACAC,aAAa,GAAbA;IACT;IAEH,MAAM,QACFC,KAAqB,EACwC;QAC7D,MAAMC,QAAQ,IAAI,CAAC,cAAc,CAAC,GAAG,CAAgB;YACjD,OAAOD,MAAM,KAAK,IAAI,CAAC;YACvB,QAAQ,IAAI,CAAC,SAAS,CAAC,MAAM;QACjC;QAEA,MAAME,OAAO,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC;YAChC,OAAOF,MAAM,IAAI;YACjB,QAAQ,IAAI,CAAC,SAAS,CAAC,MAAM;QACjC;QAEA,MAAMG,SAAS,MAAM,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE;YAChEF;YACA,OAAOD,MAAM,KAAK,IAAI;YACtB,OAAOA,MAAM,KAAK,IAAII;YACtB,MAAMF,QAAQ;gBAAC;aAAU;YACzB,QAAQF,MAAM,MAAM;QACxB;QAEA,IAAIG,OAAO,MAAM,IACb,OAAOE,OAAO,IAAI,CAAC,IAAIC,qBAAqBH,OAAO,KAAK;QAG5D,MAAM,EAAEI,OAAO,EAAEC,IAAI,EAAE,GAAGL,OAAO,KAAK;QAEtC,MAAMM,QAAQF,QAAQ,GAAG,CAACG,CAAAA,QAASC,kBAAkB,MAAM,CAACD;QAE5D,OAAOL,OAAO,EAAE,CAAC;YACb,OAAOI;YACPD;QACJ;IACJ;AACJ;AAEO,MAAMI,0CAAsBC,oBAAAA,oBAA0C,CAAC;IAC1E,gBAAgBlB;IAChB,cAAc;QAACmB;QAA0BC;QAAWC;QAAgBC;KAAc;AACtF"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Result } from "@webiny/feature/api";
|
|
2
|
+
import { ListFilesUseCase as UseCaseAbstraction, ListFilesInput, ListFilesOutput, ListFilesRepository } from "./abstractions.js";
|
|
3
|
+
import { FmPermissions } from "../../../features/shared/abstractions.js";
|
|
4
|
+
import { IdentityContext } from "@webiny/api-core/features/security/IdentityContext/index.js";
|
|
5
|
+
declare class ListFilesUseCaseImpl implements UseCaseAbstraction.Interface {
|
|
6
|
+
private permissions;
|
|
7
|
+
private identityContext;
|
|
8
|
+
private repository;
|
|
9
|
+
constructor(permissions: FmPermissions.Interface, identityContext: IdentityContext.Interface, repository: ListFilesRepository.Interface);
|
|
10
|
+
execute(input: ListFilesInput): Promise<Result<ListFilesOutput, UseCaseAbstraction.Error>>;
|
|
11
|
+
}
|
|
12
|
+
export declare const ListFilesUseCase: typeof ListFilesUseCaseImpl & {
|
|
13
|
+
__abstraction: import("@webiny/di").Abstraction<import("./abstractions.js").IListFilesUseCase>;
|
|
14
|
+
};
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Result } from "@webiny/feature/api";
|
|
2
|
+
import { ListFilesRepository, ListFilesUseCase } from "./abstractions.js";
|
|
3
|
+
import { FileNotAuthorizedError } from "../../../domain/file/errors.js";
|
|
4
|
+
import { FmPermissions } from "../../shared/abstractions.js";
|
|
5
|
+
import { IdentityContext } from "@webiny/api-core/features/security/IdentityContext/index.js";
|
|
6
|
+
class ListFilesUseCaseImpl {
|
|
7
|
+
constructor(permissions, identityContext, repository){
|
|
8
|
+
this.permissions = permissions;
|
|
9
|
+
this.identityContext = identityContext;
|
|
10
|
+
this.repository = repository;
|
|
11
|
+
}
|
|
12
|
+
async execute(input) {
|
|
13
|
+
const hasPermission = await this.permissions.canRead("file");
|
|
14
|
+
if (!hasPermission) return Result.fail(new FileNotAuthorizedError());
|
|
15
|
+
const where = {
|
|
16
|
+
...input.where || {}
|
|
17
|
+
};
|
|
18
|
+
if (await this.permissions.onlyOwnRecords("file")) {
|
|
19
|
+
const identity = this.identityContext.getIdentity();
|
|
20
|
+
where.createdBy = identity.id;
|
|
21
|
+
}
|
|
22
|
+
const result = await this.repository.execute({
|
|
23
|
+
...input,
|
|
24
|
+
where,
|
|
25
|
+
limit: input.limit || 40,
|
|
26
|
+
sort: input.sort && input.sort.length > 0 ? input.sort : [
|
|
27
|
+
"id_DESC"
|
|
28
|
+
]
|
|
29
|
+
});
|
|
30
|
+
if (result.isFail()) return Result.fail(result.error);
|
|
31
|
+
return Result.ok(result.value);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
const ListFilesUseCase_ListFilesUseCase = ListFilesUseCase.createImplementation({
|
|
35
|
+
implementation: ListFilesUseCaseImpl,
|
|
36
|
+
dependencies: [
|
|
37
|
+
FmPermissions,
|
|
38
|
+
IdentityContext,
|
|
39
|
+
ListFilesRepository
|
|
40
|
+
]
|
|
41
|
+
});
|
|
42
|
+
export { ListFilesUseCase_ListFilesUseCase as ListFilesUseCase };
|
|
43
|
+
|
|
44
|
+
//# sourceMappingURL=ListFilesUseCase.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/file/ListFiles/ListFilesUseCase.js","sources":["../../../../src/features/file/ListFiles/ListFilesUseCase.ts"],"sourcesContent":["import { Result } from \"@webiny/feature/api\";\nimport {\n ListFilesUseCase as UseCaseAbstraction,\n ListFilesInput,\n ListFilesOutput,\n ListFilesRepository\n} from \"./abstractions.js\";\nimport { FileNotAuthorizedError } from \"~/domain/file/errors.js\";\nimport { FmPermissions } from \"~/features/shared/abstractions.js\";\nimport { IdentityContext } from \"@webiny/api-core/features/security/IdentityContext/index.js\";\n\nclass ListFilesUseCaseImpl implements UseCaseAbstraction.Interface {\n constructor(\n private permissions: FmPermissions.Interface,\n private identityContext: IdentityContext.Interface,\n private repository: ListFilesRepository.Interface\n ) {}\n\n async execute(\n input: ListFilesInput\n ): Promise<Result<ListFilesOutput, UseCaseAbstraction.Error>> {\n const hasPermission = await this.permissions.canRead(\"file\");\n if (!hasPermission) {\n return Result.fail(new FileNotAuthorizedError());\n }\n\n // Build where clause.\n const where: ListFilesInput[\"where\"] = {\n ...(input.where || {})\n };\n\n // Filter by createdBy if user can only access own records.\n if (await this.permissions.onlyOwnRecords(\"file\")) {\n const identity = this.identityContext.getIdentity();\n where.createdBy = identity.id;\n }\n\n const result = await this.repository.execute({\n ...input,\n where,\n limit: input.limit || 40,\n sort: input.sort && input.sort.length > 0 ? input.sort : [\"id_DESC\"]\n });\n\n if (result.isFail()) {\n return Result.fail(result.error);\n }\n\n return Result.ok(result.value);\n }\n}\n\nexport const ListFilesUseCase = UseCaseAbstraction.createImplementation({\n implementation: ListFilesUseCaseImpl,\n dependencies: [FmPermissions, IdentityContext, ListFilesRepository]\n});\n"],"names":["ListFilesUseCaseImpl","permissions","identityContext","repository","input","hasPermission","Result","FileNotAuthorizedError","where","identity","result","ListFilesUseCase","UseCaseAbstraction","FmPermissions","IdentityContext","ListFilesRepository"],"mappings":";;;;;AAWA,MAAMA;IACF,YACYC,WAAoC,EACpCC,eAA0C,EAC1CC,UAAyC,CACnD;aAHUF,WAAW,GAAXA;aACAC,eAAe,GAAfA;aACAC,UAAU,GAAVA;IACT;IAEH,MAAM,QACFC,KAAqB,EACqC;QAC1D,MAAMC,gBAAgB,MAAM,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC;QACrD,IAAI,CAACA,eACD,OAAOC,OAAO,IAAI,CAAC,IAAIC;QAI3B,MAAMC,QAAiC;YACnC,GAAIJ,MAAM,KAAK,IAAI,CAAC,CAAC;QACzB;QAGA,IAAI,MAAM,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,SAAS;YAC/C,MAAMK,WAAW,IAAI,CAAC,eAAe,CAAC,WAAW;YACjDD,MAAM,SAAS,GAAGC,SAAS,EAAE;QACjC;QAEA,MAAMC,SAAS,MAAM,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;YACzC,GAAGN,KAAK;YACRI;YACA,OAAOJ,MAAM,KAAK,IAAI;YACtB,MAAMA,MAAM,IAAI,IAAIA,MAAM,IAAI,CAAC,MAAM,GAAG,IAAIA,MAAM,IAAI,GAAG;gBAAC;aAAU;QACxE;QAEA,IAAIM,OAAO,MAAM,IACb,OAAOJ,OAAO,IAAI,CAACI,OAAO,KAAK;QAGnC,OAAOJ,OAAO,EAAE,CAACI,OAAO,KAAK;IACjC;AACJ;AAEO,MAAMC,oCAAmBC,iBAAAA,oBAAuC,CAAC;IACpE,gBAAgBZ;IAChB,cAAc;QAACa;QAAeC;QAAiBC;KAAoB;AACvE"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { Result } from "@webiny/feature/api";
|
|
2
|
+
import type { File } from "../../../domain/file/types.js";
|
|
3
|
+
import { type FilePersistenceError, FileNotAuthorizedError } from "../../../domain/file/errors.js";
|
|
4
|
+
import type { CmsEntryMeta } from "@webiny/api-headless-cms/types";
|
|
5
|
+
export interface ListFilesInput {
|
|
6
|
+
limit?: number;
|
|
7
|
+
after?: string | null;
|
|
8
|
+
where?: Record<string, any>;
|
|
9
|
+
sort?: Array<`${string}_ASC` | `${string}_DESC`>;
|
|
10
|
+
search?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface ListFilesOutput {
|
|
13
|
+
items: File[];
|
|
14
|
+
meta: CmsEntryMeta;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* ListFiles repository interface
|
|
18
|
+
*/
|
|
19
|
+
export interface IListFilesRepository {
|
|
20
|
+
execute(input: ListFilesInput): Promise<Result<ListFilesOutput, RepositoryError>>;
|
|
21
|
+
}
|
|
22
|
+
export interface IListFilesRepositoryErrors {
|
|
23
|
+
persistence: FilePersistenceError;
|
|
24
|
+
}
|
|
25
|
+
type RepositoryError = IListFilesRepositoryErrors[keyof IListFilesRepositoryErrors];
|
|
26
|
+
/** Fetch files from storage with filtering. */
|
|
27
|
+
export declare const ListFilesRepository: import("@webiny/di").Abstraction<IListFilesRepository>;
|
|
28
|
+
export declare namespace ListFilesRepository {
|
|
29
|
+
type Interface = IListFilesRepository;
|
|
30
|
+
type Error = RepositoryError;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* ListFiles use case interface
|
|
34
|
+
*/
|
|
35
|
+
export interface IListFilesUseCase {
|
|
36
|
+
execute(input: ListFilesInput): Promise<Result<ListFilesOutput, UseCaseError>>;
|
|
37
|
+
}
|
|
38
|
+
export interface IListFilesUseCaseErrors {
|
|
39
|
+
notAuthorized: FileNotAuthorizedError;
|
|
40
|
+
persistence: FilePersistenceError;
|
|
41
|
+
}
|
|
42
|
+
type UseCaseError = IListFilesUseCaseErrors[keyof IListFilesUseCaseErrors];
|
|
43
|
+
/** List files with filtering and pagination. */
|
|
44
|
+
export declare const ListFilesUseCase: import("@webiny/di").Abstraction<IListFilesUseCase>;
|
|
45
|
+
export declare namespace ListFilesUseCase {
|
|
46
|
+
type Interface = IListFilesUseCase;
|
|
47
|
+
type Error = UseCaseError;
|
|
48
|
+
}
|
|
49
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { createAbstraction } from "@webiny/feature/api";
|
|
2
|
+
const ListFilesRepository = createAbstraction("ListFilesRepository");
|
|
3
|
+
const ListFilesUseCase = createAbstraction("ListFilesUseCase");
|
|
4
|
+
export { ListFilesRepository, ListFilesUseCase };
|
|
5
|
+
|
|
6
|
+
//# sourceMappingURL=abstractions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/file/ListFiles/abstractions.js","sources":["../../../../src/features/file/ListFiles/abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { Result } from \"@webiny/feature/api\";\nimport type { File } from \"~/domain/file/types.js\";\nimport { type FilePersistenceError, FileNotAuthorizedError } from \"~/domain/file/errors.js\";\nimport type { CmsEntryMeta } from \"@webiny/api-headless-cms/types\";\n\nexport interface ListFilesInput {\n limit?: number;\n after?: string | null;\n where?: Record<string, any>;\n sort?: Array<`${string}_ASC` | `${string}_DESC`>;\n search?: string;\n}\n\nexport interface ListFilesOutput {\n items: File[];\n meta: CmsEntryMeta;\n}\n\n/**\n * ListFiles repository interface\n */\nexport interface IListFilesRepository {\n execute(input: ListFilesInput): Promise<Result<ListFilesOutput, RepositoryError>>;\n}\n\nexport interface IListFilesRepositoryErrors {\n persistence: FilePersistenceError;\n}\n\ntype RepositoryError = IListFilesRepositoryErrors[keyof IListFilesRepositoryErrors];\n\n/** Fetch files from storage with filtering. */\nexport const ListFilesRepository = createAbstraction<IListFilesRepository>(\"ListFilesRepository\");\n\nexport namespace ListFilesRepository {\n export type Interface = IListFilesRepository;\n export type Error = RepositoryError;\n}\n\n/**\n * ListFiles use case interface\n */\nexport interface IListFilesUseCase {\n execute(input: ListFilesInput): Promise<Result<ListFilesOutput, UseCaseError>>;\n}\n\nexport interface IListFilesUseCaseErrors {\n notAuthorized: FileNotAuthorizedError;\n persistence: FilePersistenceError;\n}\n\ntype UseCaseError = IListFilesUseCaseErrors[keyof IListFilesUseCaseErrors];\n\n/** List files with filtering and pagination. */\nexport const ListFilesUseCase = createAbstraction<IListFilesUseCase>(\"ListFilesUseCase\");\n\nexport namespace ListFilesUseCase {\n export type Interface = IListFilesUseCase;\n export type Error = UseCaseError;\n}\n"],"names":["ListFilesRepository","createAbstraction","ListFilesUseCase"],"mappings":";AAiCO,MAAMA,sBAAsBC,kBAAwC;AAsBpE,MAAMC,mBAAmBD,kBAAqC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { createFeature } from "@webiny/feature/api";
|
|
2
|
+
import { ListFilesRepository } from "./ListFilesRepository.js";
|
|
3
|
+
import { ListFilesUseCase } from "./ListFilesUseCase.js";
|
|
4
|
+
const ListFilesFeature = createFeature({
|
|
5
|
+
name: "FileManager/ListFiles",
|
|
6
|
+
register (container) {
|
|
7
|
+
container.register(ListFilesUseCase);
|
|
8
|
+
container.register(ListFilesRepository).inSingletonScope();
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
export { ListFilesFeature };
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=feature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/file/ListFiles/feature.js","sources":["../../../../src/features/file/ListFiles/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { ListFilesRepository } from \"./ListFilesRepository.js\";\nimport { ListFilesUseCase } from \"./ListFilesUseCase.js\";\n\nexport const ListFilesFeature = createFeature({\n name: \"FileManager/ListFiles\",\n register(container) {\n container.register(ListFilesUseCase);\n container.register(ListFilesRepository).inSingletonScope();\n }\n});\n"],"names":["ListFilesFeature","createFeature","container","ListFilesUseCase","ListFilesRepository"],"mappings":";;;AAIO,MAAMA,mBAAmBC,cAAc;IAC1C,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,QAAQ,CAACC;QACnBD,UAAU,QAAQ,CAACE,qBAAqB,gBAAgB;IAC5D;AACJ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ListFilesUseCase } from "./abstractions.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ListFilesUseCase } from "./abstractions.js";
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { type IAiSdkTool } from "@webiny/api-core/features/ai/index.js";
|
|
3
|
+
import { ListFilesUseCase } from "../../../features/file/ListFiles/index.js";
|
|
4
|
+
declare const inputSchema: z.ZodObject<{
|
|
5
|
+
tag: z.ZodString;
|
|
6
|
+
}, z.core.$strip>;
|
|
7
|
+
type Input = z.infer<typeof inputSchema>;
|
|
8
|
+
interface ImageItem {
|
|
9
|
+
id: string;
|
|
10
|
+
name: string;
|
|
11
|
+
type: string;
|
|
12
|
+
tags: string[];
|
|
13
|
+
}
|
|
14
|
+
declare class ListImagesByTagToolImpl implements IAiSdkTool<Input> {
|
|
15
|
+
private listFiles;
|
|
16
|
+
readonly name = "listImagesByTag";
|
|
17
|
+
readonly description = "Lists images from the file manager filtered by a given tag. Returns name, type, and tags for each image.";
|
|
18
|
+
readonly inputSchema: z.ZodObject<{
|
|
19
|
+
tag: z.ZodString;
|
|
20
|
+
}, z.core.$strip>;
|
|
21
|
+
constructor(listFiles: ListFilesUseCase.Interface);
|
|
22
|
+
execute(input: Input): Promise<ImageItem[]>;
|
|
23
|
+
}
|
|
24
|
+
export declare const ListImagesByTagTool: typeof ListImagesByTagToolImpl & {
|
|
25
|
+
__abstraction: import("@webiny/di").Abstraction<IAiSdkTool<any>>;
|
|
26
|
+
};
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { AiSdkTool } from "@webiny/api-core/features/ai/index.js";
|
|
3
|
+
import { ListFilesUseCase } from "../ListFiles/index.js";
|
|
4
|
+
const inputSchema = z.object({
|
|
5
|
+
tag: z.string().describe("Tag to filter images by")
|
|
6
|
+
});
|
|
7
|
+
class ListImagesByTagToolImpl {
|
|
8
|
+
constructor(listFiles){
|
|
9
|
+
this.listFiles = listFiles;
|
|
10
|
+
this.name = "listImagesByTag";
|
|
11
|
+
this.description = "Lists images from the file manager filtered by a given tag. Returns name, type, and tags for each image.";
|
|
12
|
+
this.inputSchema = inputSchema;
|
|
13
|
+
}
|
|
14
|
+
async execute(input) {
|
|
15
|
+
console.log("Call images tool", input);
|
|
16
|
+
const result = await this.listFiles.execute({
|
|
17
|
+
where: {
|
|
18
|
+
type_startsWith: "image/",
|
|
19
|
+
tags_in: [
|
|
20
|
+
input.tag
|
|
21
|
+
]
|
|
22
|
+
},
|
|
23
|
+
limit: 50
|
|
24
|
+
});
|
|
25
|
+
if (result.isFail()) return [];
|
|
26
|
+
return result.value.items.map((file)=>({
|
|
27
|
+
id: file.id,
|
|
28
|
+
name: file.name,
|
|
29
|
+
type: file.type,
|
|
30
|
+
tags: file.tags
|
|
31
|
+
}));
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
const ListImagesByTagTool = AiSdkTool.createImplementation({
|
|
35
|
+
implementation: ListImagesByTagToolImpl,
|
|
36
|
+
dependencies: [
|
|
37
|
+
ListFilesUseCase
|
|
38
|
+
]
|
|
39
|
+
});
|
|
40
|
+
export { ListImagesByTagTool };
|
|
41
|
+
|
|
42
|
+
//# sourceMappingURL=ListImagesByTagTool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/file/ListImagesByTagTool/ListImagesByTagTool.js","sources":["../../../../src/features/file/ListImagesByTagTool/ListImagesByTagTool.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { AiSdkTool, type IAiSdkTool } from \"@webiny/api-core/features/ai/index.js\";\nimport { ListFilesUseCase } from \"~/features/file/ListFiles/index.js\";\n\nconst inputSchema = z.object({\n tag: z.string().describe(\"Tag to filter images by\")\n});\n\ntype Input = z.infer<typeof inputSchema>;\n\ninterface ImageItem {\n id: string;\n name: string;\n type: string;\n tags: string[];\n}\n\nclass ListImagesByTagToolImpl implements IAiSdkTool<Input> {\n readonly name = \"listImagesByTag\";\n readonly description =\n \"Lists images from the file manager filtered by a given tag. Returns name, type, and tags for each image.\";\n readonly inputSchema = inputSchema;\n\n constructor(private listFiles: ListFilesUseCase.Interface) {}\n\n async execute(input: Input): Promise<ImageItem[]> {\n console.log(\"Call images tool\", input);\n const result = await this.listFiles.execute({\n where: {\n type_startsWith: \"image/\",\n tags_in: [input.tag]\n },\n limit: 50\n });\n\n if (result.isFail()) {\n return [];\n }\n\n return result.value.items.map(file => ({\n id: file.id,\n name: file.name,\n type: file.type,\n tags: file.tags\n }));\n }\n}\n\nexport const ListImagesByTagTool = AiSdkTool.createImplementation({\n implementation: ListImagesByTagToolImpl,\n dependencies: [ListFilesUseCase]\n});\n"],"names":["inputSchema","z","ListImagesByTagToolImpl","listFiles","input","console","result","file","ListImagesByTagTool","AiSdkTool","ListFilesUseCase"],"mappings":";;;AAIA,MAAMA,cAAcC,EAAE,MAAM,CAAC;IACzB,KAAKA,EAAE,MAAM,GAAG,QAAQ,CAAC;AAC7B;AAWA,MAAMC;IAMF,YAAoBC,SAAqC,CAAE;aAAvCA,SAAS,GAATA;aALX,IAAI,GAAG;aACP,WAAW,GAChB;aACK,WAAW,GAAGH;IAEqC;IAE5D,MAAM,QAAQI,KAAY,EAAwB;QAC9CC,QAAQ,GAAG,CAAC,oBAAoBD;QAChC,MAAME,SAAS,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC;YACxC,OAAO;gBACH,iBAAiB;gBACjB,SAAS;oBAACF,MAAM,GAAG;iBAAC;YACxB;YACA,OAAO;QACX;QAEA,IAAIE,OAAO,MAAM,IACb,OAAO,EAAE;QAGb,OAAOA,OAAO,KAAK,CAAC,KAAK,CAAC,GAAG,CAACC,CAAAA,OAAS;gBACnC,IAAIA,KAAK,EAAE;gBACX,MAAMA,KAAK,IAAI;gBACf,MAAMA,KAAK,IAAI;gBACf,MAAMA,KAAK,IAAI;YACnB;IACJ;AACJ;AAEO,MAAMC,sBAAsBC,UAAU,oBAAoB,CAAC;IAC9D,gBAAgBP;IAChB,cAAc;QAACQ;KAAiB;AACpC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createFeature } from "@webiny/feature/api";
|
|
2
|
+
import { ListImagesByTagTool } from "./ListImagesByTagTool.js";
|
|
3
|
+
const ListImagesByTagToolFeature = createFeature({
|
|
4
|
+
name: "AiPowerUps/ListImagesByTagTool",
|
|
5
|
+
register (container) {
|
|
6
|
+
container.register(ListImagesByTagTool);
|
|
7
|
+
}
|
|
8
|
+
});
|
|
9
|
+
export { ListImagesByTagToolFeature };
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=feature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/file/ListImagesByTagTool/feature.js","sources":["../../../../src/features/file/ListImagesByTagTool/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { ListImagesByTagTool } from \"./ListImagesByTagTool.js\";\n\nexport const ListImagesByTagToolFeature = createFeature({\n name: \"AiPowerUps/ListImagesByTagTool\",\n register(container) {\n container.register(ListImagesByTagTool);\n }\n});\n"],"names":["ListImagesByTagToolFeature","createFeature","container","ListImagesByTagTool"],"mappings":";;AAGO,MAAMA,6BAA6BC,cAAc;IACpD,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,QAAQ,CAACC;IACvB;AACJ"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Result } from "@webiny/feature/api";
|
|
2
|
+
import { GetUniqueFieldValuesUseCase } from "@webiny/api-headless-cms/features/contentEntry/GetUniqueFieldValues";
|
|
3
|
+
import { ListTagsInput, ListTagsRepository as RepositoryAbstraction, TagItem } from "./abstractions.js";
|
|
4
|
+
import { FileModel } from "../../../domain/file/abstractions.js";
|
|
5
|
+
import { CmsWhereMapper } from "@webiny/api-headless-cms";
|
|
6
|
+
declare class ListTagsRepositoryImpl implements RepositoryAbstraction.Interface {
|
|
7
|
+
private getUniqueFieldValues;
|
|
8
|
+
private fileModel;
|
|
9
|
+
private cmsWhereMapper;
|
|
10
|
+
constructor(getUniqueFieldValues: GetUniqueFieldValuesUseCase.Interface, fileModel: FileModel.Interface, cmsWhereMapper: CmsWhereMapper.Interface);
|
|
11
|
+
execute(input: ListTagsInput): Promise<Result<TagItem[], RepositoryAbstraction.Error>>;
|
|
12
|
+
}
|
|
13
|
+
export declare const ListTagsRepository: typeof ListTagsRepositoryImpl & {
|
|
14
|
+
__abstraction: import("@webiny/di").Abstraction<import("./abstractions.js").IListTagsRepository>;
|
|
15
|
+
};
|
|
16
|
+
export {};
|