@webiny/api-file-manager 6.0.0-beta.0 → 6.0.0-rc.1
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/contants.js +1 -7
- package/contants.js.map +1 -1
- package/delivery/AssetDelivery/Asset.d.ts +6 -8
- package/delivery/AssetDelivery/Asset.js +13 -18
- package/delivery/AssetDelivery/Asset.js.map +1 -1
- package/delivery/AssetDelivery/AssetDeliveryConfig.d.ts +17 -15
- package/delivery/AssetDelivery/AssetDeliveryConfig.js +18 -26
- package/delivery/AssetDelivery/AssetDeliveryConfig.js.map +1 -1
- package/delivery/AssetDelivery/AssetRequest.d.ts +3 -2
- package/delivery/AssetDelivery/AssetRequest.js +1 -8
- package/delivery/AssetDelivery/AssetRequest.js.map +1 -1
- package/delivery/AssetDelivery/FilesAssetRequestResolver.d.ts +3 -3
- package/delivery/AssetDelivery/FilesAssetRequestResolver.js +11 -14
- package/delivery/AssetDelivery/FilesAssetRequestResolver.js.map +1 -1
- package/delivery/AssetDelivery/NullAssetOutputStrategy.d.ts +1 -1
- package/delivery/AssetDelivery/NullAssetOutputStrategy.js +3 -10
- package/delivery/AssetDelivery/NullAssetOutputStrategy.js.map +1 -1
- package/delivery/AssetDelivery/NullAssetReply.d.ts +1 -1
- package/delivery/AssetDelivery/NullAssetReply.js +2 -9
- package/delivery/AssetDelivery/NullAssetReply.js.map +1 -1
- package/delivery/AssetDelivery/NullAssetResolver.d.ts +2 -2
- package/delivery/AssetDelivery/NullAssetResolver.js +1 -8
- package/delivery/AssetDelivery/NullAssetResolver.js.map +1 -1
- package/delivery/AssetDelivery/NullRequestResolver.d.ts +1 -1
- package/delivery/AssetDelivery/NullRequestResolver.js +1 -8
- package/delivery/AssetDelivery/NullRequestResolver.js.map +1 -1
- package/delivery/AssetDelivery/SetCacheControlHeaders.d.ts +2 -2
- package/delivery/AssetDelivery/SetCacheControlHeaders.js +1 -8
- package/delivery/AssetDelivery/SetCacheControlHeaders.js.map +1 -1
- package/delivery/AssetDelivery/SetResponseHeaders.d.ts +4 -4
- package/delivery/AssetDelivery/SetResponseHeaders.js +1 -8
- package/delivery/AssetDelivery/SetResponseHeaders.js.map +1 -1
- package/delivery/AssetDelivery/abstractions/AssetContentsReader.d.ts +1 -2
- package/delivery/AssetDelivery/abstractions/AssetContentsReader.js +1 -5
- package/delivery/AssetDelivery/abstractions/AssetContentsReader.js.map +1 -1
- package/delivery/AssetDelivery/abstractions/AssetOutputStrategy.d.ts +1 -1
- package/delivery/AssetDelivery/abstractions/AssetOutputStrategy.js +1 -5
- package/delivery/AssetDelivery/abstractions/AssetOutputStrategy.js.map +1 -1
- package/delivery/AssetDelivery/abstractions/AssetProcessor.d.ts +1 -1
- package/delivery/AssetDelivery/abstractions/AssetProcessor.js +1 -5
- package/delivery/AssetDelivery/abstractions/AssetProcessor.js.map +1 -1
- package/delivery/AssetDelivery/abstractions/AssetReply.js +3 -10
- package/delivery/AssetDelivery/abstractions/AssetReply.js.map +1 -1
- package/delivery/AssetDelivery/abstractions/AssetRequestResolver.d.ts +2 -2
- package/delivery/AssetDelivery/abstractions/AssetRequestResolver.js +1 -5
- package/delivery/AssetDelivery/abstractions/AssetRequestResolver.js.map +1 -1
- package/delivery/AssetDelivery/abstractions/AssetResolver.d.ts +1 -1
- package/delivery/AssetDelivery/abstractions/AssetResolver.js +1 -5
- package/delivery/AssetDelivery/abstractions/AssetResolver.js.map +1 -1
- package/delivery/AssetDelivery/abstractions/AssetTransformationStrategy.d.ts +1 -1
- package/delivery/AssetDelivery/abstractions/AssetTransformationStrategy.js +1 -5
- package/delivery/AssetDelivery/abstractions/AssetTransformationStrategy.js.map +1 -1
- package/delivery/AssetDelivery/createAssetDeliveryPluginLoader.d.ts +1 -1
- package/delivery/AssetDelivery/createAssetDeliveryPluginLoader.js +1 -8
- package/delivery/AssetDelivery/createAssetDeliveryPluginLoader.js.map +1 -1
- package/delivery/AssetDelivery/privateFiles/AssetAuthorizer.d.ts +1 -1
- package/delivery/AssetDelivery/privateFiles/AssetAuthorizer.js +1 -5
- package/delivery/AssetDelivery/privateFiles/AssetAuthorizer.js.map +1 -1
- package/delivery/AssetDelivery/privateFiles/NotAuthorizedAssetReply.d.ts +1 -1
- package/delivery/AssetDelivery/privateFiles/NotAuthorizedAssetReply.js +5 -12
- package/delivery/AssetDelivery/privateFiles/NotAuthorizedAssetReply.js.map +1 -1
- package/delivery/AssetDelivery/privateFiles/NotAuthorizedOutputStrategy.d.ts +1 -1
- package/delivery/AssetDelivery/privateFiles/NotAuthorizedOutputStrategy.js +3 -10
- package/delivery/AssetDelivery/privateFiles/NotAuthorizedOutputStrategy.js.map +1 -1
- package/delivery/AssetDelivery/privateFiles/PrivateAuthenticatedAuthorizer.d.ts +4 -3
- package/delivery/AssetDelivery/privateFiles/PrivateAuthenticatedAuthorizer.js +3 -11
- package/delivery/AssetDelivery/privateFiles/PrivateAuthenticatedAuthorizer.js.map +1 -1
- package/delivery/AssetDelivery/privateFiles/PrivateCache.d.ts +5 -3
- package/delivery/AssetDelivery/privateFiles/PrivateCache.js +17 -14
- package/delivery/AssetDelivery/privateFiles/PrivateCache.js.map +1 -1
- package/delivery/AssetDelivery/privateFiles/PrivateFileAssetRequestResolver.d.ts +3 -2
- package/delivery/AssetDelivery/privateFiles/PrivateFileAssetRequestResolver.js +3 -10
- package/delivery/AssetDelivery/privateFiles/PrivateFileAssetRequestResolver.js.map +1 -1
- package/delivery/AssetDelivery/privateFiles/PrivateFilesAssetProcessor.d.ts +4 -4
- package/delivery/AssetDelivery/privateFiles/PrivateFilesAssetProcessor.js +24 -22
- package/delivery/AssetDelivery/privateFiles/PrivateFilesAssetProcessor.js.map +1 -1
- package/delivery/AssetDelivery/privateFiles/PublicCache.d.ts +5 -3
- package/delivery/AssetDelivery/privateFiles/PublicCache.js +17 -14
- package/delivery/AssetDelivery/privateFiles/PublicCache.js.map +1 -1
- package/delivery/AssetDelivery/privateFiles/RedirectToPrivateUrlOutputStrategy.d.ts +2 -1
- package/delivery/AssetDelivery/privateFiles/RedirectToPrivateUrlOutputStrategy.js +5 -12
- package/delivery/AssetDelivery/privateFiles/RedirectToPrivateUrlOutputStrategy.js.map +1 -1
- package/delivery/AssetDelivery/privateFiles/RedirectToPublicUrlOutputStrategy.d.ts +2 -1
- package/delivery/AssetDelivery/privateFiles/RedirectToPublicUrlOutputStrategy.js +5 -12
- package/delivery/AssetDelivery/privateFiles/RedirectToPublicUrlOutputStrategy.js.map +1 -1
- package/delivery/AssetDelivery/transformation/PassthroughAssetProcessor.d.ts +1 -1
- package/delivery/AssetDelivery/transformation/PassthroughAssetProcessor.js +1 -8
- package/delivery/AssetDelivery/transformation/PassthroughAssetProcessor.js.map +1 -1
- package/delivery/AssetDelivery/transformation/PassthroughAssetTransformationStrategy.d.ts +1 -1
- package/delivery/AssetDelivery/transformation/PassthroughAssetTransformationStrategy.js +1 -8
- package/delivery/AssetDelivery/transformation/PassthroughAssetTransformationStrategy.js.map +1 -1
- package/delivery/AssetDelivery/transformation/TransformationAssetProcessor.d.ts +1 -1
- package/delivery/AssetDelivery/transformation/TransformationAssetProcessor.js +2 -8
- package/delivery/AssetDelivery/transformation/TransformationAssetProcessor.js.map +1 -1
- package/delivery/index.d.ts +16 -17
- package/delivery/index.js +10 -192
- package/delivery/index.js.map +1 -1
- package/delivery/setupAssetDelivery.d.ts +2 -6
- package/delivery/setupAssetDelivery.js +23 -36
- package/delivery/setupAssetDelivery.js.map +1 -1
- package/domain/file/abstractions.d.ts +9 -0
- package/domain/file/abstractions.js +8 -0
- package/domain/file/abstractions.js.map +1 -0
- package/domain/file/errors.d.ts +59 -0
- package/domain/file/errors.js +89 -0
- package/domain/file/errors.js.map +1 -0
- package/domain/file/file.model.d.ts +12 -0
- package/domain/file/file.model.js +56 -0
- package/domain/file/file.model.js.map +1 -0
- package/domain/file/types.d.ts +51 -0
- package/domain/file/types.js +3 -0
- package/domain/file/types.js.map +1 -0
- package/domain/identity/Identity.d.ts +9 -0
- package/domain/identity/Identity.js +11 -0
- package/domain/identity/Identity.js.map +1 -0
- package/domain/settings/constants.d.ts +1 -0
- package/domain/settings/constants.js +3 -0
- package/domain/settings/constants.js.map +1 -0
- package/domain/settings/errors.d.ts +18 -0
- package/domain/settings/errors.js +30 -0
- package/domain/settings/errors.js.map +1 -0
- package/domain/settings/types.d.ts +10 -0
- package/domain/settings/types.js +3 -0
- package/domain/settings/types.js.map +1 -0
- package/domain/settings/validation.d.ts +14 -0
- package/domain/settings/validation.js +36 -0
- package/domain/settings/validation.js.map +1 -0
- package/features/FileManagerFeature.d.ts +1 -0
- package/features/FileManagerFeature.js +28 -0
- package/features/FileManagerFeature.js.map +1 -0
- package/features/file/CreateFile/CreateFileRepository.d.ts +15 -0
- package/features/file/CreateFile/CreateFileRepository.js +30 -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 +89 -0
- package/features/file/CreateFile/CreateFileUseCase.js.map +1 -0
- package/features/file/CreateFile/abstractions.d.ts +57 -0
- package/features/file/CreateFile/abstractions.js +15 -0
- package/features/file/CreateFile/abstractions.js.map +1 -0
- package/features/file/CreateFile/events.d.ts +29 -0
- package/features/file/CreateFile/events.js +28 -0
- package/features/file/CreateFile/events.js.map +1 -0
- package/features/file/CreateFile/feature.d.ts +1 -0
- package/features/file/CreateFile/feature.js +12 -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 +4 -0
- package/features/file/CreateFile/index.js.map +1 -0
- package/features/file/CreateFilesInBatch/CreateFilesInBatchRepository.d.ts +13 -0
- package/features/file/CreateFilesInBatch/CreateFilesInBatchRepository.js +24 -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 +84 -0
- package/features/file/CreateFilesInBatch/CreateFilesInBatchUseCase.js.map +1 -0
- package/features/file/CreateFilesInBatch/abstractions.d.ts +40 -0
- package/features/file/CreateFilesInBatch/abstractions.js +15 -0
- package/features/file/CreateFilesInBatch/abstractions.js.map +1 -0
- package/features/file/CreateFilesInBatch/events.d.ts +29 -0
- package/features/file/CreateFilesInBatch/events.js +28 -0
- package/features/file/CreateFilesInBatch/events.js.map +1 -0
- package/features/file/CreateFilesInBatch/feature.d.ts +1 -0
- package/features/file/CreateFilesInBatch/feature.js +12 -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 +3 -0
- package/features/file/CreateFilesInBatch/index.js.map +1 -0
- package/features/file/DeleteFile/DeleteFileRepository.d.ts +15 -0
- package/features/file/DeleteFile/DeleteFileRepository.js +30 -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 +45 -0
- package/features/file/DeleteFile/DeleteFileUseCase.js.map +1 -0
- package/features/file/DeleteFile/abstractions.d.ts +37 -0
- package/features/file/DeleteFile/abstractions.js +15 -0
- package/features/file/DeleteFile/abstractions.js.map +1 -0
- package/features/file/DeleteFile/events.d.ts +27 -0
- package/features/file/DeleteFile/events.js +28 -0
- package/features/file/DeleteFile/events.js.map +1 -0
- package/features/file/DeleteFile/feature.d.ts +1 -0
- package/features/file/DeleteFile/feature.js +12 -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 +4 -0
- package/features/file/DeleteFile/index.js.map +1 -0
- package/features/file/FileUrlGenerator/abstractions.d.ts +8 -0
- package/features/file/FileUrlGenerator/abstractions.js +4 -0
- package/features/file/FileUrlGenerator/abstractions.js.map +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 +31 -0
- package/features/file/GetFile/GetFileUseCase.js.map +1 -0
- package/features/file/GetFile/abstractions.d.ts +38 -0
- package/features/file/GetFile/abstractions.js +15 -0
- package/features/file/GetFile/abstractions.js.map +1 -0
- package/features/file/GetFile/feature.d.ts +1 -0
- package/features/file/GetFile/feature.js +12 -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 +3 -0
- package/features/file/GetFile/index.js.map +1 -0
- package/features/file/ListFiles/ListFilesRepository.d.ts +18 -0
- package/features/file/ListFiles/ListFilesRepository.js +51 -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 +45 -0
- package/features/file/ListFiles/ListFilesUseCase.js.map +1 -0
- package/features/file/ListFiles/abstractions.d.ts +47 -0
- package/features/file/ListFiles/abstractions.js +15 -0
- package/features/file/ListFiles/abstractions.js.map +1 -0
- package/features/file/ListFiles/feature.d.ts +1 -0
- package/features/file/ListFiles/feature.js +12 -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 +3 -0
- package/features/file/ListFiles/index.js.map +1 -0
- package/features/file/ListTags/ListTagsRepository.d.ts +16 -0
- package/features/file/ListTags/ListTagsRepository.js +47 -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 +43 -0
- package/features/file/ListTags/abstractions.js +15 -0
- package/features/file/ListTags/abstractions.js.map +1 -0
- package/features/file/ListTags/feature.d.ts +1 -0
- package/features/file/ListTags/feature.js +12 -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 +3 -0
- package/features/file/ListTags/index.js.map +1 -0
- package/features/file/UpdateFile/UpdateFileRepository.d.ts +15 -0
- package/features/file/UpdateFile/UpdateFileRepository.js +39 -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 +78 -0
- package/features/file/UpdateFile/UpdateFileUseCase.js.map +1 -0
- package/features/file/UpdateFile/abstractions.d.ts +53 -0
- package/features/file/UpdateFile/abstractions.js +15 -0
- package/features/file/UpdateFile/abstractions.js.map +1 -0
- package/features/file/UpdateFile/events.d.ts +32 -0
- package/features/file/UpdateFile/events.js +28 -0
- package/features/file/UpdateFile/events.js.map +1 -0
- package/features/file/UpdateFile/feature.d.ts +1 -0
- package/features/file/UpdateFile/feature.js +12 -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 +4 -0
- package/features/file/UpdateFile/index.js.map +1 -0
- package/features/file/shared/EntryToFileMapper.d.ts +5 -0
- package/features/file/shared/EntryToFileMapper.js +26 -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 +30 -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 +29 -0
- package/features/file/shared/FileToEntryMapper.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 +17 -0
- package/features/settings/GetSettings/abstractions.js +9 -0
- package/features/settings/GetSettings/abstractions.js.map +1 -0
- package/features/settings/GetSettings/feature.d.ts +1 -0
- package/features/settings/GetSettings/feature.js +10 -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 +35 -0
- package/features/settings/SettingsInstaller/SettingsInstaller.js.map +1 -0
- package/features/settings/SettingsInstaller/feature.d.ts +1 -0
- package/features/settings/SettingsInstaller/feature.js +10 -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 +62 -0
- package/features/settings/UpdateSettings/UpdateSettingsUseCase.js.map +1 -0
- package/features/settings/UpdateSettings/abstractions.d.ts +22 -0
- package/features/settings/UpdateSettings/abstractions.js +9 -0
- package/features/settings/UpdateSettings/abstractions.js.map +1 -0
- package/features/settings/UpdateSettings/events.d.ts +32 -0
- package/features/settings/UpdateSettings/events.js +28 -0
- package/features/settings/UpdateSettings/events.js.map +1 -0
- package/features/settings/UpdateSettings/feature.d.ts +1 -0
- package/features/settings/UpdateSettings/feature.js +10 -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 +4 -0
- package/features/settings/UpdateSettings/index.js.map +1 -0
- package/features/shared/abstractions.d.ts +1 -0
- package/features/shared/abstractions.js +3 -0
- package/features/shared/abstractions.js.map +1 -0
- package/graphql/baseSchema.d.ts +2 -2
- package/graphql/baseSchema.js +20 -38
- package/graphql/baseSchema.js.map +1 -1
- package/graphql/createFilesTypeDefs.d.ts +1 -1
- package/graphql/createFilesTypeDefs.js +40 -25
- package/graphql/createFilesTypeDefs.js.map +1 -1
- package/graphql/filesSchema.d.ts +3 -3
- package/graphql/filesSchema.js +73 -46
- package/graphql/filesSchema.js.map +1 -1
- package/graphql/getFileByUrl.d.ts +2 -2
- package/graphql/getFileByUrl.js +17 -26
- package/graphql/getFileByUrl.js.map +1 -1
- package/graphql/index.d.ts +2 -2
- package/graphql/index.js +24 -26
- package/graphql/index.js.map +1 -1
- package/graphql/utils.js +6 -13
- package/graphql/utils.js.map +1 -1
- package/index.d.ts +6 -9
- package/index.js +28 -63
- package/index.js.map +1 -1
- package/modelModifier/CmsModelModifier.d.ts +3 -3
- package/modelModifier/CmsModelModifier.js +7 -15
- package/modelModifier/CmsModelModifier.js.map +1 -1
- package/package.json +26 -38
- package/permissions/schema.d.ts +81 -0
- package/permissions/schema.js +22 -0
- package/permissions/schema.js.map +1 -0
- package/types.d.ts +1 -365
- package/types.js +1 -27
- package/types.js.map +1 -1
- package/FileManagerContextSetup.d.ts +0 -13
- package/FileManagerContextSetup.js +0 -108
- package/FileManagerContextSetup.js.map +0 -1
- package/cmsFileStorage/CmsFilesStorage.d.ts +0 -27
- package/cmsFileStorage/CmsFilesStorage.js +0 -164
- package/cmsFileStorage/CmsFilesStorage.js.map +0 -1
- package/cmsFileStorage/ListFilesWhereProcessor.d.ts +0 -7
- package/cmsFileStorage/ListFilesWhereProcessor.js +0 -33
- package/cmsFileStorage/ListFilesWhereProcessor.js.map +0 -1
- package/cmsFileStorage/ListTagsWhereProcessor.d.ts +0 -7
- package/cmsFileStorage/ListTagsWhereProcessor.js +0 -33
- package/cmsFileStorage/ListTagsWhereProcessor.js.map +0 -1
- package/cmsFileStorage/file.model.d.ts +0 -6
- package/cmsFileStorage/file.model.js +0 -158
- package/cmsFileStorage/file.model.js.map +0 -1
- package/createFileManager/files.crud.d.ts +0 -3
- package/createFileManager/files.crud.js +0 -328
- package/createFileManager/files.crud.js.map +0 -1
- package/createFileManager/index.d.ts +0 -15
- package/createFileManager/index.js +0 -23
- package/createFileManager/index.js.map +0 -1
- package/createFileManager/permissions/FilesPermissions.d.ts +0 -4
- package/createFileManager/permissions/FilesPermissions.js +0 -11
- package/createFileManager/permissions/FilesPermissions.js.map +0 -1
- package/createFileManager/settings.crud.d.ts +0 -3
- package/createFileManager/settings.crud.js +0 -109
- package/createFileManager/settings.crud.js.map +0 -1
- package/createFileManager/system.crud.d.ts +0 -3
- package/createFileManager/system.crud.js +0 -88
- package/createFileManager/system.crud.js.map +0 -1
- package/delivery/AssetDelivery/AliasAssetRequestResolver.d.ts +0 -10
- package/delivery/AssetDelivery/AliasAssetRequestResolver.js +0 -74
- package/delivery/AssetDelivery/AliasAssetRequestResolver.js.map +0 -1
- package/delivery/AssetDelivery/privateFiles/internalIdentity.d.ts +0 -7
- package/delivery/AssetDelivery/privateFiles/internalIdentity.js +0 -18
- package/delivery/AssetDelivery/privateFiles/internalIdentity.js.map +0 -1
- package/handlers/manage/imageManager.d.ts +0 -14
- package/handlers/manage/imageManager.js +0 -75
- package/handlers/manage/imageManager.js.map +0 -1
- package/handlers/manage/index.d.ts +0 -5
- package/handlers/manage/index.js +0 -59
- package/handlers/manage/index.js.map +0 -1
- package/handlers/manage/legacyUtils.d.ts +0 -12
- package/handlers/manage/legacyUtils.js +0 -34
- package/handlers/manage/legacyUtils.js.map +0 -1
- package/handlers/manage/utils.d.ts +0 -12
- package/handlers/manage/utils.js +0 -34
- package/handlers/manage/utils.js.map +0 -1
- package/handlers/types.d.ts +0 -8
- package/handlers/types.js +0 -7
- package/handlers/types.js.map +0 -1
- package/handlers/utils/getEnvironment.d.ts +0 -5
- package/handlers/utils/getEnvironment.js +0 -13
- package/handlers/utils/getEnvironment.js.map +0 -1
- package/handlers/utils/getObjectParams.d.ts +0 -9
- package/handlers/utils/getObjectParams.js +0 -23
- package/handlers/utils/getObjectParams.js.map +0 -1
- package/handlers/utils/index.d.ts +0 -2
- package/handlers/utils/index.js +0 -22
- 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 -39
- package/plugins/FileStorageTransformPlugin.js.map +0 -1
- package/plugins/index.d.ts +0 -2
- package/plugins/index.js +0 -29
- package/plugins/index.js.map +0 -1
- package/storage/FileStorage.d.ts +0 -33
- package/storage/FileStorage.js +0 -90
- package/storage/FileStorage.js.map +0 -1
- package/types/file.d.ts +0 -48
- package/types/file.js +0 -7
- package/types/file.js.map +0 -1
- package/types/file.lifecycle.d.ts +0 -44
- package/types/file.lifecycle.js +0 -7
- package/types/file.lifecycle.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ResponseHeaders } from "@webiny/handler";
|
|
2
|
-
import { Asset, AssetOutputStrategy, AssetReply } from "
|
|
1
|
+
import type { ResponseHeaders } from "@webiny/handler";
|
|
2
|
+
import type { Asset, AssetOutputStrategy, AssetReply } from "../../delivery/index.js";
|
|
3
3
|
export declare class SetCacheControlHeaders implements AssetOutputStrategy {
|
|
4
4
|
private readonly strategy;
|
|
5
5
|
private readonly headers;
|
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.SetCacheControlHeaders = void 0;
|
|
7
|
-
class SetCacheControlHeaders {
|
|
1
|
+
export class SetCacheControlHeaders {
|
|
8
2
|
constructor(headers, strategy) {
|
|
9
3
|
this.headers = headers;
|
|
10
4
|
this.strategy = strategy;
|
|
@@ -20,6 +14,5 @@ class SetCacheControlHeaders {
|
|
|
20
14
|
return reply;
|
|
21
15
|
}
|
|
22
16
|
}
|
|
23
|
-
exports.SetCacheControlHeaders = SetCacheControlHeaders;
|
|
24
17
|
|
|
25
18
|
//# sourceMappingURL=SetCacheControlHeaders.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["SetCacheControlHeaders","constructor","headers","strategy","output","asset","Error","reply","setHeaders","merge"
|
|
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,9 +1,9 @@
|
|
|
1
|
-
import { AssetOutputStrategy, Asset, AssetReply, AssetRequest, AssetOutputStrategyDecoratorParams } from "
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
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
4
|
export interface ResponseHeadersParams {
|
|
5
5
|
headers: ResponseHeaders;
|
|
6
|
-
context:
|
|
6
|
+
context: ApiCoreContext;
|
|
7
7
|
assetRequest: AssetRequest;
|
|
8
8
|
asset: Asset;
|
|
9
9
|
}
|
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.SetResponseHeaders = void 0;
|
|
7
|
-
class SetResponseHeaders {
|
|
1
|
+
export class SetResponseHeaders {
|
|
8
2
|
constructor(setter, strategyDecoratorParams) {
|
|
9
3
|
this.strategyDecoratorParams = strategyDecoratorParams;
|
|
10
4
|
this.setter = setter;
|
|
@@ -20,6 +14,5 @@ class SetResponseHeaders {
|
|
|
20
14
|
return reply;
|
|
21
15
|
}
|
|
22
16
|
}
|
|
23
|
-
exports.SetResponseHeaders = SetResponseHeaders;
|
|
24
17
|
|
|
25
18
|
//# sourceMappingURL=SetResponseHeaders.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["SetResponseHeaders","constructor","setter","strategyDecoratorParams","output","asset","reply","assetOutputStrategy","assetRequest","context","headers","getHeaders"
|
|
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 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["AssetContentsReader.ts"],"sourcesContent":["import { Asset } from \"~/delivery\";\n\nexport interface AssetContentsReader {\n read(asset: Asset): Promise<Buffer>;\n}\n"],"mappings":"","ignoreList":[]}
|
|
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 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["AssetOutputStrategy.ts"],"sourcesContent":["import { Asset, AssetReply } from \"~/delivery\";\n\nexport interface AssetOutputStrategy {\n output(asset: Asset): Promise<AssetReply>;\n}\n"],"mappings":"","ignoreList":[]}
|
|
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 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["AssetProcessor.ts"],"sourcesContent":["import { Asset, AssetRequest } from \"~/delivery\";\n\nexport interface AssetProcessor {\n process(assetRequest: AssetRequest, asset: Asset): Promise<Asset>;\n}\n"],"mappings":"","ignoreList":[]}
|
|
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,17 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.AssetReply = void 0;
|
|
7
|
-
var _handler = require("@webiny/handler");
|
|
1
|
+
import { ResponseHeaders } from "@webiny/handler";
|
|
8
2
|
const defaultBody = () => "";
|
|
9
|
-
class AssetReply {
|
|
3
|
+
export class AssetReply {
|
|
10
4
|
constructor(params = {
|
|
11
5
|
code: 200
|
|
12
6
|
}) {
|
|
13
7
|
this.code = params.code;
|
|
14
|
-
this.headers = params.headers ||
|
|
8
|
+
this.headers = params.headers || ResponseHeaders.create();
|
|
15
9
|
this.body = params.body || defaultBody;
|
|
16
10
|
}
|
|
17
11
|
setHeaders(cb) {
|
|
@@ -33,6 +27,5 @@ class AssetReply {
|
|
|
33
27
|
return this.body();
|
|
34
28
|
}
|
|
35
29
|
}
|
|
36
|
-
exports.AssetReply = AssetReply;
|
|
37
30
|
|
|
38
31
|
//# sourceMappingURL=AssetReply.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["ResponseHeaders","defaultBody","AssetReply","constructor","params","code","headers","create","body","setHeaders","cb","getHeaders","setCode","getCode","setBody","getBody"],"sources":["AssetReply.ts"],"sourcesContent":["import { ResponseHeaders } from \"@webiny/handler\";\n\ninterface HeadersSetter {\n (headers: ResponseHeaders): ResponseHeaders;\n}\n\ninterface AssetReplyParams {\n code: number;\n headers?: ResponseHeaders;\n body?: AssetReplyBody;\n}\n\ninterface AssetReplyBody {\n (): Promise<unknown> | unknown;\n}\n\nconst defaultBody = () => \"\";\n\nexport class AssetReply {\n private headers: ResponseHeaders;\n private code: number;\n private body: AssetReplyBody;\n\n constructor(params: AssetReplyParams = { code: 200 }) {\n this.code = params.code;\n this.headers = params.headers || ResponseHeaders.create();\n this.body = params.body || defaultBody;\n }\n\n setHeaders(cb: HeadersSetter) {\n this.headers = cb(this.headers);\n }\n\n getHeaders() {\n return this.headers;\n }\n\n setCode(code: number) {\n this.code = code;\n }\n\n getCode() {\n return this.code;\n }\n\n setBody(body: AssetReplyBody) {\n this.body = body;\n }\n\n getBody() {\n return this.body();\n }\n}\n"],"mappings":"AAAA,SAASA,eAAe,QAAQ,iBAAiB;AAgBjD,MAAMC,WAAW,GAAGA,CAAA,KAAM,EAAE;AAE5B,OAAO,MAAMC,UAAU,CAAC;EAKpBC,WAAWA,CAACC,MAAwB,GAAG;IAAEC,IAAI,EAAE;EAAI,CAAC,EAAE;IAClD,IAAI,CAACA,IAAI,GAAGD,MAAM,CAACC,IAAI;IACvB,IAAI,CAACC,OAAO,GAAGF,MAAM,CAACE,OAAO,IAAIN,eAAe,CAACO,MAAM,CAAC,CAAC;IACzD,IAAI,CAACC,IAAI,GAAGJ,MAAM,CAACI,IAAI,IAAIP,WAAW;EAC1C;EAEAQ,UAAUA,CAACC,EAAiB,EAAE;IAC1B,IAAI,CAACJ,OAAO,GAAGI,EAAE,CAAC,IAAI,CAACJ,OAAO,CAAC;EACnC;EAEAK,UAAUA,CAAA,EAAG;IACT,OAAO,IAAI,CAACL,OAAO;EACvB;EAEAM,OAAOA,CAACP,IAAY,EAAE;IAClB,IAAI,CAACA,IAAI,GAAGA,IAAI;EACpB;EAEAQ,OAAOA,CAAA,EAAG;IACN,OAAO,IAAI,CAACR,IAAI;EACpB;EAEAS,OAAOA,CAACN,IAAoB,EAAE;IAC1B,IAAI,CAACA,IAAI,GAAGA,IAAI;EACpB;EAEAO,OAAOA,CAAA,EAAG;IACN,OAAO,IAAI,CAACP,IAAI,CAAC,CAAC;EACtB;AACJ","ignoreList":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Request } from "@webiny/handler/types";
|
|
2
|
-
import { AssetRequest } from "
|
|
1
|
+
import type { Request } from "@webiny/handler/types.js";
|
|
2
|
+
import type { AssetRequest } from "../../../delivery/index.js";
|
|
3
3
|
export interface AssetRequestResolver {
|
|
4
4
|
resolve(request: Request): Promise<AssetRequest | undefined>;
|
|
5
5
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["AssetRequestResolver.ts"],"sourcesContent":["import { Request } from \"@webiny/handler/types\";\nimport { AssetRequest } from \"~/delivery\";\n\nexport interface AssetRequestResolver {\n resolve(request: Request): Promise<AssetRequest | undefined>;\n}\n"],"mappings":"","ignoreList":[]}
|
|
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 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["AssetResolver.ts"],"sourcesContent":["import { Asset, AssetRequest } from \"~/delivery\";\n\nexport interface AssetResolver {\n resolve(request: AssetRequest): Promise<Asset | undefined>;\n}\n"],"mappings":"","ignoreList":[]}
|
|
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 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["AssetTransformationStrategy.ts"],"sourcesContent":["import { Asset, AssetRequest } from \"~/delivery\";\n\nexport interface AssetTransformationStrategy {\n transform(assetRequest: AssetRequest, asset: Asset): Promise<Asset>;\n}\n"],"mappings":"","ignoreList":[]}
|
|
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,2 +1,2 @@
|
|
|
1
|
-
import { PluginFactory } from "@webiny/plugins/types";
|
|
1
|
+
import type { PluginFactory } from "@webiny/plugins/types.js";
|
|
2
2
|
export declare const createAssetDeliveryPluginLoader: (cb: PluginFactory) => PluginFactory;
|
|
@@ -1,15 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.createAssetDeliveryPluginLoader = void 0;
|
|
7
|
-
const createAssetDeliveryPluginLoader = cb => {
|
|
1
|
+
export const createAssetDeliveryPluginLoader = cb => {
|
|
8
2
|
if (process.env.WEBINY_FUNCTION_TYPE === "asset-delivery") {
|
|
9
3
|
return () => cb();
|
|
10
4
|
}
|
|
11
5
|
return () => Promise.resolve([]);
|
|
12
6
|
};
|
|
13
|
-
exports.createAssetDeliveryPluginLoader = createAssetDeliveryPluginLoader;
|
|
14
7
|
|
|
15
8
|
//# sourceMappingURL=createAssetDeliveryPluginLoader.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createAssetDeliveryPluginLoader","cb","process","env","WEBINY_FUNCTION_TYPE","Promise","resolve"
|
|
1
|
+
{"version":3,"names":["createAssetDeliveryPluginLoader","cb","process","env","WEBINY_FUNCTION_TYPE","Promise","resolve"],"sources":["createAssetDeliveryPluginLoader.ts"],"sourcesContent":["import type { PluginFactory } from \"@webiny/plugins/types.js\";\n\nexport const createAssetDeliveryPluginLoader = (cb: PluginFactory): PluginFactory => {\n if (process.env.WEBINY_FUNCTION_TYPE === \"asset-delivery\") {\n return () => cb();\n }\n\n return () => Promise.resolve([]);\n};\n"],"mappings":"AAEA,OAAO,MAAMA,+BAA+B,GAAIC,EAAiB,IAAoB;EACjF,IAAIC,OAAO,CAACC,GAAG,CAACC,oBAAoB,KAAK,gBAAgB,EAAE;IACvD,OAAO,MAAMH,EAAE,CAAC,CAAC;EACrB;EAEA,OAAO,MAAMI,OAAO,CAACC,OAAO,CAAC,EAAE,CAAC;AACpC,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["AssetAuthorizer.ts"],"sourcesContent":["import { File } from \"~/types\";\n\nexport interface AssetAuthorizer {\n authorize(file: File): Promise<void>;\n}\n"],"mappings":"","ignoreList":[]}
|
|
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":[]}
|
|
@@ -1,18 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.NotAuthorizedAssetReply = void 0;
|
|
7
|
-
var _handler = require("@webiny/handler");
|
|
8
|
-
var _ = require("../..");
|
|
9
|
-
class NotAuthorizedAssetReply extends _.AssetReply {
|
|
1
|
+
import { ResponseHeaders } from "@webiny/handler";
|
|
2
|
+
import { AssetReply } from "../../index.js";
|
|
3
|
+
export class NotAuthorizedAssetReply extends AssetReply {
|
|
10
4
|
constructor() {
|
|
11
5
|
super({
|
|
12
6
|
code: 403,
|
|
13
|
-
headers:
|
|
7
|
+
headers: ResponseHeaders.create({
|
|
14
8
|
"cache-control": "no-store",
|
|
15
|
-
"content-type": "application/json"
|
|
9
|
+
"content-type": "application/json; charset=utf-8"
|
|
16
10
|
}),
|
|
17
11
|
body: () => ({
|
|
18
12
|
error: "Not authorized!",
|
|
@@ -21,6 +15,5 @@ class NotAuthorizedAssetReply extends _.AssetReply {
|
|
|
21
15
|
});
|
|
22
16
|
}
|
|
23
17
|
}
|
|
24
|
-
exports.NotAuthorizedAssetReply = NotAuthorizedAssetReply;
|
|
25
18
|
|
|
26
19
|
//# sourceMappingURL=NotAuthorizedAssetReply.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["ResponseHeaders","AssetReply","NotAuthorizedAssetReply","constructor","code","headers","create","body","error"],"sources":["NotAuthorizedAssetReply.ts"],"sourcesContent":["import { ResponseHeaders } from \"@webiny/handler\";\nimport { AssetReply } from \"~/delivery/index.js\";\n\nexport class NotAuthorizedAssetReply extends AssetReply {\n constructor() {\n super({\n code: 403,\n headers: ResponseHeaders.create({\n \"cache-control\": \"no-store\",\n \"content-type\": \"application/json; charset=utf-8\"\n }),\n body: () => ({ error: \"Not authorized!\", code: \"NOT_AUTHORIZED\" })\n });\n }\n}\n"],"mappings":"AAAA,SAASA,eAAe,QAAQ,iBAAiB;AACjD,SAASC,UAAU;AAEnB,OAAO,MAAMC,uBAAuB,SAASD,UAAU,CAAC;EACpDE,WAAWA,CAAA,EAAG;IACV,KAAK,CAAC;MACFC,IAAI,EAAE,GAAG;MACTC,OAAO,EAAEL,eAAe,CAACM,MAAM,CAAC;QAC5B,eAAe,EAAE,UAAU;QAC3B,cAAc,EAAE;MACpB,CAAC,CAAC;MACFC,IAAI,EAAEA,CAAA,MAAO;QAAEC,KAAK,EAAE,iBAAiB;QAAEJ,IAAI,EAAE;MAAiB,CAAC;IACrE,CAAC,CAAC;EACN;AACJ","ignoreList":[]}
|
|
@@ -1,15 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.NotAuthorizedOutputStrategy = void 0;
|
|
7
|
-
var _NotAuthorizedAssetReply = require("./NotAuthorizedAssetReply");
|
|
8
|
-
class NotAuthorizedOutputStrategy {
|
|
1
|
+
import { NotAuthorizedAssetReply } from "./NotAuthorizedAssetReply.js";
|
|
2
|
+
export class NotAuthorizedOutputStrategy {
|
|
9
3
|
async output() {
|
|
10
|
-
return new
|
|
4
|
+
return new NotAuthorizedAssetReply();
|
|
11
5
|
}
|
|
12
6
|
}
|
|
13
|
-
exports.NotAuthorizedOutputStrategy = NotAuthorizedOutputStrategy;
|
|
14
7
|
|
|
15
8
|
//# sourceMappingURL=NotAuthorizedOutputStrategy.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["NotAuthorizedAssetReply","NotAuthorizedOutputStrategy","output"],"sources":["NotAuthorizedOutputStrategy.ts"],"sourcesContent":["import type { AssetOutputStrategy, AssetReply } from \"~/delivery/index.js\";\nimport { NotAuthorizedAssetReply } from \"./NotAuthorizedAssetReply.js\";\n\nexport class NotAuthorizedOutputStrategy implements AssetOutputStrategy {\n async output(): Promise<AssetReply> {\n return new NotAuthorizedAssetReply();\n }\n}\n"],"mappings":"AACA,SAASA,uBAAuB;AAEhC,OAAO,MAAMC,2BAA2B,CAAgC;EACpE,MAAMC,MAAMA,CAAA,EAAwB;IAChC,OAAO,IAAIF,uBAAuB,CAAC,CAAC;EACxC;AACJ","ignoreList":[]}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { File
|
|
2
|
-
import { AssetAuthorizer } from "./AssetAuthorizer";
|
|
1
|
+
import type { File } from "../../../domain/file/types.js";
|
|
2
|
+
import type { AssetAuthorizer } from "./AssetAuthorizer.js";
|
|
3
|
+
import type { ApiCoreContext } from "@webiny/api-core/types/core.js";
|
|
3
4
|
export declare class PrivateAuthenticatedAuthorizer implements AssetAuthorizer {
|
|
4
5
|
private context;
|
|
5
|
-
constructor(context:
|
|
6
|
+
constructor(context: ApiCoreContext);
|
|
6
7
|
authorize(file: File): Promise<void>;
|
|
7
8
|
}
|
|
@@ -1,12 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.PrivateAuthenticatedAuthorizer = void 0;
|
|
8
|
-
var _error = _interopRequireDefault(require("@webiny/error"));
|
|
9
|
-
class PrivateAuthenticatedAuthorizer {
|
|
1
|
+
import Error from "@webiny/error";
|
|
2
|
+
export class PrivateAuthenticatedAuthorizer {
|
|
10
3
|
constructor(context) {
|
|
11
4
|
this.context = context;
|
|
12
5
|
}
|
|
@@ -15,7 +8,7 @@ class PrivateAuthenticatedAuthorizer {
|
|
|
15
8
|
// Make sure there's a valid identity!
|
|
16
9
|
const identity = this.context.security.getIdentity();
|
|
17
10
|
if (!identity) {
|
|
18
|
-
throw new
|
|
11
|
+
throw new Error({
|
|
19
12
|
code: "NOT_AUTHORIZED",
|
|
20
13
|
message: "You're not authorized to access this asset!"
|
|
21
14
|
});
|
|
@@ -23,6 +16,5 @@ class PrivateAuthenticatedAuthorizer {
|
|
|
23
16
|
}
|
|
24
17
|
}
|
|
25
18
|
}
|
|
26
|
-
exports.PrivateAuthenticatedAuthorizer = PrivateAuthenticatedAuthorizer;
|
|
27
19
|
|
|
28
20
|
//# sourceMappingURL=PrivateAuthenticatedAuthorizer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["Error","PrivateAuthenticatedAuthorizer","constructor","context","authorize","file","accessControl","type","identity","security","getIdentity","code","message"],"sources":["PrivateAuthenticatedAuthorizer.ts"],"sourcesContent":["import Error from \"@webiny/error\";\nimport type { File } from \"~/domain/file/types.js\";\nimport type { AssetAuthorizer } from \"./AssetAuthorizer.js\";\nimport type { ApiCoreContext } from \"@webiny/api-core/types/core.js\";\n\nexport class PrivateAuthenticatedAuthorizer implements AssetAuthorizer {\n private context: ApiCoreContext;\n\n constructor(context: ApiCoreContext) {\n this.context = context;\n }\n\n async authorize(file: File) {\n if (file.accessControl && file.accessControl.type === \"private-authenticated\") {\n // Make sure there's a valid identity!\n const identity = this.context.security.getIdentity();\n\n if (!identity) {\n throw new Error({\n code: \"NOT_AUTHORIZED\",\n message: \"You're not authorized to access this asset!\"\n });\n }\n }\n }\n}\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,eAAe;AAKjC,OAAO,MAAMC,8BAA8B,CAA4B;EAGnEC,WAAWA,CAACC,OAAuB,EAAE;IACjC,IAAI,CAACA,OAAO,GAAGA,OAAO;EAC1B;EAEA,MAAMC,SAASA,CAACC,IAAU,EAAE;IACxB,IAAIA,IAAI,CAACC,aAAa,IAAID,IAAI,CAACC,aAAa,CAACC,IAAI,KAAK,uBAAuB,EAAE;MAC3E;MACA,MAAMC,QAAQ,GAAG,IAAI,CAACL,OAAO,CAACM,QAAQ,CAACC,WAAW,CAAC,CAAC;MAEpD,IAAI,CAACF,QAAQ,EAAE;QACX,MAAM,IAAIR,KAAK,CAAC;UACZW,IAAI,EAAE,gBAAgB;UACtBC,OAAO,EAAE;QACb,CAAC,CAAC;MACN;IACJ;EACJ;AACJ","ignoreList":[]}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { AssetOutputStrategy,
|
|
2
|
-
export declare class PrivateCache
|
|
3
|
-
|
|
1
|
+
import type { Asset, AssetOutputStrategy, AssetReply } from "../../../delivery/index.js";
|
|
2
|
+
export declare class PrivateCache implements AssetOutputStrategy {
|
|
3
|
+
private strategy;
|
|
4
|
+
constructor(strategy: AssetOutputStrategy);
|
|
5
|
+
output(asset: Asset): Promise<AssetReply>;
|
|
4
6
|
}
|
|
@@ -1,18 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { parse, stringify } from "cache-control-parser";
|
|
2
|
+
export class PrivateCache {
|
|
3
|
+
constructor(strategy) {
|
|
4
|
+
this.strategy = strategy;
|
|
5
|
+
}
|
|
6
|
+
async output(asset) {
|
|
7
|
+
const reply = await this.strategy.output(asset);
|
|
8
|
+
reply.setHeaders(headers => {
|
|
9
|
+
headers.set("cache-control", (value = "") => {
|
|
10
|
+
const cacheControl = parse(value);
|
|
11
|
+
cacheControl["private"] = true;
|
|
12
|
+
cacheControl["public"] = false;
|
|
13
|
+
return stringify(cacheControl);
|
|
14
|
+
});
|
|
15
|
+
return headers;
|
|
16
|
+
});
|
|
17
|
+
return reply;
|
|
14
18
|
}
|
|
15
19
|
}
|
|
16
|
-
exports.PrivateCache = PrivateCache;
|
|
17
20
|
|
|
18
21
|
//# sourceMappingURL=PrivateCache.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["parse","stringify","PrivateCache","constructor","strategy","output","asset","reply","setHeaders","headers","set","value","cacheControl"],"sources":["PrivateCache.ts"],"sourcesContent":["import { parse, stringify } from \"cache-control-parser\";\nimport type { Asset, AssetOutputStrategy, AssetReply } from \"~/delivery/index.js\";\n\nexport class PrivateCache implements AssetOutputStrategy {\n private strategy: AssetOutputStrategy;\n\n constructor(strategy: AssetOutputStrategy) {\n this.strategy = strategy;\n }\n\n async output(asset: Asset): Promise<AssetReply> {\n const reply = await this.strategy.output(asset);\n\n reply.setHeaders(headers => {\n headers.set(\"cache-control\", (value = \"\") => {\n const cacheControl = parse(value);\n cacheControl[\"private\"] = true;\n cacheControl[\"public\"] = false;\n return stringify(cacheControl);\n });\n return headers;\n });\n\n return reply;\n }\n}\n"],"mappings":"AAAA,SAASA,KAAK,EAAEC,SAAS,QAAQ,sBAAsB;AAGvD,OAAO,MAAMC,YAAY,CAAgC;EAGrDC,WAAWA,CAACC,QAA6B,EAAE;IACvC,IAAI,CAACA,QAAQ,GAAGA,QAAQ;EAC5B;EAEA,MAAMC,MAAMA,CAACC,KAAY,EAAuB;IAC5C,MAAMC,KAAK,GAAG,MAAM,IAAI,CAACH,QAAQ,CAACC,MAAM,CAACC,KAAK,CAAC;IAE/CC,KAAK,CAACC,UAAU,CAACC,OAAO,IAAI;MACxBA,OAAO,CAACC,GAAG,CAAC,eAAe,EAAE,CAACC,KAAK,GAAG,EAAE,KAAK;QACzC,MAAMC,YAAY,GAAGZ,KAAK,CAACW,KAAK,CAAC;QACjCC,YAAY,CAAC,SAAS,CAAC,GAAG,IAAI;QAC9BA,YAAY,CAAC,QAAQ,CAAC,GAAG,KAAK;QAC9B,OAAOX,SAAS,CAACW,YAAY,CAAC;MAClC,CAAC,CAAC;MACF,OAAOH,OAAO;IAClB,CAAC,CAAC;IAEF,OAAOF,KAAK;EAChB;AACJ","ignoreList":[]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { AssetRequestResolver } from "../../../delivery/index.js";
|
|
2
|
+
import { AssetRequest } from "../../../delivery/index.js";
|
|
3
|
+
import type { Request } from "@webiny/handler/types.js";
|
|
3
4
|
export declare class PrivateFileAssetRequestResolver implements AssetRequestResolver {
|
|
4
5
|
private readonly resolver;
|
|
5
6
|
constructor(resolver: AssetRequestResolver);
|
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.PrivateFileAssetRequestResolver = void 0;
|
|
7
|
-
var _ = require("../..");
|
|
8
|
-
class PrivateFileAssetRequestResolver {
|
|
1
|
+
import { AssetRequest } from "../../index.js";
|
|
2
|
+
export class PrivateFileAssetRequestResolver {
|
|
9
3
|
constructor(resolver) {
|
|
10
4
|
this.resolver = resolver;
|
|
11
5
|
}
|
|
@@ -19,7 +13,7 @@ class PrivateFileAssetRequestResolver {
|
|
|
19
13
|
|
|
20
14
|
// Example: { '*': '/private/65722cb5c7824a0008d05963/image-48.jpg' },
|
|
21
15
|
const path = params["*"];
|
|
22
|
-
return new
|
|
16
|
+
return new AssetRequest({
|
|
23
17
|
key: decodeURI(path).replace("/private/", ""),
|
|
24
18
|
context: {
|
|
25
19
|
url: request.url,
|
|
@@ -32,6 +26,5 @@ class PrivateFileAssetRequestResolver {
|
|
|
32
26
|
});
|
|
33
27
|
}
|
|
34
28
|
}
|
|
35
|
-
exports.PrivateFileAssetRequestResolver = PrivateFileAssetRequestResolver;
|
|
36
29
|
|
|
37
30
|
//# sourceMappingURL=PrivateFileAssetRequestResolver.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["AssetRequest","PrivateFileAssetRequestResolver","constructor","resolver","resolve","request","url","startsWith","params","query","path","key","decodeURI","replace","context","private","options","width","parseInt","undefined"],"sources":["PrivateFileAssetRequestResolver.ts"],"sourcesContent":["import type { AssetRequestResolver } from \"~/delivery/index.js\";\nimport { AssetRequest } from \"~/delivery/index.js\";\nimport type { Request } from \"@webiny/handler/types.js\";\n\nexport class PrivateFileAssetRequestResolver implements AssetRequestResolver {\n private readonly resolver: AssetRequestResolver;\n\n constructor(resolver: AssetRequestResolver) {\n this.resolver = resolver;\n }\n\n async resolve(request: Request): Promise<AssetRequest | undefined> {\n // Example: /private/65722cb5c7824a0008d05963/image-48.jpg?width=300\n if (!request.url.startsWith(\"/private/\")) {\n return this.resolver.resolve(request);\n }\n\n const params = (request.params ?? {}) as Record<string, any>;\n const query = (request.query ?? {}) as Record<string, any>;\n\n // Example: { '*': '/private/65722cb5c7824a0008d05963/image-48.jpg' },\n const path = params[\"*\"];\n\n return new AssetRequest({\n key: decodeURI(path).replace(\"/private/\", \"\"),\n context: {\n url: request.url,\n private: true\n },\n options: {\n ...query,\n width: query.width ? parseInt(query.width) : undefined\n }\n });\n }\n}\n"],"mappings":"AACA,SAASA,YAAY;AAGrB,OAAO,MAAMC,+BAA+B,CAAiC;EAGzEC,WAAWA,CAACC,QAA8B,EAAE;IACxC,IAAI,CAACA,QAAQ,GAAGA,QAAQ;EAC5B;EAEA,MAAMC,OAAOA,CAACC,OAAgB,EAAqC;IAC/D;IACA,IAAI,CAACA,OAAO,CAACC,GAAG,CAACC,UAAU,CAAC,WAAW,CAAC,EAAE;MACtC,OAAO,IAAI,CAACJ,QAAQ,CAACC,OAAO,CAACC,OAAO,CAAC;IACzC;IAEA,MAAMG,MAAM,GAAIH,OAAO,CAACG,MAAM,IAAI,CAAC,CAAyB;IAC5D,MAAMC,KAAK,GAAIJ,OAAO,CAACI,KAAK,IAAI,CAAC,CAAyB;;IAE1D;IACA,MAAMC,IAAI,GAAGF,MAAM,CAAC,GAAG,CAAC;IAExB,OAAO,IAAIR,YAAY,CAAC;MACpBW,GAAG,EAAEC,SAAS,CAACF,IAAI,CAAC,CAACG,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC;MAC7CC,OAAO,EAAE;QACLR,GAAG,EAAED,OAAO,CAACC,GAAG;QAChBS,OAAO,EAAE;MACb,CAAC;MACDC,OAAO,EAAE;QACL,GAAGP,KAAK;QACRQ,KAAK,EAAER,KAAK,CAACQ,KAAK,GAAGC,QAAQ,CAACT,KAAK,CAACQ,KAAK,CAAC,GAAGE;MACjD;IACJ,CAAC,CAAC;EACN;AACJ","ignoreList":[]}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Asset, AssetProcessor, AssetRequest } from "
|
|
3
|
-
import { AssetAuthorizer } from "./AssetAuthorizer";
|
|
1
|
+
import type { ApiCoreContext } from "@webiny/api-core/types/core.js";
|
|
2
|
+
import type { Asset, AssetProcessor, AssetRequest } from "../../../delivery/index.js";
|
|
3
|
+
import type { AssetAuthorizer } from "./AssetAuthorizer.js";
|
|
4
4
|
export declare class PrivateFilesAssetProcessor implements AssetProcessor {
|
|
5
5
|
private readonly context;
|
|
6
6
|
private assetProcessor;
|
|
7
7
|
private assetAuthorizer;
|
|
8
|
-
constructor(context:
|
|
8
|
+
constructor(context: ApiCoreContext, assetAuthorizer: AssetAuthorizer, assetProcessor: AssetProcessor);
|
|
9
9
|
process(assetRequest: AssetRequest, asset: Asset): Promise<Asset>;
|
|
10
10
|
private isPrivate;
|
|
11
11
|
private requestedViaPrivateEndpoint;
|