@webiny/api-file-manager 0.0.0-unstable.6f45466a1d → 0.0.0-unstable.7be00a75a9
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/contants.js +2 -1
- package/contants.js.map +1 -1
- package/delivery/AssetDelivery/Asset.js +50 -56
- package/delivery/AssetDelivery/Asset.js.map +1 -1
- package/delivery/AssetDelivery/AssetRequest.js +20 -19
- package/delivery/AssetDelivery/AssetRequest.js.map +1 -1
- package/delivery/AssetDelivery/abstractions/AssetReply.js +28 -27
- package/delivery/AssetDelivery/abstractions/AssetReply.js.map +1 -1
- package/delivery/AssetDelivery/createAssetDeliveryPluginLoader.js +4 -5
- package/delivery/AssetDelivery/createAssetDeliveryPluginLoader.js.map +1 -1
- package/delivery/index.d.ts +3 -12
- package/delivery/index.js +2 -8
- package/delivery/setupAssetDelivery.d.ts +1 -2
- package/delivery/setupAssetDelivery.js +60 -105
- package/delivery/setupAssetDelivery.js.map +1 -1
- package/domain/file/abstractions.js +2 -5
- package/domain/file/abstractions.js.map +1 -1
- package/domain/file/errors.js +67 -76
- package/domain/file/errors.js.map +1 -1
- package/domain/file/file.model.js +57 -45
- package/domain/file/file.model.js.map +1 -1
- package/domain/file/types.d.ts +2 -0
- package/domain/file/types.js +0 -3
- package/domain/identity/Identity.js +9 -8
- package/domain/identity/Identity.js.map +1 -1
- package/domain/permissionsSchema.d.ts +16 -0
- package/domain/permissionsSchema.js +30 -0
- package/domain/permissionsSchema.js.map +1 -0
- package/domain/settings/constants.js +2 -1
- package/domain/settings/constants.js.map +1 -1
- package/domain/settings/errors.js +22 -24
- package/domain/settings/errors.js.map +1 -1
- package/domain/settings/types.js +0 -3
- package/domain/settings/validation.d.ts +4 -12
- package/domain/settings/validation.js +18 -27
- package/domain/settings/validation.js.map +1 -1
- package/exports/api/file-manager/file.d.ts +12 -0
- package/exports/api/file-manager/file.js +12 -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 -1
- package/features/FileManagerFeature.js +17 -14
- package/features/FileManagerFeature.js.map +1 -1
- package/features/assetDelivery/FilesAssetRequestResolver.d.ts +9 -0
- package/features/assetDelivery/FilesAssetRequestResolver.js +29 -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.js +14 -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/abstractions.d.ts +54 -0
- package/features/assetDelivery/abstractions.js +11 -0
- package/features/assetDelivery/abstractions.js.map +1 -0
- package/features/assetDelivery/feature.d.ts +4 -0
- package/features/assetDelivery/feature.js +29 -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 +11 -0
- package/features/assetDelivery/privateFiles/PrivateFileAssetRequestResolver.js +31 -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 +65 -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 +9 -0
- package/features/assetDelivery/privateFiles/RedirectToPrivateUrlOutputStrategy.js +21 -0
- package/features/assetDelivery/privateFiles/RedirectToPrivateUrlOutputStrategy.js.map +1 -0
- package/features/assetDelivery/privateFiles/RedirectToPublicUrlOutputStrategy.d.ts +9 -0
- package/features/assetDelivery/privateFiles/RedirectToPublicUrlOutputStrategy.js +21 -0
- package/features/assetDelivery/privateFiles/RedirectToPublicUrlOutputStrategy.js.map +1 -0
- package/features/assetDelivery/transformation/PassthroughAssetTransformationStrategy.d.ts +9 -0
- package/features/assetDelivery/transformation/PassthroughAssetTransformationStrategy.js +13 -0
- package/features/assetDelivery/transformation/PassthroughAssetTransformationStrategy.js.map +1 -0
- package/features/assetDelivery/transformation/TransformationAssetProcessor.d.ts +11 -0
- package/features/assetDelivery/transformation/TransformationAssetProcessor.js +23 -0
- package/features/assetDelivery/transformation/TransformationAssetProcessor.js.map +1 -0
- package/features/file/CreateFile/CreateFileRepository.js +20 -18
- package/features/file/CreateFile/CreateFileRepository.js.map +1 -1
- package/features/file/CreateFile/CreateFileUseCase.d.ts +4 -4
- package/features/file/CreateFile/CreateFileUseCase.js +70 -78
- package/features/file/CreateFile/CreateFileUseCase.js.map +1 -1
- package/features/file/CreateFile/abstractions.d.ts +3 -0
- package/features/file/CreateFile/abstractions.js +3 -12
- package/features/file/CreateFile/abstractions.js.map +1 -1
- package/features/file/CreateFile/events.d.ts +8 -6
- package/features/file/CreateFile/events.js +18 -23
- package/features/file/CreateFile/events.js.map +1 -1
- package/features/file/CreateFile/feature.d.ts +4 -1
- package/features/file/CreateFile/feature.js +7 -6
- package/features/file/CreateFile/feature.js.map +1 -1
- package/features/file/CreateFile/index.d.ts +1 -1
- package/features/file/CreateFile/index.js +1 -3
- package/features/file/CreateFilesInBatch/CreateFilesInBatchRepository.js +15 -17
- package/features/file/CreateFilesInBatch/CreateFilesInBatchRepository.js.map +1 -1
- package/features/file/CreateFilesInBatch/CreateFilesInBatchUseCase.d.ts +4 -4
- package/features/file/CreateFilesInBatch/CreateFilesInBatchUseCase.js +61 -75
- package/features/file/CreateFilesInBatch/CreateFilesInBatchUseCase.js.map +1 -1
- package/features/file/CreateFilesInBatch/abstractions.d.ts +2 -0
- package/features/file/CreateFilesInBatch/abstractions.js +3 -12
- package/features/file/CreateFilesInBatch/abstractions.js.map +1 -1
- package/features/file/CreateFilesInBatch/events.d.ts +8 -6
- package/features/file/CreateFilesInBatch/events.js +18 -23
- package/features/file/CreateFilesInBatch/events.js.map +1 -1
- package/features/file/CreateFilesInBatch/feature.d.ts +4 -1
- package/features/file/CreateFilesInBatch/feature.js +7 -6
- package/features/file/CreateFilesInBatch/feature.js.map +1 -1
- package/features/file/CreateFilesInBatch/index.js +0 -2
- package/features/file/DeleteFile/DeleteFileRepository.js +21 -20
- package/features/file/DeleteFile/DeleteFileRepository.js.map +1 -1
- package/features/file/DeleteFile/DeleteFileUseCase.d.ts +4 -4
- package/features/file/DeleteFile/DeleteFileUseCase.js +33 -38
- package/features/file/DeleteFile/DeleteFileUseCase.js.map +1 -1
- package/features/file/DeleteFile/abstractions.d.ts +2 -0
- package/features/file/DeleteFile/abstractions.js +3 -12
- package/features/file/DeleteFile/abstractions.js.map +1 -1
- package/features/file/DeleteFile/events.d.ts +8 -6
- package/features/file/DeleteFile/events.js +18 -23
- package/features/file/DeleteFile/events.js.map +1 -1
- package/features/file/DeleteFile/feature.d.ts +4 -1
- package/features/file/DeleteFile/feature.js +7 -6
- package/features/file/DeleteFile/feature.js.map +1 -1
- package/features/file/DeleteFile/index.d.ts +1 -1
- package/features/file/DeleteFile/index.js +1 -3
- package/features/file/FileUrlGenerator/abstractions.d.ts +1 -0
- package/features/file/FileUrlGenerator/abstractions.js +2 -1
- package/features/file/FileUrlGenerator/abstractions.js.map +1 -1
- package/features/file/GetFile/GetFileRepository.js +22 -22
- package/features/file/GetFile/GetFileRepository.js.map +1 -1
- package/features/file/GetFile/GetFileUseCase.d.ts +3 -3
- package/features/file/GetFile/GetFileUseCase.js +20 -30
- package/features/file/GetFile/GetFileUseCase.js.map +1 -1
- package/features/file/GetFile/abstractions.d.ts +2 -0
- package/features/file/GetFile/abstractions.js +3 -12
- package/features/file/GetFile/abstractions.js.map +1 -1
- package/features/file/GetFile/feature.d.ts +4 -1
- package/features/file/GetFile/feature.js +7 -6
- package/features/file/GetFile/feature.js.map +1 -1
- package/features/file/GetFile/index.js +0 -2
- 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 +3 -1
- package/features/file/ListFiles/ListFilesRepository.js +42 -34
- package/features/file/ListFiles/ListFilesRepository.js.map +1 -1
- package/features/file/ListFiles/ListFilesUseCase.d.ts +4 -4
- package/features/file/ListFiles/ListFilesUseCase.js +35 -39
- package/features/file/ListFiles/ListFilesUseCase.js.map +1 -1
- package/features/file/ListFiles/abstractions.d.ts +2 -0
- package/features/file/ListFiles/abstractions.js +3 -12
- package/features/file/ListFiles/abstractions.js.map +1 -1
- package/features/file/ListFiles/feature.d.ts +4 -1
- package/features/file/ListFiles/feature.js +7 -6
- package/features/file/ListFiles/feature.js.map +1 -1
- package/features/file/ListFiles/index.js +0 -2
- 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.js +31 -36
- package/features/file/ListTags/ListTagsRepository.js.map +1 -1
- package/features/file/ListTags/ListTagsUseCase.d.ts +3 -3
- package/features/file/ListTags/ListTagsUseCase.js +22 -23
- package/features/file/ListTags/ListTagsUseCase.js.map +1 -1
- package/features/file/ListTags/abstractions.d.ts +2 -0
- package/features/file/ListTags/abstractions.js +3 -12
- package/features/file/ListTags/abstractions.js.map +1 -1
- package/features/file/ListTags/feature.d.ts +4 -1
- package/features/file/ListTags/feature.js +7 -6
- package/features/file/ListTags/feature.js.map +1 -1
- package/features/file/ListTags/index.js +0 -2
- package/features/file/UpdateFile/UpdateFileRepository.js +26 -28
- package/features/file/UpdateFile/UpdateFileRepository.js.map +1 -1
- package/features/file/UpdateFile/UpdateFileUseCase.d.ts +5 -5
- package/features/file/UpdateFile/UpdateFileUseCase.js +60 -70
- package/features/file/UpdateFile/UpdateFileUseCase.js.map +1 -1
- package/features/file/UpdateFile/abstractions.d.ts +3 -0
- package/features/file/UpdateFile/abstractions.js +3 -12
- package/features/file/UpdateFile/abstractions.js.map +1 -1
- package/features/file/UpdateFile/events.d.ts +8 -6
- package/features/file/UpdateFile/events.js +18 -23
- package/features/file/UpdateFile/events.js.map +1 -1
- package/features/file/UpdateFile/feature.d.ts +4 -1
- package/features/file/UpdateFile/feature.js +7 -6
- package/features/file/UpdateFile/feature.js.map +1 -1
- package/features/file/UpdateFile/index.d.ts +1 -1
- package/features/file/UpdateFile/index.js +1 -3
- package/features/file/shared/EntryToFileMapper.js +25 -23
- package/features/file/shared/EntryToFileMapper.js.map +1 -1
- package/features/file/shared/FileInputToEntryInputMapper.js +29 -27
- package/features/file/shared/FileInputToEntryInputMapper.js.map +1 -1
- package/features/file/shared/FileToEntryMapper.js +28 -26
- package/features/file/shared/FileToEntryMapper.js.map +1 -1
- 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.js +19 -19
- package/features/settings/GetSettings/GetSettingsUseCase.js.map +1 -1
- package/features/settings/GetSettings/abstractions.d.ts +1 -0
- package/features/settings/GetSettings/abstractions.js +2 -6
- package/features/settings/GetSettings/abstractions.js.map +1 -1
- package/features/settings/GetSettings/feature.d.ts +4 -1
- package/features/settings/GetSettings/feature.js +6 -5
- package/features/settings/GetSettings/feature.js.map +1 -1
- package/features/settings/SettingsInstaller/SettingsInstaller.d.ts +1 -1
- package/features/settings/SettingsInstaller/SettingsInstaller.js +26 -25
- package/features/settings/SettingsInstaller/SettingsInstaller.js.map +1 -1
- package/features/settings/SettingsInstaller/feature.d.ts +4 -1
- package/features/settings/SettingsInstaller/feature.js +6 -5
- package/features/settings/SettingsInstaller/feature.js.map +1 -1
- package/features/settings/UpdateSettings/UpdateSettingsUseCase.d.ts +1 -1
- package/features/settings/UpdateSettings/UpdateSettingsUseCase.js +42 -49
- package/features/settings/UpdateSettings/UpdateSettingsUseCase.js.map +1 -1
- package/features/settings/UpdateSettings/abstractions.d.ts +1 -0
- package/features/settings/UpdateSettings/abstractions.js +2 -6
- package/features/settings/UpdateSettings/abstractions.js.map +1 -1
- package/features/settings/UpdateSettings/events.d.ts +8 -6
- package/features/settings/UpdateSettings/events.js +18 -23
- package/features/settings/UpdateSettings/events.js.map +1 -1
- package/features/settings/UpdateSettings/feature.d.ts +4 -1
- package/features/settings/UpdateSettings/feature.js +6 -5
- package/features/settings/UpdateSettings/feature.js.map +1 -1
- package/features/settings/UpdateSettings/index.d.ts +1 -1
- package/features/settings/UpdateSettings/index.js +1 -3
- package/features/shared/abstractions.d.ts +1 -13
- package/features/shared/abstractions.js +1 -5
- package/graphql/baseSchema.js +30 -33
- package/graphql/baseSchema.js.map +1 -1
- package/graphql/createFilesTypeDefs.d.ts +3 -2
- package/graphql/createFilesTypeDefs.js +61 -66
- package/graphql/createFilesTypeDefs.js.map +1 -1
- package/graphql/filesSchema.js +79 -99
- package/graphql/filesSchema.js.map +1 -1
- package/graphql/getFileByUrl.js +45 -53
- package/graphql/getFileByUrl.js.map +1 -1
- package/graphql/index.js +37 -43
- package/graphql/index.js.map +1 -1
- package/graphql/utils.js +9 -14
- package/graphql/utils.js.map +1 -1
- package/index.d.ts +2 -2
- package/index.js +31 -39
- package/index.js.map +1 -1
- package/modelModifier/CmsModelModifier.js +40 -43
- package/modelModifier/CmsModelModifier.js.map +1 -1
- package/package.json +28 -23
- package/types.d.ts +1 -3
- package/types.js +1 -3
- package/delivery/AssetDelivery/AssetDeliveryConfig.d.ts +0 -65
- package/delivery/AssetDelivery/AssetDeliveryConfig.js +0 -94
- package/delivery/AssetDelivery/AssetDeliveryConfig.js.map +0 -1
- package/delivery/AssetDelivery/FilesAssetRequestResolver.d.ts +0 -6
- package/delivery/AssetDelivery/FilesAssetRequestResolver.js +0 -30
- package/delivery/AssetDelivery/FilesAssetRequestResolver.js.map +0 -1
- package/delivery/AssetDelivery/NullAssetOutputStrategy.d.ts +0 -4
- package/delivery/AssetDelivery/NullAssetOutputStrategy.js +0 -8
- package/delivery/AssetDelivery/NullAssetOutputStrategy.js.map +0 -1
- package/delivery/AssetDelivery/NullAssetReply.js +0 -13
- package/delivery/AssetDelivery/NullAssetReply.js.map +0 -1
- package/delivery/AssetDelivery/NullAssetResolver.d.ts +0 -5
- package/delivery/AssetDelivery/NullAssetResolver.js +0 -7
- package/delivery/AssetDelivery/NullAssetResolver.js.map +0 -1
- package/delivery/AssetDelivery/NullRequestResolver.d.ts +0 -4
- package/delivery/AssetDelivery/NullRequestResolver.js +0 -7
- package/delivery/AssetDelivery/NullRequestResolver.js.map +0 -1
- package/delivery/AssetDelivery/SetCacheControlHeaders.d.ts +0 -8
- package/delivery/AssetDelivery/SetCacheControlHeaders.js +0 -18
- package/delivery/AssetDelivery/SetCacheControlHeaders.js.map +0 -1
- package/delivery/AssetDelivery/SetResponseHeaders.d.ts +0 -18
- package/delivery/AssetDelivery/SetResponseHeaders.js +0 -18
- package/delivery/AssetDelivery/SetResponseHeaders.js.map +0 -1
- package/delivery/AssetDelivery/abstractions/AssetContentsReader.d.ts +0 -4
- package/delivery/AssetDelivery/abstractions/AssetContentsReader.js +0 -3
- package/delivery/AssetDelivery/abstractions/AssetContentsReader.js.map +0 -1
- package/delivery/AssetDelivery/abstractions/AssetOutputStrategy.d.ts +0 -4
- package/delivery/AssetDelivery/abstractions/AssetOutputStrategy.js +0 -3
- package/delivery/AssetDelivery/abstractions/AssetOutputStrategy.js.map +0 -1
- package/delivery/AssetDelivery/abstractions/AssetProcessor.d.ts +0 -4
- package/delivery/AssetDelivery/abstractions/AssetProcessor.js +0 -3
- package/delivery/AssetDelivery/abstractions/AssetProcessor.js.map +0 -1
- package/delivery/AssetDelivery/abstractions/AssetRequestResolver.d.ts +0 -5
- package/delivery/AssetDelivery/abstractions/AssetRequestResolver.js +0 -3
- package/delivery/AssetDelivery/abstractions/AssetRequestResolver.js.map +0 -1
- package/delivery/AssetDelivery/abstractions/AssetResolver.d.ts +0 -4
- package/delivery/AssetDelivery/abstractions/AssetResolver.js +0 -3
- package/delivery/AssetDelivery/abstractions/AssetResolver.js.map +0 -1
- package/delivery/AssetDelivery/abstractions/AssetTransformationStrategy.d.ts +0 -4
- package/delivery/AssetDelivery/abstractions/AssetTransformationStrategy.js +0 -3
- package/delivery/AssetDelivery/abstractions/AssetTransformationStrategy.js.map +0 -1
- package/delivery/AssetDelivery/privateFiles/AssetAuthorizer.d.ts +0 -4
- package/delivery/AssetDelivery/privateFiles/AssetAuthorizer.js +0 -3
- package/delivery/AssetDelivery/privateFiles/AssetAuthorizer.js.map +0 -1
- package/delivery/AssetDelivery/privateFiles/NotAuthorizedAssetReply.d.ts +0 -4
- package/delivery/AssetDelivery/privateFiles/NotAuthorizedAssetReply.js +0 -19
- package/delivery/AssetDelivery/privateFiles/NotAuthorizedAssetReply.js.map +0 -1
- package/delivery/AssetDelivery/privateFiles/NotAuthorizedOutputStrategy.d.ts +0 -4
- package/delivery/AssetDelivery/privateFiles/NotAuthorizedOutputStrategy.js +0 -8
- package/delivery/AssetDelivery/privateFiles/NotAuthorizedOutputStrategy.js.map +0 -1
- package/delivery/AssetDelivery/privateFiles/PrivateAuthenticatedAuthorizer.d.ts +0 -8
- package/delivery/AssetDelivery/privateFiles/PrivateAuthenticatedAuthorizer.js +0 -20
- package/delivery/AssetDelivery/privateFiles/PrivateAuthenticatedAuthorizer.js.map +0 -1
- package/delivery/AssetDelivery/privateFiles/PrivateCache.d.ts +0 -6
- package/delivery/AssetDelivery/privateFiles/PrivateCache.js +0 -21
- package/delivery/AssetDelivery/privateFiles/PrivateCache.js.map +0 -1
- package/delivery/AssetDelivery/privateFiles/PrivateFileAssetRequestResolver.d.ts +0 -8
- package/delivery/AssetDelivery/privateFiles/PrivateFileAssetRequestResolver.js +0 -30
- package/delivery/AssetDelivery/privateFiles/PrivateFileAssetRequestResolver.js.map +0 -1
- package/delivery/AssetDelivery/privateFiles/PrivateFilesAssetProcessor.d.ts +0 -13
- package/delivery/AssetDelivery/privateFiles/PrivateFilesAssetProcessor.js +0 -63
- package/delivery/AssetDelivery/privateFiles/PrivateFilesAssetProcessor.js.map +0 -1
- package/delivery/AssetDelivery/privateFiles/PublicCache.d.ts +0 -6
- package/delivery/AssetDelivery/privateFiles/PublicCache.js +0 -21
- package/delivery/AssetDelivery/privateFiles/PublicCache.js.map +0 -1
- package/delivery/AssetDelivery/privateFiles/RedirectToPrivateUrlOutputStrategy.d.ts +0 -7
- package/delivery/AssetDelivery/privateFiles/RedirectToPrivateUrlOutputStrategy.js +0 -20
- package/delivery/AssetDelivery/privateFiles/RedirectToPrivateUrlOutputStrategy.js.map +0 -1
- package/delivery/AssetDelivery/privateFiles/RedirectToPublicUrlOutputStrategy.d.ts +0 -7
- package/delivery/AssetDelivery/privateFiles/RedirectToPublicUrlOutputStrategy.js +0 -20
- package/delivery/AssetDelivery/privateFiles/RedirectToPublicUrlOutputStrategy.js.map +0 -1
- package/delivery/AssetDelivery/transformation/PassthroughAssetProcessor.d.ts +0 -4
- package/delivery/AssetDelivery/transformation/PassthroughAssetProcessor.js +0 -7
- package/delivery/AssetDelivery/transformation/PassthroughAssetProcessor.js.map +0 -1
- package/delivery/AssetDelivery/transformation/PassthroughAssetTransformationStrategy.d.ts +0 -4
- package/delivery/AssetDelivery/transformation/PassthroughAssetTransformationStrategy.js +0 -7
- package/delivery/AssetDelivery/transformation/PassthroughAssetTransformationStrategy.js.map +0 -1
- package/delivery/AssetDelivery/transformation/TransformationAssetProcessor.d.ts +0 -6
- package/delivery/AssetDelivery/transformation/TransformationAssetProcessor.js +0 -19
- package/delivery/AssetDelivery/transformation/TransformationAssetProcessor.js.map +0 -1
- package/delivery/index.js.map +0 -1
- package/domain/file/types.js.map +0 -1
- package/domain/settings/types.js.map +0 -1
- package/features/file/CreateFile/index.js.map +0 -1
- package/features/file/CreateFilesInBatch/index.js.map +0 -1
- package/features/file/DeleteFile/index.js.map +0 -1
- package/features/file/GetFile/index.js.map +0 -1
- package/features/file/ListFiles/index.js.map +0 -1
- package/features/file/ListTags/index.js.map +0 -1
- package/features/file/UpdateFile/index.js.map +0 -1
- package/features/settings/UpdateSettings/index.js.map +0 -1
- package/features/shared/abstractions.js.map +0 -1
- package/permissions/FilesPermissions.d.ts +0 -4
- package/permissions/FilesPermissions.js +0 -4
- package/permissions/FilesPermissions.js.map +0 -1
- package/permissions/SettingsPermissions.d.ts +0 -4
- package/permissions/SettingsPermissions.js +0 -4
- package/permissions/SettingsPermissions.js.map +0 -1
- package/types.js.map +0 -1
- /package/{delivery/AssetDelivery → features/assetDelivery}/NullAssetReply.d.ts +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"modelModifier/CmsModelModifier.js","sources":["../../src/modelModifier/CmsModelModifier.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport type { CmsModelField as BaseModelField } from \"@webiny/api-headless-cms/types/index.js\";\nimport type { CmsPrivateModelFull } from \"@webiny/api-headless-cms\";\nimport { createModelField } from \"@webiny/api-headless-cms\";\nimport { FILE_MODEL_ID } from \"~/domain/file/file.model.js\";\n\ntype CmsModelField = Omit<BaseModelField, \"storageId\"> & { bulkEdit?: boolean };\n\nclass CmsModelFieldsModifier {\n private fields: BaseModelField[];\n\n constructor(fields: BaseModelField[]) {\n this.fields = fields;\n }\n\n addField(field: CmsModelField) {\n const { bulkEdit, tags, ...rest } = field;\n\n this.fields.push({\n ...rest,\n tags: (tags ?? []).concat(bulkEdit ? [\"$bulk-edit\"] : []),\n storageId: `${field.type}@${field.id}`\n });\n }\n}\n\ninterface CmsModelModifierCallableParams {\n modifier: CmsModelFieldsModifier;\n}\n\ninterface CmsModelModifierCallable {\n (params: CmsModelModifierCallableParams): Promise<void> | void;\n}\n\nexport class CmsModelModifierPlugin extends Plugin {\n public static override type = \"fm.cms-model-modifier\";\n private readonly modelId: string;\n private readonly cb: CmsModelModifierCallable;\n\n constructor(modelId: string, cb: CmsModelModifierCallable) {\n super();\n this.modelId = modelId;\n this.cb = cb;\n }\n\n async modifyModel(model: CmsPrivateModelFull): Promise<void> {\n if (model.modelId !== this.modelId) {\n return;\n }\n\n let extensionsField = model.fields.find(field => field.fieldId === \"extensions\");\n if (!extensionsField) {\n extensionsField = createModelField({\n label: \"Extensions\",\n type: \"object\",\n settings: {\n layout: [],\n fields: []\n }\n });\n model.fields.push(extensionsField);\n }\n\n const modifier = new CmsModelFieldsModifier(extensionsField.settings!.fields!);\n await this.cb({ modifier });\n }\n}\n\nexport const createFileModelModifier = (cb: CmsModelModifierCallable) => {\n return new CmsModelModifierPlugin(FILE_MODEL_ID, cb);\n};\n"],"names":["CmsModelFieldsModifier","fields","field","bulkEdit","tags","rest","CmsModelModifierPlugin","Plugin","modelId","cb","model","extensionsField","createModelField","modifier","createFileModelModifier","FILE_MODEL_ID"],"mappings":";;;AAQA,MAAMA;IAGF,YAAYC,MAAwB,CAAE;QAClC,IAAI,CAAC,MAAM,GAAGA;IAClB;IAEA,SAASC,KAAoB,EAAE;QAC3B,MAAM,EAAEC,QAAQ,EAAEC,IAAI,EAAE,GAAGC,MAAM,GAAGH;QAEpC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;YACb,GAAGG,IAAI;YACP,MAAOD,AAAAA,CAAAA,QAAQ,EAAC,EAAG,MAAM,CAACD,WAAW;gBAAC;aAAa,GAAG,EAAE;YACxD,WAAW,GAAGD,MAAM,IAAI,CAAC,CAAC,EAAEA,MAAM,EAAE,EAAE;QAC1C;IACJ;AACJ;AAUO,MAAMI,+BAA+BC;;aACjB,IAAI,GAAG;;IAI9B,YAAYC,OAAe,EAAEC,EAA4B,CAAE;QACvD,KAAK;QACL,IAAI,CAAC,OAAO,GAAGD;QACf,IAAI,CAAC,EAAE,GAAGC;IACd;IAEA,MAAM,YAAYC,KAA0B,EAAiB;QACzD,IAAIA,MAAM,OAAO,KAAK,IAAI,CAAC,OAAO,EAC9B;QAGJ,IAAIC,kBAAkBD,MAAM,MAAM,CAAC,IAAI,CAACR,CAAAA,QAASA,AAAkB,iBAAlBA,MAAM,OAAO;QAC9D,IAAI,CAACS,iBAAiB;YAClBA,kBAAkBC,iBAAiB;gBAC/B,OAAO;gBACP,MAAM;gBACN,UAAU;oBACN,QAAQ,EAAE;oBACV,QAAQ,EAAE;gBACd;YACJ;YACAF,MAAM,MAAM,CAAC,IAAI,CAACC;QACtB;QAEA,MAAME,WAAW,IAAIb,uBAAuBW,gBAAgB,QAAQ,CAAE,MAAM;QAC5E,MAAM,IAAI,CAAC,EAAE,CAAC;YAAEE;QAAS;IAC7B;AACJ;AAEO,MAAMC,0BAA0B,CAACL,KAC7B,IAAIH,uBAAuBS,eAAeN"}
|
package/package.json
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/api-file-manager",
|
|
3
|
-
"version": "0.0.0-unstable.
|
|
3
|
+
"version": "0.0.0-unstable.7be00a75a9",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"
|
|
5
|
+
"exports": {
|
|
6
|
+
".": "./index.js",
|
|
7
|
+
"./*": "./*"
|
|
8
|
+
},
|
|
6
9
|
"keywords": [
|
|
7
10
|
"fm:base"
|
|
8
11
|
],
|
|
@@ -19,32 +22,31 @@
|
|
|
19
22
|
],
|
|
20
23
|
"license": "MIT",
|
|
21
24
|
"dependencies": {
|
|
22
|
-
"@webiny/api": "0.0.0-unstable.
|
|
23
|
-
"@webiny/api-core": "0.0.0-unstable.
|
|
24
|
-
"@webiny/api-headless-cms": "0.0.0-unstable.
|
|
25
|
-
"@webiny/build-tools": "0.0.0-unstable.
|
|
26
|
-
"@webiny/
|
|
27
|
-
"@webiny/
|
|
28
|
-
"@webiny/
|
|
29
|
-
"@webiny/handler": "0.0.0-unstable.
|
|
30
|
-
"@webiny/
|
|
31
|
-
"@webiny/
|
|
32
|
-
"@webiny/wcp": "0.0.0-unstable.
|
|
25
|
+
"@webiny/api": "0.0.0-unstable.7be00a75a9",
|
|
26
|
+
"@webiny/api-core": "0.0.0-unstable.7be00a75a9",
|
|
27
|
+
"@webiny/api-headless-cms": "0.0.0-unstable.7be00a75a9",
|
|
28
|
+
"@webiny/build-tools": "0.0.0-unstable.7be00a75a9",
|
|
29
|
+
"@webiny/error": "0.0.0-unstable.7be00a75a9",
|
|
30
|
+
"@webiny/feature": "0.0.0-unstable.7be00a75a9",
|
|
31
|
+
"@webiny/handler": "0.0.0-unstable.7be00a75a9",
|
|
32
|
+
"@webiny/handler-graphql": "0.0.0-unstable.7be00a75a9",
|
|
33
|
+
"@webiny/plugins": "0.0.0-unstable.7be00a75a9",
|
|
34
|
+
"@webiny/tasks": "0.0.0-unstable.7be00a75a9",
|
|
35
|
+
"@webiny/wcp": "0.0.0-unstable.7be00a75a9",
|
|
33
36
|
"cache-control-parser": "2.2.0",
|
|
34
|
-
"zod": "
|
|
37
|
+
"zod": "4.4.3"
|
|
35
38
|
},
|
|
36
39
|
"devDependencies": {
|
|
37
40
|
"@types/object-hash": "3.0.6",
|
|
38
|
-
"@webiny/handler-aws": "0.0.0-unstable.
|
|
39
|
-
"@webiny/project-utils": "0.0.0-unstable.
|
|
40
|
-
"@webiny/utils": "0.0.0-unstable.
|
|
41
|
-
"@webiny/wcp": "0.0.0",
|
|
42
|
-
"rimraf": "6.1.
|
|
43
|
-
"typescript": "
|
|
41
|
+
"@webiny/handler-aws": "0.0.0-unstable.7be00a75a9",
|
|
42
|
+
"@webiny/project-utils": "0.0.0-unstable.7be00a75a9",
|
|
43
|
+
"@webiny/utils": "0.0.0-unstable.7be00a75a9",
|
|
44
|
+
"@webiny/wcp": "0.0.0-unstable.7be00a75a9",
|
|
45
|
+
"rimraf": "6.1.3",
|
|
46
|
+
"typescript": "6.0.3"
|
|
44
47
|
},
|
|
45
48
|
"publishConfig": {
|
|
46
|
-
"access": "public"
|
|
47
|
-
"directory": "dist"
|
|
49
|
+
"access": "public"
|
|
48
50
|
},
|
|
49
51
|
"adio": {
|
|
50
52
|
"ignoreDirs": [
|
|
@@ -59,5 +61,8 @@
|
|
|
59
61
|
]
|
|
60
62
|
}
|
|
61
63
|
},
|
|
62
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "8476da73b653c89cc1474d968baf55c1b0ae0e5f",
|
|
65
|
+
"webiny": {
|
|
66
|
+
"publishFrom": "dist"
|
|
67
|
+
}
|
|
63
68
|
}
|
package/types.d.ts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
+
import "@webiny/tasks/features/TaskController/augmentation.js";
|
|
1
2
|
import type { SecurityPermission } from "@webiny/api-core/types/security.js";
|
|
2
3
|
export interface FilePermission extends SecurityPermission {
|
|
3
4
|
name: "fm.file";
|
|
4
5
|
rwd?: string;
|
|
5
6
|
own?: boolean;
|
|
6
7
|
}
|
|
7
|
-
export interface SettingsPermission extends SecurityPermission {
|
|
8
|
-
name: "fm.setting";
|
|
9
|
-
}
|
package/types.js
CHANGED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { Plugin } from "@webiny/plugins";
|
|
2
|
-
import type { AssetRequestResolver, AssetResolver, AssetProcessor, AssetOutputStrategy, AssetRequest, Asset, AssetTransformationStrategy, ResponseHeadersSetter } from "../../delivery/index.js";
|
|
3
|
-
import type { ApiCoreContext } from "@webiny/api-core/types/core.js";
|
|
4
|
-
import { Container } from "@webiny/di";
|
|
5
|
-
type Setter<TParams, TReturn> = (params: TParams) => TReturn;
|
|
6
|
-
export type AssetRequestResolverDecorator = Setter<{
|
|
7
|
-
assetRequestResolver: AssetRequestResolver;
|
|
8
|
-
}, AssetRequestResolver>;
|
|
9
|
-
export type AssetResolverDecorator = Setter<{
|
|
10
|
-
assetResolver: AssetResolver;
|
|
11
|
-
container: Container;
|
|
12
|
-
}, AssetResolver>;
|
|
13
|
-
export type AssetProcessorDecorator = Setter<{
|
|
14
|
-
context: ApiCoreContext;
|
|
15
|
-
assetProcessor: AssetProcessor;
|
|
16
|
-
}, AssetProcessor>;
|
|
17
|
-
export type AssetTransformationDecorator = Setter<{
|
|
18
|
-
context: ApiCoreContext;
|
|
19
|
-
assetTransformationStrategy: AssetTransformationStrategy;
|
|
20
|
-
}, AssetTransformationStrategy>;
|
|
21
|
-
export interface AssetOutputStrategyDecoratorParams {
|
|
22
|
-
context: ApiCoreContext;
|
|
23
|
-
assetRequest: AssetRequest;
|
|
24
|
-
asset: Asset;
|
|
25
|
-
assetOutputStrategy: AssetOutputStrategy;
|
|
26
|
-
}
|
|
27
|
-
export type AssetOutputStrategyDecorator = Setter<AssetOutputStrategyDecoratorParams, AssetOutputStrategy>;
|
|
28
|
-
export declare class AssetDeliveryConfigBuilder {
|
|
29
|
-
private assetRequestResolverDecorators;
|
|
30
|
-
private assetResolverDecorators;
|
|
31
|
-
private assetProcessorDecorators;
|
|
32
|
-
private assetTransformationStrategyDecorators;
|
|
33
|
-
private assetOutputStrategyDecorators;
|
|
34
|
-
setResponseHeaders(setter: ResponseHeadersSetter): void;
|
|
35
|
-
decorateAssetRequestResolver(decorator: AssetRequestResolverDecorator): void;
|
|
36
|
-
decorateAssetResolver(decorator: AssetResolverDecorator): void;
|
|
37
|
-
decorateAssetProcessor(decorator: AssetProcessorDecorator): void;
|
|
38
|
-
decorateAssetTransformationStrategy(decorator: AssetTransformationDecorator): void;
|
|
39
|
-
decorateAssetOutputStrategy(decorator: AssetOutputStrategyDecorator): void;
|
|
40
|
-
/**
|
|
41
|
-
* @internal
|
|
42
|
-
*/
|
|
43
|
-
getAssetRequestResolver(): AssetRequestResolver;
|
|
44
|
-
/**
|
|
45
|
-
* @internal
|
|
46
|
-
*/
|
|
47
|
-
getAssetResolver(container: Container): AssetResolver;
|
|
48
|
-
/**
|
|
49
|
-
* @internal
|
|
50
|
-
*/
|
|
51
|
-
getAssetProcessor(context: ApiCoreContext): AssetProcessor;
|
|
52
|
-
getAssetOutputStrategy(context: ApiCoreContext, assetRequest: AssetRequest, asset: Asset): AssetOutputStrategy;
|
|
53
|
-
getAssetTransformationStrategy(context: ApiCoreContext): AssetTransformationStrategy;
|
|
54
|
-
}
|
|
55
|
-
export interface AssetDeliveryConfigModifier {
|
|
56
|
-
(config: AssetDeliveryConfigBuilder): Promise<void> | void;
|
|
57
|
-
}
|
|
58
|
-
export declare class AssetDeliveryConfigModifierPlugin extends Plugin {
|
|
59
|
-
static type: string;
|
|
60
|
-
private readonly cb;
|
|
61
|
-
constructor(cb: AssetDeliveryConfigModifier);
|
|
62
|
-
buildConfig(configBuilder: AssetDeliveryConfigBuilder): Promise<void>;
|
|
63
|
-
}
|
|
64
|
-
export declare const createAssetDeliveryConfig: (cb: AssetDeliveryConfigModifier) => AssetDeliveryConfigModifierPlugin;
|
|
65
|
-
export {};
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import { Plugin } from "@webiny/plugins";
|
|
2
|
-
import { SetResponseHeaders } from "../index.js";
|
|
3
|
-
import { NullRequestResolver } from "./NullRequestResolver.js";
|
|
4
|
-
import { NullAssetResolver } from "./NullAssetResolver.js";
|
|
5
|
-
import { NullAssetOutputStrategy } from "./NullAssetOutputStrategy.js";
|
|
6
|
-
import { TransformationAssetProcessor } from "./transformation/TransformationAssetProcessor.js";
|
|
7
|
-
import { PassthroughAssetTransformationStrategy } from "./transformation/PassthroughAssetTransformationStrategy.js";
|
|
8
|
-
export class AssetDeliveryConfigBuilder {
|
|
9
|
-
assetRequestResolverDecorators = [];
|
|
10
|
-
assetResolverDecorators = [];
|
|
11
|
-
assetProcessorDecorators = [];
|
|
12
|
-
assetTransformationStrategyDecorators = [];
|
|
13
|
-
assetOutputStrategyDecorators = [];
|
|
14
|
-
setResponseHeaders(setter) {
|
|
15
|
-
this.decorateAssetOutputStrategy(params => {
|
|
16
|
-
return new SetResponseHeaders(setter, params);
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
decorateAssetRequestResolver(decorator) {
|
|
20
|
-
this.assetRequestResolverDecorators.push(decorator);
|
|
21
|
-
}
|
|
22
|
-
decorateAssetResolver(decorator) {
|
|
23
|
-
this.assetResolverDecorators.push(decorator);
|
|
24
|
-
}
|
|
25
|
-
decorateAssetProcessor(decorator) {
|
|
26
|
-
this.assetProcessorDecorators.push(decorator);
|
|
27
|
-
}
|
|
28
|
-
decorateAssetTransformationStrategy(decorator) {
|
|
29
|
-
this.assetTransformationStrategyDecorators.push(decorator);
|
|
30
|
-
}
|
|
31
|
-
decorateAssetOutputStrategy(decorator) {
|
|
32
|
-
this.assetOutputStrategyDecorators.push(decorator);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* @internal
|
|
37
|
-
*/
|
|
38
|
-
getAssetRequestResolver() {
|
|
39
|
-
return this.assetRequestResolverDecorators.reduce((value, decorator) => decorator({
|
|
40
|
-
assetRequestResolver: value
|
|
41
|
-
}), new NullRequestResolver());
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* @internal
|
|
46
|
-
*/
|
|
47
|
-
getAssetResolver(container) {
|
|
48
|
-
return this.assetResolverDecorators.reduce((value, decorator) => decorator({
|
|
49
|
-
container,
|
|
50
|
-
assetResolver: value
|
|
51
|
-
}), new NullAssetResolver());
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* @internal
|
|
56
|
-
*/
|
|
57
|
-
getAssetProcessor(context) {
|
|
58
|
-
return this.assetProcessorDecorators.reduce((value, decorator) => decorator({
|
|
59
|
-
assetProcessor: value,
|
|
60
|
-
context
|
|
61
|
-
}), new TransformationAssetProcessor(this.getAssetTransformationStrategy(context)));
|
|
62
|
-
}
|
|
63
|
-
getAssetOutputStrategy(context, assetRequest, asset) {
|
|
64
|
-
return this.assetOutputStrategyDecorators.reduce((value, decorator) => {
|
|
65
|
-
return decorator({
|
|
66
|
-
context,
|
|
67
|
-
assetRequest,
|
|
68
|
-
asset,
|
|
69
|
-
assetOutputStrategy: value
|
|
70
|
-
});
|
|
71
|
-
}, new NullAssetOutputStrategy());
|
|
72
|
-
}
|
|
73
|
-
getAssetTransformationStrategy(context) {
|
|
74
|
-
return this.assetTransformationStrategyDecorators.reduce((value, decorator) => decorator({
|
|
75
|
-
context,
|
|
76
|
-
assetTransformationStrategy: value
|
|
77
|
-
}), new PassthroughAssetTransformationStrategy());
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
export class AssetDeliveryConfigModifierPlugin extends Plugin {
|
|
81
|
-
static type = "fm.config-modifier";
|
|
82
|
-
constructor(cb) {
|
|
83
|
-
super();
|
|
84
|
-
this.cb = cb;
|
|
85
|
-
}
|
|
86
|
-
async buildConfig(configBuilder) {
|
|
87
|
-
await this.cb(configBuilder);
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
export const createAssetDeliveryConfig = cb => {
|
|
91
|
-
return new AssetDeliveryConfigModifierPlugin(cb);
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
//# sourceMappingURL=AssetDeliveryConfig.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["Plugin","SetResponseHeaders","NullRequestResolver","NullAssetResolver","NullAssetOutputStrategy","TransformationAssetProcessor","PassthroughAssetTransformationStrategy","AssetDeliveryConfigBuilder","assetRequestResolverDecorators","assetResolverDecorators","assetProcessorDecorators","assetTransformationStrategyDecorators","assetOutputStrategyDecorators","setResponseHeaders","setter","decorateAssetOutputStrategy","params","decorateAssetRequestResolver","decorator","push","decorateAssetResolver","decorateAssetProcessor","decorateAssetTransformationStrategy","getAssetRequestResolver","reduce","value","assetRequestResolver","getAssetResolver","container","assetResolver","getAssetProcessor","context","assetProcessor","getAssetTransformationStrategy","getAssetOutputStrategy","assetRequest","asset","assetOutputStrategy","assetTransformationStrategy","AssetDeliveryConfigModifierPlugin","type","constructor","cb","buildConfig","configBuilder","createAssetDeliveryConfig"],"sources":["AssetDeliveryConfig.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport type {\n AssetRequestResolver,\n AssetResolver,\n AssetProcessor,\n AssetOutputStrategy,\n AssetRequest,\n Asset,\n AssetTransformationStrategy,\n ResponseHeadersSetter\n} from \"~/delivery/index.js\";\nimport { SetResponseHeaders } from \"~/delivery/index.js\";\nimport { NullRequestResolver } from \"~/delivery/AssetDelivery/NullRequestResolver.js\";\nimport { NullAssetResolver } from \"~/delivery/AssetDelivery/NullAssetResolver.js\";\nimport { NullAssetOutputStrategy } from \"./NullAssetOutputStrategy.js\";\nimport { TransformationAssetProcessor } from \"./transformation/TransformationAssetProcessor.js\";\nimport { PassthroughAssetTransformationStrategy } from \"./transformation/PassthroughAssetTransformationStrategy.js\";\nimport type { ApiCoreContext } from \"@webiny/api-core/types/core.js\";\nimport { Container } from \"@webiny/di\";\n\ntype Setter<TParams, TReturn> = (params: TParams) => TReturn;\n\nexport type AssetRequestResolverDecorator = Setter<\n { assetRequestResolver: AssetRequestResolver },\n AssetRequestResolver\n>;\n\nexport type AssetResolverDecorator = Setter<\n { assetResolver: AssetResolver; container: Container },\n AssetResolver\n>;\n\nexport type AssetProcessorDecorator = Setter<\n { context: ApiCoreContext; assetProcessor: AssetProcessor },\n AssetProcessor\n>;\n\nexport type AssetTransformationDecorator = Setter<\n { context: ApiCoreContext; assetTransformationStrategy: AssetTransformationStrategy },\n AssetTransformationStrategy\n>;\n\nexport interface AssetOutputStrategyDecoratorParams {\n context: ApiCoreContext;\n assetRequest: AssetRequest;\n asset: Asset;\n assetOutputStrategy: AssetOutputStrategy;\n}\n\nexport type AssetOutputStrategyDecorator = Setter<\n AssetOutputStrategyDecoratorParams,\n AssetOutputStrategy\n>;\n\nexport class AssetDeliveryConfigBuilder {\n private assetRequestResolverDecorators: AssetRequestResolverDecorator[] = [];\n private assetResolverDecorators: AssetResolverDecorator[] = [];\n private assetProcessorDecorators: AssetProcessorDecorator[] = [];\n private assetTransformationStrategyDecorators: AssetTransformationDecorator[] = [];\n private assetOutputStrategyDecorators: AssetOutputStrategyDecorator[] = [];\n\n setResponseHeaders(setter: ResponseHeadersSetter) {\n this.decorateAssetOutputStrategy(params => {\n return new SetResponseHeaders(setter, params);\n });\n }\n\n decorateAssetRequestResolver(decorator: AssetRequestResolverDecorator) {\n this.assetRequestResolverDecorators.push(decorator);\n }\n\n decorateAssetResolver(decorator: AssetResolverDecorator) {\n this.assetResolverDecorators.push(decorator);\n }\n\n decorateAssetProcessor(decorator: AssetProcessorDecorator) {\n this.assetProcessorDecorators.push(decorator);\n }\n\n decorateAssetTransformationStrategy(decorator: AssetTransformationDecorator) {\n this.assetTransformationStrategyDecorators.push(decorator);\n }\n\n decorateAssetOutputStrategy(decorator: AssetOutputStrategyDecorator) {\n this.assetOutputStrategyDecorators.push(decorator);\n }\n\n /**\n * @internal\n */\n getAssetRequestResolver() {\n return this.assetRequestResolverDecorators.reduce<AssetRequestResolver>(\n (value, decorator) => decorator({ assetRequestResolver: value }),\n new NullRequestResolver()\n );\n }\n\n /**\n * @internal\n */\n getAssetResolver(container: Container) {\n return this.assetResolverDecorators.reduce<AssetResolver>(\n (value, decorator) => decorator({ container, assetResolver: value }),\n new NullAssetResolver()\n );\n }\n\n /**\n * @internal\n */\n getAssetProcessor(context: ApiCoreContext) {\n return this.assetProcessorDecorators.reduce<AssetProcessor>(\n (value, decorator) => decorator({ assetProcessor: value, context }),\n new TransformationAssetProcessor(this.getAssetTransformationStrategy(context))\n );\n }\n\n getAssetOutputStrategy(context: ApiCoreContext, assetRequest: AssetRequest, asset: Asset) {\n return this.assetOutputStrategyDecorators.reduce<AssetOutputStrategy>(\n (value, decorator) => {\n return decorator({ context, assetRequest, asset, assetOutputStrategy: value });\n },\n new NullAssetOutputStrategy()\n );\n }\n\n getAssetTransformationStrategy(context: ApiCoreContext) {\n return this.assetTransformationStrategyDecorators.reduce<AssetTransformationStrategy>(\n (value, decorator) => decorator({ context, assetTransformationStrategy: value }),\n new PassthroughAssetTransformationStrategy()\n );\n }\n}\n\nexport interface AssetDeliveryConfigModifier {\n (config: AssetDeliveryConfigBuilder): Promise<void> | void;\n}\n\nexport class AssetDeliveryConfigModifierPlugin extends Plugin {\n public static override type = \"fm.config-modifier\";\n private readonly cb: AssetDeliveryConfigModifier;\n\n constructor(cb: AssetDeliveryConfigModifier) {\n super();\n this.cb = cb;\n }\n\n async buildConfig(configBuilder: AssetDeliveryConfigBuilder): Promise<void> {\n await this.cb(configBuilder);\n }\n}\n\nexport const createAssetDeliveryConfig = (cb: AssetDeliveryConfigModifier) => {\n return new AssetDeliveryConfigModifierPlugin(cb);\n};\n"],"mappings":"AAAA,SAASA,MAAM,QAAQ,iBAAiB;AAWxC,SAASC,kBAAkB;AAC3B,SAASC,mBAAmB;AAC5B,SAASC,iBAAiB;AAC1B,SAASC,uBAAuB;AAChC,SAASC,4BAA4B;AACrC,SAASC,sCAAsC;AAsC/C,OAAO,MAAMC,0BAA0B,CAAC;EAC5BC,8BAA8B,GAAoC,EAAE;EACpEC,uBAAuB,GAA6B,EAAE;EACtDC,wBAAwB,GAA8B,EAAE;EACxDC,qCAAqC,GAAmC,EAAE;EAC1EC,6BAA6B,GAAmC,EAAE;EAE1EC,kBAAkBA,CAACC,MAA6B,EAAE;IAC9C,IAAI,CAACC,2BAA2B,CAACC,MAAM,IAAI;MACvC,OAAO,IAAIf,kBAAkB,CAACa,MAAM,EAAEE,MAAM,CAAC;IACjD,CAAC,CAAC;EACN;EAEAC,4BAA4BA,CAACC,SAAwC,EAAE;IACnE,IAAI,CAACV,8BAA8B,CAACW,IAAI,CAACD,SAAS,CAAC;EACvD;EAEAE,qBAAqBA,CAACF,SAAiC,EAAE;IACrD,IAAI,CAACT,uBAAuB,CAACU,IAAI,CAACD,SAAS,CAAC;EAChD;EAEAG,sBAAsBA,CAACH,SAAkC,EAAE;IACvD,IAAI,CAACR,wBAAwB,CAACS,IAAI,CAACD,SAAS,CAAC;EACjD;EAEAI,mCAAmCA,CAACJ,SAAuC,EAAE;IACzE,IAAI,CAACP,qCAAqC,CAACQ,IAAI,CAACD,SAAS,CAAC;EAC9D;EAEAH,2BAA2BA,CAACG,SAAuC,EAAE;IACjE,IAAI,CAACN,6BAA6B,CAACO,IAAI,CAACD,SAAS,CAAC;EACtD;;EAEA;AACJ;AACA;EACIK,uBAAuBA,CAAA,EAAG;IACtB,OAAO,IAAI,CAACf,8BAA8B,CAACgB,MAAM,CAC7C,CAACC,KAAK,EAAEP,SAAS,KAAKA,SAAS,CAAC;MAAEQ,oBAAoB,EAAED;IAAM,CAAC,CAAC,EAChE,IAAIvB,mBAAmB,CAAC,CAC5B,CAAC;EACL;;EAEA;AACJ;AACA;EACIyB,gBAAgBA,CAACC,SAAoB,EAAE;IACnC,OAAO,IAAI,CAACnB,uBAAuB,CAACe,MAAM,CACtC,CAACC,KAAK,EAAEP,SAAS,KAAKA,SAAS,CAAC;MAAEU,SAAS;MAAEC,aAAa,EAAEJ;IAAM,CAAC,CAAC,EACpE,IAAItB,iBAAiB,CAAC,CAC1B,CAAC;EACL;;EAEA;AACJ;AACA;EACI2B,iBAAiBA,CAACC,OAAuB,EAAE;IACvC,OAAO,IAAI,CAACrB,wBAAwB,CAACc,MAAM,CACvC,CAACC,KAAK,EAAEP,SAAS,KAAKA,SAAS,CAAC;MAAEc,cAAc,EAAEP,KAAK;MAAEM;IAAQ,CAAC,CAAC,EACnE,IAAI1B,4BAA4B,CAAC,IAAI,CAAC4B,8BAA8B,CAACF,OAAO,CAAC,CACjF,CAAC;EACL;EAEAG,sBAAsBA,CAACH,OAAuB,EAAEI,YAA0B,EAAEC,KAAY,EAAE;IACtF,OAAO,IAAI,CAACxB,6BAA6B,CAACY,MAAM,CAC5C,CAACC,KAAK,EAAEP,SAAS,KAAK;MAClB,OAAOA,SAAS,CAAC;QAAEa,OAAO;QAAEI,YAAY;QAAEC,KAAK;QAAEC,mBAAmB,EAAEZ;MAAM,CAAC,CAAC;IAClF,CAAC,EACD,IAAIrB,uBAAuB,CAAC,CAChC,CAAC;EACL;EAEA6B,8BAA8BA,CAACF,OAAuB,EAAE;IACpD,OAAO,IAAI,CAACpB,qCAAqC,CAACa,MAAM,CACpD,CAACC,KAAK,EAAEP,SAAS,KAAKA,SAAS,CAAC;MAAEa,OAAO;MAAEO,2BAA2B,EAAEb;IAAM,CAAC,CAAC,EAChF,IAAInB,sCAAsC,CAAC,CAC/C,CAAC;EACL;AACJ;AAMA,OAAO,MAAMiC,iCAAiC,SAASvC,MAAM,CAAC;EAC1D,OAAuBwC,IAAI,GAAG,oBAAoB;EAGlDC,WAAWA,CAACC,EAA+B,EAAE;IACzC,KAAK,CAAC,CAAC;IACP,IAAI,CAACA,EAAE,GAAGA,EAAE;EAChB;EAEA,MAAMC,WAAWA,CAACC,aAAyC,EAAiB;IACxE,MAAM,IAAI,CAACF,EAAE,CAACE,aAAa,CAAC;EAChC;AACJ;AAEA,OAAO,MAAMC,yBAAyB,GAAIH,EAA+B,IAAK;EAC1E,OAAO,IAAIH,iCAAiC,CAACG,EAAE,CAAC;AACpD,CAAC","ignoreList":[]}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { Request } from "@webiny/handler/types.js";
|
|
2
|
-
import type { AssetRequestResolver } from "./abstractions/AssetRequestResolver.js";
|
|
3
|
-
import { AssetRequest } from "./AssetRequest.js";
|
|
4
|
-
export declare class FilesAssetRequestResolver implements AssetRequestResolver {
|
|
5
|
-
resolve(request: Request): Promise<AssetRequest | undefined>;
|
|
6
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { AssetRequest } from "./AssetRequest.js";
|
|
2
|
-
export class FilesAssetRequestResolver {
|
|
3
|
-
async resolve(request) {
|
|
4
|
-
// Example: /files/65722cb5c7824a0008d05963/image-48.jpg?width=300
|
|
5
|
-
if (!request.url.startsWith("/files/")) {
|
|
6
|
-
return undefined;
|
|
7
|
-
}
|
|
8
|
-
const params = request.params ?? {};
|
|
9
|
-
const query = request.query ?? {};
|
|
10
|
-
|
|
11
|
-
// Example: { '*': '/files/65722cb5c7824a0008d05963/image-48.jpg' },
|
|
12
|
-
const path = params["*"];
|
|
13
|
-
const options = {
|
|
14
|
-
...query,
|
|
15
|
-
original: "original" in query
|
|
16
|
-
};
|
|
17
|
-
if (query.width) {
|
|
18
|
-
options.width = parseInt(query.width);
|
|
19
|
-
}
|
|
20
|
-
return new AssetRequest({
|
|
21
|
-
key: decodeURI(path).replace("/files/", ""),
|
|
22
|
-
context: {
|
|
23
|
-
url: request.url
|
|
24
|
-
},
|
|
25
|
-
options
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
//# sourceMappingURL=FilesAssetRequestResolver.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["AssetRequest","FilesAssetRequestResolver","resolve","request","url","startsWith","undefined","params","query","path","options","original","width","parseInt","key","decodeURI","replace","context"],"sources":["FilesAssetRequestResolver.ts"],"sourcesContent":["import type { Request } from \"@webiny/handler/types.js\";\nimport type { AssetRequestResolver } from \"./abstractions/AssetRequestResolver.js\";\nimport type { AssetRequestOptions } from \"./AssetRequest.js\";\nimport { AssetRequest } from \"./AssetRequest.js\";\n\nexport class FilesAssetRequestResolver implements AssetRequestResolver {\n async resolve(request: Request): Promise<AssetRequest | undefined> {\n // Example: /files/65722cb5c7824a0008d05963/image-48.jpg?width=300\n if (!request.url.startsWith(\"/files/\")) {\n return undefined;\n }\n\n const params = (request.params as Record<string, any>) ?? {};\n const query = (request.query as Record<string, any>) ?? {};\n\n // Example: { '*': '/files/65722cb5c7824a0008d05963/image-48.jpg' },\n const path = params[\"*\"];\n\n const options: AssetRequestOptions = {\n ...query,\n original: \"original\" in query\n };\n\n if (query.width) {\n options.width = parseInt(query.width);\n }\n\n return new AssetRequest({\n key: decodeURI(path).replace(\"/files/\", \"\"),\n context: {\n url: request.url\n },\n options\n });\n }\n}\n"],"mappings":"AAGA,SAASA,YAAY;AAErB,OAAO,MAAMC,yBAAyB,CAAiC;EACnE,MAAMC,OAAOA,CAACC,OAAgB,EAAqC;IAC/D;IACA,IAAI,CAACA,OAAO,CAACC,GAAG,CAACC,UAAU,CAAC,SAAS,CAAC,EAAE;MACpC,OAAOC,SAAS;IACpB;IAEA,MAAMC,MAAM,GAAIJ,OAAO,CAACI,MAAM,IAA4B,CAAC,CAAC;IAC5D,MAAMC,KAAK,GAAIL,OAAO,CAACK,KAAK,IAA4B,CAAC,CAAC;;IAE1D;IACA,MAAMC,IAAI,GAAGF,MAAM,CAAC,GAAG,CAAC;IAExB,MAAMG,OAA4B,GAAG;MACjC,GAAGF,KAAK;MACRG,QAAQ,EAAE,UAAU,IAAIH;IAC5B,CAAC;IAED,IAAIA,KAAK,CAACI,KAAK,EAAE;MACbF,OAAO,CAACE,KAAK,GAAGC,QAAQ,CAACL,KAAK,CAACI,KAAK,CAAC;IACzC;IAEA,OAAO,IAAIZ,YAAY,CAAC;MACpBc,GAAG,EAAEC,SAAS,CAACN,IAAI,CAAC,CAACO,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC;MAC3CC,OAAO,EAAE;QACLb,GAAG,EAAED,OAAO,CAACC;MACjB,CAAC;MACDM;IACJ,CAAC,CAAC;EACN;AACJ","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["NullAssetReply","NullAssetOutputStrategy","output"],"sources":["NullAssetOutputStrategy.ts"],"sourcesContent":["import type { AssetOutputStrategy, AssetReply } from \"~/delivery/index.js\";\nimport { NullAssetReply } from \"./NullAssetReply.js\";\n\nexport class NullAssetOutputStrategy implements AssetOutputStrategy {\n async output(): Promise<AssetReply> {\n return new NullAssetReply();\n }\n}\n"],"mappings":"AACA,SAASA,cAAc;AAEvB,OAAO,MAAMC,uBAAuB,CAAgC;EAChE,MAAMC,MAAMA,CAAA,EAAwB;IAChC,OAAO,IAAIF,cAAc,CAAC,CAAC;EAC/B;AACJ","ignoreList":[]}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { AssetReply } from "./abstractions/AssetReply.js";
|
|
2
|
-
export class NullAssetReply extends AssetReply {
|
|
3
|
-
constructor() {
|
|
4
|
-
super({
|
|
5
|
-
code: 404,
|
|
6
|
-
body: () => ({
|
|
7
|
-
error: "Asset output strategy is not implemented!"
|
|
8
|
-
})
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
//# sourceMappingURL=NullAssetReply.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["AssetReply","NullAssetReply","constructor","code","body","error"],"sources":["NullAssetReply.ts"],"sourcesContent":["import { AssetReply } from \"~/delivery/AssetDelivery/abstractions/AssetReply.js\";\n\nexport class NullAssetReply extends AssetReply {\n constructor() {\n super({\n code: 404,\n body: () => ({ error: \"Asset output strategy is not implemented!\" })\n });\n }\n}\n"],"mappings":"AAAA,SAASA,UAAU;AAEnB,OAAO,MAAMC,cAAc,SAASD,UAAU,CAAC;EAC3CE,WAAWA,CAAA,EAAG;IACV,KAAK,CAAC;MACFC,IAAI,EAAE,GAAG;MACTC,IAAI,EAAEA,CAAA,MAAO;QAAEC,KAAK,EAAE;MAA4C,CAAC;IACvE,CAAC,CAAC;EACN;AACJ","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["NullAssetResolver","resolve","Promise","undefined"],"sources":["NullAssetResolver.ts"],"sourcesContent":["import type { AssetResolver } from \"./abstractions/AssetResolver.js\";\nimport type { Asset } from \"./Asset.js\";\n\nexport class NullAssetResolver implements AssetResolver {\n resolve(): Promise<Asset | undefined> {\n return Promise.resolve(undefined);\n }\n}\n"],"mappings":"AAGA,OAAO,MAAMA,iBAAiB,CAA0B;EACpDC,OAAOA,CAAA,EAA+B;IAClC,OAAOC,OAAO,CAACD,OAAO,CAACE,SAAS,CAAC;EACrC;AACJ","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["NullRequestResolver","resolve","Promise","undefined"],"sources":["NullRequestResolver.ts"],"sourcesContent":["import type { AssetRequest, AssetRequestResolver } from \"~/delivery/index.js\";\n\nexport class NullRequestResolver implements AssetRequestResolver {\n resolve(): Promise<AssetRequest | undefined> {\n return Promise.resolve(undefined);\n }\n}\n"],"mappings":"AAEA,OAAO,MAAMA,mBAAmB,CAAiC;EAC7DC,OAAOA,CAAA,EAAsC;IACzC,OAAOC,OAAO,CAACD,OAAO,CAACE,SAAS,CAAC;EACrC;AACJ","ignoreList":[]}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { ResponseHeaders } from "@webiny/handler";
|
|
2
|
-
import type { Asset, AssetOutputStrategy, AssetReply } from "../../delivery/index.js";
|
|
3
|
-
export declare class SetCacheControlHeaders implements AssetOutputStrategy {
|
|
4
|
-
private readonly strategy;
|
|
5
|
-
private readonly headers;
|
|
6
|
-
constructor(headers: ResponseHeaders, strategy: AssetOutputStrategy | undefined);
|
|
7
|
-
output(asset: Asset): Promise<AssetReply>;
|
|
8
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export class SetCacheControlHeaders {
|
|
2
|
-
constructor(headers, strategy) {
|
|
3
|
-
this.headers = headers;
|
|
4
|
-
this.strategy = strategy;
|
|
5
|
-
}
|
|
6
|
-
async output(asset) {
|
|
7
|
-
if (!this.strategy) {
|
|
8
|
-
throw Error(`No asset output strategy is configured!`);
|
|
9
|
-
}
|
|
10
|
-
const reply = await this.strategy.output(asset);
|
|
11
|
-
reply.setHeaders(headers => {
|
|
12
|
-
return headers.merge(this.headers);
|
|
13
|
-
});
|
|
14
|
-
return reply;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
//# sourceMappingURL=SetCacheControlHeaders.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["SetCacheControlHeaders","constructor","headers","strategy","output","asset","Error","reply","setHeaders","merge"],"sources":["SetCacheControlHeaders.ts"],"sourcesContent":["import type { ResponseHeaders } from \"@webiny/handler\";\nimport type { Asset, AssetOutputStrategy, AssetReply } from \"~/delivery/index.js\";\n\nexport class SetCacheControlHeaders implements AssetOutputStrategy {\n private readonly strategy: AssetOutputStrategy | undefined;\n private readonly headers: ResponseHeaders;\n\n constructor(headers: ResponseHeaders, strategy: AssetOutputStrategy | undefined) {\n this.headers = headers;\n this.strategy = strategy;\n }\n\n async output(asset: Asset): Promise<AssetReply> {\n if (!this.strategy) {\n throw Error(`No asset output strategy is configured!`);\n }\n\n const reply = await this.strategy.output(asset);\n\n reply.setHeaders(headers => {\n return headers.merge(this.headers);\n });\n\n return reply;\n }\n}\n"],"mappings":"AAGA,OAAO,MAAMA,sBAAsB,CAAgC;EAI/DC,WAAWA,CAACC,OAAwB,EAAEC,QAAyC,EAAE;IAC7E,IAAI,CAACD,OAAO,GAAGA,OAAO;IACtB,IAAI,CAACC,QAAQ,GAAGA,QAAQ;EAC5B;EAEA,MAAMC,MAAMA,CAACC,KAAY,EAAuB;IAC5C,IAAI,CAAC,IAAI,CAACF,QAAQ,EAAE;MAChB,MAAMG,KAAK,CAAC,yCAAyC,CAAC;IAC1D;IAEA,MAAMC,KAAK,GAAG,MAAM,IAAI,CAACJ,QAAQ,CAACC,MAAM,CAACC,KAAK,CAAC;IAE/CE,KAAK,CAACC,UAAU,CAACN,OAAO,IAAI;MACxB,OAAOA,OAAO,CAACO,KAAK,CAAC,IAAI,CAACP,OAAO,CAAC;IACtC,CAAC,CAAC;IAEF,OAAOK,KAAK;EAChB;AACJ","ignoreList":[]}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { AssetOutputStrategy, Asset, AssetReply, AssetRequest, AssetOutputStrategyDecoratorParams } from "../../delivery/index.js";
|
|
2
|
-
import type { ResponseHeaders } from "@webiny/handler";
|
|
3
|
-
import type { ApiCoreContext } from "@webiny/api-core/types/core.js";
|
|
4
|
-
export interface ResponseHeadersParams {
|
|
5
|
-
headers: ResponseHeaders;
|
|
6
|
-
context: ApiCoreContext;
|
|
7
|
-
assetRequest: AssetRequest;
|
|
8
|
-
asset: Asset;
|
|
9
|
-
}
|
|
10
|
-
export interface ResponseHeadersSetter {
|
|
11
|
-
(params: ResponseHeadersParams): Promise<void> | void;
|
|
12
|
-
}
|
|
13
|
-
export declare class SetResponseHeaders implements AssetOutputStrategy {
|
|
14
|
-
private readonly setter;
|
|
15
|
-
private strategyDecoratorParams;
|
|
16
|
-
constructor(setter: ResponseHeadersSetter, strategyDecoratorParams: AssetOutputStrategyDecoratorParams);
|
|
17
|
-
output(asset: Asset): Promise<AssetReply>;
|
|
18
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export class SetResponseHeaders {
|
|
2
|
-
constructor(setter, strategyDecoratorParams) {
|
|
3
|
-
this.strategyDecoratorParams = strategyDecoratorParams;
|
|
4
|
-
this.setter = setter;
|
|
5
|
-
}
|
|
6
|
-
async output(asset) {
|
|
7
|
-
const reply = await this.strategyDecoratorParams.assetOutputStrategy.output(asset);
|
|
8
|
-
await this.setter({
|
|
9
|
-
asset: this.strategyDecoratorParams.asset,
|
|
10
|
-
assetRequest: this.strategyDecoratorParams.assetRequest,
|
|
11
|
-
context: this.strategyDecoratorParams.context,
|
|
12
|
-
headers: reply.getHeaders()
|
|
13
|
-
});
|
|
14
|
-
return reply;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
//# sourceMappingURL=SetResponseHeaders.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["SetResponseHeaders","constructor","setter","strategyDecoratorParams","output","asset","reply","assetOutputStrategy","assetRequest","context","headers","getHeaders"],"sources":["SetResponseHeaders.ts"],"sourcesContent":["import type {\n AssetOutputStrategy,\n Asset,\n AssetReply,\n AssetRequest,\n AssetOutputStrategyDecoratorParams\n} from \"~/delivery/index.js\";\nimport type { ResponseHeaders } from \"@webiny/handler\";\nimport type { ApiCoreContext } from \"@webiny/api-core/types/core.js\";\n\nexport interface ResponseHeadersParams {\n headers: ResponseHeaders;\n context: ApiCoreContext;\n assetRequest: AssetRequest;\n asset: Asset;\n}\n\nexport interface ResponseHeadersSetter {\n (params: ResponseHeadersParams): Promise<void> | void;\n}\n\nexport class SetResponseHeaders implements AssetOutputStrategy {\n private readonly setter: ResponseHeadersSetter;\n private strategyDecoratorParams: AssetOutputStrategyDecoratorParams;\n\n constructor(\n setter: ResponseHeadersSetter,\n strategyDecoratorParams: AssetOutputStrategyDecoratorParams\n ) {\n this.strategyDecoratorParams = strategyDecoratorParams;\n this.setter = setter;\n }\n\n async output(asset: Asset): Promise<AssetReply> {\n const reply = await this.strategyDecoratorParams.assetOutputStrategy.output(asset);\n\n await this.setter({\n asset: this.strategyDecoratorParams.asset,\n assetRequest: this.strategyDecoratorParams.assetRequest,\n context: this.strategyDecoratorParams.context,\n headers: reply.getHeaders()\n });\n\n return reply;\n }\n}\n"],"mappings":"AAqBA,OAAO,MAAMA,kBAAkB,CAAgC;EAI3DC,WAAWA,CACPC,MAA6B,EAC7BC,uBAA2D,EAC7D;IACE,IAAI,CAACA,uBAAuB,GAAGA,uBAAuB;IACtD,IAAI,CAACD,MAAM,GAAGA,MAAM;EACxB;EAEA,MAAME,MAAMA,CAACC,KAAY,EAAuB;IAC5C,MAAMC,KAAK,GAAG,MAAM,IAAI,CAACH,uBAAuB,CAACI,mBAAmB,CAACH,MAAM,CAACC,KAAK,CAAC;IAElF,MAAM,IAAI,CAACH,MAAM,CAAC;MACdG,KAAK,EAAE,IAAI,CAACF,uBAAuB,CAACE,KAAK;MACzCG,YAAY,EAAE,IAAI,CAACL,uBAAuB,CAACK,YAAY;MACvDC,OAAO,EAAE,IAAI,CAACN,uBAAuB,CAACM,OAAO;MAC7CC,OAAO,EAAEJ,KAAK,CAACK,UAAU,CAAC;IAC9B,CAAC,CAAC;IAEF,OAAOL,KAAK;EAChB;AACJ","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["AssetContentsReader.ts"],"sourcesContent":["import type { Asset } from \"~/delivery/index.js\";\n\nexport interface AssetContentsReader {\n read(asset: Asset): Promise<Buffer>;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["AssetOutputStrategy.ts"],"sourcesContent":["import type { Asset, AssetReply } from \"~/delivery/index.js\";\n\nexport interface AssetOutputStrategy {\n output(asset: Asset): Promise<AssetReply>;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["AssetProcessor.ts"],"sourcesContent":["import type { Asset, AssetRequest } from \"~/delivery/index.js\";\n\nexport interface AssetProcessor {\n process(assetRequest: AssetRequest, asset: Asset): Promise<Asset>;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["AssetRequestResolver.ts"],"sourcesContent":["import type { Request } from \"@webiny/handler/types.js\";\nimport type { AssetRequest } from \"~/delivery/index.js\";\n\nexport interface AssetRequestResolver {\n resolve(request: Request): Promise<AssetRequest | undefined>;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["AssetResolver.ts"],"sourcesContent":["import type { Asset, AssetRequest } from \"~/delivery/index.js\";\n\nexport interface AssetResolver {\n resolve(request: AssetRequest): Promise<Asset | undefined>;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["AssetTransformationStrategy.ts"],"sourcesContent":["import type { Asset, AssetRequest } from \"~/delivery/index.js\";\n\nexport interface AssetTransformationStrategy {\n transform(assetRequest: AssetRequest, asset: Asset): Promise<Asset>;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["AssetAuthorizer.ts"],"sourcesContent":["import { File } from \"~/domain/file/types.js\";\n\nexport interface AssetAuthorizer {\n authorize(file: File): Promise<void>;\n}\n"],"mappings":"","ignoreList":[]}
|