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

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 (410) hide show
  1. package/README.md +7 -13
  2. package/contants.js +1 -7
  3. package/contants.js.map +1 -1
  4. package/delivery/AssetDelivery/Asset.d.ts +3 -7
  5. package/delivery/AssetDelivery/Asset.js +1 -11
  6. package/delivery/AssetDelivery/Asset.js.map +1 -1
  7. package/delivery/AssetDelivery/AssetDeliveryConfig.d.ts +11 -9
  8. package/delivery/AssetDelivery/AssetDeliveryConfig.js +18 -26
  9. package/delivery/AssetDelivery/AssetDeliveryConfig.js.map +1 -1
  10. package/delivery/AssetDelivery/AssetRequest.d.ts +1 -1
  11. package/delivery/AssetDelivery/AssetRequest.js +1 -8
  12. package/delivery/AssetDelivery/AssetRequest.js.map +1 -1
  13. package/delivery/AssetDelivery/FilesAssetRequestResolver.d.ts +3 -3
  14. package/delivery/AssetDelivery/FilesAssetRequestResolver.js +3 -10
  15. package/delivery/AssetDelivery/FilesAssetRequestResolver.js.map +1 -1
  16. package/delivery/AssetDelivery/NullAssetOutputStrategy.d.ts +1 -1
  17. package/delivery/AssetDelivery/NullAssetOutputStrategy.js +3 -10
  18. package/delivery/AssetDelivery/NullAssetOutputStrategy.js.map +1 -1
  19. package/delivery/AssetDelivery/NullAssetReply.d.ts +1 -1
  20. package/delivery/AssetDelivery/NullAssetReply.js +2 -9
  21. package/delivery/AssetDelivery/NullAssetReply.js.map +1 -1
  22. package/delivery/AssetDelivery/NullAssetResolver.d.ts +2 -2
  23. package/delivery/AssetDelivery/NullAssetResolver.js +1 -8
  24. package/delivery/AssetDelivery/NullAssetResolver.js.map +1 -1
  25. package/delivery/AssetDelivery/NullRequestResolver.d.ts +1 -1
  26. package/delivery/AssetDelivery/NullRequestResolver.js +1 -8
  27. package/delivery/AssetDelivery/NullRequestResolver.js.map +1 -1
  28. package/delivery/AssetDelivery/SetCacheControlHeaders.d.ts +1 -1
  29. package/delivery/AssetDelivery/SetCacheControlHeaders.js +1 -8
  30. package/delivery/AssetDelivery/SetCacheControlHeaders.js.map +1 -1
  31. package/delivery/AssetDelivery/SetResponseHeaders.d.ts +3 -3
  32. package/delivery/AssetDelivery/SetResponseHeaders.js +1 -8
  33. package/delivery/AssetDelivery/SetResponseHeaders.js.map +1 -1
  34. package/delivery/AssetDelivery/abstractions/AssetContentsReader.d.ts +1 -3
  35. package/delivery/AssetDelivery/abstractions/AssetContentsReader.js +1 -5
  36. package/delivery/AssetDelivery/abstractions/AssetContentsReader.js.map +1 -1
  37. package/delivery/AssetDelivery/abstractions/AssetOutputStrategy.d.ts +1 -1
  38. package/delivery/AssetDelivery/abstractions/AssetOutputStrategy.js +1 -5
  39. package/delivery/AssetDelivery/abstractions/AssetOutputStrategy.js.map +1 -1
  40. package/delivery/AssetDelivery/abstractions/AssetProcessor.d.ts +1 -1
  41. package/delivery/AssetDelivery/abstractions/AssetProcessor.js +1 -5
  42. package/delivery/AssetDelivery/abstractions/AssetProcessor.js.map +1 -1
  43. package/delivery/AssetDelivery/abstractions/AssetReply.js +3 -10
  44. package/delivery/AssetDelivery/abstractions/AssetReply.js.map +1 -1
  45. package/delivery/AssetDelivery/abstractions/AssetRequestResolver.d.ts +2 -2
  46. package/delivery/AssetDelivery/abstractions/AssetRequestResolver.js +1 -5
  47. package/delivery/AssetDelivery/abstractions/AssetRequestResolver.js.map +1 -1
  48. package/delivery/AssetDelivery/abstractions/AssetResolver.d.ts +1 -1
  49. package/delivery/AssetDelivery/abstractions/AssetResolver.js +1 -5
  50. package/delivery/AssetDelivery/abstractions/AssetResolver.js.map +1 -1
  51. package/delivery/AssetDelivery/abstractions/AssetTransformationStrategy.d.ts +1 -1
  52. package/delivery/AssetDelivery/abstractions/AssetTransformationStrategy.js +1 -5
  53. package/delivery/AssetDelivery/abstractions/AssetTransformationStrategy.js.map +1 -1
  54. package/delivery/AssetDelivery/createAssetDeliveryPluginLoader.d.ts +1 -1
  55. package/delivery/AssetDelivery/createAssetDeliveryPluginLoader.js +1 -8
  56. package/delivery/AssetDelivery/createAssetDeliveryPluginLoader.js.map +1 -1
  57. package/delivery/AssetDelivery/privateFiles/AssetAuthorizer.d.ts +1 -1
  58. package/delivery/AssetDelivery/privateFiles/AssetAuthorizer.js +1 -5
  59. package/delivery/AssetDelivery/privateFiles/AssetAuthorizer.js.map +1 -1
  60. package/delivery/AssetDelivery/privateFiles/NotAuthorizedAssetReply.d.ts +1 -1
  61. package/delivery/AssetDelivery/privateFiles/NotAuthorizedAssetReply.js +4 -11
  62. package/delivery/AssetDelivery/privateFiles/NotAuthorizedAssetReply.js.map +1 -1
  63. package/delivery/AssetDelivery/privateFiles/NotAuthorizedOutputStrategy.d.ts +1 -1
  64. package/delivery/AssetDelivery/privateFiles/NotAuthorizedOutputStrategy.js +3 -10
  65. package/delivery/AssetDelivery/privateFiles/NotAuthorizedOutputStrategy.js.map +1 -1
  66. package/delivery/AssetDelivery/privateFiles/PrivateAuthenticatedAuthorizer.d.ts +4 -3
  67. package/delivery/AssetDelivery/privateFiles/PrivateAuthenticatedAuthorizer.js +3 -11
  68. package/delivery/AssetDelivery/privateFiles/PrivateAuthenticatedAuthorizer.js.map +1 -1
  69. package/delivery/AssetDelivery/privateFiles/PrivateCache.d.ts +1 -1
  70. package/delivery/AssetDelivery/privateFiles/PrivateCache.js +4 -11
  71. package/delivery/AssetDelivery/privateFiles/PrivateCache.js.map +1 -1
  72. package/delivery/AssetDelivery/privateFiles/PrivateFileAssetRequestResolver.d.ts +3 -3
  73. package/delivery/AssetDelivery/privateFiles/PrivateFileAssetRequestResolver.js +3 -10
  74. package/delivery/AssetDelivery/privateFiles/PrivateFileAssetRequestResolver.js.map +1 -1
  75. package/delivery/AssetDelivery/privateFiles/PrivateFilesAssetProcessor.d.ts +4 -4
  76. package/delivery/AssetDelivery/privateFiles/PrivateFilesAssetProcessor.js +21 -21
  77. package/delivery/AssetDelivery/privateFiles/PrivateFilesAssetProcessor.js.map +1 -1
  78. package/delivery/AssetDelivery/privateFiles/PublicCache.d.ts +1 -1
  79. package/delivery/AssetDelivery/privateFiles/PublicCache.js +4 -11
  80. package/delivery/AssetDelivery/privateFiles/PublicCache.js.map +1 -1
  81. package/delivery/AssetDelivery/privateFiles/RedirectToPrivateUrlOutputStrategy.d.ts +2 -2
  82. package/delivery/AssetDelivery/privateFiles/RedirectToPrivateUrlOutputStrategy.js +5 -12
  83. package/delivery/AssetDelivery/privateFiles/RedirectToPrivateUrlOutputStrategy.js.map +1 -1
  84. package/delivery/AssetDelivery/privateFiles/RedirectToPublicUrlOutputStrategy.d.ts +2 -2
  85. package/delivery/AssetDelivery/privateFiles/RedirectToPublicUrlOutputStrategy.js +5 -12
  86. package/delivery/AssetDelivery/privateFiles/RedirectToPublicUrlOutputStrategy.js.map +1 -1
  87. package/delivery/AssetDelivery/transformation/PassthroughAssetProcessor.d.ts +1 -1
  88. package/delivery/AssetDelivery/transformation/PassthroughAssetProcessor.js +1 -8
  89. package/delivery/AssetDelivery/transformation/PassthroughAssetProcessor.js.map +1 -1
  90. package/delivery/AssetDelivery/transformation/PassthroughAssetTransformationStrategy.d.ts +1 -1
  91. package/delivery/AssetDelivery/transformation/PassthroughAssetTransformationStrategy.js +1 -8
  92. package/delivery/AssetDelivery/transformation/PassthroughAssetTransformationStrategy.js.map +1 -1
  93. package/delivery/AssetDelivery/transformation/TransformationAssetProcessor.d.ts +1 -1
  94. package/delivery/AssetDelivery/transformation/TransformationAssetProcessor.js +1 -8
  95. package/delivery/AssetDelivery/transformation/TransformationAssetProcessor.js.map +1 -1
  96. package/delivery/index.d.ts +16 -17
  97. package/delivery/index.js +10 -192
  98. package/delivery/index.js.map +1 -1
  99. package/delivery/setupAssetDelivery.d.ts +2 -6
  100. package/delivery/setupAssetDelivery.js +21 -35
  101. package/delivery/setupAssetDelivery.js.map +1 -1
  102. package/domain/file/abstractions.d.ts +9 -0
  103. package/domain/file/abstractions.js +8 -0
  104. package/domain/file/abstractions.js.map +1 -0
  105. package/domain/file/errors.d.ts +59 -0
  106. package/domain/file/errors.js +89 -0
  107. package/domain/file/errors.js.map +1 -0
  108. package/domain/file/file.model.d.ts +12 -0
  109. package/domain/file/file.model.js +56 -0
  110. package/domain/file/file.model.js.map +1 -0
  111. package/domain/file/types.d.ts +51 -0
  112. package/domain/file/types.js +3 -0
  113. package/domain/file/types.js.map +1 -0
  114. package/domain/identity/Identity.d.ts +9 -0
  115. package/domain/identity/Identity.js +11 -0
  116. package/domain/identity/Identity.js.map +1 -0
  117. package/domain/settings/constants.d.ts +1 -0
  118. package/domain/settings/constants.js +3 -0
  119. package/domain/settings/constants.js.map +1 -0
  120. package/domain/settings/errors.d.ts +18 -0
  121. package/domain/settings/errors.js +30 -0
  122. package/domain/settings/errors.js.map +1 -0
  123. package/domain/settings/types.d.ts +10 -0
  124. package/domain/settings/types.js +3 -0
  125. package/domain/settings/types.js.map +1 -0
  126. package/domain/settings/validation.d.ts +14 -0
  127. package/domain/settings/validation.js +36 -0
  128. package/domain/settings/validation.js.map +1 -0
  129. package/features/FileManagerFeature.d.ts +1 -0
  130. package/features/FileManagerFeature.js +28 -0
  131. package/features/FileManagerFeature.js.map +1 -0
  132. package/features/file/CreateFile/CreateFileRepository.d.ts +15 -0
  133. package/features/file/CreateFile/CreateFileRepository.js +30 -0
  134. package/features/file/CreateFile/CreateFileRepository.js.map +1 -0
  135. package/features/file/CreateFile/CreateFileUseCase.d.ts +21 -0
  136. package/features/file/CreateFile/CreateFileUseCase.js +89 -0
  137. package/features/file/CreateFile/CreateFileUseCase.js.map +1 -0
  138. package/features/file/CreateFile/abstractions.d.ts +57 -0
  139. package/features/file/CreateFile/abstractions.js +15 -0
  140. package/features/file/CreateFile/abstractions.js.map +1 -0
  141. package/features/file/CreateFile/events.d.ts +29 -0
  142. package/features/file/CreateFile/events.js +28 -0
  143. package/features/file/CreateFile/events.js.map +1 -0
  144. package/features/file/CreateFile/feature.d.ts +1 -0
  145. package/features/file/CreateFile/feature.js +12 -0
  146. package/features/file/CreateFile/feature.js.map +1 -0
  147. package/features/file/CreateFile/index.d.ts +2 -0
  148. package/features/file/CreateFile/index.js +4 -0
  149. package/features/file/CreateFile/index.js.map +1 -0
  150. package/features/file/CreateFilesInBatch/CreateFilesInBatchRepository.d.ts +13 -0
  151. package/features/file/CreateFilesInBatch/CreateFilesInBatchRepository.js +24 -0
  152. package/features/file/CreateFilesInBatch/CreateFilesInBatchRepository.js.map +1 -0
  153. package/features/file/CreateFilesInBatch/CreateFilesInBatchUseCase.d.ts +19 -0
  154. package/features/file/CreateFilesInBatch/CreateFilesInBatchUseCase.js +84 -0
  155. package/features/file/CreateFilesInBatch/CreateFilesInBatchUseCase.js.map +1 -0
  156. package/features/file/CreateFilesInBatch/abstractions.d.ts +40 -0
  157. package/features/file/CreateFilesInBatch/abstractions.js +15 -0
  158. package/features/file/CreateFilesInBatch/abstractions.js.map +1 -0
  159. package/features/file/CreateFilesInBatch/events.d.ts +29 -0
  160. package/features/file/CreateFilesInBatch/events.js +28 -0
  161. package/features/file/CreateFilesInBatch/events.js.map +1 -0
  162. package/features/file/CreateFilesInBatch/feature.d.ts +1 -0
  163. package/features/file/CreateFilesInBatch/feature.js +12 -0
  164. package/features/file/CreateFilesInBatch/feature.js.map +1 -0
  165. package/features/file/CreateFilesInBatch/index.d.ts +1 -0
  166. package/features/file/CreateFilesInBatch/index.js +3 -0
  167. package/features/file/CreateFilesInBatch/index.js.map +1 -0
  168. package/features/file/DeleteFile/DeleteFileRepository.d.ts +15 -0
  169. package/features/file/DeleteFile/DeleteFileRepository.js +30 -0
  170. package/features/file/DeleteFile/DeleteFileRepository.js.map +1 -0
  171. package/features/file/DeleteFile/DeleteFileUseCase.d.ts +17 -0
  172. package/features/file/DeleteFile/DeleteFileUseCase.js +45 -0
  173. package/features/file/DeleteFile/DeleteFileUseCase.js.map +1 -0
  174. package/features/file/DeleteFile/abstractions.d.ts +37 -0
  175. package/features/file/DeleteFile/abstractions.js +15 -0
  176. package/features/file/DeleteFile/abstractions.js.map +1 -0
  177. package/features/file/DeleteFile/events.d.ts +27 -0
  178. package/features/file/DeleteFile/events.js +28 -0
  179. package/features/file/DeleteFile/events.js.map +1 -0
  180. package/features/file/DeleteFile/feature.d.ts +1 -0
  181. package/features/file/DeleteFile/feature.js +12 -0
  182. package/features/file/DeleteFile/feature.js.map +1 -0
  183. package/features/file/DeleteFile/index.d.ts +2 -0
  184. package/features/file/DeleteFile/index.js +4 -0
  185. package/features/file/DeleteFile/index.js.map +1 -0
  186. package/features/file/FileUrlGenerator/abstractions.d.ts +8 -0
  187. package/features/file/FileUrlGenerator/abstractions.js +4 -0
  188. package/features/file/FileUrlGenerator/abstractions.js.map +1 -0
  189. package/features/file/GetFile/GetFileRepository.d.ts +15 -0
  190. package/features/file/GetFile/GetFileRepository.js +33 -0
  191. package/features/file/GetFile/GetFileRepository.js.map +1 -0
  192. package/features/file/GetFile/GetFileUseCase.d.ts +14 -0
  193. package/features/file/GetFile/GetFileUseCase.js +31 -0
  194. package/features/file/GetFile/GetFileUseCase.js.map +1 -0
  195. package/features/file/GetFile/abstractions.d.ts +38 -0
  196. package/features/file/GetFile/abstractions.js +15 -0
  197. package/features/file/GetFile/abstractions.js.map +1 -0
  198. package/features/file/GetFile/feature.d.ts +1 -0
  199. package/features/file/GetFile/feature.js +12 -0
  200. package/features/file/GetFile/feature.js.map +1 -0
  201. package/features/file/GetFile/index.d.ts +1 -0
  202. package/features/file/GetFile/index.js +3 -0
  203. package/features/file/GetFile/index.js.map +1 -0
  204. package/features/file/ListFiles/ListFilesRepository.d.ts +18 -0
  205. package/features/file/ListFiles/ListFilesRepository.js +51 -0
  206. package/features/file/ListFiles/ListFilesRepository.js.map +1 -0
  207. package/features/file/ListFiles/ListFilesUseCase.d.ts +15 -0
  208. package/features/file/ListFiles/ListFilesUseCase.js +45 -0
  209. package/features/file/ListFiles/ListFilesUseCase.js.map +1 -0
  210. package/features/file/ListFiles/abstractions.d.ts +47 -0
  211. package/features/file/ListFiles/abstractions.js +15 -0
  212. package/features/file/ListFiles/abstractions.js.map +1 -0
  213. package/features/file/ListFiles/feature.d.ts +1 -0
  214. package/features/file/ListFiles/feature.js +12 -0
  215. package/features/file/ListFiles/feature.js.map +1 -0
  216. package/features/file/ListFiles/index.d.ts +1 -0
  217. package/features/file/ListFiles/index.js +3 -0
  218. package/features/file/ListFiles/index.js.map +1 -0
  219. package/features/file/ListTags/ListTagsRepository.d.ts +16 -0
  220. package/features/file/ListTags/ListTagsRepository.js +47 -0
  221. package/features/file/ListTags/ListTagsRepository.js.map +1 -0
  222. package/features/file/ListTags/ListTagsUseCase.d.ts +13 -0
  223. package/features/file/ListTags/ListTagsUseCase.js +31 -0
  224. package/features/file/ListTags/ListTagsUseCase.js.map +1 -0
  225. package/features/file/ListTags/abstractions.d.ts +43 -0
  226. package/features/file/ListTags/abstractions.js +15 -0
  227. package/features/file/ListTags/abstractions.js.map +1 -0
  228. package/features/file/ListTags/feature.d.ts +1 -0
  229. package/features/file/ListTags/feature.js +12 -0
  230. package/features/file/ListTags/feature.js.map +1 -0
  231. package/features/file/ListTags/index.d.ts +1 -0
  232. package/features/file/ListTags/index.js +3 -0
  233. package/features/file/ListTags/index.js.map +1 -0
  234. package/features/file/UpdateFile/UpdateFileRepository.d.ts +15 -0
  235. package/features/file/UpdateFile/UpdateFileRepository.js +39 -0
  236. package/features/file/UpdateFile/UpdateFileRepository.js.map +1 -0
  237. package/features/file/UpdateFile/UpdateFileUseCase.d.ts +20 -0
  238. package/features/file/UpdateFile/UpdateFileUseCase.js +78 -0
  239. package/features/file/UpdateFile/UpdateFileUseCase.js.map +1 -0
  240. package/features/file/UpdateFile/abstractions.d.ts +53 -0
  241. package/features/file/UpdateFile/abstractions.js +15 -0
  242. package/features/file/UpdateFile/abstractions.js.map +1 -0
  243. package/features/file/UpdateFile/events.d.ts +32 -0
  244. package/features/file/UpdateFile/events.js +28 -0
  245. package/features/file/UpdateFile/events.js.map +1 -0
  246. package/features/file/UpdateFile/feature.d.ts +1 -0
  247. package/features/file/UpdateFile/feature.js +12 -0
  248. package/features/file/UpdateFile/feature.js.map +1 -0
  249. package/features/file/UpdateFile/index.d.ts +2 -0
  250. package/features/file/UpdateFile/index.js +4 -0
  251. package/features/file/UpdateFile/index.js.map +1 -0
  252. package/features/file/shared/EntryToFileMapper.d.ts +5 -0
  253. package/features/file/shared/EntryToFileMapper.js +26 -0
  254. package/features/file/shared/EntryToFileMapper.js.map +1 -0
  255. package/features/file/shared/FileInputToEntryInputMapper.d.ts +5 -0
  256. package/features/file/shared/FileInputToEntryInputMapper.js +30 -0
  257. package/features/file/shared/FileInputToEntryInputMapper.js.map +1 -0
  258. package/features/file/shared/FileToEntryMapper.d.ts +5 -0
  259. package/features/file/shared/FileToEntryMapper.js +29 -0
  260. package/features/file/shared/FileToEntryMapper.js.map +1 -0
  261. package/features/settings/GetSettings/GetSettingsUseCase.d.ts +13 -0
  262. package/features/settings/GetSettings/GetSettingsUseCase.js +28 -0
  263. package/features/settings/GetSettings/GetSettingsUseCase.js.map +1 -0
  264. package/features/settings/GetSettings/abstractions.d.ts +17 -0
  265. package/features/settings/GetSettings/abstractions.js +9 -0
  266. package/features/settings/GetSettings/abstractions.js.map +1 -0
  267. package/features/settings/GetSettings/feature.d.ts +1 -0
  268. package/features/settings/GetSettings/feature.js +10 -0
  269. package/features/settings/GetSettings/feature.js.map +1 -0
  270. package/features/settings/SettingsInstaller/SettingsInstaller.d.ts +15 -0
  271. package/features/settings/SettingsInstaller/SettingsInstaller.js +35 -0
  272. package/features/settings/SettingsInstaller/SettingsInstaller.js.map +1 -0
  273. package/features/settings/SettingsInstaller/feature.d.ts +1 -0
  274. package/features/settings/SettingsInstaller/feature.js +10 -0
  275. package/features/settings/SettingsInstaller/feature.js.map +1 -0
  276. package/features/settings/UpdateSettings/UpdateSettingsUseCase.d.ts +18 -0
  277. package/features/settings/UpdateSettings/UpdateSettingsUseCase.js +62 -0
  278. package/features/settings/UpdateSettings/UpdateSettingsUseCase.js.map +1 -0
  279. package/features/settings/UpdateSettings/abstractions.d.ts +22 -0
  280. package/features/settings/UpdateSettings/abstractions.js +9 -0
  281. package/features/settings/UpdateSettings/abstractions.js.map +1 -0
  282. package/features/settings/UpdateSettings/events.d.ts +32 -0
  283. package/features/settings/UpdateSettings/events.js +28 -0
  284. package/features/settings/UpdateSettings/events.js.map +1 -0
  285. package/features/settings/UpdateSettings/feature.d.ts +1 -0
  286. package/features/settings/UpdateSettings/feature.js +10 -0
  287. package/features/settings/UpdateSettings/feature.js.map +1 -0
  288. package/features/settings/UpdateSettings/index.d.ts +2 -0
  289. package/features/settings/UpdateSettings/index.js +4 -0
  290. package/features/settings/UpdateSettings/index.js.map +1 -0
  291. package/features/shared/abstractions.d.ts +1 -0
  292. package/features/shared/abstractions.js +3 -0
  293. package/features/shared/abstractions.js.map +1 -0
  294. package/graphql/baseSchema.d.ts +2 -2
  295. package/graphql/baseSchema.js +20 -38
  296. package/graphql/baseSchema.js.map +1 -1
  297. package/graphql/createFilesTypeDefs.d.ts +1 -1
  298. package/graphql/createFilesTypeDefs.js +40 -25
  299. package/graphql/createFilesTypeDefs.js.map +1 -1
  300. package/graphql/filesSchema.d.ts +3 -3
  301. package/graphql/filesSchema.js +73 -46
  302. package/graphql/filesSchema.js.map +1 -1
  303. package/graphql/getFileByUrl.d.ts +2 -2
  304. package/graphql/getFileByUrl.js +17 -26
  305. package/graphql/getFileByUrl.js.map +1 -1
  306. package/graphql/index.d.ts +2 -2
  307. package/graphql/index.js +24 -26
  308. package/graphql/index.js.map +1 -1
  309. package/graphql/utils.js +6 -13
  310. package/graphql/utils.js.map +1 -1
  311. package/index.d.ts +6 -9
  312. package/index.js +28 -67
  313. package/index.js.map +1 -1
  314. package/modelModifier/CmsModelModifier.d.ts +1 -1
  315. package/modelModifier/CmsModelModifier.js +7 -15
  316. package/modelModifier/CmsModelModifier.js.map +1 -1
  317. package/package.json +26 -28
  318. package/permissions/schema.d.ts +73 -0
  319. package/permissions/schema.js +20 -0
  320. package/permissions/schema.js.map +1 -0
  321. package/types.d.ts +1 -367
  322. package/types.js +1 -27
  323. package/types.js.map +1 -1
  324. package/FileManagerContextSetup.d.ts +0 -13
  325. package/FileManagerContextSetup.js +0 -115
  326. package/FileManagerContextSetup.js.map +0 -1
  327. package/cmsFileStorage/CmsFilesStorage.d.ts +0 -27
  328. package/cmsFileStorage/CmsFilesStorage.js +0 -164
  329. package/cmsFileStorage/CmsFilesStorage.js.map +0 -1
  330. package/cmsFileStorage/ListFilesWhereProcessor.d.ts +0 -7
  331. package/cmsFileStorage/ListFilesWhereProcessor.js +0 -33
  332. package/cmsFileStorage/ListFilesWhereProcessor.js.map +0 -1
  333. package/cmsFileStorage/ListTagsWhereProcessor.d.ts +0 -7
  334. package/cmsFileStorage/ListTagsWhereProcessor.js +0 -33
  335. package/cmsFileStorage/ListTagsWhereProcessor.js.map +0 -1
  336. package/cmsFileStorage/file.model.d.ts +0 -6
  337. package/cmsFileStorage/file.model.js +0 -158
  338. package/cmsFileStorage/file.model.js.map +0 -1
  339. package/createFileManager/files.crud.d.ts +0 -3
  340. package/createFileManager/files.crud.js +0 -328
  341. package/createFileManager/files.crud.js.map +0 -1
  342. package/createFileManager/index.d.ts +0 -3
  343. package/createFileManager/index.js +0 -23
  344. package/createFileManager/index.js.map +0 -1
  345. package/createFileManager/permissions/FilesPermissions.d.ts +0 -4
  346. package/createFileManager/permissions/FilesPermissions.js +0 -11
  347. package/createFileManager/permissions/FilesPermissions.js.map +0 -1
  348. package/createFileManager/permissions/SettingsPermissions.d.ts +0 -4
  349. package/createFileManager/permissions/SettingsPermissions.js +0 -11
  350. package/createFileManager/permissions/SettingsPermissions.js.map +0 -1
  351. package/createFileManager/settings.crud.d.ts +0 -3
  352. package/createFileManager/settings.crud.js +0 -117
  353. package/createFileManager/settings.crud.js.map +0 -1
  354. package/createFileManager/system.crud.d.ts +0 -3
  355. package/createFileManager/system.crud.js +0 -88
  356. package/createFileManager/system.crud.js.map +0 -1
  357. package/createFileManager/types.d.ts +0 -16
  358. package/createFileManager/types.js +0 -7
  359. package/createFileManager/types.js.map +0 -1
  360. package/delivery/AssetDelivery/AliasAssetRequestResolver.d.ts +0 -11
  361. package/delivery/AssetDelivery/AliasAssetRequestResolver.js +0 -74
  362. package/delivery/AssetDelivery/AliasAssetRequestResolver.js.map +0 -1
  363. package/delivery/AssetDelivery/privateFiles/internalIdentity.d.ts +0 -7
  364. package/delivery/AssetDelivery/privateFiles/internalIdentity.js +0 -18
  365. package/delivery/AssetDelivery/privateFiles/internalIdentity.js.map +0 -1
  366. package/enterprise/applyThreatScanning.d.ts +0 -2
  367. package/enterprise/applyThreatScanning.js +0 -20
  368. package/enterprise/applyThreatScanning.js.map +0 -1
  369. package/handlers/manage/imageManager.d.ts +0 -14
  370. package/handlers/manage/imageManager.js +0 -75
  371. package/handlers/manage/imageManager.js.map +0 -1
  372. package/handlers/manage/index.d.ts +0 -5
  373. package/handlers/manage/index.js +0 -59
  374. package/handlers/manage/index.js.map +0 -1
  375. package/handlers/manage/legacyUtils.d.ts +0 -12
  376. package/handlers/manage/legacyUtils.js +0 -34
  377. package/handlers/manage/legacyUtils.js.map +0 -1
  378. package/handlers/manage/utils.d.ts +0 -12
  379. package/handlers/manage/utils.js +0 -34
  380. package/handlers/manage/utils.js.map +0 -1
  381. package/handlers/types.d.ts +0 -8
  382. package/handlers/types.js +0 -7
  383. package/handlers/types.js.map +0 -1
  384. package/handlers/utils/getEnvironment.d.ts +0 -5
  385. package/handlers/utils/getEnvironment.js +0 -13
  386. package/handlers/utils/getEnvironment.js.map +0 -1
  387. package/handlers/utils/getObjectParams.d.ts +0 -9
  388. package/handlers/utils/getObjectParams.js +0 -23
  389. package/handlers/utils/getObjectParams.js.map +0 -1
  390. package/handlers/utils/index.d.ts +0 -2
  391. package/handlers/utils/index.js +0 -22
  392. package/handlers/utils/index.js.map +0 -1
  393. package/plugins/FilePhysicalStoragePlugin.d.ts +0 -22
  394. package/plugins/FilePhysicalStoragePlugin.js +0 -31
  395. package/plugins/FilePhysicalStoragePlugin.js.map +0 -1
  396. package/plugins/FileStorageTransformPlugin.d.ts +0 -34
  397. package/plugins/FileStorageTransformPlugin.js +0 -39
  398. package/plugins/FileStorageTransformPlugin.js.map +0 -1
  399. package/plugins/index.d.ts +0 -2
  400. package/plugins/index.js +0 -29
  401. package/plugins/index.js.map +0 -1
  402. package/storage/FileStorage.d.ts +0 -34
  403. package/storage/FileStorage.js +0 -90
  404. package/storage/FileStorage.js.map +0 -1
  405. package/types/file.d.ts +0 -49
  406. package/types/file.js +0 -7
  407. package/types/file.js.map +0 -1
  408. package/types/file.lifecycle.d.ts +0 -44
  409. package/types/file.lifecycle.js +0 -7
  410. package/types/file.lifecycle.js.map +0 -1
@@ -0,0 +1,43 @@
1
+ import type { Result } from "@webiny/feature/api";
2
+ import { type FilePersistenceError, FileNotAuthorizedError } from "../../../domain/file/errors.js";
3
+ export interface ListTagsInput {
4
+ where?: Record<string, any>;
5
+ after?: string | null;
6
+ limit?: number;
7
+ }
8
+ export interface TagItem {
9
+ tag: string;
10
+ count: number;
11
+ }
12
+ /**
13
+ * ListTags repository interface
14
+ */
15
+ export interface IListTagsRepository {
16
+ execute(input: ListTagsInput): Promise<Result<TagItem[], RepositoryError>>;
17
+ }
18
+ export interface IListTagsRepositoryErrors {
19
+ persistence: FilePersistenceError;
20
+ }
21
+ type RepositoryError = IListTagsRepositoryErrors[keyof IListTagsRepositoryErrors];
22
+ export declare const ListTagsRepository: import("@webiny/di").Abstraction<IListTagsRepository>;
23
+ export declare namespace ListTagsRepository {
24
+ type Interface = IListTagsRepository;
25
+ type Error = RepositoryError;
26
+ }
27
+ /**
28
+ * ListTags use case interface
29
+ */
30
+ export interface IListTagsUseCase {
31
+ execute(input: ListTagsInput): Promise<Result<TagItem[], UseCaseError>>;
32
+ }
33
+ export interface IListTagsUseCaseErrors {
34
+ notAuthorized: FileNotAuthorizedError;
35
+ persistence: FilePersistenceError;
36
+ }
37
+ type UseCaseError = IListTagsUseCaseErrors[keyof IListTagsUseCaseErrors];
38
+ export declare const ListTagsUseCase: import("@webiny/di").Abstraction<IListTagsUseCase>;
39
+ export declare namespace ListTagsUseCase {
40
+ type Interface = IListTagsUseCase;
41
+ type Error = UseCaseError;
42
+ }
43
+ export {};
@@ -0,0 +1,15 @@
1
+ import { createAbstraction } from "@webiny/feature/api";
2
+
3
+ /**
4
+ * ListTags repository interface
5
+ */
6
+
7
+ export const ListTagsRepository = createAbstraction("ListTagsRepository");
8
+
9
+ /**
10
+ * ListTags use case interface
11
+ */
12
+
13
+ export const ListTagsUseCase = createAbstraction("ListTagsUseCase");
14
+
15
+ //# sourceMappingURL=abstractions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createAbstraction","ListTagsRepository","ListTagsUseCase"],"sources":["abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { Result } from \"@webiny/feature/api\";\nimport { type FilePersistenceError, FileNotAuthorizedError } from \"~/domain/file/errors.js\";\n\nexport interface ListTagsInput {\n where?: Record<string, any>;\n after?: string | null;\n limit?: number;\n}\n\nexport interface TagItem {\n tag: string;\n count: number;\n}\n\n/**\n * ListTags repository interface\n */\nexport interface IListTagsRepository {\n execute(input: ListTagsInput): Promise<Result<TagItem[], RepositoryError>>;\n}\n\nexport interface IListTagsRepositoryErrors {\n persistence: FilePersistenceError;\n}\n\ntype RepositoryError = IListTagsRepositoryErrors[keyof IListTagsRepositoryErrors];\n\nexport const ListTagsRepository = createAbstraction<IListTagsRepository>(\"ListTagsRepository\");\n\nexport namespace ListTagsRepository {\n export type Interface = IListTagsRepository;\n export type Error = RepositoryError;\n}\n\n/**\n * ListTags use case interface\n */\nexport interface IListTagsUseCase {\n execute(input: ListTagsInput): Promise<Result<TagItem[], UseCaseError>>;\n}\n\nexport interface IListTagsUseCaseErrors {\n notAuthorized: FileNotAuthorizedError;\n persistence: FilePersistenceError;\n}\n\ntype UseCaseError = IListTagsUseCaseErrors[keyof IListTagsUseCaseErrors];\n\nexport const ListTagsUseCase = createAbstraction<IListTagsUseCase>(\"ListTagsUseCase\");\n\nexport namespace ListTagsUseCase {\n export type Interface = IListTagsUseCase;\n export type Error = UseCaseError;\n}\n"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,qBAAqB;;AAevD;AACA;AACA;;AAWA,OAAO,MAAMC,kBAAkB,GAAGD,iBAAiB,CAAsB,oBAAoB,CAAC;;AAO9F;AACA;AACA;;AAYA,OAAO,MAAME,eAAe,GAAGF,iBAAiB,CAAmB,iBAAiB,CAAC","ignoreList":[]}
@@ -0,0 +1 @@
1
+ export declare const ListTagsFeature: import("@webiny/feature/api/createFeature.js").FeatureDefinition<unknown>;
@@ -0,0 +1,12 @@
1
+ import { createFeature } from "@webiny/feature/api";
2
+ import { ListTagsRepository } from "./ListTagsRepository.js";
3
+ import { ListTagsUseCase } from "./ListTagsUseCase.js";
4
+ export const ListTagsFeature = createFeature({
5
+ name: "FileManager/ListTags",
6
+ register(container) {
7
+ container.register(ListTagsUseCase);
8
+ container.register(ListTagsRepository).inSingletonScope();
9
+ }
10
+ });
11
+
12
+ //# sourceMappingURL=feature.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createFeature","ListTagsRepository","ListTagsUseCase","ListTagsFeature","name","register","container","inSingletonScope"],"sources":["feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { ListTagsRepository } from \"./ListTagsRepository.js\";\nimport { ListTagsUseCase } from \"./ListTagsUseCase.js\";\n\nexport const ListTagsFeature = createFeature({\n name: \"FileManager/ListTags\",\n register(container) {\n container.register(ListTagsUseCase);\n container.register(ListTagsRepository).inSingletonScope();\n }\n});\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ,qBAAqB;AACnD,SAASC,kBAAkB;AAC3B,SAASC,eAAe;AAExB,OAAO,MAAMC,eAAe,GAAGH,aAAa,CAAC;EACzCI,IAAI,EAAE,sBAAsB;EAC5BC,QAAQA,CAACC,SAAS,EAAE;IAChBA,SAAS,CAACD,QAAQ,CAACH,eAAe,CAAC;IACnCI,SAAS,CAACD,QAAQ,CAACJ,kBAAkB,CAAC,CAACM,gBAAgB,CAAC,CAAC;EAC7D;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1 @@
1
+ export { ListTagsUseCase } from "./abstractions.js";
@@ -0,0 +1,3 @@
1
+ export { ListTagsUseCase } from "./abstractions.js";
2
+
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["ListTagsUseCase"],"sources":["index.ts"],"sourcesContent":["export { ListTagsUseCase } from \"./abstractions.js\";\n"],"mappings":"AAAA,SAASA,eAAe","ignoreList":[]}
@@ -0,0 +1,15 @@
1
+ import { Result } from "@webiny/feature/api";
2
+ import { UpdateEntryUseCase } from "@webiny/api-headless-cms/features/contentEntry/UpdateEntry";
3
+ import { UpdateFileRepository as RepositoryAbstraction } from "./abstractions.js";
4
+ import { FileModel } from "../../../domain/file/abstractions.js";
5
+ import type { File } from "../../../domain/file/types.js";
6
+ declare class UpdateFileRepositoryImpl implements RepositoryAbstraction.Interface {
7
+ private updateEntry;
8
+ private fileModel;
9
+ constructor(updateEntry: UpdateEntryUseCase.Interface, fileModel: FileModel.Interface);
10
+ update(file: File): Promise<Result<void, RepositoryAbstraction.Error>>;
11
+ }
12
+ export declare const UpdateFileRepository: typeof UpdateFileRepositoryImpl & {
13
+ __abstraction: import("@webiny/di").Abstraction<import("./abstractions.js").IUpdateFileRepository>;
14
+ };
15
+ export {};
@@ -0,0 +1,39 @@
1
+ import { Result } from "@webiny/feature/api";
2
+ import { UpdateEntryUseCase } from "@webiny/api-headless-cms/features/contentEntry/UpdateEntry";
3
+ import { UpdateFileRepository as RepositoryAbstraction } from "./abstractions.js";
4
+ import { FileModel } from "../../../domain/file/abstractions.js";
5
+ import { FileNotAuthorizedError, FileNotFoundError, FilePersistenceError } from "../../../domain/file/errors.js";
6
+ import { FileToEntryMapper } from "../shared/FileToEntryMapper.js";
7
+ class UpdateFileRepositoryImpl {
8
+ constructor(updateEntry, fileModel) {
9
+ this.updateEntry = updateEntry;
10
+ this.fileModel = fileModel;
11
+ }
12
+ async update(file) {
13
+ const entry = FileToEntryMapper.toEntry(file);
14
+
15
+ // Files are not versioned, so we're always updating the same revision
16
+ const id = `${file.id}#0001`;
17
+ const result = await this.updateEntry.execute(this.fileModel, id, {
18
+ wbyAco_location: file.location,
19
+ values: entry.values
20
+ });
21
+ if (result.isFail()) {
22
+ const error = result.error;
23
+ if (error.code === "Cms/Entry/NotFound") {
24
+ return Result.fail(new FileNotFoundError(id));
25
+ }
26
+ if (error.code === "Cms/Entry/NotAuthorized") {
27
+ return Result.fail(new FileNotAuthorizedError());
28
+ }
29
+ return Result.fail(new FilePersistenceError(result.error));
30
+ }
31
+ return Result.ok();
32
+ }
33
+ }
34
+ export const UpdateFileRepository = RepositoryAbstraction.createImplementation({
35
+ implementation: UpdateFileRepositoryImpl,
36
+ dependencies: [UpdateEntryUseCase, FileModel]
37
+ });
38
+
39
+ //# sourceMappingURL=UpdateFileRepository.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Result","UpdateEntryUseCase","UpdateFileRepository","RepositoryAbstraction","FileModel","FileNotAuthorizedError","FileNotFoundError","FilePersistenceError","FileToEntryMapper","UpdateFileRepositoryImpl","constructor","updateEntry","fileModel","update","file","entry","toEntry","id","result","execute","wbyAco_location","location","values","isFail","error","code","fail","ok","createImplementation","implementation","dependencies"],"sources":["UpdateFileRepository.ts"],"sourcesContent":["import { Result } from \"@webiny/feature/api\";\nimport { UpdateEntryUseCase } from \"@webiny/api-headless-cms/features/contentEntry/UpdateEntry\";\nimport { UpdateFileRepository as RepositoryAbstraction } from \"./abstractions.js\";\nimport { FileModel } from \"~/domain/file/abstractions.js\";\nimport type { File } from \"~/domain/file/types.js\";\nimport {\n FileNotAuthorizedError,\n FileNotFoundError,\n FilePersistenceError\n} from \"~/domain/file/errors.js\";\nimport { FileToEntryMapper } from \"../shared/FileToEntryMapper.js\";\n\nclass UpdateFileRepositoryImpl implements RepositoryAbstraction.Interface {\n constructor(\n private updateEntry: UpdateEntryUseCase.Interface,\n private fileModel: FileModel.Interface\n ) {}\n\n async update(file: File): Promise<Result<void, RepositoryAbstraction.Error>> {\n const entry = FileToEntryMapper.toEntry(file);\n\n // Files are not versioned, so we're always updating the same revision\n const id = `${file.id}#0001`;\n\n const result = await this.updateEntry.execute(this.fileModel, id, {\n wbyAco_location: file.location,\n values: entry.values\n });\n\n if (result.isFail()) {\n const error = result.error;\n if (error.code === \"Cms/Entry/NotFound\") {\n return Result.fail(new FileNotFoundError(id));\n }\n\n if (error.code === \"Cms/Entry/NotAuthorized\") {\n return Result.fail(new FileNotAuthorizedError());\n }\n\n return Result.fail(new FilePersistenceError(result.error));\n }\n\n return Result.ok();\n }\n}\n\nexport const UpdateFileRepository = RepositoryAbstraction.createImplementation({\n implementation: UpdateFileRepositoryImpl,\n dependencies: [UpdateEntryUseCase, FileModel]\n});\n"],"mappings":"AAAA,SAASA,MAAM,QAAQ,qBAAqB;AAC5C,SAASC,kBAAkB,QAAQ,4DAA4D;AAC/F,SAASC,oBAAoB,IAAIC,qBAAqB;AACtD,SAASC,SAAS;AAElB,SACIC,sBAAsB,EACtBC,iBAAiB,EACjBC,oBAAoB;AAExB,SAASC,iBAAiB;AAE1B,MAAMC,wBAAwB,CAA4C;EACtEC,WAAWA,CACCC,WAAyC,EACzCC,SAA8B,EACxC;IAAA,KAFUD,WAAyC,GAAzCA,WAAyC;IAAA,KACzCC,SAA8B,GAA9BA,SAA8B;EACvC;EAEH,MAAMC,MAAMA,CAACC,IAAU,EAAsD;IACzE,MAAMC,KAAK,GAAGP,iBAAiB,CAACQ,OAAO,CAACF,IAAI,CAAC;;IAE7C;IACA,MAAMG,EAAE,GAAG,GAAGH,IAAI,CAACG,EAAE,OAAO;IAE5B,MAAMC,MAAM,GAAG,MAAM,IAAI,CAACP,WAAW,CAACQ,OAAO,CAAC,IAAI,CAACP,SAAS,EAAEK,EAAE,EAAE;MAC9DG,eAAe,EAAEN,IAAI,CAACO,QAAQ;MAC9BC,MAAM,EAAEP,KAAK,CAACO;IAClB,CAAC,CAAC;IAEF,IAAIJ,MAAM,CAACK,MAAM,CAAC,CAAC,EAAE;MACjB,MAAMC,KAAK,GAAGN,MAAM,CAACM,KAAK;MAC1B,IAAIA,KAAK,CAACC,IAAI,KAAK,oBAAoB,EAAE;QACrC,OAAOzB,MAAM,CAAC0B,IAAI,CAAC,IAAIpB,iBAAiB,CAACW,EAAE,CAAC,CAAC;MACjD;MAEA,IAAIO,KAAK,CAACC,IAAI,KAAK,yBAAyB,EAAE;QAC1C,OAAOzB,MAAM,CAAC0B,IAAI,CAAC,IAAIrB,sBAAsB,CAAC,CAAC,CAAC;MACpD;MAEA,OAAOL,MAAM,CAAC0B,IAAI,CAAC,IAAInB,oBAAoB,CAACW,MAAM,CAACM,KAAK,CAAC,CAAC;IAC9D;IAEA,OAAOxB,MAAM,CAAC2B,EAAE,CAAC,CAAC;EACtB;AACJ;AAEA,OAAO,MAAMzB,oBAAoB,GAAGC,qBAAqB,CAACyB,oBAAoB,CAAC;EAC3EC,cAAc,EAAEpB,wBAAwB;EACxCqB,YAAY,EAAE,CAAC7B,kBAAkB,EAAEG,SAAS;AAChD,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,20 @@
1
+ import { Result } from "@webiny/feature/api";
2
+ import { UpdateFileUseCase as UseCaseAbstraction, UpdateFileInput, UpdateFileRepository } from "./abstractions.js";
3
+ import { GetFileUseCase } from "../GetFile/abstractions.js";
4
+ import { EventPublisher } from "@webiny/api-core/features/EventPublisher";
5
+ import type { File } from "../../../domain/file/types.js";
6
+ import { FmPermissions } from "../../../features/shared/abstractions.js";
7
+ import { IdentityContext } from "@webiny/api-core/features/security/IdentityContext/index.js";
8
+ declare class UpdateFileUseCaseImpl implements UseCaseAbstraction.Interface {
9
+ private identityContext;
10
+ private permissions;
11
+ private getFile;
12
+ private repository;
13
+ private eventPublisher;
14
+ constructor(identityContext: IdentityContext.Interface, permissions: FmPermissions.Interface, getFile: GetFileUseCase.Interface, repository: UpdateFileRepository.Interface, eventPublisher: EventPublisher.Interface);
15
+ execute(input: UpdateFileInput): Promise<Result<File, UseCaseAbstraction.Error>>;
16
+ }
17
+ export declare const UpdateFileUseCase: typeof UpdateFileUseCaseImpl & {
18
+ __abstraction: import("@webiny/di").Abstraction<import("./abstractions.js").IUpdateFileUseCase>;
19
+ };
20
+ export {};
@@ -0,0 +1,78 @@
1
+ import { Result } from "@webiny/feature/api";
2
+ import { UpdateFileUseCase as UseCaseAbstraction, UpdateFileRepository } from "./abstractions.js";
3
+ import { GetFileUseCase } from "../GetFile/abstractions.js";
4
+ import { EventPublisher } from "@webiny/api-core/features/EventPublisher";
5
+ import { FileNotAuthorizedError } from "../../../domain/file/errors.js";
6
+ import { FileBeforeUpdateEvent, FileAfterUpdateEvent } from "./events.js";
7
+ import { FmPermissions } from "../../shared/abstractions.js";
8
+ import { IdentityContext } from "@webiny/api-core/features/security/IdentityContext/index.js";
9
+ import { Identity } from "../../../domain/identity/Identity.js";
10
+ class UpdateFileUseCaseImpl {
11
+ constructor(identityContext, permissions, getFile, repository, eventPublisher) {
12
+ this.identityContext = identityContext;
13
+ this.permissions = permissions;
14
+ this.getFile = getFile;
15
+ this.repository = repository;
16
+ this.eventPublisher = eventPublisher;
17
+ }
18
+ async execute(input) {
19
+ const hasPermission = await this.permissions.canEdit("file");
20
+ if (!hasPermission) {
21
+ return Result.fail(new FileNotAuthorizedError());
22
+ }
23
+
24
+ // Get the original file (includes ownership check).
25
+ const getResult = await this.getFile.execute(input.id);
26
+ if (getResult.isFail()) {
27
+ return Result.fail(getResult.error);
28
+ }
29
+ const original = getResult.value;
30
+
31
+ // Check ownership-aware edit permission.
32
+ const canEditFile = await this.permissions.canEdit("file", original);
33
+ if (!canEditFile) {
34
+ return Result.fail(new FileNotAuthorizedError());
35
+ }
36
+ const currentIdentity = this.identityContext.getIdentity();
37
+ const file = {
38
+ ...original,
39
+ ...input,
40
+ // Preserve immutable fields.
41
+ id: original.id,
42
+ key: original.key,
43
+ size: original.size,
44
+ type: original.type,
45
+ // Update mutable fields.
46
+ tags: input.tags !== undefined ? input.tags : original.tags,
47
+ location: input.location !== undefined ? input.location : original.location,
48
+ // System fields.
49
+ createdOn: input.createdOn ?? original.createdOn,
50
+ modifiedOn: input.modifiedOn ?? undefined,
51
+ savedOn: input.savedOn ?? original.savedOn,
52
+ createdBy: input.createdBy ? Identity.from(input.createdBy) : original.createdBy,
53
+ modifiedBy: input.modifiedBy ? Identity.from(input.modifiedBy) : Identity.from(currentIdentity),
54
+ savedBy: input.savedBy ? Identity.from(input.savedBy) : Identity.from(currentIdentity)
55
+ };
56
+ await this.eventPublisher.publish(new FileBeforeUpdateEvent({
57
+ original,
58
+ file,
59
+ input
60
+ }));
61
+ const result = await this.repository.update(file);
62
+ if (result.isFail()) {
63
+ return Result.fail(result.error);
64
+ }
65
+ await this.eventPublisher.publish(new FileAfterUpdateEvent({
66
+ original,
67
+ file,
68
+ input
69
+ }));
70
+ return Result.ok(file);
71
+ }
72
+ }
73
+ export const UpdateFileUseCase = UseCaseAbstraction.createImplementation({
74
+ implementation: UpdateFileUseCaseImpl,
75
+ dependencies: [IdentityContext, FmPermissions.Abstraction, GetFileUseCase, UpdateFileRepository, EventPublisher]
76
+ });
77
+
78
+ //# sourceMappingURL=UpdateFileUseCase.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Result","UpdateFileUseCase","UseCaseAbstraction","UpdateFileRepository","GetFileUseCase","EventPublisher","FileNotAuthorizedError","FileBeforeUpdateEvent","FileAfterUpdateEvent","FmPermissions","IdentityContext","Identity","UpdateFileUseCaseImpl","constructor","identityContext","permissions","getFile","repository","eventPublisher","execute","input","hasPermission","canEdit","fail","getResult","id","isFail","error","original","value","canEditFile","currentIdentity","getIdentity","file","key","size","type","tags","undefined","location","createdOn","modifiedOn","savedOn","createdBy","from","modifiedBy","savedBy","publish","result","update","ok","createImplementation","implementation","dependencies","Abstraction"],"sources":["UpdateFileUseCase.ts"],"sourcesContent":["import { Result } from \"@webiny/feature/api\";\nimport {\n UpdateFileUseCase as UseCaseAbstraction,\n UpdateFileInput,\n UpdateFileRepository\n} from \"./abstractions.js\";\nimport { GetFileUseCase } from \"../GetFile/abstractions.js\";\nimport { EventPublisher } from \"@webiny/api-core/features/EventPublisher\";\nimport type { File } from \"~/domain/file/types.js\";\nimport { FileNotAuthorizedError } from \"~/domain/file/errors.js\";\nimport { FileBeforeUpdateEvent, FileAfterUpdateEvent } from \"./events.js\";\nimport { FmPermissions } from \"~/features/shared/abstractions.js\";\nimport { IdentityContext } from \"@webiny/api-core/features/security/IdentityContext/index.js\";\nimport { Identity } from \"~/domain/identity/Identity.js\";\n\nclass UpdateFileUseCaseImpl implements UseCaseAbstraction.Interface {\n constructor(\n private identityContext: IdentityContext.Interface,\n private permissions: FmPermissions.Interface,\n private getFile: GetFileUseCase.Interface,\n private repository: UpdateFileRepository.Interface,\n private eventPublisher: EventPublisher.Interface\n ) {}\n\n async execute(input: UpdateFileInput): Promise<Result<File, UseCaseAbstraction.Error>> {\n const hasPermission = await this.permissions.canEdit(\"file\");\n if (!hasPermission) {\n return Result.fail(new FileNotAuthorizedError());\n }\n\n // Get the original file (includes ownership check).\n const getResult = await this.getFile.execute(input.id);\n\n if (getResult.isFail()) {\n return Result.fail(getResult.error);\n }\n\n const original = getResult.value;\n\n // Check ownership-aware edit permission.\n const canEditFile = await this.permissions.canEdit(\"file\", original);\n if (!canEditFile) {\n return Result.fail(new FileNotAuthorizedError());\n }\n\n const currentIdentity = this.identityContext.getIdentity();\n\n const file: File = {\n ...original,\n ...input,\n // Preserve immutable fields.\n id: original.id,\n key: original.key,\n size: original.size,\n type: original.type,\n // Update mutable fields.\n tags: input.tags !== undefined ? input.tags : original.tags,\n location: input.location !== undefined ? input.location : original.location,\n // System fields.\n createdOn: input.createdOn ?? original.createdOn,\n modifiedOn: input.modifiedOn ?? undefined,\n savedOn: input.savedOn ?? original.savedOn,\n createdBy: input.createdBy ? Identity.from(input.createdBy) : original.createdBy,\n modifiedBy: input.modifiedBy\n ? Identity.from(input.modifiedBy)\n : Identity.from(currentIdentity),\n savedBy: input.savedBy ? Identity.from(input.savedBy) : Identity.from(currentIdentity)\n };\n\n await this.eventPublisher.publish(new FileBeforeUpdateEvent({ original, file, input }));\n\n const result = await this.repository.update(file);\n\n if (result.isFail()) {\n return Result.fail(result.error);\n }\n\n await this.eventPublisher.publish(new FileAfterUpdateEvent({ original, file, input }));\n\n return Result.ok(file);\n }\n}\n\nexport const UpdateFileUseCase = UseCaseAbstraction.createImplementation({\n implementation: UpdateFileUseCaseImpl,\n dependencies: [\n IdentityContext,\n FmPermissions.Abstraction,\n GetFileUseCase,\n UpdateFileRepository,\n EventPublisher\n ]\n});\n"],"mappings":"AAAA,SAASA,MAAM,QAAQ,qBAAqB;AAC5C,SACIC,iBAAiB,IAAIC,kBAAkB,EAEvCC,oBAAoB;AAExB,SAASC,cAAc;AACvB,SAASC,cAAc,QAAQ,0CAA0C;AAEzE,SAASC,sBAAsB;AAC/B,SAASC,qBAAqB,EAAEC,oBAAoB;AACpD,SAASC,aAAa;AACtB,SAASC,eAAe,QAAQ,6DAA6D;AAC7F,SAASC,QAAQ;AAEjB,MAAMC,qBAAqB,CAAyC;EAChEC,WAAWA,CACCC,eAA0C,EAC1CC,WAAoC,EACpCC,OAAiC,EACjCC,UAA0C,EAC1CC,cAAwC,EAClD;IAAA,KALUJ,eAA0C,GAA1CA,eAA0C;IAAA,KAC1CC,WAAoC,GAApCA,WAAoC;IAAA,KACpCC,OAAiC,GAAjCA,OAAiC;IAAA,KACjCC,UAA0C,GAA1CA,UAA0C;IAAA,KAC1CC,cAAwC,GAAxCA,cAAwC;EACjD;EAEH,MAAMC,OAAOA,CAACC,KAAsB,EAAmD;IACnF,MAAMC,aAAa,GAAG,MAAM,IAAI,CAACN,WAAW,CAACO,OAAO,CAAC,MAAM,CAAC;IAC5D,IAAI,CAACD,aAAa,EAAE;MAChB,OAAOrB,MAAM,CAACuB,IAAI,CAAC,IAAIjB,sBAAsB,CAAC,CAAC,CAAC;IACpD;;IAEA;IACA,MAAMkB,SAAS,GAAG,MAAM,IAAI,CAACR,OAAO,CAACG,OAAO,CAACC,KAAK,CAACK,EAAE,CAAC;IAEtD,IAAID,SAAS,CAACE,MAAM,CAAC,CAAC,EAAE;MACpB,OAAO1B,MAAM,CAACuB,IAAI,CAACC,SAAS,CAACG,KAAK,CAAC;IACvC;IAEA,MAAMC,QAAQ,GAAGJ,SAAS,CAACK,KAAK;;IAEhC;IACA,MAAMC,WAAW,GAAG,MAAM,IAAI,CAACf,WAAW,CAACO,OAAO,CAAC,MAAM,EAAEM,QAAQ,CAAC;IACpE,IAAI,CAACE,WAAW,EAAE;MACd,OAAO9B,MAAM,CAACuB,IAAI,CAAC,IAAIjB,sBAAsB,CAAC,CAAC,CAAC;IACpD;IAEA,MAAMyB,eAAe,GAAG,IAAI,CAACjB,eAAe,CAACkB,WAAW,CAAC,CAAC;IAE1D,MAAMC,IAAU,GAAG;MACf,GAAGL,QAAQ;MACX,GAAGR,KAAK;MACR;MACAK,EAAE,EAAEG,QAAQ,CAACH,EAAE;MACfS,GAAG,EAAEN,QAAQ,CAACM,GAAG;MACjBC,IAAI,EAAEP,QAAQ,CAACO,IAAI;MACnBC,IAAI,EAAER,QAAQ,CAACQ,IAAI;MACnB;MACAC,IAAI,EAAEjB,KAAK,CAACiB,IAAI,KAAKC,SAAS,GAAGlB,KAAK,CAACiB,IAAI,GAAGT,QAAQ,CAACS,IAAI;MAC3DE,QAAQ,EAAEnB,KAAK,CAACmB,QAAQ,KAAKD,SAAS,GAAGlB,KAAK,CAACmB,QAAQ,GAAGX,QAAQ,CAACW,QAAQ;MAC3E;MACAC,SAAS,EAAEpB,KAAK,CAACoB,SAAS,IAAIZ,QAAQ,CAACY,SAAS;MAChDC,UAAU,EAAErB,KAAK,CAACqB,UAAU,IAAIH,SAAS;MACzCI,OAAO,EAAEtB,KAAK,CAACsB,OAAO,IAAId,QAAQ,CAACc,OAAO;MAC1CC,SAAS,EAAEvB,KAAK,CAACuB,SAAS,GAAGhC,QAAQ,CAACiC,IAAI,CAACxB,KAAK,CAACuB,SAAS,CAAC,GAAGf,QAAQ,CAACe,SAAS;MAChFE,UAAU,EAAEzB,KAAK,CAACyB,UAAU,GACtBlC,QAAQ,CAACiC,IAAI,CAACxB,KAAK,CAACyB,UAAU,CAAC,GAC/BlC,QAAQ,CAACiC,IAAI,CAACb,eAAe,CAAC;MACpCe,OAAO,EAAE1B,KAAK,CAAC0B,OAAO,GAAGnC,QAAQ,CAACiC,IAAI,CAACxB,KAAK,CAAC0B,OAAO,CAAC,GAAGnC,QAAQ,CAACiC,IAAI,CAACb,eAAe;IACzF,CAAC;IAED,MAAM,IAAI,CAACb,cAAc,CAAC6B,OAAO,CAAC,IAAIxC,qBAAqB,CAAC;MAAEqB,QAAQ;MAAEK,IAAI;MAAEb;IAAM,CAAC,CAAC,CAAC;IAEvF,MAAM4B,MAAM,GAAG,MAAM,IAAI,CAAC/B,UAAU,CAACgC,MAAM,CAAChB,IAAI,CAAC;IAEjD,IAAIe,MAAM,CAACtB,MAAM,CAAC,CAAC,EAAE;MACjB,OAAO1B,MAAM,CAACuB,IAAI,CAACyB,MAAM,CAACrB,KAAK,CAAC;IACpC;IAEA,MAAM,IAAI,CAACT,cAAc,CAAC6B,OAAO,CAAC,IAAIvC,oBAAoB,CAAC;MAAEoB,QAAQ;MAAEK,IAAI;MAAEb;IAAM,CAAC,CAAC,CAAC;IAEtF,OAAOpB,MAAM,CAACkD,EAAE,CAACjB,IAAI,CAAC;EAC1B;AACJ;AAEA,OAAO,MAAMhC,iBAAiB,GAAGC,kBAAkB,CAACiD,oBAAoB,CAAC;EACrEC,cAAc,EAAExC,qBAAqB;EACrCyC,YAAY,EAAE,CACV3C,eAAe,EACfD,aAAa,CAAC6C,WAAW,EACzBlD,cAAc,EACdD,oBAAoB,EACpBE,cAAc;AAEtB,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,53 @@
1
+ import type { Result } from "@webiny/feature/api";
2
+ import type { CreatedBy, File } from "../../../domain/file/types.js";
3
+ import { type FilePersistenceError, type FileNotFoundError, FileNotAuthorizedError } from "../../../domain/file/errors.js";
4
+ export interface UpdateFileInput {
5
+ id: string;
6
+ name?: string;
7
+ metadata?: Record<string, any>;
8
+ tags?: string[];
9
+ location?: {
10
+ folderId: string;
11
+ };
12
+ createdOn?: string;
13
+ modifiedOn?: string;
14
+ savedOn?: string;
15
+ createdBy?: CreatedBy;
16
+ modifiedBy?: CreatedBy;
17
+ savedBy?: CreatedBy;
18
+ }
19
+ /**
20
+ * UpdateFile repository interface
21
+ */
22
+ export interface IUpdateFileRepository {
23
+ update(file: File): Promise<Result<void, RepositoryError>>;
24
+ }
25
+ export interface IUpdateFileRepositoryErrors {
26
+ notFound: FileNotFoundError;
27
+ notAuthorized: FileNotAuthorizedError;
28
+ persistence: FilePersistenceError;
29
+ }
30
+ type RepositoryError = IUpdateFileRepositoryErrors[keyof IUpdateFileRepositoryErrors];
31
+ export declare const UpdateFileRepository: import("@webiny/di").Abstraction<IUpdateFileRepository>;
32
+ export declare namespace UpdateFileRepository {
33
+ type Interface = IUpdateFileRepository;
34
+ type Error = RepositoryError;
35
+ }
36
+ /**
37
+ * UpdateFile use case interface
38
+ */
39
+ export interface IUpdateFileUseCase {
40
+ execute(input: UpdateFileInput): Promise<Result<File, UseCaseError>>;
41
+ }
42
+ export interface IUpdateFileUseCaseErrors {
43
+ notAuthorized: FileNotAuthorizedError;
44
+ notFound: FileNotFoundError;
45
+ persistence: FilePersistenceError;
46
+ }
47
+ type UseCaseError = IUpdateFileUseCaseErrors[keyof IUpdateFileUseCaseErrors];
48
+ export declare const UpdateFileUseCase: import("@webiny/di").Abstraction<IUpdateFileUseCase>;
49
+ export declare namespace UpdateFileUseCase {
50
+ type Interface = IUpdateFileUseCase;
51
+ type Error = UseCaseError;
52
+ }
53
+ export {};
@@ -0,0 +1,15 @@
1
+ import { createAbstraction } from "@webiny/feature/api";
2
+
3
+ /**
4
+ * UpdateFile repository interface
5
+ */
6
+
7
+ export const UpdateFileRepository = createAbstraction("UpdateFileRepository");
8
+
9
+ /**
10
+ * UpdateFile use case interface
11
+ */
12
+
13
+ export const UpdateFileUseCase = createAbstraction("UpdateFileUseCase");
14
+
15
+ //# sourceMappingURL=abstractions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createAbstraction","UpdateFileRepository","UpdateFileUseCase"],"sources":["abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { Result } from \"@webiny/feature/api\";\nimport type { CreatedBy, File } from \"~/domain/file/types.js\";\nimport {\n type FilePersistenceError,\n type FileNotFoundError,\n FileNotAuthorizedError\n} from \"~/domain/file/errors.js\";\n\nexport interface UpdateFileInput {\n id: string;\n name?: string;\n metadata?: Record<string, any>;\n tags?: string[];\n location?: { folderId: string };\n createdOn?: string;\n modifiedOn?: string;\n savedOn?: string;\n createdBy?: CreatedBy;\n modifiedBy?: CreatedBy;\n savedBy?: CreatedBy;\n}\n\n/**\n * UpdateFile repository interface\n */\nexport interface IUpdateFileRepository {\n update(file: File): Promise<Result<void, RepositoryError>>;\n}\n\nexport interface IUpdateFileRepositoryErrors {\n notFound: FileNotFoundError;\n notAuthorized: FileNotAuthorizedError;\n persistence: FilePersistenceError;\n}\n\ntype RepositoryError = IUpdateFileRepositoryErrors[keyof IUpdateFileRepositoryErrors];\n\nexport const UpdateFileRepository =\n createAbstraction<IUpdateFileRepository>(\"UpdateFileRepository\");\n\nexport namespace UpdateFileRepository {\n export type Interface = IUpdateFileRepository;\n export type Error = RepositoryError;\n}\n\n/**\n * UpdateFile use case interface\n */\nexport interface IUpdateFileUseCase {\n execute(input: UpdateFileInput): Promise<Result<File, UseCaseError>>;\n}\n\nexport interface IUpdateFileUseCaseErrors {\n notAuthorized: FileNotAuthorizedError;\n notFound: FileNotFoundError;\n persistence: FilePersistenceError;\n}\n\ntype UseCaseError = IUpdateFileUseCaseErrors[keyof IUpdateFileUseCaseErrors];\n\nexport const UpdateFileUseCase = createAbstraction<IUpdateFileUseCase>(\"UpdateFileUseCase\");\n\nexport namespace UpdateFileUseCase {\n export type Interface = IUpdateFileUseCase;\n export type Error = UseCaseError;\n}\n"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,qBAAqB;;AAuBvD;AACA;AACA;;AAaA,OAAO,MAAMC,oBAAoB,GAC7BD,iBAAiB,CAAwB,sBAAsB,CAAC;;AAOpE;AACA;AACA;;AAaA,OAAO,MAAME,iBAAiB,GAAGF,iBAAiB,CAAqB,mBAAmB,CAAC","ignoreList":[]}
@@ -0,0 +1,32 @@
1
+ import { DomainEvent } from "@webiny/api-core/features/EventPublisher";
2
+ import type { IEventHandler } from "@webiny/api-core/features/EventPublisher";
3
+ import type { File } from "../../../domain/file/types.js";
4
+ import type { UpdateFileInput } from "./abstractions.js";
5
+ export interface FileBeforeUpdatePayload {
6
+ original: File;
7
+ file: File;
8
+ input: UpdateFileInput;
9
+ }
10
+ export declare class FileBeforeUpdateEvent extends DomainEvent<FileBeforeUpdatePayload> {
11
+ eventType: "FileManager/File/BeforeUpdate";
12
+ getHandlerAbstraction(): import("@webiny/di").Abstraction<IEventHandler<FileBeforeUpdateEvent>>;
13
+ }
14
+ export declare const FileBeforeUpdateHandler: import("@webiny/di").Abstraction<IEventHandler<FileBeforeUpdateEvent>>;
15
+ export declare namespace FileBeforeUpdateHandler {
16
+ type Interface = IEventHandler<FileBeforeUpdateEvent>;
17
+ type Event = FileBeforeUpdateEvent;
18
+ }
19
+ export interface FileAfterUpdatePayload {
20
+ original: File;
21
+ file: File;
22
+ input: UpdateFileInput;
23
+ }
24
+ export declare class FileAfterUpdateEvent extends DomainEvent<FileAfterUpdatePayload> {
25
+ eventType: "FileManager/File/AfterUpdate";
26
+ getHandlerAbstraction(): import("@webiny/di").Abstraction<IEventHandler<FileAfterUpdateEvent>>;
27
+ }
28
+ export declare const FileAfterUpdateHandler: import("@webiny/di").Abstraction<IEventHandler<FileAfterUpdateEvent>>;
29
+ export declare namespace FileAfterUpdateHandler {
30
+ type Interface = IEventHandler<FileAfterUpdateEvent>;
31
+ type Event = FileAfterUpdateEvent;
32
+ }
@@ -0,0 +1,28 @@
1
+ import { createAbstraction } from "@webiny/feature/api";
2
+ import { DomainEvent } from "@webiny/api-core/features/EventPublisher";
3
+
4
+ // ============================================================================
5
+ // FileBeforeUpdate Event
6
+ // ============================================================================
7
+
8
+ export class FileBeforeUpdateEvent extends DomainEvent {
9
+ eventType = "FileManager/File/BeforeUpdate";
10
+ getHandlerAbstraction() {
11
+ return FileBeforeUpdateHandler;
12
+ }
13
+ }
14
+ export const FileBeforeUpdateHandler = createAbstraction("FileBeforeUpdateHandler");
15
+
16
+ // ============================================================================
17
+ // FileAfterUpdate Event
18
+ // ============================================================================
19
+
20
+ export class FileAfterUpdateEvent extends DomainEvent {
21
+ eventType = "FileManager/File/AfterUpdate";
22
+ getHandlerAbstraction() {
23
+ return FileAfterUpdateHandler;
24
+ }
25
+ }
26
+ export const FileAfterUpdateHandler = createAbstraction("FileAfterUpdateHandler");
27
+
28
+ //# sourceMappingURL=events.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createAbstraction","DomainEvent","FileBeforeUpdateEvent","eventType","getHandlerAbstraction","FileBeforeUpdateHandler","FileAfterUpdateEvent","FileAfterUpdateHandler"],"sources":["events.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport { DomainEvent } from \"@webiny/api-core/features/EventPublisher\";\nimport type { IEventHandler } from \"@webiny/api-core/features/EventPublisher\";\nimport type { File } from \"~/domain/file/types.js\";\nimport type { UpdateFileInput } from \"./abstractions.js\";\n\n// ============================================================================\n// FileBeforeUpdate Event\n// ============================================================================\n\nexport interface FileBeforeUpdatePayload {\n original: File;\n file: File;\n input: UpdateFileInput;\n}\n\nexport class FileBeforeUpdateEvent extends DomainEvent<FileBeforeUpdatePayload> {\n eventType = \"FileManager/File/BeforeUpdate\" as const;\n\n getHandlerAbstraction() {\n return FileBeforeUpdateHandler;\n }\n}\n\nexport const FileBeforeUpdateHandler =\n createAbstraction<IEventHandler<FileBeforeUpdateEvent>>(\"FileBeforeUpdateHandler\");\n\nexport namespace FileBeforeUpdateHandler {\n export type Interface = IEventHandler<FileBeforeUpdateEvent>;\n export type Event = FileBeforeUpdateEvent;\n}\n\n// ============================================================================\n// FileAfterUpdate Event\n// ============================================================================\n\nexport interface FileAfterUpdatePayload {\n original: File;\n file: File;\n input: UpdateFileInput;\n}\n\nexport class FileAfterUpdateEvent extends DomainEvent<FileAfterUpdatePayload> {\n eventType = \"FileManager/File/AfterUpdate\" as const;\n\n getHandlerAbstraction() {\n return FileAfterUpdateHandler;\n }\n}\n\nexport const FileAfterUpdateHandler =\n createAbstraction<IEventHandler<FileAfterUpdateEvent>>(\"FileAfterUpdateHandler\");\n\nexport namespace FileAfterUpdateHandler {\n export type Interface = IEventHandler<FileAfterUpdateEvent>;\n export type Event = FileAfterUpdateEvent;\n}\n"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,qBAAqB;AACvD,SAASC,WAAW,QAAQ,0CAA0C;;AAKtE;AACA;AACA;;AAQA,OAAO,MAAMC,qBAAqB,SAASD,WAAW,CAA0B;EAC5EE,SAAS,GAAG,+BAA+B;EAE3CC,qBAAqBA,CAAA,EAAG;IACpB,OAAOC,uBAAuB;EAClC;AACJ;AAEA,OAAO,MAAMA,uBAAuB,GAChCL,iBAAiB,CAAuC,yBAAyB,CAAC;;AAOtF;AACA;AACA;;AAQA,OAAO,MAAMM,oBAAoB,SAASL,WAAW,CAAyB;EAC1EE,SAAS,GAAG,8BAA8B;EAE1CC,qBAAqBA,CAAA,EAAG;IACpB,OAAOG,sBAAsB;EACjC;AACJ;AAEA,OAAO,MAAMA,sBAAsB,GAC/BP,iBAAiB,CAAsC,wBAAwB,CAAC","ignoreList":[]}
@@ -0,0 +1 @@
1
+ export declare const UpdateFileFeature: import("@webiny/feature/api/createFeature.js").FeatureDefinition<unknown>;
@@ -0,0 +1,12 @@
1
+ import { createFeature } from "@webiny/feature/api";
2
+ import { UpdateFileRepository } from "./UpdateFileRepository.js";
3
+ import { UpdateFileUseCase } from "./UpdateFileUseCase.js";
4
+ export const UpdateFileFeature = createFeature({
5
+ name: "FileManager/UpdateFile",
6
+ register(container) {
7
+ container.register(UpdateFileUseCase);
8
+ container.register(UpdateFileRepository).inSingletonScope();
9
+ }
10
+ });
11
+
12
+ //# sourceMappingURL=feature.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createFeature","UpdateFileRepository","UpdateFileUseCase","UpdateFileFeature","name","register","container","inSingletonScope"],"sources":["feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { UpdateFileRepository } from \"./UpdateFileRepository.js\";\nimport { UpdateFileUseCase } from \"./UpdateFileUseCase.js\";\n\nexport const UpdateFileFeature = createFeature({\n name: \"FileManager/UpdateFile\",\n register(container) {\n container.register(UpdateFileUseCase);\n container.register(UpdateFileRepository).inSingletonScope();\n }\n});\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ,qBAAqB;AACnD,SAASC,oBAAoB;AAC7B,SAASC,iBAAiB;AAE1B,OAAO,MAAMC,iBAAiB,GAAGH,aAAa,CAAC;EAC3CI,IAAI,EAAE,wBAAwB;EAC9BC,QAAQA,CAACC,SAAS,EAAE;IAChBA,SAAS,CAACD,QAAQ,CAACH,iBAAiB,CAAC;IACrCI,SAAS,CAACD,QAAQ,CAACJ,oBAAoB,CAAC,CAACM,gBAAgB,CAAC,CAAC;EAC/D;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export { UpdateFileUseCase } from "./abstractions.js";
2
+ export { FileBeforeUpdateHandler, FileAfterUpdateHandler } from "./events.js";
@@ -0,0 +1,4 @@
1
+ export { UpdateFileUseCase } from "./abstractions.js";
2
+ export { FileBeforeUpdateHandler, FileAfterUpdateHandler } from "./events.js";
3
+
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["UpdateFileUseCase","FileBeforeUpdateHandler","FileAfterUpdateHandler"],"sources":["index.ts"],"sourcesContent":["export { UpdateFileUseCase } from \"./abstractions.js\";\nexport { FileBeforeUpdateHandler, FileAfterUpdateHandler } from \"./events.js\";\n"],"mappings":"AAAA,SAASA,iBAAiB;AAC1B,SAASC,uBAAuB,EAAEC,sBAAsB","ignoreList":[]}
@@ -0,0 +1,5 @@
1
+ import type { CmsEntry } from "@webiny/api-headless-cms/types";
2
+ import type { File } from "../../../domain/file/types.js";
3
+ export declare class EntryToFileMapper {
4
+ static toFile(entry: CmsEntry): File;
5
+ }
@@ -0,0 +1,26 @@
1
+ export class EntryToFileMapper {
2
+ static toFile(entry) {
3
+ return {
4
+ id: entry.entryId,
5
+ createdOn: entry.createdOn,
6
+ modifiedOn: entry.modifiedOn ?? undefined,
7
+ savedOn: entry.savedOn,
8
+ createdBy: entry.createdBy,
9
+ modifiedBy: entry.modifiedBy ?? undefined,
10
+ savedBy: entry.savedBy,
11
+ name: entry.values.name,
12
+ key: entry.values.key,
13
+ size: entry.values.size,
14
+ type: entry.values.type,
15
+ metadata: entry.values.metadata || {},
16
+ accessControl: entry.values.accessControl,
17
+ location: {
18
+ folderId: entry.location?.folderId ?? "root"
19
+ },
20
+ tags: entry.values.tags || [],
21
+ extensions: entry.values.extensions
22
+ };
23
+ }
24
+ }
25
+
26
+ //# sourceMappingURL=EntryToFileMapper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["EntryToFileMapper","toFile","entry","id","entryId","createdOn","modifiedOn","undefined","savedOn","createdBy","modifiedBy","savedBy","name","values","key","size","type","metadata","accessControl","location","folderId","tags","extensions"],"sources":["EntryToFileMapper.ts"],"sourcesContent":["import type { CmsEntry } from \"@webiny/api-headless-cms/types\";\nimport type { File } from \"~/domain/file/types.js\";\n\nexport class EntryToFileMapper {\n static toFile(entry: CmsEntry): File {\n return {\n id: entry.entryId,\n createdOn: entry.createdOn,\n modifiedOn: entry.modifiedOn ?? undefined,\n savedOn: entry.savedOn,\n createdBy: entry.createdBy,\n modifiedBy: entry.modifiedBy ?? undefined,\n savedBy: entry.savedBy,\n name: entry.values.name,\n key: entry.values.key,\n size: entry.values.size,\n type: entry.values.type,\n metadata: entry.values.metadata || {},\n accessControl: entry.values.accessControl,\n location: { folderId: entry.location?.folderId ?? \"root\" },\n tags: entry.values.tags || [],\n extensions: entry.values.extensions\n };\n }\n}\n"],"mappings":"AAGA,OAAO,MAAMA,iBAAiB,CAAC;EAC3B,OAAOC,MAAMA,CAACC,KAAe,EAAQ;IACjC,OAAO;MACHC,EAAE,EAAED,KAAK,CAACE,OAAO;MACjBC,SAAS,EAAEH,KAAK,CAACG,SAAS;MAC1BC,UAAU,EAAEJ,KAAK,CAACI,UAAU,IAAIC,SAAS;MACzCC,OAAO,EAAEN,KAAK,CAACM,OAAO;MACtBC,SAAS,EAAEP,KAAK,CAACO,SAAS;MAC1BC,UAAU,EAAER,KAAK,CAACQ,UAAU,IAAIH,SAAS;MACzCI,OAAO,EAAET,KAAK,CAACS,OAAO;MACtBC,IAAI,EAAEV,KAAK,CAACW,MAAM,CAACD,IAAI;MACvBE,GAAG,EAAEZ,KAAK,CAACW,MAAM,CAACC,GAAG;MACrBC,IAAI,EAAEb,KAAK,CAACW,MAAM,CAACE,IAAI;MACvBC,IAAI,EAAEd,KAAK,CAACW,MAAM,CAACG,IAAI;MACvBC,QAAQ,EAAEf,KAAK,CAACW,MAAM,CAACI,QAAQ,IAAI,CAAC,CAAC;MACrCC,aAAa,EAAEhB,KAAK,CAACW,MAAM,CAACK,aAAa;MACzCC,QAAQ,EAAE;QAAEC,QAAQ,EAAElB,KAAK,CAACiB,QAAQ,EAAEC,QAAQ,IAAI;MAAO,CAAC;MAC1DC,IAAI,EAAEnB,KAAK,CAACW,MAAM,CAACQ,IAAI,IAAI,EAAE;MAC7BC,UAAU,EAAEpB,KAAK,CAACW,MAAM,CAACS;IAC7B,CAAC;EACL;AACJ","ignoreList":[]}
@@ -0,0 +1,5 @@
1
+ import type { CreateCmsEntryInput } from "@webiny/api-headless-cms/types";
2
+ import type { FileInput } from "../../../domain/file/types.js";
3
+ export declare class FileInputToEntryInputMapper {
4
+ static toEntry(file: FileInput): CreateCmsEntryInput;
5
+ }
@@ -0,0 +1,30 @@
1
+ export class FileInputToEntryInputMapper {
2
+ static toEntry(file) {
3
+ return {
4
+ id: file.id,
5
+ createdOn: file.createdOn,
6
+ modifiedOn: file.modifiedOn,
7
+ savedOn: file.savedOn,
8
+ createdBy: file.createdBy,
9
+ modifiedBy: file.modifiedBy,
10
+ savedBy: file.savedBy,
11
+ location: file.location || {
12
+ folderId: "root"
13
+ },
14
+ values: {
15
+ name: file.name,
16
+ key: file.key,
17
+ size: file.size,
18
+ type: file.type,
19
+ metadata: file.metadata || {},
20
+ accessControl: {
21
+ type: "public"
22
+ },
23
+ tags: file.tags || [],
24
+ extensions: file.extensions
25
+ }
26
+ };
27
+ }
28
+ }
29
+
30
+ //# sourceMappingURL=FileInputToEntryInputMapper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["FileInputToEntryInputMapper","toEntry","file","id","createdOn","modifiedOn","savedOn","createdBy","modifiedBy","savedBy","location","folderId","values","name","key","size","type","metadata","accessControl","tags","extensions"],"sources":["FileInputToEntryInputMapper.ts"],"sourcesContent":["import type { CreateCmsEntryInput } from \"@webiny/api-headless-cms/types\";\nimport type { FileInput } from \"~/domain/file/types.js\";\n\nexport class FileInputToEntryInputMapper {\n static toEntry(file: FileInput): CreateCmsEntryInput {\n return {\n id: file.id,\n createdOn: file.createdOn,\n modifiedOn: file.modifiedOn,\n savedOn: file.savedOn,\n createdBy: file.createdBy,\n modifiedBy: file.modifiedBy,\n savedBy: file.savedBy,\n location: file.location || { folderId: \"root\" },\n values: {\n name: file.name,\n key: file.key,\n size: file.size,\n type: file.type,\n metadata: file.metadata || {},\n accessControl: {\n type: \"public\"\n },\n tags: file.tags || [],\n extensions: file.extensions\n }\n };\n }\n}\n"],"mappings":"AAGA,OAAO,MAAMA,2BAA2B,CAAC;EACrC,OAAOC,OAAOA,CAACC,IAAe,EAAuB;IACjD,OAAO;MACHC,EAAE,EAAED,IAAI,CAACC,EAAE;MACXC,SAAS,EAAEF,IAAI,CAACE,SAAS;MACzBC,UAAU,EAAEH,IAAI,CAACG,UAAU;MAC3BC,OAAO,EAAEJ,IAAI,CAACI,OAAO;MACrBC,SAAS,EAAEL,IAAI,CAACK,SAAS;MACzBC,UAAU,EAAEN,IAAI,CAACM,UAAU;MAC3BC,OAAO,EAAEP,IAAI,CAACO,OAAO;MACrBC,QAAQ,EAAER,IAAI,CAACQ,QAAQ,IAAI;QAAEC,QAAQ,EAAE;MAAO,CAAC;MAC/CC,MAAM,EAAE;QACJC,IAAI,EAAEX,IAAI,CAACW,IAAI;QACfC,GAAG,EAAEZ,IAAI,CAACY,GAAG;QACbC,IAAI,EAAEb,IAAI,CAACa,IAAI;QACfC,IAAI,EAAEd,IAAI,CAACc,IAAI;QACfC,QAAQ,EAAEf,IAAI,CAACe,QAAQ,IAAI,CAAC,CAAC;QAC7BC,aAAa,EAAE;UACXF,IAAI,EAAE;QACV,CAAC;QACDG,IAAI,EAAEjB,IAAI,CAACiB,IAAI,IAAI,EAAE;QACrBC,UAAU,EAAElB,IAAI,CAACkB;MACrB;IACJ,CAAC;EACL;AACJ","ignoreList":[]}
@@ -0,0 +1,5 @@
1
+ import type { CmsEntry } from "@webiny/api-headless-cms/types";
2
+ import type { File } from "../../../domain/file/types.js";
3
+ export declare class FileToEntryMapper {
4
+ static toEntry(file: File): Partial<CmsEntry>;
5
+ }
@@ -0,0 +1,29 @@
1
+ export class FileToEntryMapper {
2
+ static toEntry(file) {
3
+ return {
4
+ id: `${file.id}#0001`,
5
+ entryId: file.id,
6
+ createdOn: file.createdOn,
7
+ modifiedOn: file.modifiedOn,
8
+ savedOn: file.savedOn,
9
+ createdBy: file.createdBy,
10
+ modifiedBy: file.modifiedBy,
11
+ savedBy: file.savedBy,
12
+ location: file.location || {
13
+ folderId: "root"
14
+ },
15
+ values: {
16
+ name: file.name,
17
+ key: file.key,
18
+ size: file.size,
19
+ type: file.type,
20
+ metadata: file.metadata || {},
21
+ accessControl: file.accessControl,
22
+ tags: file.tags || [],
23
+ extensions: file.extensions
24
+ }
25
+ };
26
+ }
27
+ }
28
+
29
+ //# sourceMappingURL=FileToEntryMapper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["FileToEntryMapper","toEntry","file","id","entryId","createdOn","modifiedOn","savedOn","createdBy","modifiedBy","savedBy","location","folderId","values","name","key","size","type","metadata","accessControl","tags","extensions"],"sources":["FileToEntryMapper.ts"],"sourcesContent":["import type { CmsEntry } from \"@webiny/api-headless-cms/types\";\nimport type { File } from \"~/domain/file/types.js\";\n\nexport class FileToEntryMapper {\n static toEntry(file: File): Partial<CmsEntry> {\n return {\n id: `${file.id}#0001`,\n entryId: file.id,\n createdOn: file.createdOn,\n modifiedOn: file.modifiedOn,\n savedOn: file.savedOn,\n createdBy: file.createdBy,\n modifiedBy: file.modifiedBy,\n savedBy: file.savedBy,\n location: file.location || { folderId: \"root\" },\n values: {\n name: file.name,\n key: file.key,\n size: file.size,\n type: file.type,\n metadata: file.metadata || {},\n accessControl: file.accessControl,\n tags: file.tags || [],\n extensions: file.extensions\n }\n };\n }\n}\n"],"mappings":"AAGA,OAAO,MAAMA,iBAAiB,CAAC;EAC3B,OAAOC,OAAOA,CAACC,IAAU,EAAqB;IAC1C,OAAO;MACHC,EAAE,EAAE,GAAGD,IAAI,CAACC,EAAE,OAAO;MACrBC,OAAO,EAAEF,IAAI,CAACC,EAAE;MAChBE,SAAS,EAAEH,IAAI,CAACG,SAAS;MACzBC,UAAU,EAAEJ,IAAI,CAACI,UAAU;MAC3BC,OAAO,EAAEL,IAAI,CAACK,OAAO;MACrBC,SAAS,EAAEN,IAAI,CAACM,SAAS;MACzBC,UAAU,EAAEP,IAAI,CAACO,UAAU;MAC3BC,OAAO,EAAER,IAAI,CAACQ,OAAO;MACrBC,QAAQ,EAAET,IAAI,CAACS,QAAQ,IAAI;QAAEC,QAAQ,EAAE;MAAO,CAAC;MAC/CC,MAAM,EAAE;QACJC,IAAI,EAAEZ,IAAI,CAACY,IAAI;QACfC,GAAG,EAAEb,IAAI,CAACa,GAAG;QACbC,IAAI,EAAEd,IAAI,CAACc,IAAI;QACfC,IAAI,EAAEf,IAAI,CAACe,IAAI;QACfC,QAAQ,EAAEhB,IAAI,CAACgB,QAAQ,IAAI,CAAC,CAAC;QAC7BC,aAAa,EAAEjB,IAAI,CAACiB,aAAa;QACjCC,IAAI,EAAElB,IAAI,CAACkB,IAAI,IAAI,EAAE;QACrBC,UAAU,EAAEnB,IAAI,CAACmB;MACrB;IACJ,CAAC;EACL;AACJ","ignoreList":[]}
@@ -0,0 +1,13 @@
1
+ import { Result } from "@webiny/feature/api";
2
+ import { GetSettingsUseCase as UseCaseAbstraction } from "./abstractions.js";
3
+ import type { FileManagerSettings } from "../../../domain/settings/types.js";
4
+ import { KeyValueStore } from "@webiny/api-core/features/keyValueStore/index.js";
5
+ declare class GetSettingsUseCaseImpl implements UseCaseAbstraction.Interface {
6
+ private keyValueStore;
7
+ constructor(keyValueStore: KeyValueStore.Interface);
8
+ execute(): Promise<Result<FileManagerSettings, UseCaseAbstraction.Error>>;
9
+ }
10
+ export declare const GetSettingsUseCase: typeof GetSettingsUseCaseImpl & {
11
+ __abstraction: import("@webiny/di").Abstraction<import("./abstractions.js").IGetSettingsUseCase>;
12
+ };
13
+ export {};