@webiny/api-aco 6.6.0-alpha.0 → 6.6.0-alpha.10

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 (348) hide show
  1. package/AcoFeature.js +23 -38
  2. package/AcoFeature.js.map +1 -1
  3. package/AcoFolderSchemaFactory.d.ts +32 -0
  4. package/AcoFolderSchemaFactory.js +82 -0
  5. package/AcoFolderSchemaFactory.js.map +1 -0
  6. package/createAcoGraphQL.d.ts +3 -2
  7. package/createAcoGraphQL.js.map +1 -1
  8. package/domain/folder/abstractions.d.ts +12 -5
  9. package/domain/folder/abstractions.js +2 -2
  10. package/domain/folder/abstractions.js.map +1 -1
  11. package/domain/folder/folder.model.js +2 -1
  12. package/domain/folder/folder.model.js.map +1 -1
  13. package/exports/api/aco/flp.d.ts +3 -3
  14. package/exports/api/aco/flp.js +2 -3
  15. package/features/ai/CreateFolderTool.d.ts +49 -0
  16. package/features/ai/CreateFolderTool.js +58 -0
  17. package/features/ai/CreateFolderTool.js.map +1 -0
  18. package/features/ai/CreateTeamTool.d.ts +48 -0
  19. package/features/ai/CreateTeamTool.js +56 -0
  20. package/features/ai/CreateTeamTool.js.map +1 -0
  21. package/features/ai/DeleteFolderTool.d.ts +48 -0
  22. package/features/ai/DeleteFolderTool.js +55 -0
  23. package/features/ai/DeleteFolderTool.js.map +1 -0
  24. package/features/ai/GrantFolderAccessTool.d.ts +77 -0
  25. package/features/ai/GrantFolderAccessTool.js +80 -0
  26. package/features/ai/GrantFolderAccessTool.js.map +1 -0
  27. package/features/ai/ListFoldersTool.d.ts +47 -0
  28. package/features/ai/ListFoldersTool.js +57 -0
  29. package/features/ai/ListFoldersTool.js.map +1 -0
  30. package/features/ai/ListRolesTool.d.ts +39 -0
  31. package/features/ai/ListRolesTool.js +48 -0
  32. package/features/ai/ListRolesTool.js.map +1 -0
  33. package/features/ai/ListTeamsTool.d.ts +39 -0
  34. package/features/ai/ListTeamsTool.js +48 -0
  35. package/features/ai/ListTeamsTool.js.map +1 -0
  36. package/features/ai/RevokeFolderAccessTool.d.ts +63 -0
  37. package/features/ai/RevokeFolderAccessTool.js +69 -0
  38. package/features/ai/RevokeFolderAccessTool.js.map +1 -0
  39. package/features/ai/assertTargetIsUsable.d.ts +10 -0
  40. package/features/ai/assertTargetIsUsable.js +14 -0
  41. package/features/ai/assertTargetIsUsable.js.map +1 -0
  42. package/features/ai/feature.d.ts +12 -0
  43. package/features/ai/feature.js +25 -0
  44. package/features/ai/feature.js.map +1 -0
  45. package/features/ai/index.d.ts +9 -0
  46. package/features/ai/index.js +9 -0
  47. package/features/ai/loadFolderPermissions.d.ts +16 -0
  48. package/features/ai/loadFolderPermissions.js +14 -0
  49. package/features/ai/loadFolderPermissions.js.map +1 -0
  50. package/features/cms/decorators/ListDeletedEntriesWithFlpDecorator.d.ts +4 -4
  51. package/features/cms/decorators/ListDeletedEntriesWithFlpDecorator.js +7 -8
  52. package/features/cms/decorators/ListDeletedEntriesWithFlpDecorator.js.map +1 -1
  53. package/features/cms/decorators/ListEntriesWithFlpDecorator.d.ts +3 -3
  54. package/features/cms/decorators/ListEntriesWithFlpDecorator.js +7 -8
  55. package/features/cms/decorators/ListEntriesWithFlpDecorator.js.map +1 -1
  56. package/features/cms/decorators/ListLatestEntriesWithFlpDecorator.d.ts +4 -4
  57. package/features/cms/decorators/ListLatestEntriesWithFlpDecorator.js +7 -8
  58. package/features/cms/decorators/ListLatestEntriesWithFlpDecorator.js.map +1 -1
  59. package/features/cms/decorators/ListPublishedEntriesWithFlpDecorator.d.ts +4 -4
  60. package/features/cms/decorators/ListPublishedEntriesWithFlpDecorator.js +7 -8
  61. package/features/cms/decorators/ListPublishedEntriesWithFlpDecorator.js.map +1 -1
  62. package/features/flp/CreateFlp/index.d.ts +0 -1
  63. package/features/flp/CreateFlp/index.js +0 -1
  64. package/features/flp/DeleteFlp/index.d.ts +0 -1
  65. package/features/flp/DeleteFlp/index.js +0 -1
  66. package/features/flp/FolderAccessListFilter/abstractions.d.ts +33 -0
  67. package/features/flp/FolderAccessListFilter/abstractions.js +5 -0
  68. package/features/flp/FolderAccessListFilter/abstractions.js.map +1 -0
  69. package/features/flp/FolderAccessListFilter/index.d.ts +1 -0
  70. package/features/flp/FolderAccessListFilter/index.js +1 -0
  71. package/features/flp/FolderCatalogSync/FolderCatalogSyncHandlersFeature.d.ts +8 -0
  72. package/features/flp/FolderCatalogSync/FolderCatalogSyncHandlersFeature.js +15 -0
  73. package/features/flp/FolderCatalogSync/FolderCatalogSyncHandlersFeature.js.map +1 -0
  74. package/features/flp/FolderCatalogSync/SyncFolderCatalogOnFolderCreatedHandler.d.ts +11 -0
  75. package/features/flp/FolderCatalogSync/SyncFolderCatalogOnFolderCreatedHandler.js +19 -0
  76. package/features/flp/FolderCatalogSync/SyncFolderCatalogOnFolderCreatedHandler.js.map +1 -0
  77. package/features/flp/FolderCatalogSync/SyncFolderCatalogOnFolderDeletedHandler.d.ts +11 -0
  78. package/features/flp/FolderCatalogSync/SyncFolderCatalogOnFolderDeletedHandler.js +19 -0
  79. package/features/flp/FolderCatalogSync/SyncFolderCatalogOnFolderDeletedHandler.js.map +1 -0
  80. package/features/flp/FolderCatalogSync/SyncFolderCatalogOnFolderUpdatedHandler.d.ts +11 -0
  81. package/features/flp/FolderCatalogSync/SyncFolderCatalogOnFolderUpdatedHandler.js +23 -0
  82. package/features/flp/FolderCatalogSync/SyncFolderCatalogOnFolderUpdatedHandler.js.map +1 -0
  83. package/features/flp/FolderCatalogSync/abstractions.d.ts +25 -0
  84. package/features/flp/FolderCatalogSync/abstractions.js +5 -0
  85. package/features/flp/FolderCatalogSync/abstractions.js.map +1 -0
  86. package/features/flp/FolderCatalogSync/index.d.ts +2 -0
  87. package/features/flp/FolderCatalogSync/index.js +2 -0
  88. package/features/flp/FolderLevelPermissions/FolderLevelPermissions.d.ts +8 -5
  89. package/features/flp/FolderLevelPermissions/FolderLevelPermissions.js +25 -11
  90. package/features/flp/FolderLevelPermissions/FolderLevelPermissions.js.map +1 -1
  91. package/features/flp/FolderLevelPermissions/NoopFolderLevelPermissions.d.ts +1 -0
  92. package/features/flp/FolderLevelPermissions/NoopFolderLevelPermissions.js +3 -0
  93. package/features/flp/FolderLevelPermissions/NoopFolderLevelPermissions.js.map +1 -1
  94. package/features/flp/FolderLevelPermissions/abstractions.d.ts +8 -2
  95. package/features/flp/FolderLevelPermissions/abstractions.js.map +1 -1
  96. package/features/flp/FolderLevelPermissions/useCases/GetDefaultPermissions/GetDefaultPermissionsWithTeams.d.ts +12 -0
  97. package/features/flp/FolderLevelPermissions/useCases/GetDefaultPermissions/GetDefaultPermissionsWithTeams.js +22 -14
  98. package/features/flp/FolderLevelPermissions/useCases/GetDefaultPermissions/GetDefaultPermissionsWithTeams.js.map +1 -1
  99. package/features/flp/FolderPermissionsRepository/abstractions.d.ts +28 -0
  100. package/features/flp/FolderPermissionsRepository/abstractions.js +5 -0
  101. package/features/flp/FolderPermissionsRepository/abstractions.js.map +1 -0
  102. package/features/flp/FolderPermissionsRepository/index.d.ts +1 -0
  103. package/features/flp/FolderPermissionsRepository/index.js +1 -0
  104. package/features/flp/GetFlp/GetFlpUseCase.d.ts +10 -5
  105. package/features/flp/GetFlp/GetFlpUseCase.js +13 -5
  106. package/features/flp/GetFlp/GetFlpUseCase.js.map +1 -1
  107. package/features/flp/GetFlp/decorators/GetFlpWithCodeFlps.d.ts +13 -0
  108. package/features/flp/GetFlp/decorators/GetFlpWithCodeFlps.js +26 -0
  109. package/features/flp/GetFlp/decorators/GetFlpWithCodeFlps.js.map +1 -0
  110. package/features/flp/GetFlp/feature.js +1 -3
  111. package/features/flp/GetFlp/feature.js.map +1 -1
  112. package/features/flp/ListFlps/ListFlpsUseCase.d.ts +11 -6
  113. package/features/flp/ListFlps/ListFlpsUseCase.js +13 -5
  114. package/features/flp/ListFlps/ListFlpsUseCase.js.map +1 -1
  115. package/features/flp/ListFlps/abstractions.d.ts +3 -9
  116. package/features/flp/ListFlps/abstractions.js.map +1 -1
  117. package/features/flp/ListFlps/decorators/ListFlpsWithCodeFlps.d.ts +13 -0
  118. package/features/flp/ListFlps/decorators/ListFlpsWithCodeFlps.js +27 -0
  119. package/features/flp/ListFlps/decorators/ListFlpsWithCodeFlps.js.map +1 -0
  120. package/features/flp/ListFlps/feature.js +1 -3
  121. package/features/flp/ListFlps/feature.js.map +1 -1
  122. package/features/flp/ListFolderAccess/GetUserEntryAccessUseCase.d.ts +14 -0
  123. package/features/flp/ListFolderAccess/GetUserEntryAccessUseCase.js +36 -0
  124. package/features/flp/ListFolderAccess/GetUserEntryAccessUseCase.js.map +1 -0
  125. package/features/flp/ListFolderAccess/GetUserFolderAccessUseCase.d.ts +25 -0
  126. package/features/flp/ListFolderAccess/GetUserFolderAccessUseCase.js +75 -0
  127. package/features/flp/ListFolderAccess/GetUserFolderAccessUseCase.js.map +1 -0
  128. package/features/flp/ListFolderAccess/ListEntryAccessUseCase.d.ts +13 -0
  129. package/features/flp/ListFolderAccess/ListEntryAccessUseCase.js +28 -0
  130. package/features/flp/ListFolderAccess/ListEntryAccessUseCase.js.map +1 -0
  131. package/features/flp/ListFolderAccess/ListFolderAccessUseCase.d.ts +24 -0
  132. package/features/flp/ListFolderAccess/ListFolderAccessUseCase.js +107 -0
  133. package/features/flp/ListFolderAccess/ListFolderAccessUseCase.js.map +1 -0
  134. package/features/flp/ListFolderAccess/ListUserFolderAccessUseCase.d.ts +28 -0
  135. package/features/flp/ListFolderAccess/ListUserFolderAccessUseCase.js +98 -0
  136. package/features/flp/ListFolderAccess/ListUserFolderAccessUseCase.js.map +1 -0
  137. package/features/flp/ListFolderAccess/UserFolderCandidates.d.ts +13 -0
  138. package/features/flp/ListFolderAccess/UserFolderCandidates.js +26 -0
  139. package/features/flp/ListFolderAccess/UserFolderCandidates.js.map +1 -0
  140. package/features/flp/ListFolderAccess/abstractions.d.ts +182 -0
  141. package/features/flp/ListFolderAccess/abstractions.js +10 -0
  142. package/features/flp/ListFolderAccess/abstractions.js.map +1 -0
  143. package/features/flp/{UpdateFlpOnFolderUpdated → ListFolderAccess}/feature.d.ts +1 -1
  144. package/features/flp/ListFolderAccess/feature.js +21 -0
  145. package/features/flp/ListFolderAccess/feature.js.map +1 -0
  146. package/features/flp/ListFolderAccess/index.d.ts +2 -0
  147. package/features/flp/ListFolderAccess/index.js +2 -0
  148. package/features/flp/ListFolderAccess/mayAskAboutUser.d.ts +3 -0
  149. package/features/flp/ListFolderAccess/mayAskAboutUser.js +9 -0
  150. package/features/flp/ListFolderAccess/mayAskAboutUser.js.map +1 -0
  151. package/features/flp/ListFolderAccess/userFolderLevel.d.ts +31 -0
  152. package/features/flp/ListFolderAccess/userFolderLevel.js +48 -0
  153. package/features/flp/ListFolderAccess/userFolderLevel.js.map +1 -0
  154. package/features/flp/UpdateFlp/abstractions.d.ts +6 -2
  155. package/features/flp/UpdateFlp/abstractions.js.map +1 -1
  156. package/features/flp/UpdateFlp/index.d.ts +0 -1
  157. package/features/flp/UpdateFlp/index.js +0 -1
  158. package/features/flp/shared/CodeFlpMerger.d.ts +26 -0
  159. package/features/flp/shared/CodeFlpMerger.js +20 -0
  160. package/features/flp/shared/CodeFlpMerger.js.map +1 -0
  161. package/features/flp/shared/CodeFlpPath.d.ts +15 -0
  162. package/features/flp/shared/CodeFlpPath.js +29 -0
  163. package/features/flp/shared/CodeFlpPath.js.map +1 -0
  164. package/features/flp/shared/CodeFlpTarget.d.ts +10 -0
  165. package/features/flp/shared/CodeFlpTarget.js +26 -0
  166. package/features/flp/shared/CodeFlpTarget.js.map +1 -0
  167. package/features/flp/shared/CodeFlpsProvider.d.ts +15 -0
  168. package/features/flp/shared/CodeFlpsProvider.js +36 -0
  169. package/features/flp/shared/CodeFlpsProvider.js.map +1 -0
  170. package/features/flp/shared/abstractions.d.ts +79 -0
  171. package/features/flp/shared/abstractions.js +19 -0
  172. package/features/flp/shared/abstractions.js.map +1 -0
  173. package/features/flp/shared/feature.d.ts +5 -0
  174. package/features/flp/shared/feature.js +17 -0
  175. package/features/flp/shared/feature.js.map +1 -0
  176. package/features/flp/shared/index.d.ts +4 -0
  177. package/features/flp/shared/index.js +4 -0
  178. package/features/folder/CreateFolder/CreateFolderRepository.d.ts +3 -3
  179. package/features/folder/CreateFolder/CreateFolderRepository.js +10 -7
  180. package/features/folder/CreateFolder/CreateFolderRepository.js.map +1 -1
  181. package/features/folder/CreateFolder/decorators/CreateFolderWithFolderLevelPermissions.d.ts +9 -1
  182. package/features/folder/CreateFolder/decorators/CreateFolderWithFolderLevelPermissions.js +20 -3
  183. package/features/folder/CreateFolder/decorators/CreateFolderWithFolderLevelPermissions.js.map +1 -1
  184. package/features/folder/DeleteFolder/DeleteFolderRepository.d.ts +3 -3
  185. package/features/folder/DeleteFolder/DeleteFolderRepository.js +6 -5
  186. package/features/folder/DeleteFolder/DeleteFolderRepository.js.map +1 -1
  187. package/features/folder/FolderModelProvider.d.ts +26 -0
  188. package/features/folder/FolderModelProvider.js +22 -0
  189. package/features/folder/FolderModelProvider.js.map +1 -0
  190. package/features/folder/GetAncestors/GetAncestorsRepository.d.ts +3 -3
  191. package/features/folder/GetAncestors/GetAncestorsRepository.js +6 -5
  192. package/features/folder/GetAncestors/GetAncestorsRepository.js.map +1 -1
  193. package/features/folder/GetFolder/GetFolderRepository.d.ts +3 -3
  194. package/features/folder/GetFolder/GetFolderRepository.js +6 -5
  195. package/features/folder/GetFolder/GetFolderRepository.js.map +1 -1
  196. package/features/folder/GetFolderHierarchy/GetFolderHierarchyRepository.d.ts +3 -3
  197. package/features/folder/GetFolderHierarchy/GetFolderHierarchyRepository.js +10 -8
  198. package/features/folder/GetFolderHierarchy/GetFolderHierarchyRepository.js.map +1 -1
  199. package/features/folder/ListFolders/ListFoldersRepository.d.ts +3 -3
  200. package/features/folder/ListFolders/ListFoldersRepository.js +8 -7
  201. package/features/folder/ListFolders/ListFoldersRepository.js.map +1 -1
  202. package/features/folder/ListFolders/decorators/ListFoldersWithFolderLevelPermissions.d.ts +3 -7
  203. package/features/folder/ListFolders/decorators/ListFoldersWithFolderLevelPermissions.js +5 -50
  204. package/features/folder/ListFolders/decorators/ListFoldersWithFolderLevelPermissions.js.map +1 -1
  205. package/features/folder/NotifyFolderChange/NotifyFolderChangeUseCase.d.ts +11 -0
  206. package/features/folder/NotifyFolderChange/NotifyFolderChangeUseCase.js +38 -0
  207. package/features/folder/NotifyFolderChange/NotifyFolderChangeUseCase.js.map +1 -0
  208. package/features/{flp/DeleteFlpOnFolderDeleted/DeleteFlpOnFolderDeletedHandler.d.ts → folder/NotifyFolderChange/NotifyOnFolderDeletedHandler.d.ts} +5 -7
  209. package/features/folder/NotifyFolderChange/NotifyOnFolderDeletedHandler.js +24 -0
  210. package/features/folder/NotifyFolderChange/NotifyOnFolderDeletedHandler.js.map +1 -0
  211. package/features/folder/NotifyFolderChange/abstractions.d.ts +28 -0
  212. package/features/folder/NotifyFolderChange/abstractions.js +8 -0
  213. package/features/folder/NotifyFolderChange/abstractions.js.map +1 -0
  214. package/features/folder/NotifyFolderChange/feature.d.ts +8 -0
  215. package/features/folder/NotifyFolderChange/feature.js +13 -0
  216. package/features/folder/NotifyFolderChange/feature.js.map +1 -0
  217. package/features/folder/NotifyFolderChange/index.d.ts +2 -0
  218. package/features/folder/NotifyFolderChange/index.js +2 -0
  219. package/features/folder/UpdateFolder/UpdateFolderRepository.d.ts +3 -3
  220. package/features/folder/UpdateFolder/UpdateFolderRepository.js +11 -8
  221. package/features/folder/UpdateFolder/UpdateFolderRepository.js.map +1 -1
  222. package/features/folder/UpdateFolder/decorators/UpdateFolderWithFolderLevelPermissions.d.ts +14 -1
  223. package/features/folder/UpdateFolder/decorators/UpdateFolderWithFolderLevelPermissions.js +52 -4
  224. package/features/folder/UpdateFolder/decorators/UpdateFolderWithFolderLevelPermissions.js.map +1 -1
  225. package/filter/filter.model.js +2 -1
  226. package/filter/filter.model.js.map +1 -1
  227. package/filter/filter.so.d.ts +0 -2
  228. package/filter/filter.so.js +20 -8
  229. package/filter/filter.so.js.map +1 -1
  230. package/flp/flp.types.d.ts +6 -1
  231. package/flp/index.d.ts +0 -1
  232. package/flp/index.js +0 -1
  233. package/flpTaskCatalog/CatalogFolderPermissionsRepository.d.ts +17 -0
  234. package/flpTaskCatalog/CatalogFolderPermissionsRepository.js +34 -0
  235. package/flpTaskCatalog/CatalogFolderPermissionsRepository.js.map +1 -0
  236. package/flpTaskCatalog/PostLoadFolderAccessListFilter.d.ts +24 -0
  237. package/flpTaskCatalog/PostLoadFolderAccessListFilter.js +63 -0
  238. package/flpTaskCatalog/PostLoadFolderAccessListFilter.js.map +1 -0
  239. package/flpTaskCatalog/TaskCatalogFlpFeature.d.ts +12 -0
  240. package/flpTaskCatalog/TaskCatalogFlpFeature.js +49 -0
  241. package/flpTaskCatalog/TaskCatalogFlpFeature.js.map +1 -0
  242. package/flpTaskCatalog/TaskFolderCatalogSync.d.ts +29 -0
  243. package/flpTaskCatalog/TaskFolderCatalogSync.js +57 -0
  244. package/flpTaskCatalog/TaskFolderCatalogSync.js.map +1 -0
  245. package/{flp → flpTaskCatalog}/flp.crud.d.ts +1 -1
  246. package/flpTaskCatalog/flp.crud.js.map +1 -0
  247. package/flpTaskCatalog/index.d.ts +1 -0
  248. package/flpTaskCatalog/index.js +1 -0
  249. package/{utils/decorators → flpTaskCatalog/listEntries}/ListEntriesFactory.d.ts +1 -1
  250. package/flpTaskCatalog/listEntries/ListEntriesFactory.js.map +1 -0
  251. package/flpTaskCatalog/listEntries/hasRootFolderId.js.map +1 -0
  252. package/{utils/decorators → flpTaskCatalog/listEntries}/isPageModel.js +1 -1
  253. package/flpTaskCatalog/listEntries/isPageModel.js.map +1 -0
  254. package/flpTaskCatalog/tasks/createFlp.task.d.ts +25 -0
  255. package/{flp → flpTaskCatalog}/tasks/createFlp.task.js +34 -17
  256. package/flpTaskCatalog/tasks/createFlp.task.js.map +1 -0
  257. package/flpTaskCatalog/tasks/deleteFlp.task.d.ts +23 -0
  258. package/{flp → flpTaskCatalog}/tasks/deleteFlp.task.js +24 -15
  259. package/flpTaskCatalog/tasks/deleteFlp.task.js.map +1 -0
  260. package/{flp → flpTaskCatalog}/tasks/syncFlp.task.d.ts +11 -6
  261. package/{flp → flpTaskCatalog}/tasks/syncFlp.task.js +25 -16
  262. package/flpTaskCatalog/tasks/syncFlp.task.js.map +1 -0
  263. package/flpTaskCatalog/tasks/updateFlp.task.d.ts +25 -0
  264. package/flpTaskCatalog/tasks/updateFlp.task.js +64 -0
  265. package/flpTaskCatalog/tasks/updateFlp.task.js.map +1 -0
  266. package/flpTaskCatalog/useCases/CreateFlpUseCase.d.ts +8 -0
  267. package/{features/flp/CreateFlp → flpTaskCatalog/useCases}/CreateFlpUseCase.js +1 -1
  268. package/flpTaskCatalog/useCases/CreateFlpUseCase.js.map +1 -0
  269. package/flpTaskCatalog/useCases/DeleteFlpUseCase.d.ts +8 -0
  270. package/flpTaskCatalog/useCases/DeleteFlpUseCase.js.map +1 -0
  271. package/{features/flp/UpdateFlp → flpTaskCatalog/useCases}/UpdateFlpUseCase.d.ts +10 -11
  272. package/{features/flp/UpdateFlp → flpTaskCatalog/useCases}/UpdateFlpUseCase.js +27 -33
  273. package/flpTaskCatalog/useCases/UpdateFlpUseCase.js.map +1 -0
  274. package/folder/createFolderTypeDefs.js +4 -1
  275. package/folder/createFolderTypeDefs.js.map +1 -1
  276. package/folder/folder.gql.js +2 -2
  277. package/folder/folder.gql.js.map +1 -1
  278. package/index.d.ts +1 -0
  279. package/index.js +1 -0
  280. package/package.json +23 -22
  281. package/types.d.ts +2 -3
  282. package/types.js.map +1 -1
  283. package/utils/createOperationsWrapper.d.ts +2 -2
  284. package/utils/createOperationsWrapper.js +5 -5
  285. package/utils/createOperationsWrapper.js.map +1 -1
  286. package/AcoInitializer.d.ts +0 -25
  287. package/AcoInitializer.js +0 -79
  288. package/AcoInitializer.js.map +0 -1
  289. package/features/flp/CreateFlp/CreateFlpUseCase.d.ts +0 -8
  290. package/features/flp/CreateFlp/CreateFlpUseCase.js.map +0 -1
  291. package/features/flp/CreateFlp/feature.d.ts +0 -5
  292. package/features/flp/CreateFlp/feature.js +0 -13
  293. package/features/flp/CreateFlp/feature.js.map +0 -1
  294. package/features/flp/CreateFlpOnFolderCreated/CreateFlpOnFolderCreatedHandler.d.ts +0 -14
  295. package/features/flp/CreateFlpOnFolderCreated/CreateFlpOnFolderCreatedHandler.js +0 -37
  296. package/features/flp/CreateFlpOnFolderCreated/CreateFlpOnFolderCreatedHandler.js.map +0 -1
  297. package/features/flp/CreateFlpOnFolderCreated/feature.d.ts +0 -4
  298. package/features/flp/CreateFlpOnFolderCreated/feature.js +0 -11
  299. package/features/flp/CreateFlpOnFolderCreated/feature.js.map +0 -1
  300. package/features/flp/CreateFlpOnFolderCreated/index.d.ts +0 -1
  301. package/features/flp/CreateFlpOnFolderCreated/index.js +0 -1
  302. package/features/flp/DeleteFlp/DeleteFlpUseCase.d.ts +0 -8
  303. package/features/flp/DeleteFlp/DeleteFlpUseCase.js.map +0 -1
  304. package/features/flp/DeleteFlp/feature.d.ts +0 -5
  305. package/features/flp/DeleteFlp/feature.js +0 -13
  306. package/features/flp/DeleteFlp/feature.js.map +0 -1
  307. package/features/flp/DeleteFlpOnFolderDeleted/DeleteFlpOnFolderDeletedHandler.js +0 -37
  308. package/features/flp/DeleteFlpOnFolderDeleted/DeleteFlpOnFolderDeletedHandler.js.map +0 -1
  309. package/features/flp/DeleteFlpOnFolderDeleted/feature.d.ts +0 -4
  310. package/features/flp/DeleteFlpOnFolderDeleted/feature.js +0 -11
  311. package/features/flp/DeleteFlpOnFolderDeleted/feature.js.map +0 -1
  312. package/features/flp/DeleteFlpOnFolderDeleted/index.d.ts +0 -1
  313. package/features/flp/DeleteFlpOnFolderDeleted/index.js +0 -1
  314. package/features/flp/UpdateFlp/UpdateFlpUseCase.js.map +0 -1
  315. package/features/flp/UpdateFlp/feature.d.ts +0 -5
  316. package/features/flp/UpdateFlp/feature.js +0 -17
  317. package/features/flp/UpdateFlp/feature.js.map +0 -1
  318. package/features/flp/UpdateFlpOnFolderUpdated/UpdateFlpOnFolderUpdatedHandler.d.ts +0 -14
  319. package/features/flp/UpdateFlpOnFolderUpdated/UpdateFlpOnFolderUpdatedHandler.js +0 -39
  320. package/features/flp/UpdateFlpOnFolderUpdated/UpdateFlpOnFolderUpdatedHandler.js.map +0 -1
  321. package/features/flp/UpdateFlpOnFolderUpdated/feature.js +0 -11
  322. package/features/flp/UpdateFlpOnFolderUpdated/feature.js.map +0 -1
  323. package/features/flp/UpdateFlpOnFolderUpdated/index.d.ts +0 -1
  324. package/features/flp/UpdateFlpOnFolderUpdated/index.js +0 -1
  325. package/flp/flp.crud.js.map +0 -1
  326. package/flp/tasks/createFlp.task.d.ts +0 -18
  327. package/flp/tasks/createFlp.task.js.map +0 -1
  328. package/flp/tasks/deleteFlp.task.d.ts +0 -18
  329. package/flp/tasks/deleteFlp.task.js.map +0 -1
  330. package/flp/tasks/syncFlp.task.js.map +0 -1
  331. package/flp/tasks/updateFlp.task.d.ts +0 -18
  332. package/flp/tasks/updateFlp.task.js +0 -43
  333. package/flp/tasks/updateFlp.task.js.map +0 -1
  334. package/utils/decorators/CmsEntriesCrudDecorators.d.ts +0 -11
  335. package/utils/decorators/CmsEntriesCrudDecorators.js +0 -179
  336. package/utils/decorators/CmsEntriesCrudDecorators.js.map +0 -1
  337. package/utils/decorators/FilterEntriesByFolderFactory.d.ts +0 -7
  338. package/utils/decorators/FilterEntriesByFolderFactory.js +0 -22
  339. package/utils/decorators/FilterEntriesByFolderFactory.js.map +0 -1
  340. package/utils/decorators/ListEntriesFactory.js.map +0 -1
  341. package/utils/decorators/hasRootFolderId.js.map +0 -1
  342. package/utils/decorators/isPageModel.js.map +0 -1
  343. /package/{flp → flpTaskCatalog}/flp.crud.js +0 -0
  344. /package/{utils/decorators → flpTaskCatalog/listEntries}/ListEntriesFactory.js +0 -0
  345. /package/{utils/decorators → flpTaskCatalog/listEntries}/hasRootFolderId.d.ts +0 -0
  346. /package/{utils/decorators → flpTaskCatalog/listEntries}/hasRootFolderId.js +0 -0
  347. /package/{utils/decorators → flpTaskCatalog/listEntries}/isPageModel.d.ts +0 -0
  348. /package/{features/flp/DeleteFlp → flpTaskCatalog/useCases}/DeleteFlpUseCase.js +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"features/flp/FolderLevelPermissions/abstractions.js","sources":["../../../../src/features/flp/FolderLevelPermissions/abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { CanAccessFolderContentParams, CanAccessFolderParams } from \"./useCases/index.js\";\nimport type { FolderLevelPermission, FolderPermission, ListFlpsParams } from \"~/types.js\";\n\nexport interface IFolderLevelPermissions {\n canUseFolderLevelPermissions(enabled?: boolean): boolean;\n canUseTeams(): boolean;\n canCreateFolderInRoot(): boolean;\n permissionsIncludeNonInheritedPermissions(permissions: FolderPermission[]): boolean;\n canAccessFolder(params: CanAccessFolderParams): Promise<boolean>;\n canAccessFolderContent(params: CanAccessFolderContentParams): Promise<boolean>;\n ensureCanAccessFolder(params: CanAccessFolderParams): Promise<void>;\n ensureCanAccessFolderContent(params: CanAccessFolderContentParams): Promise<void>;\n canManageFolderContent(flp: FolderLevelPermission): Promise<boolean>;\n canManageFolderStructure(flp: FolderLevelPermission): Promise<boolean>;\n canManageFolderPermissions(flp: FolderLevelPermission): Promise<boolean>;\n getDefaultPermissions(permissions: FolderPermission[]): Promise<FolderPermission[]>;\n listFolderLevelPermissions(params: ListFlpsParams): Promise<\n Array<{\n id: string;\n permissions: FolderPermission[];\n }>\n >;\n getFolderLevelPermissions(id: string): Promise<FolderPermission[]>;\n}\n\n/** Manage folder-level access control. */\nexport const FolderLevelPermissions =\n createAbstraction<IFolderLevelPermissions>(\"FolderLevelPermissions\");\n\nexport namespace FolderLevelPermissions {\n export type Interface = IFolderLevelPermissions;\n}\n"],"names":["FolderLevelPermissions","createAbstraction"],"mappings":";AA2BO,MAAMA,yBACTC,kBAA2C"}
1
+ {"version":3,"file":"features/flp/FolderLevelPermissions/abstractions.js","sources":["../../../../src/features/flp/FolderLevelPermissions/abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { CanAccessFolderContentParams, CanAccessFolderParams } from \"./useCases/index.js\";\nimport type { FolderLevelPermission, FolderPermission } from \"~/types.js\";\nimport type { ListFolderPermissionsParams } from \"~/features/flp/FolderPermissionsRepository/abstractions.js\";\n\nexport interface IFolderLevelPermissions {\n canUseFolderLevelPermissions(enabled?: boolean): boolean;\n canUseTeams(): boolean;\n canCreateFolderInRoot(): boolean;\n permissionsIncludeNonInheritedPermissions(permissions: FolderPermission[]): boolean;\n canAccessFolder(params: CanAccessFolderParams): Promise<boolean>;\n canAccessFolderContent(params: CanAccessFolderContentParams): Promise<boolean>;\n ensureCanAccessFolder(params: CanAccessFolderParams): Promise<void>;\n ensureCanAccessFolderContent(params: CanAccessFolderContentParams): Promise<void>;\n canManageFolderContent(flp: FolderLevelPermission): Promise<boolean>;\n canManageFolderStructure(flp: FolderLevelPermission): Promise<boolean>;\n canManageFolderPermissions(flp: FolderLevelPermission): Promise<boolean>;\n getDefaultPermissions(permissions: FolderPermission[]): Promise<FolderPermission[]>;\n /**\n * `getDefaultPermissions` for many folders at once: the identity's teams and permissions are\n * looked up once, not once per folder. Results are in the order of the input.\n */\n getDefaultPermissionsBatch(\n permissionsList: FolderPermission[][]\n ): Promise<FolderPermission[][]>;\n listFolderLevelPermissions(params: ListFolderPermissionsParams): Promise<\n Array<{\n id: string;\n permissions: FolderPermission[];\n }>\n >;\n getFolderLevelPermissions(id: string): Promise<FolderPermission[]>;\n}\n\n/** Manage folder-level access control. */\nexport const FolderLevelPermissions =\n createAbstraction<IFolderLevelPermissions>(\"FolderLevelPermissions\");\n\nexport namespace FolderLevelPermissions {\n export type Interface = IFolderLevelPermissions;\n}\n"],"names":["FolderLevelPermissions","createAbstraction"],"mappings":";AAmCO,MAAMA,yBACTC,kBAA2C"}
@@ -2,10 +2,22 @@ import type { IGetDefaultPermissions } from "./IGetDefaultPermissions.js";
2
2
  import type { FolderPermission } from "../../../../../flp/flp.types.js";
3
3
  import type { IdentityContext } from "@webiny/api-core/features/security/IdentityContext/index.js";
4
4
  import { ListUserTeamsUseCase } from "@webiny/api-core/features/users/ListUserTeams/index.js";
5
+ import type { SecurityIdentity, Team } from "@webiny/api-core/types/security.js";
6
+ /**
7
+ * For every team of the identity that has a permission on the folder, grants the identity the same
8
+ * level, marked as inherited from the team. Returns a new list; the given one is not changed.
9
+ */
10
+ export declare const expandTeamPermissions: (identity: SecurityIdentity | undefined, identityTeams: Team[], originalPermissions: FolderPermission[]) => FolderPermission[];
5
11
  export declare class GetDefaultPermissionsWithTeams implements IGetDefaultPermissions {
6
12
  private identityContext;
7
13
  private listUserTeamsUseCase;
8
14
  private decoretee;
15
+ /**
16
+ * The identity's teams, loaded once per instance and identity. An instance lives for one
17
+ * `getDefaultPermissions` call or one `listFolderLevelPermissions` call, so nothing is kept
18
+ * between calls or requests.
19
+ */
20
+ private loaded;
9
21
  constructor(identityContext: IdentityContext.Interface, listUserTeamsUseCase: ListUserTeamsUseCase.Interface, decoretee: IGetDefaultPermissions);
10
22
  execute(originalPermissions: FolderPermission[]): Promise<FolderPermission[]>;
11
23
  }
@@ -1,27 +1,35 @@
1
+ const expandTeamPermissions = (identity, identityTeams, originalPermissions)=>{
2
+ const permissions = [
3
+ ...originalPermissions
4
+ ];
5
+ if (identity && identityTeams.length) for (const identityTeam of identityTeams){
6
+ const teamPermission = permissions.find((p)=>p.target === `team:${identityTeam.slug}`);
7
+ if (teamPermission) permissions.push({
8
+ target: `admin:${identity.id}`,
9
+ level: teamPermission.level,
10
+ inheritedFrom: "team:" + identityTeam.slug
11
+ });
12
+ }
13
+ return permissions;
14
+ };
1
15
  class GetDefaultPermissionsWithTeams {
2
16
  constructor(identityContext, listUserTeamsUseCase, decoretee){
17
+ this.loaded = null;
3
18
  this.identityContext = identityContext;
4
19
  this.listUserTeamsUseCase = listUserTeamsUseCase;
5
20
  this.decoretee = decoretee;
6
21
  }
7
22
  async execute(originalPermissions) {
8
23
  const identity = this.identityContext.getIdentity();
9
- const listTeamsResult = await this.listUserTeamsUseCase.execute(identity.id);
10
- const identityTeams = listTeamsResult.isOk() ? listTeamsResult.value : [];
11
- const permissions = [
12
- ...originalPermissions
13
- ];
14
- if (identity && identityTeams.length) for (const identityTeam of identityTeams){
15
- const teamPermission = permissions.find((p)=>p.target === `team:${identityTeam.slug}`);
16
- if (teamPermission) permissions.push({
17
- target: `admin:${identity.id}`,
18
- level: teamPermission.level,
19
- inheritedFrom: "team:" + identityTeam.slug
20
- });
21
- }
24
+ if (!this.loaded || this.loaded.identityId !== identity.id) this.loaded = {
25
+ identityId: identity.id,
26
+ teams: this.listUserTeamsUseCase.execute(identity.id).then((result)=>result.isOk() ? result.value : [])
27
+ };
28
+ const identityTeams = await this.loaded.teams;
29
+ const permissions = expandTeamPermissions(identity, identityTeams, originalPermissions);
22
30
  return await this.decoretee.execute(permissions);
23
31
  }
24
32
  }
25
- export { GetDefaultPermissionsWithTeams };
33
+ export { GetDefaultPermissionsWithTeams, expandTeamPermissions };
26
34
 
27
35
  //# sourceMappingURL=GetDefaultPermissionsWithTeams.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"features/flp/FolderLevelPermissions/useCases/GetDefaultPermissions/GetDefaultPermissionsWithTeams.js","sources":["../../../../../../src/features/flp/FolderLevelPermissions/useCases/GetDefaultPermissions/GetDefaultPermissionsWithTeams.ts"],"sourcesContent":["import type { IGetDefaultPermissions } from \"./IGetDefaultPermissions.js\";\nimport type { FolderPermission } from \"~/flp/flp.types.js\";\nimport type { IdentityContext } from \"@webiny/api-core/features/security/IdentityContext/index.js\";\nimport { ListUserTeamsUseCase } from \"@webiny/api-core/features/users/ListUserTeams/index.js\";\nimport type { Team } from \"@webiny/api-core/types/security.js\";\n\nexport class GetDefaultPermissionsWithTeams implements IGetDefaultPermissions {\n private identityContext: IdentityContext.Interface;\n private listUserTeamsUseCase: ListUserTeamsUseCase.Interface;\n private decoretee: IGetDefaultPermissions;\n\n constructor(\n identityContext: IdentityContext.Interface,\n listUserTeamsUseCase: ListUserTeamsUseCase.Interface,\n decoretee: IGetDefaultPermissions\n ) {\n this.identityContext = identityContext;\n this.listUserTeamsUseCase = listUserTeamsUseCase;\n this.decoretee = decoretee;\n }\n\n async execute(originalPermissions: FolderPermission[]) {\n /**\n * Retrieves the list of teams the current identity belongs to and checks if any of these teams\n * have permissions for the folder. If a team has permissions, the current identity is granted\n * the same permissions, inheriting them from the team.\n */\n const identity = this.identityContext.getIdentity();\n\n // Get teams for current identity\n const listTeamsResult = await this.listUserTeamsUseCase.execute(identity.id);\n const identityTeams: Team[] = listTeamsResult.isOk() ? listTeamsResult.value : [];\n\n const permissions = [...originalPermissions]; // Clone the original permissions to avoid mutation.\n\n if (identity && identityTeams.length) {\n for (const identityTeam of identityTeams) {\n // Check if the team has permissions for the folder.\n const teamPermission = permissions.find(\n p => p.target === `team:${identityTeam.slug}`\n );\n\n if (teamPermission) {\n // Grant the current identity the same permissions as the team, marking them as inherited.\n permissions.push({\n target: `admin:${identity.id}`,\n level: teamPermission.level,\n inheritedFrom: \"team:\" + identityTeam.slug\n });\n }\n }\n }\n\n return await this.decoretee.execute(permissions);\n }\n}\n"],"names":["GetDefaultPermissionsWithTeams","identityContext","listUserTeamsUseCase","decoretee","originalPermissions","identity","listTeamsResult","identityTeams","permissions","identityTeam","teamPermission","p"],"mappings":"AAMO,MAAMA;IAKT,YACIC,eAA0C,EAC1CC,oBAAoD,EACpDC,SAAiC,CACnC;QACE,IAAI,CAAC,eAAe,GAAGF;QACvB,IAAI,CAAC,oBAAoB,GAAGC;QAC5B,IAAI,CAAC,SAAS,GAAGC;IACrB;IAEA,MAAM,QAAQC,mBAAuC,EAAE;QAMnD,MAAMC,WAAW,IAAI,CAAC,eAAe,CAAC,WAAW;QAGjD,MAAMC,kBAAkB,MAAM,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAACD,SAAS,EAAE;QAC3E,MAAME,gBAAwBD,gBAAgB,IAAI,KAAKA,gBAAgB,KAAK,GAAG,EAAE;QAEjF,MAAME,cAAc;eAAIJ;SAAoB;QAE5C,IAAIC,YAAYE,cAAc,MAAM,EAChC,KAAK,MAAME,gBAAgBF,cAAe;YAEtC,MAAMG,iBAAiBF,YAAY,IAAI,CACnCG,CAAAA,IAAKA,EAAE,MAAM,KAAK,CAAC,KAAK,EAAEF,aAAa,IAAI,EAAE;YAGjD,IAAIC,gBAEAF,YAAY,IAAI,CAAC;gBACb,QAAQ,CAAC,MAAM,EAAEH,SAAS,EAAE,EAAE;gBAC9B,OAAOK,eAAe,KAAK;gBAC3B,eAAe,UAAUD,aAAa,IAAI;YAC9C;QAER;QAGJ,OAAO,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO,CAACD;IACxC;AACJ"}
1
+ {"version":3,"file":"features/flp/FolderLevelPermissions/useCases/GetDefaultPermissions/GetDefaultPermissionsWithTeams.js","sources":["../../../../../../src/features/flp/FolderLevelPermissions/useCases/GetDefaultPermissions/GetDefaultPermissionsWithTeams.ts"],"sourcesContent":["import type { IGetDefaultPermissions } from \"./IGetDefaultPermissions.js\";\nimport type { FolderPermission } from \"~/flp/flp.types.js\";\nimport type { IdentityContext } from \"@webiny/api-core/features/security/IdentityContext/index.js\";\nimport { ListUserTeamsUseCase } from \"@webiny/api-core/features/users/ListUserTeams/index.js\";\nimport type { SecurityIdentity, Team } from \"@webiny/api-core/types/security.js\";\n\n/**\n * For every team of the identity that has a permission on the folder, grants the identity the same\n * level, marked as inherited from the team. Returns a new list; the given one is not changed.\n */\nexport const expandTeamPermissions = (\n identity: SecurityIdentity | undefined,\n identityTeams: Team[],\n originalPermissions: FolderPermission[]\n): FolderPermission[] => {\n const permissions = [...originalPermissions]; // Clone the original permissions to avoid mutation.\n\n if (identity && identityTeams.length) {\n for (const identityTeam of identityTeams) {\n // Check if the team has permissions for the folder.\n const teamPermission = permissions.find(p => p.target === `team:${identityTeam.slug}`);\n\n if (teamPermission) {\n // Grant the current identity the same permissions as the team, marking them as inherited.\n permissions.push({\n target: `admin:${identity.id}`,\n level: teamPermission.level,\n inheritedFrom: \"team:\" + identityTeam.slug\n });\n }\n }\n }\n\n return permissions;\n};\n\ninterface LoadedTeams {\n identityId: string;\n teams: Promise<Team[]>;\n}\n\nexport class GetDefaultPermissionsWithTeams implements IGetDefaultPermissions {\n private identityContext: IdentityContext.Interface;\n private listUserTeamsUseCase: ListUserTeamsUseCase.Interface;\n private decoretee: IGetDefaultPermissions;\n /**\n * The identity's teams, loaded once per instance and identity. An instance lives for one\n * `getDefaultPermissions` call or one `listFolderLevelPermissions` call, so nothing is kept\n * between calls or requests.\n */\n private loaded: LoadedTeams | null = null;\n\n constructor(\n identityContext: IdentityContext.Interface,\n listUserTeamsUseCase: ListUserTeamsUseCase.Interface,\n decoretee: IGetDefaultPermissions\n ) {\n this.identityContext = identityContext;\n this.listUserTeamsUseCase = listUserTeamsUseCase;\n this.decoretee = decoretee;\n }\n\n async execute(originalPermissions: FolderPermission[]) {\n /**\n * Retrieves the list of teams the current identity belongs to and checks if any of these teams\n * have permissions for the folder. If a team has permissions, the current identity is granted\n * the same permissions, inheriting them from the team.\n */\n const identity = this.identityContext.getIdentity();\n\n // Get teams for current identity (once per instance and identity).\n if (!this.loaded || this.loaded.identityId !== identity.id) {\n this.loaded = {\n identityId: identity.id,\n teams: this.listUserTeamsUseCase.execute(identity.id).then(result => {\n return result.isOk() ? result.value : [];\n })\n };\n }\n const identityTeams: Team[] = await this.loaded.teams;\n\n const permissions = expandTeamPermissions(identity, identityTeams, originalPermissions);\n\n return await this.decoretee.execute(permissions);\n }\n}\n"],"names":["expandTeamPermissions","identity","identityTeams","originalPermissions","permissions","identityTeam","teamPermission","p","GetDefaultPermissionsWithTeams","identityContext","listUserTeamsUseCase","decoretee","result"],"mappings":"AAUO,MAAMA,wBAAwB,CACjCC,UACAC,eACAC;IAEA,MAAMC,cAAc;WAAID;KAAoB;IAE5C,IAAIF,YAAYC,cAAc,MAAM,EAChC,KAAK,MAAMG,gBAAgBH,cAAe;QAEtC,MAAMI,iBAAiBF,YAAY,IAAI,CAACG,CAAAA,IAAKA,EAAE,MAAM,KAAK,CAAC,KAAK,EAAEF,aAAa,IAAI,EAAE;QAErF,IAAIC,gBAEAF,YAAY,IAAI,CAAC;YACb,QAAQ,CAAC,MAAM,EAAEH,SAAS,EAAE,EAAE;YAC9B,OAAOK,eAAe,KAAK;YAC3B,eAAe,UAAUD,aAAa,IAAI;QAC9C;IAER;IAGJ,OAAOD;AACX;AAOO,MAAMI;IAWT,YACIC,eAA0C,EAC1CC,oBAAoD,EACpDC,SAAiC,CACnC;QAPD,KACO,MAAM,GAAuB;QAOjC,IAAI,CAAC,eAAe,GAAGF;QACvB,IAAI,CAAC,oBAAoB,GAAGC;QAC5B,IAAI,CAAC,SAAS,GAAGC;IACrB;IAEA,MAAM,QAAQR,mBAAuC,EAAE;QAMnD,MAAMF,WAAW,IAAI,CAAC,eAAe,CAAC,WAAW;QAGjD,IAAI,CAAC,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC,UAAU,KAAKA,SAAS,EAAE,EACtD,IAAI,CAAC,MAAM,GAAG;YACV,YAAYA,SAAS,EAAE;YACvB,OAAO,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAACA,SAAS,EAAE,EAAE,IAAI,CAACW,CAAAA,SAChDA,OAAO,IAAI,KAAKA,OAAO,KAAK,GAAG,EAAE;QAEhD;QAEJ,MAAMV,gBAAwB,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK;QAErD,MAAME,cAAcJ,sBAAsBC,UAAUC,eAAeC;QAEnE,OAAO,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO,CAACC;IACxC;AACJ"}
@@ -0,0 +1,28 @@
1
+ import type { FolderLevelPermission } from "../../../flp/flp.types.js";
2
+ export interface ListFolderPermissionsParams {
3
+ where: {
4
+ type: string;
5
+ parentId?: string;
6
+ /** Folders whose path (e.g. `root/a`) starts with this. */
7
+ path_startsWith?: string;
8
+ };
9
+ }
10
+ export interface IFolderPermissionsRepository {
11
+ /**
12
+ * The folder's stored permissions: its own, plus the ones it inherits from its ancestors
13
+ * (marked `inheritedFrom: "parent:<id>"`). Code-defined permissions and the current identity's
14
+ * team and role permissions are not included; those are applied on top by the callers.
15
+ */
16
+ get(folderId: string): Promise<FolderLevelPermission | null>;
17
+ /** The same, for every folder of a type, optionally only the children of one folder. */
18
+ list(params: ListFolderPermissionsParams): Promise<FolderLevelPermission[]>;
19
+ }
20
+ /**
21
+ * Where folder permissions are read from. Every storage provides its own: some keep a catalog with
22
+ * the inherited permissions copied into each folder, others work them out when reading.
23
+ */
24
+ export declare const FolderPermissionsRepository: import("@webiny/di").Abstraction<IFolderPermissionsRepository>;
25
+ export declare namespace FolderPermissionsRepository {
26
+ type Interface = IFolderPermissionsRepository;
27
+ type ListParams = ListFolderPermissionsParams;
28
+ }
@@ -0,0 +1,5 @@
1
+ import { createAbstraction } from "@webiny/feature/api";
2
+ const FolderPermissionsRepository = createAbstraction("Aco/FolderPermissionsRepository");
3
+ export { FolderPermissionsRepository };
4
+
5
+ //# sourceMappingURL=abstractions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/flp/FolderPermissionsRepository/abstractions.js","sources":["../../../../src/features/flp/FolderPermissionsRepository/abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { FolderLevelPermission } from \"~/flp/flp.types.js\";\n\nexport interface ListFolderPermissionsParams {\n where: {\n type: string;\n parentId?: string;\n /** Folders whose path (e.g. `root/a`) starts with this. */\n path_startsWith?: string;\n };\n}\n\nexport interface IFolderPermissionsRepository {\n /**\n * The folder's stored permissions: its own, plus the ones it inherits from its ancestors\n * (marked `inheritedFrom: \"parent:<id>\"`). Code-defined permissions and the current identity's\n * team and role permissions are not included; those are applied on top by the callers.\n */\n get(folderId: string): Promise<FolderLevelPermission | null>;\n /** The same, for every folder of a type, optionally only the children of one folder. */\n list(params: ListFolderPermissionsParams): Promise<FolderLevelPermission[]>;\n}\n\n/**\n * Where folder permissions are read from. Every storage provides its own: some keep a catalog with\n * the inherited permissions copied into each folder, others work them out when reading.\n */\nexport const FolderPermissionsRepository = createAbstraction<IFolderPermissionsRepository>(\n \"Aco/FolderPermissionsRepository\"\n);\n\nexport namespace FolderPermissionsRepository {\n export type Interface = IFolderPermissionsRepository;\n export type ListParams = ListFolderPermissionsParams;\n}\n"],"names":["FolderPermissionsRepository","createAbstraction"],"mappings":";AA2BO,MAAMA,8BAA8BC,kBACvC"}
@@ -0,0 +1 @@
1
+ export * from "./abstractions.js";
@@ -0,0 +1 @@
1
+ export * from "./abstractions.js";
@@ -1,7 +1,12 @@
1
- import type { GetFlpUseCase as UseCaseAbstraction } from "./abstractions.js";
2
- import type { AcoFolderLevelPermissionsCrud, FolderLevelPermission } from "../../../flp/flp.types.js";
3
- export declare class GetFlpUseCase implements UseCaseAbstraction.Interface {
4
- private readonly get;
5
- constructor(get: AcoFolderLevelPermissionsCrud["get"]);
1
+ import { GetFlpUseCase as UseCaseAbstraction } from "./abstractions.js";
2
+ import { FolderPermissionsRepository } from "../../../features/flp/FolderPermissionsRepository/index.js";
3
+ import type { FolderLevelPermission } from "../../../flp/flp.types.js";
4
+ declare class GetFlpUseCaseImpl implements UseCaseAbstraction.Interface {
5
+ private repository;
6
+ constructor(repository: FolderPermissionsRepository.Interface);
6
7
  execute(id: string): Promise<FolderLevelPermission | null>;
7
8
  }
9
+ export declare const GetFlpUseCase: typeof GetFlpUseCaseImpl & {
10
+ __abstraction: import("@webiny/di").Abstraction<import("./abstractions.js").IGetFolderPermission>;
11
+ };
12
+ export {};
@@ -1,11 +1,19 @@
1
- class GetFlpUseCase {
2
- constructor(get){
3
- this.get = get;
1
+ import { GetFlpUseCase } from "./abstractions.js";
2
+ import { FolderPermissionsRepository } from "../FolderPermissionsRepository/index.js";
3
+ class GetFlpUseCaseImpl {
4
+ constructor(repository){
5
+ this.repository = repository;
4
6
  }
5
7
  async execute(id) {
6
- return this.get(id);
8
+ return this.repository.get(id);
7
9
  }
8
10
  }
9
- export { GetFlpUseCase };
11
+ const GetFlpUseCase_GetFlpUseCase = GetFlpUseCase.createImplementation({
12
+ implementation: GetFlpUseCaseImpl,
13
+ dependencies: [
14
+ FolderPermissionsRepository
15
+ ]
16
+ });
17
+ export { GetFlpUseCase_GetFlpUseCase as GetFlpUseCase };
10
18
 
11
19
  //# sourceMappingURL=GetFlpUseCase.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"features/flp/GetFlp/GetFlpUseCase.js","sources":["../../../../src/features/flp/GetFlp/GetFlpUseCase.ts"],"sourcesContent":["import type { GetFlpUseCase as UseCaseAbstraction } from \"./abstractions.js\";\nimport type { AcoFolderLevelPermissionsCrud, FolderLevelPermission } from \"~/flp/flp.types.js\";\n\nexport class GetFlpUseCase implements UseCaseAbstraction.Interface {\n private readonly get: AcoFolderLevelPermissionsCrud[\"get\"];\n\n constructor(get: AcoFolderLevelPermissionsCrud[\"get\"]) {\n this.get = get;\n }\n\n async execute(id: string): Promise<FolderLevelPermission | null> {\n return this.get(id);\n }\n}\n"],"names":["GetFlpUseCase","get","id"],"mappings":"AAGO,MAAMA;IAGT,YAAYC,GAAyC,CAAE;QACnD,IAAI,CAAC,GAAG,GAAGA;IACf;IAEA,MAAM,QAAQC,EAAU,EAAyC;QAC7D,OAAO,IAAI,CAAC,GAAG,CAACA;IACpB;AACJ"}
1
+ {"version":3,"file":"features/flp/GetFlp/GetFlpUseCase.js","sources":["../../../../src/features/flp/GetFlp/GetFlpUseCase.ts"],"sourcesContent":["import { GetFlpUseCase as UseCaseAbstraction } from \"./abstractions.js\";\nimport { FolderPermissionsRepository } from \"~/features/flp/FolderPermissionsRepository/index.js\";\nimport type { FolderLevelPermission } from \"~/flp/flp.types.js\";\n\nclass GetFlpUseCaseImpl implements UseCaseAbstraction.Interface {\n constructor(private repository: FolderPermissionsRepository.Interface) {}\n\n async execute(id: string): Promise<FolderLevelPermission | null> {\n return this.repository.get(id);\n }\n}\n\nexport const GetFlpUseCase = UseCaseAbstraction.createImplementation({\n implementation: GetFlpUseCaseImpl,\n dependencies: [FolderPermissionsRepository]\n});\n"],"names":["GetFlpUseCaseImpl","repository","id","GetFlpUseCase","UseCaseAbstraction","FolderPermissionsRepository"],"mappings":";;AAIA,MAAMA;IACF,YAAoBC,UAAiD,CAAE;aAAnDA,UAAU,GAAVA;IAAoD;IAExE,MAAM,QAAQC,EAAU,EAAyC;QAC7D,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAACA;IAC/B;AACJ;AAEO,MAAMC,8BAAgBC,cAAAA,oBAAuC,CAAC;IACjE,gBAAgBJ;IAChB,cAAc;QAACK;KAA4B;AAC/C"}
@@ -0,0 +1,13 @@
1
+ import { GetFlpUseCase } from "../abstractions.js";
2
+ import { CodeFlpsProvider } from "../../../../features/flp/shared/index.js";
3
+ import type { FolderLevelPermission } from "../../../../flp/flp.types.js";
4
+ declare class GetFlpWithCodeFlpsImpl implements GetFlpUseCase.Interface {
5
+ private codeFlpsProvider;
6
+ private decoratee;
7
+ constructor(codeFlpsProvider: CodeFlpsProvider.Interface, decoratee: GetFlpUseCase.Interface);
8
+ execute(id: string): Promise<FolderLevelPermission | null>;
9
+ }
10
+ export declare const GetFlpWithCodeFlps: typeof GetFlpWithCodeFlpsImpl & {
11
+ __abstraction: import("@webiny/di").Abstraction<import("../abstractions.js").IGetFolderPermission>;
12
+ };
13
+ export {};
@@ -0,0 +1,26 @@
1
+ import { GetFlpUseCase } from "../abstractions.js";
2
+ import { CodeFlpMerger, CodeFlpsProvider } from "../../shared/index.js";
3
+ class GetFlpWithCodeFlpsImpl {
4
+ constructor(codeFlpsProvider, decoratee){
5
+ this.codeFlpsProvider = codeFlpsProvider;
6
+ this.decoratee = decoratee;
7
+ }
8
+ async execute(id) {
9
+ const flp = await this.decoratee.execute(id);
10
+ if (!flp) return null;
11
+ const codePermissions = await this.codeFlpsProvider.getPermissions({
12
+ type: flp.type,
13
+ path: flp.path
14
+ });
15
+ return CodeFlpMerger.merge(flp, codePermissions);
16
+ }
17
+ }
18
+ const GetFlpWithCodeFlps = GetFlpUseCase.createDecorator({
19
+ decorator: GetFlpWithCodeFlpsImpl,
20
+ dependencies: [
21
+ CodeFlpsProvider
22
+ ]
23
+ });
24
+ export { GetFlpWithCodeFlps };
25
+
26
+ //# sourceMappingURL=GetFlpWithCodeFlps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/flp/GetFlp/decorators/GetFlpWithCodeFlps.js","sources":["../../../../../src/features/flp/GetFlp/decorators/GetFlpWithCodeFlps.ts"],"sourcesContent":["import { GetFlpUseCase } from \"../abstractions.js\";\nimport { CodeFlpMerger, CodeFlpsProvider } from \"~/features/flp/shared/index.js\";\nimport type { FolderLevelPermission } from \"~/flp/flp.types.js\";\n\nclass GetFlpWithCodeFlpsImpl implements GetFlpUseCase.Interface {\n constructor(\n private codeFlpsProvider: CodeFlpsProvider.Interface,\n private decoratee: GetFlpUseCase.Interface\n ) {}\n\n async execute(id: string): Promise<FolderLevelPermission | null> {\n const flp = await this.decoratee.execute(id);\n\n if (!flp) {\n return null;\n }\n\n const codePermissions = await this.codeFlpsProvider.getPermissions({\n type: flp.type,\n path: flp.path\n });\n\n return CodeFlpMerger.merge(flp, codePermissions);\n }\n}\n\nexport const GetFlpWithCodeFlps = GetFlpUseCase.createDecorator({\n decorator: GetFlpWithCodeFlpsImpl,\n dependencies: [CodeFlpsProvider]\n});\n"],"names":["GetFlpWithCodeFlpsImpl","codeFlpsProvider","decoratee","id","flp","codePermissions","CodeFlpMerger","GetFlpWithCodeFlps","GetFlpUseCase","CodeFlpsProvider"],"mappings":";;AAIA,MAAMA;IACF,YACYC,gBAA4C,EAC5CC,SAAkC,CAC5C;aAFUD,gBAAgB,GAAhBA;aACAC,SAAS,GAATA;IACT;IAEH,MAAM,QAAQC,EAAU,EAAyC;QAC7D,MAAMC,MAAM,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO,CAACD;QAEzC,IAAI,CAACC,KACD,OAAO;QAGX,MAAMC,kBAAkB,MAAM,IAAI,CAAC,gBAAgB,CAAC,cAAc,CAAC;YAC/D,MAAMD,IAAI,IAAI;YACd,MAAMA,IAAI,IAAI;QAClB;QAEA,OAAOE,cAAc,KAAK,CAACF,KAAKC;IACpC;AACJ;AAEO,MAAME,qBAAqBC,cAAc,eAAe,CAAC;IAC5D,WAAWR;IACX,cAAc;QAACS;KAAiB;AACpC"}
@@ -1,11 +1,9 @@
1
1
  import { createFeature } from "@webiny/feature/api";
2
2
  import { GetFlpUseCase } from "./GetFlpUseCase.js";
3
- import { GetFlpUseCase as external_abstractions_js_GetFlpUseCase } from "./abstractions.js";
4
- import { AcoFlpCrud } from "../../folder/shared/abstractions.js";
5
3
  const GetFlpFeature = createFeature({
6
4
  name: "GetFlpFeature",
7
5
  register (container) {
8
- container.registerFactory(external_abstractions_js_GetFlpUseCase, ()=>new GetFlpUseCase(container.resolve(AcoFlpCrud).get));
6
+ container.register(GetFlpUseCase);
9
7
  }
10
8
  });
11
9
  export { GetFlpFeature };
@@ -1 +1 @@
1
- {"version":3,"file":"features/flp/GetFlp/feature.js","sources":["../../../../src/features/flp/GetFlp/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { GetFlpUseCase } from \"./GetFlpUseCase.js\";\nimport { GetFlpUseCase as UseCaseAbstraction } from \"./abstractions.js\";\nimport { AcoFlpCrud } from \"~/features/folder/shared/abstractions.js\";\n\nexport const GetFlpFeature = createFeature({\n name: \"GetFlpFeature\",\n register(container) {\n container.registerFactory(UseCaseAbstraction, () => {\n return new GetFlpUseCase(container.resolve(AcoFlpCrud).get);\n });\n }\n});\n"],"names":["GetFlpFeature","createFeature","container","UseCaseAbstraction","GetFlpUseCase","AcoFlpCrud"],"mappings":";;;;AAKO,MAAMA,gBAAgBC,cAAc;IACvC,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,eAAe,CAACC,wCAAoB,IACnC,IAAIC,cAAcF,UAAU,OAAO,CAACG,YAAY,GAAG;IAElE;AACJ"}
1
+ {"version":3,"file":"features/flp/GetFlp/feature.js","sources":["../../../../src/features/flp/GetFlp/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { GetFlpUseCase } from \"./GetFlpUseCase.js\";\n\nexport const GetFlpFeature = createFeature({\n name: \"GetFlpFeature\",\n register(container) {\n container.register(GetFlpUseCase);\n }\n});\n"],"names":["GetFlpFeature","createFeature","container","GetFlpUseCase"],"mappings":";;AAGO,MAAMA,gBAAgBC,cAAc;IACvC,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,QAAQ,CAACC;IACvB;AACJ"}
@@ -1,7 +1,12 @@
1
- import type { ListFlpsUseCase as UseCaseAbstraction } from "./abstractions.js";
2
- import type { AcoFolderLevelPermissionsCrud, ListFlpsParams } from "../../../flp/flp.types.js";
3
- export declare class ListFlpsUseCase implements UseCaseAbstraction.Interface {
4
- private readonly list;
5
- constructor(list: AcoFolderLevelPermissionsCrud["list"]);
6
- execute(params: ListFlpsParams): Promise<import("~/flp/flp.types.js").FolderLevelPermission[]>;
1
+ import { ListFlpsUseCase as UseCaseAbstraction } from "./abstractions.js";
2
+ import { FolderPermissionsRepository } from "../../../features/flp/FolderPermissionsRepository/index.js";
3
+ import type { FolderLevelPermission } from "../../../flp/flp.types.js";
4
+ declare class ListFlpsUseCaseImpl implements UseCaseAbstraction.Interface {
5
+ private repository;
6
+ constructor(repository: FolderPermissionsRepository.Interface);
7
+ execute(params: UseCaseAbstraction.Params): Promise<FolderLevelPermission[]>;
7
8
  }
9
+ export declare const ListFlpsUseCase: typeof ListFlpsUseCaseImpl & {
10
+ __abstraction: import("@webiny/di").Abstraction<import("./abstractions.js").IListFlps>;
11
+ };
12
+ export {};
@@ -1,11 +1,19 @@
1
- class ListFlpsUseCase {
2
- constructor(list){
3
- this.list = list;
1
+ import { ListFlpsUseCase } from "./abstractions.js";
2
+ import { FolderPermissionsRepository } from "../FolderPermissionsRepository/index.js";
3
+ class ListFlpsUseCaseImpl {
4
+ constructor(repository){
5
+ this.repository = repository;
4
6
  }
5
7
  async execute(params) {
6
- return this.list(params);
8
+ return this.repository.list(params);
7
9
  }
8
10
  }
9
- export { ListFlpsUseCase };
11
+ const ListFlpsUseCase_ListFlpsUseCase = ListFlpsUseCase.createImplementation({
12
+ implementation: ListFlpsUseCaseImpl,
13
+ dependencies: [
14
+ FolderPermissionsRepository
15
+ ]
16
+ });
17
+ export { ListFlpsUseCase_ListFlpsUseCase as ListFlpsUseCase };
10
18
 
11
19
  //# sourceMappingURL=ListFlpsUseCase.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"features/flp/ListFlps/ListFlpsUseCase.js","sources":["../../../../src/features/flp/ListFlps/ListFlpsUseCase.ts"],"sourcesContent":["import type { ListFlpsUseCase as UseCaseAbstraction } from \"./abstractions.js\";\nimport type { AcoFolderLevelPermissionsCrud, ListFlpsParams } from \"~/flp/flp.types.js\";\n\nexport class ListFlpsUseCase implements UseCaseAbstraction.Interface {\n private readonly list: AcoFolderLevelPermissionsCrud[\"list\"];\n\n constructor(list: AcoFolderLevelPermissionsCrud[\"list\"]) {\n this.list = list;\n }\n\n async execute(params: ListFlpsParams) {\n return this.list(params);\n }\n}\n"],"names":["ListFlpsUseCase","list","params"],"mappings":"AAGO,MAAMA;IAGT,YAAYC,IAA2C,CAAE;QACrD,IAAI,CAAC,IAAI,GAAGA;IAChB;IAEA,MAAM,QAAQC,MAAsB,EAAE;QAClC,OAAO,IAAI,CAAC,IAAI,CAACA;IACrB;AACJ"}
1
+ {"version":3,"file":"features/flp/ListFlps/ListFlpsUseCase.js","sources":["../../../../src/features/flp/ListFlps/ListFlpsUseCase.ts"],"sourcesContent":["import { ListFlpsUseCase as UseCaseAbstraction } from \"./abstractions.js\";\nimport { FolderPermissionsRepository } from \"~/features/flp/FolderPermissionsRepository/index.js\";\nimport type { FolderLevelPermission } from \"~/flp/flp.types.js\";\n\nclass ListFlpsUseCaseImpl implements UseCaseAbstraction.Interface {\n constructor(private repository: FolderPermissionsRepository.Interface) {}\n\n async execute(params: UseCaseAbstraction.Params): Promise<FolderLevelPermission[]> {\n return this.repository.list(params);\n }\n}\n\nexport const ListFlpsUseCase = UseCaseAbstraction.createImplementation({\n implementation: ListFlpsUseCaseImpl,\n dependencies: [FolderPermissionsRepository]\n});\n"],"names":["ListFlpsUseCaseImpl","repository","params","ListFlpsUseCase","UseCaseAbstraction","FolderPermissionsRepository"],"mappings":";;AAIA,MAAMA;IACF,YAAoBC,UAAiD,CAAE;aAAnDA,UAAU,GAAVA;IAAoD;IAExE,MAAM,QAAQC,MAAiC,EAAoC;QAC/E,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,CAACA;IAChC;AACJ;AAEO,MAAMC,kCAAkBC,gBAAAA,oBAAuC,CAAC;IACnE,gBAAgBJ;IAChB,cAAc;QAACK;KAA4B;AAC/C"}
@@ -1,17 +1,11 @@
1
1
  import type { FolderLevelPermission } from "../../../types.js";
2
- interface ListFlpsParams {
3
- where: {
4
- path_startsWith?: string;
5
- parentId?: string;
6
- type: string;
7
- };
8
- }
2
+ import type { ListFolderPermissionsParams } from "../../../features/flp/FolderPermissionsRepository/abstractions.js";
9
3
  export interface IListFlps {
10
- execute: (params: ListFlpsParams) => Promise<FolderLevelPermission[]>;
4
+ execute: (params: ListFolderPermissionsParams) => Promise<FolderLevelPermission[]>;
11
5
  }
12
6
  /** List folder-level permissions. */
13
7
  export declare const ListFlpsUseCase: import("@webiny/di").Abstraction<IListFlps>;
14
8
  export declare namespace ListFlpsUseCase {
15
9
  type Interface = IListFlps;
10
+ type Params = ListFolderPermissionsParams;
16
11
  }
17
- export {};
@@ -1 +1 @@
1
- {"version":3,"file":"features/flp/ListFlps/abstractions.js","sources":["../../../../src/features/flp/ListFlps/abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { FolderLevelPermission } from \"~/types.js\";\n\ninterface ListFlpsParams {\n where: {\n path_startsWith?: string;\n parentId?: string;\n type: string;\n };\n}\n\nexport interface IListFlps {\n execute: (params: ListFlpsParams) => Promise<FolderLevelPermission[]>;\n}\n\n/** List folder-level permissions. */\nexport const ListFlpsUseCase = createAbstraction<IListFlps>(\"ListFlpsUseCase\");\n\nexport namespace ListFlpsUseCase {\n export type Interface = IListFlps;\n}\n"],"names":["ListFlpsUseCase","createAbstraction"],"mappings":";AAgBO,MAAMA,kBAAkBC,kBAA6B"}
1
+ {"version":3,"file":"features/flp/ListFlps/abstractions.js","sources":["../../../../src/features/flp/ListFlps/abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { FolderLevelPermission } from \"~/types.js\";\nimport type { ListFolderPermissionsParams } from \"~/features/flp/FolderPermissionsRepository/abstractions.js\";\n\nexport interface IListFlps {\n execute: (params: ListFolderPermissionsParams) => Promise<FolderLevelPermission[]>;\n}\n\n/** List folder-level permissions. */\nexport const ListFlpsUseCase = createAbstraction<IListFlps>(\"ListFlpsUseCase\");\n\nexport namespace ListFlpsUseCase {\n export type Interface = IListFlps;\n export type Params = ListFolderPermissionsParams;\n}\n"],"names":["ListFlpsUseCase","createAbstraction"],"mappings":";AASO,MAAMA,kBAAkBC,kBAA6B"}
@@ -0,0 +1,13 @@
1
+ import { ListFlpsUseCase } from "../abstractions.js";
2
+ import { CodeFlpsProvider } from "../../../../features/flp/shared/index.js";
3
+ import type { FolderLevelPermission } from "../../../../flp/flp.types.js";
4
+ declare class ListFlpsWithCodeFlpsImpl implements ListFlpsUseCase.Interface {
5
+ private codeFlpsProvider;
6
+ private decoratee;
7
+ constructor(codeFlpsProvider: CodeFlpsProvider.Interface, decoratee: ListFlpsUseCase.Interface);
8
+ execute(params: ListFlpsUseCase.Params): Promise<FolderLevelPermission[]>;
9
+ }
10
+ export declare const ListFlpsWithCodeFlps: typeof ListFlpsWithCodeFlpsImpl & {
11
+ __abstraction: import("@webiny/di").Abstraction<import("../abstractions.js").IListFlps>;
12
+ };
13
+ export {};
@@ -0,0 +1,27 @@
1
+ import { ListFlpsUseCase } from "../abstractions.js";
2
+ import { CodeFlpMerger, CodeFlpsProvider } from "../../shared/index.js";
3
+ class ListFlpsWithCodeFlpsImpl {
4
+ constructor(codeFlpsProvider, decoratee){
5
+ this.codeFlpsProvider = codeFlpsProvider;
6
+ this.decoratee = decoratee;
7
+ }
8
+ async execute(params) {
9
+ const flps = await this.decoratee.execute(params);
10
+ return Promise.all(flps.map(async (flp)=>{
11
+ const codePermissions = await this.codeFlpsProvider.getPermissions({
12
+ type: flp.type,
13
+ path: flp.path
14
+ });
15
+ return CodeFlpMerger.merge(flp, codePermissions);
16
+ }));
17
+ }
18
+ }
19
+ const ListFlpsWithCodeFlps = ListFlpsUseCase.createDecorator({
20
+ decorator: ListFlpsWithCodeFlpsImpl,
21
+ dependencies: [
22
+ CodeFlpsProvider
23
+ ]
24
+ });
25
+ export { ListFlpsWithCodeFlps };
26
+
27
+ //# sourceMappingURL=ListFlpsWithCodeFlps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/flp/ListFlps/decorators/ListFlpsWithCodeFlps.js","sources":["../../../../../src/features/flp/ListFlps/decorators/ListFlpsWithCodeFlps.ts"],"sourcesContent":["import { ListFlpsUseCase } from \"../abstractions.js\";\nimport { CodeFlpMerger, CodeFlpsProvider } from \"~/features/flp/shared/index.js\";\nimport type { FolderLevelPermission } from \"~/flp/flp.types.js\";\n\nclass ListFlpsWithCodeFlpsImpl implements ListFlpsUseCase.Interface {\n constructor(\n private codeFlpsProvider: CodeFlpsProvider.Interface,\n private decoratee: ListFlpsUseCase.Interface\n ) {}\n\n async execute(params: ListFlpsUseCase.Params): Promise<FolderLevelPermission[]> {\n const flps = await this.decoratee.execute(params);\n\n return Promise.all(\n flps.map(async flp => {\n const codePermissions = await this.codeFlpsProvider.getPermissions({\n type: flp.type,\n path: flp.path\n });\n\n return CodeFlpMerger.merge(flp, codePermissions);\n })\n );\n }\n}\n\nexport const ListFlpsWithCodeFlps = ListFlpsUseCase.createDecorator({\n decorator: ListFlpsWithCodeFlpsImpl,\n dependencies: [CodeFlpsProvider]\n});\n"],"names":["ListFlpsWithCodeFlpsImpl","codeFlpsProvider","decoratee","params","flps","Promise","flp","codePermissions","CodeFlpMerger","ListFlpsWithCodeFlps","ListFlpsUseCase","CodeFlpsProvider"],"mappings":";;AAIA,MAAMA;IACF,YACYC,gBAA4C,EAC5CC,SAAoC,CAC9C;aAFUD,gBAAgB,GAAhBA;aACAC,SAAS,GAATA;IACT;IAEH,MAAM,QAAQC,MAA8B,EAAoC;QAC5E,MAAMC,OAAO,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO,CAACD;QAE1C,OAAOE,QAAQ,GAAG,CACdD,KAAK,GAAG,CAAC,OAAME;YACX,MAAMC,kBAAkB,MAAM,IAAI,CAAC,gBAAgB,CAAC,cAAc,CAAC;gBAC/D,MAAMD,IAAI,IAAI;gBACd,MAAMA,IAAI,IAAI;YAClB;YAEA,OAAOE,cAAc,KAAK,CAACF,KAAKC;QACpC;IAER;AACJ;AAEO,MAAME,uBAAuBC,gBAAgB,eAAe,CAAC;IAChE,WAAWV;IACX,cAAc;QAACW;KAAiB;AACpC"}
@@ -1,11 +1,9 @@
1
1
  import { createFeature } from "@webiny/feature/api";
2
2
  import { ListFlpsUseCase } from "./ListFlpsUseCase.js";
3
- import { ListFlpsUseCase as external_abstractions_js_ListFlpsUseCase } from "./abstractions.js";
4
- import { AcoFlpCrud } from "../../folder/shared/abstractions.js";
5
3
  const ListFlpsFeature = createFeature({
6
4
  name: "ListFlpsFeature",
7
5
  register (container) {
8
- container.registerFactory(external_abstractions_js_ListFlpsUseCase, ()=>new ListFlpsUseCase(container.resolve(AcoFlpCrud).list));
6
+ container.register(ListFlpsUseCase);
9
7
  }
10
8
  });
11
9
  export { ListFlpsFeature };
@@ -1 +1 @@
1
- {"version":3,"file":"features/flp/ListFlps/feature.js","sources":["../../../../src/features/flp/ListFlps/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { ListFlpsUseCase } from \"./ListFlpsUseCase.js\";\nimport { ListFlpsUseCase as UseCaseAbstraction } from \"./abstractions.js\";\nimport { AcoFlpCrud } from \"~/features/folder/shared/abstractions.js\";\n\nexport const ListFlpsFeature = createFeature({\n name: \"ListFlpsFeature\",\n register(container) {\n container.registerFactory(UseCaseAbstraction, () => {\n return new ListFlpsUseCase(container.resolve(AcoFlpCrud).list);\n });\n }\n});\n"],"names":["ListFlpsFeature","createFeature","container","UseCaseAbstraction","ListFlpsUseCase","AcoFlpCrud"],"mappings":";;;;AAKO,MAAMA,kBAAkBC,cAAc;IACzC,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,eAAe,CAACC,0CAAoB,IACnC,IAAIC,gBAAgBF,UAAU,OAAO,CAACG,YAAY,IAAI;IAErE;AACJ"}
1
+ {"version":3,"file":"features/flp/ListFlps/feature.js","sources":["../../../../src/features/flp/ListFlps/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { ListFlpsUseCase } from \"./ListFlpsUseCase.js\";\n\nexport const ListFlpsFeature = createFeature({\n name: \"ListFlpsFeature\",\n register(container) {\n container.register(ListFlpsUseCase);\n }\n});\n"],"names":["ListFlpsFeature","createFeature","container","ListFlpsUseCase"],"mappings":";;AAGO,MAAMA,kBAAkBC,cAAc;IACzC,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,QAAQ,CAACC;IACvB;AACJ"}
@@ -0,0 +1,14 @@
1
+ import { GetLatestRevisionByEntryIdUseCase } from "@webiny/api-headless-cms/features/contentEntry/GetLatestRevisionByEntryId/index.js";
2
+ import { IdentityContext } from "@webiny/api-core/features/security/IdentityContext/abstractions.js";
3
+ import { GetUserEntryAccessUseCase as UseCaseAbstraction, GetUserFolderAccessUseCase } from "./abstractions.js";
4
+ declare class GetUserEntryAccessUseCaseImpl implements UseCaseAbstraction.Interface {
5
+ private identityContext;
6
+ private getLatestRevision;
7
+ private getUserFolderAccess;
8
+ constructor(identityContext: IdentityContext.Interface, getLatestRevision: GetLatestRevisionByEntryIdUseCase.Interface, getUserFolderAccess: GetUserFolderAccessUseCase.Interface);
9
+ execute({ userId, model, entryId }: UseCaseAbstraction.Params): UseCaseAbstraction.Return;
10
+ }
11
+ export declare const GetUserEntryAccessUseCase: typeof GetUserEntryAccessUseCaseImpl & {
12
+ __abstraction: import("@webiny/di").Abstraction<import("./abstractions.js").IGetUserEntryAccessUseCase>;
13
+ };
14
+ export {};
@@ -0,0 +1,36 @@
1
+ import { Result } from "@webiny/feature/api";
2
+ import { GetLatestRevisionByEntryIdUseCase } from "@webiny/api-headless-cms/features/contentEntry/GetLatestRevisionByEntryId/index.js";
3
+ import { IdentityContext } from "@webiny/api-core/features/security/IdentityContext/abstractions.js";
4
+ import { NotAuthorizedError } from "@webiny/api-core/features/security/shared/errors.js";
5
+ import { GetUserEntryAccessUseCase, GetUserFolderAccessUseCase } from "./abstractions.js";
6
+ import { mayAskAboutUser } from "./mayAskAboutUser.js";
7
+ class GetUserEntryAccessUseCaseImpl {
8
+ constructor(identityContext, getLatestRevision, getUserFolderAccess){
9
+ this.identityContext = identityContext;
10
+ this.getLatestRevision = getLatestRevision;
11
+ this.getUserFolderAccess = getUserFolderAccess;
12
+ }
13
+ async execute({ userId, model, entryId }) {
14
+ if (!await mayAskAboutUser(this.identityContext, userId)) return Result.fail(new NotAuthorizedError());
15
+ const result = await this.identityContext.withoutAuthorization(()=>this.getLatestRevision.execute(model, {
16
+ id: entryId
17
+ }));
18
+ if (result.isFail()) return Result.fail(result.error);
19
+ const folderId = result.value.location?.folderId ?? null;
20
+ return this.getUserFolderAccess.execute({
21
+ userId,
22
+ folderId
23
+ });
24
+ }
25
+ }
26
+ const GetUserEntryAccessUseCase_GetUserEntryAccessUseCase = GetUserEntryAccessUseCase.createImplementation({
27
+ implementation: GetUserEntryAccessUseCaseImpl,
28
+ dependencies: [
29
+ IdentityContext,
30
+ GetLatestRevisionByEntryIdUseCase,
31
+ GetUserFolderAccessUseCase
32
+ ]
33
+ });
34
+ export { GetUserEntryAccessUseCase_GetUserEntryAccessUseCase as GetUserEntryAccessUseCase };
35
+
36
+ //# sourceMappingURL=GetUserEntryAccessUseCase.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/flp/ListFolderAccess/GetUserEntryAccessUseCase.js","sources":["../../../../src/features/flp/ListFolderAccess/GetUserEntryAccessUseCase.ts"],"sourcesContent":["import { Result } from \"@webiny/feature/api\";\nimport { GetLatestRevisionByEntryIdUseCase } from \"@webiny/api-headless-cms/features/contentEntry/GetLatestRevisionByEntryId/index.js\";\nimport { IdentityContext } from \"@webiny/api-core/features/security/IdentityContext/abstractions.js\";\nimport { NotAuthorizedError } from \"@webiny/api-core/features/security/shared/errors.js\";\nimport {\n GetUserEntryAccessUseCase as UseCaseAbstraction,\n GetUserFolderAccessUseCase\n} from \"./abstractions.js\";\nimport { mayAskAboutUser } from \"./mayAskAboutUser.js\";\n\nclass GetUserEntryAccessUseCaseImpl implements UseCaseAbstraction.Interface {\n constructor(\n private identityContext: IdentityContext.Interface,\n private getLatestRevision: GetLatestRevisionByEntryIdUseCase.Interface,\n private getUserFolderAccess: GetUserFolderAccessUseCase.Interface\n ) {}\n\n async execute({\n userId,\n model,\n entryId\n }: UseCaseAbstraction.Params): UseCaseAbstraction.Return {\n // Checked before reading the entry, so a refused caller learns nothing about it.\n if (!(await mayAskAboutUser(this.identityContext, userId))) {\n return Result.fail(new NotAuthorizedError());\n }\n // The entry is read whoever asks: the answer is about the user, not the caller.\n const result = await this.identityContext.withoutAuthorization(() =>\n this.getLatestRevision.execute(model, { id: entryId })\n );\n if (result.isFail()) {\n return Result.fail(result.error);\n }\n const folderId = result.value.location?.folderId ?? null;\n return this.getUserFolderAccess.execute({ userId, folderId });\n }\n}\n\nexport const GetUserEntryAccessUseCase = UseCaseAbstraction.createImplementation({\n implementation: GetUserEntryAccessUseCaseImpl,\n dependencies: [IdentityContext, GetLatestRevisionByEntryIdUseCase, GetUserFolderAccessUseCase]\n});\n"],"names":["GetUserEntryAccessUseCaseImpl","identityContext","getLatestRevision","getUserFolderAccess","userId","model","entryId","mayAskAboutUser","Result","NotAuthorizedError","result","folderId","GetUserEntryAccessUseCase","UseCaseAbstraction","IdentityContext","GetLatestRevisionByEntryIdUseCase","GetUserFolderAccessUseCase"],"mappings":";;;;;;AAUA,MAAMA;IACF,YACYC,eAA0C,EAC1CC,iBAA8D,EAC9DC,mBAAyD,CACnE;aAHUF,eAAe,GAAfA;aACAC,iBAAiB,GAAjBA;aACAC,mBAAmB,GAAnBA;IACT;IAEH,MAAM,QAAQ,EACVC,MAAM,EACNC,KAAK,EACLC,OAAO,EACiB,EAA6B;QAErD,IAAI,CAAE,MAAMC,gBAAgB,IAAI,CAAC,eAAe,EAAEH,SAC9C,OAAOI,OAAO,IAAI,CAAC,IAAIC;QAG3B,MAAMC,SAAS,MAAM,IAAI,CAAC,eAAe,CAAC,oBAAoB,CAAC,IAC3D,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAACL,OAAO;gBAAE,IAAIC;YAAQ;QAExD,IAAII,OAAO,MAAM,IACb,OAAOF,OAAO,IAAI,CAACE,OAAO,KAAK;QAEnC,MAAMC,WAAWD,OAAO,KAAK,CAAC,QAAQ,EAAE,YAAY;QACpD,OAAO,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC;YAAEN;YAAQO;QAAS;IAC/D;AACJ;AAEO,MAAMC,sDAA4BC,0BAAAA,oBAAuC,CAAC;IAC7E,gBAAgBb;IAChB,cAAc;QAACc;QAAiBC;QAAmCC;KAA2B;AAClG"}
@@ -0,0 +1,25 @@
1
+ import { FeatureFlags } from "@webiny/api-core/features/featureFlags/abstractions.js";
2
+ import { IdentityContext } from "@webiny/api-core/features/security/IdentityContext/abstractions.js";
3
+ import { GetUserUseCase } from "@webiny/api-core/features/users/GetUser/index.js";
4
+ import { ListTeamsUseCase } from "@webiny/api-core/features/security/teams/ListTeams/index.js";
5
+ import { ListRolesUseCase } from "@webiny/api-core/features/security/roles/ListRoles/index.js";
6
+ import { GetUserFolderAccessUseCase as UseCaseAbstraction } from "./abstractions.js";
7
+ import { GetFlpUseCase } from "../../../features/flp/GetFlp/abstractions.js";
8
+ /**
9
+ * One folder's permissions (`GetFlpUseCase`, inherited and code-defined ones included) checked with
10
+ * one user's level (see `getUserFolderLevel`), as `ListFolderAccessUseCase` does for every user.
11
+ */
12
+ declare class GetUserFolderAccessUseCaseImpl implements UseCaseAbstraction.Interface {
13
+ private featureFlags;
14
+ private identityContext;
15
+ private getFlp;
16
+ private getUser;
17
+ private listTeams;
18
+ private listRoles;
19
+ constructor(featureFlags: FeatureFlags.Interface, identityContext: IdentityContext.Interface, getFlp: GetFlpUseCase.Interface, getUser: GetUserUseCase.Interface, listTeams: ListTeamsUseCase.Interface, listRoles: ListRolesUseCase.Interface);
20
+ execute({ userId, folderId }: UseCaseAbstraction.Params): UseCaseAbstraction.Return;
21
+ }
22
+ export declare const GetUserFolderAccessUseCase: typeof GetUserFolderAccessUseCaseImpl & {
23
+ __abstraction: import("@webiny/di").Abstraction<import("./abstractions.js").IGetUserFolderAccessUseCase>;
24
+ };
25
+ export {};