@webiny/api-aco 6.6.0-alpha.1 → 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.
- package/AcoFeature.js +14 -36
- package/AcoFeature.js.map +1 -1
- package/AcoFolderSchemaFactory.d.ts +2 -0
- package/AcoFolderSchemaFactory.js +25 -7
- package/AcoFolderSchemaFactory.js.map +1 -1
- package/domain/folder/folder.model.js +2 -1
- package/domain/folder/folder.model.js.map +1 -1
- package/exports/api/aco/flp.d.ts +3 -3
- package/exports/api/aco/flp.js +2 -3
- package/features/ai/CreateFolderTool.d.ts +11 -6
- package/features/ai/CreateFolderTool.js +20 -11
- package/features/ai/CreateFolderTool.js.map +1 -1
- package/features/ai/CreateTeamTool.d.ts +11 -6
- package/features/ai/CreateTeamTool.js +20 -11
- package/features/ai/CreateTeamTool.js.map +1 -1
- package/features/ai/DeleteFolderTool.d.ts +48 -0
- package/features/ai/DeleteFolderTool.js +55 -0
- package/features/ai/DeleteFolderTool.js.map +1 -0
- package/features/ai/GrantFolderAccessTool.d.ts +13 -8
- package/features/ai/GrantFolderAccessTool.js +20 -11
- package/features/ai/GrantFolderAccessTool.js.map +1 -1
- package/features/ai/ListFoldersTool.d.ts +11 -6
- package/features/ai/ListFoldersTool.js +21 -12
- package/features/ai/ListFoldersTool.js.map +1 -1
- package/features/ai/ListRolesTool.d.ts +11 -6
- package/features/ai/ListRolesTool.js +21 -12
- package/features/ai/ListRolesTool.js.map +1 -1
- package/features/ai/ListTeamsTool.d.ts +11 -6
- package/features/ai/ListTeamsTool.js +21 -12
- package/features/ai/ListTeamsTool.js.map +1 -1
- package/features/ai/RevokeFolderAccessTool.d.ts +12 -7
- package/features/ai/RevokeFolderAccessTool.js +21 -12
- package/features/ai/RevokeFolderAccessTool.js.map +1 -1
- package/features/ai/feature.d.ts +1 -1
- package/features/ai/feature.js +2 -0
- package/features/ai/feature.js.map +1 -1
- package/features/ai/index.d.ts +1 -0
- package/features/ai/index.js +1 -0
- package/features/cms/decorators/ListDeletedEntriesWithFlpDecorator.d.ts +4 -4
- package/features/cms/decorators/ListDeletedEntriesWithFlpDecorator.js +7 -8
- package/features/cms/decorators/ListDeletedEntriesWithFlpDecorator.js.map +1 -1
- package/features/cms/decorators/ListEntriesWithFlpDecorator.d.ts +3 -3
- package/features/cms/decorators/ListEntriesWithFlpDecorator.js +7 -8
- package/features/cms/decorators/ListEntriesWithFlpDecorator.js.map +1 -1
- package/features/cms/decorators/ListLatestEntriesWithFlpDecorator.d.ts +4 -4
- package/features/cms/decorators/ListLatestEntriesWithFlpDecorator.js +7 -8
- package/features/cms/decorators/ListLatestEntriesWithFlpDecorator.js.map +1 -1
- package/features/cms/decorators/ListPublishedEntriesWithFlpDecorator.d.ts +4 -4
- package/features/cms/decorators/ListPublishedEntriesWithFlpDecorator.js +7 -8
- package/features/cms/decorators/ListPublishedEntriesWithFlpDecorator.js.map +1 -1
- package/features/flp/CreateFlp/index.d.ts +0 -1
- package/features/flp/CreateFlp/index.js +0 -1
- package/features/flp/DeleteFlp/index.d.ts +0 -1
- package/features/flp/DeleteFlp/index.js +0 -1
- package/features/flp/FolderAccessListFilter/abstractions.d.ts +33 -0
- package/features/flp/FolderAccessListFilter/abstractions.js +5 -0
- package/features/flp/FolderAccessListFilter/abstractions.js.map +1 -0
- package/features/flp/FolderAccessListFilter/index.d.ts +1 -0
- package/features/flp/FolderAccessListFilter/index.js +1 -0
- package/features/flp/FolderCatalogSync/FolderCatalogSyncHandlersFeature.d.ts +8 -0
- package/features/flp/FolderCatalogSync/FolderCatalogSyncHandlersFeature.js +15 -0
- package/features/flp/FolderCatalogSync/FolderCatalogSyncHandlersFeature.js.map +1 -0
- package/features/flp/FolderCatalogSync/SyncFolderCatalogOnFolderCreatedHandler.d.ts +11 -0
- package/features/flp/FolderCatalogSync/SyncFolderCatalogOnFolderCreatedHandler.js +19 -0
- package/features/flp/FolderCatalogSync/SyncFolderCatalogOnFolderCreatedHandler.js.map +1 -0
- package/features/flp/FolderCatalogSync/SyncFolderCatalogOnFolderDeletedHandler.d.ts +11 -0
- package/features/flp/FolderCatalogSync/SyncFolderCatalogOnFolderDeletedHandler.js +19 -0
- package/features/flp/FolderCatalogSync/SyncFolderCatalogOnFolderDeletedHandler.js.map +1 -0
- package/features/flp/FolderCatalogSync/SyncFolderCatalogOnFolderUpdatedHandler.d.ts +11 -0
- package/features/flp/FolderCatalogSync/SyncFolderCatalogOnFolderUpdatedHandler.js +23 -0
- package/features/flp/FolderCatalogSync/SyncFolderCatalogOnFolderUpdatedHandler.js.map +1 -0
- package/features/flp/FolderCatalogSync/abstractions.d.ts +25 -0
- package/features/flp/FolderCatalogSync/abstractions.js +5 -0
- package/features/flp/FolderCatalogSync/abstractions.js.map +1 -0
- package/features/flp/FolderCatalogSync/index.d.ts +2 -0
- package/features/flp/FolderCatalogSync/index.js +2 -0
- package/features/flp/FolderLevelPermissions/FolderLevelPermissions.d.ts +5 -2
- package/features/flp/FolderLevelPermissions/FolderLevelPermissions.js +19 -5
- package/features/flp/FolderLevelPermissions/FolderLevelPermissions.js.map +1 -1
- package/features/flp/FolderLevelPermissions/NoopFolderLevelPermissions.d.ts +1 -0
- package/features/flp/FolderLevelPermissions/NoopFolderLevelPermissions.js +3 -0
- package/features/flp/FolderLevelPermissions/NoopFolderLevelPermissions.js.map +1 -1
- package/features/flp/FolderLevelPermissions/abstractions.d.ts +8 -2
- package/features/flp/FolderLevelPermissions/abstractions.js.map +1 -1
- package/features/flp/FolderLevelPermissions/useCases/GetDefaultPermissions/GetDefaultPermissionsWithTeams.d.ts +12 -0
- package/features/flp/FolderLevelPermissions/useCases/GetDefaultPermissions/GetDefaultPermissionsWithTeams.js +22 -14
- package/features/flp/FolderLevelPermissions/useCases/GetDefaultPermissions/GetDefaultPermissionsWithTeams.js.map +1 -1
- package/features/flp/FolderPermissionsRepository/abstractions.d.ts +28 -0
- package/features/flp/FolderPermissionsRepository/abstractions.js +5 -0
- package/features/flp/FolderPermissionsRepository/abstractions.js.map +1 -0
- package/features/flp/FolderPermissionsRepository/index.d.ts +1 -0
- package/features/flp/FolderPermissionsRepository/index.js +1 -0
- package/features/flp/GetFlp/GetFlpUseCase.d.ts +10 -5
- package/features/flp/GetFlp/GetFlpUseCase.js +13 -5
- package/features/flp/GetFlp/GetFlpUseCase.js.map +1 -1
- package/features/flp/GetFlp/decorators/GetFlpWithCodeFlps.d.ts +13 -0
- package/features/flp/GetFlp/decorators/GetFlpWithCodeFlps.js +26 -0
- package/features/flp/GetFlp/decorators/GetFlpWithCodeFlps.js.map +1 -0
- package/features/flp/GetFlp/feature.js +1 -3
- package/features/flp/GetFlp/feature.js.map +1 -1
- package/features/flp/ListFlps/ListFlpsUseCase.d.ts +11 -6
- package/features/flp/ListFlps/ListFlpsUseCase.js +13 -5
- package/features/flp/ListFlps/ListFlpsUseCase.js.map +1 -1
- package/features/flp/ListFlps/abstractions.d.ts +3 -9
- package/features/flp/ListFlps/abstractions.js.map +1 -1
- package/features/flp/ListFlps/decorators/ListFlpsWithCodeFlps.d.ts +13 -0
- package/features/flp/ListFlps/decorators/ListFlpsWithCodeFlps.js +27 -0
- package/features/flp/ListFlps/decorators/ListFlpsWithCodeFlps.js.map +1 -0
- package/features/flp/ListFlps/feature.js +1 -3
- package/features/flp/ListFlps/feature.js.map +1 -1
- package/features/flp/ListFolderAccess/GetUserEntryAccessUseCase.d.ts +14 -0
- package/features/flp/ListFolderAccess/GetUserEntryAccessUseCase.js +36 -0
- package/features/flp/ListFolderAccess/GetUserEntryAccessUseCase.js.map +1 -0
- package/features/flp/ListFolderAccess/GetUserFolderAccessUseCase.d.ts +25 -0
- package/features/flp/ListFolderAccess/GetUserFolderAccessUseCase.js +75 -0
- package/features/flp/ListFolderAccess/GetUserFolderAccessUseCase.js.map +1 -0
- package/features/flp/ListFolderAccess/ListEntryAccessUseCase.d.ts +13 -0
- package/features/flp/ListFolderAccess/ListEntryAccessUseCase.js +28 -0
- package/features/flp/ListFolderAccess/ListEntryAccessUseCase.js.map +1 -0
- package/features/flp/ListFolderAccess/ListFolderAccessUseCase.d.ts +24 -0
- package/features/flp/ListFolderAccess/ListFolderAccessUseCase.js +107 -0
- package/features/flp/ListFolderAccess/ListFolderAccessUseCase.js.map +1 -0
- package/features/flp/ListFolderAccess/ListUserFolderAccessUseCase.d.ts +28 -0
- package/features/flp/ListFolderAccess/ListUserFolderAccessUseCase.js +98 -0
- package/features/flp/ListFolderAccess/ListUserFolderAccessUseCase.js.map +1 -0
- package/features/flp/ListFolderAccess/UserFolderCandidates.d.ts +13 -0
- package/features/flp/ListFolderAccess/UserFolderCandidates.js +26 -0
- package/features/flp/ListFolderAccess/UserFolderCandidates.js.map +1 -0
- package/features/flp/ListFolderAccess/abstractions.d.ts +182 -0
- package/features/flp/ListFolderAccess/abstractions.js +10 -0
- package/features/flp/ListFolderAccess/abstractions.js.map +1 -0
- package/features/flp/{CreateFlpOnFolderCreated → ListFolderAccess}/feature.d.ts +1 -1
- package/features/flp/ListFolderAccess/feature.js +21 -0
- package/features/flp/ListFolderAccess/feature.js.map +1 -0
- package/features/flp/ListFolderAccess/index.d.ts +2 -0
- package/features/flp/ListFolderAccess/index.js +2 -0
- package/features/flp/ListFolderAccess/mayAskAboutUser.d.ts +3 -0
- package/features/flp/ListFolderAccess/mayAskAboutUser.js +9 -0
- package/features/flp/ListFolderAccess/mayAskAboutUser.js.map +1 -0
- package/features/flp/ListFolderAccess/userFolderLevel.d.ts +31 -0
- package/features/flp/ListFolderAccess/userFolderLevel.js +48 -0
- package/features/flp/ListFolderAccess/userFolderLevel.js.map +1 -0
- package/features/flp/UpdateFlp/abstractions.d.ts +6 -2
- package/features/flp/UpdateFlp/abstractions.js.map +1 -1
- package/features/flp/UpdateFlp/index.d.ts +0 -1
- package/features/flp/UpdateFlp/index.js +0 -1
- package/features/flp/shared/CodeFlpMerger.d.ts +26 -0
- package/features/flp/shared/CodeFlpMerger.js +20 -0
- package/features/flp/shared/CodeFlpMerger.js.map +1 -0
- package/features/flp/shared/CodeFlpPath.d.ts +15 -0
- package/features/flp/shared/CodeFlpPath.js +29 -0
- package/features/flp/shared/CodeFlpPath.js.map +1 -0
- package/features/flp/shared/CodeFlpTarget.d.ts +10 -0
- package/features/flp/shared/CodeFlpTarget.js +26 -0
- package/features/flp/shared/CodeFlpTarget.js.map +1 -0
- package/features/flp/shared/CodeFlpsProvider.d.ts +15 -0
- package/features/flp/shared/CodeFlpsProvider.js +36 -0
- package/features/flp/shared/CodeFlpsProvider.js.map +1 -0
- package/features/flp/shared/abstractions.d.ts +79 -0
- package/features/flp/shared/abstractions.js +19 -0
- package/features/flp/shared/abstractions.js.map +1 -0
- package/features/flp/shared/feature.d.ts +5 -0
- package/features/flp/shared/feature.js +17 -0
- package/features/flp/shared/feature.js.map +1 -0
- package/features/flp/shared/index.d.ts +4 -0
- package/features/flp/shared/index.js +4 -0
- package/features/folder/CreateFolder/decorators/CreateFolderWithFolderLevelPermissions.d.ts +9 -1
- package/features/folder/CreateFolder/decorators/CreateFolderWithFolderLevelPermissions.js +20 -3
- package/features/folder/CreateFolder/decorators/CreateFolderWithFolderLevelPermissions.js.map +1 -1
- package/features/folder/ListFolders/decorators/ListFoldersWithFolderLevelPermissions.d.ts +3 -7
- package/features/folder/ListFolders/decorators/ListFoldersWithFolderLevelPermissions.js +5 -50
- package/features/folder/ListFolders/decorators/ListFoldersWithFolderLevelPermissions.js.map +1 -1
- package/features/folder/NotifyFolderChange/NotifyFolderChangeUseCase.d.ts +11 -0
- package/features/folder/NotifyFolderChange/NotifyFolderChangeUseCase.js +38 -0
- package/features/folder/NotifyFolderChange/NotifyFolderChangeUseCase.js.map +1 -0
- package/features/{flp/DeleteFlpOnFolderDeleted/DeleteFlpOnFolderDeletedHandler.d.ts → folder/NotifyFolderChange/NotifyOnFolderDeletedHandler.d.ts} +5 -7
- package/features/folder/NotifyFolderChange/NotifyOnFolderDeletedHandler.js +24 -0
- package/features/folder/NotifyFolderChange/NotifyOnFolderDeletedHandler.js.map +1 -0
- package/features/folder/NotifyFolderChange/abstractions.d.ts +28 -0
- package/features/folder/NotifyFolderChange/abstractions.js +8 -0
- package/features/folder/NotifyFolderChange/abstractions.js.map +1 -0
- package/features/folder/NotifyFolderChange/feature.d.ts +8 -0
- package/features/folder/NotifyFolderChange/feature.js +13 -0
- package/features/folder/NotifyFolderChange/feature.js.map +1 -0
- package/features/folder/NotifyFolderChange/index.d.ts +2 -0
- package/features/folder/NotifyFolderChange/index.js +2 -0
- package/features/folder/UpdateFolder/decorators/UpdateFolderWithFolderLevelPermissions.d.ts +14 -1
- package/features/folder/UpdateFolder/decorators/UpdateFolderWithFolderLevelPermissions.js +52 -4
- package/features/folder/UpdateFolder/decorators/UpdateFolderWithFolderLevelPermissions.js.map +1 -1
- package/filter/filter.model.js +2 -1
- package/filter/filter.model.js.map +1 -1
- package/filter/filter.so.d.ts +0 -2
- package/filter/filter.so.js +20 -8
- package/filter/filter.so.js.map +1 -1
- package/flp/flp.types.d.ts +6 -1
- package/flp/index.d.ts +0 -1
- package/flp/index.js +0 -1
- package/flpTaskCatalog/CatalogFolderPermissionsRepository.d.ts +17 -0
- package/flpTaskCatalog/CatalogFolderPermissionsRepository.js +34 -0
- package/flpTaskCatalog/CatalogFolderPermissionsRepository.js.map +1 -0
- package/flpTaskCatalog/PostLoadFolderAccessListFilter.d.ts +24 -0
- package/flpTaskCatalog/PostLoadFolderAccessListFilter.js +63 -0
- package/flpTaskCatalog/PostLoadFolderAccessListFilter.js.map +1 -0
- package/flpTaskCatalog/TaskCatalogFlpFeature.d.ts +12 -0
- package/flpTaskCatalog/TaskCatalogFlpFeature.js +49 -0
- package/flpTaskCatalog/TaskCatalogFlpFeature.js.map +1 -0
- package/flpTaskCatalog/TaskFolderCatalogSync.d.ts +29 -0
- package/flpTaskCatalog/TaskFolderCatalogSync.js +57 -0
- package/flpTaskCatalog/TaskFolderCatalogSync.js.map +1 -0
- package/{flp → flpTaskCatalog}/flp.crud.d.ts +1 -1
- package/flpTaskCatalog/flp.crud.js.map +1 -0
- package/flpTaskCatalog/index.d.ts +1 -0
- package/flpTaskCatalog/index.js +1 -0
- package/{utils/decorators → flpTaskCatalog/listEntries}/ListEntriesFactory.d.ts +1 -1
- package/flpTaskCatalog/listEntries/ListEntriesFactory.js.map +1 -0
- package/flpTaskCatalog/listEntries/hasRootFolderId.js.map +1 -0
- package/{utils/decorators → flpTaskCatalog/listEntries}/isPageModel.js +1 -1
- package/flpTaskCatalog/listEntries/isPageModel.js.map +1 -0
- package/flpTaskCatalog/tasks/createFlp.task.d.ts +25 -0
- package/{flp → flpTaskCatalog}/tasks/createFlp.task.js +34 -17
- package/flpTaskCatalog/tasks/createFlp.task.js.map +1 -0
- package/flpTaskCatalog/tasks/deleteFlp.task.d.ts +23 -0
- package/{flp → flpTaskCatalog}/tasks/deleteFlp.task.js +24 -15
- package/flpTaskCatalog/tasks/deleteFlp.task.js.map +1 -0
- package/{flp → flpTaskCatalog}/tasks/syncFlp.task.d.ts +11 -6
- package/{flp → flpTaskCatalog}/tasks/syncFlp.task.js +25 -16
- package/flpTaskCatalog/tasks/syncFlp.task.js.map +1 -0
- package/flpTaskCatalog/tasks/updateFlp.task.d.ts +25 -0
- package/flpTaskCatalog/tasks/updateFlp.task.js +64 -0
- package/flpTaskCatalog/tasks/updateFlp.task.js.map +1 -0
- package/flpTaskCatalog/useCases/CreateFlpUseCase.d.ts +8 -0
- package/{features/flp/CreateFlp → flpTaskCatalog/useCases}/CreateFlpUseCase.js +1 -1
- package/flpTaskCatalog/useCases/CreateFlpUseCase.js.map +1 -0
- package/flpTaskCatalog/useCases/DeleteFlpUseCase.d.ts +8 -0
- package/flpTaskCatalog/useCases/DeleteFlpUseCase.js.map +1 -0
- package/{features/flp/UpdateFlp → flpTaskCatalog/useCases}/UpdateFlpUseCase.d.ts +8 -9
- package/{features/flp/UpdateFlp → flpTaskCatalog/useCases}/UpdateFlpUseCase.js +23 -30
- package/flpTaskCatalog/useCases/UpdateFlpUseCase.js.map +1 -0
- package/folder/createFolderTypeDefs.js +4 -1
- package/folder/createFolderTypeDefs.js.map +1 -1
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/package.json +22 -22
- package/types.d.ts +2 -3
- package/types.js.map +1 -1
- package/utils/createOperationsWrapper.d.ts +2 -2
- package/utils/createOperationsWrapper.js +5 -5
- package/utils/createOperationsWrapper.js.map +1 -1
- package/features/flp/CreateFlp/CreateFlpUseCase.d.ts +0 -8
- package/features/flp/CreateFlp/CreateFlpUseCase.js.map +0 -1
- package/features/flp/CreateFlp/feature.d.ts +0 -5
- package/features/flp/CreateFlp/feature.js +0 -13
- package/features/flp/CreateFlp/feature.js.map +0 -1
- package/features/flp/CreateFlpOnFolderCreated/CreateFlpOnFolderCreatedHandler.d.ts +0 -14
- package/features/flp/CreateFlpOnFolderCreated/CreateFlpOnFolderCreatedHandler.js +0 -37
- package/features/flp/CreateFlpOnFolderCreated/CreateFlpOnFolderCreatedHandler.js.map +0 -1
- package/features/flp/CreateFlpOnFolderCreated/feature.js +0 -11
- package/features/flp/CreateFlpOnFolderCreated/feature.js.map +0 -1
- package/features/flp/CreateFlpOnFolderCreated/index.d.ts +0 -1
- package/features/flp/CreateFlpOnFolderCreated/index.js +0 -1
- package/features/flp/DeleteFlp/DeleteFlpUseCase.d.ts +0 -8
- package/features/flp/DeleteFlp/DeleteFlpUseCase.js.map +0 -1
- package/features/flp/DeleteFlp/feature.d.ts +0 -5
- package/features/flp/DeleteFlp/feature.js +0 -13
- package/features/flp/DeleteFlp/feature.js.map +0 -1
- package/features/flp/DeleteFlpOnFolderDeleted/DeleteFlpOnFolderDeletedHandler.js +0 -37
- package/features/flp/DeleteFlpOnFolderDeleted/DeleteFlpOnFolderDeletedHandler.js.map +0 -1
- package/features/flp/DeleteFlpOnFolderDeleted/feature.d.ts +0 -4
- package/features/flp/DeleteFlpOnFolderDeleted/feature.js +0 -11
- package/features/flp/DeleteFlpOnFolderDeleted/feature.js.map +0 -1
- package/features/flp/DeleteFlpOnFolderDeleted/index.d.ts +0 -1
- package/features/flp/DeleteFlpOnFolderDeleted/index.js +0 -1
- package/features/flp/UpdateFlp/UpdateFlpUseCase.js.map +0 -1
- package/features/flp/UpdateFlp/feature.d.ts +0 -5
- package/features/flp/UpdateFlp/feature.js +0 -17
- package/features/flp/UpdateFlp/feature.js.map +0 -1
- package/features/flp/UpdateFlpOnFolderUpdated/UpdateFlpOnFolderUpdatedHandler.d.ts +0 -14
- package/features/flp/UpdateFlpOnFolderUpdated/UpdateFlpOnFolderUpdatedHandler.js +0 -39
- package/features/flp/UpdateFlpOnFolderUpdated/UpdateFlpOnFolderUpdatedHandler.js.map +0 -1
- package/features/flp/UpdateFlpOnFolderUpdated/feature.d.ts +0 -4
- package/features/flp/UpdateFlpOnFolderUpdated/feature.js +0 -11
- package/features/flp/UpdateFlpOnFolderUpdated/feature.js.map +0 -1
- package/features/flp/UpdateFlpOnFolderUpdated/index.d.ts +0 -1
- package/features/flp/UpdateFlpOnFolderUpdated/index.js +0 -1
- package/flp/flp.crud.js.map +0 -1
- package/flp/tasks/createFlp.task.d.ts +0 -18
- package/flp/tasks/createFlp.task.js.map +0 -1
- package/flp/tasks/deleteFlp.task.d.ts +0 -18
- package/flp/tasks/deleteFlp.task.js.map +0 -1
- package/flp/tasks/syncFlp.task.js.map +0 -1
- package/flp/tasks/updateFlp.task.d.ts +0 -18
- package/flp/tasks/updateFlp.task.js +0 -43
- package/flp/tasks/updateFlp.task.js.map +0 -1
- package/utils/decorators/CmsEntriesCrudDecorators.d.ts +0 -11
- package/utils/decorators/CmsEntriesCrudDecorators.js +0 -179
- package/utils/decorators/CmsEntriesCrudDecorators.js.map +0 -1
- package/utils/decorators/FilterEntriesByFolderFactory.d.ts +0 -7
- package/utils/decorators/FilterEntriesByFolderFactory.js +0 -22
- package/utils/decorators/FilterEntriesByFolderFactory.js.map +0 -1
- package/utils/decorators/ListEntriesFactory.js.map +0 -1
- package/utils/decorators/hasRootFolderId.js.map +0 -1
- package/utils/decorators/isPageModel.js.map +0 -1
- /package/{flp → flpTaskCatalog}/flp.crud.js +0 -0
- /package/{utils/decorators → flpTaskCatalog/listEntries}/ListEntriesFactory.js +0 -0
- /package/{utils/decorators → flpTaskCatalog/listEntries}/hasRootFolderId.d.ts +0 -0
- /package/{utils/decorators → flpTaskCatalog/listEntries}/hasRootFolderId.js +0 -0
- /package/{utils/decorators → flpTaskCatalog/listEntries}/isPageModel.d.ts +0 -0
- /package/{features/flp/DeleteFlp → flpTaskCatalog/useCases}/DeleteFlpUseCase.js +0 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { AiSdkToolDefinition, AiSdkToolHandler } from "@webiny/api-core/features/ai/index.js";
|
|
3
|
+
import { GetFolderUseCase } from "../../features/folder/GetFolder/index.js";
|
|
4
|
+
import { DeleteFolderUseCase } from "../../features/folder/DeleteFolder/index.js";
|
|
5
|
+
declare const inputSchema: z.ZodObject<{
|
|
6
|
+
folderId: z.ZodString;
|
|
7
|
+
title: z.ZodString;
|
|
8
|
+
}, z.core.$strip>;
|
|
9
|
+
type Input = z.infer<typeof inputSchema>;
|
|
10
|
+
interface DeletedFolder {
|
|
11
|
+
id: string;
|
|
12
|
+
title: string;
|
|
13
|
+
path: string;
|
|
14
|
+
type: string;
|
|
15
|
+
}
|
|
16
|
+
declare class DeleteFolderToolHandlerImpl implements AiSdkToolHandler.Interface<Input> {
|
|
17
|
+
private getFolder;
|
|
18
|
+
private deleteFolder;
|
|
19
|
+
constructor(getFolder: GetFolderUseCase.Interface, deleteFolder: DeleteFolderUseCase.Interface);
|
|
20
|
+
execute(input: Input): Promise<DeletedFolder>;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Deletes one folder.
|
|
24
|
+
*
|
|
25
|
+
* Destructive, so the approval says it cannot be undone. Only an empty folder can go: the folder
|
|
26
|
+
* feature refuses to delete one that still holds subfolders or content, and that error reaches the
|
|
27
|
+
* model as-is.
|
|
28
|
+
*/
|
|
29
|
+
declare class DeleteFolderToolImpl implements AiSdkToolDefinition.Interface<Input> {
|
|
30
|
+
readonly name = "deleteFolder";
|
|
31
|
+
readonly title = "Delete folder";
|
|
32
|
+
readonly description = "Deletes one empty folder. Folders that still contain subfolders or content are refused. Call listFolders first for the id and exact title. Requires user approval.";
|
|
33
|
+
readonly inputSchema: z.ZodObject<{
|
|
34
|
+
folderId: z.ZodString;
|
|
35
|
+
title: z.ZodString;
|
|
36
|
+
}, z.core.$strip>;
|
|
37
|
+
readonly annotations: {
|
|
38
|
+
readOnlyHint: boolean;
|
|
39
|
+
destructiveHint: boolean;
|
|
40
|
+
};
|
|
41
|
+
readonly handler: typeof DeleteFolderToolHandlerImpl & {
|
|
42
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/ai/abstractions").IAiSdkToolHandler<any>>;
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
export declare const DeleteFolderTool: typeof DeleteFolderToolImpl & {
|
|
46
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/ai/abstractions").IAiSdkToolDefinition<any>>;
|
|
47
|
+
};
|
|
48
|
+
export {};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { AiSdkToolDefinition, AiSdkToolHandler } from "@webiny/api-core/features/ai/index.js";
|
|
3
|
+
import { GetFolderUseCase } from "../folder/GetFolder/index.js";
|
|
4
|
+
import { DeleteFolderUseCase } from "../folder/DeleteFolder/index.js";
|
|
5
|
+
const inputSchema = z.object({
|
|
6
|
+
folderId: z.string().describe("Folder id as returned by listFolders."),
|
|
7
|
+
title: z.string().describe("The folder's current title, exactly as listFolders returned it. The delete is refused if it does not match.")
|
|
8
|
+
});
|
|
9
|
+
class DeleteFolderToolHandlerImpl {
|
|
10
|
+
constructor(getFolder, deleteFolder){
|
|
11
|
+
this.getFolder = getFolder;
|
|
12
|
+
this.deleteFolder = deleteFolder;
|
|
13
|
+
}
|
|
14
|
+
async execute(input) {
|
|
15
|
+
const found = await this.getFolder.execute(input.folderId);
|
|
16
|
+
if (found.isFail()) throw new Error(`Folder "${input.folderId}" not found: ${found.error.message}. Call listFolders for valid ids.`);
|
|
17
|
+
const folder = found.value;
|
|
18
|
+
if (folder.title !== input.title) throw new Error(`Folder "${input.folderId}" is titled "${folder.title}", not "${input.title}", so nothing was deleted. Check the folder with listFolders.`);
|
|
19
|
+
const result = await this.deleteFolder.execute(folder.id);
|
|
20
|
+
if (result.isFail()) throw new Error(`Could not delete the folder: ${result.error.message}`);
|
|
21
|
+
return {
|
|
22
|
+
id: folder.id,
|
|
23
|
+
title: folder.title,
|
|
24
|
+
path: folder.path,
|
|
25
|
+
type: folder.type
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
const DeleteFolderToolHandler = AiSdkToolHandler.createImplementation({
|
|
30
|
+
implementation: DeleteFolderToolHandlerImpl,
|
|
31
|
+
dependencies: [
|
|
32
|
+
GetFolderUseCase,
|
|
33
|
+
DeleteFolderUseCase
|
|
34
|
+
]
|
|
35
|
+
});
|
|
36
|
+
class DeleteFolderToolImpl {
|
|
37
|
+
constructor(){
|
|
38
|
+
this.name = "deleteFolder";
|
|
39
|
+
this.title = "Delete folder";
|
|
40
|
+
this.description = "Deletes one empty folder. Folders that still contain subfolders or content are refused. Call listFolders first for the id and exact title. Requires user approval.";
|
|
41
|
+
this.inputSchema = inputSchema;
|
|
42
|
+
this.annotations = {
|
|
43
|
+
readOnlyHint: false,
|
|
44
|
+
destructiveHint: true
|
|
45
|
+
};
|
|
46
|
+
this.handler = DeleteFolderToolHandler;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
const DeleteFolderTool = AiSdkToolDefinition.createImplementation({
|
|
50
|
+
implementation: DeleteFolderToolImpl,
|
|
51
|
+
dependencies: []
|
|
52
|
+
});
|
|
53
|
+
export { DeleteFolderTool };
|
|
54
|
+
|
|
55
|
+
//# sourceMappingURL=DeleteFolderTool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/ai/DeleteFolderTool.js","sources":["../../../src/features/ai/DeleteFolderTool.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { AiSdkToolDefinition, AiSdkToolHandler } from \"@webiny/api-core/features/ai/index.js\";\nimport { GetFolderUseCase } from \"~/features/folder/GetFolder/index.js\";\nimport { DeleteFolderUseCase } from \"~/features/folder/DeleteFolder/index.js\";\n\nconst inputSchema = z.object({\n folderId: z.string().describe(\"Folder id as returned by listFolders.\"),\n title: z\n .string()\n .describe(\n \"The folder's current title, exactly as listFolders returned it. The delete is refused if it does not match.\"\n )\n});\n\ntype Input = z.infer<typeof inputSchema>;\n\ninterface DeletedFolder {\n id: string;\n title: string;\n path: string;\n type: string;\n}\n\n/*\n * The title is part of the input so the approval shows the user which folder goes, rather than only\n * an id. The model supplies it, so it is checked against the stored folder before anything is\n * deleted: what the user approved by name has to be the folder that is removed.\n */\nclass DeleteFolderToolHandlerImpl implements AiSdkToolHandler.Interface<Input> {\n constructor(\n private getFolder: GetFolderUseCase.Interface,\n private deleteFolder: DeleteFolderUseCase.Interface\n ) {}\n\n async execute(input: Input): Promise<DeletedFolder> {\n const found = await this.getFolder.execute(input.folderId);\n\n if (found.isFail()) {\n throw new Error(\n `Folder \"${input.folderId}\" not found: ${found.error.message}. Call listFolders for valid ids.`\n );\n }\n\n const folder = found.value;\n\n if (folder.title !== input.title) {\n throw new Error(\n `Folder \"${input.folderId}\" is titled \"${folder.title}\", not \"${input.title}\", so nothing was deleted. Check the folder with listFolders.`\n );\n }\n\n const result = await this.deleteFolder.execute(folder.id);\n\n if (result.isFail()) {\n throw new Error(`Could not delete the folder: ${result.error.message}`);\n }\n\n return { id: folder.id, title: folder.title, path: folder.path, type: folder.type };\n }\n}\n\nconst DeleteFolderToolHandler = AiSdkToolHandler.createImplementation({\n implementation: DeleteFolderToolHandlerImpl,\n dependencies: [GetFolderUseCase, DeleteFolderUseCase]\n});\n\n/**\n * Deletes one folder.\n *\n * Destructive, so the approval says it cannot be undone. Only an empty folder can go: the folder\n * feature refuses to delete one that still holds subfolders or content, and that error reaches the\n * model as-is.\n */\nclass DeleteFolderToolImpl implements AiSdkToolDefinition.Interface<Input> {\n readonly name = \"deleteFolder\";\n readonly title = \"Delete folder\";\n readonly description =\n \"Deletes one empty folder. Folders that still contain subfolders or content are refused. Call listFolders first for the id and exact title. Requires user approval.\";\n readonly inputSchema = inputSchema;\n readonly annotations = { readOnlyHint: false, destructiveHint: true };\n readonly handler = DeleteFolderToolHandler;\n}\n\nexport const DeleteFolderTool = AiSdkToolDefinition.createImplementation({\n implementation: DeleteFolderToolImpl,\n dependencies: []\n});\n"],"names":["inputSchema","z","DeleteFolderToolHandlerImpl","getFolder","deleteFolder","input","found","Error","folder","result","DeleteFolderToolHandler","AiSdkToolHandler","GetFolderUseCase","DeleteFolderUseCase","DeleteFolderToolImpl","DeleteFolderTool","AiSdkToolDefinition"],"mappings":";;;;AAKA,MAAMA,cAAcC,EAAE,MAAM,CAAC;IACzB,UAAUA,EAAE,MAAM,GAAG,QAAQ,CAAC;IAC9B,OAAOA,EAAAA,MACI,GACN,QAAQ,CACL;AAEZ;AAgBA,MAAMC;IACF,YACYC,SAAqC,EACrCC,YAA2C,CACrD;aAFUD,SAAS,GAATA;aACAC,YAAY,GAAZA;IACT;IAEH,MAAM,QAAQC,KAAY,EAA0B;QAChD,MAAMC,QAAQ,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO,CAACD,MAAM,QAAQ;QAEzD,IAAIC,MAAM,MAAM,IACZ,MAAM,IAAIC,MACN,CAAC,QAAQ,EAAEF,MAAM,QAAQ,CAAC,aAAa,EAAEC,MAAM,KAAK,CAAC,OAAO,CAAC,iCAAiC,CAAC;QAIvG,MAAME,SAASF,MAAM,KAAK;QAE1B,IAAIE,OAAO,KAAK,KAAKH,MAAM,KAAK,EAC5B,MAAM,IAAIE,MACN,CAAC,QAAQ,EAAEF,MAAM,QAAQ,CAAC,aAAa,EAAEG,OAAO,KAAK,CAAC,QAAQ,EAAEH,MAAM,KAAK,CAAC,6DAA6D,CAAC;QAIlJ,MAAMI,SAAS,MAAM,IAAI,CAAC,YAAY,CAAC,OAAO,CAACD,OAAO,EAAE;QAExD,IAAIC,OAAO,MAAM,IACb,MAAM,IAAIF,MAAM,CAAC,6BAA6B,EAAEE,OAAO,KAAK,CAAC,OAAO,EAAE;QAG1E,OAAO;YAAE,IAAID,OAAO,EAAE;YAAE,OAAOA,OAAO,KAAK;YAAE,MAAMA,OAAO,IAAI;YAAE,MAAMA,OAAO,IAAI;QAAC;IACtF;AACJ;AAEA,MAAME,0BAA0BC,iBAAiB,oBAAoB,CAAC;IAClE,gBAAgBT;IAChB,cAAc;QAACU;QAAkBC;KAAoB;AACzD;AASA,MAAMC;;aACO,IAAI,GAAG;aACP,KAAK,GAAG;aACR,WAAW,GAChB;aACK,WAAW,GAAGd;aACd,WAAW,GAAG;YAAE,cAAc;YAAO,iBAAiB;QAAK;aAC3D,OAAO,GAAGU;;AACvB;AAEO,MAAMK,mBAAmBC,oBAAoB,oBAAoB,CAAC;IACrE,gBAAgBF;IAChB,cAAc,EAAE;AACpB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import
|
|
2
|
+
import { AiSdkToolDefinition, AiSdkToolHandler } from "@webiny/api-core/features/ai/index.js";
|
|
3
3
|
import { ListTeamsUseCase } from "@webiny/api-core/features/security/teams/ListTeams/index.js";
|
|
4
4
|
import { GetFolderUseCase } from "../../features/folder/GetFolder/index.js";
|
|
5
5
|
import { UpdateFolderUseCase } from "../../features/folder/UpdateFolder/index.js";
|
|
@@ -34,6 +34,13 @@ interface GrantResult {
|
|
|
34
34
|
/** True when the target already had a direct rule and its level was changed. */
|
|
35
35
|
replacedExistingLevel?: string;
|
|
36
36
|
}
|
|
37
|
+
declare class GrantFolderAccessToolHandlerImpl implements AiSdkToolHandler.Interface<Input> {
|
|
38
|
+
private getFolder;
|
|
39
|
+
private updateFolder;
|
|
40
|
+
private listTeams;
|
|
41
|
+
constructor(getFolder: GetFolderUseCase.Interface, updateFolder: UpdateFolderUseCase.Interface, listTeams: ListTeamsUseCase.Interface);
|
|
42
|
+
execute(input: Input): Promise<GrantResult>;
|
|
43
|
+
}
|
|
37
44
|
/**
|
|
38
45
|
* Grants one target access to one folder, leaving every other rule alone.
|
|
39
46
|
*
|
|
@@ -42,10 +49,7 @@ interface GrantResult {
|
|
|
42
49
|
* the model omitted disappeared silently. One target per call keeps the approval honest: what the user
|
|
43
50
|
* sees in the plan is the whole change.
|
|
44
51
|
*/
|
|
45
|
-
declare class GrantFolderAccessToolImpl implements
|
|
46
|
-
private getFolder;
|
|
47
|
-
private updateFolder;
|
|
48
|
-
private listTeams;
|
|
52
|
+
declare class GrantFolderAccessToolImpl implements AiSdkToolDefinition.Interface<Input> {
|
|
49
53
|
readonly name = "grantFolderAccess";
|
|
50
54
|
readonly title = "Grant folder access";
|
|
51
55
|
readonly description = "Grants one team or user a level of access on one folder, leaving all other permissions untouched. Use listFolders for the folder id and listTeams for a team slug. Requires user approval.";
|
|
@@ -63,10 +67,11 @@ declare class GrantFolderAccessToolImpl implements IAiSdkTool<Input> {
|
|
|
63
67
|
readonly annotations: {
|
|
64
68
|
readOnlyHint: boolean;
|
|
65
69
|
};
|
|
66
|
-
|
|
67
|
-
|
|
70
|
+
readonly handler: typeof GrantFolderAccessToolHandlerImpl & {
|
|
71
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/ai/abstractions.js").IAiSdkToolHandler<any>>;
|
|
72
|
+
};
|
|
68
73
|
}
|
|
69
74
|
export declare const GrantFolderAccessTool: typeof GrantFolderAccessToolImpl & {
|
|
70
|
-
__abstraction: import("@webiny/di").Abstraction<
|
|
75
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/ai/abstractions.js").IAiSdkToolDefinition<any>>;
|
|
71
76
|
};
|
|
72
77
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import {
|
|
2
|
+
import { AiSdkToolDefinition, AiSdkToolHandler } from "@webiny/api-core/features/ai/index.js";
|
|
3
3
|
import { ListTeamsUseCase } from "@webiny/api-core/features/security/teams/ListTeams/index.js";
|
|
4
4
|
import { GetFolderUseCase } from "../folder/GetFolder/index.js";
|
|
5
5
|
import { UpdateFolderUseCase } from "../folder/UpdateFolder/index.js";
|
|
@@ -17,18 +17,11 @@ const inputSchema = z.object({
|
|
|
17
17
|
target: z.string().describe("Who to grant access to. A team is 'team:<slug>' — the SLUG, not the id. A user is 'admin:<userId>'. Resolve with listTeams first."),
|
|
18
18
|
level: z["enum"](ACCESS_LEVELS).describe("owner = full control including permissions; editor = change content; viewer = read only; no-access = explicitly denied.")
|
|
19
19
|
});
|
|
20
|
-
class
|
|
20
|
+
class GrantFolderAccessToolHandlerImpl {
|
|
21
21
|
constructor(getFolder, updateFolder, listTeams){
|
|
22
22
|
this.getFolder = getFolder;
|
|
23
23
|
this.updateFolder = updateFolder;
|
|
24
24
|
this.listTeams = listTeams;
|
|
25
|
-
this.name = "grantFolderAccess";
|
|
26
|
-
this.title = "Grant folder access";
|
|
27
|
-
this.description = "Grants one team or user a level of access on one folder, leaving all other permissions untouched. Use listFolders for the folder id and listTeams for a team slug. Requires user approval.";
|
|
28
|
-
this.inputSchema = inputSchema;
|
|
29
|
-
this.annotations = {
|
|
30
|
-
readOnlyHint: false
|
|
31
|
-
};
|
|
32
25
|
}
|
|
33
26
|
async execute(input) {
|
|
34
27
|
const loaded = await loadFolderPermissions(this.getFolder, input.folderId);
|
|
@@ -58,14 +51,30 @@ class GrantFolderAccessToolImpl {
|
|
|
58
51
|
return granted;
|
|
59
52
|
}
|
|
60
53
|
}
|
|
61
|
-
const
|
|
62
|
-
implementation:
|
|
54
|
+
const GrantFolderAccessToolHandler = AiSdkToolHandler.createImplementation({
|
|
55
|
+
implementation: GrantFolderAccessToolHandlerImpl,
|
|
63
56
|
dependencies: [
|
|
64
57
|
GetFolderUseCase,
|
|
65
58
|
UpdateFolderUseCase,
|
|
66
59
|
ListTeamsUseCase
|
|
67
60
|
]
|
|
68
61
|
});
|
|
62
|
+
class GrantFolderAccessToolImpl {
|
|
63
|
+
constructor(){
|
|
64
|
+
this.name = "grantFolderAccess";
|
|
65
|
+
this.title = "Grant folder access";
|
|
66
|
+
this.description = "Grants one team or user a level of access on one folder, leaving all other permissions untouched. Use listFolders for the folder id and listTeams for a team slug. Requires user approval.";
|
|
67
|
+
this.inputSchema = inputSchema;
|
|
68
|
+
this.annotations = {
|
|
69
|
+
readOnlyHint: false
|
|
70
|
+
};
|
|
71
|
+
this.handler = GrantFolderAccessToolHandler;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
const GrantFolderAccessTool = AiSdkToolDefinition.createImplementation({
|
|
75
|
+
implementation: GrantFolderAccessToolImpl,
|
|
76
|
+
dependencies: []
|
|
77
|
+
});
|
|
69
78
|
export { GrantFolderAccessTool };
|
|
70
79
|
|
|
71
80
|
//# sourceMappingURL=GrantFolderAccessTool.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"features/ai/GrantFolderAccessTool.js","sources":["../../../src/features/ai/GrantFolderAccessTool.ts"],"sourcesContent":["import { z } from \"zod\";\nimport {
|
|
1
|
+
{"version":3,"file":"features/ai/GrantFolderAccessTool.js","sources":["../../../src/features/ai/GrantFolderAccessTool.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { AiSdkToolDefinition, AiSdkToolHandler } from \"@webiny/api-core/features/ai/index.js\";\nimport { ListTeamsUseCase } from \"@webiny/api-core/features/security/teams/ListTeams/index.js\";\nimport { GetFolderUseCase } from \"~/features/folder/GetFolder/index.js\";\nimport { UpdateFolderUseCase } from \"~/features/folder/UpdateFolder/index.js\";\nimport type { FolderPermission } from \"~/types.js\";\nimport { loadFolderPermissions } from \"./loadFolderPermissions.js\";\nimport { assertTargetIsUsable } from \"./assertTargetIsUsable.js\";\n\nconst ACCESS_LEVELS = [\"owner\", \"editor\", \"viewer\", \"public\", \"no-access\"] as const;\n\nconst inputSchema = z.object({\n folderId: z.string().describe(\"Folder id as returned by listFolders.\"),\n target: z\n .string()\n .describe(\n \"Who to grant access to. A team is 'team:<slug>' — the SLUG, not the id. A user is 'admin:<userId>'. Resolve with listTeams first.\"\n ),\n level: z\n .enum(ACCESS_LEVELS)\n .describe(\n \"owner = full control including permissions; editor = change content; viewer = read only; no-access = explicitly denied.\"\n )\n});\n\ntype Input = z.infer<typeof inputSchema>;\n\ninterface GrantResult {\n folderId: string;\n title: string;\n path: string;\n /**\n * Every direct rule on the folder afterwards.\n *\n * This is the set the update was asked to store, not an independent read of it:\n * `UpdateFolderWithFolderLevelPermissions` returns the permissions it derived from the input\n * rather than the ones the repository wrote. Treating it as a verification would let the tool\n * confirm its own request back to itself.\n */\n permissions: { target: string; level: string }[];\n /** True when the target already had a direct rule and its level was changed. */\n replacedExistingLevel?: string;\n}\n\nclass GrantFolderAccessToolHandlerImpl implements AiSdkToolHandler.Interface<Input> {\n constructor(\n private getFolder: GetFolderUseCase.Interface,\n private updateFolder: UpdateFolderUseCase.Interface,\n private listTeams: ListTeamsUseCase.Interface\n ) {}\n\n async execute(input: Input): Promise<GrantResult> {\n const loaded = await loadFolderPermissions(this.getFolder, input.folderId);\n\n await assertTargetIsUsable(this.listTeams, input.target, loaded.inheritedTargets);\n\n const existing = loaded.direct.find(\n permission => String(permission.target) === input.target\n );\n\n const permissions: FolderPermission[] = loaded.direct\n .filter(permission => String(permission.target) !== input.target)\n .concat([{ target: input.target, level: input.level } as FolderPermission]);\n\n const result = await this.updateFolder.execute(input.folderId, { permissions });\n\n if (result.isFail()) {\n throw new Error(`Could not grant access: ${result.error.message}`);\n }\n\n const folder = result.value;\n\n const granted: GrantResult = {\n folderId: folder.id,\n title: folder.title,\n path: folder.path,\n permissions: (folder.permissions ?? [])\n .filter(permission => !permission.inheritedFrom)\n .map(permission => ({ target: String(permission.target), level: permission.level }))\n };\n\n if (existing) {\n granted.replacedExistingLevel = existing.level;\n }\n\n return granted;\n }\n}\n\nconst GrantFolderAccessToolHandler = AiSdkToolHandler.createImplementation({\n implementation: GrantFolderAccessToolHandlerImpl,\n dependencies: [GetFolderUseCase, UpdateFolderUseCase, ListTeamsUseCase]\n});\n\n/**\n * Grants one target access to one folder, leaving every other rule alone.\n *\n * Additive by design. The earlier tool took the complete permission set and replaced it, which meant\n * approving a change showed what would be SET and said nothing about what would be removed — a rule\n * the model omitted disappeared silently. One target per call keeps the approval honest: what the user\n * sees in the plan is the whole change.\n */\nclass GrantFolderAccessToolImpl implements AiSdkToolDefinition.Interface<Input> {\n readonly name = \"grantFolderAccess\";\n readonly title = \"Grant folder access\";\n readonly description =\n \"Grants one team or user a level of access on one folder, leaving all other permissions untouched. Use listFolders for the folder id and listTeams for a team slug. Requires user approval.\";\n readonly inputSchema = inputSchema;\n readonly annotations = { readOnlyHint: false };\n readonly handler = GrantFolderAccessToolHandler;\n}\n\nexport const GrantFolderAccessTool = AiSdkToolDefinition.createImplementation({\n implementation: GrantFolderAccessToolImpl,\n dependencies: []\n});\n"],"names":["ACCESS_LEVELS","inputSchema","z","GrantFolderAccessToolHandlerImpl","getFolder","updateFolder","listTeams","input","loaded","loadFolderPermissions","assertTargetIsUsable","existing","permission","String","permissions","result","Error","folder","granted","GrantFolderAccessToolHandler","AiSdkToolHandler","GetFolderUseCase","UpdateFolderUseCase","ListTeamsUseCase","GrantFolderAccessToolImpl","GrantFolderAccessTool","AiSdkToolDefinition"],"mappings":";;;;;;;AASA,MAAMA,gBAAgB;IAAC;IAAS;IAAU;IAAU;IAAU;CAAY;AAE1E,MAAMC,cAAcC,EAAE,MAAM,CAAC;IACzB,UAAUA,EAAE,MAAM,GAAG,QAAQ,CAAC;IAC9B,QAAQA,EAAAA,MACG,GACN,QAAQ,CACL;IAER,OAAOA,CAAC,CAADA,OACE,CAACF,eACL,QAAQ,CACL;AAEZ;AAqBA,MAAMG;IACF,YACYC,SAAqC,EACrCC,YAA2C,EAC3CC,SAAqC,CAC/C;aAHUF,SAAS,GAATA;aACAC,YAAY,GAAZA;aACAC,SAAS,GAATA;IACT;IAEH,MAAM,QAAQC,KAAY,EAAwB;QAC9C,MAAMC,SAAS,MAAMC,sBAAsB,IAAI,CAAC,SAAS,EAAEF,MAAM,QAAQ;QAEzE,MAAMG,qBAAqB,IAAI,CAAC,SAAS,EAAEH,MAAM,MAAM,EAAEC,OAAO,gBAAgB;QAEhF,MAAMG,WAAWH,OAAO,MAAM,CAAC,IAAI,CAC/BI,CAAAA,aAAcC,OAAOD,WAAW,MAAM,MAAML,MAAM,MAAM;QAG5D,MAAMO,cAAkCN,OAAO,MAAM,CAChD,MAAM,CAACI,CAAAA,aAAcC,OAAOD,WAAW,MAAM,MAAML,MAAM,MAAM,EAC/D,MAAM,CAAC;YAAC;gBAAE,QAAQA,MAAM,MAAM;gBAAE,OAAOA,MAAM,KAAK;YAAC;SAAsB;QAE9E,MAAMQ,SAAS,MAAM,IAAI,CAAC,YAAY,CAAC,OAAO,CAACR,MAAM,QAAQ,EAAE;YAAEO;QAAY;QAE7E,IAAIC,OAAO,MAAM,IACb,MAAM,IAAIC,MAAM,CAAC,wBAAwB,EAAED,OAAO,KAAK,CAAC,OAAO,EAAE;QAGrE,MAAME,SAASF,OAAO,KAAK;QAE3B,MAAMG,UAAuB;YACzB,UAAUD,OAAO,EAAE;YACnB,OAAOA,OAAO,KAAK;YACnB,MAAMA,OAAO,IAAI;YACjB,aAAcA,AAAAA,CAAAA,OAAO,WAAW,IAAI,EAAC,EAChC,MAAM,CAACL,CAAAA,aAAc,CAACA,WAAW,aAAa,EAC9C,GAAG,CAACA,CAAAA,aAAe;oBAAE,QAAQC,OAAOD,WAAW,MAAM;oBAAG,OAAOA,WAAW,KAAK;gBAAC;QACzF;QAEA,IAAID,UACAO,QAAQ,qBAAqB,GAAGP,SAAS,KAAK;QAGlD,OAAOO;IACX;AACJ;AAEA,MAAMC,+BAA+BC,iBAAiB,oBAAoB,CAAC;IACvE,gBAAgBjB;IAChB,cAAc;QAACkB;QAAkBC;QAAqBC;KAAiB;AAC3E;AAUA,MAAMC;;aACO,IAAI,GAAG;aACP,KAAK,GAAG;aACR,WAAW,GAChB;aACK,WAAW,GAAGvB;aACd,WAAW,GAAG;YAAE,cAAc;QAAM;aACpC,OAAO,GAAGkB;;AACvB;AAEO,MAAMM,wBAAwBC,oBAAoB,oBAAoB,CAAC;IAC1E,gBAAgBF;IAChB,cAAc,EAAE;AACpB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import
|
|
2
|
+
import { AiSdkToolDefinition, AiSdkToolHandler } from "@webiny/api-core/features/ai/index.js";
|
|
3
3
|
import { ListFoldersUseCase } from "../../features/folder/ListFolders/index.js";
|
|
4
4
|
declare const inputSchema: z.ZodObject<{
|
|
5
5
|
type: z.ZodString;
|
|
@@ -17,12 +17,16 @@ interface FolderSummary {
|
|
|
17
17
|
inherited: boolean;
|
|
18
18
|
}[];
|
|
19
19
|
}
|
|
20
|
+
declare class ListFoldersToolHandlerImpl implements AiSdkToolHandler.Interface<Input> {
|
|
21
|
+
private listFolders;
|
|
22
|
+
constructor(listFolders: ListFoldersUseCase.Interface);
|
|
23
|
+
execute(input: Input): Promise<FolderSummary[]>;
|
|
24
|
+
}
|
|
20
25
|
/**
|
|
21
26
|
* Lists folders with their current access rules, so a permission change is proposed against a real
|
|
22
27
|
* folder id and the user can see what the access already is before approving a change to it.
|
|
23
28
|
*/
|
|
24
|
-
declare class ListFoldersToolImpl implements
|
|
25
|
-
private listFolders;
|
|
29
|
+
declare class ListFoldersToolImpl implements AiSdkToolDefinition.Interface<Input> {
|
|
26
30
|
readonly name = "listFolders";
|
|
27
31
|
readonly title = "List folders";
|
|
28
32
|
readonly description = "Lists folders of a given type with their ids, paths and current access permissions. Call this before changing folder permissions so the change targets a real folder.";
|
|
@@ -33,10 +37,11 @@ declare class ListFoldersToolImpl implements IAiSdkTool<Input> {
|
|
|
33
37
|
readOnlyHint: boolean;
|
|
34
38
|
idempotentHint: boolean;
|
|
35
39
|
};
|
|
36
|
-
|
|
37
|
-
|
|
40
|
+
readonly handler: typeof ListFoldersToolHandlerImpl & {
|
|
41
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/ai/abstractions").IAiSdkToolHandler<any>>;
|
|
42
|
+
};
|
|
38
43
|
}
|
|
39
44
|
export declare const ListFoldersTool: typeof ListFoldersToolImpl & {
|
|
40
|
-
__abstraction: import("@webiny/di").Abstraction<
|
|
45
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/ai/abstractions").IAiSdkToolDefinition<any>>;
|
|
41
46
|
};
|
|
42
47
|
export {};
|
|
@@ -1,20 +1,12 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import {
|
|
2
|
+
import { AiSdkToolDefinition, AiSdkToolHandler } from "@webiny/api-core/features/ai/index.js";
|
|
3
3
|
import { ListFoldersUseCase } from "../folder/ListFolders/index.js";
|
|
4
4
|
const inputSchema = z.object({
|
|
5
5
|
type: z.string().describe("Folder namespace, e.g. 'FmFile' for the file manager or 'cms:<modelId>' for a content model's folders.")
|
|
6
6
|
});
|
|
7
|
-
class
|
|
7
|
+
class ListFoldersToolHandlerImpl {
|
|
8
8
|
constructor(listFolders){
|
|
9
9
|
this.listFolders = listFolders;
|
|
10
|
-
this.name = "listFolders";
|
|
11
|
-
this.title = "List folders";
|
|
12
|
-
this.description = "Lists folders of a given type with their ids, paths and current access permissions. Call this before changing folder permissions so the change targets a real folder.";
|
|
13
|
-
this.inputSchema = inputSchema;
|
|
14
|
-
this.annotations = {
|
|
15
|
-
readOnlyHint: true,
|
|
16
|
-
idempotentHint: true
|
|
17
|
-
};
|
|
18
10
|
}
|
|
19
11
|
async execute(input) {
|
|
20
12
|
const result = await this.listFolders.execute({
|
|
@@ -37,12 +29,29 @@ class ListFoldersToolImpl {
|
|
|
37
29
|
}));
|
|
38
30
|
}
|
|
39
31
|
}
|
|
40
|
-
const
|
|
41
|
-
implementation:
|
|
32
|
+
const ListFoldersToolHandler = AiSdkToolHandler.createImplementation({
|
|
33
|
+
implementation: ListFoldersToolHandlerImpl,
|
|
42
34
|
dependencies: [
|
|
43
35
|
ListFoldersUseCase
|
|
44
36
|
]
|
|
45
37
|
});
|
|
38
|
+
class ListFoldersToolImpl {
|
|
39
|
+
constructor(){
|
|
40
|
+
this.name = "listFolders";
|
|
41
|
+
this.title = "List folders";
|
|
42
|
+
this.description = "Lists folders of a given type with their ids, paths and current access permissions. Call this before changing folder permissions so the change targets a real folder.";
|
|
43
|
+
this.inputSchema = inputSchema;
|
|
44
|
+
this.annotations = {
|
|
45
|
+
readOnlyHint: true,
|
|
46
|
+
idempotentHint: true
|
|
47
|
+
};
|
|
48
|
+
this.handler = ListFoldersToolHandler;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
const ListFoldersTool = AiSdkToolDefinition.createImplementation({
|
|
52
|
+
implementation: ListFoldersToolImpl,
|
|
53
|
+
dependencies: []
|
|
54
|
+
});
|
|
46
55
|
export { ListFoldersTool };
|
|
47
56
|
|
|
48
57
|
//# sourceMappingURL=ListFoldersTool.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"features/ai/ListFoldersTool.js","sources":["../../../src/features/ai/ListFoldersTool.ts"],"sourcesContent":["import { z } from \"zod\";\nimport {
|
|
1
|
+
{"version":3,"file":"features/ai/ListFoldersTool.js","sources":["../../../src/features/ai/ListFoldersTool.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { AiSdkToolDefinition, AiSdkToolHandler } from \"@webiny/api-core/features/ai/index.js\";\nimport { ListFoldersUseCase } from \"~/features/folder/ListFolders/index.js\";\n\nconst inputSchema = z.object({\n type: z\n .string()\n .describe(\n \"Folder namespace, e.g. 'FmFile' for the file manager or 'cms:<modelId>' for a content model's folders.\"\n )\n});\n\ntype Input = z.infer<typeof inputSchema>;\n\ninterface FolderSummary {\n id: string;\n title: string;\n slug: string;\n path: string;\n parentId?: string | null;\n permissions: { target: string; level: string; inherited: boolean }[];\n}\n\nclass ListFoldersToolHandlerImpl implements AiSdkToolHandler.Interface<Input> {\n constructor(private listFolders: ListFoldersUseCase.Interface) {}\n\n async execute(input: Input): Promise<FolderSummary[]> {\n const result = await this.listFolders.execute({ where: { type: input.type } });\n\n if (result.isFail()) {\n throw new Error(`Could not list folders: ${result.error.message}`);\n }\n\n return result.value.folders.map(folder => ({\n id: folder.id,\n title: folder.title,\n slug: folder.slug,\n path: folder.path,\n parentId: folder.parentId,\n permissions: (folder.permissions ?? []).map(permission => ({\n target: permission.target,\n level: permission.level,\n // Inherited rules cannot be edited on this folder — only on the ancestor that set them.\n inherited: Boolean(permission.inheritedFrom)\n }))\n }));\n }\n}\n\nconst ListFoldersToolHandler = AiSdkToolHandler.createImplementation({\n implementation: ListFoldersToolHandlerImpl,\n dependencies: [ListFoldersUseCase]\n});\n\n/**\n * Lists folders with their current access rules, so a permission change is proposed against a real\n * folder id and the user can see what the access already is before approving a change to it.\n */\nclass ListFoldersToolImpl implements AiSdkToolDefinition.Interface<Input> {\n readonly name = \"listFolders\";\n readonly title = \"List folders\";\n readonly description =\n \"Lists folders of a given type with their ids, paths and current access permissions. Call this before changing folder permissions so the change targets a real folder.\";\n readonly inputSchema = inputSchema;\n readonly annotations = { readOnlyHint: true, idempotentHint: true };\n readonly handler = ListFoldersToolHandler;\n}\n\nexport const ListFoldersTool = AiSdkToolDefinition.createImplementation({\n implementation: ListFoldersToolImpl,\n dependencies: []\n});\n"],"names":["inputSchema","z","ListFoldersToolHandlerImpl","listFolders","input","result","Error","folder","permission","Boolean","ListFoldersToolHandler","AiSdkToolHandler","ListFoldersUseCase","ListFoldersToolImpl","ListFoldersTool","AiSdkToolDefinition"],"mappings":";;;AAIA,MAAMA,cAAcC,EAAE,MAAM,CAAC;IACzB,MAAMA,EAAAA,MACK,GACN,QAAQ,CACL;AAEZ;AAaA,MAAMC;IACF,YAAoBC,WAAyC,CAAE;aAA3CA,WAAW,GAAXA;IAA4C;IAEhE,MAAM,QAAQC,KAAY,EAA4B;QAClD,MAAMC,SAAS,MAAM,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC;YAAE,OAAO;gBAAE,MAAMD,MAAM,IAAI;YAAC;QAAE;QAE5E,IAAIC,OAAO,MAAM,IACb,MAAM,IAAIC,MAAM,CAAC,wBAAwB,EAAED,OAAO,KAAK,CAAC,OAAO,EAAE;QAGrE,OAAOA,OAAO,KAAK,CAAC,OAAO,CAAC,GAAG,CAACE,CAAAA,SAAW;gBACvC,IAAIA,OAAO,EAAE;gBACb,OAAOA,OAAO,KAAK;gBACnB,MAAMA,OAAO,IAAI;gBACjB,MAAMA,OAAO,IAAI;gBACjB,UAAUA,OAAO,QAAQ;gBACzB,aAAcA,AAAAA,CAAAA,OAAO,WAAW,IAAI,EAAC,EAAG,GAAG,CAACC,CAAAA,aAAe;wBACvD,QAAQA,WAAW,MAAM;wBACzB,OAAOA,WAAW,KAAK;wBAEvB,WAAWC,QAAQD,WAAW,aAAa;oBAC/C;YACJ;IACJ;AACJ;AAEA,MAAME,yBAAyBC,iBAAiB,oBAAoB,CAAC;IACjE,gBAAgBT;IAChB,cAAc;QAACU;KAAmB;AACtC;AAMA,MAAMC;;aACO,IAAI,GAAG;aACP,KAAK,GAAG;aACR,WAAW,GAChB;aACK,WAAW,GAAGb;aACd,WAAW,GAAG;YAAE,cAAc;YAAM,gBAAgB;QAAK;aACzD,OAAO,GAAGU;;AACvB;AAEO,MAAMI,kBAAkBC,oBAAoB,oBAAoB,CAAC;IACpE,gBAAgBF;IAChB,cAAc,EAAE;AACpB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import
|
|
2
|
+
import { AiSdkToolDefinition, AiSdkToolHandler } from "@webiny/api-core/features/ai/index.js";
|
|
3
3
|
import { ListRolesUseCase } from "@webiny/api-core/features/security/roles/ListRoles/index.js";
|
|
4
4
|
interface RoleSummary {
|
|
5
5
|
id: string;
|
|
@@ -7,6 +7,11 @@ interface RoleSummary {
|
|
|
7
7
|
slug: string;
|
|
8
8
|
description?: string;
|
|
9
9
|
}
|
|
10
|
+
declare class ListRolesToolHandlerImpl implements AiSdkToolHandler.Interface<Record<string, never>> {
|
|
11
|
+
private listRoles;
|
|
12
|
+
constructor(listRoles: ListRolesUseCase.Interface);
|
|
13
|
+
execute(): Promise<RoleSummary[]>;
|
|
14
|
+
}
|
|
10
15
|
/**
|
|
11
16
|
* Resolves role names to the IDs `createTeam` takes. Separate from the write, so the user approves a
|
|
12
17
|
* team with roles that were looked up rather than guessed.
|
|
@@ -15,8 +20,7 @@ interface RoleSummary {
|
|
|
15
20
|
* `id` is what a team actually stores. Nothing at the type level separates the two, so `createTeam`
|
|
16
21
|
* accepts either and resolves it rather than making the caller guess which one that field wants.
|
|
17
22
|
*/
|
|
18
|
-
declare class ListRolesToolImpl implements
|
|
19
|
-
private listRoles;
|
|
23
|
+
declare class ListRolesToolImpl implements AiSdkToolDefinition.Interface<Record<string, never>> {
|
|
20
24
|
readonly name = "listRoles";
|
|
21
25
|
readonly title = "List roles";
|
|
22
26
|
readonly description = "Lists the security roles in this project. Call this before createTeam and pass the `id` of each role you want. A slug also works, but a value that is neither is rejected.";
|
|
@@ -25,10 +29,11 @@ declare class ListRolesToolImpl implements IAiSdkTool<Record<string, never>> {
|
|
|
25
29
|
readOnlyHint: boolean;
|
|
26
30
|
idempotentHint: boolean;
|
|
27
31
|
};
|
|
28
|
-
|
|
29
|
-
|
|
32
|
+
readonly handler: typeof ListRolesToolHandlerImpl & {
|
|
33
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/ai/abstractions").IAiSdkToolHandler<any>>;
|
|
34
|
+
};
|
|
30
35
|
}
|
|
31
36
|
export declare const ListRolesTool: typeof ListRolesToolImpl & {
|
|
32
|
-
__abstraction: import("@webiny/di").Abstraction<
|
|
37
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/ai/abstractions").IAiSdkToolDefinition<any>>;
|
|
33
38
|
};
|
|
34
39
|
export {};
|
|
@@ -1,18 +1,10 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import {
|
|
2
|
+
import { AiSdkToolDefinition, AiSdkToolHandler } from "@webiny/api-core/features/ai/index.js";
|
|
3
3
|
import { ListRolesUseCase } from "@webiny/api-core/features/security/roles/ListRoles/index.js";
|
|
4
4
|
const inputSchema = z.object({});
|
|
5
|
-
class
|
|
5
|
+
class ListRolesToolHandlerImpl {
|
|
6
6
|
constructor(listRoles){
|
|
7
7
|
this.listRoles = listRoles;
|
|
8
|
-
this.name = "listRoles";
|
|
9
|
-
this.title = "List roles";
|
|
10
|
-
this.description = "Lists the security roles in this project. Call this before createTeam and pass the `id` of each role you want. A slug also works, but a value that is neither is rejected.";
|
|
11
|
-
this.inputSchema = inputSchema;
|
|
12
|
-
this.annotations = {
|
|
13
|
-
readOnlyHint: true,
|
|
14
|
-
idempotentHint: true
|
|
15
|
-
};
|
|
16
8
|
}
|
|
17
9
|
async execute() {
|
|
18
10
|
const result = await this.listRoles.execute();
|
|
@@ -28,12 +20,29 @@ class ListRolesToolImpl {
|
|
|
28
20
|
});
|
|
29
21
|
}
|
|
30
22
|
}
|
|
31
|
-
const
|
|
32
|
-
implementation:
|
|
23
|
+
const ListRolesToolHandler = AiSdkToolHandler.createImplementation({
|
|
24
|
+
implementation: ListRolesToolHandlerImpl,
|
|
33
25
|
dependencies: [
|
|
34
26
|
ListRolesUseCase
|
|
35
27
|
]
|
|
36
28
|
});
|
|
29
|
+
class ListRolesToolImpl {
|
|
30
|
+
constructor(){
|
|
31
|
+
this.name = "listRoles";
|
|
32
|
+
this.title = "List roles";
|
|
33
|
+
this.description = "Lists the security roles in this project. Call this before createTeam and pass the `id` of each role you want. A slug also works, but a value that is neither is rejected.";
|
|
34
|
+
this.inputSchema = inputSchema;
|
|
35
|
+
this.annotations = {
|
|
36
|
+
readOnlyHint: true,
|
|
37
|
+
idempotentHint: true
|
|
38
|
+
};
|
|
39
|
+
this.handler = ListRolesToolHandler;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
const ListRolesTool = AiSdkToolDefinition.createImplementation({
|
|
43
|
+
implementation: ListRolesToolImpl,
|
|
44
|
+
dependencies: []
|
|
45
|
+
});
|
|
37
46
|
export { ListRolesTool };
|
|
38
47
|
|
|
39
48
|
//# sourceMappingURL=ListRolesTool.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"features/ai/ListRolesTool.js","sources":["../../../src/features/ai/ListRolesTool.ts"],"sourcesContent":["import { z } from \"zod\";\nimport {
|
|
1
|
+
{"version":3,"file":"features/ai/ListRolesTool.js","sources":["../../../src/features/ai/ListRolesTool.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { AiSdkToolDefinition, AiSdkToolHandler } from \"@webiny/api-core/features/ai/index.js\";\nimport { ListRolesUseCase } from \"@webiny/api-core/features/security/roles/ListRoles/index.js\";\n\nconst inputSchema = z.object({});\n\ninterface RoleSummary {\n id: string;\n name: string;\n slug: string;\n description?: string;\n}\n\nclass ListRolesToolHandlerImpl implements AiSdkToolHandler.Interface<Record<string, never>> {\n constructor(private listRoles: ListRolesUseCase.Interface) {}\n\n async execute(): Promise<RoleSummary[]> {\n const result = await this.listRoles.execute();\n\n if (result.isFail()) {\n throw new Error(`Could not list roles: ${result.error.message}`);\n }\n\n return result.value.map(role => {\n const summary: RoleSummary = {\n id: role.id,\n name: role.name,\n slug: role.slug\n };\n\n if (role.description) {\n summary.description = role.description;\n }\n\n return summary;\n });\n }\n}\n\nconst ListRolesToolHandler = AiSdkToolHandler.createImplementation({\n implementation: ListRolesToolHandlerImpl,\n dependencies: [ListRolesUseCase]\n});\n\n/**\n * Resolves role names to the IDs `createTeam` takes. Separate from the write, so the user approves a\n * team with roles that were looked up rather than guessed.\n *\n * Returns the slug too, because it is what a human recognises and what the admin UI shows, while\n * `id` is what a team actually stores. Nothing at the type level separates the two, so `createTeam`\n * accepts either and resolves it rather than making the caller guess which one that field wants.\n */\nclass ListRolesToolImpl implements AiSdkToolDefinition.Interface<Record<string, never>> {\n readonly name = \"listRoles\";\n readonly title = \"List roles\";\n readonly description =\n \"Lists the security roles in this project. Call this before createTeam and pass the `id` of each role you want. A slug also works, but a value that is neither is rejected.\";\n readonly inputSchema = inputSchema;\n readonly annotations = { readOnlyHint: true, idempotentHint: true };\n readonly handler = ListRolesToolHandler;\n}\n\nexport const ListRolesTool = AiSdkToolDefinition.createImplementation({\n implementation: ListRolesToolImpl,\n dependencies: []\n});\n"],"names":["inputSchema","z","ListRolesToolHandlerImpl","listRoles","result","Error","role","summary","ListRolesToolHandler","AiSdkToolHandler","ListRolesUseCase","ListRolesToolImpl","ListRolesTool","AiSdkToolDefinition"],"mappings":";;;AAIA,MAAMA,cAAcC,EAAE,MAAM,CAAC,CAAC;AAS9B,MAAMC;IACF,YAAoBC,SAAqC,CAAE;aAAvCA,SAAS,GAATA;IAAwC;IAE5D,MAAM,UAAkC;QACpC,MAAMC,SAAS,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO;QAE3C,IAAIA,OAAO,MAAM,IACb,MAAM,IAAIC,MAAM,CAAC,sBAAsB,EAAED,OAAO,KAAK,CAAC,OAAO,EAAE;QAGnE,OAAOA,OAAO,KAAK,CAAC,GAAG,CAACE,CAAAA;YACpB,MAAMC,UAAuB;gBACzB,IAAID,KAAK,EAAE;gBACX,MAAMA,KAAK,IAAI;gBACf,MAAMA,KAAK,IAAI;YACnB;YAEA,IAAIA,KAAK,WAAW,EAChBC,QAAQ,WAAW,GAAGD,KAAK,WAAW;YAG1C,OAAOC;QACX;IACJ;AACJ;AAEA,MAAMC,uBAAuBC,iBAAiB,oBAAoB,CAAC;IAC/D,gBAAgBP;IAChB,cAAc;QAACQ;KAAiB;AACpC;AAUA,MAAMC;;aACO,IAAI,GAAG;aACP,KAAK,GAAG;aACR,WAAW,GAChB;aACK,WAAW,GAAGX;aACd,WAAW,GAAG;YAAE,cAAc;YAAM,gBAAgB;QAAK;aACzD,OAAO,GAAGQ;;AACvB;AAEO,MAAMI,gBAAgBC,oBAAoB,oBAAoB,CAAC;IAClE,gBAAgBF;IAChB,cAAc,EAAE;AACpB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import
|
|
2
|
+
import { AiSdkToolDefinition, AiSdkToolHandler } from "@webiny/api-core/features/ai/index.js";
|
|
3
3
|
import { ListTeamsUseCase } from "@webiny/api-core/features/security/teams/ListTeams/index.js";
|
|
4
4
|
declare const inputSchema: z.ZodObject<{}, z.core.$strip>;
|
|
5
5
|
type Input = z.infer<typeof inputSchema>;
|
|
@@ -9,14 +9,18 @@ interface TeamSummary {
|
|
|
9
9
|
slug: string;
|
|
10
10
|
description?: string;
|
|
11
11
|
}
|
|
12
|
+
declare class ListTeamsToolHandlerImpl implements AiSdkToolHandler.Interface<Input> {
|
|
13
|
+
private listTeams;
|
|
14
|
+
constructor(listTeams: ListTeamsUseCase.Interface);
|
|
15
|
+
execute(): Promise<TeamSummary[]>;
|
|
16
|
+
}
|
|
12
17
|
/**
|
|
13
18
|
* Resolves human names ("team A") to the ids folder permissions actually take.
|
|
14
19
|
*
|
|
15
20
|
* Kept separate from setFolderPermissions rather than accepting a team name there: the user approves
|
|
16
21
|
* the arguments of a write, so the id has to be looked up and shown, not guessed inside the write.
|
|
17
22
|
*/
|
|
18
|
-
declare class ListTeamsToolImpl implements
|
|
19
|
-
private listTeams;
|
|
23
|
+
declare class ListTeamsToolImpl implements AiSdkToolDefinition.Interface<Input> {
|
|
20
24
|
readonly name = "listTeams";
|
|
21
25
|
readonly title = "List teams";
|
|
22
26
|
readonly description = "Lists the teams in this project with their ids, names and slugs. Folder permission targets use the SLUG (`team:<slug>`), not the id.";
|
|
@@ -25,10 +29,11 @@ declare class ListTeamsToolImpl implements IAiSdkTool<Input> {
|
|
|
25
29
|
readOnlyHint: boolean;
|
|
26
30
|
idempotentHint: boolean;
|
|
27
31
|
};
|
|
28
|
-
|
|
29
|
-
|
|
32
|
+
readonly handler: typeof ListTeamsToolHandlerImpl & {
|
|
33
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/ai/abstractions").IAiSdkToolHandler<any>>;
|
|
34
|
+
};
|
|
30
35
|
}
|
|
31
36
|
export declare const ListTeamsTool: typeof ListTeamsToolImpl & {
|
|
32
|
-
__abstraction: import("@webiny/di").Abstraction<
|
|
37
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/ai/abstractions").IAiSdkToolDefinition<any>>;
|
|
33
38
|
};
|
|
34
39
|
export {};
|
|
@@ -1,18 +1,10 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import {
|
|
2
|
+
import { AiSdkToolDefinition, AiSdkToolHandler } from "@webiny/api-core/features/ai/index.js";
|
|
3
3
|
import { ListTeamsUseCase } from "@webiny/api-core/features/security/teams/ListTeams/index.js";
|
|
4
4
|
const inputSchema = z.object({});
|
|
5
|
-
class
|
|
5
|
+
class ListTeamsToolHandlerImpl {
|
|
6
6
|
constructor(listTeams){
|
|
7
7
|
this.listTeams = listTeams;
|
|
8
|
-
this.name = "listTeams";
|
|
9
|
-
this.title = "List teams";
|
|
10
|
-
this.description = "Lists the teams in this project with their ids, names and slugs. Folder permission targets use the SLUG (`team:<slug>`), not the id.";
|
|
11
|
-
this.inputSchema = inputSchema;
|
|
12
|
-
this.annotations = {
|
|
13
|
-
readOnlyHint: true,
|
|
14
|
-
idempotentHint: true
|
|
15
|
-
};
|
|
16
8
|
}
|
|
17
9
|
async execute() {
|
|
18
10
|
const result = await this.listTeams.execute();
|
|
@@ -28,12 +20,29 @@ class ListTeamsToolImpl {
|
|
|
28
20
|
});
|
|
29
21
|
}
|
|
30
22
|
}
|
|
31
|
-
const
|
|
32
|
-
implementation:
|
|
23
|
+
const ListTeamsToolHandler = AiSdkToolHandler.createImplementation({
|
|
24
|
+
implementation: ListTeamsToolHandlerImpl,
|
|
33
25
|
dependencies: [
|
|
34
26
|
ListTeamsUseCase
|
|
35
27
|
]
|
|
36
28
|
});
|
|
29
|
+
class ListTeamsToolImpl {
|
|
30
|
+
constructor(){
|
|
31
|
+
this.name = "listTeams";
|
|
32
|
+
this.title = "List teams";
|
|
33
|
+
this.description = "Lists the teams in this project with their ids, names and slugs. Folder permission targets use the SLUG (`team:<slug>`), not the id.";
|
|
34
|
+
this.inputSchema = inputSchema;
|
|
35
|
+
this.annotations = {
|
|
36
|
+
readOnlyHint: true,
|
|
37
|
+
idempotentHint: true
|
|
38
|
+
};
|
|
39
|
+
this.handler = ListTeamsToolHandler;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
const ListTeamsTool = AiSdkToolDefinition.createImplementation({
|
|
43
|
+
implementation: ListTeamsToolImpl,
|
|
44
|
+
dependencies: []
|
|
45
|
+
});
|
|
37
46
|
export { ListTeamsTool };
|
|
38
47
|
|
|
39
48
|
//# sourceMappingURL=ListTeamsTool.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"features/ai/ListTeamsTool.js","sources":["../../../src/features/ai/ListTeamsTool.ts"],"sourcesContent":["import { z } from \"zod\";\nimport {
|
|
1
|
+
{"version":3,"file":"features/ai/ListTeamsTool.js","sources":["../../../src/features/ai/ListTeamsTool.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { AiSdkToolDefinition, AiSdkToolHandler } from \"@webiny/api-core/features/ai/index.js\";\nimport { ListTeamsUseCase } from \"@webiny/api-core/features/security/teams/ListTeams/index.js\";\n\nconst inputSchema = z.object({});\n\ntype Input = z.infer<typeof inputSchema>;\n\ninterface TeamSummary {\n id: string;\n name: string;\n slug: string;\n description?: string;\n}\n\nclass ListTeamsToolHandlerImpl implements AiSdkToolHandler.Interface<Input> {\n constructor(private listTeams: ListTeamsUseCase.Interface) {}\n\n async execute(): Promise<TeamSummary[]> {\n const result = await this.listTeams.execute();\n\n if (result.isFail()) {\n throw new Error(`Could not list teams: ${result.error.message}`);\n }\n\n return result.value.map(team => {\n const summary: TeamSummary = {\n id: team.id,\n name: team.name,\n slug: team.slug\n };\n\n if (team.description) {\n summary.description = team.description;\n }\n\n return summary;\n });\n }\n}\n\nconst ListTeamsToolHandler = AiSdkToolHandler.createImplementation({\n implementation: ListTeamsToolHandlerImpl,\n dependencies: [ListTeamsUseCase]\n});\n\n/**\n * Resolves human names (\"team A\") to the ids folder permissions actually take.\n *\n * Kept separate from setFolderPermissions rather than accepting a team name there: the user approves\n * the arguments of a write, so the id has to be looked up and shown, not guessed inside the write.\n */\nclass ListTeamsToolImpl implements AiSdkToolDefinition.Interface<Input> {\n readonly name = \"listTeams\";\n readonly title = \"List teams\";\n readonly description =\n \"Lists the teams in this project with their ids, names and slugs. Folder permission targets use the SLUG (`team:<slug>`), not the id.\";\n readonly inputSchema = inputSchema;\n readonly annotations = { readOnlyHint: true, idempotentHint: true };\n readonly handler = ListTeamsToolHandler;\n}\n\nexport const ListTeamsTool = AiSdkToolDefinition.createImplementation({\n implementation: ListTeamsToolImpl,\n dependencies: []\n});\n"],"names":["inputSchema","z","ListTeamsToolHandlerImpl","listTeams","result","Error","team","summary","ListTeamsToolHandler","AiSdkToolHandler","ListTeamsUseCase","ListTeamsToolImpl","ListTeamsTool","AiSdkToolDefinition"],"mappings":";;;AAIA,MAAMA,cAAcC,EAAE,MAAM,CAAC,CAAC;AAW9B,MAAMC;IACF,YAAoBC,SAAqC,CAAE;aAAvCA,SAAS,GAATA;IAAwC;IAE5D,MAAM,UAAkC;QACpC,MAAMC,SAAS,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO;QAE3C,IAAIA,OAAO,MAAM,IACb,MAAM,IAAIC,MAAM,CAAC,sBAAsB,EAAED,OAAO,KAAK,CAAC,OAAO,EAAE;QAGnE,OAAOA,OAAO,KAAK,CAAC,GAAG,CAACE,CAAAA;YACpB,MAAMC,UAAuB;gBACzB,IAAID,KAAK,EAAE;gBACX,MAAMA,KAAK,IAAI;gBACf,MAAMA,KAAK,IAAI;YACnB;YAEA,IAAIA,KAAK,WAAW,EAChBC,QAAQ,WAAW,GAAGD,KAAK,WAAW;YAG1C,OAAOC;QACX;IACJ;AACJ;AAEA,MAAMC,uBAAuBC,iBAAiB,oBAAoB,CAAC;IAC/D,gBAAgBP;IAChB,cAAc;QAACQ;KAAiB;AACpC;AAQA,MAAMC;;aACO,IAAI,GAAG;aACP,KAAK,GAAG;aACR,WAAW,GAChB;aACK,WAAW,GAAGX;aACd,WAAW,GAAG;YAAE,cAAc;YAAM,gBAAgB;QAAK;aACzD,OAAO,GAAGQ;;AACvB;AAEO,MAAMI,gBAAgBC,oBAAoB,oBAAoB,CAAC;IAClE,gBAAgBF;IAChB,cAAc,EAAE;AACpB"}
|