@webiny/api-aco 0.0.0-unstable.aad28a72ae → 0.0.0-unstable.ac6ebf63c6
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/README.md +6 -13
- package/constants.d.ts +2 -0
- package/constants.js +4 -0
- package/constants.js.map +1 -0
- package/createAcoContext.d.ts +9 -0
- package/createAcoContext.js +141 -0
- package/createAcoContext.js.map +1 -0
- package/createAcoGraphQL.d.ts +4 -0
- package/createAcoGraphQL.js +111 -0
- package/createAcoGraphQL.js.map +1 -0
- package/createAcoStorageOperations.d.ts +12 -0
- package/createAcoStorageOperations.js +10 -0
- package/createAcoStorageOperations.js.map +1 -0
- package/createAcoTasks.d.ts +1 -0
- package/createAcoTasks.js +15 -0
- package/createAcoTasks.js.map +1 -0
- package/domain/folder/abstractions.d.ts +9 -0
- package/domain/folder/abstractions.js +8 -0
- package/domain/folder/abstractions.js.map +1 -0
- package/domain/folder/errors.d.ts +29 -0
- package/domain/folder/errors.js +56 -0
- package/domain/folder/errors.js.map +1 -0
- package/domain/folder/folder.model.d.ts +9 -0
- package/domain/folder/folder.model.js +42 -0
- package/domain/folder/folder.model.js.map +1 -0
- package/features/cms/decorators/CreateEntryRevisionFromWithFlpDecorator.d.ts +13 -0
- package/features/cms/decorators/CreateEntryRevisionFromWithFlpDecorator.js +43 -0
- package/features/cms/decorators/CreateEntryRevisionFromWithFlpDecorator.js.map +1 -0
- package/features/cms/decorators/CreateEntryWithFlpDecorator.d.ts +12 -0
- package/features/cms/decorators/CreateEntryWithFlpDecorator.js +36 -0
- package/features/cms/decorators/CreateEntryWithFlpDecorator.js.map +1 -0
- package/features/cms/decorators/DeleteEntryRevisionWithFlpDecorator.d.ts +13 -0
- package/features/cms/decorators/DeleteEntryRevisionWithFlpDecorator.js +43 -0
- package/features/cms/decorators/DeleteEntryRevisionWithFlpDecorator.js.map +1 -0
- package/features/cms/decorators/DeleteEntryWithFlpDecorator.d.ts +13 -0
- package/features/cms/decorators/DeleteEntryWithFlpDecorator.js +45 -0
- package/features/cms/decorators/DeleteEntryWithFlpDecorator.js.map +1 -0
- package/features/cms/decorators/GetEntryByIdWithFlpDecorator.d.ts +12 -0
- package/features/cms/decorators/GetEntryByIdWithFlpDecorator.js +41 -0
- package/features/cms/decorators/GetEntryByIdWithFlpDecorator.js.map +1 -0
- package/features/cms/decorators/GetEntryWithFlpDecorator.d.ts +12 -0
- package/features/cms/decorators/GetEntryWithFlpDecorator.js +41 -0
- package/features/cms/decorators/GetEntryWithFlpDecorator.js.map +1 -0
- package/features/cms/decorators/GetLatestEntriesByIdsWithFlpDecorator.d.ts +13 -0
- package/features/cms/decorators/GetLatestEntriesByIdsWithFlpDecorator.js +45 -0
- package/features/cms/decorators/GetLatestEntriesByIdsWithFlpDecorator.js.map +1 -0
- package/features/cms/decorators/GetPublishedEntriesByIdsWithFlpDecorator.d.ts +13 -0
- package/features/cms/decorators/GetPublishedEntriesByIdsWithFlpDecorator.js +44 -0
- package/features/cms/decorators/GetPublishedEntriesByIdsWithFlpDecorator.js.map +1 -0
- package/features/cms/decorators/ListDeletedEntriesWithFlpDecorator.d.ts +11 -0
- package/features/cms/decorators/ListDeletedEntriesWithFlpDecorator.js +36 -0
- package/features/cms/decorators/ListDeletedEntriesWithFlpDecorator.js.map +1 -0
- package/features/cms/decorators/ListEntriesWithFlpDecorator.d.ts +11 -0
- package/features/cms/decorators/ListEntriesWithFlpDecorator.js +35 -0
- package/features/cms/decorators/ListEntriesWithFlpDecorator.js.map +1 -0
- package/features/cms/decorators/ListLatestEntriesWithFlpDecorator.d.ts +11 -0
- package/features/cms/decorators/ListLatestEntriesWithFlpDecorator.js +36 -0
- package/features/cms/decorators/ListLatestEntriesWithFlpDecorator.js.map +1 -0
- package/features/cms/decorators/ListPublishedEntriesWithFlpDecorator.d.ts +11 -0
- package/features/cms/decorators/ListPublishedEntriesWithFlpDecorator.js +36 -0
- package/features/cms/decorators/ListPublishedEntriesWithFlpDecorator.js.map +1 -0
- package/features/cms/decorators/MoveEntryWithFlpDecorator.d.ts +15 -0
- package/features/cms/decorators/MoveEntryWithFlpDecorator.js +63 -0
- package/features/cms/decorators/MoveEntryWithFlpDecorator.js.map +1 -0
- package/features/cms/decorators/UpdateEntryWithFlpDecorator.d.ts +15 -0
- package/features/cms/decorators/UpdateEntryWithFlpDecorator.js +43 -0
- package/features/cms/decorators/UpdateEntryWithFlpDecorator.js.map +1 -0
- package/features/cms/feature.d.ts +1 -0
- package/features/cms/feature.js +43 -0
- package/features/cms/feature.js.map +1 -0
- package/features/cms/index.d.ts +1 -0
- package/features/cms/index.js +3 -0
- package/features/cms/index.js.map +1 -0
- package/features/flp/CreateFlp/CreateFlpUseCase.d.ts +8 -0
- package/features/flp/CreateFlp/CreateFlpUseCase.js +41 -0
- package/features/flp/CreateFlp/CreateFlpUseCase.js.map +1 -0
- package/features/flp/CreateFlp/abstractions.d.ts +8 -0
- package/features/flp/CreateFlp/abstractions.js +7 -0
- package/features/flp/CreateFlp/abstractions.js.map +1 -0
- package/features/flp/CreateFlp/feature.d.ts +6 -0
- package/features/flp/CreateFlp/feature.js +13 -0
- package/features/flp/CreateFlp/feature.js.map +1 -0
- package/features/flp/CreateFlp/index.d.ts +2 -0
- package/features/flp/CreateFlp/index.js +4 -0
- package/features/flp/CreateFlp/index.js.map +1 -0
- package/features/flp/CreateFlpOnFolderCreated/CreateFlpOnFolderCreatedHandler.d.ts +14 -0
- package/features/flp/CreateFlpOnFolderCreated/CreateFlpOnFolderCreatedHandler.js +37 -0
- package/features/flp/CreateFlpOnFolderCreated/CreateFlpOnFolderCreatedHandler.js.map +1 -0
- package/features/flp/CreateFlpOnFolderCreated/feature.d.ts +1 -0
- package/features/flp/CreateFlpOnFolderCreated/feature.js +10 -0
- package/features/flp/CreateFlpOnFolderCreated/feature.js.map +1 -0
- package/features/flp/CreateFlpOnFolderCreated/index.d.ts +1 -0
- package/features/flp/CreateFlpOnFolderCreated/index.js +3 -0
- package/features/flp/CreateFlpOnFolderCreated/index.js.map +1 -0
- package/features/flp/DeleteFlp/DeleteFlpUseCase.d.ts +8 -0
- package/features/flp/DeleteFlp/DeleteFlpUseCase.js +23 -0
- package/features/flp/DeleteFlp/DeleteFlpUseCase.js.map +1 -0
- package/features/flp/DeleteFlp/abstractions.d.ts +8 -0
- package/features/flp/DeleteFlp/abstractions.js +7 -0
- package/features/flp/DeleteFlp/abstractions.js.map +1 -0
- package/features/flp/DeleteFlp/feature.d.ts +6 -0
- package/features/flp/DeleteFlp/feature.js +13 -0
- package/features/flp/DeleteFlp/feature.js.map +1 -0
- package/features/flp/DeleteFlp/index.d.ts +2 -0
- package/features/flp/DeleteFlp/index.js +4 -0
- package/features/flp/DeleteFlp/index.js.map +1 -0
- package/features/flp/DeleteFlpOnFolderDeleted/DeleteFlpOnFolderDeletedHandler.d.ts +14 -0
- package/features/flp/DeleteFlpOnFolderDeleted/DeleteFlpOnFolderDeletedHandler.js +37 -0
- package/features/flp/DeleteFlpOnFolderDeleted/DeleteFlpOnFolderDeletedHandler.js.map +1 -0
- package/features/flp/DeleteFlpOnFolderDeleted/feature.d.ts +1 -0
- package/features/flp/DeleteFlpOnFolderDeleted/feature.js +10 -0
- package/features/flp/DeleteFlpOnFolderDeleted/feature.js.map +1 -0
- package/features/flp/DeleteFlpOnFolderDeleted/index.d.ts +1 -0
- package/features/flp/DeleteFlpOnFolderDeleted/index.js +3 -0
- package/features/flp/DeleteFlpOnFolderDeleted/index.js.map +1 -0
- package/features/flp/FolderLevelPermissions/FolderLevelPermissions.d.ts +35 -0
- package/features/flp/FolderLevelPermissions/FolderLevelPermissions.js +133 -0
- package/features/flp/FolderLevelPermissions/FolderLevelPermissions.js.map +1 -0
- package/features/flp/FolderLevelPermissions/abstractions.d.ts +25 -0
- package/features/flp/FolderLevelPermissions/abstractions.js +4 -0
- package/features/flp/FolderLevelPermissions/abstractions.js.map +1 -0
- package/features/flp/FolderLevelPermissions/feature.d.ts +1 -0
- package/features/flp/FolderLevelPermissions/feature.js +10 -0
- package/features/flp/FolderLevelPermissions/feature.js.map +1 -0
- package/features/flp/FolderLevelPermissions/index.d.ts +2 -0
- package/features/flp/FolderLevelPermissions/index.js +4 -0
- package/features/flp/FolderLevelPermissions/index.js.map +1 -0
- package/features/flp/FolderLevelPermissions/useCases/CanAccessFolder/CanAccessFolder.d.ts +7 -0
- package/features/flp/FolderLevelPermissions/useCases/CanAccessFolder/CanAccessFolder.js +41 -0
- package/features/flp/FolderLevelPermissions/useCases/CanAccessFolder/CanAccessFolder.js.map +1 -0
- package/features/flp/FolderLevelPermissions/useCases/CanAccessFolder/ICanAccessFolder.d.ts +9 -0
- package/features/flp/FolderLevelPermissions/useCases/CanAccessFolder/ICanAccessFolder.js +3 -0
- package/features/flp/FolderLevelPermissions/useCases/CanAccessFolder/ICanAccessFolder.js.map +1 -0
- package/features/flp/FolderLevelPermissions/useCases/CanAccessFolder/index.d.ts +2 -0
- package/features/flp/FolderLevelPermissions/useCases/CanAccessFolder/index.js +3 -0
- package/features/flp/FolderLevelPermissions/useCases/CanAccessFolder/index.js.map +1 -0
- package/features/flp/FolderLevelPermissions/useCases/CanAccessFolderContent/CanAccessFolderContent.d.ts +7 -0
- package/features/flp/FolderLevelPermissions/useCases/CanAccessFolderContent/CanAccessFolderContent.js +34 -0
- package/features/flp/FolderLevelPermissions/useCases/CanAccessFolderContent/CanAccessFolderContent.js.map +1 -0
- package/features/flp/FolderLevelPermissions/useCases/CanAccessFolderContent/ICanAccessFolderContent.d.ts +8 -0
- package/features/flp/FolderLevelPermissions/useCases/CanAccessFolderContent/ICanAccessFolderContent.js +3 -0
- package/features/flp/FolderLevelPermissions/useCases/CanAccessFolderContent/ICanAccessFolderContent.js.map +1 -0
- package/features/flp/FolderLevelPermissions/useCases/CanAccessFolderContent/index.d.ts +2 -0
- package/features/flp/FolderLevelPermissions/useCases/CanAccessFolderContent/index.js +3 -0
- package/features/flp/FolderLevelPermissions/useCases/CanAccessFolderContent/index.js.map +1 -0
- package/features/flp/FolderLevelPermissions/useCases/CanCreateFolderInRoot/CanCreateFolderInRoot.d.ts +4 -0
- package/features/flp/FolderLevelPermissions/useCases/CanCreateFolderInRoot/CanCreateFolderInRoot.js +7 -0
- package/features/flp/FolderLevelPermissions/useCases/CanCreateFolderInRoot/CanCreateFolderInRoot.js.map +1 -0
- package/features/flp/FolderLevelPermissions/useCases/CanCreateFolderInRoot/ICanCreateFolderInRoot.d.ts +3 -0
- package/features/flp/FolderLevelPermissions/useCases/CanCreateFolderInRoot/ICanCreateFolderInRoot.js +3 -0
- package/features/flp/FolderLevelPermissions/useCases/CanCreateFolderInRoot/ICanCreateFolderInRoot.js.map +1 -0
- package/features/flp/FolderLevelPermissions/useCases/CanCreateFolderInRoot/index.d.ts +2 -0
- package/features/flp/FolderLevelPermissions/useCases/CanCreateFolderInRoot/index.js +3 -0
- package/features/flp/FolderLevelPermissions/useCases/CanCreateFolderInRoot/index.js.map +1 -0
- package/features/flp/FolderLevelPermissions/useCases/CheckNotInheritedPermissions/CheckNotInheritedPermissions.d.ts +5 -0
- package/features/flp/FolderLevelPermissions/useCases/CheckNotInheritedPermissions/CheckNotInheritedPermissions.js +7 -0
- package/features/flp/FolderLevelPermissions/useCases/CheckNotInheritedPermissions/CheckNotInheritedPermissions.js.map +1 -0
- package/features/flp/FolderLevelPermissions/useCases/CheckNotInheritedPermissions/ICheckNotInheritedPermissions.d.ts +4 -0
- package/features/flp/FolderLevelPermissions/useCases/CheckNotInheritedPermissions/ICheckNotInheritedPermissions.js +3 -0
- package/features/flp/FolderLevelPermissions/useCases/CheckNotInheritedPermissions/ICheckNotInheritedPermissions.js.map +1 -0
- package/features/flp/FolderLevelPermissions/useCases/CheckNotInheritedPermissions/index.d.ts +2 -0
- package/features/flp/FolderLevelPermissions/useCases/CheckNotInheritedPermissions/index.js +3 -0
- package/features/flp/FolderLevelPermissions/useCases/CheckNotInheritedPermissions/index.js.map +1 -0
- package/features/flp/FolderLevelPermissions/useCases/GetDefaultPermissions/DefaultPermissionsMerger.d.ts +5 -0
- package/features/flp/FolderLevelPermissions/useCases/GetDefaultPermissions/DefaultPermissionsMerger.js +70 -0
- package/features/flp/FolderLevelPermissions/useCases/GetDefaultPermissions/DefaultPermissionsMerger.js.map +1 -0
- package/features/flp/FolderLevelPermissions/useCases/GetDefaultPermissions/GetDefaultPermissions.d.ts +8 -0
- package/features/flp/FolderLevelPermissions/useCases/GetDefaultPermissions/GetDefaultPermissions.js +13 -0
- package/features/flp/FolderLevelPermissions/useCases/GetDefaultPermissions/GetDefaultPermissions.js.map +1 -0
- package/features/flp/FolderLevelPermissions/useCases/GetDefaultPermissions/GetDefaultPermissionsWithTeams.d.ts +11 -0
- package/features/flp/FolderLevelPermissions/useCases/GetDefaultPermissions/GetDefaultPermissionsWithTeams.js +38 -0
- package/features/flp/FolderLevelPermissions/useCases/GetDefaultPermissions/GetDefaultPermissionsWithTeams.js.map +1 -0
- package/features/flp/FolderLevelPermissions/useCases/GetDefaultPermissions/IGetDefaultPermissions.d.ts +4 -0
- package/features/flp/FolderLevelPermissions/useCases/GetDefaultPermissions/IGetDefaultPermissions.js +3 -0
- package/features/flp/FolderLevelPermissions/useCases/GetDefaultPermissions/IGetDefaultPermissions.js.map +1 -0
- package/features/flp/FolderLevelPermissions/useCases/GetDefaultPermissions/index.d.ts +3 -0
- package/features/flp/FolderLevelPermissions/useCases/GetDefaultPermissions/index.js +4 -0
- package/features/flp/FolderLevelPermissions/useCases/GetDefaultPermissions/index.js.map +1 -0
- package/features/flp/FolderLevelPermissions/useCases/index.d.ts +5 -0
- package/features/flp/FolderLevelPermissions/useCases/index.js +7 -0
- package/features/flp/FolderLevelPermissions/useCases/index.js.map +1 -0
- package/features/flp/GetFlp/GetFlpUseCase.d.ts +7 -0
- package/features/flp/GetFlp/GetFlpUseCase.js +10 -0
- package/features/flp/GetFlp/GetFlpUseCase.js.map +1 -0
- package/features/flp/GetFlp/abstractions.d.ts +8 -0
- package/features/flp/GetFlp/abstractions.js +4 -0
- package/features/flp/GetFlp/abstractions.js.map +1 -0
- package/features/flp/GetFlp/feature.d.ts +1 -0
- package/features/flp/GetFlp/feature.js +13 -0
- package/features/flp/GetFlp/feature.js.map +1 -0
- package/features/flp/GetFlp/index.d.ts +1 -0
- package/features/flp/GetFlp/index.js +3 -0
- package/features/flp/GetFlp/index.js.map +1 -0
- package/features/flp/ListFlps/ListFlpsUseCase.d.ts +7 -0
- package/features/flp/ListFlps/ListFlpsUseCase.js +10 -0
- package/features/flp/ListFlps/ListFlpsUseCase.js.map +1 -0
- package/features/flp/ListFlps/abstractions.d.ts +16 -0
- package/features/flp/ListFlps/abstractions.js +4 -0
- package/features/flp/ListFlps/abstractions.js.map +1 -0
- package/features/flp/ListFlps/feature.d.ts +1 -0
- package/features/flp/ListFlps/feature.js +13 -0
- package/features/flp/ListFlps/feature.js.map +1 -0
- package/features/flp/ListFlps/index.d.ts +1 -0
- package/features/flp/ListFlps/index.js +3 -0
- package/features/flp/ListFlps/index.js.map +1 -0
- package/features/flp/UpdateFlp/UpdateFlpUseCase.d.ts +19 -0
- package/features/flp/UpdateFlp/UpdateFlpUseCase.js +203 -0
- package/features/flp/UpdateFlp/UpdateFlpUseCase.js.map +1 -0
- package/features/flp/UpdateFlp/abstractions.d.ts +14 -0
- package/features/flp/UpdateFlp/abstractions.js +7 -0
- package/features/flp/UpdateFlp/abstractions.js.map +1 -0
- package/features/flp/UpdateFlp/feature.d.ts +6 -0
- package/features/flp/UpdateFlp/feature.js +13 -0
- package/features/flp/UpdateFlp/feature.js.map +1 -0
- package/features/flp/UpdateFlp/index.d.ts +2 -0
- package/features/flp/UpdateFlp/index.js +4 -0
- package/features/flp/UpdateFlp/index.js.map +1 -0
- package/features/flp/UpdateFlpOnFolderUpdated/UpdateFlpOnFolderUpdatedHandler.d.ts +14 -0
- package/features/flp/UpdateFlpOnFolderUpdated/UpdateFlpOnFolderUpdatedHandler.js +39 -0
- package/features/flp/UpdateFlpOnFolderUpdated/UpdateFlpOnFolderUpdatedHandler.js.map +1 -0
- package/features/flp/UpdateFlpOnFolderUpdated/feature.d.ts +1 -0
- package/features/flp/UpdateFlpOnFolderUpdated/feature.js +10 -0
- package/features/flp/UpdateFlpOnFolderUpdated/feature.js.map +1 -0
- package/features/flp/UpdateFlpOnFolderUpdated/index.d.ts +1 -0
- package/features/flp/UpdateFlpOnFolderUpdated/index.js +3 -0
- package/features/flp/UpdateFlpOnFolderUpdated/index.js.map +1 -0
- package/features/folder/CreateFolder/CreateFolderRepository.d.ts +21 -0
- package/features/folder/CreateFolder/CreateFolderRepository.js +108 -0
- package/features/folder/CreateFolder/CreateFolderRepository.js.map +1 -0
- package/features/folder/CreateFolder/CreateFolderUseCase.d.ts +12 -0
- package/features/folder/CreateFolder/CreateFolderUseCase.js +39 -0
- package/features/folder/CreateFolder/CreateFolderUseCase.js.map +1 -0
- package/features/folder/CreateFolder/abstractions.d.ts +55 -0
- package/features/folder/CreateFolder/abstractions.js +21 -0
- package/features/folder/CreateFolder/abstractions.js.map +1 -0
- package/features/folder/CreateFolder/decorators/CreateFolderWithFolderLevelPermissions.d.ts +11 -0
- package/features/folder/CreateFolder/decorators/CreateFolderWithFolderLevelPermissions.js +44 -0
- package/features/folder/CreateFolder/decorators/CreateFolderWithFolderLevelPermissions.js.map +1 -0
- package/features/folder/CreateFolder/events.d.ts +10 -0
- package/features/folder/CreateFolder/events.js +19 -0
- package/features/folder/CreateFolder/events.js.map +1 -0
- package/features/folder/CreateFolder/feature.d.ts +1 -0
- package/features/folder/CreateFolder/feature.js +14 -0
- package/features/folder/CreateFolder/feature.js.map +1 -0
- package/features/folder/CreateFolder/index.d.ts +2 -0
- package/features/folder/CreateFolder/index.js +4 -0
- package/features/folder/CreateFolder/index.js.map +1 -0
- package/features/folder/DeleteFolder/DeleteFolderRepository.d.ts +15 -0
- package/features/folder/DeleteFolder/DeleteFolderRepository.js +30 -0
- package/features/folder/DeleteFolder/DeleteFolderRepository.js.map +1 -0
- package/features/folder/DeleteFolder/DeleteFolderUseCase.d.ts +13 -0
- package/features/folder/DeleteFolder/DeleteFolderUseCase.js +55 -0
- package/features/folder/DeleteFolder/DeleteFolderUseCase.js.map +1 -0
- package/features/folder/DeleteFolder/abstractions.d.ts +55 -0
- package/features/folder/DeleteFolder/abstractions.js +21 -0
- package/features/folder/DeleteFolder/abstractions.js.map +1 -0
- package/features/folder/DeleteFolder/decorators/DeleteFolderWithFolderLevelPermissions.d.ts +11 -0
- package/features/folder/DeleteFolder/decorators/DeleteFolderWithFolderLevelPermissions.js +28 -0
- package/features/folder/DeleteFolder/decorators/DeleteFolderWithFolderLevelPermissions.js.map +1 -0
- package/features/folder/DeleteFolder/events.d.ts +10 -0
- package/features/folder/DeleteFolder/events.js +19 -0
- package/features/folder/DeleteFolder/events.js.map +1 -0
- package/features/folder/DeleteFolder/feature.d.ts +1 -0
- package/features/folder/DeleteFolder/feature.js +14 -0
- package/features/folder/DeleteFolder/feature.js.map +1 -0
- package/features/folder/DeleteFolder/index.d.ts +2 -0
- package/features/folder/DeleteFolder/index.js +4 -0
- package/features/folder/DeleteFolder/index.js.map +1 -0
- package/features/folder/EnsureFolderIsEmpty/EnsureFolderIsEmpty.d.ts +15 -0
- package/features/folder/EnsureFolderIsEmpty/EnsureFolderIsEmpty.js +56 -0
- package/features/folder/EnsureFolderIsEmpty/EnsureFolderIsEmpty.js.map +1 -0
- package/features/folder/EnsureFolderIsEmpty/abstractions.d.ts +20 -0
- package/features/folder/EnsureFolderIsEmpty/abstractions.js +4 -0
- package/features/folder/EnsureFolderIsEmpty/abstractions.js.map +1 -0
- package/features/folder/EnsureFolderIsEmpty/feature.d.ts +1 -0
- package/features/folder/EnsureFolderIsEmpty/feature.js +10 -0
- package/features/folder/EnsureFolderIsEmpty/feature.js.map +1 -0
- package/features/folder/EnsureFolderIsEmpty/index.d.ts +1 -0
- package/features/folder/EnsureFolderIsEmpty/index.js +3 -0
- package/features/folder/EnsureFolderIsEmpty/index.js.map +1 -0
- package/features/folder/EnsureFolderIsEmptyOnDelete/GenericFolderBeforeDeleteHandler.d.ts +12 -0
- package/features/folder/EnsureFolderIsEmptyOnDelete/GenericFolderBeforeDeleteHandler.js +29 -0
- package/features/folder/EnsureFolderIsEmptyOnDelete/GenericFolderBeforeDeleteHandler.js.map +1 -0
- package/features/folder/EnsureFolderIsEmptyOnDelete/feature.d.ts +7 -0
- package/features/folder/EnsureFolderIsEmptyOnDelete/feature.js +17 -0
- package/features/folder/EnsureFolderIsEmptyOnDelete/feature.js.map +1 -0
- package/features/folder/EnsureFolderIsEmptyOnDelete/index.d.ts +1 -0
- package/features/folder/EnsureFolderIsEmptyOnDelete/index.js +3 -0
- package/features/folder/EnsureFolderIsEmptyOnDelete/index.js.map +1 -0
- package/features/folder/EnsureHcmsFolderIsEmptyOnDelete/ModelFolderBeforeDeleteHandler.d.ts +16 -0
- package/features/folder/EnsureHcmsFolderIsEmptyOnDelete/ModelFolderBeforeDeleteHandler.js +56 -0
- package/features/folder/EnsureHcmsFolderIsEmptyOnDelete/ModelFolderBeforeDeleteHandler.js.map +1 -0
- package/features/folder/EnsureHcmsFolderIsEmptyOnDelete/feature.d.ts +1 -0
- package/features/folder/EnsureHcmsFolderIsEmptyOnDelete/feature.js +10 -0
- package/features/folder/EnsureHcmsFolderIsEmptyOnDelete/feature.js.map +1 -0
- package/features/folder/EnsureHcmsFolderIsEmptyOnDelete/index.d.ts +1 -0
- package/features/folder/EnsureHcmsFolderIsEmptyOnDelete/index.js +3 -0
- package/features/folder/EnsureHcmsFolderIsEmptyOnDelete/index.js.map +1 -0
- package/features/folder/GetAncestors/GetAncestorsRepository.d.ts +15 -0
- package/features/folder/GetAncestors/GetAncestorsRepository.js +88 -0
- package/features/folder/GetAncestors/GetAncestorsRepository.js.map +1 -0
- package/features/folder/GetAncestors/GetAncestorsUseCase.d.ts +10 -0
- package/features/folder/GetAncestors/GetAncestorsUseCase.js +17 -0
- package/features/folder/GetAncestors/GetAncestorsUseCase.js.map +1 -0
- package/features/folder/GetAncestors/abstractions.d.ts +38 -0
- package/features/folder/GetAncestors/abstractions.js +15 -0
- package/features/folder/GetAncestors/abstractions.js.map +1 -0
- package/features/folder/GetAncestors/feature.d.ts +1 -0
- package/features/folder/GetAncestors/feature.js +12 -0
- package/features/folder/GetAncestors/feature.js.map +1 -0
- package/features/folder/GetAncestors/index.d.ts +2 -0
- package/features/folder/GetAncestors/index.js +4 -0
- package/features/folder/GetAncestors/index.js.map +1 -0
- package/features/folder/GetFolder/GetFolderRepository.d.ts +15 -0
- package/features/folder/GetFolder/GetFolderRepository.js +31 -0
- package/features/folder/GetFolder/GetFolderRepository.js.map +1 -0
- package/features/folder/GetFolder/GetFolderUseCase.d.ts +10 -0
- package/features/folder/GetFolder/GetFolderUseCase.js +17 -0
- package/features/folder/GetFolder/GetFolderUseCase.js.map +1 -0
- package/features/folder/GetFolder/abstractions.d.ts +54 -0
- package/features/folder/GetFolder/abstractions.js +21 -0
- package/features/folder/GetFolder/abstractions.js.map +1 -0
- package/features/folder/GetFolder/decorators/GetFolderWithFolderLevelPermissions.d.ts +29 -0
- package/features/folder/GetFolder/decorators/GetFolderWithFolderLevelPermissions.js +37 -0
- package/features/folder/GetFolder/decorators/GetFolderWithFolderLevelPermissions.js.map +1 -0
- package/features/folder/GetFolder/feature.d.ts +1 -0
- package/features/folder/GetFolder/feature.js +14 -0
- package/features/folder/GetFolder/feature.js.map +1 -0
- package/features/folder/GetFolder/index.d.ts +2 -0
- package/features/folder/GetFolder/index.js +4 -0
- package/features/folder/GetFolder/index.js.map +1 -0
- package/features/folder/GetFolderHierarchy/GetFolderHierarchyRepository.d.ts +18 -0
- package/features/folder/GetFolderHierarchy/GetFolderHierarchyRepository.js +103 -0
- package/features/folder/GetFolderHierarchy/GetFolderHierarchyRepository.js.map +1 -0
- package/features/folder/GetFolderHierarchy/GetFolderHierarchyUseCase.d.ts +10 -0
- package/features/folder/GetFolderHierarchy/GetFolderHierarchyUseCase.js +17 -0
- package/features/folder/GetFolderHierarchy/GetFolderHierarchyUseCase.js.map +1 -0
- package/features/folder/GetFolderHierarchy/abstractions.d.ts +36 -0
- package/features/folder/GetFolderHierarchy/abstractions.js +15 -0
- package/features/folder/GetFolderHierarchy/abstractions.js.map +1 -0
- package/features/folder/GetFolderHierarchy/decorators/GetFolderHierarchyWithFolderLevelPermissions.d.ts +16 -0
- package/features/folder/GetFolderHierarchy/decorators/GetFolderHierarchyWithFolderLevelPermissions.js +64 -0
- package/features/folder/GetFolderHierarchy/decorators/GetFolderHierarchyWithFolderLevelPermissions.js.map +1 -0
- package/features/folder/GetFolderHierarchy/feature.d.ts +1 -0
- package/features/folder/GetFolderHierarchy/feature.js +14 -0
- package/features/folder/GetFolderHierarchy/feature.js.map +1 -0
- package/features/folder/GetFolderHierarchy/index.d.ts +2 -0
- package/features/folder/GetFolderHierarchy/index.js +4 -0
- package/features/folder/GetFolderHierarchy/index.js.map +1 -0
- package/features/folder/ListFolderLevelPermissionsTargets/ListFolderLevelPermissionsTargetsUseCase.d.ts +13 -0
- package/features/folder/ListFolderLevelPermissionsTargets/ListFolderLevelPermissionsTargetsUseCase.js +68 -0
- package/features/folder/ListFolderLevelPermissionsTargets/ListFolderLevelPermissionsTargetsUseCase.js.map +1 -0
- package/features/folder/ListFolderLevelPermissionsTargets/abstractions.d.ts +10 -0
- package/features/folder/ListFolderLevelPermissionsTargets/abstractions.js +7 -0
- package/features/folder/ListFolderLevelPermissionsTargets/abstractions.js.map +1 -0
- package/features/folder/ListFolderLevelPermissionsTargets/feature.d.ts +1 -0
- package/features/folder/ListFolderLevelPermissionsTargets/feature.js +10 -0
- package/features/folder/ListFolderLevelPermissionsTargets/feature.js.map +1 -0
- package/features/folder/ListFolderLevelPermissionsTargets/index.d.ts +1 -0
- package/features/folder/ListFolderLevelPermissionsTargets/index.js +3 -0
- package/features/folder/ListFolderLevelPermissionsTargets/index.js.map +1 -0
- package/features/folder/ListFolders/ListFoldersRepository.d.ts +17 -0
- package/features/folder/ListFolders/ListFoldersRepository.js +54 -0
- package/features/folder/ListFolders/ListFoldersRepository.js.map +1 -0
- package/features/folder/ListFolders/ListFoldersUseCase.d.ts +9 -0
- package/features/folder/ListFolders/ListFoldersUseCase.js +17 -0
- package/features/folder/ListFolders/ListFoldersUseCase.js.map +1 -0
- package/features/folder/ListFolders/abstractions.d.ts +42 -0
- package/features/folder/ListFolders/abstractions.js +15 -0
- package/features/folder/ListFolders/abstractions.js.map +1 -0
- package/features/folder/ListFolders/decorators/ListFoldersWithFolderLevelPermissions.d.ts +17 -0
- package/features/folder/ListFolders/decorators/ListFoldersWithFolderLevelPermissions.js +77 -0
- package/features/folder/ListFolders/decorators/ListFoldersWithFolderLevelPermissions.js.map +1 -0
- package/features/folder/ListFolders/feature.d.ts +1 -0
- package/features/folder/ListFolders/feature.js +14 -0
- package/features/folder/ListFolders/feature.js.map +1 -0
- package/features/folder/ListFolders/index.d.ts +2 -0
- package/features/folder/ListFolders/index.js +4 -0
- package/features/folder/ListFolders/index.js.map +1 -0
- package/features/folder/UpdateFolder/UpdateFolderRepository.d.ts +21 -0
- package/features/folder/UpdateFolder/UpdateFolderRepository.js +110 -0
- package/features/folder/UpdateFolder/UpdateFolderRepository.js.map +1 -0
- package/features/folder/UpdateFolder/UpdateFolderUseCase.d.ts +14 -0
- package/features/folder/UpdateFolder/UpdateFolderUseCase.js +55 -0
- package/features/folder/UpdateFolder/UpdateFolderUseCase.js.map +1 -0
- package/features/folder/UpdateFolder/abstractions.d.ts +60 -0
- package/features/folder/UpdateFolder/abstractions.js +21 -0
- package/features/folder/UpdateFolder/abstractions.js.map +1 -0
- package/features/folder/UpdateFolder/decorators/UpdateFolderWithFolderLevelPermissions.d.ts +13 -0
- package/features/folder/UpdateFolder/decorators/UpdateFolderWithFolderLevelPermissions.js +77 -0
- package/features/folder/UpdateFolder/decorators/UpdateFolderWithFolderLevelPermissions.js.map +1 -0
- package/features/folder/UpdateFolder/events.d.ts +10 -0
- package/features/folder/UpdateFolder/events.js +19 -0
- package/features/folder/UpdateFolder/events.js.map +1 -0
- package/features/folder/UpdateFolder/feature.d.ts +1 -0
- package/features/folder/UpdateFolder/feature.js +14 -0
- package/features/folder/UpdateFolder/feature.js.map +1 -0
- package/features/folder/UpdateFolder/index.d.ts +2 -0
- package/features/folder/UpdateFolder/index.js +4 -0
- package/features/folder/UpdateFolder/index.js.map +1 -0
- package/features/folder/shared/EntryToFolderMapper.d.ts +5 -0
- package/features/folder/shared/EntryToFolderMapper.js +22 -0
- package/features/folder/shared/EntryToFolderMapper.js.map +1 -0
- package/features/folder/shared/abstractions.d.ts +5 -0
- package/features/folder/shared/abstractions.js +4 -0
- package/features/folder/shared/abstractions.js.map +1 -0
- package/filter/filter.crud.d.ts +3 -0
- package/filter/filter.crud.js +33 -0
- package/filter/filter.crud.js.map +1 -0
- package/filter/filter.gql.d.ts +3 -0
- package/filter/filter.gql.js +146 -0
- package/filter/filter.gql.js.map +1 -0
- package/filter/filter.model.d.ts +9 -0
- package/filter/filter.model.js +41 -0
- package/filter/filter.model.js.map +1 -0
- package/filter/filter.so.d.ts +3 -0
- package/filter/filter.so.js +104 -0
- package/filter/filter.so.js.map +1 -0
- package/filter/filter.types.d.ts +67 -0
- package/filter/filter.types.js +7 -0
- package/filter/filter.types.js.map +1 -0
- package/flp/flp.crud.d.ts +7 -0
- package/flp/flp.crud.js +91 -0
- package/flp/flp.crud.js.map +1 -0
- package/flp/flp.so.d.ts +20 -0
- package/flp/flp.so.js +220 -0
- package/flp/flp.so.js.map +1 -0
- package/flp/flp.types.d.ts +93 -0
- package/flp/flp.types.js +3 -0
- package/flp/flp.types.js.map +1 -0
- package/flp/index.d.ts +3 -0
- package/flp/index.js +5 -0
- package/flp/index.js.map +1 -0
- package/flp/tasks/createFlp.task.d.ts +16 -0
- package/flp/tasks/createFlp.task.js +35 -0
- package/flp/tasks/createFlp.task.js.map +1 -0
- package/flp/tasks/deleteFlp.task.d.ts +16 -0
- package/flp/tasks/deleteFlp.task.js +35 -0
- package/flp/tasks/deleteFlp.task.js.map +1 -0
- package/flp/tasks/index.d.ts +5 -0
- package/flp/tasks/index.js +19 -0
- package/flp/tasks/index.js.map +1 -0
- package/flp/tasks/syncFlp.task.d.ts +20 -0
- package/flp/tasks/syncFlp.task.js +127 -0
- package/flp/tasks/syncFlp.task.js.map +1 -0
- package/flp/tasks/updateFlp.task.d.ts +16 -0
- package/flp/tasks/updateFlp.task.js +40 -0
- package/flp/tasks/updateFlp.task.js.map +1 -0
- package/folder/createFolderModelModifier.d.ts +36 -0
- package/folder/createFolderModelModifier.js +61 -0
- package/folder/createFolderModelModifier.js.map +1 -0
- package/folder/createFolderTypeDefs.d.ts +7 -0
- package/folder/createFolderTypeDefs.js +186 -0
- package/folder/createFolderTypeDefs.js.map +1 -0
- package/folder/folder.gql.d.ts +4 -0
- package/folder/folder.gql.js +152 -0
- package/folder/folder.gql.js.map +1 -0
- package/folder/folder.types.d.ts +76 -0
- package/folder/folder.types.js +3 -0
- package/folder/folder.types.js.map +1 -0
- package/index.d.ts +7 -8
- package/index.js +8 -69
- package/index.js.map +1 -1
- package/package.json +44 -33
- package/types.d.ts +42 -207
- package/types.js +7 -4
- package/types.js.map +1 -1
- package/utils/FoldersCacheFactory.d.ts +10 -0
- package/utils/FoldersCacheFactory.js +24 -0
- package/utils/FoldersCacheFactory.js.map +1 -0
- package/utils/ListCache.d.ts +23 -0
- package/utils/ListCache.js +23 -0
- package/utils/ListCache.js.map +1 -0
- package/utils/Path.d.ts +3 -0
- package/utils/Path.js +11 -0
- package/utils/Path.js.map +1 -0
- package/utils/acoRecordId.d.ts +6 -0
- package/utils/acoRecordId.js +27 -0
- package/utils/acoRecordId.js.map +1 -0
- package/utils/compress.d.ts +4 -0
- package/utils/compress.js +12 -0
- package/utils/compress.js.map +1 -0
- package/utils/createListSort.d.ts +3 -0
- package/utils/createListSort.js +10 -0
- package/utils/createListSort.js.map +1 -0
- package/utils/createOperationsWrapper.d.ts +9 -0
- package/utils/createOperationsWrapper.js +22 -0
- package/utils/createOperationsWrapper.js.map +1 -0
- package/utils/decorators/CmsEntriesCrudDecorators.d.ts +11 -0
- package/utils/decorators/CmsEntriesCrudDecorators.js +206 -0
- package/utils/decorators/CmsEntriesCrudDecorators.js.map +1 -0
- package/utils/decorators/FilterEntriesByFolderFactory.d.ts +7 -0
- package/utils/decorators/FilterEntriesByFolderFactory.js +23 -0
- package/utils/decorators/FilterEntriesByFolderFactory.js.map +1 -0
- package/utils/decorators/ListEntriesFactory.d.ts +17 -0
- package/utils/decorators/ListEntriesFactory.js +106 -0
- package/utils/decorators/ListEntriesFactory.js.map +1 -0
- package/utils/decorators/hasRootFolderId.d.ts +7 -0
- package/utils/decorators/hasRootFolderId.js +19 -0
- package/utils/decorators/hasRootFolderId.js.map +1 -0
- package/utils/decorators/isPageModel.d.ts +5 -0
- package/utils/decorators/isPageModel.js +13 -0
- package/utils/decorators/isPageModel.js.map +1 -0
- package/utils/ensureAuthentication.d.ts +2 -0
- package/utils/ensureAuthentication.js +12 -0
- package/utils/ensureAuthentication.js.map +1 -0
- package/utils/pickEntryFieldValues.d.ts +3 -0
- package/utils/pickEntryFieldValues.js +23 -0
- package/utils/pickEntryFieldValues.js.map +1 -0
- package/utils/resolve.d.ts +2 -0
- package/utils/resolve.js +10 -0
- package/utils/resolve.js.map +1 -0
- package/context/folders.d.ts +0 -2
- package/context/folders.js +0 -261
- package/context/folders.js.map +0 -1
- package/context/index.d.ts +0 -2
- package/context/index.js +0 -22
- package/context/index.js.map +0 -1
- package/context/links.d.ts +0 -2
- package/context/links.js +0 -270
- package/context/links.js.map +0 -1
- package/graphql/base.gql.d.ts +0 -3
- package/graphql/base.gql.js +0 -63
- package/graphql/base.gql.js.map +0 -1
- package/graphql/folders.gql.d.ts +0 -3
- package/graphql/folders.gql.js +0 -126
- package/graphql/folders.gql.js.map +0 -1
- package/graphql/index.d.ts +0 -1
- package/graphql/index.js +0 -15
- package/graphql/index.js.map +0 -1
- package/graphql/links.gql.d.ts +0 -3
- package/graphql/links.gql.js +0 -123
- package/graphql/links.gql.js.map +0 -1
- package/subscriptions/afterFolderDelete.d.ts +0 -3
- package/subscriptions/afterFolderDelete.js +0 -62
- package/subscriptions/afterFolderDelete.js.map +0 -1
- package/subscriptions/index.d.ts +0 -3
- package/subscriptions/index.js +0 -14
- package/subscriptions/index.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,18 +1,11 @@
|
|
|
1
1
|
# @webiny/api-aco
|
|
2
2
|
|
|
3
|
-
[!
|
|
4
|
-
[
|
|
5
|
-
|
|
6
|
-
[](http://makeapullrequest.com)
|
|
3
|
+
> [!NOTE]
|
|
4
|
+
> This package is part of the [Webiny](https://www.webiny.com) monorepo.
|
|
5
|
+
> It’s **included in every Webiny project by default** and is not meant to be used as a standalone package.
|
|
7
6
|
|
|
8
|
-
|
|
7
|
+
📘 **Documentation:** [https://www.webiny.com/docs](https://www.webiny.com/docs)
|
|
9
8
|
|
|
10
|
-
|
|
11
|
-
npm install --save @webiny/api-aco
|
|
12
|
-
```
|
|
9
|
+
---
|
|
13
10
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
```
|
|
17
|
-
yarn add @webiny/api-aco
|
|
18
|
-
```
|
|
11
|
+
_This README file is automatically generated during the publish process._
|
package/constants.d.ts
ADDED
package/constants.js
ADDED
package/constants.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["FM_FILE_TYPE"],"sources":["constants.ts"],"sourcesContent":["export * from \"@webiny/shared-aco\";\nexport const FM_FILE_TYPE = \"FmFile\";\n"],"mappings":"AAAA,cAAc,oBAAoB;AAClC,OAAO,MAAMA,YAAY,GAAG,QAAQ","ignoreList":[]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ContextPlugin } from "@webiny/api";
|
|
2
|
+
import type { DynamoDBDocument } from "@webiny/aws-sdk/client-dynamodb/index.js";
|
|
3
|
+
import type { AcoContext } from "./types.js";
|
|
4
|
+
interface CreateAcoContextParams {
|
|
5
|
+
useFolderLevelPermissions?: boolean;
|
|
6
|
+
documentClient: DynamoDBDocument;
|
|
7
|
+
}
|
|
8
|
+
export declare const createAcoContext: (params: CreateAcoContextParams) => ContextPlugin<AcoContext>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { ContextPlugin } from "@webiny/api";
|
|
2
|
+
import { isHeadlessCmsReady } from "@webiny/api-headless-cms";
|
|
3
|
+
import { createAcoStorageOperations } from "./createAcoStorageOperations.js";
|
|
4
|
+
import { createFilterCrudMethods } from "./filter/filter.crud.js";
|
|
5
|
+
import { createFlpCrudMethods } from "./flp/index.js";
|
|
6
|
+
import { FolderLevelPermissions, FolderLevelPermissionsFeature } from "./features/flp/FolderLevelPermissions/index.js";
|
|
7
|
+
import { UpdateFolderFeature } from "./features/folder/UpdateFolder/index.js";
|
|
8
|
+
import { DeleteFolderFeature } from "./features/folder/DeleteFolder/index.js";
|
|
9
|
+
import { CreateFolderFeature } from "./features/folder/CreateFolder/index.js";
|
|
10
|
+
import { GetFolderFeature } from "./features/folder/GetFolder/index.js";
|
|
11
|
+
import { ListFoldersFeature } from "./features/folder/ListFolders/index.js";
|
|
12
|
+
import { GetFolderHierarchyFeature } from "./features/folder/GetFolderHierarchy/index.js";
|
|
13
|
+
import { GetAncestorsFeature } from "./features/folder/GetAncestors/index.js";
|
|
14
|
+
import { UpdateFlpOnFolderUpdatedFeature } from "./features/flp/UpdateFlpOnFolderUpdated/index.js";
|
|
15
|
+
import { DeleteFlpOnFolderDeletedFeature } from "./features/flp/DeleteFlpOnFolderDeleted/index.js";
|
|
16
|
+
import { EnsureHcmsFolderIsEmptyOnDeleteFeature } from "./features/folder/EnsureHcmsFolderIsEmptyOnDelete/index.js";
|
|
17
|
+
import { CreateFlpFeature } from "./features/flp/CreateFlp/index.js";
|
|
18
|
+
import { DeleteFlpFeature } from "./features/flp/DeleteFlp/index.js";
|
|
19
|
+
import { UpdateFlpFeature } from "./features/flp/UpdateFlp/index.js";
|
|
20
|
+
import { EnsureFolderIsEmptyOnDeleteFeature } from "./features/folder/EnsureFolderIsEmptyOnDelete/index.js";
|
|
21
|
+
import { FilterStorageOperations } from "./features/folder/shared/abstractions.js";
|
|
22
|
+
import { ListFlpsFeature } from "./features/flp/ListFlps/feature.js";
|
|
23
|
+
import { GetFlpFeature } from "./features/flp/GetFlp/feature.js";
|
|
24
|
+
import { ListFolderLevelPermissionsTargetsFeature } from "./features/folder/ListFolderLevelPermissionsTargets/feature.js";
|
|
25
|
+
import { CmsFlpFeature } from "./features/cms/index.js";
|
|
26
|
+
import { GetModelUseCase } from "@webiny/api-headless-cms/features/contentModel/GetModel/index.js";
|
|
27
|
+
import { FolderModel as FolderModelAbstraction } from "./domain/folder/abstractions.js";
|
|
28
|
+
import { CreateFlpOnFolderCreatedFeature } from "./features/flp/CreateFlpOnFolderCreated/index.js";
|
|
29
|
+
import { EnsureFolderIsEmptyFeature } from "./features/folder/EnsureFolderIsEmpty/feature.js";
|
|
30
|
+
import { FOLDER_MODEL_ID, FolderModel } from "./domain/folder/folder.model.js";
|
|
31
|
+
import { FilterPrivateModel } from "./filter/filter.model.js";
|
|
32
|
+
const setupAcoContext = async (context, setupAcoContextParams) => {
|
|
33
|
+
const {
|
|
34
|
+
tenancy,
|
|
35
|
+
security
|
|
36
|
+
} = context;
|
|
37
|
+
context.container.register(FolderModel);
|
|
38
|
+
context.container.register(FilterPrivateModel);
|
|
39
|
+
const getModel = context.container.resolve(GetModelUseCase);
|
|
40
|
+
await context.security.withoutAuthorization(async () => {
|
|
41
|
+
const folderModel = await getModel.execute(FOLDER_MODEL_ID);
|
|
42
|
+
context.container.registerInstance(FolderModelAbstraction, folderModel.value);
|
|
43
|
+
});
|
|
44
|
+
const getTenant = () => {
|
|
45
|
+
return tenancy.getCurrentTenant();
|
|
46
|
+
};
|
|
47
|
+
const storageOperations = await createAcoStorageOperations({
|
|
48
|
+
/**
|
|
49
|
+
* TODO: We need to figure out a way to pass "cms" from outside (e.g. apps/api/graphql)
|
|
50
|
+
*/
|
|
51
|
+
cms: context.cms,
|
|
52
|
+
container: context.container,
|
|
53
|
+
documentClient: setupAcoContextParams.documentClient,
|
|
54
|
+
security
|
|
55
|
+
});
|
|
56
|
+
const flpCrudMethods = createFlpCrudMethods({
|
|
57
|
+
getTenant,
|
|
58
|
+
storageOperations
|
|
59
|
+
});
|
|
60
|
+
FolderLevelPermissionsFeature.register(context.container);
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Register legacy dependencies via abstractions
|
|
64
|
+
*/
|
|
65
|
+
context.container.registerInstance(FilterStorageOperations, storageOperations.filter);
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Register folder features into DI container
|
|
69
|
+
*/
|
|
70
|
+
CreateFolderFeature.register(context.container);
|
|
71
|
+
UpdateFolderFeature.register(context.container);
|
|
72
|
+
DeleteFolderFeature.register(context.container);
|
|
73
|
+
GetFolderFeature.register(context.container);
|
|
74
|
+
ListFoldersFeature.register(context.container);
|
|
75
|
+
ListFolderLevelPermissionsTargetsFeature.register(context.container);
|
|
76
|
+
GetFolderHierarchyFeature.register(context.container);
|
|
77
|
+
GetAncestorsFeature.register(context.container);
|
|
78
|
+
EnsureFolderIsEmptyFeature.register(context.container);
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Register FLP use cases and event handlers
|
|
82
|
+
*/
|
|
83
|
+
CreateFlpFeature.register(context.container, {
|
|
84
|
+
context
|
|
85
|
+
});
|
|
86
|
+
UpdateFlpFeature.register(context.container, {
|
|
87
|
+
context
|
|
88
|
+
});
|
|
89
|
+
DeleteFlpFeature.register(context.container, {
|
|
90
|
+
context
|
|
91
|
+
});
|
|
92
|
+
ListFlpsFeature.register(context.container, flpCrudMethods);
|
|
93
|
+
GetFlpFeature.register(context.container, flpCrudMethods);
|
|
94
|
+
CreateFlpOnFolderCreatedFeature.register(context.container);
|
|
95
|
+
UpdateFlpOnFolderUpdatedFeature.register(context.container, {
|
|
96
|
+
tasks: context.tasks
|
|
97
|
+
});
|
|
98
|
+
DeleteFlpOnFolderDeletedFeature.register(context.container, {
|
|
99
|
+
tasks: context.tasks
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Register folder event handlers
|
|
104
|
+
*/
|
|
105
|
+
EnsureFolderIsEmptyOnDeleteFeature.register(context.container);
|
|
106
|
+
EnsureHcmsFolderIsEmptyOnDeleteFeature.register(context.container);
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Setup legacy context
|
|
110
|
+
*/
|
|
111
|
+
const folderLevelPermissions = context.container.resolve(FolderLevelPermissions);
|
|
112
|
+
context.aco = {
|
|
113
|
+
filter: createFilterCrudMethods({
|
|
114
|
+
container: context.container,
|
|
115
|
+
getTenant,
|
|
116
|
+
storageOperations,
|
|
117
|
+
folderLevelPermissions
|
|
118
|
+
}),
|
|
119
|
+
flp: flpCrudMethods
|
|
120
|
+
};
|
|
121
|
+
if (context.wcp.canUseFolderLevelPermissions()) {
|
|
122
|
+
CmsFlpFeature.register(context.container);
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
export const createAcoContext = params => {
|
|
126
|
+
const plugin = new ContextPlugin(async context => {
|
|
127
|
+
/**
|
|
128
|
+
* We can skip the ACO initialization if the installation is pending.
|
|
129
|
+
*/
|
|
130
|
+
if (!(await isHeadlessCmsReady(context))) {
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
await context.benchmark.measure("aco.context.setup", async () => {
|
|
134
|
+
await setupAcoContext(context, params);
|
|
135
|
+
});
|
|
136
|
+
});
|
|
137
|
+
plugin.name = "aco.createContext";
|
|
138
|
+
return plugin;
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
//# sourceMappingURL=createAcoContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["ContextPlugin","isHeadlessCmsReady","createAcoStorageOperations","createFilterCrudMethods","createFlpCrudMethods","FolderLevelPermissions","FolderLevelPermissionsFeature","UpdateFolderFeature","DeleteFolderFeature","CreateFolderFeature","GetFolderFeature","ListFoldersFeature","GetFolderHierarchyFeature","GetAncestorsFeature","UpdateFlpOnFolderUpdatedFeature","DeleteFlpOnFolderDeletedFeature","EnsureHcmsFolderIsEmptyOnDeleteFeature","CreateFlpFeature","DeleteFlpFeature","UpdateFlpFeature","EnsureFolderIsEmptyOnDeleteFeature","FilterStorageOperations","ListFlpsFeature","GetFlpFeature","ListFolderLevelPermissionsTargetsFeature","CmsFlpFeature","GetModelUseCase","FolderModel","FolderModelAbstraction","CreateFlpOnFolderCreatedFeature","EnsureFolderIsEmptyFeature","FOLDER_MODEL_ID","FilterPrivateModel","setupAcoContext","context","setupAcoContextParams","tenancy","security","container","register","getModel","resolve","withoutAuthorization","folderModel","execute","registerInstance","value","getTenant","getCurrentTenant","storageOperations","cms","documentClient","flpCrudMethods","filter","tasks","folderLevelPermissions","aco","flp","wcp","canUseFolderLevelPermissions","createAcoContext","params","plugin","benchmark","measure","name"],"sources":["createAcoContext.ts"],"sourcesContent":["import { ContextPlugin } from \"@webiny/api\";\nimport { isHeadlessCmsReady } from \"@webiny/api-headless-cms\";\nimport type { DynamoDBDocument } from \"@webiny/aws-sdk/client-dynamodb/index.js\";\nimport { createAcoStorageOperations } from \"~/createAcoStorageOperations.js\";\nimport type { AcoContext } from \"~/types.js\";\nimport { createFilterCrudMethods } from \"~/filter/filter.crud.js\";\nimport { createFlpCrudMethods } from \"~/flp/index.js\";\nimport {\n FolderLevelPermissions,\n FolderLevelPermissionsFeature\n} from \"~/features/flp/FolderLevelPermissions/index.js\";\nimport { UpdateFolderFeature } from \"~/features/folder/UpdateFolder/index.js\";\nimport { DeleteFolderFeature } from \"~/features/folder/DeleteFolder/index.js\";\nimport { CreateFolderFeature } from \"~/features/folder/CreateFolder/index.js\";\nimport { GetFolderFeature } from \"~/features/folder/GetFolder/index.js\";\nimport { ListFoldersFeature } from \"~/features/folder/ListFolders/index.js\";\nimport { GetFolderHierarchyFeature } from \"~/features/folder/GetFolderHierarchy/index.js\";\nimport { GetAncestorsFeature } from \"~/features/folder/GetAncestors/index.js\";\nimport { UpdateFlpOnFolderUpdatedFeature } from \"~/features/flp/UpdateFlpOnFolderUpdated/index.js\";\nimport { DeleteFlpOnFolderDeletedFeature } from \"~/features/flp/DeleteFlpOnFolderDeleted/index.js\";\nimport { EnsureHcmsFolderIsEmptyOnDeleteFeature } from \"~/features/folder/EnsureHcmsFolderIsEmptyOnDelete/index.js\";\nimport { CreateFlpFeature } from \"~/features/flp/CreateFlp/index.js\";\nimport { DeleteFlpFeature } from \"~/features/flp/DeleteFlp/index.js\";\nimport { UpdateFlpFeature } from \"~/features/flp/UpdateFlp/index.js\";\nimport { EnsureFolderIsEmptyOnDeleteFeature } from \"~/features/folder/EnsureFolderIsEmptyOnDelete/index.js\";\nimport { FilterStorageOperations } from \"~/features/folder/shared/abstractions.js\";\nimport { ListFlpsFeature } from \"~/features/flp/ListFlps/feature.js\";\nimport { GetFlpFeature } from \"~/features/flp/GetFlp/feature.js\";\nimport { ListFolderLevelPermissionsTargetsFeature } from \"~/features/folder/ListFolderLevelPermissionsTargets/feature.js\";\nimport { Tenant } from \"@webiny/api-core/types/tenancy\";\nimport { CmsFlpFeature } from \"~/features/cms/index.js\";\nimport { GetModelUseCase } from \"@webiny/api-headless-cms/features/contentModel/GetModel/index.js\";\nimport { FolderModel as FolderModelAbstraction } from \"~/domain/folder/abstractions.js\";\nimport { CreateFlpOnFolderCreatedFeature } from \"~/features/flp/CreateFlpOnFolderCreated/index.js\";\nimport { EnsureFolderIsEmptyFeature } from \"~/features/folder/EnsureFolderIsEmpty/feature.js\";\nimport { FOLDER_MODEL_ID, FolderModel } from \"~/domain/folder/folder.model.js\";\nimport { FilterPrivateModel } from \"~/filter/filter.model.js\";\n\ninterface CreateAcoContextParams {\n useFolderLevelPermissions?: boolean;\n documentClient: DynamoDBDocument;\n}\n\nconst setupAcoContext = async (\n context: AcoContext,\n setupAcoContextParams: CreateAcoContextParams\n): Promise<void> => {\n const { tenancy, security } = context;\n\n context.container.register(FolderModel);\n context.container.register(FilterPrivateModel);\n\n const getModel = context.container.resolve(GetModelUseCase);\n\n await context.security.withoutAuthorization(async () => {\n const folderModel = await getModel.execute(FOLDER_MODEL_ID);\n context.container.registerInstance(FolderModelAbstraction, folderModel.value);\n });\n\n const getTenant = (): Tenant => {\n return tenancy.getCurrentTenant();\n };\n\n const storageOperations = await createAcoStorageOperations({\n /**\n * TODO: We need to figure out a way to pass \"cms\" from outside (e.g. apps/api/graphql)\n */\n cms: context.cms,\n container: context.container,\n documentClient: setupAcoContextParams.documentClient,\n security\n });\n\n const flpCrudMethods = createFlpCrudMethods({\n getTenant,\n storageOperations\n });\n\n FolderLevelPermissionsFeature.register(context.container);\n\n /**\n * Register legacy dependencies via abstractions\n */\n context.container.registerInstance(FilterStorageOperations, storageOperations.filter);\n\n /**\n * Register folder features into DI container\n */\n CreateFolderFeature.register(context.container);\n\n UpdateFolderFeature.register(context.container);\n\n DeleteFolderFeature.register(context.container);\n\n GetFolderFeature.register(context.container);\n\n ListFoldersFeature.register(context.container);\n\n ListFolderLevelPermissionsTargetsFeature.register(context.container);\n\n GetFolderHierarchyFeature.register(context.container);\n\n GetAncestorsFeature.register(context.container);\n\n EnsureFolderIsEmptyFeature.register(context.container);\n\n /**\n * Register FLP use cases and event handlers\n */\n CreateFlpFeature.register(context.container, { context });\n UpdateFlpFeature.register(context.container, { context });\n DeleteFlpFeature.register(context.container, { context });\n ListFlpsFeature.register(context.container, flpCrudMethods);\n GetFlpFeature.register(context.container, flpCrudMethods);\n\n CreateFlpOnFolderCreatedFeature.register(context.container);\n\n UpdateFlpOnFolderUpdatedFeature.register(context.container, {\n tasks: context.tasks\n });\n\n DeleteFlpOnFolderDeletedFeature.register(context.container, {\n tasks: context.tasks\n });\n\n /**\n * Register folder event handlers\n */\n EnsureFolderIsEmptyOnDeleteFeature.register(context.container);\n EnsureHcmsFolderIsEmptyOnDeleteFeature.register(context.container);\n\n /**\n * Setup legacy context\n */\n const folderLevelPermissions = context.container.resolve(FolderLevelPermissions);\n\n context.aco = {\n filter: createFilterCrudMethods({\n container: context.container,\n getTenant,\n storageOperations,\n folderLevelPermissions\n }),\n flp: flpCrudMethods\n };\n\n if (context.wcp.canUseFolderLevelPermissions()) {\n CmsFlpFeature.register(context.container);\n }\n};\n\nexport const createAcoContext = (params: CreateAcoContextParams) => {\n const plugin = new ContextPlugin<AcoContext>(async context => {\n /**\n * We can skip the ACO initialization if the installation is pending.\n */\n if (!(await isHeadlessCmsReady(context))) {\n return;\n }\n\n await context.benchmark.measure(\"aco.context.setup\", async () => {\n await setupAcoContext(context, params);\n });\n });\n\n plugin.name = \"aco.createContext\";\n\n return plugin;\n};\n"],"mappings":"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","ignoreList":[]}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { GraphQLSchemaPlugin } from "@webiny/handler-graphql";
|
|
2
|
+
import { filterSchema } from "./filter/filter.gql.js";
|
|
3
|
+
import { createFoldersSchema } from "./folder/folder.gql.js";
|
|
4
|
+
import { ContextPlugin } from "@webiny/api";
|
|
5
|
+
import { isHeadlessCmsReady } from "@webiny/api-headless-cms";
|
|
6
|
+
import { createFieldTypePluginRecords } from "@webiny/api-headless-cms/graphql/schema/createFieldTypePluginRecords.js";
|
|
7
|
+
import { createGraphQLSchemaPluginFromFieldPlugins } from "@webiny/api-headless-cms/utils/getSchemaFromFieldPlugins.js";
|
|
8
|
+
import { FOLDER_MODEL_ID } from "./domain/folder/folder.model.js";
|
|
9
|
+
const emptyResolver = () => ({});
|
|
10
|
+
const baseSchema = new GraphQLSchemaPlugin({
|
|
11
|
+
typeDefs: /* GraphQL */`
|
|
12
|
+
type AcoQuery {
|
|
13
|
+
_empty: String
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
type AcoMutation {
|
|
17
|
+
_empty: String
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
type AcoMeta {
|
|
21
|
+
hasMoreItems: Boolean
|
|
22
|
+
totalCount: Int
|
|
23
|
+
cursor: String
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
type AcoUser {
|
|
27
|
+
id: ID
|
|
28
|
+
displayName: String
|
|
29
|
+
type: String
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
type AcoError {
|
|
33
|
+
code: String
|
|
34
|
+
message: String
|
|
35
|
+
data: JSON
|
|
36
|
+
stack: String
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
type AcoBooleanResponse {
|
|
40
|
+
data: Boolean
|
|
41
|
+
error: AcoError
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
enum AcoSortDirection {
|
|
45
|
+
ASC
|
|
46
|
+
DESC
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
input AcoSort {
|
|
50
|
+
id: AcoSortDirection
|
|
51
|
+
createdOn: AcoSortDirection
|
|
52
|
+
modifiedOn: AcoSortDirection
|
|
53
|
+
savedOn: AcoSortDirection
|
|
54
|
+
title: AcoSortDirection
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
extend type Query {
|
|
58
|
+
aco: AcoQuery
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
extend type Mutation {
|
|
62
|
+
aco: AcoMutation
|
|
63
|
+
}
|
|
64
|
+
`,
|
|
65
|
+
resolvers: {
|
|
66
|
+
Query: {
|
|
67
|
+
aco: emptyResolver
|
|
68
|
+
},
|
|
69
|
+
Mutation: {
|
|
70
|
+
aco: emptyResolver
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
export const createAcoGraphQL = () => {
|
|
75
|
+
const folderSchema = new ContextPlugin(async context => {
|
|
76
|
+
if (!(await isHeadlessCmsReady(context))) {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
await context.security.withoutAuthorization(async () => {
|
|
80
|
+
const model = await context.cms.getModel(FOLDER_MODEL_ID);
|
|
81
|
+
const models = await context.cms.listModels();
|
|
82
|
+
const fieldPlugins = createFieldTypePluginRecords(context.plugins);
|
|
83
|
+
/**
|
|
84
|
+
* We need to register all plugins for all the CMS fields.
|
|
85
|
+
*/
|
|
86
|
+
const plugins = createGraphQLSchemaPluginFromFieldPlugins({
|
|
87
|
+
models,
|
|
88
|
+
type: "manage",
|
|
89
|
+
fieldTypePlugins: fieldPlugins,
|
|
90
|
+
createPlugin: ({
|
|
91
|
+
schema,
|
|
92
|
+
type,
|
|
93
|
+
fieldType
|
|
94
|
+
}) => {
|
|
95
|
+
const plugin = new GraphQLSchemaPlugin(schema);
|
|
96
|
+
plugin.name = `aco.graphql.folder.schema.${type}.field.${fieldType}`;
|
|
97
|
+
return plugin;
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
const graphQlPlugin = createFoldersSchema({
|
|
101
|
+
model,
|
|
102
|
+
models,
|
|
103
|
+
plugins: fieldPlugins
|
|
104
|
+
});
|
|
105
|
+
context.plugins.register([...plugins, graphQlPlugin]);
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
return [baseSchema, folderSchema, filterSchema];
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
//# sourceMappingURL=createAcoGraphQL.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["GraphQLSchemaPlugin","filterSchema","createFoldersSchema","ContextPlugin","isHeadlessCmsReady","createFieldTypePluginRecords","createGraphQLSchemaPluginFromFieldPlugins","FOLDER_MODEL_ID","emptyResolver","baseSchema","typeDefs","resolvers","Query","aco","Mutation","createAcoGraphQL","folderSchema","context","security","withoutAuthorization","model","cms","getModel","models","listModels","fieldPlugins","plugins","type","fieldTypePlugins","createPlugin","schema","fieldType","plugin","name","graphQlPlugin","register"],"sources":["createAcoGraphQL.ts"],"sourcesContent":["import { GraphQLSchemaPlugin } from \"@webiny/handler-graphql\";\nimport { filterSchema } from \"~/filter/filter.gql.js\";\nimport { createFoldersSchema } from \"~/folder/folder.gql.js\";\nimport type { AcoContext } from \"~/types.js\";\nimport { ContextPlugin } from \"@webiny/api\";\nimport { isHeadlessCmsReady } from \"@webiny/api-headless-cms\";\nimport type { CmsModel } from \"@webiny/api-headless-cms/types/index.js\";\nimport { createFieldTypePluginRecords } from \"@webiny/api-headless-cms/graphql/schema/createFieldTypePluginRecords.js\";\nimport { createGraphQLSchemaPluginFromFieldPlugins } from \"@webiny/api-headless-cms/utils/getSchemaFromFieldPlugins.js\";\nimport { FOLDER_MODEL_ID } from \"~/domain/folder/folder.model.js\";\n\nconst emptyResolver = () => ({});\n\nconst baseSchema = new GraphQLSchemaPlugin({\n typeDefs: /* GraphQL */ `\n type AcoQuery {\n _empty: String\n }\n\n type AcoMutation {\n _empty: String\n }\n\n type AcoMeta {\n hasMoreItems: Boolean\n totalCount: Int\n cursor: String\n }\n\n type AcoUser {\n id: ID\n displayName: String\n type: String\n }\n\n type AcoError {\n code: String\n message: String\n data: JSON\n stack: String\n }\n\n type AcoBooleanResponse {\n data: Boolean\n error: AcoError\n }\n\n enum AcoSortDirection {\n ASC\n DESC\n }\n\n input AcoSort {\n id: AcoSortDirection\n createdOn: AcoSortDirection\n modifiedOn: AcoSortDirection\n savedOn: AcoSortDirection\n title: AcoSortDirection\n }\n\n extend type Query {\n aco: AcoQuery\n }\n\n extend type Mutation {\n aco: AcoMutation\n }\n `,\n resolvers: {\n Query: {\n aco: emptyResolver\n },\n Mutation: {\n aco: emptyResolver\n }\n }\n});\n\nexport const createAcoGraphQL = () => {\n const folderSchema = new ContextPlugin<AcoContext>(async context => {\n if (!(await isHeadlessCmsReady(context))) {\n return;\n }\n\n await context.security.withoutAuthorization(async () => {\n const model = (await context.cms.getModel(FOLDER_MODEL_ID)) as CmsModel;\n const models = await context.cms.listModels();\n const fieldPlugins = createFieldTypePluginRecords(context.plugins);\n /**\n * We need to register all plugins for all the CMS fields.\n */\n const plugins = createGraphQLSchemaPluginFromFieldPlugins({\n models,\n type: \"manage\",\n fieldTypePlugins: fieldPlugins,\n createPlugin: ({ schema, type, fieldType }) => {\n const plugin = new GraphQLSchemaPlugin(schema);\n plugin.name = `aco.graphql.folder.schema.${type}.field.${fieldType}`;\n return plugin;\n }\n });\n\n const graphQlPlugin = createFoldersSchema({\n model,\n models,\n plugins: fieldPlugins\n });\n\n context.plugins.register([...plugins, graphQlPlugin]);\n });\n });\n\n return [baseSchema, folderSchema, filterSchema];\n};\n"],"mappings":"AAAA,SAASA,mBAAmB,QAAQ,yBAAyB;AAC7D,SAASC,YAAY;AACrB,SAASC,mBAAmB;AAE5B,SAASC,aAAa,QAAQ,aAAa;AAC3C,SAASC,kBAAkB,QAAQ,0BAA0B;AAE7D,SAASC,4BAA4B,QAAQ,yEAAyE;AACtH,SAASC,yCAAyC,QAAQ,6DAA6D;AACvH,SAASC,eAAe;AAExB,MAAMC,aAAa,GAAGA,CAAA,MAAO,CAAC,CAAC,CAAC;AAEhC,MAAMC,UAAU,GAAG,IAAIT,mBAAmB,CAAC;EACvCU,QAAQ,EAAE,aAAc;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;EACDC,SAAS,EAAE;IACPC,KAAK,EAAE;MACHC,GAAG,EAAEL;IACT,CAAC;IACDM,QAAQ,EAAE;MACND,GAAG,EAAEL;IACT;EACJ;AACJ,CAAC,CAAC;AAEF,OAAO,MAAMO,gBAAgB,GAAGA,CAAA,KAAM;EAClC,MAAMC,YAAY,GAAG,IAAIb,aAAa,CAAa,MAAMc,OAAO,IAAI;IAChE,IAAI,EAAE,MAAMb,kBAAkB,CAACa,OAAO,CAAC,CAAC,EAAE;MACtC;IACJ;IAEA,MAAMA,OAAO,CAACC,QAAQ,CAACC,oBAAoB,CAAC,YAAY;MACpD,MAAMC,KAAK,GAAI,MAAMH,OAAO,CAACI,GAAG,CAACC,QAAQ,CAACf,eAAe,CAAc;MACvE,MAAMgB,MAAM,GAAG,MAAMN,OAAO,CAACI,GAAG,CAACG,UAAU,CAAC,CAAC;MAC7C,MAAMC,YAAY,GAAGpB,4BAA4B,CAACY,OAAO,CAACS,OAAO,CAAC;MAClE;AACZ;AACA;MACY,MAAMA,OAAO,GAAGpB,yCAAyC,CAAC;QACtDiB,MAAM;QACNI,IAAI,EAAE,QAAQ;QACdC,gBAAgB,EAAEH,YAAY;QAC9BI,YAAY,EAAEA,CAAC;UAAEC,MAAM;UAAEH,IAAI;UAAEI;QAAU,CAAC,KAAK;UAC3C,MAAMC,MAAM,GAAG,IAAIhC,mBAAmB,CAAC8B,MAAM,CAAC;UAC9CE,MAAM,CAACC,IAAI,GAAG,6BAA6BN,IAAI,UAAUI,SAAS,EAAE;UACpE,OAAOC,MAAM;QACjB;MACJ,CAAC,CAAC;MAEF,MAAME,aAAa,GAAGhC,mBAAmB,CAAC;QACtCkB,KAAK;QACLG,MAAM;QACNG,OAAO,EAAED;MACb,CAAC,CAAC;MAEFR,OAAO,CAACS,OAAO,CAACS,QAAQ,CAAC,CAAC,GAAGT,OAAO,EAAEQ,aAAa,CAAC,CAAC;IACzD,CAAC,CAAC;EACN,CAAC,CAAC;EAEF,OAAO,CAACzB,UAAU,EAAEO,YAAY,EAAEf,YAAY,CAAC;AACnD,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { HeadlessCms } from "@webiny/api-headless-cms/types/index.js";
|
|
2
|
+
import type { DynamoDBDocument } from "@webiny/aws-sdk/client-dynamodb/index.js";
|
|
3
|
+
import type { AcoStorageOperations } from "./types.js";
|
|
4
|
+
import type { Security } from "@webiny/api-core/types/security.js";
|
|
5
|
+
import type { Container } from "@webiny/di";
|
|
6
|
+
export interface CreateAcoStorageOperationsParams {
|
|
7
|
+
cms: HeadlessCms;
|
|
8
|
+
security: Security;
|
|
9
|
+
container: Container;
|
|
10
|
+
documentClient: DynamoDBDocument;
|
|
11
|
+
}
|
|
12
|
+
export declare const createAcoStorageOperations: (params: CreateAcoStorageOperationsParams) => Promise<AcoStorageOperations>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createFilterOperations } from "./filter/filter.so.js";
|
|
2
|
+
import { createFlpOperations } from "./flp/index.js";
|
|
3
|
+
export const createAcoStorageOperations = async params => {
|
|
4
|
+
return {
|
|
5
|
+
filter: createFilterOperations(params),
|
|
6
|
+
flp: createFlpOperations(params)
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
//# sourceMappingURL=createAcoStorageOperations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createFilterOperations","createFlpOperations","createAcoStorageOperations","params","filter","flp"],"sources":["createAcoStorageOperations.ts"],"sourcesContent":["import type { HeadlessCms } from \"@webiny/api-headless-cms/types/index.js\";\nimport type { DynamoDBDocument } from \"@webiny/aws-sdk/client-dynamodb/index.js\";\nimport { createFilterOperations } from \"~/filter/filter.so.js\";\nimport type { AcoStorageOperations } from \"~/types.js\";\nimport { createFlpOperations } from \"~/flp/index.js\";\nimport type { Security } from \"@webiny/api-core/types/security.js\";\nimport type { Container } from \"@webiny/di\";\n\nexport interface CreateAcoStorageOperationsParams {\n cms: HeadlessCms;\n security: Security;\n container: Container;\n documentClient: DynamoDBDocument;\n}\n\nexport const createAcoStorageOperations = async (\n params: CreateAcoStorageOperationsParams\n): Promise<AcoStorageOperations> => {\n return {\n filter: createFilterOperations(params),\n flp: createFlpOperations(params)\n };\n};\n"],"mappings":"AAEA,SAASA,sBAAsB;AAE/B,SAASC,mBAAmB;AAW5B,OAAO,MAAMC,0BAA0B,GAAG,MACtCC,MAAwC,IACR;EAChC,OAAO;IACHC,MAAM,EAAEJ,sBAAsB,CAACG,MAAM,CAAC;IACtCE,GAAG,EAAEJ,mBAAmB,CAACE,MAAM;EACnC,CAAC;AACL,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const createAcoTasks: () => import("@webiny/api").ContextPlugin<import("@webiny/api/types").Context>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { createContextPlugin } from "@webiny/api";
|
|
2
|
+
import { CreateFlpTask } from "./flp/tasks/createFlp.task.js";
|
|
3
|
+
import { UpdateFlpTask } from "./flp/tasks/updateFlp.task.js";
|
|
4
|
+
import { DeleteFlpTask } from "./flp/tasks/deleteFlp.task.js";
|
|
5
|
+
import { SyncFlpTask } from "./flp/tasks/syncFlp.task.js";
|
|
6
|
+
export const createAcoTasks = () => {
|
|
7
|
+
return createContextPlugin(context => {
|
|
8
|
+
context.container.register(CreateFlpTask);
|
|
9
|
+
context.container.register(UpdateFlpTask);
|
|
10
|
+
context.container.register(DeleteFlpTask);
|
|
11
|
+
context.container.register(SyncFlpTask);
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=createAcoTasks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createContextPlugin","CreateFlpTask","UpdateFlpTask","DeleteFlpTask","SyncFlpTask","createAcoTasks","context","container","register"],"sources":["createAcoTasks.ts"],"sourcesContent":["import { createContextPlugin } from \"@webiny/api\";\nimport { CreateFlpTask } from \"~/flp/tasks/createFlp.task.js\";\nimport { UpdateFlpTask } from \"~/flp/tasks/updateFlp.task.js\";\nimport { DeleteFlpTask } from \"~/flp/tasks/deleteFlp.task.js\";\nimport { SyncFlpTask } from \"~/flp/tasks/syncFlp.task.js\";\n\nexport const createAcoTasks = () => {\n return createContextPlugin(context => {\n context.container.register(CreateFlpTask);\n context.container.register(UpdateFlpTask);\n context.container.register(DeleteFlpTask);\n context.container.register(SyncFlpTask);\n });\n};\n"],"mappings":"AAAA,SAASA,mBAAmB,QAAQ,aAAa;AACjD,SAASC,aAAa;AACtB,SAASC,aAAa;AACtB,SAASC,aAAa;AACtB,SAASC,WAAW;AAEpB,OAAO,MAAMC,cAAc,GAAGA,CAAA,KAAM;EAChC,OAAOL,mBAAmB,CAACM,OAAO,IAAI;IAClCA,OAAO,CAACC,SAAS,CAACC,QAAQ,CAACP,aAAa,CAAC;IACzCK,OAAO,CAACC,SAAS,CAACC,QAAQ,CAACN,aAAa,CAAC;IACzCI,OAAO,CAACC,SAAS,CAACC,QAAQ,CAACL,aAAa,CAAC;IACzCG,OAAO,CAACC,SAAS,CAACC,QAAQ,CAACJ,WAAW,CAAC;EAC3C,CAAC,CAAC;AACN,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { CmsModel } from "@webiny/api-headless-cms/types";
|
|
2
|
+
/**
|
|
3
|
+
* FolderModel abstraction - represents the ACO folder CMS model.
|
|
4
|
+
* This will be registered via container.registerInstance in the composite feature.
|
|
5
|
+
*/
|
|
6
|
+
export declare const FolderModel: import("@webiny/di").Abstraction<CmsModel>;
|
|
7
|
+
export declare namespace FolderModel {
|
|
8
|
+
type Interface = CmsModel;
|
|
9
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { createAbstraction } from "@webiny/feature/api";
|
|
2
|
+
/**
|
|
3
|
+
* FolderModel abstraction - represents the ACO folder CMS model.
|
|
4
|
+
* This will be registered via container.registerInstance in the composite feature.
|
|
5
|
+
*/
|
|
6
|
+
export const FolderModel = createAbstraction("FolderModel");
|
|
7
|
+
|
|
8
|
+
//# sourceMappingURL=abstractions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createAbstraction","FolderModel"],"sources":["abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { CmsModel } from \"@webiny/api-headless-cms/types\";\n\n/**\n * FolderModel abstraction - represents the ACO folder CMS model.\n * This will be registered via container.registerInstance in the composite feature.\n */\nexport const FolderModel = createAbstraction<CmsModel>(\"FolderModel\");\n\nexport namespace FolderModel {\n export type Interface = CmsModel;\n}\n"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,qBAAqB;AAGvD;AACA;AACA;AACA;AACA,OAAO,MAAMC,WAAW,GAAGD,iBAAiB,CAAW,aAAa,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { BaseError } from "@webiny/feature/api";
|
|
2
|
+
export declare class FolderNotFoundError extends BaseError<{
|
|
3
|
+
folder: {
|
|
4
|
+
id: string;
|
|
5
|
+
};
|
|
6
|
+
}> {
|
|
7
|
+
readonly code: "Aco/Folder/NotFound";
|
|
8
|
+
constructor(id: string);
|
|
9
|
+
}
|
|
10
|
+
export declare class FolderNotAuthorizedError extends BaseError {
|
|
11
|
+
readonly code: "Aco/Folder/NotAuthorizedError";
|
|
12
|
+
constructor();
|
|
13
|
+
}
|
|
14
|
+
export declare class FolderPersistenceError extends BaseError {
|
|
15
|
+
readonly code: "Aco/Folder/PersistenceError";
|
|
16
|
+
constructor(error: Error);
|
|
17
|
+
}
|
|
18
|
+
export declare class FolderValidationError extends BaseError {
|
|
19
|
+
readonly code: "Aco/Folder/ValidationError";
|
|
20
|
+
constructor(message: string);
|
|
21
|
+
}
|
|
22
|
+
export declare class FolderCannotMoveToNewParent extends BaseError {
|
|
23
|
+
readonly code: "Aco/Folder/CannotMoveToNewParent";
|
|
24
|
+
constructor();
|
|
25
|
+
}
|
|
26
|
+
export declare class FolderNotEmptyError extends BaseError {
|
|
27
|
+
readonly code: "Aco/Folder/NotEmpty";
|
|
28
|
+
constructor();
|
|
29
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { BaseError } from "@webiny/feature/api";
|
|
2
|
+
export class FolderNotFoundError extends BaseError {
|
|
3
|
+
code = "Aco/Folder/NotFound";
|
|
4
|
+
constructor(id) {
|
|
5
|
+
super({
|
|
6
|
+
message: "Folder not found!",
|
|
7
|
+
data: {
|
|
8
|
+
folder: {
|
|
9
|
+
id
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
export class FolderNotAuthorizedError extends BaseError {
|
|
16
|
+
code = "Aco/Folder/NotAuthorizedError";
|
|
17
|
+
constructor() {
|
|
18
|
+
super({
|
|
19
|
+
message: `Not authorized.`
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
export class FolderPersistenceError extends BaseError {
|
|
24
|
+
code = "Aco/Folder/PersistenceError";
|
|
25
|
+
constructor(error) {
|
|
26
|
+
super({
|
|
27
|
+
message: error.message
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
export class FolderValidationError extends BaseError {
|
|
32
|
+
code = "Aco/Folder/ValidationError";
|
|
33
|
+
constructor(message) {
|
|
34
|
+
super({
|
|
35
|
+
message
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
export class FolderCannotMoveToNewParent extends BaseError {
|
|
40
|
+
code = "Aco/Folder/CannotMoveToNewParent";
|
|
41
|
+
constructor() {
|
|
42
|
+
super({
|
|
43
|
+
message: `Cannot move folder to a new parent because you don't have access to the new parent.`
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
export class FolderNotEmptyError extends BaseError {
|
|
48
|
+
code = "Aco/Folder/NotEmpty";
|
|
49
|
+
constructor() {
|
|
50
|
+
super({
|
|
51
|
+
message: `Folder is not empty.`
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["BaseError","FolderNotFoundError","code","constructor","id","message","data","folder","FolderNotAuthorizedError","FolderPersistenceError","error","FolderValidationError","FolderCannotMoveToNewParent","FolderNotEmptyError"],"sources":["errors.ts"],"sourcesContent":["import { BaseError } from \"@webiny/feature/api\";\n\nexport class FolderNotFoundError extends BaseError<{ folder: { id: string } }> {\n override readonly code = \"Aco/Folder/NotFound\" as const;\n\n constructor(id: string) {\n super({\n message: \"Folder not found!\",\n data: {\n folder: {\n id\n }\n }\n });\n }\n}\n\nexport class FolderNotAuthorizedError extends BaseError {\n override readonly code = \"Aco/Folder/NotAuthorizedError\" as const;\n\n constructor() {\n super({\n message: `Not authorized.`\n });\n }\n}\n\nexport class FolderPersistenceError extends BaseError {\n override readonly code = \"Aco/Folder/PersistenceError\" as const;\n\n constructor(error: Error) {\n super({\n message: error.message\n });\n }\n}\n\nexport class FolderValidationError extends BaseError {\n override readonly code = \"Aco/Folder/ValidationError\" as const;\n\n constructor(message: string) {\n super({\n message\n });\n }\n}\n\nexport class FolderCannotMoveToNewParent extends BaseError {\n override readonly code = \"Aco/Folder/CannotMoveToNewParent\" as const;\n\n constructor() {\n super({\n message: `Cannot move folder to a new parent because you don't have access to the new parent.`\n });\n }\n}\n\nexport class FolderNotEmptyError extends BaseError {\n override readonly code = \"Aco/Folder/NotEmpty\" as const;\n\n constructor() {\n super({\n message: `Folder is not empty.`\n });\n }\n}\n"],"mappings":"AAAA,SAASA,SAAS,QAAQ,qBAAqB;AAE/C,OAAO,MAAMC,mBAAmB,SAASD,SAAS,CAA6B;EACzDE,IAAI,GAAG,qBAAqB;EAE9CC,WAAWA,CAACC,EAAU,EAAE;IACpB,KAAK,CAAC;MACFC,OAAO,EAAE,mBAAmB;MAC5BC,IAAI,EAAE;QACFC,MAAM,EAAE;UACJH;QACJ;MACJ;IACJ,CAAC,CAAC;EACN;AACJ;AAEA,OAAO,MAAMI,wBAAwB,SAASR,SAAS,CAAC;EAClCE,IAAI,GAAG,+BAA+B;EAExDC,WAAWA,CAAA,EAAG;IACV,KAAK,CAAC;MACFE,OAAO,EAAE;IACb,CAAC,CAAC;EACN;AACJ;AAEA,OAAO,MAAMI,sBAAsB,SAAST,SAAS,CAAC;EAChCE,IAAI,GAAG,6BAA6B;EAEtDC,WAAWA,CAACO,KAAY,EAAE;IACtB,KAAK,CAAC;MACFL,OAAO,EAAEK,KAAK,CAACL;IACnB,CAAC,CAAC;EACN;AACJ;AAEA,OAAO,MAAMM,qBAAqB,SAASX,SAAS,CAAC;EAC/BE,IAAI,GAAG,4BAA4B;EAErDC,WAAWA,CAACE,OAAe,EAAE;IACzB,KAAK,CAAC;MACFA;IACJ,CAAC,CAAC;EACN;AACJ;AAEA,OAAO,MAAMO,2BAA2B,SAASZ,SAAS,CAAC;EACrCE,IAAI,GAAG,kCAAkC;EAE3DC,WAAWA,CAAA,EAAG;IACV,KAAK,CAAC;MACFE,OAAO,EAAE;IACb,CAAC,CAAC;EACN;AACJ;AAEA,OAAO,MAAMQ,mBAAmB,SAASb,SAAS,CAAC;EAC7BE,IAAI,GAAG,qBAAqB;EAE9CC,WAAWA,CAAA,EAAG;IACV,KAAK,CAAC;MACFE,OAAO,EAAE;IACb,CAAC,CAAC;EACN;AACJ","ignoreList":[]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ModelFactory } from "@webiny/api-headless-cms/features/modelBuilder/index.js";
|
|
2
|
+
export declare const FOLDER_MODEL_ID: string;
|
|
3
|
+
declare class FolderPrivateModelImpl implements ModelFactory.Interface {
|
|
4
|
+
execute(builder: ModelFactory.Builder): Promise<import("@webiny/api-headless-cms/features/modelBuilder/index.js").PrivateModelBuilder[]>;
|
|
5
|
+
}
|
|
6
|
+
export declare const FolderModel: typeof FolderPrivateModelImpl & {
|
|
7
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-headless-cms/features/modelBuilder/abstractions").IModelFactory>;
|
|
8
|
+
};
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { ModelFactory } from "@webiny/api-headless-cms/features/modelBuilder/index.js";
|
|
2
|
+
export const FOLDER_MODEL_ID = process.env.WEBINY_API_LEGACY_MODELS ? "acoFolder" : "wbyAcoFolder";
|
|
3
|
+
class FolderPrivateModelImpl {
|
|
4
|
+
async execute(builder) {
|
|
5
|
+
return [builder.private({
|
|
6
|
+
modelId: FOLDER_MODEL_ID,
|
|
7
|
+
name: "ACO - Folder"
|
|
8
|
+
}).fields(fields => ({
|
|
9
|
+
title: fields.text().label("Title").required("Value is required."),
|
|
10
|
+
slug: fields.text().label("Slug").required("Value is required.").pattern("^[a-z0-9]+(-[a-z0-9]+)*$", "g", "Value must consist of only 'a-z', '0-9' and '-'."),
|
|
11
|
+
type: fields.text().label("Type").required("Value is required."),
|
|
12
|
+
parentId: fields.text().label("Parent Id"),
|
|
13
|
+
path: fields.text().label("Path"),
|
|
14
|
+
permissions: fields.object().label("Permissions").list().fields(fields => ({
|
|
15
|
+
target: fields.text().label("Target").required("Value is required."),
|
|
16
|
+
level: fields.text().label("Level").required("Value is required.").predefinedValues([{
|
|
17
|
+
label: "Viewer",
|
|
18
|
+
value: "viewer"
|
|
19
|
+
}, {
|
|
20
|
+
label: "Editor",
|
|
21
|
+
value: "editor"
|
|
22
|
+
}, {
|
|
23
|
+
label: "Owner",
|
|
24
|
+
value: "owner"
|
|
25
|
+
}, {
|
|
26
|
+
label: "Public",
|
|
27
|
+
value: "public"
|
|
28
|
+
}, {
|
|
29
|
+
label: "No Access",
|
|
30
|
+
value: "no-access"
|
|
31
|
+
}])
|
|
32
|
+
})).layout([["target"], ["level"]]),
|
|
33
|
+
extensions: fields.object().label("Extensions")
|
|
34
|
+
}))];
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
export const FolderModel = ModelFactory.createImplementation({
|
|
38
|
+
implementation: FolderPrivateModelImpl,
|
|
39
|
+
dependencies: []
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
//# sourceMappingURL=folder.model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["ModelFactory","FOLDER_MODEL_ID","process","env","WEBINY_API_LEGACY_MODELS","FolderPrivateModelImpl","execute","builder","private","modelId","name","fields","title","text","label","required","slug","pattern","type","parentId","path","permissions","object","list","target","level","predefinedValues","value","layout","extensions","FolderModel","createImplementation","implementation","dependencies"],"sources":["folder.model.ts"],"sourcesContent":["import { ModelFactory } from \"@webiny/api-headless-cms/features/modelBuilder/index.js\";\n\nexport const FOLDER_MODEL_ID = process.env.WEBINY_API_LEGACY_MODELS ? \"acoFolder\" : \"wbyAcoFolder\";\n\nclass FolderPrivateModelImpl implements ModelFactory.Interface {\n public async execute(builder: ModelFactory.Builder) {\n return [\n builder\n .private({\n modelId: FOLDER_MODEL_ID,\n name: \"ACO - Folder\"\n })\n .fields(fields => ({\n title: fields.text().label(\"Title\").required(\"Value is required.\"),\n slug: fields\n .text()\n .label(\"Slug\")\n .required(\"Value is required.\")\n .pattern(\n \"^[a-z0-9]+(-[a-z0-9]+)*$\",\n \"g\",\n \"Value must consist of only 'a-z', '0-9' and '-'.\"\n ),\n type: fields.text().label(\"Type\").required(\"Value is required.\"),\n parentId: fields.text().label(\"Parent Id\"),\n path: fields.text().label(\"Path\"),\n permissions: fields\n .object()\n .label(\"Permissions\")\n .list()\n .fields(fields => ({\n target: fields.text().label(\"Target\").required(\"Value is required.\"),\n level: fields\n .text()\n .label(\"Level\")\n .required(\"Value is required.\")\n .predefinedValues([\n {\n label: \"Viewer\",\n value: \"viewer\"\n },\n {\n label: \"Editor\",\n value: \"editor\"\n },\n {\n label: \"Owner\",\n value: \"owner\"\n },\n {\n label: \"Public\",\n value: \"public\"\n },\n {\n label: \"No Access\",\n value: \"no-access\"\n }\n ])\n }))\n .layout([[\"target\"], [\"level\"]]),\n extensions: fields.object().label(\"Extensions\")\n }))\n ];\n }\n}\n\nexport const FolderModel = ModelFactory.createImplementation({\n implementation: FolderPrivateModelImpl,\n dependencies: []\n});\n"],"mappings":"AAAA,SAASA,YAAY,QAAQ,yDAAyD;AAEtF,OAAO,MAAMC,eAAe,GAAGC,OAAO,CAACC,GAAG,CAACC,wBAAwB,GAAG,WAAW,GAAG,cAAc;AAElG,MAAMC,sBAAsB,CAAmC;EAC3D,MAAaC,OAAOA,CAACC,OAA6B,EAAE;IAChD,OAAO,CACHA,OAAO,CACFC,OAAO,CAAC;MACLC,OAAO,EAAER,eAAe;MACxBS,IAAI,EAAE;IACV,CAAC,CAAC,CACDC,MAAM,CAACA,MAAM,KAAK;MACfC,KAAK,EAAED,MAAM,CAACE,IAAI,CAAC,CAAC,CAACC,KAAK,CAAC,OAAO,CAAC,CAACC,QAAQ,CAAC,oBAAoB,CAAC;MAClEC,IAAI,EAAEL,MAAM,CACPE,IAAI,CAAC,CAAC,CACNC,KAAK,CAAC,MAAM,CAAC,CACbC,QAAQ,CAAC,oBAAoB,CAAC,CAC9BE,OAAO,CACJ,0BAA0B,EAC1B,GAAG,EACH,kDACJ,CAAC;MACLC,IAAI,EAAEP,MAAM,CAACE,IAAI,CAAC,CAAC,CAACC,KAAK,CAAC,MAAM,CAAC,CAACC,QAAQ,CAAC,oBAAoB,CAAC;MAChEI,QAAQ,EAAER,MAAM,CAACE,IAAI,CAAC,CAAC,CAACC,KAAK,CAAC,WAAW,CAAC;MAC1CM,IAAI,EAAET,MAAM,CAACE,IAAI,CAAC,CAAC,CAACC,KAAK,CAAC,MAAM,CAAC;MACjCO,WAAW,EAAEV,MAAM,CACdW,MAAM,CAAC,CAAC,CACRR,KAAK,CAAC,aAAa,CAAC,CACpBS,IAAI,CAAC,CAAC,CACNZ,MAAM,CAACA,MAAM,KAAK;QACfa,MAAM,EAAEb,MAAM,CAACE,IAAI,CAAC,CAAC,CAACC,KAAK,CAAC,QAAQ,CAAC,CAACC,QAAQ,CAAC,oBAAoB,CAAC;QACpEU,KAAK,EAAEd,MAAM,CACRE,IAAI,CAAC,CAAC,CACNC,KAAK,CAAC,OAAO,CAAC,CACdC,QAAQ,CAAC,oBAAoB,CAAC,CAC9BW,gBAAgB,CAAC,CACd;UACIZ,KAAK,EAAE,QAAQ;UACfa,KAAK,EAAE;QACX,CAAC,EACD;UACIb,KAAK,EAAE,QAAQ;UACfa,KAAK,EAAE;QACX,CAAC,EACD;UACIb,KAAK,EAAE,OAAO;UACda,KAAK,EAAE;QACX,CAAC,EACD;UACIb,KAAK,EAAE,QAAQ;UACfa,KAAK,EAAE;QACX,CAAC,EACD;UACIb,KAAK,EAAE,WAAW;UAClBa,KAAK,EAAE;QACX,CAAC,CACJ;MACT,CAAC,CAAC,CAAC,CACFC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;MACpCC,UAAU,EAAElB,MAAM,CAACW,MAAM,CAAC,CAAC,CAACR,KAAK,CAAC,YAAY;IAClD,CAAC,CAAC,CAAC,CACV;EACL;AACJ;AAEA,OAAO,MAAMgB,WAAW,GAAG9B,YAAY,CAAC+B,oBAAoB,CAAC;EACzDC,cAAc,EAAE3B,sBAAsB;EACtC4B,YAAY,EAAE;AAClB,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { CreateEntryRevisionFromUseCase } from "@webiny/api-headless-cms/features/contentEntry/CreateEntryRevisionFrom/abstractions.js";
|
|
2
|
+
import { GetRevisionByIdUseCase } from "@webiny/api-headless-cms/features/contentEntry/GetRevisionById/abstractions.js";
|
|
3
|
+
import type { CmsEntryValues, CmsModel, CreateCmsEntryInput, CreateCmsEntryOptionsInput } from "@webiny/api-headless-cms/types/index.js";
|
|
4
|
+
import { FolderLevelPermissions } from "../../../features/flp/FolderLevelPermissions/index.js";
|
|
5
|
+
declare class CreateEntryRevisionFromWithFlpDecoratorImpl implements CreateEntryRevisionFromUseCase.Interface {
|
|
6
|
+
private folderLevelPermissions;
|
|
7
|
+
private getRevisionById;
|
|
8
|
+
private decoratee;
|
|
9
|
+
constructor(folderLevelPermissions: FolderLevelPermissions.Interface, getRevisionById: GetRevisionByIdUseCase.Interface, decoratee: CreateEntryRevisionFromUseCase.Interface);
|
|
10
|
+
execute<T extends CmsEntryValues = CmsEntryValues>(model: CmsModel, sourceId: string, input: CreateCmsEntryInput<T>, options?: CreateCmsEntryOptionsInput): CreateEntryRevisionFromUseCase.Return<T>;
|
|
11
|
+
}
|
|
12
|
+
export declare const CreateEntryRevisionFromWithFlpDecorator: typeof CreateEntryRevisionFromWithFlpDecoratorImpl;
|
|
13
|
+
export {};
|