@webiny/api-file-manager 0.0.0-unstable.e3f4727c56 → 0.0.0-unstable.eb196ccd2f

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.
Files changed (291) hide show
  1. package/FileManagerContextSetup.d.ts +13 -0
  2. package/FileManagerContextSetup.js +115 -0
  3. package/FileManagerContextSetup.js.map +1 -0
  4. package/README.md +1 -1
  5. package/cmsFileStorage/CmsFilesStorage.d.ts +27 -0
  6. package/cmsFileStorage/CmsFilesStorage.js +164 -0
  7. package/cmsFileStorage/CmsFilesStorage.js.map +1 -0
  8. package/cmsFileStorage/ListFilesWhereProcessor.d.ts +7 -0
  9. package/cmsFileStorage/ListFilesWhereProcessor.js +33 -0
  10. package/cmsFileStorage/ListFilesWhereProcessor.js.map +1 -0
  11. package/cmsFileStorage/ListTagsWhereProcessor.d.ts +7 -0
  12. package/cmsFileStorage/ListTagsWhereProcessor.js +33 -0
  13. package/cmsFileStorage/ListTagsWhereProcessor.js.map +1 -0
  14. package/cmsFileStorage/file.model.d.ts +6 -0
  15. package/cmsFileStorage/file.model.js +158 -0
  16. package/cmsFileStorage/file.model.js.map +1 -0
  17. package/contants.d.ts +1 -0
  18. package/contants.js +9 -0
  19. package/contants.js.map +1 -0
  20. package/createFileManager/files.crud.d.ts +3 -0
  21. package/createFileManager/files.crud.js +328 -0
  22. package/createFileManager/files.crud.js.map +1 -0
  23. package/createFileManager/index.d.ts +3 -0
  24. package/createFileManager/index.js +23 -0
  25. package/createFileManager/index.js.map +1 -0
  26. package/createFileManager/permissions/FilesPermissions.d.ts +4 -0
  27. package/createFileManager/permissions/FilesPermissions.js +11 -0
  28. package/createFileManager/permissions/FilesPermissions.js.map +1 -0
  29. package/createFileManager/permissions/SettingsPermissions.d.ts +4 -0
  30. package/createFileManager/permissions/SettingsPermissions.js +11 -0
  31. package/createFileManager/permissions/SettingsPermissions.js.map +1 -0
  32. package/createFileManager/settings.crud.d.ts +3 -0
  33. package/createFileManager/settings.crud.js +117 -0
  34. package/createFileManager/settings.crud.js.map +1 -0
  35. package/createFileManager/system.crud.d.ts +3 -0
  36. package/createFileManager/system.crud.js +88 -0
  37. package/createFileManager/system.crud.js.map +1 -0
  38. package/createFileManager/types.d.ts +16 -0
  39. package/createFileManager/types.js +7 -0
  40. package/createFileManager/types.js.map +1 -0
  41. package/delivery/AssetDelivery/AliasAssetRequestResolver.d.ts +11 -0
  42. package/delivery/AssetDelivery/AliasAssetRequestResolver.js +74 -0
  43. package/delivery/AssetDelivery/AliasAssetRequestResolver.js.map +1 -0
  44. package/delivery/AssetDelivery/Asset.d.ts +32 -0
  45. package/delivery/AssetDelivery/Asset.js +69 -0
  46. package/delivery/AssetDelivery/Asset.js.map +1 -0
  47. package/delivery/AssetDelivery/AssetDeliveryConfig.d.ts +63 -0
  48. package/delivery/AssetDelivery/AssetDeliveryConfig.js +102 -0
  49. package/delivery/AssetDelivery/AssetDeliveryConfig.js.map +1 -0
  50. package/delivery/AssetDelivery/AssetRequest.d.ts +25 -0
  51. package/delivery/AssetDelivery/AssetRequest.js +29 -0
  52. package/delivery/AssetDelivery/AssetRequest.js.map +1 -0
  53. package/delivery/AssetDelivery/FilesAssetRequestResolver.d.ts +6 -0
  54. package/delivery/AssetDelivery/FilesAssetRequestResolver.js +37 -0
  55. package/delivery/AssetDelivery/FilesAssetRequestResolver.js.map +1 -0
  56. package/delivery/AssetDelivery/NullAssetOutputStrategy.d.ts +4 -0
  57. package/delivery/AssetDelivery/NullAssetOutputStrategy.js +15 -0
  58. package/delivery/AssetDelivery/NullAssetOutputStrategy.js.map +1 -0
  59. package/delivery/AssetDelivery/NullAssetReply.d.ts +4 -0
  60. package/delivery/AssetDelivery/NullAssetReply.js +20 -0
  61. package/delivery/AssetDelivery/NullAssetReply.js.map +1 -0
  62. package/delivery/AssetDelivery/NullAssetResolver.d.ts +5 -0
  63. package/delivery/AssetDelivery/NullAssetResolver.js +14 -0
  64. package/delivery/AssetDelivery/NullAssetResolver.js.map +1 -0
  65. package/delivery/AssetDelivery/NullRequestResolver.d.ts +4 -0
  66. package/delivery/AssetDelivery/NullRequestResolver.js +14 -0
  67. package/delivery/AssetDelivery/NullRequestResolver.js.map +1 -0
  68. package/delivery/AssetDelivery/SetCacheControlHeaders.d.ts +8 -0
  69. package/delivery/AssetDelivery/SetCacheControlHeaders.js +25 -0
  70. package/delivery/AssetDelivery/SetCacheControlHeaders.js.map +1 -0
  71. package/delivery/AssetDelivery/SetResponseHeaders.d.ts +18 -0
  72. package/delivery/AssetDelivery/SetResponseHeaders.js +25 -0
  73. package/delivery/AssetDelivery/SetResponseHeaders.js.map +1 -0
  74. package/delivery/AssetDelivery/abstractions/AssetContentsReader.d.ts +6 -0
  75. package/delivery/AssetDelivery/abstractions/AssetContentsReader.js +7 -0
  76. package/delivery/AssetDelivery/abstractions/AssetContentsReader.js.map +1 -0
  77. package/delivery/AssetDelivery/abstractions/AssetOutputStrategy.d.ts +4 -0
  78. package/delivery/AssetDelivery/abstractions/AssetOutputStrategy.js +7 -0
  79. package/delivery/AssetDelivery/abstractions/AssetOutputStrategy.js.map +1 -0
  80. package/delivery/AssetDelivery/abstractions/AssetProcessor.d.ts +4 -0
  81. package/delivery/AssetDelivery/abstractions/AssetProcessor.js +7 -0
  82. package/delivery/AssetDelivery/abstractions/AssetProcessor.js.map +1 -0
  83. package/delivery/AssetDelivery/abstractions/AssetReply.d.ts +25 -0
  84. package/delivery/AssetDelivery/abstractions/AssetReply.js +38 -0
  85. package/delivery/AssetDelivery/abstractions/AssetReply.js.map +1 -0
  86. package/delivery/AssetDelivery/abstractions/AssetRequestResolver.d.ts +5 -0
  87. package/delivery/AssetDelivery/abstractions/AssetRequestResolver.js +7 -0
  88. package/delivery/AssetDelivery/abstractions/AssetRequestResolver.js.map +1 -0
  89. package/delivery/AssetDelivery/abstractions/AssetResolver.d.ts +4 -0
  90. package/delivery/AssetDelivery/abstractions/AssetResolver.js +7 -0
  91. package/delivery/AssetDelivery/abstractions/AssetResolver.js.map +1 -0
  92. package/delivery/AssetDelivery/abstractions/AssetTransformationStrategy.d.ts +4 -0
  93. package/delivery/AssetDelivery/abstractions/AssetTransformationStrategy.js +7 -0
  94. package/delivery/AssetDelivery/abstractions/AssetTransformationStrategy.js.map +1 -0
  95. package/delivery/AssetDelivery/createAssetDeliveryPluginLoader.d.ts +2 -0
  96. package/delivery/AssetDelivery/createAssetDeliveryPluginLoader.js +15 -0
  97. package/delivery/AssetDelivery/createAssetDeliveryPluginLoader.js.map +1 -0
  98. package/delivery/AssetDelivery/privateFiles/AssetAuthorizer.d.ts +4 -0
  99. package/delivery/AssetDelivery/privateFiles/AssetAuthorizer.js +7 -0
  100. package/delivery/AssetDelivery/privateFiles/AssetAuthorizer.js.map +1 -0
  101. package/delivery/AssetDelivery/privateFiles/NotAuthorizedAssetReply.d.ts +4 -0
  102. package/delivery/AssetDelivery/privateFiles/NotAuthorizedAssetReply.js +26 -0
  103. package/delivery/AssetDelivery/privateFiles/NotAuthorizedAssetReply.js.map +1 -0
  104. package/delivery/AssetDelivery/privateFiles/NotAuthorizedOutputStrategy.d.ts +4 -0
  105. package/delivery/AssetDelivery/privateFiles/NotAuthorizedOutputStrategy.js +15 -0
  106. package/delivery/AssetDelivery/privateFiles/NotAuthorizedOutputStrategy.js.map +1 -0
  107. package/delivery/AssetDelivery/privateFiles/PrivateAuthenticatedAuthorizer.d.ts +7 -0
  108. package/delivery/AssetDelivery/privateFiles/PrivateAuthenticatedAuthorizer.js +28 -0
  109. package/delivery/AssetDelivery/privateFiles/PrivateAuthenticatedAuthorizer.js.map +1 -0
  110. package/delivery/AssetDelivery/privateFiles/PrivateCache.d.ts +6 -0
  111. package/delivery/AssetDelivery/privateFiles/PrivateCache.js +28 -0
  112. package/delivery/AssetDelivery/privateFiles/PrivateCache.js.map +1 -0
  113. package/delivery/AssetDelivery/privateFiles/PrivateFileAssetRequestResolver.d.ts +8 -0
  114. package/delivery/AssetDelivery/privateFiles/PrivateFileAssetRequestResolver.js +37 -0
  115. package/delivery/AssetDelivery/privateFiles/PrivateFileAssetRequestResolver.js.map +1 -0
  116. package/delivery/AssetDelivery/privateFiles/PrivateFilesAssetProcessor.d.ts +13 -0
  117. package/delivery/AssetDelivery/privateFiles/PrivateFilesAssetProcessor.js +63 -0
  118. package/delivery/AssetDelivery/privateFiles/PrivateFilesAssetProcessor.js.map +1 -0
  119. package/delivery/AssetDelivery/privateFiles/PublicCache.d.ts +6 -0
  120. package/delivery/AssetDelivery/privateFiles/PublicCache.js +28 -0
  121. package/delivery/AssetDelivery/privateFiles/PublicCache.js.map +1 -0
  122. package/delivery/AssetDelivery/privateFiles/RedirectToPrivateUrlOutputStrategy.d.ts +7 -0
  123. package/delivery/AssetDelivery/privateFiles/RedirectToPrivateUrlOutputStrategy.js +27 -0
  124. package/delivery/AssetDelivery/privateFiles/RedirectToPrivateUrlOutputStrategy.js.map +1 -0
  125. package/delivery/AssetDelivery/privateFiles/RedirectToPublicUrlOutputStrategy.d.ts +7 -0
  126. package/delivery/AssetDelivery/privateFiles/RedirectToPublicUrlOutputStrategy.js +27 -0
  127. package/delivery/AssetDelivery/privateFiles/RedirectToPublicUrlOutputStrategy.js.map +1 -0
  128. package/delivery/AssetDelivery/privateFiles/internalIdentity.d.ts +7 -0
  129. package/delivery/AssetDelivery/privateFiles/internalIdentity.js +18 -0
  130. package/delivery/AssetDelivery/privateFiles/internalIdentity.js.map +1 -0
  131. package/delivery/AssetDelivery/transformation/PassthroughAssetProcessor.d.ts +4 -0
  132. package/delivery/AssetDelivery/transformation/PassthroughAssetProcessor.js +14 -0
  133. package/delivery/AssetDelivery/transformation/PassthroughAssetProcessor.js.map +1 -0
  134. package/delivery/AssetDelivery/transformation/PassthroughAssetTransformationStrategy.d.ts +4 -0
  135. package/delivery/AssetDelivery/transformation/PassthroughAssetTransformationStrategy.js +14 -0
  136. package/delivery/AssetDelivery/transformation/PassthroughAssetTransformationStrategy.js.map +1 -0
  137. package/delivery/AssetDelivery/transformation/TransformationAssetProcessor.d.ts +6 -0
  138. package/delivery/AssetDelivery/transformation/TransformationAssetProcessor.js +26 -0
  139. package/delivery/AssetDelivery/transformation/TransformationAssetProcessor.js.map +1 -0
  140. package/delivery/index.d.ts +17 -0
  141. package/delivery/index.js +194 -0
  142. package/delivery/index.js.map +1 -0
  143. package/delivery/setupAssetDelivery.d.ts +6 -0
  144. package/delivery/setupAssetDelivery.js +128 -0
  145. package/delivery/setupAssetDelivery.js.map +1 -0
  146. package/enterprise/applyThreatScanning.d.ts +2 -0
  147. package/enterprise/applyThreatScanning.js +20 -0
  148. package/enterprise/applyThreatScanning.js.map +1 -0
  149. package/graphql/baseSchema.d.ts +3 -0
  150. package/graphql/baseSchema.js +121 -0
  151. package/graphql/baseSchema.js.map +1 -0
  152. package/graphql/createFilesTypeDefs.d.ts +7 -0
  153. package/graphql/createFilesTypeDefs.js +184 -0
  154. package/graphql/createFilesTypeDefs.js.map +1 -0
  155. package/graphql/filesSchema.d.ts +4 -0
  156. package/graphql/filesSchema.js +89 -0
  157. package/graphql/filesSchema.js.map +1 -0
  158. package/graphql/getFileByUrl.d.ts +3 -0
  159. package/graphql/getFileByUrl.js +78 -0
  160. package/graphql/getFileByUrl.js.map +1 -0
  161. package/graphql/index.d.ts +4 -0
  162. package/graphql/index.js +55 -0
  163. package/graphql/index.js.map +1 -0
  164. package/graphql/utils.d.ts +11 -0
  165. package/graphql/utils.js +24 -0
  166. package/graphql/utils.js.map +1 -0
  167. package/handlers/{transform/managers → manage}/imageManager.d.ts +2 -3
  168. package/handlers/manage/imageManager.js +75 -0
  169. package/handlers/manage/imageManager.js.map +1 -0
  170. package/handlers/manage/index.d.ts +1 -1
  171. package/handlers/manage/index.js +9 -5
  172. package/handlers/manage/index.js.map +1 -1
  173. package/handlers/{transform/utils.js → manage/legacyUtils.js} +7 -9
  174. package/handlers/manage/legacyUtils.js.map +1 -0
  175. package/handlers/manage/utils.d.ts +12 -0
  176. package/handlers/manage/utils.js +34 -0
  177. package/handlers/manage/utils.js.map +1 -0
  178. package/handlers/types.d.ts +1 -1
  179. package/handlers/types.js +3 -1
  180. package/handlers/types.js.map +1 -1
  181. package/handlers/utils/getEnvironment.js +3 -1
  182. package/handlers/utils/getEnvironment.js.map +1 -1
  183. package/handlers/utils/getObjectParams.js +3 -1
  184. package/handlers/utils/getObjectParams.js.map +1 -1
  185. package/handlers/utils/index.js +3 -1
  186. package/handlers/utils/index.js.map +1 -1
  187. package/index.d.ts +10 -0
  188. package/index.js +76 -0
  189. package/index.js.map +1 -0
  190. package/modelModifier/CmsModelModifier.d.ts +26 -0
  191. package/modelModifier/CmsModelModifier.js +62 -0
  192. package/modelModifier/CmsModelModifier.js.map +1 -0
  193. package/package.json +26 -36
  194. package/plugins/{definitions/FilePhysicalStoragePlugin.d.ts → FilePhysicalStoragePlugin.d.ts} +2 -1
  195. package/plugins/{definitions/FilePhysicalStoragePlugin.js → FilePhysicalStoragePlugin.js} +3 -3
  196. package/plugins/FilePhysicalStoragePlugin.js.map +1 -0
  197. package/plugins/{definitions/FileStorageTransformPlugin.d.ts → FileStorageTransformPlugin.d.ts} +1 -1
  198. package/plugins/{definitions/FileStorageTransformPlugin.js → FileStorageTransformPlugin.js} +3 -4
  199. package/plugins/FileStorageTransformPlugin.js.map +1 -0
  200. package/plugins/index.d.ts +2 -2
  201. package/plugins/index.js +24 -10
  202. package/plugins/index.js.map +1 -1
  203. package/{plugins/storage → storage}/FileStorage.d.ts +10 -6
  204. package/storage/FileStorage.js +90 -0
  205. package/storage/FileStorage.js.map +1 -0
  206. package/types/file.d.ts +49 -0
  207. package/types/file.js +7 -0
  208. package/types/file.js.map +1 -0
  209. package/types/file.lifecycle.d.ts +44 -0
  210. package/types/file.lifecycle.js +7 -0
  211. package/types/file.lifecycle.js.map +1 -0
  212. package/types.d.ts +92 -80
  213. package/types.js +25 -1
  214. package/types.js.map +1 -1
  215. package/handlers/download/index.d.ts +0 -3
  216. package/handlers/download/index.js +0 -113
  217. package/handlers/download/index.js.map +0 -1
  218. package/handlers/transform/index.d.ts +0 -2
  219. package/handlers/transform/index.js +0 -81
  220. package/handlers/transform/index.js.map +0 -1
  221. package/handlers/transform/loaders/imageLoader.d.ts +0 -30
  222. package/handlers/transform/loaders/imageLoader.js +0 -88
  223. package/handlers/transform/loaders/imageLoader.js.map +0 -1
  224. package/handlers/transform/loaders/index.d.ts +0 -8
  225. package/handlers/transform/loaders/index.js +0 -10
  226. package/handlers/transform/loaders/index.js.map +0 -1
  227. package/handlers/transform/loaders/sanitizeImageTransformations.d.ts +0 -11
  228. package/handlers/transform/loaders/sanitizeImageTransformations.js +0 -45
  229. package/handlers/transform/loaders/sanitizeImageTransformations.js.map +0 -1
  230. package/handlers/transform/managers/imageManager.js +0 -55
  231. package/handlers/transform/managers/imageManager.js.map +0 -1
  232. package/handlers/transform/managers/index.d.ts +0 -5
  233. package/handlers/transform/managers/index.js +0 -10
  234. package/handlers/transform/managers/index.js.map +0 -1
  235. package/handlers/transform/optimizeImage.d.ts +0 -3
  236. package/handlers/transform/optimizeImage.js +0 -42
  237. package/handlers/transform/optimizeImage.js.map +0 -1
  238. package/handlers/transform/transformImage.d.ts +0 -10
  239. package/handlers/transform/transformImage.js +0 -25
  240. package/handlers/transform/transformImage.js.map +0 -1
  241. package/handlers/transform/utils.js.map +0 -1
  242. package/plugins/crud/files/validation.d.ts +0 -3
  243. package/plugins/crud/files/validation.js +0 -35
  244. package/plugins/crud/files/validation.js.map +0 -1
  245. package/plugins/crud/files.crud.d.ts +0 -4
  246. package/plugins/crud/files.crud.js +0 -372
  247. package/plugins/crud/files.crud.js.map +0 -1
  248. package/plugins/crud/settings.crud.d.ts +0 -5
  249. package/plugins/crud/settings.crud.js +0 -99
  250. package/plugins/crud/settings.crud.js.map +0 -1
  251. package/plugins/crud/system.crud.d.ts +0 -4
  252. package/plugins/crud/system.crud.js +0 -104
  253. package/plugins/crud/system.crud.js.map +0 -1
  254. package/plugins/crud/utils/checkBasePermissions.d.ts +0 -5
  255. package/plugins/crud/utils/checkBasePermissions.js +0 -25
  256. package/plugins/crud/utils/checkBasePermissions.js.map +0 -1
  257. package/plugins/crud/utils/createFileModel.d.ts +0 -5
  258. package/plugins/crud/utils/createFileModel.js +0 -65
  259. package/plugins/crud/utils/createFileModel.js.map +0 -1
  260. package/plugins/crud/utils/lifecycleEvents.d.ts +0 -6
  261. package/plugins/crud/utils/lifecycleEvents.js +0 -30
  262. package/plugins/crud/utils/lifecycleEvents.js.map +0 -1
  263. package/plugins/definitions/FilePhysicalStoragePlugin.js.map +0 -1
  264. package/plugins/definitions/FilePlugin.d.ts +0 -136
  265. package/plugins/definitions/FilePlugin.js +0 -52
  266. package/plugins/definitions/FilePlugin.js.map +0 -1
  267. package/plugins/definitions/FileStorageTransformPlugin.js.map +0 -1
  268. package/plugins/definitions/FilesStorageOperationsProviderPlugin.d.ts +0 -9
  269. package/plugins/definitions/FilesStorageOperationsProviderPlugin.js +0 -12
  270. package/plugins/definitions/FilesStorageOperationsProviderPlugin.js.map +0 -1
  271. package/plugins/definitions/InstallationPlugin.d.ts +0 -19
  272. package/plugins/definitions/InstallationPlugin.js +0 -31
  273. package/plugins/definitions/InstallationPlugin.js.map +0 -1
  274. package/plugins/definitions/SettingsStorageOperationsProviderPlugin.d.ts +0 -9
  275. package/plugins/definitions/SettingsStorageOperationsProviderPlugin.js +0 -12
  276. package/plugins/definitions/SettingsStorageOperationsProviderPlugin.js.map +0 -1
  277. package/plugins/definitions/SystemStorageOperationsProviderPlugin.d.ts +0 -9
  278. package/plugins/definitions/SystemStorageOperationsProviderPlugin.js +0 -12
  279. package/plugins/definitions/SystemStorageOperationsProviderPlugin.js.map +0 -1
  280. package/plugins/graphql.d.ts +0 -4
  281. package/plugins/graphql.js +0 -262
  282. package/plugins/graphql.js.map +0 -1
  283. package/plugins/storage/FileStorage.js +0 -85
  284. package/plugins/storage/FileStorage.js.map +0 -1
  285. package/plugins/storage/index.d.ts +0 -4
  286. package/plugins/storage/index.js +0 -22
  287. package/plugins/storage/index.js.map +0 -1
  288. package/utils.d.ts +0 -4
  289. package/utils.js +0 -14
  290. package/utils.js.map +0 -1
  291. /package/handlers/{transform/utils.d.ts → manage/legacyUtils.d.ts} +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"names":["systemCrudContextPlugin","ContextPlugin","context","pluginType","SystemStorageOperationsProviderPlugin","type","providerPlugin","plugins","byType","find","WebinyError","storageOperations","provide","fileManager","getTenantId","tenancy","getCurrentTenant","id","system","getVersion","get","version","setVersion","data","tenant","update","original","ex","create","install","srcPrefix","identity","security","getIdentity","NotAuthorizedError","installationPlugins","InstallationPlugin","executeCallbacks","settings","createSettings","WEBINY_VERSION","name"],"sources":["system.crud.ts"],"sourcesContent":["import { NotAuthorizedError } from \"@webiny/api-security\";\nimport { FileManagerContext, FileManagerSettings, FileManagerSystem } from \"~/types\";\nimport WebinyError from \"@webiny/error\";\nimport { ContextPlugin } from \"@webiny/api\";\nimport { executeCallbacks } from \"~/utils\";\nimport { InstallationPlugin } from \"~/plugins/definitions/InstallationPlugin\";\nimport { SystemStorageOperationsProviderPlugin } from \"~/plugins/definitions/SystemStorageOperationsProviderPlugin\";\n\nconst systemCrudContextPlugin = new ContextPlugin<FileManagerContext>(async context => {\n const pluginType = SystemStorageOperationsProviderPlugin.type;\n const providerPlugin = context.plugins\n .byType<SystemStorageOperationsProviderPlugin>(pluginType)\n .find(() => true);\n\n if (!providerPlugin) {\n throw new WebinyError(`Missing \"${pluginType}\" plugin.`, \"PLUGIN_NOT_FOUND\", {\n type: pluginType\n });\n }\n\n const storageOperations = await providerPlugin.provide({\n context\n });\n\n if (!context.fileManager) {\n context.fileManager = {} as any;\n }\n\n const getTenantId = (): string => {\n return context.tenancy.getCurrentTenant().id;\n };\n\n context.fileManager.system = {\n async getVersion() {\n const system = await storageOperations.get();\n\n return system ? system.version : null;\n },\n async setVersion(version: string) {\n const system = await storageOperations.get();\n\n if (system) {\n const data: FileManagerSystem = {\n ...system,\n tenant: system.tenant || getTenantId(),\n version\n };\n try {\n await storageOperations.update({\n original: system,\n data\n });\n return;\n } catch (ex) {\n throw new WebinyError(\n \"Could not update the system data.\",\n \"SYSTEM_UPDATE_ERROR\",\n {\n data\n }\n );\n }\n }\n\n const data: FileManagerSystem = {\n version,\n tenant: getTenantId()\n };\n try {\n await storageOperations.create({\n data\n });\n return;\n } catch (ex) {\n throw new WebinyError(\"Could not create the system data.\", \"SYSTEM_CREATE_ERROR\", {\n data\n });\n }\n },\n async install({ srcPrefix }) {\n const identity = context.security.getIdentity();\n if (!identity) {\n throw new NotAuthorizedError();\n }\n const { fileManager } = context;\n const version = await fileManager.system.getVersion();\n\n if (version) {\n throw new WebinyError(\n \"File Manager is already installed.\",\n \"FILES_INSTALL_ABORTED\"\n );\n }\n\n const data: Partial<FileManagerSettings> = {};\n\n if (srcPrefix) {\n data.srcPrefix = srcPrefix;\n }\n\n const installationPlugins = context.plugins.byType<InstallationPlugin>(\n InstallationPlugin.type\n );\n\n await executeCallbacks<InstallationPlugin[\"beforeInstall\"]>(\n installationPlugins,\n \"beforeInstall\",\n {\n context\n }\n );\n\n await fileManager.settings.createSettings(data);\n\n await fileManager.system.setVersion(context.WEBINY_VERSION);\n\n await executeCallbacks<InstallationPlugin[\"afterInstall\"]>(\n installationPlugins,\n \"afterInstall\",\n {\n context\n }\n );\n\n return true;\n }\n };\n});\n\nsystemCrudContextPlugin.name = \"FileManagerSystemCrud\";\n\nexport default systemCrudContextPlugin;\n"],"mappings":";;;;;;;;AAAA;AAEA;AACA;AACA;AACA;AACA;AAEA,MAAMA,uBAAuB,GAAG,IAAIC,kBAAa,CAAqB,MAAMC,OAAO,IAAI;EACnF,MAAMC,UAAU,GAAGC,4EAAqC,CAACC,IAAI;EAC7D,MAAMC,cAAc,GAAGJ,OAAO,CAACK,OAAO,CACjCC,MAAM,CAAwCL,UAAU,CAAC,CACzDM,IAAI,CAAC,MAAM,IAAI,CAAC;EAErB,IAAI,CAACH,cAAc,EAAE;IACjB,MAAM,IAAII,cAAW,CAAE,YAAWP,UAAW,WAAU,EAAE,kBAAkB,EAAE;MACzEE,IAAI,EAAEF;IACV,CAAC,CAAC;EACN;EAEA,MAAMQ,iBAAiB,GAAG,MAAML,cAAc,CAACM,OAAO,CAAC;IACnDV;EACJ,CAAC,CAAC;EAEF,IAAI,CAACA,OAAO,CAACW,WAAW,EAAE;IACtBX,OAAO,CAACW,WAAW,GAAG,CAAC,CAAQ;EACnC;EAEA,MAAMC,WAAW,GAAG,MAAc;IAC9B,OAAOZ,OAAO,CAACa,OAAO,CAACC,gBAAgB,EAAE,CAACC,EAAE;EAChD,CAAC;EAEDf,OAAO,CAACW,WAAW,CAACK,MAAM,GAAG;IACzB,MAAMC,UAAU,GAAG;MACf,MAAMD,MAAM,GAAG,MAAMP,iBAAiB,CAACS,GAAG,EAAE;MAE5C,OAAOF,MAAM,GAAGA,MAAM,CAACG,OAAO,GAAG,IAAI;IACzC,CAAC;IACD,MAAMC,UAAU,CAACD,OAAe,EAAE;MAC9B,MAAMH,MAAM,GAAG,MAAMP,iBAAiB,CAACS,GAAG,EAAE;MAE5C,IAAIF,MAAM,EAAE;QACR,MAAMK,IAAuB,+DACtBL,MAAM;UACTM,MAAM,EAAEN,MAAM,CAACM,MAAM,IAAIV,WAAW,EAAE;UACtCO;QAAO,EACV;QACD,IAAI;UACA,MAAMV,iBAAiB,CAACc,MAAM,CAAC;YAC3BC,QAAQ,EAAER,MAAM;YAChBK;UACJ,CAAC,CAAC;UACF;QACJ,CAAC,CAAC,OAAOI,EAAE,EAAE;UACT,MAAM,IAAIjB,cAAW,CACjB,mCAAmC,EACnC,qBAAqB,EACrB;YACIa;UACJ,CAAC,CACJ;QACL;MACJ;MAEA,MAAMA,IAAuB,GAAG;QAC5BF,OAAO;QACPG,MAAM,EAAEV,WAAW;MACvB,CAAC;MACD,IAAI;QACA,MAAMH,iBAAiB,CAACiB,MAAM,CAAC;UAC3BL;QACJ,CAAC,CAAC;QACF;MACJ,CAAC,CAAC,OAAOI,EAAE,EAAE;QACT,MAAM,IAAIjB,cAAW,CAAC,mCAAmC,EAAE,qBAAqB,EAAE;UAC9Ea;QACJ,CAAC,CAAC;MACN;IACJ,CAAC;IACD,MAAMM,OAAO,CAAC;MAAEC;IAAU,CAAC,EAAE;MACzB,MAAMC,QAAQ,GAAG7B,OAAO,CAAC8B,QAAQ,CAACC,WAAW,EAAE;MAC/C,IAAI,CAACF,QAAQ,EAAE;QACX,MAAM,IAAIG,+BAAkB,EAAE;MAClC;MACA,MAAM;QAAErB;MAAY,CAAC,GAAGX,OAAO;MAC/B,MAAMmB,OAAO,GAAG,MAAMR,WAAW,CAACK,MAAM,CAACC,UAAU,EAAE;MAErD,IAAIE,OAAO,EAAE;QACT,MAAM,IAAIX,cAAW,CACjB,oCAAoC,EACpC,uBAAuB,CAC1B;MACL;MAEA,MAAMa,IAAkC,GAAG,CAAC,CAAC;MAE7C,IAAIO,SAAS,EAAE;QACXP,IAAI,CAACO,SAAS,GAAGA,SAAS;MAC9B;MAEA,MAAMK,mBAAmB,GAAGjC,OAAO,CAACK,OAAO,CAACC,MAAM,CAC9C4B,sCAAkB,CAAC/B,IAAI,CAC1B;MAED,MAAM,IAAAgC,uBAAgB,EAClBF,mBAAmB,EACnB,eAAe,EACf;QACIjC;MACJ,CAAC,CACJ;MAED,MAAMW,WAAW,CAACyB,QAAQ,CAACC,cAAc,CAAChB,IAAI,CAAC;MAE/C,MAAMV,WAAW,CAACK,MAAM,CAACI,UAAU,CAACpB,OAAO,CAACsC,cAAc,CAAC;MAE3D,MAAM,IAAAH,uBAAgB,EAClBF,mBAAmB,EACnB,cAAc,EACd;QACIjC;MACJ,CAAC,CACJ;MAED,OAAO,IAAI;IACf;EACJ,CAAC;AACL,CAAC,CAAC;AAEFF,uBAAuB,CAACyC,IAAI,GAAG,uBAAuB;AAAC,eAExCzC,uBAAuB;AAAA"}
@@ -1,5 +0,0 @@
1
- import { FileManagerContext, FilePermission } from "../../../types";
2
- declare const _default: (context: FileManagerContext, check?: {
3
- rwd?: string;
4
- }) => Promise<FilePermission>;
5
- export default _default;
@@ -1,25 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _apiSecurity = require("@webiny/api-security");
8
- var _default = async (context, check = {}) => {
9
- await context.i18n.checkI18NContentPermission();
10
- const filePermission = await context.security.getPermission("fm.file");
11
- if (!filePermission) {
12
- throw new _apiSecurity.NotAuthorizedError();
13
- }
14
- if (check.rwd && !hasRwd(filePermission, check.rwd)) {
15
- throw new _apiSecurity.NotAuthorizedError();
16
- }
17
- return filePermission;
18
- };
19
- exports.default = _default;
20
- const hasRwd = (filesFilePermission, rwd) => {
21
- if (typeof filesFilePermission.rwd !== "string") {
22
- return true;
23
- }
24
- return filesFilePermission.rwd.includes(rwd);
25
- };
@@ -1 +0,0 @@
1
- {"version":3,"names":["context","check","i18n","checkI18NContentPermission","filePermission","security","getPermission","NotAuthorizedError","rwd","hasRwd","filesFilePermission","includes"],"sources":["checkBasePermissions.ts"],"sourcesContent":["import { FileManagerContext, FilePermission } from \"~/types\";\nimport { NotAuthorizedError } from \"@webiny/api-security\";\n\nexport default async (\n context: FileManagerContext,\n check: { rwd?: string } = {}\n): Promise<FilePermission> => {\n await context.i18n.checkI18NContentPermission();\n const filePermission = await context.security.getPermission<FilePermission>(\"fm.file\");\n if (!filePermission) {\n throw new NotAuthorizedError();\n }\n if (check.rwd && !hasRwd(filePermission, check.rwd)) {\n throw new NotAuthorizedError();\n }\n\n return filePermission;\n};\n\nconst hasRwd = (filesFilePermission: FilePermission, rwd: string): boolean => {\n if (typeof filesFilePermission.rwd !== \"string\") {\n return true;\n }\n\n return filesFilePermission.rwd.includes(rwd);\n};\n"],"mappings":";;;;;;AACA;AAA0D,eAE3C,OACXA,OAA2B,EAC3BC,KAAuB,GAAG,CAAC,CAAC,KACF;EAC1B,MAAMD,OAAO,CAACE,IAAI,CAACC,0BAA0B,EAAE;EAC/C,MAAMC,cAAc,GAAG,MAAMJ,OAAO,CAACK,QAAQ,CAACC,aAAa,CAAiB,SAAS,CAAC;EACtF,IAAI,CAACF,cAAc,EAAE;IACjB,MAAM,IAAIG,+BAAkB,EAAE;EAClC;EACA,IAAIN,KAAK,CAACO,GAAG,IAAI,CAACC,MAAM,CAACL,cAAc,EAAEH,KAAK,CAACO,GAAG,CAAC,EAAE;IACjD,MAAM,IAAID,+BAAkB,EAAE;EAClC;EAEA,OAAOH,cAAc;AACzB,CAAC;AAAA;AAED,MAAMK,MAAM,GAAG,CAACC,mBAAmC,EAAEF,GAAW,KAAc;EAC1E,IAAI,OAAOE,mBAAmB,CAACF,GAAG,KAAK,QAAQ,EAAE;IAC7C,OAAO,IAAI;EACf;EAEA,OAAOE,mBAAmB,CAACF,GAAG,CAACG,QAAQ,CAACH,GAAG,CAAC;AAChD,CAAC"}
@@ -1,5 +0,0 @@
1
- /**
2
- * TODO @ts-refactor change for JOI or some other validation library
3
- */
4
- declare const _default: (create?: boolean) => any;
5
- export default _default;
@@ -1,65 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _fields = require("@commodo/fields");
8
- var _commodoFieldsObject = require("commodo-fields-object");
9
- var _validation = require("@webiny/validation");
10
- /**
11
- * Package @commodo/fields does not have types
12
- */
13
- // @ts-ignore
14
- /**
15
- * Package commodo-fields-object does not have types
16
- */
17
- // @ts-ignore
18
- /**
19
- * TODO @ts-refactor change for JOI or some other validation library
20
- */
21
- var _default = (create = true) => {
22
- return (0, _fields.withFields)({
23
- key: (0, _fields.string)({
24
- validation: _validation.validation.create(`${create ? "required," : ""}maxLength:1000`)
25
- }),
26
- name: (0, _fields.string)({
27
- validation: _validation.validation.create("maxLength:1000")
28
- }),
29
- size: (0, _fields.number)(),
30
- type: (0, _fields.string)({
31
- validation: _validation.validation.create("maxLength:255")
32
- }),
33
- meta: (0, _commodoFieldsObject.object)({
34
- value: {
35
- private: false
36
- }
37
- }),
38
- tags: (0, _fields.onSet)(value => {
39
- if (!Array.isArray(value)) {
40
- return null;
41
- }
42
- return value.map(item => item.toLowerCase());
43
- })((0, _fields.string)({
44
- list: true,
45
- validation: tags => {
46
- if (!Array.isArray(tags)) {
47
- return;
48
- }
49
- if (tags.length > 15) {
50
- throw Error("You cannot set more than 15 tags.");
51
- }
52
- for (let i = 0; i < tags.length; i++) {
53
- const tag = tags[i];
54
- if (typeof tag !== "string") {
55
- throw Error("Tag must be typeof string.");
56
- }
57
- if (tag.length > 50) {
58
- throw Error(`Tag ${tag} is more than 50 characters long.`);
59
- }
60
- }
61
- }
62
- }))
63
- })();
64
- };
65
- exports.default = _default;
@@ -1 +0,0 @@
1
- {"version":3,"names":["create","withFields","key","string","validation","name","size","number","type","meta","object","value","private","tags","onSet","Array","isArray","map","item","toLowerCase","list","length","Error","i","tag"],"sources":["createFileModel.ts"],"sourcesContent":["/**\n * Package @commodo/fields does not have types\n */\n// @ts-ignore\nimport { withFields, string, number, onSet } from \"@commodo/fields\";\n/**\n * Package commodo-fields-object does not have types\n */\n// @ts-ignore\nimport { object } from \"commodo-fields-object\";\nimport { validation } from \"@webiny/validation\";\n\n/**\n * TODO @ts-refactor change for JOI or some other validation library\n */\nexport default (create = true) => {\n return withFields({\n key: string({\n validation: validation.create(`${create ? \"required,\" : \"\"}maxLength:1000`)\n }),\n name: string({ validation: validation.create(\"maxLength:1000\") }),\n size: number(),\n type: string({ validation: validation.create(\"maxLength:255\") }),\n meta: object({ value: { private: false } }),\n tags: onSet((value: string[]) => {\n if (!Array.isArray(value)) {\n return null;\n }\n\n return value.map(item => item.toLowerCase());\n })(\n string({\n list: true,\n validation: (tags: string[]) => {\n if (!Array.isArray(tags)) {\n return;\n }\n\n if (tags.length > 15) {\n throw Error(\"You cannot set more than 15 tags.\");\n }\n\n for (let i = 0; i < tags.length; i++) {\n const tag = tags[i];\n if (typeof tag !== \"string\") {\n throw Error(\"Tag must be typeof string.\");\n }\n\n if (tag.length > 50) {\n throw Error(`Tag ${tag} is more than 50 characters long.`);\n }\n }\n }\n })\n )\n })();\n};\n"],"mappings":";;;;;;AAIA;AAKA;AACA;AAVA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAIA;AACA;AACA;AAFA,eAGe,CAACA,MAAM,GAAG,IAAI,KAAK;EAC9B,OAAO,IAAAC,kBAAU,EAAC;IACdC,GAAG,EAAE,IAAAC,cAAM,EAAC;MACRC,UAAU,EAAEA,sBAAU,CAACJ,MAAM,CAAE,GAAEA,MAAM,GAAG,WAAW,GAAG,EAAG,gBAAe;IAC9E,CAAC,CAAC;IACFK,IAAI,EAAE,IAAAF,cAAM,EAAC;MAAEC,UAAU,EAAEA,sBAAU,CAACJ,MAAM,CAAC,gBAAgB;IAAE,CAAC,CAAC;IACjEM,IAAI,EAAE,IAAAC,cAAM,GAAE;IACdC,IAAI,EAAE,IAAAL,cAAM,EAAC;MAAEC,UAAU,EAAEA,sBAAU,CAACJ,MAAM,CAAC,eAAe;IAAE,CAAC,CAAC;IAChES,IAAI,EAAE,IAAAC,2BAAM,EAAC;MAAEC,KAAK,EAAE;QAAEC,OAAO,EAAE;MAAM;IAAE,CAAC,CAAC;IAC3CC,IAAI,EAAE,IAAAC,aAAK,EAAEH,KAAe,IAAK;MAC7B,IAAI,CAACI,KAAK,CAACC,OAAO,CAACL,KAAK,CAAC,EAAE;QACvB,OAAO,IAAI;MACf;MAEA,OAAOA,KAAK,CAACM,GAAG,CAACC,IAAI,IAAIA,IAAI,CAACC,WAAW,EAAE,CAAC;IAChD,CAAC,CAAC,CACE,IAAAhB,cAAM,EAAC;MACHiB,IAAI,EAAE,IAAI;MACVhB,UAAU,EAAGS,IAAc,IAAK;QAC5B,IAAI,CAACE,KAAK,CAACC,OAAO,CAACH,IAAI,CAAC,EAAE;UACtB;QACJ;QAEA,IAAIA,IAAI,CAACQ,MAAM,GAAG,EAAE,EAAE;UAClB,MAAMC,KAAK,CAAC,mCAAmC,CAAC;QACpD;QAEA,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGV,IAAI,CAACQ,MAAM,EAAEE,CAAC,EAAE,EAAE;UAClC,MAAMC,GAAG,GAAGX,IAAI,CAACU,CAAC,CAAC;UACnB,IAAI,OAAOC,GAAG,KAAK,QAAQ,EAAE;YACzB,MAAMF,KAAK,CAAC,4BAA4B,CAAC;UAC7C;UAEA,IAAIE,GAAG,CAACH,MAAM,GAAG,EAAE,EAAE;YACjB,MAAMC,KAAK,CAAE,OAAME,GAAI,mCAAkC,CAAC;UAC9D;QACJ;MACJ;IACJ,CAAC,CAAC;EAEV,CAAC,CAAC,EAAE;AACR,CAAC;AAAA"}
@@ -1,6 +0,0 @@
1
- import { FilePlugin, FilePluginParams } from "../../definitions/FilePlugin";
2
- import { FileManagerContext } from "../../../types";
3
- export declare const runLifecycleEvent: (hook: keyof FilePluginParams, params: {
4
- context: FileManagerContext;
5
- plugins: FilePlugin[];
6
- } & Record<string, any>) => Promise<void>;
@@ -1,30 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.runLifecycleEvent = void 0;
8
- var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
9
- const _excluded = ["plugins"];
10
- // TODO @ts-refactor introduce pubsub methods
11
-
12
- const runLifecycleEvent = async (hook, params) => {
13
- const {
14
- plugins
15
- } = params,
16
- rest = (0, _objectWithoutProperties2.default)(params, _excluded);
17
- if (plugins.length === 0) {
18
- return;
19
- }
20
- for (const plugin of plugins) {
21
- if (!plugin[hook]) {
22
- continue;
23
- }
24
- /**
25
- * Keep any because we do not know which hook needs to be executed. This will be removed, so it does not matter.
26
- */
27
- await plugin[hook](rest);
28
- }
29
- };
30
- exports.runLifecycleEvent = runLifecycleEvent;
@@ -1 +0,0 @@
1
- {"version":3,"names":["runLifecycleEvent","hook","params","plugins","rest","length","plugin"],"sources":["lifecycleEvents.ts"],"sourcesContent":["// TODO @ts-refactor introduce pubsub methods\nimport { FilePlugin, FilePluginParams } from \"~/plugins/definitions/FilePlugin\";\nimport { FileManagerContext } from \"~/types\";\n\nexport const runLifecycleEvent = async (\n hook: keyof FilePluginParams,\n params: { context: FileManagerContext; plugins: FilePlugin[] } & Record<string, any>\n): Promise<void> => {\n const { plugins, ...rest } = params;\n if (plugins.length === 0) {\n return;\n }\n for (const plugin of plugins) {\n if (!plugin[hook]) {\n continue;\n }\n /**\n * Keep any because we do not know which hook needs to be executed. This will be removed, so it does not matter.\n */\n await plugin[hook](rest as any);\n }\n};\n"],"mappings":";;;;;;;;;AAAA;;AAIO,MAAMA,iBAAiB,GAAG,OAC7BC,IAA4B,EAC5BC,MAAoF,KACpE;EAChB,MAAM;MAAEC;IAAiB,CAAC,GAAGD,MAAM;IAAfE,IAAI,0CAAKF,MAAM;EACnC,IAAIC,OAAO,CAACE,MAAM,KAAK,CAAC,EAAE;IACtB;EACJ;EACA,KAAK,MAAMC,MAAM,IAAIH,OAAO,EAAE;IAC1B,IAAI,CAACG,MAAM,CAACL,IAAI,CAAC,EAAE;MACf;IACJ;IACA;AACR;AACA;IACQ,MAAMK,MAAM,CAACL,IAAI,CAAC,CAACG,IAAI,CAAQ;EACnC;AACJ,CAAC;AAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"names":["FilePhysicalStoragePlugin","Plugin","constructor","params","_params","upload","WebinyError","delete"],"sources":["FilePhysicalStoragePlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport WebinyError from \"@webiny/error\";\nimport { FileManagerSettings } from \"~/types\";\n\nexport interface FilePhysicalStoragePluginParams<\n U extends FilePhysicalStoragePluginUploadParams,\n D extends FilePhysicalStoragePluginDeleteParams\n> {\n upload: (args: U) => Promise<any>;\n delete: (args: D) => Promise<void>;\n}\n\nexport interface FilePhysicalStoragePluginUploadParams {\n settings: FileManagerSettings;\n buffer: Buffer;\n}\n\nexport interface FilePhysicalStoragePluginDeleteParams {\n key: string;\n}\n\nexport class FilePhysicalStoragePlugin<\n U extends FilePhysicalStoragePluginUploadParams = FilePhysicalStoragePluginUploadParams,\n D extends FilePhysicalStoragePluginDeleteParams = FilePhysicalStoragePluginDeleteParams\n> extends Plugin {\n public static override readonly type: string = \"api-file-manager-storage\";\n private readonly _params: FilePhysicalStoragePluginParams<U, D>;\n\n public constructor(params: FilePhysicalStoragePluginParams<U, D>) {\n super();\n this._params = params;\n }\n\n public async upload(params: U): Promise<any> {\n if (!this._params.upload) {\n throw new WebinyError(\n `You must define the \"upload\" method of this plugin.`,\n \"UPLOAD_METHOD_ERROR\"\n );\n }\n return this._params.upload(params);\n }\n\n public async delete(params: D): Promise<any> {\n if (!this._params.delete) {\n throw new WebinyError(\n `You must define the \"delete\" method of this plugin.`,\n \"DELETE_METHOD_ERROR\"\n );\n }\n return this._params.delete(params);\n }\n}\n"],"mappings":";;;;;;;;AAAA;AACA;AAoBO,MAAMA,yBAAyB,SAG5BC,eAAM,CAAC;EAINC,WAAW,CAACC,MAA6C,EAAE;IAC9D,KAAK,EAAE;IAAC;IACR,IAAI,CAACC,OAAO,GAAGD,MAAM;EACzB;EAEA,MAAaE,MAAM,CAACF,MAAS,EAAgB;IACzC,IAAI,CAAC,IAAI,CAACC,OAAO,CAACC,MAAM,EAAE;MACtB,MAAM,IAAIC,cAAW,CAChB,qDAAoD,EACrD,qBAAqB,CACxB;IACL;IACA,OAAO,IAAI,CAACF,OAAO,CAACC,MAAM,CAACF,MAAM,CAAC;EACtC;EAEA,MAAaI,MAAM,CAACJ,MAAS,EAAgB;IACzC,IAAI,CAAC,IAAI,CAACC,OAAO,CAACG,MAAM,EAAE;MACtB,MAAM,IAAID,cAAW,CAChB,qDAAoD,EACrD,qBAAqB,CACxB;IACL;IACA,OAAO,IAAI,CAACF,OAAO,CAACG,MAAM,CAACJ,MAAM,CAAC;EACtC;AACJ;AAAC;AAAA,8BA/BYH,yBAAyB,UAIa,0BAA0B"}
@@ -1,136 +0,0 @@
1
- import { Plugin } from "@webiny/plugins";
2
- import { File, FileManagerContext } from "../../types";
3
- /**
4
- * Parameters for beforeCreate lifecycle.
5
- */
6
- export interface BeforeCreateParams {
7
- context: FileManagerContext;
8
- /**
9
- * Data to be inserted into the storage.
10
- */
11
- data: File;
12
- }
13
- /**
14
- * Parameters for afterCreate lifecycle.
15
- */
16
- export interface AfterCreateParams {
17
- context: FileManagerContext;
18
- /**
19
- * Data that was inserted into the storage.
20
- */
21
- data: File;
22
- /**
23
- * Result of the storage operations create method.
24
- * Possibly changed something on the "data".
25
- */
26
- file: File;
27
- }
28
- /**
29
- * Parameters for beforeUpdate lifecycle.
30
- */
31
- export interface BeforeUpdateParams {
32
- context: FileManagerContext;
33
- /**
34
- * Original file from the storage.
35
- */
36
- original: File;
37
- /**
38
- * Data to be updated to the storage.
39
- */
40
- data: File;
41
- }
42
- /**
43
- * Parameters for afterUpdate lifecycle.
44
- */
45
- export interface AfterUpdateParams {
46
- context: FileManagerContext;
47
- /**
48
- * Original file from the storage.
49
- */
50
- original: File;
51
- /**
52
- * Data that was updated in the storage.
53
- */
54
- data: File;
55
- /**
56
- * Result of the storage operations update method.
57
- * Possibly changed something on the "data".
58
- */
59
- file: File;
60
- }
61
- /**
62
- * Parameters for beforeBatchCreate lifecycle.
63
- */
64
- export interface BeforeBatchCreateParams {
65
- context: FileManagerContext;
66
- /**
67
- * Files to be inserted into the storage.
68
- */
69
- data: File[];
70
- }
71
- /**
72
- * Parameters for afterBatchCreate lifecycle.
73
- */
74
- export interface AfterBatchCreateParams {
75
- context: FileManagerContext;
76
- /**
77
- * Files that were inserted into the storage.
78
- */
79
- data: File[];
80
- /**
81
- * Results of the insert.
82
- */
83
- files: File[];
84
- }
85
- /**
86
- * Parameters for beforeDelete lifecycle.
87
- */
88
- export interface BeforeDeleteParams {
89
- context: FileManagerContext;
90
- /**
91
- * File to be deleted from the storage.
92
- */
93
- file: File;
94
- }
95
- /**
96
- * Parameters for afterDelete lifecycle.
97
- */
98
- export interface AfterDeleteParams {
99
- context: FileManagerContext;
100
- /**
101
- * File that was deleted from the storage.
102
- */
103
- file: File;
104
- }
105
- /**
106
- * Definition for the constructor parameters of the FilePlugin.
107
- *
108
- * @category FilePlugin
109
- */
110
- export interface FilePluginParams {
111
- beforeCreate?: (params: BeforeCreateParams) => Promise<void>;
112
- afterCreate?: (params: AfterCreateParams) => Promise<void>;
113
- beforeUpdate?: (params: BeforeUpdateParams) => Promise<void>;
114
- afterUpdate?: (params: AfterUpdateParams) => Promise<void>;
115
- beforeBatchCreate?: (params: BeforeBatchCreateParams) => Promise<void>;
116
- afterBatchCreate?: (params: AfterBatchCreateParams) => Promise<void>;
117
- beforeDelete?: (params: BeforeDeleteParams) => Promise<void>;
118
- afterDelete?: (params: AfterDeleteParams) => Promise<void>;
119
- }
120
- export declare class FilePlugin extends Plugin {
121
- static readonly type: string;
122
- private readonly _params;
123
- constructor(params?: FilePluginParams);
124
- beforeCreate(params: BeforeCreateParams): Promise<void>;
125
- afterCreate(params: AfterCreateParams): Promise<void>;
126
- beforeUpdate(params: BeforeUpdateParams): Promise<void>;
127
- afterUpdate(params: AfterUpdateParams): Promise<void>;
128
- beforeBatchCreate(params: BeforeBatchCreateParams): Promise<void>;
129
- afterBatchCreate(params: AfterBatchCreateParams): Promise<void>;
130
- beforeDelete(params: BeforeDeleteParams): Promise<void>;
131
- afterDelete(params: AfterDeleteParams): Promise<void>;
132
- /**
133
- * Keep any here because it can be a number of params. Method is internal so no need to complicate the code.
134
- */
135
- private _execute;
136
- }
@@ -1,52 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.FilePlugin = void 0;
8
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
- var _plugins = require("@webiny/plugins");
10
- class FilePlugin extends _plugins.Plugin {
11
- constructor(params) {
12
- super();
13
- (0, _defineProperty2.default)(this, "_params", void 0);
14
- this._params = params || {};
15
- }
16
- async beforeCreate(params) {
17
- await this._execute("beforeCreate", params);
18
- }
19
- async afterCreate(params) {
20
- await this._execute("afterCreate", params);
21
- }
22
- async beforeUpdate(params) {
23
- await this._execute("beforeUpdate", params);
24
- }
25
- async afterUpdate(params) {
26
- await this._execute("afterUpdate", params);
27
- }
28
- async beforeBatchCreate(params) {
29
- await this._execute("beforeBatchCreate", params);
30
- }
31
- async afterBatchCreate(params) {
32
- await this._execute("afterBatchCreate", params);
33
- }
34
- async beforeDelete(params) {
35
- await this._execute("beforeDelete", params);
36
- }
37
- async afterDelete(params) {
38
- await this._execute("afterDelete", params);
39
- }
40
- /**
41
- * Keep any here because it can be a number of params. Method is internal so no need to complicate the code.
42
- */
43
- async _execute(callback, params) {
44
- const cb = this._params[callback];
45
- if (typeof cb !== "function") {
46
- return;
47
- }
48
- await cb(params);
49
- }
50
- }
51
- exports.FilePlugin = FilePlugin;
52
- (0, _defineProperty2.default)(FilePlugin, "type", "fm.file");
@@ -1 +0,0 @@
1
- {"version":3,"names":["FilePlugin","Plugin","constructor","params","_params","beforeCreate","_execute","afterCreate","beforeUpdate","afterUpdate","beforeBatchCreate","afterBatchCreate","beforeDelete","afterDelete","callback","cb"],"sources":["FilePlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport { File, FileManagerContext } from \"~/types\";\n\n/**\n * Parameters for beforeCreate lifecycle.\n */\nexport interface BeforeCreateParams {\n context: FileManagerContext;\n /**\n * Data to be inserted into the storage.\n */\n data: File;\n}\n/**\n * Parameters for afterCreate lifecycle.\n */\nexport interface AfterCreateParams {\n context: FileManagerContext;\n /**\n * Data that was inserted into the storage.\n */\n data: File;\n /**\n * Result of the storage operations create method.\n * Possibly changed something on the \"data\".\n */\n file: File;\n}\n/**\n * Parameters for beforeUpdate lifecycle.\n */\nexport interface BeforeUpdateParams {\n context: FileManagerContext;\n /**\n * Original file from the storage.\n */\n original: File;\n /**\n * Data to be updated to the storage.\n */\n data: File;\n}\n/**\n * Parameters for afterUpdate lifecycle.\n */\nexport interface AfterUpdateParams {\n context: FileManagerContext;\n /**\n * Original file from the storage.\n */\n original: File;\n /**\n * Data that was updated in the storage.\n */\n data: File;\n /**\n * Result of the storage operations update method.\n * Possibly changed something on the \"data\".\n */\n file: File;\n}\n/**\n * Parameters for beforeBatchCreate lifecycle.\n */\nexport interface BeforeBatchCreateParams {\n context: FileManagerContext;\n /**\n * Files to be inserted into the storage.\n */\n data: File[];\n}\n\n/**\n * Parameters for afterBatchCreate lifecycle.\n */\nexport interface AfterBatchCreateParams {\n context: FileManagerContext;\n /**\n * Files that were inserted into the storage.\n */\n data: File[];\n /**\n * Results of the insert.\n */\n files: File[];\n}\n/**\n * Parameters for beforeDelete lifecycle.\n */\nexport interface BeforeDeleteParams {\n context: FileManagerContext;\n /**\n * File to be deleted from the storage.\n */\n file: File;\n}\n/**\n * Parameters for afterDelete lifecycle.\n */\nexport interface AfterDeleteParams {\n context: FileManagerContext;\n /**\n * File that was deleted from the storage.\n */\n file: File;\n}\n\n/**\n * Definition for the constructor parameters of the FilePlugin.\n *\n * @category FilePlugin\n */\nexport interface FilePluginParams {\n beforeCreate?: (params: BeforeCreateParams) => Promise<void>;\n afterCreate?: (params: AfterCreateParams) => Promise<void>;\n beforeUpdate?: (params: BeforeUpdateParams) => Promise<void>;\n afterUpdate?: (params: AfterUpdateParams) => Promise<void>;\n beforeBatchCreate?: (params: BeforeBatchCreateParams) => Promise<void>;\n afterBatchCreate?: (params: AfterBatchCreateParams) => Promise<void>;\n beforeDelete?: (params: BeforeDeleteParams) => Promise<void>;\n afterDelete?: (params: AfterDeleteParams) => Promise<void>;\n}\n\nexport class FilePlugin extends Plugin {\n public static override readonly type: string = \"fm.file\";\n private readonly _params: FilePluginParams;\n\n public constructor(params?: FilePluginParams) {\n super();\n this._params = params || ({} as any);\n }\n\n public async beforeCreate(params: BeforeCreateParams): Promise<void> {\n await this._execute(\"beforeCreate\", params);\n }\n\n public async afterCreate(params: AfterCreateParams): Promise<void> {\n await this._execute(\"afterCreate\", params);\n }\n\n public async beforeUpdate(params: BeforeUpdateParams): Promise<void> {\n await this._execute(\"beforeUpdate\", params);\n }\n\n public async afterUpdate(params: AfterUpdateParams): Promise<void> {\n await this._execute(\"afterUpdate\", params);\n }\n\n public async beforeBatchCreate(params: BeforeBatchCreateParams): Promise<void> {\n await this._execute(\"beforeBatchCreate\", params);\n }\n\n public async afterBatchCreate(params: AfterBatchCreateParams): Promise<void> {\n await this._execute(\"afterBatchCreate\", params);\n }\n\n public async beforeDelete(params: BeforeDeleteParams): Promise<void> {\n await this._execute(\"beforeDelete\", params);\n }\n\n public async afterDelete(params: AfterDeleteParams): Promise<void> {\n await this._execute(\"afterDelete\", params);\n }\n /**\n * Keep any here because it can be a number of params. Method is internal so no need to complicate the code.\n */\n private async _execute(callback: keyof FilePluginParams, params: any): Promise<void> {\n const cb = this._params[callback];\n if (typeof cb !== \"function\") {\n return;\n }\n await cb(params);\n }\n}\n"],"mappings":";;;;;;;;AAAA;AA2HO,MAAMA,UAAU,SAASC,eAAM,CAAC;EAI5BC,WAAW,CAACC,MAAyB,EAAE;IAC1C,KAAK,EAAE;IAAC;IACR,IAAI,CAACC,OAAO,GAAGD,MAAM,IAAK,CAAC,CAAS;EACxC;EAEA,MAAaE,YAAY,CAACF,MAA0B,EAAiB;IACjE,MAAM,IAAI,CAACG,QAAQ,CAAC,cAAc,EAAEH,MAAM,CAAC;EAC/C;EAEA,MAAaI,WAAW,CAACJ,MAAyB,EAAiB;IAC/D,MAAM,IAAI,CAACG,QAAQ,CAAC,aAAa,EAAEH,MAAM,CAAC;EAC9C;EAEA,MAAaK,YAAY,CAACL,MAA0B,EAAiB;IACjE,MAAM,IAAI,CAACG,QAAQ,CAAC,cAAc,EAAEH,MAAM,CAAC;EAC/C;EAEA,MAAaM,WAAW,CAACN,MAAyB,EAAiB;IAC/D,MAAM,IAAI,CAACG,QAAQ,CAAC,aAAa,EAAEH,MAAM,CAAC;EAC9C;EAEA,MAAaO,iBAAiB,CAACP,MAA+B,EAAiB;IAC3E,MAAM,IAAI,CAACG,QAAQ,CAAC,mBAAmB,EAAEH,MAAM,CAAC;EACpD;EAEA,MAAaQ,gBAAgB,CAACR,MAA8B,EAAiB;IACzE,MAAM,IAAI,CAACG,QAAQ,CAAC,kBAAkB,EAAEH,MAAM,CAAC;EACnD;EAEA,MAAaS,YAAY,CAACT,MAA0B,EAAiB;IACjE,MAAM,IAAI,CAACG,QAAQ,CAAC,cAAc,EAAEH,MAAM,CAAC;EAC/C;EAEA,MAAaU,WAAW,CAACV,MAAyB,EAAiB;IAC/D,MAAM,IAAI,CAACG,QAAQ,CAAC,aAAa,EAAEH,MAAM,CAAC;EAC9C;EACA;AACJ;AACA;EACI,MAAcG,QAAQ,CAACQ,QAAgC,EAAEX,MAAW,EAAiB;IACjF,MAAMY,EAAE,GAAG,IAAI,CAACX,OAAO,CAACU,QAAQ,CAAC;IACjC,IAAI,OAAOC,EAAE,KAAK,UAAU,EAAE;MAC1B;IACJ;IACA,MAAMA,EAAE,CAACZ,MAAM,CAAC;EACpB;AACJ;AAAC;AAAA,8BAlDYH,UAAU,UAC4B,SAAS"}
@@ -1 +0,0 @@
1
- {"version":3,"names":["FileStorageTransformPlugin","Plugin","constructor","params","_params","toStorage","file","fromStorage"],"sources":["FileStorageTransformPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport { File } from \"~/types\";\n\nexport interface FileStorageTransformPluginToParams {\n /**\n * File that is being sent to the storage operations method.\n */\n file: File & Record<string, any>;\n}\n\nexport interface FileStorageTransformPluginFromParams {\n /**\n * File that was fetched from the storage operations method.\n */\n file: File & Record<string, any>;\n}\n\nexport interface FileStorageTransformPluginParams {\n toStorage?: (params: FileStorageTransformPluginToParams) => Promise<File & Record<string, any>>;\n fromStorage?: (\n params: FileStorageTransformPluginFromParams\n ) => Promise<File & Record<string, any>>;\n}\n\nexport class FileStorageTransformPlugin extends Plugin {\n public static override readonly type: string = \"fm.files.storage.transform\";\n private readonly _params: FileStorageTransformPluginParams;\n\n public constructor(params: FileStorageTransformPluginParams) {\n super();\n\n this._params = params;\n }\n\n /**\n * Transform the file value into something that can be stored.\n * Be aware that you must return the whole file object.\n */\n public async toStorage(\n params: FileStorageTransformPluginToParams\n ): Promise<File & Record<string, any>> {\n if (!this._params.toStorage) {\n return params.file;\n }\n return this._params.toStorage(params);\n }\n /**\n * Transform the file value from the storage type to one required by our system.\n * Be aware that you must return the whole file object.\n * This method MUST reverse what ever toStorage method changed on the file object.\n */\n public async fromStorage(\n params: FileStorageTransformPluginFromParams\n ): Promise<File & Record<string, any>> {\n if (!this._params.fromStorage) {\n return params.file;\n }\n return this._params.fromStorage(params);\n }\n}\n"],"mappings":";;;;;;;;AAAA;AAwBO,MAAMA,0BAA0B,SAASC,eAAM,CAAC;EAI5CC,WAAW,CAACC,MAAwC,EAAE;IACzD,KAAK,EAAE;IAAC;IAER,IAAI,CAACC,OAAO,GAAGD,MAAM;EACzB;;EAEA;AACJ;AACA;AACA;EACI,MAAaE,SAAS,CAClBF,MAA0C,EACP;IACnC,IAAI,CAAC,IAAI,CAACC,OAAO,CAACC,SAAS,EAAE;MACzB,OAAOF,MAAM,CAACG,IAAI;IACtB;IACA,OAAO,IAAI,CAACF,OAAO,CAACC,SAAS,CAACF,MAAM,CAAC;EACzC;EACA;AACJ;AACA;AACA;AACA;EACI,MAAaI,WAAW,CACpBJ,MAA4C,EACT;IACnC,IAAI,CAAC,IAAI,CAACC,OAAO,CAACG,WAAW,EAAE;MAC3B,OAAOJ,MAAM,CAACG,IAAI;IACtB;IACA,OAAO,IAAI,CAACF,OAAO,CAACG,WAAW,CAACJ,MAAM,CAAC;EAC3C;AACJ;AAAC;AAAA,8BAnCYH,0BAA0B,UACY,4BAA4B"}
@@ -1,9 +0,0 @@
1
- import { Plugin } from "@webiny/plugins";
2
- import { FileManagerContext, FileManagerFilesStorageOperations } from "../../types";
3
- export interface FilesStorageOperationsProviderPluginParams<T = FileManagerContext> {
4
- context: T;
5
- }
6
- export declare abstract class FilesStorageOperationsProviderPlugin extends Plugin {
7
- static readonly type: string;
8
- abstract provide(params: FilesStorageOperationsProviderPluginParams): Promise<FileManagerFilesStorageOperations>;
9
- }
@@ -1,12 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.FilesStorageOperationsProviderPlugin = void 0;
8
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
- var _plugins = require("@webiny/plugins");
10
- class FilesStorageOperationsProviderPlugin extends _plugins.Plugin {}
11
- exports.FilesStorageOperationsProviderPlugin = FilesStorageOperationsProviderPlugin;
12
- (0, _defineProperty2.default)(FilesStorageOperationsProviderPlugin, "type", "fm.storageOperationsProvider.files");
@@ -1 +0,0 @@
1
- {"version":3,"names":["FilesStorageOperationsProviderPlugin","Plugin"],"sources":["FilesStorageOperationsProviderPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport { FileManagerContext, FileManagerFilesStorageOperations } from \"~/types\";\n\nexport interface FilesStorageOperationsProviderPluginParams<T = FileManagerContext> {\n context: T;\n}\n\nexport abstract class FilesStorageOperationsProviderPlugin extends Plugin {\n public static override readonly type: string = \"fm.storageOperationsProvider.files\";\n\n public abstract provide(\n params: FilesStorageOperationsProviderPluginParams\n ): Promise<FileManagerFilesStorageOperations>;\n}\n"],"mappings":";;;;;;;;AAAA;AAOO,MAAeA,oCAAoC,SAASC,eAAM,CAAC;AAMzE;AAAA,8BANqBD,oCAAoC,UACP,oCAAoC"}
@@ -1,19 +0,0 @@
1
- import { FileManagerContext } from "../../types";
2
- import { Plugin } from "@webiny/plugins";
3
- export interface InstallationPluginParams {
4
- context: FileManagerContext;
5
- }
6
- export declare type CallbackFunction<TParams> = (params: TParams) => Promise<void>;
7
- interface InstallationPluginConfig {
8
- beforeInstall?: CallbackFunction<InstallationPluginParams>;
9
- afterInstall?: CallbackFunction<InstallationPluginParams>;
10
- }
11
- export declare abstract class InstallationPlugin extends Plugin {
12
- static readonly type: string;
13
- private readonly _config;
14
- constructor(config?: Partial<InstallationPluginConfig>);
15
- beforeInstall(params: InstallationPluginParams): Promise<void>;
16
- afterInstall(params: InstallationPluginParams): Promise<void>;
17
- private _execute;
18
- }
19
- export {};
@@ -1,31 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.InstallationPlugin = void 0;
8
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
- var _plugins = require("@webiny/plugins");
10
- class InstallationPlugin extends _plugins.Plugin {
11
- constructor(config) {
12
- super();
13
- (0, _defineProperty2.default)(this, "_config", void 0);
14
- this._config = config || {};
15
- }
16
- async beforeInstall(params) {
17
- return this._execute("beforeInstall", params);
18
- }
19
- async afterInstall(params) {
20
- return this._execute("afterInstall", params);
21
- }
22
- async _execute(callback, params) {
23
- const cb = this._config[callback];
24
- if (!cb) {
25
- return;
26
- }
27
- return cb(params);
28
- }
29
- }
30
- exports.InstallationPlugin = InstallationPlugin;
31
- (0, _defineProperty2.default)(InstallationPlugin, "type", "fm.install");
@@ -1 +0,0 @@
1
- {"version":3,"names":["InstallationPlugin","Plugin","constructor","config","_config","beforeInstall","params","_execute","afterInstall","callback","cb"],"sources":["InstallationPlugin.ts"],"sourcesContent":["import { FileManagerContext } from \"~/types\";\nimport { Plugin } from \"@webiny/plugins\";\n\nexport interface InstallationPluginParams {\n context: FileManagerContext;\n}\nexport type CallbackFunction<TParams> = (params: TParams) => Promise<void>;\n\ninterface InstallationPluginConfig {\n beforeInstall?: CallbackFunction<InstallationPluginParams>;\n afterInstall?: CallbackFunction<InstallationPluginParams>;\n}\n\nexport abstract class InstallationPlugin extends Plugin {\n public static override readonly type: string = \"fm.install\";\n private readonly _config: Partial<InstallationPluginConfig>;\n\n constructor(config?: Partial<InstallationPluginConfig>) {\n super();\n this._config = config || {};\n }\n\n public async beforeInstall(params: InstallationPluginParams): Promise<void> {\n return this._execute(\"beforeInstall\", params);\n }\n\n public async afterInstall(params: InstallationPluginParams): Promise<void> {\n return this._execute(\"afterInstall\", params);\n }\n\n private async _execute(\n callback: keyof InstallationPluginConfig,\n params: InstallationPluginParams\n ): Promise<void> {\n const cb = this._config[callback];\n if (!cb) {\n return;\n }\n return cb(params);\n }\n}\n"],"mappings":";;;;;;;;AACA;AAYO,MAAeA,kBAAkB,SAASC,eAAM,CAAC;EAIpDC,WAAW,CAACC,MAA0C,EAAE;IACpD,KAAK,EAAE;IAAC;IACR,IAAI,CAACC,OAAO,GAAGD,MAAM,IAAI,CAAC,CAAC;EAC/B;EAEA,MAAaE,aAAa,CAACC,MAAgC,EAAiB;IACxE,OAAO,IAAI,CAACC,QAAQ,CAAC,eAAe,EAAED,MAAM,CAAC;EACjD;EAEA,MAAaE,YAAY,CAACF,MAAgC,EAAiB;IACvE,OAAO,IAAI,CAACC,QAAQ,CAAC,cAAc,EAAED,MAAM,CAAC;EAChD;EAEA,MAAcC,QAAQ,CAClBE,QAAwC,EACxCH,MAAgC,EACnB;IACb,MAAMI,EAAE,GAAG,IAAI,CAACN,OAAO,CAACK,QAAQ,CAAC;IACjC,IAAI,CAACC,EAAE,EAAE;MACL;IACJ;IACA,OAAOA,EAAE,CAACJ,MAAM,CAAC;EACrB;AACJ;AAAC;AAAA,8BA3BqBN,kBAAkB,UACW,YAAY"}
@@ -1,9 +0,0 @@
1
- import { Plugin } from "@webiny/plugins";
2
- import { FileManagerContext, FileManagerSettingsStorageOperations } from "../../types";
3
- export interface SettingsStorageOperationsProviderPluginParams<T = FileManagerContext> {
4
- context: T;
5
- }
6
- export declare abstract class SettingsStorageOperationsProviderPlugin extends Plugin {
7
- static readonly type: string;
8
- abstract provide(params: SettingsStorageOperationsProviderPluginParams): Promise<FileManagerSettingsStorageOperations>;
9
- }
@@ -1,12 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.SettingsStorageOperationsProviderPlugin = void 0;
8
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
- var _plugins = require("@webiny/plugins");
10
- class SettingsStorageOperationsProviderPlugin extends _plugins.Plugin {}
11
- exports.SettingsStorageOperationsProviderPlugin = SettingsStorageOperationsProviderPlugin;
12
- (0, _defineProperty2.default)(SettingsStorageOperationsProviderPlugin, "type", "fm.storageOperationsProvider.settings");
@@ -1 +0,0 @@
1
- {"version":3,"names":["SettingsStorageOperationsProviderPlugin","Plugin"],"sources":["SettingsStorageOperationsProviderPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport { FileManagerContext, FileManagerSettingsStorageOperations } from \"~/types\";\n\nexport interface SettingsStorageOperationsProviderPluginParams<T = FileManagerContext> {\n context: T;\n}\n\nexport abstract class SettingsStorageOperationsProviderPlugin extends Plugin {\n public static override readonly type: string = \"fm.storageOperationsProvider.settings\";\n\n public abstract provide(\n params: SettingsStorageOperationsProviderPluginParams\n ): Promise<FileManagerSettingsStorageOperations>;\n}\n"],"mappings":";;;;;;;;AAAA;AAOO,MAAeA,uCAAuC,SAASC,eAAM,CAAC;AAM5E;AAAA,8BANqBD,uCAAuC,UACV,uCAAuC"}
@@ -1,9 +0,0 @@
1
- import { Plugin } from "@webiny/plugins";
2
- import { FileManagerContext, FileManagerSystemStorageOperations } from "../../types";
3
- export interface SystemStorageOperationsProviderPluginParams<T = FileManagerContext> {
4
- context: T;
5
- }
6
- export declare abstract class SystemStorageOperationsProviderPlugin extends Plugin {
7
- static readonly type: string;
8
- abstract provide(params: SystemStorageOperationsProviderPluginParams): Promise<FileManagerSystemStorageOperations>;
9
- }
@@ -1,12 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.SystemStorageOperationsProviderPlugin = void 0;
8
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
- var _plugins = require("@webiny/plugins");
10
- class SystemStorageOperationsProviderPlugin extends _plugins.Plugin {}
11
- exports.SystemStorageOperationsProviderPlugin = SystemStorageOperationsProviderPlugin;
12
- (0, _defineProperty2.default)(SystemStorageOperationsProviderPlugin, "type", "fm.storageOperationsProvider.system");
@@ -1 +0,0 @@
1
- {"version":3,"names":["SystemStorageOperationsProviderPlugin","Plugin"],"sources":["SystemStorageOperationsProviderPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport { FileManagerContext, FileManagerSystemStorageOperations } from \"~/types\";\n\nexport interface SystemStorageOperationsProviderPluginParams<T = FileManagerContext> {\n context: T;\n}\n\nexport abstract class SystemStorageOperationsProviderPlugin extends Plugin {\n public static override readonly type: string = \"fm.storageOperationsProvider.system\";\n\n public abstract provide(\n params: SystemStorageOperationsProviderPluginParams\n ): Promise<FileManagerSystemStorageOperations>;\n}\n"],"mappings":";;;;;;;;AAAA;AAOO,MAAeA,qCAAqC,SAASC,eAAM,CAAC;AAM1E;AAAA,8BANqBD,qCAAqC,UACR,qCAAqC"}
@@ -1,4 +0,0 @@
1
- import { FileManagerContext } from "../types";
2
- import { GraphQLSchemaPlugin } from "@webiny/handler-graphql/types";
3
- declare const plugin: GraphQLSchemaPlugin<FileManagerContext>;
4
- export default plugin;