@webiny/api-file-manager 0.0.0-unstable.df6d94b531 → 0.0.0-unstable.e53eceafb5
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/FileManagerContextSetup.d.ts +13 -0
- package/FileManagerContextSetup.js +115 -0
- package/FileManagerContextSetup.js.map +1 -0
- package/README.md +1 -1
- package/cmsFileStorage/CmsFilesStorage.d.ts +27 -0
- package/cmsFileStorage/CmsFilesStorage.js +164 -0
- package/cmsFileStorage/CmsFilesStorage.js.map +1 -0
- package/cmsFileStorage/ListFilesWhereProcessor.d.ts +7 -0
- package/cmsFileStorage/ListFilesWhereProcessor.js +33 -0
- package/cmsFileStorage/ListFilesWhereProcessor.js.map +1 -0
- package/cmsFileStorage/ListTagsWhereProcessor.d.ts +7 -0
- package/cmsFileStorage/ListTagsWhereProcessor.js +33 -0
- package/cmsFileStorage/ListTagsWhereProcessor.js.map +1 -0
- package/cmsFileStorage/file.model.d.ts +6 -0
- package/cmsFileStorage/file.model.js +158 -0
- package/cmsFileStorage/file.model.js.map +1 -0
- package/contants.d.ts +1 -0
- package/contants.js +9 -0
- package/contants.js.map +1 -0
- package/createFileManager/files.crud.d.ts +3 -3
- package/createFileManager/files.crud.js +123 -120
- package/createFileManager/files.crud.js.map +1 -1
- package/createFileManager/index.d.ts +2 -12
- package/createFileManager/index.js +8 -5
- package/createFileManager/index.js.map +1 -1
- package/createFileManager/permissions/FilesPermissions.d.ts +4 -0
- package/createFileManager/permissions/FilesPermissions.js +11 -0
- package/createFileManager/permissions/FilesPermissions.js.map +1 -0
- package/createFileManager/permissions/SettingsPermissions.d.ts +4 -0
- package/createFileManager/permissions/SettingsPermissions.js +11 -0
- package/createFileManager/permissions/SettingsPermissions.js.map +1 -0
- package/createFileManager/settings.crud.d.ts +3 -3
- package/createFileManager/settings.crud.js +74 -48
- package/createFileManager/settings.crud.js.map +1 -1
- package/createFileManager/system.crud.d.ts +3 -3
- package/createFileManager/system.crud.js +6 -4
- package/createFileManager/system.crud.js.map +1 -1
- package/createFileManager/types.d.ts +16 -0
- package/createFileManager/types.js +7 -0
- package/createFileManager/types.js.map +1 -0
- package/delivery/AssetDelivery/AliasAssetRequestResolver.d.ts +11 -0
- package/delivery/AssetDelivery/AliasAssetRequestResolver.js +74 -0
- package/delivery/AssetDelivery/AliasAssetRequestResolver.js.map +1 -0
- package/delivery/AssetDelivery/Asset.d.ts +32 -0
- package/delivery/AssetDelivery/Asset.js +69 -0
- package/delivery/AssetDelivery/Asset.js.map +1 -0
- package/delivery/AssetDelivery/AssetDeliveryConfig.d.ts +63 -0
- package/delivery/AssetDelivery/AssetDeliveryConfig.js +102 -0
- package/delivery/AssetDelivery/AssetDeliveryConfig.js.map +1 -0
- package/delivery/AssetDelivery/AssetRequest.d.ts +25 -0
- package/delivery/AssetDelivery/AssetRequest.js +29 -0
- package/delivery/AssetDelivery/AssetRequest.js.map +1 -0
- package/delivery/AssetDelivery/FilesAssetRequestResolver.d.ts +6 -0
- package/delivery/AssetDelivery/FilesAssetRequestResolver.js +37 -0
- package/delivery/AssetDelivery/FilesAssetRequestResolver.js.map +1 -0
- package/delivery/AssetDelivery/NullAssetOutputStrategy.d.ts +4 -0
- package/delivery/AssetDelivery/NullAssetOutputStrategy.js +15 -0
- package/delivery/AssetDelivery/NullAssetOutputStrategy.js.map +1 -0
- package/delivery/AssetDelivery/NullAssetReply.d.ts +4 -0
- package/delivery/AssetDelivery/NullAssetReply.js +20 -0
- package/delivery/AssetDelivery/NullAssetReply.js.map +1 -0
- package/delivery/AssetDelivery/NullAssetResolver.d.ts +5 -0
- package/delivery/AssetDelivery/NullAssetResolver.js +14 -0
- package/delivery/AssetDelivery/NullAssetResolver.js.map +1 -0
- package/delivery/AssetDelivery/NullRequestResolver.d.ts +4 -0
- package/delivery/AssetDelivery/NullRequestResolver.js +14 -0
- package/delivery/AssetDelivery/NullRequestResolver.js.map +1 -0
- package/delivery/AssetDelivery/SetCacheControlHeaders.d.ts +8 -0
- package/delivery/AssetDelivery/SetCacheControlHeaders.js +25 -0
- package/delivery/AssetDelivery/SetCacheControlHeaders.js.map +1 -0
- package/delivery/AssetDelivery/SetResponseHeaders.d.ts +18 -0
- package/delivery/AssetDelivery/SetResponseHeaders.js +25 -0
- package/delivery/AssetDelivery/SetResponseHeaders.js.map +1 -0
- package/delivery/AssetDelivery/abstractions/AssetContentsReader.d.ts +6 -0
- package/delivery/AssetDelivery/abstractions/AssetContentsReader.js +7 -0
- package/delivery/AssetDelivery/abstractions/AssetContentsReader.js.map +1 -0
- package/delivery/AssetDelivery/abstractions/AssetOutputStrategy.d.ts +4 -0
- package/delivery/AssetDelivery/abstractions/AssetOutputStrategy.js +7 -0
- package/delivery/AssetDelivery/abstractions/AssetOutputStrategy.js.map +1 -0
- package/delivery/AssetDelivery/abstractions/AssetProcessor.d.ts +4 -0
- package/delivery/AssetDelivery/abstractions/AssetProcessor.js +7 -0
- package/delivery/AssetDelivery/abstractions/AssetProcessor.js.map +1 -0
- package/delivery/AssetDelivery/abstractions/AssetReply.d.ts +25 -0
- package/delivery/AssetDelivery/abstractions/AssetReply.js +38 -0
- package/delivery/AssetDelivery/abstractions/AssetReply.js.map +1 -0
- package/delivery/AssetDelivery/abstractions/AssetRequestResolver.d.ts +5 -0
- package/delivery/AssetDelivery/abstractions/AssetRequestResolver.js +7 -0
- package/delivery/AssetDelivery/abstractions/AssetRequestResolver.js.map +1 -0
- package/delivery/AssetDelivery/abstractions/AssetResolver.d.ts +4 -0
- package/delivery/AssetDelivery/abstractions/AssetResolver.js +7 -0
- package/delivery/AssetDelivery/abstractions/AssetResolver.js.map +1 -0
- package/delivery/AssetDelivery/abstractions/AssetTransformationStrategy.d.ts +4 -0
- package/delivery/AssetDelivery/abstractions/AssetTransformationStrategy.js +7 -0
- package/delivery/AssetDelivery/abstractions/AssetTransformationStrategy.js.map +1 -0
- package/delivery/AssetDelivery/createAssetDeliveryPluginLoader.d.ts +2 -0
- package/delivery/AssetDelivery/createAssetDeliveryPluginLoader.js +15 -0
- package/delivery/AssetDelivery/createAssetDeliveryPluginLoader.js.map +1 -0
- package/delivery/AssetDelivery/privateFiles/AssetAuthorizer.d.ts +4 -0
- package/delivery/AssetDelivery/privateFiles/AssetAuthorizer.js +7 -0
- package/delivery/AssetDelivery/privateFiles/AssetAuthorizer.js.map +1 -0
- package/delivery/AssetDelivery/privateFiles/NotAuthorizedAssetReply.d.ts +4 -0
- package/delivery/AssetDelivery/privateFiles/NotAuthorizedAssetReply.js +26 -0
- package/delivery/AssetDelivery/privateFiles/NotAuthorizedAssetReply.js.map +1 -0
- package/delivery/AssetDelivery/privateFiles/NotAuthorizedOutputStrategy.d.ts +4 -0
- package/delivery/AssetDelivery/privateFiles/NotAuthorizedOutputStrategy.js +15 -0
- package/delivery/AssetDelivery/privateFiles/NotAuthorizedOutputStrategy.js.map +1 -0
- package/delivery/AssetDelivery/privateFiles/PrivateAuthenticatedAuthorizer.d.ts +7 -0
- package/delivery/AssetDelivery/privateFiles/PrivateAuthenticatedAuthorizer.js +28 -0
- package/delivery/AssetDelivery/privateFiles/PrivateAuthenticatedAuthorizer.js.map +1 -0
- package/delivery/AssetDelivery/privateFiles/PrivateCache.d.ts +6 -0
- package/delivery/AssetDelivery/privateFiles/PrivateCache.js +28 -0
- package/delivery/AssetDelivery/privateFiles/PrivateCache.js.map +1 -0
- package/delivery/AssetDelivery/privateFiles/PrivateFileAssetRequestResolver.d.ts +8 -0
- package/delivery/AssetDelivery/privateFiles/PrivateFileAssetRequestResolver.js +37 -0
- package/delivery/AssetDelivery/privateFiles/PrivateFileAssetRequestResolver.js.map +1 -0
- package/delivery/AssetDelivery/privateFiles/PrivateFilesAssetProcessor.d.ts +13 -0
- package/delivery/AssetDelivery/privateFiles/PrivateFilesAssetProcessor.js +63 -0
- package/delivery/AssetDelivery/privateFiles/PrivateFilesAssetProcessor.js.map +1 -0
- package/delivery/AssetDelivery/privateFiles/PublicCache.d.ts +6 -0
- package/delivery/AssetDelivery/privateFiles/PublicCache.js +28 -0
- package/delivery/AssetDelivery/privateFiles/PublicCache.js.map +1 -0
- package/delivery/AssetDelivery/privateFiles/RedirectToPrivateUrlOutputStrategy.d.ts +7 -0
- package/delivery/AssetDelivery/privateFiles/RedirectToPrivateUrlOutputStrategy.js +27 -0
- package/delivery/AssetDelivery/privateFiles/RedirectToPrivateUrlOutputStrategy.js.map +1 -0
- package/delivery/AssetDelivery/privateFiles/RedirectToPublicUrlOutputStrategy.d.ts +7 -0
- package/delivery/AssetDelivery/privateFiles/RedirectToPublicUrlOutputStrategy.js +27 -0
- package/delivery/AssetDelivery/privateFiles/RedirectToPublicUrlOutputStrategy.js.map +1 -0
- package/delivery/AssetDelivery/privateFiles/internalIdentity.d.ts +7 -0
- package/delivery/AssetDelivery/privateFiles/internalIdentity.js +18 -0
- package/delivery/AssetDelivery/privateFiles/internalIdentity.js.map +1 -0
- package/delivery/AssetDelivery/transformation/PassthroughAssetProcessor.d.ts +4 -0
- package/delivery/AssetDelivery/transformation/PassthroughAssetProcessor.js +14 -0
- package/delivery/AssetDelivery/transformation/PassthroughAssetProcessor.js.map +1 -0
- package/delivery/AssetDelivery/transformation/PassthroughAssetTransformationStrategy.d.ts +4 -0
- package/delivery/AssetDelivery/transformation/PassthroughAssetTransformationStrategy.js +14 -0
- package/delivery/AssetDelivery/transformation/PassthroughAssetTransformationStrategy.js.map +1 -0
- package/delivery/AssetDelivery/transformation/TransformationAssetProcessor.d.ts +6 -0
- package/delivery/AssetDelivery/transformation/TransformationAssetProcessor.js +26 -0
- package/delivery/AssetDelivery/transformation/TransformationAssetProcessor.js.map +1 -0
- package/delivery/index.d.ts +17 -0
- package/delivery/index.js +194 -0
- package/delivery/index.js.map +1 -0
- package/delivery/setupAssetDelivery.d.ts +6 -0
- package/delivery/setupAssetDelivery.js +128 -0
- package/delivery/setupAssetDelivery.js.map +1 -0
- package/enterprise/applyThreatScanning.d.ts +2 -0
- package/enterprise/applyThreatScanning.js +20 -0
- package/enterprise/applyThreatScanning.js.map +1 -0
- package/graphql/baseSchema.d.ts +3 -0
- package/graphql/baseSchema.js +121 -0
- package/graphql/baseSchema.js.map +1 -0
- package/graphql/createFilesTypeDefs.d.ts +7 -0
- package/graphql/createFilesTypeDefs.js +184 -0
- package/graphql/createFilesTypeDefs.js.map +1 -0
- package/graphql/filesSchema.d.ts +4 -0
- package/graphql/filesSchema.js +89 -0
- package/graphql/filesSchema.js.map +1 -0
- package/graphql/getFileByUrl.d.ts +3 -0
- package/graphql/getFileByUrl.js +78 -0
- package/graphql/getFileByUrl.js.map +1 -0
- package/graphql/index.d.ts +3 -2
- package/graphql/index.js +45 -267
- package/graphql/index.js.map +1 -1
- package/graphql/utils.d.ts +11 -0
- package/graphql/utils.js +24 -0
- package/graphql/utils.js.map +1 -0
- package/handlers/{transform/managers → manage}/imageManager.d.ts +2 -3
- package/handlers/{transform/managers → manage}/imageManager.js +10 -9
- package/handlers/manage/imageManager.js.map +1 -0
- package/handlers/manage/index.d.ts +1 -1
- package/handlers/manage/index.js +9 -5
- package/handlers/manage/index.js.map +1 -1
- package/handlers/{transform → manage}/legacyUtils.d.ts +0 -5
- package/handlers/{transform → manage}/legacyUtils.js +7 -15
- package/handlers/manage/legacyUtils.js.map +1 -0
- package/handlers/{transform → manage}/utils.js +7 -9
- package/handlers/manage/utils.js.map +1 -0
- package/handlers/types.d.ts +1 -1
- package/handlers/types.js +3 -1
- package/handlers/types.js.map +1 -1
- package/handlers/utils/getEnvironment.js +3 -1
- package/handlers/utils/getEnvironment.js.map +1 -1
- package/handlers/utils/getObjectParams.js +3 -1
- package/handlers/utils/getObjectParams.js.map +1 -1
- package/handlers/utils/index.js +3 -1
- package/handlers/utils/index.js.map +1 -1
- package/index.d.ts +8 -4
- package/index.js +47 -39
- package/index.js.map +1 -1
- package/modelModifier/CmsModelModifier.d.ts +26 -0
- package/modelModifier/CmsModelModifier.js +62 -0
- package/modelModifier/CmsModelModifier.js.map +1 -0
- package/package.json +26 -35
- package/plugins/FilePhysicalStoragePlugin.d.ts +2 -1
- package/plugins/FilePhysicalStoragePlugin.js +3 -3
- package/plugins/FilePhysicalStoragePlugin.js.map +1 -1
- package/plugins/FileStorageTransformPlugin.d.ts +1 -1
- package/plugins/FileStorageTransformPlugin.js +3 -4
- package/plugins/FileStorageTransformPlugin.js.map +1 -1
- package/plugins/index.js +3 -1
- package/plugins/index.js.map +1 -1
- package/storage/FileStorage.d.ts +5 -3
- package/storage/FileStorage.js +20 -16
- package/storage/FileStorage.js.map +1 -1
- package/types/file.d.ts +17 -1
- package/types/file.js +3 -1
- package/types/file.js.map +1 -1
- package/types/file.lifecycle.d.ts +6 -2
- package/types/file.lifecycle.js +3 -1
- package/types/file.lifecycle.js.map +1 -1
- package/types.d.ts +63 -47
- package/types.js +3 -1
- package/types.js.map +1 -1
- package/createFileManager/checkBasePermissions.d.ts +0 -5
- package/createFileManager/checkBasePermissions.js +0 -24
- package/createFileManager/checkBasePermissions.js.map +0 -1
- package/createFileManager/filevalidation.disabled.d.ts +0 -0
- package/createFileManager/filevalidation.disabled.js +0 -55
- package/createFileManager/filevalidation.disabled.js.map +0 -1
- package/handlers/download/byAlias.d.ts +0 -6
- package/handlers/download/byAlias.js +0 -89
- package/handlers/download/byAlias.js.map +0 -1
- package/handlers/download/byExactKey.d.ts +0 -2
- package/handlers/download/byExactKey.js +0 -57
- package/handlers/download/byExactKey.js.map +0 -1
- package/handlers/download/extractFileInformation.d.ts +0 -9
- package/handlers/download/extractFileInformation.js +0 -20
- package/handlers/download/extractFileInformation.js.map +0 -1
- package/handlers/download/getS3Object.d.ts +0 -10
- package/handlers/download/getS3Object.js +0 -57
- package/handlers/download/getS3Object.js.map +0 -1
- package/handlers/download/index.d.ts +0 -2
- package/handlers/download/index.js +0 -27
- package/handlers/download/index.js.map +0 -1
- package/handlers/transform/index.d.ts +0 -2
- package/handlers/transform/index.js +0 -89
- package/handlers/transform/index.js.map +0 -1
- package/handlers/transform/legacyUtils.js.map +0 -1
- package/handlers/transform/loaders/imageLoader.d.ts +0 -30
- package/handlers/transform/loaders/imageLoader.js +0 -94
- package/handlers/transform/loaders/imageLoader.js.map +0 -1
- package/handlers/transform/loaders/index.d.ts +0 -8
- package/handlers/transform/loaders/index.js +0 -10
- package/handlers/transform/loaders/index.js.map +0 -1
- package/handlers/transform/loaders/sanitizeImageTransformations.d.ts +0 -11
- package/handlers/transform/loaders/sanitizeImageTransformations.js +0 -45
- package/handlers/transform/loaders/sanitizeImageTransformations.js.map +0 -1
- package/handlers/transform/managers/imageManager.js.map +0 -1
- package/handlers/transform/managers/index.d.ts +0 -5
- package/handlers/transform/managers/index.js +0 -10
- package/handlers/transform/managers/index.js.map +0 -1
- package/handlers/transform/optimizeImage.d.ts +0 -3
- package/handlers/transform/optimizeImage.js +0 -42
- package/handlers/transform/optimizeImage.js.map +0 -1
- package/handlers/transform/transformImage.d.ts +0 -10
- package/handlers/transform/transformImage.js +0 -25
- package/handlers/transform/transformImage.js.map +0 -1
- package/handlers/transform/utils.js.map +0 -1
- package/plugins/crud/files/validation.d.ts +0 -3
- package/plugins/crud/files/validation.js +0 -41
- package/plugins/crud/files/validation.js.map +0 -1
- package/plugins/crud/files.crud.d.ts +0 -4
- package/plugins/crud/files.crud.js +0 -431
- package/plugins/crud/files.crud.js.map +0 -1
- package/plugins/crud/settings.crud.d.ts +0 -5
- package/plugins/crud/settings.crud.js +0 -116
- package/plugins/crud/settings.crud.js.map +0 -1
- package/plugins/crud/system.crud.d.ts +0 -4
- package/plugins/crud/system.crud.js +0 -153
- package/plugins/crud/system.crud.js.map +0 -1
- package/plugins/crud/utils/checkBasePermissions.d.ts +0 -5
- package/plugins/crud/utils/checkBasePermissions.js +0 -33
- package/plugins/crud/utils/checkBasePermissions.js.map +0 -1
- package/plugins/crud/utils/createFileModel.d.ts +0 -5
- package/plugins/crud/utils/createFileModel.js +0 -77
- package/plugins/crud/utils/createFileModel.js.map +0 -1
- package/plugins/crud/utils/lifecycleEvents.d.ts +0 -6
- package/plugins/crud/utils/lifecycleEvents.js +0 -38
- package/plugins/crud/utils/lifecycleEvents.js.map +0 -1
- package/plugins/definitions/FilePhysicalStoragePlugin.d.ts +0 -21
- package/plugins/definitions/FilePhysicalStoragePlugin.js +0 -42
- package/plugins/definitions/FilePhysicalStoragePlugin.js.map +0 -1
- package/plugins/definitions/FilePlugin.d.ts +0 -136
- package/plugins/definitions/FilePlugin.js +0 -70
- package/plugins/definitions/FilePlugin.js.map +0 -1
- package/plugins/definitions/FileStorageTransformPlugin.d.ts +0 -34
- package/plugins/definitions/FileStorageTransformPlugin.js +0 -51
- package/plugins/definitions/FileStorageTransformPlugin.js.map +0 -1
- package/plugins/definitions/FilesStorageOperationsProviderPlugin.d.ts +0 -9
- package/plugins/definitions/FilesStorageOperationsProviderPlugin.js +0 -17
- package/plugins/definitions/FilesStorageOperationsProviderPlugin.js.map +0 -1
- package/plugins/definitions/InstallationPlugin.d.ts +0 -19
- package/plugins/definitions/InstallationPlugin.js +0 -42
- package/plugins/definitions/InstallationPlugin.js.map +0 -1
- package/plugins/definitions/SettingsStorageOperationsProviderPlugin.d.ts +0 -9
- package/plugins/definitions/SettingsStorageOperationsProviderPlugin.js +0 -17
- package/plugins/definitions/SettingsStorageOperationsProviderPlugin.js.map +0 -1
- package/plugins/definitions/SystemStorageOperationsProviderPlugin.d.ts +0 -9
- package/plugins/definitions/SystemStorageOperationsProviderPlugin.js +0 -17
- package/plugins/definitions/SystemStorageOperationsProviderPlugin.js.map +0 -1
- package/plugins/graphql.d.ts +0 -4
- package/plugins/graphql.js +0 -290
- package/plugins/graphql.js.map +0 -1
- package/plugins/storage/FileStorage.d.ts +0 -30
- package/plugins/storage/FileStorage.js +0 -103
- package/plugins/storage/FileStorage.js.map +0 -1
- package/plugins/storage/index.d.ts +0 -4
- package/plugins/storage/index.js +0 -26
- package/plugins/storage/index.js.map +0 -1
- package/utils.d.ts +0 -4
- package/utils.js +0 -16
- package/utils.js.map +0 -1
- /package/handlers/{transform → manage}/utils.d.ts +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_apiHeadlessCms","require","required","name","message","nameField","createModelField","label","type","validation","keyField","typeField","sizeField","metaWidthField","metaHeightField","metaPrivateField","metaOriginalKeyField","metaField","settings","fields","accessControlTypeField","predefinedValues","enabled","values","value","selected","accessControlField","tags","tagsField","multipleValues","aliasesField","locationField","fieldId","path","FILE_MODEL_ID","exports","createFileModel","params","withPrivateFiles","push","createPrivateModel","modelId","titleFieldId","authorization","permissions"],"sources":["file.model.ts"],"sourcesContent":["import { createPrivateModel, createModelField } from \"@webiny/api-headless-cms\";\n\nconst required = () => {\n return {\n name: \"required\",\n message: \"Value is required.\"\n };\n};\n\nconst nameField = () => {\n return createModelField({\n label: \"Name\",\n type: \"text\",\n validation: [required()]\n });\n};\n\nconst keyField = () => {\n return createModelField({\n label: \"Key\",\n type: \"text\",\n validation: [required()]\n });\n};\n\nconst typeField = () => {\n return createModelField({\n label: \"Type\",\n type: \"text\",\n validation: [required()]\n });\n};\n\nconst sizeField = () => {\n return createModelField({\n label: \"Size\",\n type: \"number\",\n validation: [required()]\n });\n};\n\nconst metaWidthField = () => {\n return createModelField({\n label: \"Width\",\n type: \"number\"\n });\n};\n\nconst metaHeightField = () => {\n return createModelField({\n label: \"Height\",\n type: \"number\"\n });\n};\n\nconst metaPrivateField = () => {\n return createModelField({\n label: \"Private\",\n type: \"boolean\"\n });\n};\n\nconst metaOriginalKeyField = () => {\n return createModelField({\n label: \"Original Key\",\n type: \"text\"\n });\n};\n\nconst metaField = () => {\n return createModelField({\n label: \"Meta\",\n type: \"object\",\n settings: {\n fields: [\n metaPrivateField(),\n metaWidthField(),\n metaHeightField(),\n metaOriginalKeyField()\n ]\n }\n });\n};\n\nconst accessControlTypeField = () => {\n return createModelField({\n label: \"Type\",\n type: \"text\",\n predefinedValues: {\n enabled: true,\n values: [\n {\n label: \"Public\",\n value: \"public\",\n selected: true\n },\n {\n label: \"Private\",\n value: \"private-authenticated\"\n }\n ]\n }\n });\n};\n\nconst accessControlField = () => {\n return createModelField({\n label: \"Access Control\",\n type: \"object\",\n tags: [\"$bulk-edit\"],\n settings: {\n fields: [accessControlTypeField()]\n }\n });\n};\n\nconst tagsField = () => {\n return createModelField({\n label: \"Tags\",\n type: \"text\",\n tags: [\"$bulk-edit\"],\n multipleValues: true,\n validation: [required()]\n });\n};\n\nconst aliasesField = () => {\n return createModelField({\n label: \"Aliases\",\n type: \"text\",\n multipleValues: true,\n validation: [required()]\n });\n};\n\nconst locationField = () => {\n return createModelField({\n type: \"object\",\n label: \"Location\",\n fieldId: \"location\",\n settings: {\n fields: [\n createModelField({\n type: \"text\",\n fieldId: \"folderId\",\n label: \"Folder ID\",\n settings: {\n path: \"location.folderId\"\n }\n })\n ]\n }\n });\n};\n\nexport const FILE_MODEL_ID = \"fmFile\";\n\ninterface CreateFileModelDefinitionParams {\n withPrivateFiles: boolean;\n}\n\nexport const createFileModel = (params: CreateFileModelDefinitionParams) => {\n const fields = [\n locationField(),\n nameField(),\n keyField(),\n typeField(),\n sizeField(),\n metaField(),\n tagsField(),\n aliasesField()\n ];\n\n if (params.withPrivateFiles) {\n fields.push(accessControlField());\n }\n\n return createPrivateModel({\n name: \"FmFile\",\n modelId: FILE_MODEL_ID,\n titleFieldId: \"name\",\n authorization: {\n // Disables base permission checks, but leaves FLP checks enabled.\n permissions: false\n\n // We're leaving FLP enabled (no need to set `flp: true`).\n // flp: true\n },\n fields\n });\n};\n"],"mappings":";;;;;;AAAA,IAAAA,eAAA,GAAAC,OAAA;AAEA,MAAMC,QAAQ,GAAGA,CAAA,KAAM;EACnB,OAAO;IACHC,IAAI,EAAE,UAAU;IAChBC,OAAO,EAAE;EACb,CAAC;AACL,CAAC;AAED,MAAMC,SAAS,GAAGA,CAAA,KAAM;EACpB,OAAO,IAAAC,gCAAgB,EAAC;IACpBC,KAAK,EAAE,MAAM;IACbC,IAAI,EAAE,MAAM;IACZC,UAAU,EAAE,CAACP,QAAQ,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A,eAAA","ignoreList":[]}
|
package/contants.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ROOT_FOLDER = "root";
|
package/contants.js
ADDED
package/contants.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["ROOT_FOLDER","exports"],"sources":["contants.ts"],"sourcesContent":["export const ROOT_FOLDER = \"root\";\n"],"mappings":";;;;;;AAAO,MAAMA,WAAW,GAAAC,OAAA,CAAAD,WAAA,GAAG,MAAM","ignoreList":[]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { FilesCRUD } from "../types";
|
|
2
|
-
import { FileManagerConfig } from "./
|
|
3
|
-
export declare const createFilesCrud: (config: FileManagerConfig) => FilesCRUD;
|
|
1
|
+
import type { FilesCRUD } from "../types";
|
|
2
|
+
import type { FileManagerConfig } from "./types";
|
|
3
|
+
export declare const createFilesCrud: (config: Pick<FileManagerConfig, "storageOperations" | "filesPermissions" | "getLocaleCode" | "getTenantId" | "getIdentity" | "WEBINY_VERSION">) => FilesCRUD;
|
|
@@ -5,29 +5,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.createFilesCrud = void 0;
|
|
8
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
9
8
|
var _handlerGraphql = require("@webiny/handler-graphql");
|
|
10
|
-
var _apiSecurity = require("@webiny/api-security");
|
|
11
9
|
var _pubsub = require("@webiny/pubsub");
|
|
12
10
|
var _error = _interopRequireDefault(require("@webiny/error"));
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const checkOwnership = (file, permission, identity) => {
|
|
18
|
-
if ((permission === null || permission === void 0 ? void 0 : permission.own) === true) {
|
|
19
|
-
if (file.createdBy.id !== identity.id) {
|
|
20
|
-
throw new _apiSecurity.NotAuthorizedError();
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
};
|
|
11
|
+
var _contants = require("../contants");
|
|
12
|
+
var _apiSecurity = require("@webiny/api-security");
|
|
13
|
+
var _date = require("@webiny/api-headless-cms/utils/date");
|
|
14
|
+
var _identity = require("@webiny/api-headless-cms/utils/identity");
|
|
24
15
|
const createFilesCrud = config => {
|
|
25
16
|
const {
|
|
26
17
|
storageOperations,
|
|
18
|
+
filesPermissions,
|
|
27
19
|
getLocaleCode,
|
|
28
20
|
getTenantId,
|
|
29
21
|
getIdentity,
|
|
30
|
-
getPermission,
|
|
31
22
|
WEBINY_VERSION
|
|
32
23
|
} = config;
|
|
33
24
|
return {
|
|
@@ -40,7 +31,7 @@ const createFilesCrud = config => {
|
|
|
40
31
|
onFileBeforeDelete: (0, _pubsub.createTopic)("fileManager.onFileBeforeDelete"),
|
|
41
32
|
onFileAfterDelete: (0, _pubsub.createTopic)("fileManager.onFileAfterDelete"),
|
|
42
33
|
async getFile(id) {
|
|
43
|
-
|
|
34
|
+
await filesPermissions.ensure({
|
|
44
35
|
rwd: "r"
|
|
45
36
|
});
|
|
46
37
|
const file = await storageOperations.files.get({
|
|
@@ -53,53 +44,68 @@ const createFilesCrud = config => {
|
|
|
53
44
|
if (!file) {
|
|
54
45
|
throw new _handlerGraphql.NotFoundError(`File with id "${id}" does not exists.`);
|
|
55
46
|
}
|
|
56
|
-
|
|
47
|
+
await filesPermissions.ensure({
|
|
48
|
+
owns: file.createdBy
|
|
49
|
+
});
|
|
57
50
|
return file;
|
|
58
51
|
},
|
|
59
|
-
async createFile(input) {
|
|
60
|
-
await
|
|
52
|
+
async createFile(input, meta) {
|
|
53
|
+
await filesPermissions.ensure({
|
|
61
54
|
rwd: "w"
|
|
62
55
|
});
|
|
63
|
-
const identity = getIdentity();
|
|
64
56
|
|
|
65
57
|
// Extract ID from file key
|
|
66
58
|
const [id] = input.key.split("/");
|
|
67
|
-
const
|
|
59
|
+
const currentDateTime = new Date();
|
|
60
|
+
const currentIdentity = getIdentity();
|
|
61
|
+
const file = {
|
|
62
|
+
...input,
|
|
68
63
|
tags: Array.isArray(input.tags) ? input.tags : [],
|
|
69
64
|
aliases: Array.isArray(input.aliases) ? input.aliases : [],
|
|
70
65
|
id: input.id || id,
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
},
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
id: identity.id,
|
|
78
|
-
displayName: identity.displayName,
|
|
79
|
-
type: identity.type
|
|
66
|
+
location: {
|
|
67
|
+
folderId: input.location?.folderId ?? _contants.ROOT_FOLDER
|
|
68
|
+
},
|
|
69
|
+
meta: {
|
|
70
|
+
private: false,
|
|
71
|
+
...(input.meta || {})
|
|
80
72
|
},
|
|
73
|
+
createdOn: (0, _date.getDate)(input.createdOn, currentDateTime),
|
|
74
|
+
modifiedOn: (0, _date.getDate)(input.modifiedOn, null),
|
|
75
|
+
savedOn: (0, _date.getDate)(input.savedOn, currentDateTime),
|
|
76
|
+
createdBy: (0, _identity.getIdentity)(input.createdBy, currentIdentity),
|
|
77
|
+
modifiedBy: (0, _identity.getIdentity)(input.modifiedBy, null),
|
|
78
|
+
savedBy: (0, _identity.getIdentity)(input.savedBy, currentIdentity),
|
|
79
|
+
tenant: getTenantId(),
|
|
81
80
|
locale: getLocaleCode(),
|
|
82
81
|
webinyVersion: WEBINY_VERSION
|
|
83
|
-
}
|
|
82
|
+
};
|
|
84
83
|
try {
|
|
85
84
|
await this.onFileBeforeCreate.publish({
|
|
86
|
-
file
|
|
85
|
+
file,
|
|
86
|
+
meta
|
|
87
87
|
});
|
|
88
88
|
const result = await storageOperations.files.create({
|
|
89
89
|
file
|
|
90
90
|
});
|
|
91
91
|
await this.onFileAfterCreate.publish({
|
|
92
|
-
file
|
|
92
|
+
file,
|
|
93
|
+
meta
|
|
93
94
|
});
|
|
94
95
|
return result;
|
|
95
96
|
} catch (ex) {
|
|
96
|
-
|
|
97
|
+
// If a `NotAuthorizedError` error was thrown, then we just want to rethrow it.
|
|
98
|
+
if (ex instanceof _apiSecurity.NotAuthorizedError) {
|
|
99
|
+
throw ex;
|
|
100
|
+
}
|
|
101
|
+
throw new _error.default(ex.message || "Could not create a file.", ex.code || "CREATE_FILE_ERROR", {
|
|
102
|
+
...(ex.data || {}),
|
|
97
103
|
file
|
|
98
|
-
})
|
|
104
|
+
});
|
|
99
105
|
}
|
|
100
106
|
},
|
|
101
107
|
async updateFile(id, input) {
|
|
102
|
-
|
|
108
|
+
await filesPermissions.ensure({
|
|
103
109
|
rwd: "w"
|
|
104
110
|
});
|
|
105
111
|
const original = await storageOperations.files.get({
|
|
@@ -112,13 +118,25 @@ const createFilesCrud = config => {
|
|
|
112
118
|
if (!original) {
|
|
113
119
|
throw new _handlerGraphql.NotFoundError(`File with id "${id}" does not exists.`);
|
|
114
120
|
}
|
|
115
|
-
|
|
116
|
-
|
|
121
|
+
await filesPermissions.ensure({
|
|
122
|
+
owns: original.createdBy
|
|
123
|
+
});
|
|
124
|
+
const currentDateTime = new Date();
|
|
125
|
+
const currentIdentity = getIdentity();
|
|
126
|
+
const file = {
|
|
127
|
+
...original,
|
|
128
|
+
...input,
|
|
129
|
+
createdOn: (0, _date.getDate)(input.createdOn, original.createdOn),
|
|
130
|
+
modifiedOn: (0, _date.getDate)(input.modifiedOn, currentDateTime),
|
|
131
|
+
savedOn: (0, _date.getDate)(input.savedOn, currentDateTime),
|
|
132
|
+
createdBy: (0, _identity.getIdentity)(input.createdBy, original.createdBy),
|
|
133
|
+
modifiedBy: (0, _identity.getIdentity)(input.modifiedBy, currentIdentity),
|
|
134
|
+
savedBy: (0, _identity.getIdentity)(input.savedBy, currentIdentity),
|
|
117
135
|
tags: Array.isArray(input.tags) ? input.tags : Array.isArray(original.tags) ? original.tags : [],
|
|
118
136
|
aliases: Array.isArray(input.aliases) ? input.aliases : Array.isArray(original.aliases) ? original.aliases : [],
|
|
119
137
|
id: original.id,
|
|
120
138
|
webinyVersion: WEBINY_VERSION
|
|
121
|
-
}
|
|
139
|
+
};
|
|
122
140
|
try {
|
|
123
141
|
await this.onFileBeforeUpdate.publish({
|
|
124
142
|
original,
|
|
@@ -136,14 +154,15 @@ const createFilesCrud = config => {
|
|
|
136
154
|
});
|
|
137
155
|
return result;
|
|
138
156
|
} catch (ex) {
|
|
139
|
-
throw new _error.default(ex.message || "Could not update a file.", ex.code || "UPDATE_FILE_ERROR",
|
|
157
|
+
throw new _error.default(ex.message || "Could not update a file.", ex.code || "UPDATE_FILE_ERROR", {
|
|
158
|
+
...(ex.data || {}),
|
|
140
159
|
original,
|
|
141
160
|
file
|
|
142
|
-
})
|
|
161
|
+
});
|
|
143
162
|
}
|
|
144
163
|
},
|
|
145
164
|
async deleteFile(id) {
|
|
146
|
-
|
|
165
|
+
await filesPermissions.ensure({
|
|
147
166
|
rwd: "d"
|
|
148
167
|
});
|
|
149
168
|
const file = await storageOperations.files.get({
|
|
@@ -156,7 +175,9 @@ const createFilesCrud = config => {
|
|
|
156
175
|
if (!file) {
|
|
157
176
|
throw new _handlerGraphql.NotFoundError(`File with id "${id}" does not exists.`);
|
|
158
177
|
}
|
|
159
|
-
|
|
178
|
+
await filesPermissions.ensure({
|
|
179
|
+
owns: file.createdBy
|
|
180
|
+
});
|
|
160
181
|
try {
|
|
161
182
|
await this.onFileBeforeDelete.publish({
|
|
162
183
|
file
|
|
@@ -168,126 +189,111 @@ const createFilesCrud = config => {
|
|
|
168
189
|
file
|
|
169
190
|
});
|
|
170
191
|
} catch (ex) {
|
|
171
|
-
throw new _error.default(ex.message || "Could not delete a file.", ex.code || "DELETE_FILE_ERROR",
|
|
192
|
+
throw new _error.default(ex.message || "Could not delete a file.", ex.code || "DELETE_FILE_ERROR", {
|
|
193
|
+
...(ex.data || {}),
|
|
172
194
|
id,
|
|
173
195
|
file
|
|
174
|
-
})
|
|
196
|
+
});
|
|
175
197
|
}
|
|
176
198
|
return true;
|
|
177
199
|
},
|
|
178
|
-
async createFilesInBatch(inputs) {
|
|
179
|
-
await
|
|
200
|
+
async createFilesInBatch(inputs, meta) {
|
|
201
|
+
await filesPermissions.ensure({
|
|
180
202
|
rwd: "w"
|
|
181
203
|
});
|
|
182
|
-
const identity = getIdentity();
|
|
183
204
|
const tenant = getTenantId();
|
|
184
205
|
const locale = getLocaleCode();
|
|
185
|
-
const
|
|
186
|
-
|
|
187
|
-
displayName: identity.displayName,
|
|
188
|
-
type: identity.type
|
|
189
|
-
};
|
|
206
|
+
const currentIdentity = getIdentity();
|
|
207
|
+
const currentDateTime = new Date();
|
|
190
208
|
const files = inputs.map(input => {
|
|
191
|
-
return
|
|
209
|
+
return {
|
|
210
|
+
...input,
|
|
192
211
|
tags: Array.isArray(input.tags) ? input.tags : [],
|
|
193
212
|
aliases: Array.isArray(input.aliases) ? input.aliases : [],
|
|
194
|
-
meta:
|
|
195
|
-
private: false
|
|
196
|
-
|
|
213
|
+
meta: {
|
|
214
|
+
private: false,
|
|
215
|
+
...(input.meta || {})
|
|
216
|
+
},
|
|
217
|
+
location: {
|
|
218
|
+
folderId: input.location?.folderId ?? _contants.ROOT_FOLDER
|
|
219
|
+
},
|
|
220
|
+
createdOn: (0, _date.getDate)(currentDateTime),
|
|
221
|
+
modifiedOn: null,
|
|
222
|
+
savedOn: (0, _date.getDate)(currentDateTime),
|
|
223
|
+
createdBy: (0, _identity.getIdentity)(currentIdentity),
|
|
224
|
+
modifiedBy: null,
|
|
225
|
+
savedBy: (0, _identity.getIdentity)(currentIdentity),
|
|
197
226
|
tenant,
|
|
198
|
-
createdOn: new Date().toISOString(),
|
|
199
|
-
createdBy,
|
|
200
227
|
locale,
|
|
201
228
|
webinyVersion: WEBINY_VERSION
|
|
202
|
-
}
|
|
229
|
+
};
|
|
203
230
|
});
|
|
204
231
|
try {
|
|
205
232
|
await this.onFileBeforeBatchCreate.publish({
|
|
206
|
-
files
|
|
233
|
+
files,
|
|
234
|
+
meta
|
|
207
235
|
});
|
|
208
236
|
const results = await storageOperations.files.createBatch({
|
|
209
237
|
files
|
|
210
238
|
});
|
|
211
239
|
await this.onFileAfterBatchCreate.publish({
|
|
212
|
-
files
|
|
240
|
+
files,
|
|
241
|
+
meta
|
|
213
242
|
});
|
|
214
243
|
return results;
|
|
215
244
|
} catch (ex) {
|
|
216
|
-
throw new _error.default(ex.message || "Could not create a batch of files.", ex.code || "CREATE_FILES_ERROR",
|
|
245
|
+
throw new _error.default(ex.message || "Could not create a batch of files.", ex.code || "CREATE_FILES_ERROR", {
|
|
246
|
+
...(ex.data || {}),
|
|
217
247
|
files
|
|
218
|
-
})
|
|
248
|
+
});
|
|
219
249
|
}
|
|
220
250
|
},
|
|
221
251
|
async listFiles(params = {}) {
|
|
222
|
-
|
|
252
|
+
await filesPermissions.ensure({
|
|
223
253
|
rwd: "r"
|
|
224
254
|
});
|
|
225
255
|
const {
|
|
226
256
|
limit = 40,
|
|
227
|
-
search = "",
|
|
228
|
-
types = [],
|
|
229
|
-
tags = [],
|
|
230
|
-
ids = [],
|
|
231
257
|
after = null,
|
|
232
258
|
where: initialWhere,
|
|
233
|
-
sort: initialSort
|
|
259
|
+
sort: initialSort,
|
|
260
|
+
search
|
|
234
261
|
} = params;
|
|
235
|
-
const where =
|
|
236
|
-
|
|
262
|
+
const where = {
|
|
263
|
+
...{
|
|
264
|
+
meta: {
|
|
265
|
+
private_not: true
|
|
266
|
+
},
|
|
267
|
+
...initialWhere
|
|
268
|
+
},
|
|
237
269
|
locale: getLocaleCode(),
|
|
238
270
|
tenant: getTenantId()
|
|
239
|
-
}
|
|
271
|
+
};
|
|
272
|
+
|
|
240
273
|
/**
|
|
241
274
|
* Always override the createdBy received from the user, if any.
|
|
242
275
|
*/
|
|
243
|
-
if (
|
|
276
|
+
if (await filesPermissions.canAccessOnlyOwnRecords()) {
|
|
244
277
|
const identity = getIdentity();
|
|
245
278
|
where.createdBy = identity.id;
|
|
246
279
|
}
|
|
247
|
-
/**
|
|
248
|
-
* We need to map the old GraphQL definition to the new one.
|
|
249
|
-
* That GQL definition is marked as deprecated.
|
|
250
|
-
*/
|
|
251
|
-
/**
|
|
252
|
-
* To have standardized where objects across the applications, we transform the types into type_in.
|
|
253
|
-
*/
|
|
254
|
-
if (Array.isArray(types) && types.length > 0 && !where.type_in) {
|
|
255
|
-
where.type_in = types;
|
|
256
|
-
}
|
|
257
|
-
/**
|
|
258
|
-
* We are assigning search to tag and name search.
|
|
259
|
-
* This should be treated as OR condition in the storage operations.
|
|
260
|
-
*/
|
|
261
|
-
if (search && !where.search) {
|
|
262
|
-
where.search = search;
|
|
263
|
-
}
|
|
264
|
-
/**
|
|
265
|
-
* Same as on types/type_in.
|
|
266
|
-
*/
|
|
267
|
-
if (Array.isArray(tags) && tags.length > 0 && !where.tag_in) {
|
|
268
|
-
where.tag_in = tags.map(tag => tag.toLowerCase());
|
|
269
|
-
}
|
|
270
|
-
/**
|
|
271
|
-
* Same as on types/type_in.
|
|
272
|
-
*/
|
|
273
|
-
if (Array.isArray(ids) && ids.length > 0 && !where.id_in) {
|
|
274
|
-
where.id_in = ids;
|
|
275
|
-
}
|
|
276
280
|
const sort = Array.isArray(initialSort) && initialSort.length > 0 ? initialSort : ["id_DESC"];
|
|
277
281
|
try {
|
|
278
282
|
return await storageOperations.files.list({
|
|
279
283
|
where,
|
|
280
284
|
after,
|
|
281
285
|
limit,
|
|
282
|
-
sort
|
|
286
|
+
sort,
|
|
287
|
+
search
|
|
283
288
|
});
|
|
284
289
|
} catch (ex) {
|
|
285
|
-
throw new _error.default(ex.message || "Could not list files by given parameters.", ex.code || "FILE_TAG_SEARCH_ERROR",
|
|
290
|
+
throw new _error.default(ex.message || "Could not list files by given parameters.", ex.code || "FILE_TAG_SEARCH_ERROR", {
|
|
291
|
+
...(ex.data || {}),
|
|
286
292
|
where,
|
|
287
293
|
after,
|
|
288
294
|
limit,
|
|
289
295
|
sort
|
|
290
|
-
})
|
|
296
|
+
});
|
|
291
297
|
}
|
|
292
298
|
},
|
|
293
299
|
async listTags({
|
|
@@ -295,31 +301,28 @@ const createFilesCrud = config => {
|
|
|
295
301
|
after,
|
|
296
302
|
limit
|
|
297
303
|
}) {
|
|
298
|
-
await
|
|
299
|
-
const where =
|
|
304
|
+
await filesPermissions.ensure();
|
|
305
|
+
const where = {
|
|
306
|
+
...initialWhere,
|
|
300
307
|
tenant: getTenantId(),
|
|
301
308
|
locale: getLocaleCode()
|
|
302
|
-
}
|
|
309
|
+
};
|
|
303
310
|
const params = {
|
|
304
311
|
where,
|
|
305
|
-
limit: limit ||
|
|
312
|
+
limit: limit || 1000000,
|
|
306
313
|
after
|
|
307
314
|
};
|
|
308
315
|
try {
|
|
309
|
-
|
|
310
|
-
if (Array.isArray(tags) === false) {
|
|
311
|
-
return [];
|
|
312
|
-
}
|
|
313
|
-
/**
|
|
314
|
-
* just to keep it standardized, sort by the tag ASC
|
|
315
|
-
*/
|
|
316
|
-
return tags.sort();
|
|
316
|
+
return await storageOperations.files.tags(params);
|
|
317
317
|
} catch (ex) {
|
|
318
|
-
throw new _error.default(ex.message || "Could not search for tags.", ex.code || "FILE_TAG_SEARCH_ERROR",
|
|
318
|
+
throw new _error.default(ex.message || "Could not search for tags.", ex.code || "FILE_TAG_SEARCH_ERROR", {
|
|
319
|
+
...(ex.data || {}),
|
|
319
320
|
params
|
|
320
|
-
})
|
|
321
|
+
});
|
|
321
322
|
}
|
|
322
323
|
}
|
|
323
324
|
};
|
|
324
325
|
};
|
|
325
|
-
exports.createFilesCrud = createFilesCrud;
|
|
326
|
+
exports.createFilesCrud = createFilesCrud;
|
|
327
|
+
|
|
328
|
+
//# sourceMappingURL=files.crud.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["checkOwnership","file","permission","identity","own","createdBy","id","NotAuthorizedError","createFilesCrud","config","storageOperations","getLocaleCode","getTenantId","getIdentity","getPermission","WEBINY_VERSION","onFileBeforeCreate","createTopic","onFileAfterCreate","onFileBeforeBatchCreate","onFileAfterBatchCreate","onFileBeforeUpdate","onFileAfterUpdate","onFileBeforeDelete","onFileAfterDelete","getFile","checkBasePermissions","rwd","files","get","where","tenant","locale","NotFoundError","createFile","input","key","split","tags","Array","isArray","aliases","meta","private","createdOn","Date","toISOString","displayName","type","webinyVersion","publish","result","create","ex","WebinyError","message","code","data","updateFile","original","update","deleteFile","delete","createFilesInBatch","inputs","map","results","createBatch","listFiles","params","limit","search","types","ids","after","initialWhere","sort","initialSort","length","type_in","tag_in","tag","toLowerCase","id_in","list","listTags"],"sources":["files.crud.ts"],"sourcesContent":["import { NotFoundError } from \"@webiny/handler-graphql\";\nimport { NotAuthorizedError } from \"@webiny/api-security\";\nimport { createTopic } from \"@webiny/pubsub\";\nimport WebinyError from \"@webiny/error\";\nimport { SecurityIdentity } from \"@webiny/api-security/types\";\nimport {\n CreatedBy,\n File,\n FileManagerFilesStorageOperationsListParamsWhere,\n FileManagerFilesStorageOperationsTagsParamsWhere,\n FilePermission,\n FilesCRUD,\n FilesListOpts\n} from \"~/types\";\nimport { checkBasePermissions } from \"./checkBasePermissions\";\nimport { FileManagerConfig } from \"~/createFileManager/index\";\n\n/**\n * If permission is limited to \"own\" files only, check that current identity owns the file.\n */\nconst checkOwnership = (file: File, permission: FilePermission, identity: SecurityIdentity) => {\n if (permission?.own === true) {\n if (file.createdBy.id !== identity.id) {\n throw new NotAuthorizedError();\n }\n }\n};\n\nexport const createFilesCrud = (config: FileManagerConfig): FilesCRUD => {\n const {\n storageOperations,\n getLocaleCode,\n getTenantId,\n getIdentity,\n getPermission,\n WEBINY_VERSION\n } = config;\n\n return {\n onFileBeforeCreate: createTopic(\"fileManager.onFileBeforeCreate\"),\n onFileAfterCreate: createTopic(\"fileManager.onFileAfterCreate\"),\n onFileBeforeBatchCreate: createTopic(\"fileManager.onFileBeforeBatchCreate\"),\n onFileAfterBatchCreate: createTopic(\"fileManager.onFileAfterBatchCreate\"),\n onFileBeforeUpdate: createTopic(\"fileManager.onFileBeforeUpdate\"),\n onFileAfterUpdate: createTopic(\"fileManager.onFileAfterUpdate\"),\n onFileBeforeDelete: createTopic(\"fileManager.onFileBeforeDelete\"),\n onFileAfterDelete: createTopic(\"fileManager.onFileAfterDelete\"),\n async getFile(id: string) {\n const permission = await checkBasePermissions(getPermission, { rwd: \"r\" });\n\n const file = await storageOperations.files.get({\n where: {\n id,\n tenant: getTenantId(),\n locale: getLocaleCode()\n }\n });\n\n if (!file) {\n throw new NotFoundError(`File with id \"${id}\" does not exists.`);\n }\n\n checkOwnership(file, permission, getIdentity());\n\n return file;\n },\n async createFile(input) {\n await checkBasePermissions(getPermission, { rwd: \"w\" });\n const identity = getIdentity();\n\n // Extract ID from file key\n const [id] = input.key.split(\"/\");\n\n const file: File = {\n ...input,\n tags: Array.isArray(input.tags) ? input.tags : [],\n aliases: Array.isArray(input.aliases) ? input.aliases : [],\n id: input.id || id,\n meta: {\n private: false,\n ...(input.meta || {})\n },\n tenant: getTenantId(),\n createdOn: new Date().toISOString(),\n createdBy: {\n id: identity.id,\n displayName: identity.displayName,\n type: identity.type\n },\n locale: getLocaleCode(),\n webinyVersion: WEBINY_VERSION\n };\n\n try {\n await this.onFileBeforeCreate.publish({ file });\n\n const result = await storageOperations.files.create({ file });\n\n await this.onFileAfterCreate.publish({ file });\n return result;\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not create a file.\",\n ex.code || \"CREATE_FILE_ERROR\",\n {\n ...(ex.data || {}),\n file\n }\n );\n }\n },\n async updateFile(id, input) {\n const permission = await checkBasePermissions(getPermission, { rwd: \"w\" });\n\n const original = await storageOperations.files.get({\n where: {\n id,\n tenant: getTenantId(),\n locale: getLocaleCode()\n }\n });\n\n if (!original) {\n throw new NotFoundError(`File with id \"${id}\" does not exists.`);\n }\n\n checkOwnership(original, permission, getIdentity());\n\n const file: File = {\n ...original,\n ...input,\n tags: Array.isArray(input.tags)\n ? input.tags\n : Array.isArray(original.tags)\n ? original.tags\n : [],\n aliases: Array.isArray(input.aliases)\n ? input.aliases\n : Array.isArray(original.aliases)\n ? original.aliases\n : [],\n id: original.id,\n webinyVersion: WEBINY_VERSION\n };\n\n try {\n await this.onFileBeforeUpdate.publish({\n original,\n file,\n input\n });\n\n const result = await storageOperations.files.update({\n original,\n file\n });\n\n await this.onFileAfterUpdate.publish({\n original,\n file,\n input\n });\n return result;\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not update a file.\",\n ex.code || \"UPDATE_FILE_ERROR\",\n {\n ...(ex.data || {}),\n original,\n file\n }\n );\n }\n },\n async deleteFile(id) {\n const permission = await checkBasePermissions(getPermission, { rwd: \"d\" });\n\n const file = await storageOperations.files.get({\n where: {\n id,\n tenant: getTenantId(),\n locale: getLocaleCode()\n }\n });\n\n if (!file) {\n throw new NotFoundError(`File with id \"${id}\" does not exists.`);\n }\n\n checkOwnership(file, permission, getIdentity());\n\n try {\n await this.onFileBeforeDelete.publish({ file });\n\n await storageOperations.files.delete({\n file\n });\n\n await this.onFileAfterDelete.publish({ file });\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not delete a file.\",\n ex.code || \"DELETE_FILE_ERROR\",\n {\n ...(ex.data || {}),\n id,\n file\n }\n );\n }\n\n return true;\n },\n async createFilesInBatch(inputs) {\n await checkBasePermissions(getPermission, { rwd: \"w\" });\n\n const identity = getIdentity();\n const tenant = getTenantId();\n const locale = getLocaleCode();\n\n const createdBy: CreatedBy = {\n id: identity.id,\n displayName: identity.displayName,\n type: identity.type\n };\n\n const files: File[] = inputs.map(input => {\n return {\n ...input,\n tags: Array.isArray(input.tags) ? input.tags : [],\n aliases: Array.isArray(input.aliases) ? input.aliases : [],\n meta: {\n private: false,\n ...(input.meta || {})\n },\n tenant,\n createdOn: new Date().toISOString(),\n createdBy,\n locale,\n webinyVersion: WEBINY_VERSION\n };\n });\n\n try {\n await this.onFileBeforeBatchCreate.publish({ files });\n const results = await storageOperations.files.createBatch({\n files\n });\n await this.onFileAfterBatchCreate.publish({ files });\n return results;\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not create a batch of files.\",\n ex.code || \"CREATE_FILES_ERROR\",\n {\n ...(ex.data || {}),\n files\n }\n );\n }\n },\n async listFiles(params: FilesListOpts = {}) {\n const permission = await checkBasePermissions(getPermission, { rwd: \"r\" });\n\n const {\n limit = 40,\n search = \"\",\n types = [],\n tags = [],\n ids = [],\n after = null,\n where: initialWhere,\n sort: initialSort\n } = params;\n\n const where: FileManagerFilesStorageOperationsListParamsWhere = {\n ...initialWhere,\n private: false,\n locale: getLocaleCode(),\n tenant: getTenantId()\n };\n /**\n * Always override the createdBy received from the user, if any.\n */\n if (permission.own === true) {\n const identity = getIdentity();\n where.createdBy = identity.id;\n }\n /**\n * We need to map the old GraphQL definition to the new one.\n * That GQL definition is marked as deprecated.\n */\n /**\n * To have standardized where objects across the applications, we transform the types into type_in.\n */\n if (Array.isArray(types) && types.length > 0 && !where.type_in) {\n where.type_in = types;\n }\n /**\n * We are assigning search to tag and name search.\n * This should be treated as OR condition in the storage operations.\n */\n if (search && !where.search) {\n where.search = search;\n }\n /**\n * Same as on types/type_in.\n */\n if (Array.isArray(tags) && tags.length > 0 && !where.tag_in) {\n where.tag_in = tags.map(tag => tag.toLowerCase());\n }\n /**\n * Same as on types/type_in.\n */\n if (Array.isArray(ids) && ids.length > 0 && !where.id_in) {\n where.id_in = ids;\n }\n\n const sort =\n Array.isArray(initialSort) && initialSort.length > 0 ? initialSort : [\"id_DESC\"];\n try {\n return await storageOperations.files.list({\n where,\n after,\n limit,\n sort\n });\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not list files by given parameters.\",\n ex.code || \"FILE_TAG_SEARCH_ERROR\",\n {\n ...(ex.data || {}),\n where,\n after,\n limit,\n sort\n }\n );\n }\n },\n async listTags({ where: initialWhere, after, limit }) {\n await checkBasePermissions(getPermission);\n\n const where: FileManagerFilesStorageOperationsTagsParamsWhere = {\n ...initialWhere,\n tenant: getTenantId(),\n locale: getLocaleCode()\n };\n\n const params = {\n where,\n limit: limit || 100000,\n after\n };\n\n try {\n const [tags] = await storageOperations.files.tags(params);\n if (Array.isArray(tags) === false) {\n return [];\n }\n /**\n * just to keep it standardized, sort by the tag ASC\n */\n return tags.sort();\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not search for tags.\",\n ex.code || \"FILE_TAG_SEARCH_ERROR\",\n {\n ...(ex.data || {}),\n params\n }\n );\n }\n }\n };\n};\n"],"mappings":";;;;;;;;AAAA;AACA;AACA;AACA;AAWA;AAGA;AACA;AACA;AACA,MAAMA,cAAc,GAAG,CAACC,IAAU,EAAEC,UAA0B,EAAEC,QAA0B,KAAK;EAC3F,IAAI,CAAAD,UAAU,aAAVA,UAAU,uBAAVA,UAAU,CAAEE,GAAG,MAAK,IAAI,EAAE;IAC1B,IAAIH,IAAI,CAACI,SAAS,CAACC,EAAE,KAAKH,QAAQ,CAACG,EAAE,EAAE;MACnC,MAAM,IAAIC,+BAAkB,EAAE;IAClC;EACJ;AACJ,CAAC;AAEM,MAAMC,eAAe,GAAIC,MAAyB,IAAgB;EACrE,MAAM;IACFC,iBAAiB;IACjBC,aAAa;IACbC,WAAW;IACXC,WAAW;IACXC,aAAa;IACbC;EACJ,CAAC,GAAGN,MAAM;EAEV,OAAO;IACHO,kBAAkB,EAAE,IAAAC,mBAAW,EAAC,gCAAgC,CAAC;IACjEC,iBAAiB,EAAE,IAAAD,mBAAW,EAAC,+BAA+B,CAAC;IAC/DE,uBAAuB,EAAE,IAAAF,mBAAW,EAAC,qCAAqC,CAAC;IAC3EG,sBAAsB,EAAE,IAAAH,mBAAW,EAAC,oCAAoC,CAAC;IACzEI,kBAAkB,EAAE,IAAAJ,mBAAW,EAAC,gCAAgC,CAAC;IACjEK,iBAAiB,EAAE,IAAAL,mBAAW,EAAC,+BAA+B,CAAC;IAC/DM,kBAAkB,EAAE,IAAAN,mBAAW,EAAC,gCAAgC,CAAC;IACjEO,iBAAiB,EAAE,IAAAP,mBAAW,EAAC,+BAA+B,CAAC;IAC/D,MAAMQ,OAAO,CAACnB,EAAU,EAAE;MACtB,MAAMJ,UAAU,GAAG,MAAM,IAAAwB,0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AAI,EAAE;MACtB,CAAC,CAAC,OAAOvB,EAAE,EAAE;QACT,MAAM,IAAIC,cAAW,CACjBD,EAAE,CAACE,OAAO,IAAI,4BAA4B,EAC1CF,EAAE,CAACG,IAAI,IAAI,uBAAuB,8DAE1BH,EAAE,CAACI,IAAI,IAAI,CAAC,CAAC;UACjBY;QAAM,GAEb;MACL;IACJ;EACJ,CAAC;AACL,CAAC;AAAC"}
|
|
1
|
+
{"version":3,"names":["_handlerGraphql","require","_pubsub","_error","_interopRequireDefault","_contants","_apiSecurity","_date","_identity","createFilesCrud","config","storageOperations","filesPermissions","getLocaleCode","getTenantId","getIdentity","WEBINY_VERSION","onFileBeforeCreate","createTopic","onFileAfterCreate","onFileBeforeBatchCreate","onFileAfterBatchCreate","onFileBeforeUpdate","onFileAfterUpdate","onFileBeforeDelete","onFileAfterDelete","getFile","id","ensure","rwd","file","files","get","where","tenant","locale","NotFoundError","owns","createdBy","createFile","input","meta","key","split","currentDateTime","Date","currentIdentity","tags","Array","isArray","aliases","location","folderId","ROOT_FOLDER","private","createdOn","getDate","modifiedOn","savedOn","utilsGetIdentity","modifiedBy","savedBy","webinyVersion","publish","result","create","ex","NotAuthorizedError","WebinyError","message","code","data","updateFile","original","update","deleteFile","delete","createFilesInBatch","inputs","map","results","createBatch","listFiles","params","limit","after","initialWhere","sort","initialSort","search","private_not","canAccessOnlyOwnRecords","identity","length","list","listTags","exports"],"sources":["files.crud.ts"],"sourcesContent":["import { NotFoundError } from \"@webiny/handler-graphql\";\nimport { createTopic } from \"@webiny/pubsub\";\nimport WebinyError from \"@webiny/error\";\nimport type {\n File,\n FileManagerFilesStorageOperationsListParamsWhere,\n FileManagerFilesStorageOperationsTagsParamsWhere,\n FilesCRUD,\n FilesListOpts\n} from \"~/types\";\nimport type { FileManagerConfig } from \"~/createFileManager/types\";\nimport { ROOT_FOLDER } from \"~/contants\";\nimport { NotAuthorizedError } from \"@webiny/api-security\";\nimport { getDate } from \"@webiny/api-headless-cms/utils/date\";\nimport { getIdentity as utilsGetIdentity } from \"@webiny/api-headless-cms/utils/identity\";\nimport type { CmsEntryListSort } from \"@webiny/api-headless-cms/types\";\n\nexport const createFilesCrud = (\n config: Pick<\n FileManagerConfig,\n | \"storageOperations\"\n | \"filesPermissions\"\n | \"getLocaleCode\"\n | \"getTenantId\"\n | \"getIdentity\"\n | \"WEBINY_VERSION\"\n >\n): FilesCRUD => {\n const {\n storageOperations,\n filesPermissions,\n getLocaleCode,\n getTenantId,\n getIdentity,\n WEBINY_VERSION\n } = config;\n\n return {\n onFileBeforeCreate: createTopic(\"fileManager.onFileBeforeCreate\"),\n onFileAfterCreate: createTopic(\"fileManager.onFileAfterCreate\"),\n onFileBeforeBatchCreate: createTopic(\"fileManager.onFileBeforeBatchCreate\"),\n onFileAfterBatchCreate: createTopic(\"fileManager.onFileAfterBatchCreate\"),\n onFileBeforeUpdate: createTopic(\"fileManager.onFileBeforeUpdate\"),\n onFileAfterUpdate: createTopic(\"fileManager.onFileAfterUpdate\"),\n onFileBeforeDelete: createTopic(\"fileManager.onFileBeforeDelete\"),\n onFileAfterDelete: createTopic(\"fileManager.onFileAfterDelete\"),\n async getFile(id: string) {\n await filesPermissions.ensure({ rwd: \"r\" });\n\n const file = await storageOperations.files.get({\n where: {\n id,\n tenant: getTenantId(),\n locale: getLocaleCode()\n }\n });\n\n if (!file) {\n throw new NotFoundError(`File with id \"${id}\" does not exists.`);\n }\n\n await filesPermissions.ensure({ owns: file.createdBy });\n\n return file;\n },\n async createFile(input, meta) {\n await filesPermissions.ensure({ rwd: \"w\" });\n\n // Extract ID from file key\n const [id] = input.key.split(\"/\");\n\n const currentDateTime = new Date();\n const currentIdentity = getIdentity();\n\n const file: File = {\n ...input,\n tags: Array.isArray(input.tags) ? input.tags : [],\n aliases: Array.isArray(input.aliases) ? input.aliases : [],\n id: input.id || id,\n location: {\n folderId: input.location?.folderId ?? ROOT_FOLDER\n },\n meta: {\n private: false,\n ...(input.meta || {})\n },\n\n createdOn: getDate(input.createdOn, currentDateTime),\n modifiedOn: getDate(input.modifiedOn, null),\n savedOn: getDate(input.savedOn, currentDateTime),\n createdBy: utilsGetIdentity(input.createdBy, currentIdentity),\n modifiedBy: utilsGetIdentity(input.modifiedBy, null),\n savedBy: utilsGetIdentity(input.savedBy, currentIdentity),\n\n tenant: getTenantId(),\n locale: getLocaleCode(),\n webinyVersion: WEBINY_VERSION\n };\n\n try {\n await this.onFileBeforeCreate.publish({ file, meta });\n\n const result = await storageOperations.files.create({ file });\n\n await this.onFileAfterCreate.publish({ file, meta });\n return result;\n } catch (ex) {\n // If a `NotAuthorizedError` error was thrown, then we just want to rethrow it.\n if (ex instanceof NotAuthorizedError) {\n throw ex;\n }\n\n throw new WebinyError(\n ex.message || \"Could not create a file.\",\n ex.code || \"CREATE_FILE_ERROR\",\n {\n ...(ex.data || {}),\n file\n }\n );\n }\n },\n async updateFile(id, input) {\n await filesPermissions.ensure({ rwd: \"w\" });\n\n const original = await storageOperations.files.get({\n where: {\n id,\n tenant: getTenantId(),\n locale: getLocaleCode()\n }\n });\n\n if (!original) {\n throw new NotFoundError(`File with id \"${id}\" does not exists.`);\n }\n\n await filesPermissions.ensure({ owns: original.createdBy });\n\n const currentDateTime = new Date();\n const currentIdentity = getIdentity();\n\n const file: File = {\n ...original,\n ...input,\n\n createdOn: getDate(input.createdOn, original.createdOn),\n modifiedOn: getDate(input.modifiedOn, currentDateTime),\n savedOn: getDate(input.savedOn, currentDateTime),\n createdBy: utilsGetIdentity(input.createdBy, original.createdBy),\n modifiedBy: utilsGetIdentity(input.modifiedBy, currentIdentity),\n savedBy: utilsGetIdentity(input.savedBy, currentIdentity),\n\n tags: Array.isArray(input.tags)\n ? input.tags\n : Array.isArray(original.tags)\n ? original.tags\n : [],\n aliases: Array.isArray(input.aliases)\n ? input.aliases\n : Array.isArray(original.aliases)\n ? original.aliases\n : [],\n id: original.id,\n webinyVersion: WEBINY_VERSION\n };\n\n try {\n await this.onFileBeforeUpdate.publish({\n original,\n file,\n input\n });\n\n const result = await storageOperations.files.update({\n original,\n file\n });\n\n await this.onFileAfterUpdate.publish({\n original,\n file,\n input\n });\n return result;\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not update a file.\",\n ex.code || \"UPDATE_FILE_ERROR\",\n {\n ...(ex.data || {}),\n original,\n file\n }\n );\n }\n },\n async deleteFile(id) {\n await filesPermissions.ensure({ rwd: \"d\" });\n\n const file = await storageOperations.files.get({\n where: {\n id,\n tenant: getTenantId(),\n locale: getLocaleCode()\n }\n });\n\n if (!file) {\n throw new NotFoundError(`File with id \"${id}\" does not exists.`);\n }\n\n await filesPermissions.ensure({ owns: file.createdBy });\n\n try {\n await this.onFileBeforeDelete.publish({ file });\n\n await storageOperations.files.delete({\n file\n });\n\n await this.onFileAfterDelete.publish({ file });\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not delete a file.\",\n ex.code || \"DELETE_FILE_ERROR\",\n {\n ...(ex.data || {}),\n id,\n file\n }\n );\n }\n\n return true;\n },\n async createFilesInBatch(inputs, meta) {\n await filesPermissions.ensure({ rwd: \"w\" });\n\n const tenant = getTenantId();\n const locale = getLocaleCode();\n\n const currentIdentity = getIdentity();\n const currentDateTime = new Date();\n\n const files: File[] = inputs.map(input => {\n return {\n ...input,\n tags: Array.isArray(input.tags) ? input.tags : [],\n aliases: Array.isArray(input.aliases) ? input.aliases : [],\n meta: {\n private: false,\n ...(input.meta || {})\n },\n location: {\n folderId: input.location?.folderId ?? ROOT_FOLDER\n },\n\n createdOn: getDate(currentDateTime),\n modifiedOn: null,\n savedOn: getDate(currentDateTime),\n createdBy: utilsGetIdentity(currentIdentity),\n modifiedBy: null,\n savedBy: utilsGetIdentity(currentIdentity),\n\n tenant,\n locale,\n webinyVersion: WEBINY_VERSION\n };\n });\n\n try {\n await this.onFileBeforeBatchCreate.publish({ files, meta });\n const results = await storageOperations.files.createBatch({\n files\n });\n await this.onFileAfterBatchCreate.publish({ files, meta });\n return results;\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not create a batch of files.\",\n ex.code || \"CREATE_FILES_ERROR\",\n {\n ...(ex.data || {}),\n files\n }\n );\n }\n },\n async listFiles(params: FilesListOpts = {}) {\n await filesPermissions.ensure({ rwd: \"r\" });\n\n const {\n limit = 40,\n after = null,\n where: initialWhere,\n sort: initialSort,\n search\n } = params;\n\n const where: FileManagerFilesStorageOperationsListParamsWhere = {\n ...{ meta: { private_not: true }, ...initialWhere },\n locale: getLocaleCode(),\n tenant: getTenantId()\n };\n\n /**\n * Always override the createdBy received from the user, if any.\n */\n if (await filesPermissions.canAccessOnlyOwnRecords()) {\n const identity = getIdentity();\n where.createdBy = identity.id;\n }\n\n const sort: CmsEntryListSort =\n Array.isArray(initialSort) && initialSort.length > 0 ? initialSort : [\"id_DESC\"];\n try {\n return await storageOperations.files.list({\n where,\n after,\n limit,\n sort,\n search\n });\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not list files by given parameters.\",\n ex.code || \"FILE_TAG_SEARCH_ERROR\",\n {\n ...(ex.data || {}),\n where,\n after,\n limit,\n sort\n }\n );\n }\n },\n async listTags({ where: initialWhere, after, limit }) {\n await filesPermissions.ensure();\n\n const where: FileManagerFilesStorageOperationsTagsParamsWhere = {\n ...initialWhere,\n tenant: getTenantId(),\n locale: getLocaleCode()\n };\n\n const params = {\n where,\n limit: limit || 1000000,\n after\n };\n\n try {\n return await storageOperations.files.tags(params);\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not search for tags.\",\n ex.code || \"FILE_TAG_SEARCH_ERROR\",\n {\n ...(ex.data || {}),\n params\n }\n );\n }\n }\n };\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,eAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAC,sBAAA,CAAAH,OAAA;AASA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAN,OAA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AC;MAED,MAAMsE,MAAM,GAAG;QACXlD,KAAK;QACLmD,KAAK,EAAEA,KAAK,IAAI,OAAO;QACvBC;MACJ,CAAC;MAED,IAAI;QACA,OAAO,MAAM1E,iBAAiB,CAACoB,KAAK,CAACgB,IAAI,CAACoC,MAAM,CAAC;MACrD,CAAC,CAAC,OAAOjB,EAAE,EAAE;QACT,MAAM,IAAIE,cAAW,CACjBF,EAAE,CAACG,OAAO,IAAI,4BAA4B,EAC1CH,EAAE,CAACI,IAAI,IAAI,uBAAuB,EAClC;UACI,IAAIJ,EAAE,CAACK,IAAI,IAAI,CAAC,CAAC,CAAC;UAClBY;QACJ,CACJ,CAAC;MACL;IACJ;EACJ,CAAC;AACL,CAAC;AAACa,OAAA,CAAAvF,eAAA,GAAAA,eAAA","ignoreList":[]}
|
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
import { FileManagerContextObject
|
|
2
|
-
import {
|
|
3
|
-
import { FileStorage } from "../storage/FileStorage";
|
|
4
|
-
export interface FileManagerConfig {
|
|
5
|
-
storageOperations: FileManagerStorageOperations;
|
|
6
|
-
getTenantId: () => string;
|
|
7
|
-
getLocaleCode: () => string;
|
|
8
|
-
getIdentity: () => SecurityIdentity;
|
|
9
|
-
getPermission: GetPermission;
|
|
10
|
-
storage: FileStorage;
|
|
11
|
-
WEBINY_VERSION: string;
|
|
12
|
-
}
|
|
1
|
+
import type { FileManagerContextObject } from "../types";
|
|
2
|
+
import type { FileManagerConfig } from "./types";
|
|
13
3
|
export declare const createFileManager: (config: FileManagerConfig) => FileManagerContextObject;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.createFileManager = void 0;
|
|
8
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
9
7
|
var _files = require("./files.crud");
|
|
10
8
|
var _settings = require("./settings.crud");
|
|
11
9
|
var _system = require("./system.crud");
|
|
@@ -13,8 +11,13 @@ const createFileManager = config => {
|
|
|
13
11
|
const filesCrud = (0, _files.createFilesCrud)(config);
|
|
14
12
|
const settingsCrud = (0, _settings.createSettingsCrud)(config);
|
|
15
13
|
const systemCrud = (0, _system.createSystemCrud)(config);
|
|
16
|
-
return
|
|
14
|
+
return {
|
|
15
|
+
...filesCrud,
|
|
16
|
+
...settingsCrud,
|
|
17
|
+
...systemCrud,
|
|
17
18
|
storage: config.storage
|
|
18
|
-
}
|
|
19
|
+
};
|
|
19
20
|
};
|
|
20
|
-
exports.createFileManager = createFileManager;
|
|
21
|
+
exports.createFileManager = createFileManager;
|
|
22
|
+
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createFileManager","config","filesCrud","createFilesCrud","settingsCrud","createSettingsCrud","systemCrud","createSystemCrud","storage"],"sources":["index.ts"],"sourcesContent":["import { FileManagerContextObject
|
|
1
|
+
{"version":3,"names":["_files","require","_settings","_system","createFileManager","config","filesCrud","createFilesCrud","settingsCrud","createSettingsCrud","systemCrud","createSystemCrud","storage","exports"],"sources":["index.ts"],"sourcesContent":["import type { FileManagerContextObject } from \"~/types\";\nimport { createFilesCrud } from \"~/createFileManager/files.crud\";\nimport { createSettingsCrud } from \"~/createFileManager/settings.crud\";\nimport { createSystemCrud } from \"~/createFileManager/system.crud\";\nimport type { FileManagerConfig } from \"~/createFileManager/types\";\n\nexport const createFileManager = (config: FileManagerConfig): FileManagerContextObject => {\n const filesCrud = createFilesCrud(config);\n const settingsCrud = createSettingsCrud(config);\n const systemCrud = createSystemCrud(config);\n\n return {\n ...filesCrud,\n ...settingsCrud,\n ...systemCrud,\n storage: config.storage\n };\n};\n"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAGO,MAAMG,iBAAiB,GAAIC,MAAyB,IAA+B;EACtF,MAAMC,SAAS,GAAG,IAAAC,sBAAe,EAACF,MAAM,CAAC;EACzC,MAAMG,YAAY,GAAG,IAAAC,4BAAkB,EAACJ,MAAM,CAAC;EAC/C,MAAMK,UAAU,GAAG,IAAAC,wBAAgB,EAACN,MAAM,CAAC;EAE3C,OAAO;IACH,GAAGC,SAAS;IACZ,GAAGE,YAAY;IACf,GAAGE,UAAU;IACbE,OAAO,EAAEP,MAAM,CAACO;EACpB,CAAC;AACL,CAAC;AAACC,OAAA,CAAAT,iBAAA,GAAAA,iBAAA","ignoreList":[]}
|