@webiny/api-file-manager 0.0.0-unstable.e53eceafb5 → 0.0.0-unstable.e6f0dc8ca7
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 +3 -7
- package/delivery/AssetDelivery/Asset.js +1 -11
- package/delivery/AssetDelivery/Asset.js.map +1 -1
- package/delivery/AssetDelivery/AssetDeliveryConfig.d.ts +11 -9
- package/delivery/AssetDelivery/AssetDeliveryConfig.js +18 -26
- package/delivery/AssetDelivery/AssetDeliveryConfig.js.map +1 -1
- package/delivery/AssetDelivery/AssetRequest.d.ts +1 -1
- 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 +3 -10
- 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 +1 -1
- package/delivery/AssetDelivery/SetCacheControlHeaders.js +1 -8
- package/delivery/AssetDelivery/SetCacheControlHeaders.js.map +1 -1
- package/delivery/AssetDelivery/SetResponseHeaders.d.ts +3 -3
- package/delivery/AssetDelivery/SetResponseHeaders.js +1 -8
- package/delivery/AssetDelivery/SetResponseHeaders.js.map +1 -1
- package/delivery/AssetDelivery/abstractions/AssetContentsReader.d.ts +1 -3
- 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 +4 -11
- 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 +1 -1
- package/delivery/AssetDelivery/privateFiles/PrivateCache.js +4 -11
- package/delivery/AssetDelivery/privateFiles/PrivateCache.js.map +1 -1
- package/delivery/AssetDelivery/privateFiles/PrivateFileAssetRequestResolver.d.ts +3 -3
- 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 +21 -21
- package/delivery/AssetDelivery/privateFiles/PrivateFilesAssetProcessor.js.map +1 -1
- package/delivery/AssetDelivery/privateFiles/PublicCache.d.ts +1 -1
- package/delivery/AssetDelivery/privateFiles/PublicCache.js +4 -11
- package/delivery/AssetDelivery/privateFiles/PublicCache.js.map +1 -1
- package/delivery/AssetDelivery/privateFiles/RedirectToPrivateUrlOutputStrategy.d.ts +2 -2
- 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 -2
- 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 +1 -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 +21 -35
- 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 +57 -0
- package/domain/file/file.model.js.map +1 -0
- package/domain/file/types.d.ts +53 -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/permissionsSchema.d.ts +16 -0
- package/domain/permissionsSchema.js +19 -0
- package/domain/permissionsSchema.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 +6 -0
- package/domain/settings/validation.js +36 -0
- package/domain/settings/validation.js.map +1 -0
- package/exports/api/file-manager/file.d.ts +12 -0
- package/exports/api/file-manager/file.js +14 -0
- package/exports/api/file-manager/file.js.map +1 -0
- package/exports/api/file-manager/permissions.d.ts +1 -0
- package/exports/api/file-manager/permissions.js +3 -0
- package/exports/api/file-manager/permissions.js.map +1 -0
- package/exports/api/file-manager/settings.d.ts +3 -0
- package/exports/api/file-manager/settings.js +5 -0
- package/exports/api/file-manager/settings.js.map +1 -0
- package/features/FileManagerFeature.d.ts +4 -0
- package/features/FileManagerFeature.js +30 -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 +90 -0
- package/features/file/CreateFile/CreateFileUseCase.js.map +1 -0
- package/features/file/CreateFile/abstractions.d.ts +60 -0
- package/features/file/CreateFile/abstractions.js +17 -0
- package/features/file/CreateFile/abstractions.js.map +1 -0
- package/features/file/CreateFile/events.d.ts +31 -0
- package/features/file/CreateFile/events.js +32 -0
- package/features/file/CreateFile/events.js.map +1 -0
- package/features/file/CreateFile/feature.d.ts +4 -0
- package/features/file/CreateFile/feature.js +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 +42 -0
- package/features/file/CreateFilesInBatch/abstractions.js +17 -0
- package/features/file/CreateFilesInBatch/abstractions.js.map +1 -0
- package/features/file/CreateFilesInBatch/events.d.ts +31 -0
- package/features/file/CreateFilesInBatch/events.js +32 -0
- package/features/file/CreateFilesInBatch/events.js.map +1 -0
- package/features/file/CreateFilesInBatch/feature.d.ts +4 -0
- package/features/file/CreateFilesInBatch/feature.js +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 +39 -0
- package/features/file/DeleteFile/abstractions.js +17 -0
- package/features/file/DeleteFile/abstractions.js.map +1 -0
- package/features/file/DeleteFile/events.d.ts +29 -0
- package/features/file/DeleteFile/events.js +32 -0
- package/features/file/DeleteFile/events.js.map +1 -0
- package/features/file/DeleteFile/feature.d.ts +4 -0
- package/features/file/DeleteFile/feature.js +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 +9 -0
- package/features/file/FileUrlGenerator/abstractions.js +5 -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 +40 -0
- package/features/file/GetFile/abstractions.js +17 -0
- package/features/file/GetFile/abstractions.js.map +1 -0
- package/features/file/GetFile/feature.d.ts +4 -0
- package/features/file/GetFile/feature.js +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/GetFileContents/abstractions.d.ts +20 -0
- package/features/file/GetFileContents/abstractions.js +4 -0
- package/features/file/GetFileContents/abstractions.js.map +1 -0
- package/features/file/GetFileContents/index.d.ts +1 -0
- package/features/file/GetFileContents/index.js +3 -0
- package/features/file/GetFileContents/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 +49 -0
- package/features/file/ListFiles/abstractions.js +17 -0
- package/features/file/ListFiles/abstractions.js.map +1 -0
- package/features/file/ListFiles/feature.d.ts +4 -0
- package/features/file/ListFiles/feature.js +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/ListImagesByTagTool/ListImagesByTagTool.d.ts +27 -0
- package/features/file/ListImagesByTagTool/ListImagesByTagTool.js +39 -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 +10 -0
- package/features/file/ListImagesByTagTool/feature.js.map +1 -0
- package/features/file/ListTags/ListTagsRepository.d.ts +16 -0
- package/features/file/ListTags/ListTagsRepository.js +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 +45 -0
- package/features/file/ListTags/abstractions.js +17 -0
- package/features/file/ListTags/abstractions.js.map +1 -0
- package/features/file/ListTags/feature.d.ts +4 -0
- package/features/file/ListTags/feature.js +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 +79 -0
- package/features/file/UpdateFile/UpdateFileUseCase.js.map +1 -0
- package/features/file/UpdateFile/abstractions.d.ts +56 -0
- package/features/file/UpdateFile/abstractions.js +17 -0
- package/features/file/UpdateFile/abstractions.js.map +1 -0
- package/features/file/UpdateFile/events.d.ts +34 -0
- package/features/file/UpdateFile/events.js +32 -0
- package/features/file/UpdateFile/events.js.map +1 -0
- package/features/file/UpdateFile/feature.d.ts +4 -0
- package/features/file/UpdateFile/feature.js +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 +27 -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 +31 -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 +30 -0
- package/features/file/shared/FileToEntryMapper.js.map +1 -0
- package/features/permissions/abstractions.d.ts +21 -0
- package/features/permissions/abstractions.js +5 -0
- package/features/permissions/abstractions.js.map +1 -0
- package/features/permissions/feature.d.ts +4 -0
- package/features/permissions/feature.js +6 -0
- package/features/permissions/feature.js.map +1 -0
- package/features/settings/GetSettings/GetSettingsUseCase.d.ts +13 -0
- package/features/settings/GetSettings/GetSettingsUseCase.js +28 -0
- package/features/settings/GetSettings/GetSettingsUseCase.js.map +1 -0
- package/features/settings/GetSettings/abstractions.d.ts +18 -0
- package/features/settings/GetSettings/abstractions.js +10 -0
- package/features/settings/GetSettings/abstractions.js.map +1 -0
- package/features/settings/GetSettings/feature.d.ts +4 -0
- package/features/settings/GetSettings/feature.js +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 +4 -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 +23 -0
- package/features/settings/UpdateSettings/abstractions.js +10 -0
- package/features/settings/UpdateSettings/abstractions.js.map +1 -0
- package/features/settings/UpdateSettings/events.d.ts +34 -0
- package/features/settings/UpdateSettings/events.js +32 -0
- package/features/settings/UpdateSettings/events.js.map +1 -0
- package/features/settings/UpdateSettings/feature.d.ts +4 -0
- package/features/settings/UpdateSettings/feature.js +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 +3 -2
- package/graphql/createFilesTypeDefs.js +45 -30
- 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 +27 -28
- package/graphql/index.js.map +1 -1
- package/graphql/utils.d.ts +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 -67
- package/index.js.map +1 -1
- package/modelModifier/CmsModelModifier.d.ts +1 -1
- package/modelModifier/CmsModelModifier.js +7 -15
- package/modelModifier/CmsModelModifier.js.map +1 -1
- package/package.json +31 -29
- package/types.d.ts +2 -367
- package/types.js +1 -27
- package/types.js.map +1 -1
- package/FileManagerContextSetup.d.ts +0 -13
- package/FileManagerContextSetup.js +0 -115
- 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 -3
- 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/permissions/SettingsPermissions.d.ts +0 -4
- package/createFileManager/permissions/SettingsPermissions.js +0 -11
- package/createFileManager/permissions/SettingsPermissions.js.map +0 -1
- package/createFileManager/settings.crud.d.ts +0 -3
- package/createFileManager/settings.crud.js +0 -117
- 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/createFileManager/types.d.ts +0 -16
- package/createFileManager/types.js +0 -7
- package/createFileManager/types.js.map +0 -1
- package/delivery/AssetDelivery/AliasAssetRequestResolver.d.ts +0 -11
- 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/enterprise/applyThreatScanning.d.ts +0 -2
- package/enterprise/applyThreatScanning.js +0 -20
- package/enterprise/applyThreatScanning.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 -22
- 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 -34
- package/storage/FileStorage.js +0 -90
- package/storage/FileStorage.js.map +0 -1
- package/types/file.d.ts +0 -49
- 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
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { DomainEvent } from "@webiny/api-core/features/eventPublisher/index.js";
|
|
2
|
+
import type { IEventHandler } from "@webiny/api-core/features/eventPublisher/index.js";
|
|
3
|
+
import type { File } from "../../../domain/file/types.js";
|
|
4
|
+
import type { UpdateFileInput } from "./abstractions.js";
|
|
5
|
+
export interface FileBeforeUpdatePayload {
|
|
6
|
+
original: File;
|
|
7
|
+
file: File;
|
|
8
|
+
input: UpdateFileInput;
|
|
9
|
+
}
|
|
10
|
+
export declare class FileBeforeUpdateEvent extends DomainEvent<FileBeforeUpdatePayload> {
|
|
11
|
+
eventType: "FileManager/File/BeforeUpdate";
|
|
12
|
+
getHandlerAbstraction(): import("@webiny/di").Abstraction<IEventHandler<FileBeforeUpdateEvent>>;
|
|
13
|
+
}
|
|
14
|
+
/** Hook into file lifecycle before a file is updated. */
|
|
15
|
+
export declare const FileBeforeUpdateEventHandler: import("@webiny/di").Abstraction<IEventHandler<FileBeforeUpdateEvent>>;
|
|
16
|
+
export declare namespace FileBeforeUpdateEventHandler {
|
|
17
|
+
type Interface = IEventHandler<FileBeforeUpdateEvent>;
|
|
18
|
+
type Event = FileBeforeUpdateEvent;
|
|
19
|
+
}
|
|
20
|
+
export interface FileAfterUpdatePayload {
|
|
21
|
+
original: File;
|
|
22
|
+
file: File;
|
|
23
|
+
input: UpdateFileInput;
|
|
24
|
+
}
|
|
25
|
+
export declare class FileAfterUpdateEvent extends DomainEvent<FileAfterUpdatePayload> {
|
|
26
|
+
eventType: "FileManager/File/AfterUpdate";
|
|
27
|
+
getHandlerAbstraction(): import("@webiny/di").Abstraction<IEventHandler<FileAfterUpdateEvent>>;
|
|
28
|
+
}
|
|
29
|
+
/** Hook into file lifecycle after a file is updated. */
|
|
30
|
+
export declare const FileAfterUpdateEventHandler: import("@webiny/di").Abstraction<IEventHandler<FileAfterUpdateEvent>>;
|
|
31
|
+
export declare namespace FileAfterUpdateEventHandler {
|
|
32
|
+
type Interface = IEventHandler<FileAfterUpdateEvent>;
|
|
33
|
+
type Event = FileAfterUpdateEvent;
|
|
34
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { createAbstraction } from "@webiny/feature/api";
|
|
2
|
+
import { DomainEvent } from "@webiny/api-core/features/eventPublisher/index.js";
|
|
3
|
+
|
|
4
|
+
// ============================================================================
|
|
5
|
+
// FileBeforeUpdate Event
|
|
6
|
+
// ============================================================================
|
|
7
|
+
|
|
8
|
+
export class FileBeforeUpdateEvent extends DomainEvent {
|
|
9
|
+
eventType = "FileManager/File/BeforeUpdate";
|
|
10
|
+
getHandlerAbstraction() {
|
|
11
|
+
return FileBeforeUpdateEventHandler;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/** Hook into file lifecycle before a file is updated. */
|
|
16
|
+
export const FileBeforeUpdateEventHandler = createAbstraction("FileBeforeUpdateEventHandler");
|
|
17
|
+
|
|
18
|
+
// ============================================================================
|
|
19
|
+
// FileAfterUpdate Event
|
|
20
|
+
// ============================================================================
|
|
21
|
+
|
|
22
|
+
export class FileAfterUpdateEvent extends DomainEvent {
|
|
23
|
+
eventType = "FileManager/File/AfterUpdate";
|
|
24
|
+
getHandlerAbstraction() {
|
|
25
|
+
return FileAfterUpdateEventHandler;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** Hook into file lifecycle after a file is updated. */
|
|
30
|
+
export const FileAfterUpdateEventHandler = createAbstraction("FileAfterUpdateEventHandler");
|
|
31
|
+
|
|
32
|
+
//# sourceMappingURL=events.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createAbstraction","DomainEvent","FileBeforeUpdateEvent","eventType","getHandlerAbstraction","FileBeforeUpdateEventHandler","FileAfterUpdateEvent","FileAfterUpdateEventHandler"],"sources":["events.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport { DomainEvent } from \"@webiny/api-core/features/eventPublisher/index.js\";\nimport type { IEventHandler } from \"@webiny/api-core/features/eventPublisher/index.js\";\nimport type { File } from \"~/domain/file/types.js\";\nimport type { UpdateFileInput } from \"./abstractions.js\";\n\n// ============================================================================\n// FileBeforeUpdate Event\n// ============================================================================\n\nexport interface FileBeforeUpdatePayload {\n original: File;\n file: File;\n input: UpdateFileInput;\n}\n\nexport class FileBeforeUpdateEvent extends DomainEvent<FileBeforeUpdatePayload> {\n eventType = \"FileManager/File/BeforeUpdate\" as const;\n\n getHandlerAbstraction() {\n return FileBeforeUpdateEventHandler;\n }\n}\n\n/** Hook into file lifecycle before a file is updated. */\nexport const FileBeforeUpdateEventHandler = createAbstraction<IEventHandler<FileBeforeUpdateEvent>>(\n \"FileBeforeUpdateEventHandler\"\n);\n\nexport namespace FileBeforeUpdateEventHandler {\n export type Interface = IEventHandler<FileBeforeUpdateEvent>;\n export type Event = FileBeforeUpdateEvent;\n}\n\n// ============================================================================\n// FileAfterUpdate Event\n// ============================================================================\n\nexport interface FileAfterUpdatePayload {\n original: File;\n file: File;\n input: UpdateFileInput;\n}\n\nexport class FileAfterUpdateEvent extends DomainEvent<FileAfterUpdatePayload> {\n eventType = \"FileManager/File/AfterUpdate\" as const;\n\n getHandlerAbstraction() {\n return FileAfterUpdateEventHandler;\n }\n}\n\n/** Hook into file lifecycle after a file is updated. */\nexport const FileAfterUpdateEventHandler = createAbstraction<IEventHandler<FileAfterUpdateEvent>>(\n \"FileAfterUpdateEventHandler\"\n);\n\nexport namespace FileAfterUpdateEventHandler {\n export type Interface = IEventHandler<FileAfterUpdateEvent>;\n export type Event = FileAfterUpdateEvent;\n}\n"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,qBAAqB;AACvD,SAASC,WAAW,QAAQ,mDAAmD;;AAK/E;AACA;AACA;;AAQA,OAAO,MAAMC,qBAAqB,SAASD,WAAW,CAA0B;EAC5EE,SAAS,GAAG,+BAA+B;EAE3CC,qBAAqBA,CAAA,EAAG;IACpB,OAAOC,4BAA4B;EACvC;AACJ;;AAEA;AACA,OAAO,MAAMA,4BAA4B,GAAGL,iBAAiB,CACzD,8BACJ,CAAC;;AAOD;AACA;AACA;;AAQA,OAAO,MAAMM,oBAAoB,SAASL,WAAW,CAAyB;EAC1EE,SAAS,GAAG,8BAA8B;EAE1CC,qBAAqBA,CAAA,EAAG;IACpB,OAAOG,2BAA2B;EACtC;AACJ;;AAEA;AACA,OAAO,MAAMA,2BAA2B,GAAGP,iBAAiB,CACxD,6BACJ,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createFeature } from "@webiny/feature/api";
|
|
2
|
+
import { UpdateFileRepository } from "./UpdateFileRepository.js";
|
|
3
|
+
import { UpdateFileUseCase } from "./UpdateFileUseCase.js";
|
|
4
|
+
export const UpdateFileFeature = createFeature({
|
|
5
|
+
name: "FileManager/UpdateFile",
|
|
6
|
+
register(container) {
|
|
7
|
+
container.register(UpdateFileUseCase);
|
|
8
|
+
container.register(UpdateFileRepository).inSingletonScope();
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
//# sourceMappingURL=feature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createFeature","UpdateFileRepository","UpdateFileUseCase","UpdateFileFeature","name","register","container","inSingletonScope"],"sources":["feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { UpdateFileRepository } from \"./UpdateFileRepository.js\";\nimport { UpdateFileUseCase } from \"./UpdateFileUseCase.js\";\n\nexport const UpdateFileFeature = createFeature({\n name: \"FileManager/UpdateFile\",\n register(container) {\n container.register(UpdateFileUseCase);\n container.register(UpdateFileRepository).inSingletonScope();\n }\n});\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ,qBAAqB;AACnD,SAASC,oBAAoB;AAC7B,SAASC,iBAAiB;AAE1B,OAAO,MAAMC,iBAAiB,GAAGH,aAAa,CAAC;EAC3CI,IAAI,EAAE,wBAAwB;EAC9BC,QAAQA,CAACC,SAAS,EAAE;IAChBA,SAAS,CAACD,QAAQ,CAACH,iBAAiB,CAAC;IACrCI,SAAS,CAACD,QAAQ,CAACJ,oBAAoB,CAAC,CAACM,gBAAgB,CAAC,CAAC;EAC/D;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["UpdateFileUseCase","FileBeforeUpdateEventHandler","FileAfterUpdateEventHandler"],"sources":["index.ts"],"sourcesContent":["export { UpdateFileUseCase } from \"./abstractions.js\";\nexport { FileBeforeUpdateEventHandler, FileAfterUpdateEventHandler } from \"./events.js\";\n"],"mappings":"AAAA,SAASA,iBAAiB;AAC1B,SAASC,4BAA4B,EAAEC,2BAA2B","ignoreList":[]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export class EntryToFileMapper {
|
|
2
|
+
static toFile(entry) {
|
|
3
|
+
return {
|
|
4
|
+
id: entry.entryId,
|
|
5
|
+
createdOn: entry.createdOn,
|
|
6
|
+
modifiedOn: entry.modifiedOn ?? undefined,
|
|
7
|
+
savedOn: entry.savedOn,
|
|
8
|
+
createdBy: entry.createdBy,
|
|
9
|
+
modifiedBy: entry.modifiedBy ?? undefined,
|
|
10
|
+
savedBy: entry.savedBy,
|
|
11
|
+
name: entry.values.name,
|
|
12
|
+
key: entry.values.key,
|
|
13
|
+
size: entry.values.size,
|
|
14
|
+
type: entry.values.type,
|
|
15
|
+
metadata: entry.values.metadata || {},
|
|
16
|
+
accessControl: entry.values.accessControl,
|
|
17
|
+
location: {
|
|
18
|
+
folderId: entry.location?.folderId ?? "root"
|
|
19
|
+
},
|
|
20
|
+
tags: entry.values.tags || [],
|
|
21
|
+
description: entry.values.description ?? "",
|
|
22
|
+
extensions: entry.values.extensions
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
//# sourceMappingURL=EntryToFileMapper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["EntryToFileMapper","toFile","entry","id","entryId","createdOn","modifiedOn","undefined","savedOn","createdBy","modifiedBy","savedBy","name","values","key","size","type","metadata","accessControl","location","folderId","tags","description","extensions"],"sources":["EntryToFileMapper.ts"],"sourcesContent":["import type { CmsEntry } from \"@webiny/api-headless-cms/types\";\nimport type { File } from \"~/domain/file/types.js\";\n\nexport class EntryToFileMapper {\n static toFile(entry: CmsEntry): File {\n return {\n id: entry.entryId,\n createdOn: entry.createdOn,\n modifiedOn: entry.modifiedOn ?? undefined,\n savedOn: entry.savedOn,\n createdBy: entry.createdBy,\n modifiedBy: entry.modifiedBy ?? undefined,\n savedBy: entry.savedBy,\n name: entry.values.name,\n key: entry.values.key,\n size: entry.values.size,\n type: entry.values.type,\n metadata: entry.values.metadata || {},\n accessControl: entry.values.accessControl,\n location: { folderId: entry.location?.folderId ?? \"root\" },\n tags: entry.values.tags || [],\n description: entry.values.description ?? \"\",\n extensions: entry.values.extensions\n };\n }\n}\n"],"mappings":"AAGA,OAAO,MAAMA,iBAAiB,CAAC;EAC3B,OAAOC,MAAMA,CAACC,KAAe,EAAQ;IACjC,OAAO;MACHC,EAAE,EAAED,KAAK,CAACE,OAAO;MACjBC,SAAS,EAAEH,KAAK,CAACG,SAAS;MAC1BC,UAAU,EAAEJ,KAAK,CAACI,UAAU,IAAIC,SAAS;MACzCC,OAAO,EAAEN,KAAK,CAACM,OAAO;MACtBC,SAAS,EAAEP,KAAK,CAACO,SAAS;MAC1BC,UAAU,EAAER,KAAK,CAACQ,UAAU,IAAIH,SAAS;MACzCI,OAAO,EAAET,KAAK,CAACS,OAAO;MACtBC,IAAI,EAAEV,KAAK,CAACW,MAAM,CAACD,IAAI;MACvBE,GAAG,EAAEZ,KAAK,CAACW,MAAM,CAACC,GAAG;MACrBC,IAAI,EAAEb,KAAK,CAACW,MAAM,CAACE,IAAI;MACvBC,IAAI,EAAEd,KAAK,CAACW,MAAM,CAACG,IAAI;MACvBC,QAAQ,EAAEf,KAAK,CAACW,MAAM,CAACI,QAAQ,IAAI,CAAC,CAAC;MACrCC,aAAa,EAAEhB,KAAK,CAACW,MAAM,CAACK,aAAa;MACzCC,QAAQ,EAAE;QAAEC,QAAQ,EAAElB,KAAK,CAACiB,QAAQ,EAAEC,QAAQ,IAAI;MAAO,CAAC;MAC1DC,IAAI,EAAEnB,KAAK,CAACW,MAAM,CAACQ,IAAI,IAAI,EAAE;MAC7BC,WAAW,EAAEpB,KAAK,CAACW,MAAM,CAACS,WAAW,IAAI,EAAE;MAC3CC,UAAU,EAAErB,KAAK,CAACW,MAAM,CAACU;IAC7B,CAAC;EACL;AACJ","ignoreList":[]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export class FileInputToEntryInputMapper {
|
|
2
|
+
static toEntry(file) {
|
|
3
|
+
return {
|
|
4
|
+
id: file.id,
|
|
5
|
+
createdOn: file.createdOn,
|
|
6
|
+
modifiedOn: file.modifiedOn,
|
|
7
|
+
savedOn: file.savedOn,
|
|
8
|
+
createdBy: file.createdBy,
|
|
9
|
+
modifiedBy: file.modifiedBy,
|
|
10
|
+
savedBy: file.savedBy,
|
|
11
|
+
location: file.location || {
|
|
12
|
+
folderId: "root"
|
|
13
|
+
},
|
|
14
|
+
values: {
|
|
15
|
+
name: file.name,
|
|
16
|
+
key: file.key,
|
|
17
|
+
size: file.size,
|
|
18
|
+
type: file.type,
|
|
19
|
+
metadata: file.metadata || {},
|
|
20
|
+
accessControl: {
|
|
21
|
+
type: "public"
|
|
22
|
+
},
|
|
23
|
+
tags: file.tags || [],
|
|
24
|
+
description: file.description ?? "",
|
|
25
|
+
extensions: file.extensions
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
//# sourceMappingURL=FileInputToEntryInputMapper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["FileInputToEntryInputMapper","toEntry","file","id","createdOn","modifiedOn","savedOn","createdBy","modifiedBy","savedBy","location","folderId","values","name","key","size","type","metadata","accessControl","tags","description","extensions"],"sources":["FileInputToEntryInputMapper.ts"],"sourcesContent":["import type { CreateCmsEntryInput } from \"@webiny/api-headless-cms/types\";\nimport type { FileInput } from \"~/domain/file/types.js\";\n\nexport class FileInputToEntryInputMapper {\n static toEntry(file: FileInput): CreateCmsEntryInput {\n return {\n id: file.id,\n createdOn: file.createdOn,\n modifiedOn: file.modifiedOn,\n savedOn: file.savedOn,\n createdBy: file.createdBy,\n modifiedBy: file.modifiedBy,\n savedBy: file.savedBy,\n location: file.location || { folderId: \"root\" },\n values: {\n name: file.name,\n key: file.key,\n size: file.size,\n type: file.type,\n metadata: file.metadata || {},\n accessControl: {\n type: \"public\"\n },\n tags: file.tags || [],\n description: file.description ?? \"\",\n extensions: file.extensions\n }\n };\n }\n}\n"],"mappings":"AAGA,OAAO,MAAMA,2BAA2B,CAAC;EACrC,OAAOC,OAAOA,CAACC,IAAe,EAAuB;IACjD,OAAO;MACHC,EAAE,EAAED,IAAI,CAACC,EAAE;MACXC,SAAS,EAAEF,IAAI,CAACE,SAAS;MACzBC,UAAU,EAAEH,IAAI,CAACG,UAAU;MAC3BC,OAAO,EAAEJ,IAAI,CAACI,OAAO;MACrBC,SAAS,EAAEL,IAAI,CAACK,SAAS;MACzBC,UAAU,EAAEN,IAAI,CAACM,UAAU;MAC3BC,OAAO,EAAEP,IAAI,CAACO,OAAO;MACrBC,QAAQ,EAAER,IAAI,CAACQ,QAAQ,IAAI;QAAEC,QAAQ,EAAE;MAAO,CAAC;MAC/CC,MAAM,EAAE;QACJC,IAAI,EAAEX,IAAI,CAACW,IAAI;QACfC,GAAG,EAAEZ,IAAI,CAACY,GAAG;QACbC,IAAI,EAAEb,IAAI,CAACa,IAAI;QACfC,IAAI,EAAEd,IAAI,CAACc,IAAI;QACfC,QAAQ,EAAEf,IAAI,CAACe,QAAQ,IAAI,CAAC,CAAC;QAC7BC,aAAa,EAAE;UACXF,IAAI,EAAE;QACV,CAAC;QACDG,IAAI,EAAEjB,IAAI,CAACiB,IAAI,IAAI,EAAE;QACrBC,WAAW,EAAElB,IAAI,CAACkB,WAAW,IAAI,EAAE;QACnCC,UAAU,EAAEnB,IAAI,CAACmB;MACrB;IACJ,CAAC;EACL;AACJ","ignoreList":[]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export class FileToEntryMapper {
|
|
2
|
+
static toEntry(file) {
|
|
3
|
+
return {
|
|
4
|
+
id: `${file.id}#0001`,
|
|
5
|
+
entryId: file.id,
|
|
6
|
+
createdOn: file.createdOn,
|
|
7
|
+
modifiedOn: file.modifiedOn,
|
|
8
|
+
savedOn: file.savedOn,
|
|
9
|
+
createdBy: file.createdBy,
|
|
10
|
+
modifiedBy: file.modifiedBy,
|
|
11
|
+
savedBy: file.savedBy,
|
|
12
|
+
location: file.location || {
|
|
13
|
+
folderId: "root"
|
|
14
|
+
},
|
|
15
|
+
values: {
|
|
16
|
+
name: file.name,
|
|
17
|
+
key: file.key,
|
|
18
|
+
size: file.size,
|
|
19
|
+
type: file.type,
|
|
20
|
+
metadata: file.metadata || {},
|
|
21
|
+
accessControl: file.accessControl,
|
|
22
|
+
tags: file.tags || [],
|
|
23
|
+
description: file.description ?? "",
|
|
24
|
+
extensions: file.extensions
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
//# sourceMappingURL=FileToEntryMapper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["FileToEntryMapper","toEntry","file","id","entryId","createdOn","modifiedOn","savedOn","createdBy","modifiedBy","savedBy","location","folderId","values","name","key","size","type","metadata","accessControl","tags","description","extensions"],"sources":["FileToEntryMapper.ts"],"sourcesContent":["import type { CmsEntry } from \"@webiny/api-headless-cms/types\";\nimport type { File } from \"~/domain/file/types.js\";\n\nexport class FileToEntryMapper {\n static toEntry(file: File): Partial<CmsEntry> {\n return {\n id: `${file.id}#0001`,\n entryId: file.id,\n createdOn: file.createdOn,\n modifiedOn: file.modifiedOn,\n savedOn: file.savedOn,\n createdBy: file.createdBy,\n modifiedBy: file.modifiedBy,\n savedBy: file.savedBy,\n location: file.location || { folderId: \"root\" },\n values: {\n name: file.name,\n key: file.key,\n size: file.size,\n type: file.type,\n metadata: file.metadata || {},\n accessControl: file.accessControl,\n tags: file.tags || [],\n description: file.description ?? \"\",\n extensions: file.extensions\n }\n };\n }\n}\n"],"mappings":"AAGA,OAAO,MAAMA,iBAAiB,CAAC;EAC3B,OAAOC,OAAOA,CAACC,IAAU,EAAqB;IAC1C,OAAO;MACHC,EAAE,EAAE,GAAGD,IAAI,CAACC,EAAE,OAAO;MACrBC,OAAO,EAAEF,IAAI,CAACC,EAAE;MAChBE,SAAS,EAAEH,IAAI,CAACG,SAAS;MACzBC,UAAU,EAAEJ,IAAI,CAACI,UAAU;MAC3BC,OAAO,EAAEL,IAAI,CAACK,OAAO;MACrBC,SAAS,EAAEN,IAAI,CAACM,SAAS;MACzBC,UAAU,EAAEP,IAAI,CAACO,UAAU;MAC3BC,OAAO,EAAER,IAAI,CAACQ,OAAO;MACrBC,QAAQ,EAAET,IAAI,CAACS,QAAQ,IAAI;QAAEC,QAAQ,EAAE;MAAO,CAAC;MAC/CC,MAAM,EAAE;QACJC,IAAI,EAAEZ,IAAI,CAACY,IAAI;QACfC,GAAG,EAAEb,IAAI,CAACa,GAAG;QACbC,IAAI,EAAEd,IAAI,CAACc,IAAI;QACfC,IAAI,EAAEf,IAAI,CAACe,IAAI;QACfC,QAAQ,EAAEhB,IAAI,CAACgB,QAAQ,IAAI,CAAC,CAAC;QAC7BC,aAAa,EAAEjB,IAAI,CAACiB,aAAa;QACjCC,IAAI,EAAElB,IAAI,CAACkB,IAAI,IAAI,EAAE;QACrBC,WAAW,EAAEnB,IAAI,CAACmB,WAAW,IAAI,EAAE;QACnCC,UAAU,EAAEpB,IAAI,CAACoB;MACrB;IACJ,CAAC;EACL;AACJ","ignoreList":[]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Permissions } from "@webiny/api-core/features/security/permissions/index.js";
|
|
2
|
+
import { FM_PERMISSIONS_SCHEMA } from "../../domain/permissionsSchema.js";
|
|
3
|
+
export declare const FmPermissions: import("@webiny/di").Abstraction<import("@webiny/api-core/features/security/permissions/types").PermissionsTyped<{
|
|
4
|
+
readonly prefix: "fm";
|
|
5
|
+
readonly fullAccess: true;
|
|
6
|
+
readonly entities: readonly [{
|
|
7
|
+
readonly id: "file";
|
|
8
|
+
readonly permission: "fm.file";
|
|
9
|
+
readonly scopes: readonly ["full", "own"];
|
|
10
|
+
readonly actions: readonly [{
|
|
11
|
+
readonly name: "rwd";
|
|
12
|
+
}];
|
|
13
|
+
}, {
|
|
14
|
+
readonly id: "settings";
|
|
15
|
+
readonly permission: "fm.settings";
|
|
16
|
+
readonly scopes: readonly ["full"];
|
|
17
|
+
}];
|
|
18
|
+
}>>;
|
|
19
|
+
export declare namespace FmPermissions {
|
|
20
|
+
type Interface = Permissions<typeof FM_PERMISSIONS_SCHEMA>;
|
|
21
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { createPermissionsAbstraction } from "@webiny/api-core/features/security/permissions/index.js";
|
|
2
|
+
import { FM_PERMISSIONS_SCHEMA } from "../../domain/permissionsSchema.js";
|
|
3
|
+
export const FmPermissions = createPermissionsAbstraction(FM_PERMISSIONS_SCHEMA);
|
|
4
|
+
|
|
5
|
+
//# sourceMappingURL=abstractions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createPermissionsAbstraction","FM_PERMISSIONS_SCHEMA","FmPermissions"],"sources":["abstractions.ts"],"sourcesContent":["import { createPermissionsAbstraction } from \"@webiny/api-core/features/security/permissions/index.js\";\nimport type { Permissions } from \"@webiny/api-core/features/security/permissions/index.js\";\nimport { FM_PERMISSIONS_SCHEMA } from \"~/domain/permissionsSchema.js\";\n\nexport const FmPermissions = createPermissionsAbstraction(FM_PERMISSIONS_SCHEMA);\n\nexport namespace FmPermissions {\n export type Interface = Permissions<typeof FM_PERMISSIONS_SCHEMA>;\n}\n"],"mappings":"AAAA,SAASA,4BAA4B,QAAQ,yDAAyD;AAEtG,SAASC,qBAAqB;AAE9B,OAAO,MAAMC,aAAa,GAAGF,4BAA4B,CAACC,qBAAqB,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { createPermissionsFeature } from "@webiny/api-core/exports/api/security.js";
|
|
2
|
+
import { FM_PERMISSIONS_SCHEMA } from "../../domain/permissionsSchema.js";
|
|
3
|
+
import { FmPermissions } from "./abstractions.js";
|
|
4
|
+
export const FmPermissionsFeature = createPermissionsFeature(FM_PERMISSIONS_SCHEMA, FmPermissions);
|
|
5
|
+
|
|
6
|
+
//# sourceMappingURL=feature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createPermissionsFeature","FM_PERMISSIONS_SCHEMA","FmPermissions","FmPermissionsFeature"],"sources":["feature.ts"],"sourcesContent":["import { createPermissionsFeature } from \"@webiny/api-core/exports/api/security.js\";\nimport { FM_PERMISSIONS_SCHEMA } from \"~/domain/permissionsSchema.js\";\nimport { FmPermissions } from \"./abstractions.js\";\n\nexport const FmPermissionsFeature = createPermissionsFeature(FM_PERMISSIONS_SCHEMA, FmPermissions);\n"],"mappings":"AAAA,SAASA,wBAAwB,QAAQ,0CAA0C;AACnF,SAASC,qBAAqB;AAC9B,SAASC,aAAa;AAEtB,OAAO,MAAMC,oBAAoB,GAAGH,wBAAwB,CAACC,qBAAqB,EAAEC,aAAa,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Result } from "@webiny/feature/api";
|
|
2
|
+
import { GetSettingsUseCase as UseCaseAbstraction } from "./abstractions.js";
|
|
3
|
+
import type { FileManagerSettings } from "../../../domain/settings/types.js";
|
|
4
|
+
import { KeyValueStore } from "@webiny/api-core/features/keyValueStore/index.js";
|
|
5
|
+
declare class GetSettingsUseCaseImpl implements UseCaseAbstraction.Interface {
|
|
6
|
+
private keyValueStore;
|
|
7
|
+
constructor(keyValueStore: KeyValueStore.Interface);
|
|
8
|
+
execute(): Promise<Result<FileManagerSettings, UseCaseAbstraction.Error>>;
|
|
9
|
+
}
|
|
10
|
+
export declare const GetSettingsUseCase: typeof GetSettingsUseCaseImpl & {
|
|
11
|
+
__abstraction: import("@webiny/di").Abstraction<import("./abstractions.js").IGetSettingsUseCase>;
|
|
12
|
+
};
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Result } from "@webiny/feature/api";
|
|
2
|
+
import { GetSettingsUseCase as UseCaseAbstraction } from "./abstractions.js";
|
|
3
|
+
import { FILE_MANAGER_GENERAL_SETTINGS } from "../../../domain/settings/constants.js";
|
|
4
|
+
import { KeyValueStore } from "@webiny/api-core/features/keyValueStore/index.js";
|
|
5
|
+
class GetSettingsUseCaseImpl {
|
|
6
|
+
constructor(keyValueStore) {
|
|
7
|
+
this.keyValueStore = keyValueStore;
|
|
8
|
+
}
|
|
9
|
+
async execute() {
|
|
10
|
+
const result = await this.keyValueStore.get(FILE_MANAGER_GENERAL_SETTINGS);
|
|
11
|
+
if (result.isFail()) {
|
|
12
|
+
// Return default values
|
|
13
|
+
return Result.ok({
|
|
14
|
+
uploadMinFileSize: 0,
|
|
15
|
+
uploadMaxFileSize: 10737418240,
|
|
16
|
+
srcPrefix: ""
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
const settings = result.value;
|
|
20
|
+
return Result.ok(settings);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
export const GetSettingsUseCase = UseCaseAbstraction.createImplementation({
|
|
24
|
+
implementation: GetSettingsUseCaseImpl,
|
|
25
|
+
dependencies: [KeyValueStore]
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
//# sourceMappingURL=GetSettingsUseCase.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Result","GetSettingsUseCase","UseCaseAbstraction","FILE_MANAGER_GENERAL_SETTINGS","KeyValueStore","GetSettingsUseCaseImpl","constructor","keyValueStore","execute","result","get","isFail","ok","uploadMinFileSize","uploadMaxFileSize","srcPrefix","settings","value","createImplementation","implementation","dependencies"],"sources":["GetSettingsUseCase.ts"],"sourcesContent":["import { Result } from \"@webiny/feature/api\";\nimport { GetSettingsUseCase as UseCaseAbstraction } from \"./abstractions.js\";\nimport type { FileManagerSettings } from \"~/domain/settings/types.js\";\nimport { FILE_MANAGER_GENERAL_SETTINGS } from \"~/domain/settings/constants.js\";\nimport { KeyValueStore } from \"@webiny/api-core/features/keyValueStore/index.js\";\n\nclass GetSettingsUseCaseImpl implements UseCaseAbstraction.Interface {\n constructor(private keyValueStore: KeyValueStore.Interface) {}\n\n async execute(): Promise<Result<FileManagerSettings, UseCaseAbstraction.Error>> {\n const result = await this.keyValueStore.get<FileManagerSettings>(\n FILE_MANAGER_GENERAL_SETTINGS\n );\n\n if (result.isFail()) {\n // Return default values\n return Result.ok({\n uploadMinFileSize: 0,\n uploadMaxFileSize: 10737418240,\n srcPrefix: \"\"\n });\n }\n\n const settings = result.value;\n\n return Result.ok(settings);\n }\n}\n\nexport const GetSettingsUseCase = UseCaseAbstraction.createImplementation({\n implementation: GetSettingsUseCaseImpl,\n dependencies: [KeyValueStore]\n});\n"],"mappings":"AAAA,SAASA,MAAM,QAAQ,qBAAqB;AAC5C,SAASC,kBAAkB,IAAIC,kBAAkB;AAEjD,SAASC,6BAA6B;AACtC,SAASC,aAAa,QAAQ,kDAAkD;AAEhF,MAAMC,sBAAsB,CAAyC;EACjEC,WAAWA,CAASC,aAAsC,EAAE;IAAA,KAAxCA,aAAsC,GAAtCA,aAAsC;EAAG;EAE7D,MAAMC,OAAOA,CAAA,EAAmE;IAC5E,MAAMC,MAAM,GAAG,MAAM,IAAI,CAACF,aAAa,CAACG,GAAG,CACvCP,6BACJ,CAAC;IAED,IAAIM,MAAM,CAACE,MAAM,CAAC,CAAC,EAAE;MACjB;MACA,OAAOX,MAAM,CAACY,EAAE,CAAC;QACbC,iBAAiB,EAAE,CAAC;QACpBC,iBAAiB,EAAE,WAAW;QAC9BC,SAAS,EAAE;MACf,CAAC,CAAC;IACN;IAEA,MAAMC,QAAQ,GAAGP,MAAM,CAACQ,KAAK;IAE7B,OAAOjB,MAAM,CAACY,EAAE,CAACI,QAAQ,CAAC;EAC9B;AACJ;AAEA,OAAO,MAAMf,kBAAkB,GAAGC,kBAAkB,CAACgB,oBAAoB,CAAC;EACtEC,cAAc,EAAEd,sBAAsB;EACtCe,YAAY,EAAE,CAAChB,aAAa;AAChC,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Result } from "@webiny/feature/api";
|
|
2
|
+
import type { FileManagerSettings } from "../../../domain/settings/types.js";
|
|
3
|
+
export interface IGetSettingsUseCaseErrors {
|
|
4
|
+
}
|
|
5
|
+
type UseCaseError = IGetSettingsUseCaseErrors[keyof IGetSettingsUseCaseErrors];
|
|
6
|
+
/**
|
|
7
|
+
* GetSettings use case - retrieves file manager settings.
|
|
8
|
+
*/
|
|
9
|
+
export interface IGetSettingsUseCase {
|
|
10
|
+
execute(): Promise<Result<FileManagerSettings, UseCaseError>>;
|
|
11
|
+
}
|
|
12
|
+
/** Retrieve file manager settings. */
|
|
13
|
+
export declare const GetSettingsUseCase: import("@webiny/di").Abstraction<IGetSettingsUseCase>;
|
|
14
|
+
export declare namespace GetSettingsUseCase {
|
|
15
|
+
type Interface = IGetSettingsUseCase;
|
|
16
|
+
type Error = UseCaseError;
|
|
17
|
+
}
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createAbstraction } from "@webiny/feature/api";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* GetSettings use case - retrieves file manager settings.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/** Retrieve file manager settings. */
|
|
8
|
+
export const GetSettingsUseCase = createAbstraction("GetSettingsUseCase");
|
|
9
|
+
|
|
10
|
+
//# sourceMappingURL=abstractions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createAbstraction","GetSettingsUseCase"],"sources":["abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { Result } from \"@webiny/feature/api\";\nimport type { FileManagerSettings } from \"~/domain/settings/types.js\";\n\nexport interface IGetSettingsUseCaseErrors {}\n\ntype UseCaseError = IGetSettingsUseCaseErrors[keyof IGetSettingsUseCaseErrors];\n\n/**\n * GetSettings use case - retrieves file manager settings.\n */\nexport interface IGetSettingsUseCase {\n execute(): Promise<Result<FileManagerSettings, UseCaseError>>;\n}\n\n/** Retrieve file manager settings. */\nexport const GetSettingsUseCase = createAbstraction<IGetSettingsUseCase>(\"GetSettingsUseCase\");\n\nexport namespace GetSettingsUseCase {\n export type Interface = IGetSettingsUseCase;\n export type Error = UseCaseError;\n}\n"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,qBAAqB;;AAQvD;AACA;AACA;;AAKA;AACA,OAAO,MAAMC,kBAAkB,GAAGD,iBAAiB,CAAsB,oBAAoB,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createFeature } from "@webiny/feature/api";
|
|
2
|
+
import { GetSettingsUseCase } from "./GetSettingsUseCase.js";
|
|
3
|
+
export const GetSettingsFeature = createFeature({
|
|
4
|
+
name: "FileManager/GetSettings",
|
|
5
|
+
register(container) {
|
|
6
|
+
container.register(GetSettingsUseCase);
|
|
7
|
+
}
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
//# sourceMappingURL=feature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createFeature","GetSettingsUseCase","GetSettingsFeature","name","register","container"],"sources":["feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { GetSettingsUseCase } from \"./GetSettingsUseCase.js\";\n\nexport const GetSettingsFeature = createFeature({\n name: \"FileManager/GetSettings\",\n register(container) {\n container.register(GetSettingsUseCase);\n }\n});\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ,qBAAqB;AACnD,SAASC,kBAAkB;AAE3B,OAAO,MAAMC,kBAAkB,GAAGF,aAAa,CAAC;EAC5CG,IAAI,EAAE,yBAAyB;EAC/BC,QAAQA,CAACC,SAAS,EAAE;IAChBA,SAAS,CAACD,QAAQ,CAACH,kBAAkB,CAAC;EAC1C;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { AppInstaller } from "@webiny/api-core/features/tenancy/InstallTenant/index.js";
|
|
2
|
+
import { UpdateSettingsUseCase } from "../../../features/settings/UpdateSettings/abstractions.js";
|
|
3
|
+
import { KeyValueStore } from "@webiny/api-core/features/keyValueStore/index.js";
|
|
4
|
+
declare class SettingsInstallerImpl implements AppInstaller.Interface {
|
|
5
|
+
private updateSettings;
|
|
6
|
+
private keyValueStore;
|
|
7
|
+
readonly alwaysRun = true;
|
|
8
|
+
readonly appName = "FileManager";
|
|
9
|
+
readonly dependsOn: never[];
|
|
10
|
+
constructor(updateSettings: UpdateSettingsUseCase.Interface, keyValueStore: KeyValueStore.Interface);
|
|
11
|
+
install(): Promise<void>;
|
|
12
|
+
uninstall(): Promise<void>;
|
|
13
|
+
}
|
|
14
|
+
export declare const SettingsInstaller: import("@webiny/di").Implementation<typeof SettingsInstallerImpl>;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { ServiceDiscovery } from "@webiny/api";
|
|
2
|
+
import { createImplementation } from "@webiny/feature/api";
|
|
3
|
+
import { AppInstaller } from "@webiny/api-core/features/tenancy/InstallTenant/index.js";
|
|
4
|
+
import { FILE_MANAGER_GENERAL_SETTINGS } from "../../../domain/settings/constants.js";
|
|
5
|
+
import { UpdateSettingsUseCase } from "../UpdateSettings/abstractions.js";
|
|
6
|
+
import { KeyValueStore } from "@webiny/api-core/features/keyValueStore/index.js";
|
|
7
|
+
class SettingsInstallerImpl {
|
|
8
|
+
alwaysRun = true;
|
|
9
|
+
appName = "FileManager";
|
|
10
|
+
dependsOn = [];
|
|
11
|
+
constructor(updateSettings, keyValueStore) {
|
|
12
|
+
this.updateSettings = updateSettings;
|
|
13
|
+
this.keyValueStore = keyValueStore;
|
|
14
|
+
}
|
|
15
|
+
async install() {
|
|
16
|
+
// TODO: move this to api-core with a proper abstraction
|
|
17
|
+
const manifest = await ServiceDiscovery.load();
|
|
18
|
+
const {
|
|
19
|
+
domain
|
|
20
|
+
} = manifest?.api.cloudfront;
|
|
21
|
+
await this.updateSettings.execute({
|
|
22
|
+
srcPrefix: `${domain}/files`
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
async uninstall() {
|
|
26
|
+
await this.keyValueStore.delete(FILE_MANAGER_GENERAL_SETTINGS);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
export const SettingsInstaller = createImplementation({
|
|
30
|
+
abstraction: AppInstaller,
|
|
31
|
+
implementation: SettingsInstallerImpl,
|
|
32
|
+
dependencies: [UpdateSettingsUseCase, KeyValueStore]
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
//# sourceMappingURL=SettingsInstaller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["ServiceDiscovery","createImplementation","AppInstaller","FILE_MANAGER_GENERAL_SETTINGS","UpdateSettingsUseCase","KeyValueStore","SettingsInstallerImpl","alwaysRun","appName","dependsOn","constructor","updateSettings","keyValueStore","install","manifest","load","domain","api","cloudfront","execute","srcPrefix","uninstall","delete","SettingsInstaller","abstraction","implementation","dependencies"],"sources":["SettingsInstaller.ts"],"sourcesContent":["import { ServiceDiscovery } from \"@webiny/api\";\nimport { createImplementation } from \"@webiny/feature/api\";\nimport { AppInstaller } from \"@webiny/api-core/features/tenancy/InstallTenant/index.js\";\nimport { FILE_MANAGER_GENERAL_SETTINGS } from \"~/domain/settings/constants.js\";\nimport { UpdateSettingsUseCase } from \"~/features/settings/UpdateSettings/abstractions.js\";\nimport { KeyValueStore } from \"@webiny/api-core/features/keyValueStore/index.js\";\n\nclass SettingsInstallerImpl implements AppInstaller.Interface {\n readonly alwaysRun = true;\n readonly appName = \"FileManager\";\n readonly dependsOn = [];\n\n constructor(\n private updateSettings: UpdateSettingsUseCase.Interface,\n private keyValueStore: KeyValueStore.Interface\n ) {}\n\n async install(): Promise<void> {\n // TODO: move this to api-core with a proper abstraction\n const manifest = await ServiceDiscovery.load();\n const { domain } = manifest?.api.cloudfront;\n\n await this.updateSettings.execute({\n srcPrefix: `${domain}/files`\n });\n }\n\n async uninstall(): Promise<void> {\n await this.keyValueStore.delete(FILE_MANAGER_GENERAL_SETTINGS);\n }\n}\n\nexport const SettingsInstaller = createImplementation({\n abstraction: AppInstaller,\n implementation: SettingsInstallerImpl,\n dependencies: [UpdateSettingsUseCase, KeyValueStore]\n});\n"],"mappings":"AAAA,SAASA,gBAAgB,QAAQ,aAAa;AAC9C,SAASC,oBAAoB,QAAQ,qBAAqB;AAC1D,SAASC,YAAY,QAAQ,0DAA0D;AACvF,SAASC,6BAA6B;AACtC,SAASC,qBAAqB;AAC9B,SAASC,aAAa,QAAQ,kDAAkD;AAEhF,MAAMC,qBAAqB,CAAmC;EACjDC,SAAS,GAAG,IAAI;EAChBC,OAAO,GAAG,aAAa;EACvBC,SAAS,GAAG,EAAE;EAEvBC,WAAWA,CACCC,cAA+C,EAC/CC,aAAsC,EAChD;IAAA,KAFUD,cAA+C,GAA/CA,cAA+C;IAAA,KAC/CC,aAAsC,GAAtCA,aAAsC;EAC/C;EAEH,MAAMC,OAAOA,CAAA,EAAkB;IAC3B;IACA,MAAMC,QAAQ,GAAG,MAAMd,gBAAgB,CAACe,IAAI,CAAC,CAAC;IAC9C,MAAM;MAAEC;IAAO,CAAC,GAAGF,QAAQ,EAAEG,GAAG,CAACC,UAAU;IAE3C,MAAM,IAAI,CAACP,cAAc,CAACQ,OAAO,CAAC;MAC9BC,SAAS,EAAE,GAAGJ,MAAM;IACxB,CAAC,CAAC;EACN;EAEA,MAAMK,SAASA,CAAA,EAAkB;IAC7B,MAAM,IAAI,CAACT,aAAa,CAACU,MAAM,CAACnB,6BAA6B,CAAC;EAClE;AACJ;AAEA,OAAO,MAAMoB,iBAAiB,GAAGtB,oBAAoB,CAAC;EAClDuB,WAAW,EAAEtB,YAAY;EACzBuB,cAAc,EAAEnB,qBAAqB;EACrCoB,YAAY,EAAE,CAACtB,qBAAqB,EAAEC,aAAa;AACvD,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createFeature } from "@webiny/feature/api";
|
|
2
|
+
import { SettingsInstaller } from "./SettingsInstaller.js";
|
|
3
|
+
export const SettingsInstallerFeature = createFeature({
|
|
4
|
+
name: "FileManager/SettingsInstaller",
|
|
5
|
+
register(container) {
|
|
6
|
+
container.register(SettingsInstaller);
|
|
7
|
+
}
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
//# sourceMappingURL=feature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createFeature","SettingsInstaller","SettingsInstallerFeature","name","register","container"],"sources":["feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { SettingsInstaller } from \"./SettingsInstaller.js\";\n\nexport const SettingsInstallerFeature = createFeature({\n name: \"FileManager/SettingsInstaller\",\n register(container) {\n container.register(SettingsInstaller);\n }\n});\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ,qBAAqB;AACnD,SAASC,iBAAiB;AAE1B,OAAO,MAAMC,wBAAwB,GAAGF,aAAa,CAAC;EAClDG,IAAI,EAAE,+BAA+B;EACrCC,QAAQA,CAACC,SAAS,EAAE;IAChBA,SAAS,CAACD,QAAQ,CAACH,iBAAiB,CAAC;EACzC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Result } from "@webiny/feature/api";
|
|
2
|
+
import { KeyValueStore } from "@webiny/api-core/features/keyValueStore/index.js";
|
|
3
|
+
import { UpdateSettingsUseCase as UseCaseAbstraction } from "./abstractions.js";
|
|
4
|
+
import { GetSettingsUseCase } from "../GetSettings/abstractions.js";
|
|
5
|
+
import type { FileManagerSettings } from "../../../domain/settings/types.js";
|
|
6
|
+
import type { UpdateSettingsInput } from "../../../domain/settings/types.js";
|
|
7
|
+
import { EventPublisher } from "@webiny/api-core/features/eventPublisher/index.js";
|
|
8
|
+
declare class UpdateSettingsUseCaseImpl implements UseCaseAbstraction.Interface {
|
|
9
|
+
private keyValueStore;
|
|
10
|
+
private getSettings;
|
|
11
|
+
private eventPublisher;
|
|
12
|
+
constructor(keyValueStore: KeyValueStore.Interface, getSettings: GetSettingsUseCase.Interface, eventPublisher: EventPublisher.Interface);
|
|
13
|
+
execute(input: UpdateSettingsInput): Promise<Result<FileManagerSettings, UseCaseAbstraction.Error>>;
|
|
14
|
+
}
|
|
15
|
+
export declare const UpdateSettingsUseCase: typeof UpdateSettingsUseCaseImpl & {
|
|
16
|
+
__abstraction: import("@webiny/di").Abstraction<import("./abstractions.js").IUpdateSettingsUseCase>;
|
|
17
|
+
};
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { Result } from "@webiny/feature/api";
|
|
2
|
+
import { KeyValueStore } from "@webiny/api-core/features/keyValueStore/index.js";
|
|
3
|
+
import { UpdateSettingsUseCase as UseCaseAbstraction } from "./abstractions.js";
|
|
4
|
+
import { GetSettingsUseCase } from "../GetSettings/abstractions.js";
|
|
5
|
+
import { SettingsUpdateError } from "../../../domain/settings/errors.js";
|
|
6
|
+
import { SettingsValidationError } from "../../../domain/settings/errors.js";
|
|
7
|
+
import { FILE_MANAGER_GENERAL_SETTINGS } from "../../../domain/settings/constants.js";
|
|
8
|
+
import { EventPublisher } from "@webiny/api-core/features/eventPublisher/index.js";
|
|
9
|
+
import { SettingsBeforeUpdateEvent, SettingsAfterUpdateEvent } from "./events.js";
|
|
10
|
+
import { updateSettingsValidation } from "../../../domain/settings/validation.js";
|
|
11
|
+
import { createZodError } from "@webiny/utils";
|
|
12
|
+
class UpdateSettingsUseCaseImpl {
|
|
13
|
+
constructor(keyValueStore, getSettings, eventPublisher) {
|
|
14
|
+
this.keyValueStore = keyValueStore;
|
|
15
|
+
this.getSettings = getSettings;
|
|
16
|
+
this.eventPublisher = eventPublisher;
|
|
17
|
+
}
|
|
18
|
+
async execute(input) {
|
|
19
|
+
// Validate input
|
|
20
|
+
const validationResult = await updateSettingsValidation.safeParseAsync(input);
|
|
21
|
+
if (!validationResult.success) {
|
|
22
|
+
const zodError = createZodError(validationResult.error);
|
|
23
|
+
return Result.fail(new SettingsValidationError(zodError.data.invalidFields));
|
|
24
|
+
}
|
|
25
|
+
const validatedInput = validationResult.data;
|
|
26
|
+
|
|
27
|
+
// Get existing settings to merge with new data
|
|
28
|
+
const existingResult = await this.getSettings.execute();
|
|
29
|
+
const existing = existingResult.value;
|
|
30
|
+
|
|
31
|
+
// Prepare merged settings
|
|
32
|
+
const updatedSettings = {
|
|
33
|
+
...existing,
|
|
34
|
+
...validatedInput
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
// Publish BeforeUpdate event
|
|
38
|
+
await this.eventPublisher.publish(new SettingsBeforeUpdateEvent({
|
|
39
|
+
original: existing,
|
|
40
|
+
settings: updatedSettings,
|
|
41
|
+
input: validatedInput
|
|
42
|
+
}));
|
|
43
|
+
const result = await this.keyValueStore.set(FILE_MANAGER_GENERAL_SETTINGS, updatedSettings);
|
|
44
|
+
if (result.isFail()) {
|
|
45
|
+
return Result.fail(new SettingsUpdateError(result.error));
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// Publish AfterUpdate event
|
|
49
|
+
await this.eventPublisher.publish(new SettingsAfterUpdateEvent({
|
|
50
|
+
original: existing,
|
|
51
|
+
settings: updatedSettings,
|
|
52
|
+
input: validatedInput
|
|
53
|
+
}));
|
|
54
|
+
return Result.ok(updatedSettings);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
export const UpdateSettingsUseCase = UseCaseAbstraction.createImplementation({
|
|
58
|
+
implementation: UpdateSettingsUseCaseImpl,
|
|
59
|
+
dependencies: [KeyValueStore, GetSettingsUseCase, EventPublisher]
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
//# sourceMappingURL=UpdateSettingsUseCase.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Result","KeyValueStore","UpdateSettingsUseCase","UseCaseAbstraction","GetSettingsUseCase","SettingsUpdateError","SettingsValidationError","FILE_MANAGER_GENERAL_SETTINGS","EventPublisher","SettingsBeforeUpdateEvent","SettingsAfterUpdateEvent","updateSettingsValidation","createZodError","UpdateSettingsUseCaseImpl","constructor","keyValueStore","getSettings","eventPublisher","execute","input","validationResult","safeParseAsync","success","zodError","error","fail","data","invalidFields","validatedInput","existingResult","existing","value","updatedSettings","publish","original","settings","result","set","isFail","ok","createImplementation","implementation","dependencies"],"sources":["UpdateSettingsUseCase.ts"],"sourcesContent":["import { Result } from \"@webiny/feature/api\";\nimport { KeyValueStore } from \"@webiny/api-core/features/keyValueStore/index.js\";\nimport { UpdateSettingsUseCase as UseCaseAbstraction } from \"./abstractions.js\";\nimport { GetSettingsUseCase } from \"../GetSettings/abstractions.js\";\nimport type { FileManagerSettings } from \"~/domain/settings/types.js\";\nimport type { UpdateSettingsInput } from \"~/domain/settings/types.js\";\nimport { SettingsUpdateError } from \"~/domain/settings/errors.js\";\nimport { SettingsValidationError } from \"~/domain/settings/errors.js\";\nimport { FILE_MANAGER_GENERAL_SETTINGS } from \"~/domain/settings/constants.js\";\nimport { EventPublisher } from \"@webiny/api-core/features/eventPublisher/index.js\";\nimport { SettingsBeforeUpdateEvent, SettingsAfterUpdateEvent } from \"./events.js\";\nimport { updateSettingsValidation } from \"~/domain/settings/validation.js\";\nimport { createZodError } from \"@webiny/utils\";\n\nclass UpdateSettingsUseCaseImpl implements UseCaseAbstraction.Interface {\n constructor(\n private keyValueStore: KeyValueStore.Interface,\n private getSettings: GetSettingsUseCase.Interface,\n private eventPublisher: EventPublisher.Interface\n ) {}\n\n async execute(\n input: UpdateSettingsInput\n ): Promise<Result<FileManagerSettings, UseCaseAbstraction.Error>> {\n // Validate input\n const validationResult = await updateSettingsValidation.safeParseAsync(input);\n if (!validationResult.success) {\n const zodError = createZodError(validationResult.error);\n return Result.fail(new SettingsValidationError(zodError.data!.invalidFields));\n }\n\n const validatedInput = validationResult.data;\n\n // Get existing settings to merge with new data\n const existingResult = await this.getSettings.execute();\n const existing = existingResult.value;\n\n // Prepare merged settings\n const updatedSettings: FileManagerSettings = {\n ...existing,\n ...validatedInput\n };\n\n // Publish BeforeUpdate event\n await this.eventPublisher.publish(\n new SettingsBeforeUpdateEvent({\n original: existing,\n settings: updatedSettings,\n input: validatedInput\n })\n );\n\n const result = await this.keyValueStore.set(FILE_MANAGER_GENERAL_SETTINGS, updatedSettings);\n\n if (result.isFail()) {\n return Result.fail(new SettingsUpdateError(result.error));\n }\n\n // Publish AfterUpdate event\n await this.eventPublisher.publish(\n new SettingsAfterUpdateEvent({\n original: existing,\n settings: updatedSettings,\n input: validatedInput\n })\n );\n\n return Result.ok(updatedSettings);\n }\n}\n\nexport const UpdateSettingsUseCase = UseCaseAbstraction.createImplementation({\n implementation: UpdateSettingsUseCaseImpl,\n dependencies: [KeyValueStore, GetSettingsUseCase, EventPublisher]\n});\n"],"mappings":"AAAA,SAASA,MAAM,QAAQ,qBAAqB;AAC5C,SAASC,aAAa,QAAQ,kDAAkD;AAChF,SAASC,qBAAqB,IAAIC,kBAAkB;AACpD,SAASC,kBAAkB;AAG3B,SAASC,mBAAmB;AAC5B,SAASC,uBAAuB;AAChC,SAASC,6BAA6B;AACtC,SAASC,cAAc,QAAQ,mDAAmD;AAClF,SAASC,yBAAyB,EAAEC,wBAAwB;AAC5D,SAASC,wBAAwB;AACjC,SAASC,cAAc,QAAQ,eAAe;AAE9C,MAAMC,yBAAyB,CAAyC;EACpEC,WAAWA,CACCC,aAAsC,EACtCC,WAAyC,EACzCC,cAAwC,EAClD;IAAA,KAHUF,aAAsC,GAAtCA,aAAsC;IAAA,KACtCC,WAAyC,GAAzCA,WAAyC;IAAA,KACzCC,cAAwC,GAAxCA,cAAwC;EACjD;EAEH,MAAMC,OAAOA,CACTC,KAA0B,EACoC;IAC9D;IACA,MAAMC,gBAAgB,GAAG,MAAMT,wBAAwB,CAACU,cAAc,CAACF,KAAK,CAAC;IAC7E,IAAI,CAACC,gBAAgB,CAACE,OAAO,EAAE;MAC3B,MAAMC,QAAQ,GAAGX,cAAc,CAACQ,gBAAgB,CAACI,KAAK,CAAC;MACvD,OAAOxB,MAAM,CAACyB,IAAI,CAAC,IAAInB,uBAAuB,CAACiB,QAAQ,CAACG,IAAI,CAAEC,aAAa,CAAC,CAAC;IACjF;IAEA,MAAMC,cAAc,GAAGR,gBAAgB,CAACM,IAAI;;IAE5C;IACA,MAAMG,cAAc,GAAG,MAAM,IAAI,CAACb,WAAW,CAACE,OAAO,CAAC,CAAC;IACvD,MAAMY,QAAQ,GAAGD,cAAc,CAACE,KAAK;;IAErC;IACA,MAAMC,eAAoC,GAAG;MACzC,GAAGF,QAAQ;MACX,GAAGF;IACP,CAAC;;IAED;IACA,MAAM,IAAI,CAACX,cAAc,CAACgB,OAAO,CAC7B,IAAIxB,yBAAyB,CAAC;MAC1ByB,QAAQ,EAAEJ,QAAQ;MAClBK,QAAQ,EAAEH,eAAe;MACzBb,KAAK,EAAES;IACX,CAAC,CACL,CAAC;IAED,MAAMQ,MAAM,GAAG,MAAM,IAAI,CAACrB,aAAa,CAACsB,GAAG,CAAC9B,6BAA6B,EAAEyB,eAAe,CAAC;IAE3F,IAAII,MAAM,CAACE,MAAM,CAAC,CAAC,EAAE;MACjB,OAAOtC,MAAM,CAACyB,IAAI,CAAC,IAAIpB,mBAAmB,CAAC+B,MAAM,CAACZ,KAAK,CAAC,CAAC;IAC7D;;IAEA;IACA,MAAM,IAAI,CAACP,cAAc,CAACgB,OAAO,CAC7B,IAAIvB,wBAAwB,CAAC;MACzBwB,QAAQ,EAAEJ,QAAQ;MAClBK,QAAQ,EAAEH,eAAe;MACzBb,KAAK,EAAES;IACX,CAAC,CACL,CAAC;IAED,OAAO5B,MAAM,CAACuC,EAAE,CAACP,eAAe,CAAC;EACrC;AACJ;AAEA,OAAO,MAAM9B,qBAAqB,GAAGC,kBAAkB,CAACqC,oBAAoB,CAAC;EACzEC,cAAc,EAAE5B,yBAAyB;EACzC6B,YAAY,EAAE,CAACzC,aAAa,EAAEG,kBAAkB,EAAEI,cAAc;AACpE,CAAC,CAAC","ignoreList":[]}
|