@webiny/api-file-manager 0.0.0-unstable.6f45466a1d → 0.0.0-unstable.7be00a75a9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/contants.js +2 -1
- package/contants.js.map +1 -1
- package/delivery/AssetDelivery/Asset.js +50 -56
- package/delivery/AssetDelivery/Asset.js.map +1 -1
- package/delivery/AssetDelivery/AssetRequest.js +20 -19
- package/delivery/AssetDelivery/AssetRequest.js.map +1 -1
- package/delivery/AssetDelivery/abstractions/AssetReply.js +28 -27
- package/delivery/AssetDelivery/abstractions/AssetReply.js.map +1 -1
- package/delivery/AssetDelivery/createAssetDeliveryPluginLoader.js +4 -5
- package/delivery/AssetDelivery/createAssetDeliveryPluginLoader.js.map +1 -1
- package/delivery/index.d.ts +3 -12
- package/delivery/index.js +2 -8
- package/delivery/setupAssetDelivery.d.ts +1 -2
- package/delivery/setupAssetDelivery.js +60 -105
- package/delivery/setupAssetDelivery.js.map +1 -1
- package/domain/file/abstractions.js +2 -5
- package/domain/file/abstractions.js.map +1 -1
- package/domain/file/errors.js +67 -76
- package/domain/file/errors.js.map +1 -1
- package/domain/file/file.model.js +57 -45
- package/domain/file/file.model.js.map +1 -1
- package/domain/file/types.d.ts +2 -0
- package/domain/file/types.js +0 -3
- package/domain/identity/Identity.js +9 -8
- package/domain/identity/Identity.js.map +1 -1
- package/domain/permissionsSchema.d.ts +16 -0
- package/domain/permissionsSchema.js +30 -0
- package/domain/permissionsSchema.js.map +1 -0
- package/domain/settings/constants.js +2 -1
- package/domain/settings/constants.js.map +1 -1
- package/domain/settings/errors.js +22 -24
- package/domain/settings/errors.js.map +1 -1
- package/domain/settings/types.js +0 -3
- package/domain/settings/validation.d.ts +4 -12
- package/domain/settings/validation.js +18 -27
- package/domain/settings/validation.js.map +1 -1
- package/exports/api/file-manager/file.d.ts +12 -0
- package/exports/api/file-manager/file.js +12 -0
- package/exports/api/file-manager/permissions.d.ts +1 -0
- package/exports/api/file-manager/permissions.js +1 -0
- package/exports/api/file-manager/settings.d.ts +3 -0
- package/exports/api/file-manager/settings.js +3 -0
- package/features/FileManagerFeature.d.ts +4 -1
- package/features/FileManagerFeature.js +17 -14
- package/features/FileManagerFeature.js.map +1 -1
- package/features/assetDelivery/FilesAssetRequestResolver.d.ts +9 -0
- package/features/assetDelivery/FilesAssetRequestResolver.js +29 -0
- package/features/assetDelivery/FilesAssetRequestResolver.js.map +1 -0
- package/features/assetDelivery/NullAssetOutputStrategy.d.ts +8 -0
- package/features/assetDelivery/NullAssetOutputStrategy.js +14 -0
- package/features/assetDelivery/NullAssetOutputStrategy.js.map +1 -0
- package/features/assetDelivery/NullAssetReply.js +14 -0
- package/features/assetDelivery/NullAssetReply.js.map +1 -0
- package/features/assetDelivery/NullAssetResolver.d.ts +8 -0
- package/features/assetDelivery/NullAssetResolver.js +13 -0
- package/features/assetDelivery/NullAssetResolver.js.map +1 -0
- package/features/assetDelivery/abstractions.d.ts +54 -0
- package/features/assetDelivery/abstractions.js +11 -0
- package/features/assetDelivery/abstractions.js.map +1 -0
- package/features/assetDelivery/feature.d.ts +4 -0
- package/features/assetDelivery/feature.js +29 -0
- package/features/assetDelivery/feature.js.map +1 -0
- package/features/assetDelivery/privateFiles/NotAuthorizedAssetReply.d.ts +4 -0
- package/features/assetDelivery/privateFiles/NotAuthorizedAssetReply.js +20 -0
- package/features/assetDelivery/privateFiles/NotAuthorizedAssetReply.js.map +1 -0
- package/features/assetDelivery/privateFiles/NotAuthorizedOutputStrategy.d.ts +5 -0
- package/features/assetDelivery/privateFiles/NotAuthorizedOutputStrategy.js +9 -0
- package/features/assetDelivery/privateFiles/NotAuthorizedOutputStrategy.js.map +1 -0
- package/features/assetDelivery/privateFiles/PrivateAuthenticatedAuthorizer.d.ts +11 -0
- package/features/assetDelivery/privateFiles/PrivateAuthenticatedAuthorizer.js +26 -0
- package/features/assetDelivery/privateFiles/PrivateAuthenticatedAuthorizer.js.map +1 -0
- package/features/assetDelivery/privateFiles/PrivateCache.d.ts +8 -0
- package/features/assetDelivery/privateFiles/PrivateCache.js +22 -0
- package/features/assetDelivery/privateFiles/PrivateCache.js.map +1 -0
- package/features/assetDelivery/privateFiles/PrivateFileAssetRequestResolver.d.ts +11 -0
- package/features/assetDelivery/privateFiles/PrivateFileAssetRequestResolver.js +31 -0
- package/features/assetDelivery/privateFiles/PrivateFileAssetRequestResolver.js.map +1 -0
- package/features/assetDelivery/privateFiles/PrivateFilesAssetProcessor.d.ts +19 -0
- package/features/assetDelivery/privateFiles/PrivateFilesAssetProcessor.js +65 -0
- package/features/assetDelivery/privateFiles/PrivateFilesAssetProcessor.js.map +1 -0
- package/features/assetDelivery/privateFiles/PublicCache.d.ts +8 -0
- package/features/assetDelivery/privateFiles/PublicCache.js +22 -0
- package/features/assetDelivery/privateFiles/PublicCache.js.map +1 -0
- package/features/assetDelivery/privateFiles/RedirectToPrivateUrlOutputStrategy.d.ts +9 -0
- package/features/assetDelivery/privateFiles/RedirectToPrivateUrlOutputStrategy.js +21 -0
- package/features/assetDelivery/privateFiles/RedirectToPrivateUrlOutputStrategy.js.map +1 -0
- package/features/assetDelivery/privateFiles/RedirectToPublicUrlOutputStrategy.d.ts +9 -0
- package/features/assetDelivery/privateFiles/RedirectToPublicUrlOutputStrategy.js +21 -0
- package/features/assetDelivery/privateFiles/RedirectToPublicUrlOutputStrategy.js.map +1 -0
- package/features/assetDelivery/transformation/PassthroughAssetTransformationStrategy.d.ts +9 -0
- package/features/assetDelivery/transformation/PassthroughAssetTransformationStrategy.js +13 -0
- package/features/assetDelivery/transformation/PassthroughAssetTransformationStrategy.js.map +1 -0
- package/features/assetDelivery/transformation/TransformationAssetProcessor.d.ts +11 -0
- package/features/assetDelivery/transformation/TransformationAssetProcessor.js +23 -0
- package/features/assetDelivery/transformation/TransformationAssetProcessor.js.map +1 -0
- package/features/file/CreateFile/CreateFileRepository.js +20 -18
- package/features/file/CreateFile/CreateFileRepository.js.map +1 -1
- package/features/file/CreateFile/CreateFileUseCase.d.ts +4 -4
- package/features/file/CreateFile/CreateFileUseCase.js +70 -78
- package/features/file/CreateFile/CreateFileUseCase.js.map +1 -1
- package/features/file/CreateFile/abstractions.d.ts +3 -0
- package/features/file/CreateFile/abstractions.js +3 -12
- package/features/file/CreateFile/abstractions.js.map +1 -1
- package/features/file/CreateFile/events.d.ts +8 -6
- package/features/file/CreateFile/events.js +18 -23
- package/features/file/CreateFile/events.js.map +1 -1
- package/features/file/CreateFile/feature.d.ts +4 -1
- package/features/file/CreateFile/feature.js +7 -6
- package/features/file/CreateFile/feature.js.map +1 -1
- package/features/file/CreateFile/index.d.ts +1 -1
- package/features/file/CreateFile/index.js +1 -3
- package/features/file/CreateFilesInBatch/CreateFilesInBatchRepository.js +15 -17
- package/features/file/CreateFilesInBatch/CreateFilesInBatchRepository.js.map +1 -1
- package/features/file/CreateFilesInBatch/CreateFilesInBatchUseCase.d.ts +4 -4
- package/features/file/CreateFilesInBatch/CreateFilesInBatchUseCase.js +61 -75
- package/features/file/CreateFilesInBatch/CreateFilesInBatchUseCase.js.map +1 -1
- package/features/file/CreateFilesInBatch/abstractions.d.ts +2 -0
- package/features/file/CreateFilesInBatch/abstractions.js +3 -12
- package/features/file/CreateFilesInBatch/abstractions.js.map +1 -1
- package/features/file/CreateFilesInBatch/events.d.ts +8 -6
- package/features/file/CreateFilesInBatch/events.js +18 -23
- package/features/file/CreateFilesInBatch/events.js.map +1 -1
- package/features/file/CreateFilesInBatch/feature.d.ts +4 -1
- package/features/file/CreateFilesInBatch/feature.js +7 -6
- package/features/file/CreateFilesInBatch/feature.js.map +1 -1
- package/features/file/CreateFilesInBatch/index.js +0 -2
- package/features/file/DeleteFile/DeleteFileRepository.js +21 -20
- package/features/file/DeleteFile/DeleteFileRepository.js.map +1 -1
- package/features/file/DeleteFile/DeleteFileUseCase.d.ts +4 -4
- package/features/file/DeleteFile/DeleteFileUseCase.js +33 -38
- package/features/file/DeleteFile/DeleteFileUseCase.js.map +1 -1
- package/features/file/DeleteFile/abstractions.d.ts +2 -0
- package/features/file/DeleteFile/abstractions.js +3 -12
- package/features/file/DeleteFile/abstractions.js.map +1 -1
- package/features/file/DeleteFile/events.d.ts +8 -6
- package/features/file/DeleteFile/events.js +18 -23
- package/features/file/DeleteFile/events.js.map +1 -1
- package/features/file/DeleteFile/feature.d.ts +4 -1
- package/features/file/DeleteFile/feature.js +7 -6
- package/features/file/DeleteFile/feature.js.map +1 -1
- package/features/file/DeleteFile/index.d.ts +1 -1
- package/features/file/DeleteFile/index.js +1 -3
- package/features/file/FileUrlGenerator/abstractions.d.ts +1 -0
- package/features/file/FileUrlGenerator/abstractions.js +2 -1
- package/features/file/FileUrlGenerator/abstractions.js.map +1 -1
- package/features/file/GetFile/GetFileRepository.js +22 -22
- package/features/file/GetFile/GetFileRepository.js.map +1 -1
- package/features/file/GetFile/GetFileUseCase.d.ts +3 -3
- package/features/file/GetFile/GetFileUseCase.js +20 -30
- package/features/file/GetFile/GetFileUseCase.js.map +1 -1
- package/features/file/GetFile/abstractions.d.ts +2 -0
- package/features/file/GetFile/abstractions.js +3 -12
- package/features/file/GetFile/abstractions.js.map +1 -1
- package/features/file/GetFile/feature.d.ts +4 -1
- package/features/file/GetFile/feature.js +7 -6
- package/features/file/GetFile/feature.js.map +1 -1
- package/features/file/GetFile/index.js +0 -2
- package/features/file/GetFileContentsById/abstractions.d.ts +20 -0
- package/features/file/GetFileContentsById/abstractions.js +5 -0
- package/features/file/GetFileContentsById/abstractions.js.map +1 -0
- package/features/file/GetFileContentsById/index.d.ts +1 -0
- package/features/file/GetFileContentsById/index.js +1 -0
- package/features/file/GetFileContentsByKey/abstractions.d.ts +17 -0
- package/features/file/GetFileContentsByKey/abstractions.js +5 -0
- package/features/file/GetFileContentsByKey/abstractions.js.map +1 -0
- package/features/file/GetFileContentsByKey/index.d.ts +1 -0
- package/features/file/GetFileContentsByKey/index.js +1 -0
- package/features/file/ListFiles/ListFilesRepository.d.ts +3 -1
- package/features/file/ListFiles/ListFilesRepository.js +42 -34
- package/features/file/ListFiles/ListFilesRepository.js.map +1 -1
- package/features/file/ListFiles/ListFilesUseCase.d.ts +4 -4
- package/features/file/ListFiles/ListFilesUseCase.js +35 -39
- package/features/file/ListFiles/ListFilesUseCase.js.map +1 -1
- package/features/file/ListFiles/abstractions.d.ts +2 -0
- package/features/file/ListFiles/abstractions.js +3 -12
- package/features/file/ListFiles/abstractions.js.map +1 -1
- package/features/file/ListFiles/feature.d.ts +4 -1
- package/features/file/ListFiles/feature.js +7 -6
- package/features/file/ListFiles/feature.js.map +1 -1
- package/features/file/ListFiles/index.js +0 -2
- package/features/file/ListImagesByTagTool/ListImagesByTagTool.d.ts +27 -0
- package/features/file/ListImagesByTagTool/ListImagesByTagTool.js +42 -0
- package/features/file/ListImagesByTagTool/ListImagesByTagTool.js.map +1 -0
- package/features/file/ListImagesByTagTool/feature.d.ts +4 -0
- package/features/file/ListImagesByTagTool/feature.js +11 -0
- package/features/file/ListImagesByTagTool/feature.js.map +1 -0
- package/features/file/ListTags/ListTagsRepository.js +31 -36
- package/features/file/ListTags/ListTagsRepository.js.map +1 -1
- package/features/file/ListTags/ListTagsUseCase.d.ts +3 -3
- package/features/file/ListTags/ListTagsUseCase.js +22 -23
- package/features/file/ListTags/ListTagsUseCase.js.map +1 -1
- package/features/file/ListTags/abstractions.d.ts +2 -0
- package/features/file/ListTags/abstractions.js +3 -12
- package/features/file/ListTags/abstractions.js.map +1 -1
- package/features/file/ListTags/feature.d.ts +4 -1
- package/features/file/ListTags/feature.js +7 -6
- package/features/file/ListTags/feature.js.map +1 -1
- package/features/file/ListTags/index.js +0 -2
- package/features/file/UpdateFile/UpdateFileRepository.js +26 -28
- package/features/file/UpdateFile/UpdateFileRepository.js.map +1 -1
- package/features/file/UpdateFile/UpdateFileUseCase.d.ts +5 -5
- package/features/file/UpdateFile/UpdateFileUseCase.js +60 -70
- package/features/file/UpdateFile/UpdateFileUseCase.js.map +1 -1
- package/features/file/UpdateFile/abstractions.d.ts +3 -0
- package/features/file/UpdateFile/abstractions.js +3 -12
- package/features/file/UpdateFile/abstractions.js.map +1 -1
- package/features/file/UpdateFile/events.d.ts +8 -6
- package/features/file/UpdateFile/events.js +18 -23
- package/features/file/UpdateFile/events.js.map +1 -1
- package/features/file/UpdateFile/feature.d.ts +4 -1
- package/features/file/UpdateFile/feature.js +7 -6
- package/features/file/UpdateFile/feature.js.map +1 -1
- package/features/file/UpdateFile/index.d.ts +1 -1
- package/features/file/UpdateFile/index.js +1 -3
- package/features/file/shared/EntryToFileMapper.js +25 -23
- package/features/file/shared/EntryToFileMapper.js.map +1 -1
- package/features/file/shared/FileInputToEntryInputMapper.js +29 -27
- package/features/file/shared/FileInputToEntryInputMapper.js.map +1 -1
- package/features/file/shared/FileToEntryMapper.js +28 -26
- package/features/file/shared/FileToEntryMapper.js.map +1 -1
- package/features/permissions/abstractions.d.ts +21 -0
- package/features/permissions/abstractions.js +6 -0
- package/features/permissions/abstractions.js.map +1 -0
- package/features/permissions/feature.d.ts +4 -0
- package/features/permissions/feature.js +7 -0
- package/features/permissions/feature.js.map +1 -0
- package/features/settings/GetSettings/GetSettingsUseCase.js +19 -19
- package/features/settings/GetSettings/GetSettingsUseCase.js.map +1 -1
- package/features/settings/GetSettings/abstractions.d.ts +1 -0
- package/features/settings/GetSettings/abstractions.js +2 -6
- package/features/settings/GetSettings/abstractions.js.map +1 -1
- package/features/settings/GetSettings/feature.d.ts +4 -1
- package/features/settings/GetSettings/feature.js +6 -5
- package/features/settings/GetSettings/feature.js.map +1 -1
- package/features/settings/SettingsInstaller/SettingsInstaller.d.ts +1 -1
- package/features/settings/SettingsInstaller/SettingsInstaller.js +26 -25
- package/features/settings/SettingsInstaller/SettingsInstaller.js.map +1 -1
- package/features/settings/SettingsInstaller/feature.d.ts +4 -1
- package/features/settings/SettingsInstaller/feature.js +6 -5
- package/features/settings/SettingsInstaller/feature.js.map +1 -1
- package/features/settings/UpdateSettings/UpdateSettingsUseCase.d.ts +1 -1
- package/features/settings/UpdateSettings/UpdateSettingsUseCase.js +42 -49
- package/features/settings/UpdateSettings/UpdateSettingsUseCase.js.map +1 -1
- package/features/settings/UpdateSettings/abstractions.d.ts +1 -0
- package/features/settings/UpdateSettings/abstractions.js +2 -6
- package/features/settings/UpdateSettings/abstractions.js.map +1 -1
- package/features/settings/UpdateSettings/events.d.ts +8 -6
- package/features/settings/UpdateSettings/events.js +18 -23
- package/features/settings/UpdateSettings/events.js.map +1 -1
- package/features/settings/UpdateSettings/feature.d.ts +4 -1
- package/features/settings/UpdateSettings/feature.js +6 -5
- package/features/settings/UpdateSettings/feature.js.map +1 -1
- package/features/settings/UpdateSettings/index.d.ts +1 -1
- package/features/settings/UpdateSettings/index.js +1 -3
- package/features/shared/abstractions.d.ts +1 -13
- package/features/shared/abstractions.js +1 -5
- package/graphql/baseSchema.js +30 -33
- package/graphql/baseSchema.js.map +1 -1
- package/graphql/createFilesTypeDefs.d.ts +3 -2
- package/graphql/createFilesTypeDefs.js +61 -66
- package/graphql/createFilesTypeDefs.js.map +1 -1
- package/graphql/filesSchema.js +79 -99
- package/graphql/filesSchema.js.map +1 -1
- package/graphql/getFileByUrl.js +45 -53
- package/graphql/getFileByUrl.js.map +1 -1
- package/graphql/index.js +37 -43
- package/graphql/index.js.map +1 -1
- package/graphql/utils.js +9 -14
- package/graphql/utils.js.map +1 -1
- package/index.d.ts +2 -2
- package/index.js +31 -39
- package/index.js.map +1 -1
- package/modelModifier/CmsModelModifier.js +40 -43
- package/modelModifier/CmsModelModifier.js.map +1 -1
- package/package.json +28 -23
- package/types.d.ts +1 -3
- package/types.js +1 -3
- package/delivery/AssetDelivery/AssetDeliveryConfig.d.ts +0 -65
- package/delivery/AssetDelivery/AssetDeliveryConfig.js +0 -94
- package/delivery/AssetDelivery/AssetDeliveryConfig.js.map +0 -1
- package/delivery/AssetDelivery/FilesAssetRequestResolver.d.ts +0 -6
- package/delivery/AssetDelivery/FilesAssetRequestResolver.js +0 -30
- package/delivery/AssetDelivery/FilesAssetRequestResolver.js.map +0 -1
- package/delivery/AssetDelivery/NullAssetOutputStrategy.d.ts +0 -4
- package/delivery/AssetDelivery/NullAssetOutputStrategy.js +0 -8
- package/delivery/AssetDelivery/NullAssetOutputStrategy.js.map +0 -1
- package/delivery/AssetDelivery/NullAssetReply.js +0 -13
- package/delivery/AssetDelivery/NullAssetReply.js.map +0 -1
- package/delivery/AssetDelivery/NullAssetResolver.d.ts +0 -5
- package/delivery/AssetDelivery/NullAssetResolver.js +0 -7
- package/delivery/AssetDelivery/NullAssetResolver.js.map +0 -1
- package/delivery/AssetDelivery/NullRequestResolver.d.ts +0 -4
- package/delivery/AssetDelivery/NullRequestResolver.js +0 -7
- package/delivery/AssetDelivery/NullRequestResolver.js.map +0 -1
- package/delivery/AssetDelivery/SetCacheControlHeaders.d.ts +0 -8
- package/delivery/AssetDelivery/SetCacheControlHeaders.js +0 -18
- package/delivery/AssetDelivery/SetCacheControlHeaders.js.map +0 -1
- package/delivery/AssetDelivery/SetResponseHeaders.d.ts +0 -18
- package/delivery/AssetDelivery/SetResponseHeaders.js +0 -18
- package/delivery/AssetDelivery/SetResponseHeaders.js.map +0 -1
- package/delivery/AssetDelivery/abstractions/AssetContentsReader.d.ts +0 -4
- package/delivery/AssetDelivery/abstractions/AssetContentsReader.js +0 -3
- package/delivery/AssetDelivery/abstractions/AssetContentsReader.js.map +0 -1
- package/delivery/AssetDelivery/abstractions/AssetOutputStrategy.d.ts +0 -4
- package/delivery/AssetDelivery/abstractions/AssetOutputStrategy.js +0 -3
- package/delivery/AssetDelivery/abstractions/AssetOutputStrategy.js.map +0 -1
- package/delivery/AssetDelivery/abstractions/AssetProcessor.d.ts +0 -4
- package/delivery/AssetDelivery/abstractions/AssetProcessor.js +0 -3
- package/delivery/AssetDelivery/abstractions/AssetProcessor.js.map +0 -1
- package/delivery/AssetDelivery/abstractions/AssetRequestResolver.d.ts +0 -5
- package/delivery/AssetDelivery/abstractions/AssetRequestResolver.js +0 -3
- package/delivery/AssetDelivery/abstractions/AssetRequestResolver.js.map +0 -1
- package/delivery/AssetDelivery/abstractions/AssetResolver.d.ts +0 -4
- package/delivery/AssetDelivery/abstractions/AssetResolver.js +0 -3
- package/delivery/AssetDelivery/abstractions/AssetResolver.js.map +0 -1
- package/delivery/AssetDelivery/abstractions/AssetTransformationStrategy.d.ts +0 -4
- package/delivery/AssetDelivery/abstractions/AssetTransformationStrategy.js +0 -3
- package/delivery/AssetDelivery/abstractions/AssetTransformationStrategy.js.map +0 -1
- package/delivery/AssetDelivery/privateFiles/AssetAuthorizer.d.ts +0 -4
- package/delivery/AssetDelivery/privateFiles/AssetAuthorizer.js +0 -3
- package/delivery/AssetDelivery/privateFiles/AssetAuthorizer.js.map +0 -1
- package/delivery/AssetDelivery/privateFiles/NotAuthorizedAssetReply.d.ts +0 -4
- package/delivery/AssetDelivery/privateFiles/NotAuthorizedAssetReply.js +0 -19
- package/delivery/AssetDelivery/privateFiles/NotAuthorizedAssetReply.js.map +0 -1
- package/delivery/AssetDelivery/privateFiles/NotAuthorizedOutputStrategy.d.ts +0 -4
- package/delivery/AssetDelivery/privateFiles/NotAuthorizedOutputStrategy.js +0 -8
- package/delivery/AssetDelivery/privateFiles/NotAuthorizedOutputStrategy.js.map +0 -1
- package/delivery/AssetDelivery/privateFiles/PrivateAuthenticatedAuthorizer.d.ts +0 -8
- package/delivery/AssetDelivery/privateFiles/PrivateAuthenticatedAuthorizer.js +0 -20
- package/delivery/AssetDelivery/privateFiles/PrivateAuthenticatedAuthorizer.js.map +0 -1
- package/delivery/AssetDelivery/privateFiles/PrivateCache.d.ts +0 -6
- package/delivery/AssetDelivery/privateFiles/PrivateCache.js +0 -21
- package/delivery/AssetDelivery/privateFiles/PrivateCache.js.map +0 -1
- package/delivery/AssetDelivery/privateFiles/PrivateFileAssetRequestResolver.d.ts +0 -8
- package/delivery/AssetDelivery/privateFiles/PrivateFileAssetRequestResolver.js +0 -30
- package/delivery/AssetDelivery/privateFiles/PrivateFileAssetRequestResolver.js.map +0 -1
- package/delivery/AssetDelivery/privateFiles/PrivateFilesAssetProcessor.d.ts +0 -13
- package/delivery/AssetDelivery/privateFiles/PrivateFilesAssetProcessor.js +0 -63
- package/delivery/AssetDelivery/privateFiles/PrivateFilesAssetProcessor.js.map +0 -1
- package/delivery/AssetDelivery/privateFiles/PublicCache.d.ts +0 -6
- package/delivery/AssetDelivery/privateFiles/PublicCache.js +0 -21
- package/delivery/AssetDelivery/privateFiles/PublicCache.js.map +0 -1
- package/delivery/AssetDelivery/privateFiles/RedirectToPrivateUrlOutputStrategy.d.ts +0 -7
- package/delivery/AssetDelivery/privateFiles/RedirectToPrivateUrlOutputStrategy.js +0 -20
- package/delivery/AssetDelivery/privateFiles/RedirectToPrivateUrlOutputStrategy.js.map +0 -1
- package/delivery/AssetDelivery/privateFiles/RedirectToPublicUrlOutputStrategy.d.ts +0 -7
- package/delivery/AssetDelivery/privateFiles/RedirectToPublicUrlOutputStrategy.js +0 -20
- package/delivery/AssetDelivery/privateFiles/RedirectToPublicUrlOutputStrategy.js.map +0 -1
- package/delivery/AssetDelivery/transformation/PassthroughAssetProcessor.d.ts +0 -4
- package/delivery/AssetDelivery/transformation/PassthroughAssetProcessor.js +0 -7
- package/delivery/AssetDelivery/transformation/PassthroughAssetProcessor.js.map +0 -1
- package/delivery/AssetDelivery/transformation/PassthroughAssetTransformationStrategy.d.ts +0 -4
- package/delivery/AssetDelivery/transformation/PassthroughAssetTransformationStrategy.js +0 -7
- package/delivery/AssetDelivery/transformation/PassthroughAssetTransformationStrategy.js.map +0 -1
- package/delivery/AssetDelivery/transformation/TransformationAssetProcessor.d.ts +0 -6
- package/delivery/AssetDelivery/transformation/TransformationAssetProcessor.js +0 -19
- package/delivery/AssetDelivery/transformation/TransformationAssetProcessor.js.map +0 -1
- package/delivery/index.js.map +0 -1
- package/domain/file/types.js.map +0 -1
- package/domain/settings/types.js.map +0 -1
- package/features/file/CreateFile/index.js.map +0 -1
- package/features/file/CreateFilesInBatch/index.js.map +0 -1
- package/features/file/DeleteFile/index.js.map +0 -1
- package/features/file/GetFile/index.js.map +0 -1
- package/features/file/ListFiles/index.js.map +0 -1
- package/features/file/ListTags/index.js.map +0 -1
- package/features/file/UpdateFile/index.js.map +0 -1
- package/features/settings/UpdateSettings/index.js.map +0 -1
- package/features/shared/abstractions.js.map +0 -1
- package/permissions/FilesPermissions.d.ts +0 -4
- package/permissions/FilesPermissions.js +0 -4
- package/permissions/FilesPermissions.js.map +0 -1
- package/permissions/SettingsPermissions.d.ts +0 -4
- package/permissions/SettingsPermissions.js +0 -4
- package/permissions/SettingsPermissions.js.map +0 -1
- package/types.js.map +0 -1
- /package/{delivery/AssetDelivery → features/assetDelivery}/NullAssetReply.d.ts +0 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { type IAiSdkTool } from "@webiny/api-core/features/ai/index.js";
|
|
3
|
+
import { ListFilesUseCase } from "../../../features/file/ListFiles/index.js";
|
|
4
|
+
declare const inputSchema: z.ZodObject<{
|
|
5
|
+
tag: z.ZodString;
|
|
6
|
+
}, z.core.$strip>;
|
|
7
|
+
type Input = z.infer<typeof inputSchema>;
|
|
8
|
+
interface ImageItem {
|
|
9
|
+
id: string;
|
|
10
|
+
name: string;
|
|
11
|
+
type: string;
|
|
12
|
+
tags: string[];
|
|
13
|
+
}
|
|
14
|
+
declare class ListImagesByTagToolImpl implements IAiSdkTool<Input> {
|
|
15
|
+
private listFiles;
|
|
16
|
+
readonly name = "listImagesByTag";
|
|
17
|
+
readonly description = "Lists images from the file manager filtered by a given tag. Returns name, type, and tags for each image.";
|
|
18
|
+
readonly inputSchema: z.ZodObject<{
|
|
19
|
+
tag: z.ZodString;
|
|
20
|
+
}, z.core.$strip>;
|
|
21
|
+
constructor(listFiles: ListFilesUseCase.Interface);
|
|
22
|
+
execute(input: Input): Promise<ImageItem[]>;
|
|
23
|
+
}
|
|
24
|
+
export declare const ListImagesByTagTool: typeof ListImagesByTagToolImpl & {
|
|
25
|
+
__abstraction: import("@webiny/di").Abstraction<IAiSdkTool<any>>;
|
|
26
|
+
};
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { AiSdkTool } from "@webiny/api-core/features/ai/index.js";
|
|
3
|
+
import { ListFilesUseCase } from "../ListFiles/index.js";
|
|
4
|
+
const inputSchema = z.object({
|
|
5
|
+
tag: z.string().describe("Tag to filter images by")
|
|
6
|
+
});
|
|
7
|
+
class ListImagesByTagToolImpl {
|
|
8
|
+
constructor(listFiles){
|
|
9
|
+
this.listFiles = listFiles;
|
|
10
|
+
this.name = "listImagesByTag";
|
|
11
|
+
this.description = "Lists images from the file manager filtered by a given tag. Returns name, type, and tags for each image.";
|
|
12
|
+
this.inputSchema = inputSchema;
|
|
13
|
+
}
|
|
14
|
+
async execute(input) {
|
|
15
|
+
console.log("Call images tool", input);
|
|
16
|
+
const result = await this.listFiles.execute({
|
|
17
|
+
where: {
|
|
18
|
+
type_startsWith: "image/",
|
|
19
|
+
tags_in: [
|
|
20
|
+
input.tag
|
|
21
|
+
]
|
|
22
|
+
},
|
|
23
|
+
limit: 50
|
|
24
|
+
});
|
|
25
|
+
if (result.isFail()) return [];
|
|
26
|
+
return result.value.items.map((file)=>({
|
|
27
|
+
id: file.id,
|
|
28
|
+
name: file.name,
|
|
29
|
+
type: file.type,
|
|
30
|
+
tags: file.tags
|
|
31
|
+
}));
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
const ListImagesByTagTool = AiSdkTool.createImplementation({
|
|
35
|
+
implementation: ListImagesByTagToolImpl,
|
|
36
|
+
dependencies: [
|
|
37
|
+
ListFilesUseCase
|
|
38
|
+
]
|
|
39
|
+
});
|
|
40
|
+
export { ListImagesByTagTool };
|
|
41
|
+
|
|
42
|
+
//# sourceMappingURL=ListImagesByTagTool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/file/ListImagesByTagTool/ListImagesByTagTool.js","sources":["../../../../src/features/file/ListImagesByTagTool/ListImagesByTagTool.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { AiSdkTool, type IAiSdkTool } from \"@webiny/api-core/features/ai/index.js\";\nimport { ListFilesUseCase } from \"~/features/file/ListFiles/index.js\";\n\nconst inputSchema = z.object({\n tag: z.string().describe(\"Tag to filter images by\")\n});\n\ntype Input = z.infer<typeof inputSchema>;\n\ninterface ImageItem {\n id: string;\n name: string;\n type: string;\n tags: string[];\n}\n\nclass ListImagesByTagToolImpl implements IAiSdkTool<Input> {\n readonly name = \"listImagesByTag\";\n readonly description =\n \"Lists images from the file manager filtered by a given tag. Returns name, type, and tags for each image.\";\n readonly inputSchema = inputSchema;\n\n constructor(private listFiles: ListFilesUseCase.Interface) {}\n\n async execute(input: Input): Promise<ImageItem[]> {\n console.log(\"Call images tool\", input);\n const result = await this.listFiles.execute({\n where: {\n type_startsWith: \"image/\",\n tags_in: [input.tag]\n },\n limit: 50\n });\n\n if (result.isFail()) {\n return [];\n }\n\n return result.value.items.map(file => ({\n id: file.id,\n name: file.name,\n type: file.type,\n tags: file.tags\n }));\n }\n}\n\nexport const ListImagesByTagTool = AiSdkTool.createImplementation({\n implementation: ListImagesByTagToolImpl,\n dependencies: [ListFilesUseCase]\n});\n"],"names":["inputSchema","z","ListImagesByTagToolImpl","listFiles","input","console","result","file","ListImagesByTagTool","AiSdkTool","ListFilesUseCase"],"mappings":";;;AAIA,MAAMA,cAAcC,EAAE,MAAM,CAAC;IACzB,KAAKA,EAAE,MAAM,GAAG,QAAQ,CAAC;AAC7B;AAWA,MAAMC;IAMF,YAAoBC,SAAqC,CAAE;aAAvCA,SAAS,GAATA;aALX,IAAI,GAAG;aACP,WAAW,GAChB;aACK,WAAW,GAAGH;IAEqC;IAE5D,MAAM,QAAQI,KAAY,EAAwB;QAC9CC,QAAQ,GAAG,CAAC,oBAAoBD;QAChC,MAAME,SAAS,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC;YACxC,OAAO;gBACH,iBAAiB;gBACjB,SAAS;oBAACF,MAAM,GAAG;iBAAC;YACxB;YACA,OAAO;QACX;QAEA,IAAIE,OAAO,MAAM,IACb,OAAO,EAAE;QAGb,OAAOA,OAAO,KAAK,CAAC,KAAK,CAAC,GAAG,CAACC,CAAAA,OAAS;gBACnC,IAAIA,KAAK,EAAE;gBACX,MAAMA,KAAK,IAAI;gBACf,MAAMA,KAAK,IAAI;gBACf,MAAMA,KAAK,IAAI;YACnB;IACJ;AACJ;AAEO,MAAMC,sBAAsBC,UAAU,oBAAoB,CAAC;IAC9D,gBAAgBP;IAChB,cAAc;QAACQ;KAAiB;AACpC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createFeature } from "@webiny/feature/api";
|
|
2
|
+
import { ListImagesByTagTool } from "./ListImagesByTagTool.js";
|
|
3
|
+
const ListImagesByTagToolFeature = createFeature({
|
|
4
|
+
name: "AiPowerUps/ListImagesByTagTool",
|
|
5
|
+
register (container) {
|
|
6
|
+
container.register(ListImagesByTagTool);
|
|
7
|
+
}
|
|
8
|
+
});
|
|
9
|
+
export { ListImagesByTagToolFeature };
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=feature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/file/ListImagesByTagTool/feature.js","sources":["../../../../src/features/file/ListImagesByTagTool/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { ListImagesByTagTool } from \"./ListImagesByTagTool.js\";\n\nexport const ListImagesByTagToolFeature = createFeature({\n name: \"AiPowerUps/ListImagesByTagTool\",\n register(container) {\n container.register(ListImagesByTagTool);\n }\n});\n"],"names":["ListImagesByTagToolFeature","createFeature","container","ListImagesByTagTool"],"mappings":";;AAGO,MAAMA,6BAA6BC,cAAc;IACpD,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,QAAQ,CAACC;IACvB;AACJ"}
|
|
@@ -1,47 +1,42 @@
|
|
|
1
1
|
import { Result } from "@webiny/feature/api";
|
|
2
2
|
import { GetUniqueFieldValuesUseCase } from "@webiny/api-headless-cms/features/contentEntry/GetUniqueFieldValues";
|
|
3
|
-
import { ListTagsRepository
|
|
3
|
+
import { ListTagsRepository } from "./abstractions.js";
|
|
4
4
|
import { FileModel } from "../../../domain/file/abstractions.js";
|
|
5
5
|
import { FilePersistenceError } from "../../../domain/file/errors.js";
|
|
6
6
|
import { CmsWhereMapper } from "@webiny/api-headless-cms";
|
|
7
7
|
class ListTagsRepositoryImpl {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
8
|
+
constructor(getUniqueFieldValues, fileModel, cmsWhereMapper){
|
|
9
|
+
this.getUniqueFieldValues = getUniqueFieldValues;
|
|
10
|
+
this.fileModel = fileModel;
|
|
11
|
+
this.cmsWhereMapper = cmsWhereMapper;
|
|
12
|
+
}
|
|
13
|
+
async execute(input) {
|
|
14
|
+
const result = await this.getUniqueFieldValues.execute(this.fileModel, {
|
|
15
|
+
fieldId: "tags",
|
|
16
|
+
where: this.cmsWhereMapper.map({
|
|
17
|
+
input: {
|
|
18
|
+
...input.where || {},
|
|
19
|
+
latest: true
|
|
20
|
+
},
|
|
21
|
+
fields: this.fileModel.fields
|
|
22
|
+
})
|
|
23
|
+
});
|
|
24
|
+
if (result.isFail()) return Result.fail(new FilePersistenceError(result.error));
|
|
25
|
+
const tags = result.value.map((uv)=>({
|
|
26
|
+
tag: uv.value,
|
|
27
|
+
count: uv.count
|
|
28
|
+
})).sort((a, b)=>a.tag < b.tag ? -1 : 1).sort((a, b)=>a.count > b.count ? -1 : 1);
|
|
29
|
+
return Result.ok(tags);
|
|
28
30
|
}
|
|
29
|
-
|
|
30
|
-
// Map to TagItem format
|
|
31
|
-
const tags = result.value.map(uv => ({
|
|
32
|
-
tag: uv.value,
|
|
33
|
-
count: uv.count
|
|
34
|
-
}))
|
|
35
|
-
// Sort by tag name alphabetically
|
|
36
|
-
.sort((a, b) => a.tag < b.tag ? -1 : 1)
|
|
37
|
-
// Then sort by count descending (most used first)
|
|
38
|
-
.sort((a, b) => a.count > b.count ? -1 : 1);
|
|
39
|
-
return Result.ok(tags);
|
|
40
|
-
}
|
|
41
31
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
32
|
+
const ListTagsRepository_ListTagsRepository = ListTagsRepository.createImplementation({
|
|
33
|
+
implementation: ListTagsRepositoryImpl,
|
|
34
|
+
dependencies: [
|
|
35
|
+
GetUniqueFieldValuesUseCase,
|
|
36
|
+
FileModel,
|
|
37
|
+
CmsWhereMapper
|
|
38
|
+
]
|
|
45
39
|
});
|
|
40
|
+
export { ListTagsRepository_ListTagsRepository as ListTagsRepository };
|
|
46
41
|
|
|
47
42
|
//# sourceMappingURL=ListTagsRepository.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"features/file/ListTags/ListTagsRepository.js","sources":["../../../../src/features/file/ListTags/ListTagsRepository.ts"],"sourcesContent":["import { Result } from \"@webiny/feature/api\";\nimport { GetUniqueFieldValuesUseCase } from \"@webiny/api-headless-cms/features/contentEntry/GetUniqueFieldValues\";\nimport {\n ListTagsInput,\n ListTagsRepository as RepositoryAbstraction,\n TagItem\n} from \"./abstractions.js\";\nimport { FileModel } from \"~/domain/file/abstractions.js\";\nimport { FilePersistenceError } from \"~/domain/file/errors.js\";\nimport { CmsWhereMapper } from \"@webiny/api-headless-cms\";\n\nclass ListTagsRepositoryImpl implements RepositoryAbstraction.Interface {\n constructor(\n private getUniqueFieldValues: GetUniqueFieldValuesUseCase.Interface,\n private fileModel: FileModel.Interface,\n private cmsWhereMapper: CmsWhereMapper.Interface\n ) {}\n\n async execute(input: ListTagsInput): Promise<Result<TagItem[], RepositoryAbstraction.Error>> {\n const result = await this.getUniqueFieldValues.execute(this.fileModel, {\n fieldId: \"tags\",\n // TODO fix with proper types\n // @ts-expect-error\n where: this.cmsWhereMapper.map({\n input: {\n ...(input.where || {}),\n latest: true\n },\n fields: this.fileModel.fields\n })\n });\n\n if (result.isFail()) {\n return Result.fail(new FilePersistenceError(result.error));\n }\n\n // Map to TagItem format\n const tags: TagItem[] = result.value\n .map(uv => ({\n tag: uv.value as string,\n count: uv.count\n }))\n // Sort by tag name alphabetically\n .sort((a, b) => (a.tag < b.tag ? -1 : 1))\n // Then sort by count descending (most used first)\n .sort((a, b) => (a.count > b.count ? -1 : 1));\n\n return Result.ok(tags);\n }\n}\n\nexport const ListTagsRepository = RepositoryAbstraction.createImplementation({\n implementation: ListTagsRepositoryImpl,\n dependencies: [GetUniqueFieldValuesUseCase, FileModel, CmsWhereMapper]\n});\n"],"names":["ListTagsRepositoryImpl","getUniqueFieldValues","fileModel","cmsWhereMapper","input","result","Result","FilePersistenceError","tags","uv","a","b","ListTagsRepository","RepositoryAbstraction","GetUniqueFieldValuesUseCase","FileModel","CmsWhereMapper"],"mappings":";;;;;;AAWA,MAAMA;IACF,YACYC,oBAA2D,EAC3DC,SAA8B,EAC9BC,cAAwC,CAClD;aAHUF,oBAAoB,GAApBA;aACAC,SAAS,GAATA;aACAC,cAAc,GAAdA;IACT;IAEH,MAAM,QAAQC,KAAoB,EAA2D;QACzF,MAAMC,SAAS,MAAM,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE;YACnE,SAAS;YAGT,OAAO,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC;gBAC3B,OAAO;oBACH,GAAID,MAAM,KAAK,IAAI,CAAC,CAAC;oBACrB,QAAQ;gBACZ;gBACA,QAAQ,IAAI,CAAC,SAAS,CAAC,MAAM;YACjC;QACJ;QAEA,IAAIC,OAAO,MAAM,IACb,OAAOC,OAAO,IAAI,CAAC,IAAIC,qBAAqBF,OAAO,KAAK;QAI5D,MAAMG,OAAkBH,OAAO,KAAK,CAC/B,GAAG,CAACI,CAAAA,KAAO;gBACR,KAAKA,GAAG,KAAK;gBACb,OAAOA,GAAG,KAAK;YACnB,IAEC,IAAI,CAAC,CAACC,GAAGC,IAAOD,EAAE,GAAG,GAAGC,EAAE,GAAG,GAAG,KAAK,GAErC,IAAI,CAAC,CAACD,GAAGC,IAAOD,EAAE,KAAK,GAAGC,EAAE,KAAK,GAAG,KAAK;QAE9C,OAAOL,OAAO,EAAE,CAACE;IACrB;AACJ;AAEO,MAAMI,wCAAqBC,mBAAAA,oBAA0C,CAAC;IACzE,gBAAgBb;IAChB,cAAc;QAACc;QAA6BC;QAAWC;KAAe;AAC1E"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Result } from "@webiny/feature/api";
|
|
2
2
|
import { ListTagsUseCase as UseCaseAbstraction, ListTagsInput, TagItem, ListTagsRepository } from "./abstractions.js";
|
|
3
|
-
import {
|
|
3
|
+
import { FmPermissions } from "../../../features/shared/abstractions.js";
|
|
4
4
|
declare class ListTagsUseCaseImpl implements UseCaseAbstraction.Interface {
|
|
5
|
-
private
|
|
5
|
+
private permissions;
|
|
6
6
|
private repository;
|
|
7
|
-
constructor(
|
|
7
|
+
constructor(permissions: FmPermissions.Interface, repository: ListTagsRepository.Interface);
|
|
8
8
|
execute(input: ListTagsInput): Promise<Result<TagItem[], UseCaseAbstraction.Error>>;
|
|
9
9
|
}
|
|
10
10
|
export declare const ListTagsUseCase: typeof ListTagsUseCaseImpl & {
|
|
@@ -1,32 +1,31 @@
|
|
|
1
1
|
import { Result } from "@webiny/feature/api";
|
|
2
|
-
import {
|
|
2
|
+
import { ListTagsRepository, ListTagsUseCase } from "./abstractions.js";
|
|
3
3
|
import { FileNotAuthorizedError } from "../../../domain/file/errors.js";
|
|
4
|
-
import {
|
|
4
|
+
import { FmPermissions } from "../../shared/abstractions.js";
|
|
5
5
|
class ListTagsUseCaseImpl {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
async execute(input) {
|
|
11
|
-
// Check permission (ensure() with no args checks basic access)
|
|
12
|
-
const hasPermission = await this.filePermissions.ensure();
|
|
13
|
-
if (!hasPermission) {
|
|
14
|
-
return Result.fail(new FileNotAuthorizedError());
|
|
6
|
+
constructor(permissions, repository){
|
|
7
|
+
this.permissions = permissions;
|
|
8
|
+
this.repository = repository;
|
|
15
9
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
10
|
+
async execute(input) {
|
|
11
|
+
const hasPermission = await this.permissions.canAccess("file");
|
|
12
|
+
if (!hasPermission) return Result.fail(new FileNotAuthorizedError());
|
|
13
|
+
const enrichedInput = {
|
|
14
|
+
...input,
|
|
15
|
+
limit: input.limit || 1000000
|
|
16
|
+
};
|
|
17
|
+
const result = await this.repository.execute(enrichedInput);
|
|
18
|
+
if (result.isFail()) return Result.fail(result.error);
|
|
19
|
+
return Result.ok(result.value);
|
|
23
20
|
}
|
|
24
|
-
return Result.ok(result.value);
|
|
25
|
-
}
|
|
26
21
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
22
|
+
const ListTagsUseCase_ListTagsUseCase = ListTagsUseCase.createImplementation({
|
|
23
|
+
implementation: ListTagsUseCaseImpl,
|
|
24
|
+
dependencies: [
|
|
25
|
+
FmPermissions,
|
|
26
|
+
ListTagsRepository
|
|
27
|
+
]
|
|
30
28
|
});
|
|
29
|
+
export { ListTagsUseCase_ListTagsUseCase as ListTagsUseCase };
|
|
31
30
|
|
|
32
31
|
//# sourceMappingURL=ListTagsUseCase.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"features/file/ListTags/ListTagsUseCase.js","sources":["../../../../src/features/file/ListTags/ListTagsUseCase.ts"],"sourcesContent":["import { Result } from \"@webiny/feature/api\";\nimport {\n ListTagsUseCase as UseCaseAbstraction,\n ListTagsInput,\n TagItem,\n ListTagsRepository\n} from \"./abstractions.js\";\nimport { FileNotAuthorizedError } from \"~/domain/file/errors.js\";\nimport { FmPermissions } from \"~/features/shared/abstractions.js\";\n\nclass ListTagsUseCaseImpl implements UseCaseAbstraction.Interface {\n constructor(\n private permissions: FmPermissions.Interface,\n private repository: ListTagsRepository.Interface\n ) {}\n\n async execute(input: ListTagsInput): Promise<Result<TagItem[], UseCaseAbstraction.Error>> {\n const hasPermission = await this.permissions.canAccess(\"file\");\n if (!hasPermission) {\n return Result.fail(new FileNotAuthorizedError());\n }\n\n const enrichedInput: ListTagsInput = {\n ...input,\n limit: input.limit || 1000000\n };\n\n const result = await this.repository.execute(enrichedInput);\n\n if (result.isFail()) {\n return Result.fail(result.error);\n }\n\n return Result.ok(result.value);\n }\n}\n\nexport const ListTagsUseCase = UseCaseAbstraction.createImplementation({\n implementation: ListTagsUseCaseImpl,\n dependencies: [FmPermissions, ListTagsRepository]\n});\n"],"names":["ListTagsUseCaseImpl","permissions","repository","input","hasPermission","Result","FileNotAuthorizedError","enrichedInput","result","ListTagsUseCase","UseCaseAbstraction","FmPermissions","ListTagsRepository"],"mappings":";;;;AAUA,MAAMA;IACF,YACYC,WAAoC,EACpCC,UAAwC,CAClD;aAFUD,WAAW,GAAXA;aACAC,UAAU,GAAVA;IACT;IAEH,MAAM,QAAQC,KAAoB,EAAwD;QACtF,MAAMC,gBAAgB,MAAM,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC;QACvD,IAAI,CAACA,eACD,OAAOC,OAAO,IAAI,CAAC,IAAIC;QAG3B,MAAMC,gBAA+B;YACjC,GAAGJ,KAAK;YACR,OAAOA,MAAM,KAAK,IAAI;QAC1B;QAEA,MAAMK,SAAS,MAAM,IAAI,CAAC,UAAU,CAAC,OAAO,CAACD;QAE7C,IAAIC,OAAO,MAAM,IACb,OAAOH,OAAO,IAAI,CAACG,OAAO,KAAK;QAGnC,OAAOH,OAAO,EAAE,CAACG,OAAO,KAAK;IACjC;AACJ;AAEO,MAAMC,kCAAkBC,gBAAAA,oBAAuC,CAAC;IACnE,gBAAgBV;IAChB,cAAc;QAACW;QAAeC;KAAmB;AACrD"}
|
|
@@ -19,6 +19,7 @@ export interface IListTagsRepositoryErrors {
|
|
|
19
19
|
persistence: FilePersistenceError;
|
|
20
20
|
}
|
|
21
21
|
type RepositoryError = IListTagsRepositoryErrors[keyof IListTagsRepositoryErrors];
|
|
22
|
+
/** Fetch file tags from storage. */
|
|
22
23
|
export declare const ListTagsRepository: import("@webiny/di").Abstraction<IListTagsRepository>;
|
|
23
24
|
export declare namespace ListTagsRepository {
|
|
24
25
|
type Interface = IListTagsRepository;
|
|
@@ -35,6 +36,7 @@ export interface IListTagsUseCaseErrors {
|
|
|
35
36
|
persistence: FilePersistenceError;
|
|
36
37
|
}
|
|
37
38
|
type UseCaseError = IListTagsUseCaseErrors[keyof IListTagsUseCaseErrors];
|
|
39
|
+
/** List all file tags. */
|
|
38
40
|
export declare const ListTagsUseCase: import("@webiny/di").Abstraction<IListTagsUseCase>;
|
|
39
41
|
export declare namespace ListTagsUseCase {
|
|
40
42
|
type Interface = IListTagsUseCase;
|
|
@@ -1,15 +1,6 @@
|
|
|
1
1
|
import { createAbstraction } from "@webiny/feature/api";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
export const ListTagsRepository = createAbstraction("ListTagsRepository");
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* ListTags use case interface
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
export const ListTagsUseCase = createAbstraction("ListTagsUseCase");
|
|
2
|
+
const ListTagsRepository = createAbstraction("ListTagsRepository");
|
|
3
|
+
const ListTagsUseCase = createAbstraction("ListTagsUseCase");
|
|
4
|
+
export { ListTagsRepository, ListTagsUseCase };
|
|
14
5
|
|
|
15
6
|
//# sourceMappingURL=abstractions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"features/file/ListTags/abstractions.js","sources":["../../../../src/features/file/ListTags/abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { Result } from \"@webiny/feature/api\";\nimport { type FilePersistenceError, FileNotAuthorizedError } from \"~/domain/file/errors.js\";\n\nexport interface ListTagsInput {\n where?: Record<string, any>;\n after?: string | null;\n limit?: number;\n}\n\nexport interface TagItem {\n tag: string;\n count: number;\n}\n\n/**\n * ListTags repository interface\n */\nexport interface IListTagsRepository {\n execute(input: ListTagsInput): Promise<Result<TagItem[], RepositoryError>>;\n}\n\nexport interface IListTagsRepositoryErrors {\n persistence: FilePersistenceError;\n}\n\ntype RepositoryError = IListTagsRepositoryErrors[keyof IListTagsRepositoryErrors];\n\n/** Fetch file tags from storage. */\nexport const ListTagsRepository = createAbstraction<IListTagsRepository>(\"ListTagsRepository\");\n\nexport namespace ListTagsRepository {\n export type Interface = IListTagsRepository;\n export type Error = RepositoryError;\n}\n\n/**\n * ListTags use case interface\n */\nexport interface IListTagsUseCase {\n execute(input: ListTagsInput): Promise<Result<TagItem[], UseCaseError>>;\n}\n\nexport interface IListTagsUseCaseErrors {\n notAuthorized: FileNotAuthorizedError;\n persistence: FilePersistenceError;\n}\n\ntype UseCaseError = IListTagsUseCaseErrors[keyof IListTagsUseCaseErrors];\n\n/** List all file tags. */\nexport const ListTagsUseCase = createAbstraction<IListTagsUseCase>(\"ListTagsUseCase\");\n\nexport namespace ListTagsUseCase {\n export type Interface = IListTagsUseCase;\n export type Error = UseCaseError;\n}\n"],"names":["ListTagsRepository","createAbstraction","ListTagsUseCase"],"mappings":";AA6BO,MAAMA,qBAAqBC,kBAAuC;AAsBlE,MAAMC,kBAAkBD,kBAAoC"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { createFeature } from "@webiny/feature/api";
|
|
2
2
|
import { ListTagsRepository } from "./ListTagsRepository.js";
|
|
3
3
|
import { ListTagsUseCase } from "./ListTagsUseCase.js";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
const ListTagsFeature = createFeature({
|
|
5
|
+
name: "FileManager/ListTags",
|
|
6
|
+
register (container) {
|
|
7
|
+
container.register(ListTagsUseCase);
|
|
8
|
+
container.register(ListTagsRepository).inSingletonScope();
|
|
9
|
+
}
|
|
10
10
|
});
|
|
11
|
+
export { ListTagsFeature };
|
|
11
12
|
|
|
12
13
|
//# sourceMappingURL=feature.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"features/file/ListTags/feature.js","sources":["../../../../src/features/file/ListTags/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { ListTagsRepository } from \"./ListTagsRepository.js\";\nimport { ListTagsUseCase } from \"./ListTagsUseCase.js\";\n\nexport const ListTagsFeature = createFeature({\n name: \"FileManager/ListTags\",\n register(container) {\n container.register(ListTagsUseCase);\n container.register(ListTagsRepository).inSingletonScope();\n }\n});\n"],"names":["ListTagsFeature","createFeature","container","ListTagsUseCase","ListTagsRepository"],"mappings":";;;AAIO,MAAMA,kBAAkBC,cAAc;IACzC,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,QAAQ,CAACC;QACnBD,UAAU,QAAQ,CAACE,oBAAoB,gBAAgB;IAC3D;AACJ"}
|
|
@@ -1,39 +1,37 @@
|
|
|
1
1
|
import { Result } from "@webiny/feature/api";
|
|
2
2
|
import { UpdateEntryUseCase } from "@webiny/api-headless-cms/features/contentEntry/UpdateEntry";
|
|
3
|
-
import { UpdateFileRepository
|
|
3
|
+
import { UpdateFileRepository } from "./abstractions.js";
|
|
4
4
|
import { FileModel } from "../../../domain/file/abstractions.js";
|
|
5
5
|
import { FileNotAuthorizedError, FileNotFoundError, FilePersistenceError } from "../../../domain/file/errors.js";
|
|
6
6
|
import { FileToEntryMapper } from "../shared/FileToEntryMapper.js";
|
|
7
7
|
class UpdateFileRepositoryImpl {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
if (error.code === "Cms/Entry/NotAuthorized") {
|
|
27
|
-
return Result.fail(new FileNotAuthorizedError());
|
|
28
|
-
}
|
|
29
|
-
return Result.fail(new FilePersistenceError(result.error));
|
|
8
|
+
constructor(updateEntry, fileModel){
|
|
9
|
+
this.updateEntry = updateEntry;
|
|
10
|
+
this.fileModel = fileModel;
|
|
11
|
+
}
|
|
12
|
+
async update(file) {
|
|
13
|
+
const entry = FileToEntryMapper.toEntry(file);
|
|
14
|
+
const id = `${file.id}#0001`;
|
|
15
|
+
const result = await this.updateEntry.execute(this.fileModel, id, {
|
|
16
|
+
wbyAco_location: file.location,
|
|
17
|
+
values: entry.values
|
|
18
|
+
});
|
|
19
|
+
if (result.isFail()) {
|
|
20
|
+
const error = result.error;
|
|
21
|
+
if ("Cms/Entry/NotFound" === error.code) return Result.fail(new FileNotFoundError(id));
|
|
22
|
+
if ("Cms/Entry/NotAuthorized" === error.code) return Result.fail(new FileNotAuthorizedError());
|
|
23
|
+
return Result.fail(new FilePersistenceError(result.error));
|
|
24
|
+
}
|
|
25
|
+
return Result.ok();
|
|
30
26
|
}
|
|
31
|
-
return Result.ok();
|
|
32
|
-
}
|
|
33
27
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
28
|
+
const UpdateFileRepository_UpdateFileRepository = UpdateFileRepository.createImplementation({
|
|
29
|
+
implementation: UpdateFileRepositoryImpl,
|
|
30
|
+
dependencies: [
|
|
31
|
+
UpdateEntryUseCase,
|
|
32
|
+
FileModel
|
|
33
|
+
]
|
|
37
34
|
});
|
|
35
|
+
export { UpdateFileRepository_UpdateFileRepository as UpdateFileRepository };
|
|
38
36
|
|
|
39
37
|
//# sourceMappingURL=UpdateFileRepository.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"features/file/UpdateFile/UpdateFileRepository.js","sources":["../../../../src/features/file/UpdateFile/UpdateFileRepository.ts"],"sourcesContent":["import { Result } from \"@webiny/feature/api\";\nimport { UpdateEntryUseCase } from \"@webiny/api-headless-cms/features/contentEntry/UpdateEntry\";\nimport { UpdateFileRepository as RepositoryAbstraction } from \"./abstractions.js\";\nimport { FileModel } from \"~/domain/file/abstractions.js\";\nimport type { File } from \"~/domain/file/types.js\";\nimport {\n FileNotAuthorizedError,\n FileNotFoundError,\n FilePersistenceError\n} from \"~/domain/file/errors.js\";\nimport { FileToEntryMapper } from \"../shared/FileToEntryMapper.js\";\n\nclass UpdateFileRepositoryImpl implements RepositoryAbstraction.Interface {\n constructor(\n private updateEntry: UpdateEntryUseCase.Interface,\n private fileModel: FileModel.Interface\n ) {}\n\n async update(file: File): Promise<Result<void, RepositoryAbstraction.Error>> {\n const entry = FileToEntryMapper.toEntry(file);\n\n // Files are not versioned, so we're always updating the same revision\n const id = `${file.id}#0001`;\n\n const result = await this.updateEntry.execute(this.fileModel, id, {\n wbyAco_location: file.location,\n values: entry.values\n });\n\n if (result.isFail()) {\n const error = result.error;\n if (error.code === \"Cms/Entry/NotFound\") {\n return Result.fail(new FileNotFoundError(id));\n }\n\n if (error.code === \"Cms/Entry/NotAuthorized\") {\n return Result.fail(new FileNotAuthorizedError());\n }\n\n return Result.fail(new FilePersistenceError(result.error));\n }\n\n return Result.ok();\n }\n}\n\nexport const UpdateFileRepository = RepositoryAbstraction.createImplementation({\n implementation: UpdateFileRepositoryImpl,\n dependencies: [UpdateEntryUseCase, FileModel]\n});\n"],"names":["UpdateFileRepositoryImpl","updateEntry","fileModel","file","entry","FileToEntryMapper","id","result","error","Result","FileNotFoundError","FileNotAuthorizedError","FilePersistenceError","UpdateFileRepository","RepositoryAbstraction","UpdateEntryUseCase","FileModel"],"mappings":";;;;;;AAYA,MAAMA;IACF,YACYC,WAAyC,EACzCC,SAA8B,CACxC;aAFUD,WAAW,GAAXA;aACAC,SAAS,GAATA;IACT;IAEH,MAAM,OAAOC,IAAU,EAAsD;QACzE,MAAMC,QAAQC,kBAAkB,OAAO,CAACF;QAGxC,MAAMG,KAAK,GAAGH,KAAK,EAAE,CAAC,KAAK,CAAC;QAE5B,MAAMI,SAAS,MAAM,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,EAAED,IAAI;YAC9D,iBAAiBH,KAAK,QAAQ;YAC9B,QAAQC,MAAM,MAAM;QACxB;QAEA,IAAIG,OAAO,MAAM,IAAI;YACjB,MAAMC,QAAQD,OAAO,KAAK;YAC1B,IAAIC,AAAe,yBAAfA,MAAM,IAAI,EACV,OAAOC,OAAO,IAAI,CAAC,IAAIC,kBAAkBJ;YAG7C,IAAIE,AAAe,8BAAfA,MAAM,IAAI,EACV,OAAOC,OAAO,IAAI,CAAC,IAAIE;YAG3B,OAAOF,OAAO,IAAI,CAAC,IAAIG,qBAAqBL,OAAO,KAAK;QAC5D;QAEA,OAAOE,OAAO,EAAE;IACpB;AACJ;AAEO,MAAMI,4CAAuBC,qBAAAA,oBAA0C,CAAC;IAC3E,gBAAgBd;IAChB,cAAc;QAACe;QAAoBC;KAAU;AACjD"}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { Result } from "@webiny/feature/api";
|
|
2
2
|
import { UpdateFileUseCase as UseCaseAbstraction, UpdateFileInput, UpdateFileRepository } from "./abstractions.js";
|
|
3
3
|
import { GetFileUseCase } from "../GetFile/abstractions.js";
|
|
4
|
-
import { EventPublisher } from "@webiny/api-core/features/
|
|
4
|
+
import { EventPublisher } from "@webiny/api-core/features/eventPublisher/index.js";
|
|
5
5
|
import type { File } from "../../../domain/file/types.js";
|
|
6
|
-
import {
|
|
7
|
-
import { IdentityContext } from "@webiny/api-core/features/IdentityContext";
|
|
6
|
+
import { FmPermissions } from "../../../features/shared/abstractions.js";
|
|
7
|
+
import { IdentityContext } from "@webiny/api-core/features/security/IdentityContext/index.js";
|
|
8
8
|
declare class UpdateFileUseCaseImpl implements UseCaseAbstraction.Interface {
|
|
9
9
|
private identityContext;
|
|
10
|
-
private
|
|
10
|
+
private permissions;
|
|
11
11
|
private getFile;
|
|
12
12
|
private repository;
|
|
13
13
|
private eventPublisher;
|
|
14
|
-
constructor(identityContext: IdentityContext.Interface,
|
|
14
|
+
constructor(identityContext: IdentityContext.Interface, permissions: FmPermissions.Interface, getFile: GetFileUseCase.Interface, repository: UpdateFileRepository.Interface, eventPublisher: EventPublisher.Interface);
|
|
15
15
|
execute(input: UpdateFileInput): Promise<Result<File, UseCaseAbstraction.Error>>;
|
|
16
16
|
}
|
|
17
17
|
export declare const UpdateFileUseCase: typeof UpdateFileUseCaseImpl & {
|