@webiny/app-aco 6.0.0-alpha.0 → 6.0.0-alpha.2
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/components/AdvancedSearch/AdvancedSearch.d.ts +1 -1
- package/components/AdvancedSearch/AdvancedSearch.js.map +1 -1
- package/components/AdvancedSearch/AdvancedSearchPresenter.d.ts +1 -1
- package/components/AdvancedSearch/AdvancedSearchPresenter.js.map +1 -1
- package/components/AdvancedSearch/AdvancedSearchPresenter.test.js.map +1 -1
- package/components/AdvancedSearch/GraphQLInputMapper.d.ts +1 -1
- package/components/AdvancedSearch/GraphQLInputMapper.js.map +1 -1
- package/components/AdvancedSearch/GraphQLInputMapper.test.js.map +1 -1
- package/components/AdvancedSearch/QueryBuilderDrawer/QueryBuilder/QueryBuilder.d.ts +3 -3
- package/components/AdvancedSearch/QueryBuilderDrawer/QueryBuilder/QueryBuilder.js.map +1 -1
- package/components/AdvancedSearch/QueryBuilderDrawer/QueryBuilder/components/Filter.d.ts +1 -1
- package/components/AdvancedSearch/QueryBuilderDrawer/QueryBuilder/components/Filter.js.map +1 -1
- package/components/AdvancedSearch/QueryBuilderDrawer/QueryBuilder/components/InputField.d.ts +1 -1
- package/components/AdvancedSearch/QueryBuilderDrawer/QueryBuilder/components/InputField.js.map +1 -1
- package/components/AdvancedSearch/QueryBuilderDrawer/QueryBuilderDrawer.d.ts +1 -1
- package/components/AdvancedSearch/QueryBuilderDrawer/QueryBuilderDrawer.js.map +1 -1
- package/components/AdvancedSearch/QueryBuilderDrawer/QueryBuilderDrawerPresenter.d.ts +3 -2
- package/components/AdvancedSearch/QueryBuilderDrawer/QueryBuilderDrawerPresenter.js.map +1 -1
- package/components/AdvancedSearch/QueryBuilderDrawer/QueryBuilderDrawerPresenter.test.js.map +1 -1
- package/components/AdvancedSearch/QueryManagerDialog/components/FilterList.d.ts +1 -1
- package/components/AdvancedSearch/QueryManagerDialog/components/FilterList.js.map +1 -1
- package/components/AdvancedSearch/QuerySaverDialog/QuerySaverDialog.d.ts +1 -1
- package/components/AdvancedSearch/QuerySaverDialog/QuerySaverDialog.js.map +1 -1
- package/components/AdvancedSearch/QuerySaverDialog/QuerySaverDialogPresenter.d.ts +2 -2
- package/components/AdvancedSearch/QuerySaverDialog/QuerySaverDialogPresenter.js.map +1 -1
- package/components/AdvancedSearch/QuerySaverDialog/QuerySaverDialogPresenter.test.js.map +1 -1
- package/components/AdvancedSearch/SelectedFilter/SelectedFilter.d.ts +1 -1
- package/components/AdvancedSearch/SelectedFilter/SelectedFilter.js.map +1 -1
- package/components/AdvancedSearch/domain/Field.d.ts +1 -1
- package/components/AdvancedSearch/domain/Field.js.map +1 -1
- package/components/AdvancedSearch/domain/FieldMapper.d.ts +1 -1
- package/components/AdvancedSearch/domain/FieldMapper.js.map +1 -1
- package/components/AdvancedSearch/domain/Filter.d.ts +24 -24
- package/components/AdvancedSearch/domain/FilterMapper.d.ts +1 -1
- package/components/AdvancedSearch/domain/FilterMapper.js.map +1 -1
- package/components/AdvancedSearch/domain/FilterRepository.d.ts +2 -2
- package/components/AdvancedSearch/domain/FilterRepository.js.map +1 -1
- package/components/AdvancedSearch/domain/FilterRepositoryFactory.d.ts +1 -1
- package/components/AdvancedSearch/domain/FilterRepositoryFactory.js.map +1 -1
- package/components/AdvancedSearch/gateways/FiltersGatewayInterface.d.ts +2 -2
- package/components/AdvancedSearch/gateways/FiltersGatewayInterface.js.map +1 -1
- package/components/AdvancedSearch/gateways/FiltersGraphQLGateway.d.ts +3 -3
- package/components/AdvancedSearch/gateways/FiltersGraphQLGateway.js.map +1 -1
- package/components/AdvancedSearch/gateways/filters.types.d.ts +2 -2
- package/components/AdvancedSearch/gateways/filters.types.js.map +1 -1
- package/components/AdvancedSearch/index.d.ts +2 -2
- package/components/AdvancedSearch/index.js.map +1 -1
- package/components/AdvancedSearch/useInputField.d.ts +1 -1
- package/components/AdvancedSearch/useInputField.js.map +1 -1
- package/components/FolderTree/List/List.d.ts +1 -1
- package/components/FolderTree/List/List.js +15 -1
- package/components/FolderTree/List/List.js.map +1 -1
- package/components/FolderTree/List/utils.d.ts +1 -1
- package/components/FolderTree/List/utils.js.map +1 -1
- package/components/FolderTree/MenuActions/MenuActions.js +2 -0
- package/components/FolderTree/MenuActions/MenuActions.js.map +1 -1
- package/components/FolderTree/index.d.ts +1 -1
- package/components/FolderTree/index.js.map +1 -1
- package/components/Table/components/Table/ColumnVisibility/ColumnsVisibilityDecorator.d.ts +2 -2
- package/components/Table/components/Table/ColumnVisibility/ColumnsVisibilityDecorator.js.map +1 -1
- package/components/Table/components/Table/ColumnVisibility/ColumnsVisibilityPresenter.d.ts +1 -1
- package/components/Table/components/Table/ColumnVisibility/ColumnsVisibilityPresenter.js.map +1 -1
- package/components/Table/components/Table/ColumnVisibility/ColumnsVisibilityPresenter.test.js.map +1 -1
- package/components/Table/components/Table/ColumnVisibility/ColumnsVisibilityRepository.d.ts +2 -2
- package/components/Table/components/Table/ColumnVisibility/ColumnsVisibilityRepository.js.map +1 -1
- package/components/Table/components/Table/ColumnVisibility/ColumnsVisibilityRepositoryFactory.d.ts +1 -1
- package/components/Table/components/Table/ColumnVisibility/ColumnsVisibilityRepositoryFactory.js.map +1 -1
- package/components/Table/components/Table/ColumnVisibility/ColumnsVisibilityUpdater.d.ts +2 -2
- package/components/Table/components/Table/ColumnVisibility/ColumnsVisibilityUpdater.js.map +1 -1
- package/components/Table/components/Table/Columns/Column.d.ts +2 -2
- package/components/Table/components/Table/Columns/Column.js.map +1 -1
- package/components/Table/components/Table/Columns/ColumnMapper.d.ts +2 -2
- package/components/Table/components/Table/Columns/ColumnMapper.js.map +1 -1
- package/components/Table/components/Table/Columns/ColumnsPresenter.d.ts +1 -1
- package/components/Table/components/Table/Columns/ColumnsPresenter.js.map +1 -1
- package/components/Table/components/Table/Columns/ColumnsPresenter.test.js.map +1 -1
- package/components/Table/components/Table/Columns/ColumnsRepository.d.ts +2 -2
- package/components/Table/components/Table/Columns/ColumnsRepository.js.map +1 -1
- package/components/Table/components/Table/Columns/ColumnsRepositoryFactory.d.ts +1 -1
- package/components/Table/components/Table/Columns/ColumnsRepositoryFactory.js.map +1 -1
- package/components/Table/components/Table/Columns/IColumnsRepository.d.ts +1 -1
- package/components/Table/components/Table/Columns/IColumnsRepository.js.map +1 -1
- package/components/Table/components/Table/Table.d.ts +4 -3
- package/components/Table/components/Table/Table.js.map +1 -1
- package/components/Table/components/Table/TableInner.d.ts +8 -6
- package/components/Table/components/Table/TableInner.js.map +1 -1
- package/components/Table/components/Table/TablePresenter.d.ts +1 -1
- package/components/Table/components/Table/TablePresenter.js.map +1 -1
- package/components/Table/components/Table/gateways/ColumnsVisibilityLocalStorageGateway.d.ts +1 -1
- package/components/Table/components/Table/gateways/ColumnsVisibilityLocalStorageGateway.js.map +1 -1
- package/components/Table/createTableData.d.ts +6 -6
- package/components/Table/createTableData.js +8 -8
- package/components/Table/createTableData.js.map +1 -1
- package/components/Table/useTableRow.d.ts +9 -4
- package/components/Table/useTableRow.js +10 -3
- package/components/Table/useTableRow.js.map +1 -1
- package/config/AcoConfig.d.ts +12 -7
- package/config/AcoConfig.js +0 -5
- package/config/AcoConfig.js.map +1 -1
- package/config/advanced-search/index.d.ts +1 -1
- package/config/advanced-search/index.js.map +1 -1
- package/config/folder/createFolderFieldDecoratorFactory.d.ts +1 -1
- package/config/folder/createFolderFieldDecoratorFactory.js.map +1 -1
- package/config/folder/index.d.ts +1 -1
- package/config/folder/index.js.map +1 -1
- package/config/record/index.d.ts +1 -1
- package/config/record/index.js.map +1 -1
- package/config/table/Column.d.ts +10 -4
- package/config/table/Column.js.map +1 -1
- package/config/table/index.d.ts +9 -4
- package/config/table/index.js.map +1 -1
- package/contexts/acoList.d.ts +1 -1
- package/contexts/acoList.js.map +1 -1
- package/contexts/app.d.ts +2 -2
- package/contexts/app.js.map +1 -1
- package/contexts/folder.d.ts +1 -1
- package/contexts/folder.js.map +1 -1
- package/contexts/folders.d.ts +2 -1
- package/contexts/folders.js.map +1 -1
- package/contexts/index.d.ts +1 -1
- package/contexts/index.js +1 -1
- package/contexts/index.js.map +1 -1
- package/contexts/records.d.ts +3 -2
- package/contexts/records.js.map +1 -1
- package/dialogs/DialogSetPermissions/UsersTeamsSelection/ListItemGraphic.d.ts +1 -1
- package/dialogs/DialogSetPermissions/UsersTeamsSelection/ListItemGraphic.js.map +1 -1
- package/dialogs/DialogSetPermissions/UsersTeamsSelection/ListItemMeta.d.ts +1 -1
- package/dialogs/DialogSetPermissions/UsersTeamsSelection/ListItemMeta.js.map +1 -1
- package/dialogs/DialogSetPermissions/UsersTeamsSelection/ListItemText.d.ts +1 -1
- package/dialogs/DialogSetPermissions/UsersTeamsSelection/ListItemText.js.map +1 -1
- package/dialogs/DialogSetPermissions/UsersTeamsSelection.d.ts +1 -1
- package/dialogs/DialogSetPermissions/UsersTeamsSelection.js.map +1 -1
- package/dialogs/useCreateDialog.js.map +1 -1
- package/dialogs/useDeleteDialog.d.ts +1 -1
- package/dialogs/useDeleteDialog.js.map +1 -1
- package/dialogs/useEditDialog.d.ts +1 -1
- package/dialogs/useEditDialog.js.map +1 -1
- package/dialogs/useMoveToFolderDialog.d.ts +3 -2
- package/dialogs/useMoveToFolderDialog.js.map +1 -1
- package/dialogs/useSetPermissionsDialog.d.ts +1 -1
- package/dialogs/useSetPermissionsDialog.js.map +1 -1
- package/features/folders/Folder.d.ts +1 -1
- package/features/folders/Folder.js.map +1 -1
- package/features/folders/cache/FoldersCacheFactory.d.ts +1 -1
- package/features/folders/cache/FoldersCacheFactory.js.map +1 -1
- package/features/folders/createFolder/CreateFolder.d.ts +2 -2
- package/features/folders/createFolder/CreateFolder.js.map +1 -1
- package/features/folders/createFolder/CreateFolderGqlGateway.d.ts +4 -4
- package/features/folders/createFolder/CreateFolderGqlGateway.js.map +1 -1
- package/features/folders/createFolder/CreateFolderRepository.d.ts +3 -3
- package/features/folders/createFolder/CreateFolderRepository.js.map +1 -1
- package/features/folders/createFolder/CreateFolderUseCase.d.ts +2 -2
- package/features/folders/createFolder/CreateFolderUseCase.js.map +1 -1
- package/features/folders/createFolder/CreateFolderUseCaseWithLoading.d.ts +2 -2
- package/features/folders/createFolder/CreateFolderUseCaseWithLoading.js.map +1 -1
- package/features/folders/createFolder/FolderDto.d.ts +1 -1
- package/features/folders/createFolder/FolderDto.js.map +1 -1
- package/features/folders/createFolder/FolderGqlDto.d.ts +1 -1
- package/features/folders/createFolder/FolderGqlDto.js.map +1 -1
- package/features/folders/createFolder/ICreateFolderGateway.d.ts +2 -2
- package/features/folders/createFolder/ICreateFolderGateway.js.map +1 -1
- package/features/folders/createFolder/ICreateFolderRepository.d.ts +1 -1
- package/features/folders/createFolder/ICreateFolderRepository.js.map +1 -1
- package/features/folders/createFolder/ICreateFolderUseCase.d.ts +1 -1
- package/features/folders/createFolder/ICreateFolderUseCase.js.map +1 -1
- package/features/folders/createFolder/useCreateFolder.d.ts +1 -1
- package/features/folders/createFolder/useCreateFolder.js.map +1 -1
- package/features/folders/deleteFolder/DeleteFolder.d.ts +2 -2
- package/features/folders/deleteFolder/DeleteFolder.js.map +1 -1
- package/features/folders/deleteFolder/DeleteFolderGqlGateway.d.ts +3 -3
- package/features/folders/deleteFolder/DeleteFolderGqlGateway.js.map +1 -1
- package/features/folders/deleteFolder/DeleteFolderRepository.d.ts +4 -4
- package/features/folders/deleteFolder/DeleteFolderRepository.js.map +1 -1
- package/features/folders/deleteFolder/DeleteFolderUseCase.d.ts +2 -2
- package/features/folders/deleteFolder/DeleteFolderUseCase.js.map +1 -1
- package/features/folders/deleteFolder/DeleteFolderUseCaseWithLoading.d.ts +2 -2
- package/features/folders/deleteFolder/DeleteFolderUseCaseWithLoading.js.map +1 -1
- package/features/folders/deleteFolder/IDeleteFolderRepository.d.ts +1 -1
- package/features/folders/deleteFolder/IDeleteFolderRepository.js.map +1 -1
- package/features/folders/deleteFolder/IDeleteFolderUseCase.d.ts +1 -1
- package/features/folders/deleteFolder/IDeleteFolderUseCase.js.map +1 -1
- package/features/folders/deleteFolder/useDeleteFolder.d.ts +1 -1
- package/features/folders/deleteFolder/useDeleteFolder.js.map +1 -1
- package/features/folders/getDescendantFolders/FolderDto.d.ts +1 -1
- package/features/folders/getDescendantFolders/FolderDto.js.map +1 -1
- package/features/folders/getDescendantFolders/GetDescendantFolders.d.ts +1 -1
- package/features/folders/getDescendantFolders/GetDescendantFolders.js.map +1 -1
- package/features/folders/getDescendantFolders/GetDescendantFoldersRepository.d.ts +3 -3
- package/features/folders/getDescendantFolders/GetDescendantFoldersRepository.js.map +1 -1
- package/features/folders/getDescendantFolders/GetDescendantFoldersUseCase.d.ts +2 -2
- package/features/folders/getDescendantFolders/GetDescendantFoldersUseCase.js.map +1 -1
- package/features/folders/getDescendantFolders/IGetDescendantFoldersRepository.d.ts +1 -1
- package/features/folders/getDescendantFolders/IGetDescendantFoldersRepository.js.map +1 -1
- package/features/folders/getDescendantFolders/IGetDescendantFoldersUseCase.d.ts +1 -1
- package/features/folders/getDescendantFolders/IGetDescendantFoldersUseCase.js.map +1 -1
- package/features/folders/getFolder/GetFolder.d.ts +2 -2
- package/features/folders/getFolder/GetFolder.js.map +1 -1
- package/features/folders/getFolder/GetFolderGqlGateway.d.ts +3 -3
- package/features/folders/getFolder/GetFolderGqlGateway.js.map +1 -1
- package/features/folders/getFolder/GetFolderRepository.d.ts +3 -3
- package/features/folders/getFolder/GetFolderRepository.js.map +1 -1
- package/features/folders/getFolder/GetFolderUseCase.d.ts +2 -2
- package/features/folders/getFolder/GetFolderUseCase.js.map +1 -1
- package/features/folders/getFolder/GetFolderUseCaseWithLoading.d.ts +2 -2
- package/features/folders/getFolder/GetFolderUseCaseWithLoading.js.map +1 -1
- package/features/folders/getFolder/IGetFolderGateway.d.ts +1 -1
- package/features/folders/getFolder/IGetFolderGateway.js.map +1 -1
- package/features/folders/getFolder/useGetFolder.d.ts +1 -1
- package/features/folders/getFolder/useGetFolder.js.map +1 -1
- package/features/folders/getFolderAncestors/FolderDto.d.ts +9 -0
- package/features/folders/getFolderAncestors/FolderDto.js +3 -0
- package/features/folders/getFolderAncestors/FolderDto.js.map +1 -0
- package/features/folders/getFolderAncestors/GetFolderAncestors.d.ts +4 -0
- package/features/folders/getFolderAncestors/GetFolderAncestors.js +12 -0
- package/features/folders/getFolderAncestors/GetFolderAncestors.js.map +1 -0
- package/features/folders/getFolderAncestors/GetFolderAncestors.test.d.ts +1 -0
- package/features/folders/getFolderAncestors/GetFolderAncestors.test.js +97 -0
- package/features/folders/getFolderAncestors/GetFolderAncestors.test.js.map +1 -0
- package/features/folders/getFolderAncestors/GetFolderAncestorsRepository.d.ts +7 -0
- package/features/folders/getFolderAncestors/GetFolderAncestorsRepository.js +25 -0
- package/features/folders/getFolderAncestors/GetFolderAncestorsRepository.js.map +1 -0
- package/features/folders/getFolderAncestors/GetFolderAncestorsUseCase.d.ts +14 -0
- package/features/folders/getFolderAncestors/GetFolderAncestorsUseCase.js +18 -0
- package/features/folders/getFolderAncestors/GetFolderAncestorsUseCase.js.map +1 -0
- package/features/folders/getFolderAncestors/IGetFolderAncestorsRepository.d.ts +4 -0
- package/features/folders/getFolderAncestors/IGetFolderAncestorsRepository.js +3 -0
- package/features/folders/getFolderAncestors/IGetFolderAncestorsRepository.js.map +1 -0
- package/features/folders/getFolderAncestors/IGetFolderAncestorsUseCase.d.ts +7 -0
- package/features/folders/getFolderAncestors/IGetFolderAncestorsUseCase.js +3 -0
- package/features/folders/getFolderAncestors/IGetFolderAncestorsUseCase.js.map +1 -0
- package/features/folders/getFolderAncestors/index.d.ts +1 -0
- package/features/folders/getFolderAncestors/index.js +3 -0
- package/features/folders/getFolderAncestors/index.js.map +1 -0
- package/features/folders/getFolderAncestors/useGetFolderAncestors.d.ts +3 -0
- package/features/folders/getFolderAncestors/useGetFolderAncestors.js +17 -0
- package/features/folders/getFolderAncestors/useGetFolderAncestors.js.map +1 -0
- package/features/folders/getFolderExtensionsFields/GetFolderExtensionsFieldsRepository.d.ts +1 -1
- package/features/folders/getFolderExtensionsFields/GetFolderExtensionsFieldsUseCase.d.ts +1 -1
- package/features/folders/getFolderExtensionsFields/GetFolderExtensionsFieldsUseCaseWithNamespace.d.ts +1 -1
- package/features/folders/getFolderExtensionsFields/GetFolderExtensionsFieldsUseCaseWithNamespaceAndModelId.d.ts +1 -1
- package/features/folders/getFolderExtensionsFields/IGetFolderExtensionsFieldsRepository.d.ts +1 -1
- package/features/folders/getFolderExtensionsFields/IGetFolderExtensionsFieldsRepository.js.map +1 -1
- package/features/folders/getFolderExtensionsFields/IGetFolderExtensionsFieldsUseCase.d.ts +1 -1
- package/features/folders/getFolderExtensionsFields/IGetFolderExtensionsFieldsUseCase.js.map +1 -1
- package/features/folders/getFolderExtensionsFields/useGetFolderExtensionsFields.d.ts +1 -1
- package/features/folders/getFolderHierarchy/FolderDto.d.ts +2 -2
- package/features/folders/getFolderHierarchy/FolderDto.js.map +1 -1
- package/features/folders/getFolderHierarchy/FolderGqlDto.d.ts +1 -1
- package/features/folders/getFolderHierarchy/FolderGqlDto.js.map +1 -1
- package/features/folders/getFolderHierarchy/GetFolderHierarchy.d.ts +5 -5
- package/features/folders/getFolderHierarchy/GetFolderHierarchy.js.map +1 -1
- package/features/folders/getFolderHierarchy/GetFolderHierarchyGqlGateway.d.ts +3 -3
- package/features/folders/getFolderHierarchy/GetFolderHierarchyGqlGateway.js.map +1 -1
- package/features/folders/getFolderHierarchy/GetFolderHierarchyRepository.d.ts +3 -3
- package/features/folders/getFolderHierarchy/GetFolderHierarchyRepository.js.map +1 -1
- package/features/folders/getFolderHierarchy/GetFolderHierarchyUseCase.d.ts +2 -2
- package/features/folders/getFolderHierarchy/GetFolderHierarchyUseCase.js.map +1 -1
- package/features/folders/getFolderHierarchy/GetFolderHierarchyUseCaseWithLoading.d.ts +2 -2
- package/features/folders/getFolderHierarchy/GetFolderHierarchyUseCaseWithLoading.js.map +1 -1
- package/features/folders/getFolderHierarchy/IGetFolderHierarchyGateway.d.ts +1 -1
- package/features/folders/getFolderHierarchy/IGetFolderHierarchyGateway.js.map +1 -1
- package/features/folders/getFolderHierarchy/useGetFolderHierarchy.d.ts +1 -1
- package/features/folders/getFolderHierarchy/useGetFolderHierarchy.js.map +1 -1
- package/features/folders/getFolderLevelPermission/GetFolderLevelPermission.d.ts +2 -2
- package/features/folders/getFolderLevelPermission/GetFolderLevelPermission.js.map +1 -1
- package/features/folders/getFolderLevelPermission/GetFolderLevelPermissionRepository.d.ts +4 -4
- package/features/folders/getFolderLevelPermission/GetFolderLevelPermissionRepository.js.map +1 -1
- package/features/folders/getFolderLevelPermission/GetFolderLevelPermissionUseCase.d.ts +1 -1
- package/features/folders/getFolderLevelPermission/GetFolderLevelPermissionUseCase.js.map +1 -1
- package/features/folders/getFolderLevelPermission/GetFolderLevelPermissionWithFlpUseCase.d.ts +2 -2
- package/features/folders/getFolderLevelPermission/GetFolderLevelPermissionWithFlpUseCase.js.map +1 -1
- package/features/folders/getFolderLevelPermission/useGetFolderLevelPermission.d.ts +1 -1
- package/features/folders/getFolderLevelPermission/useGetFolderLevelPermission.js.map +1 -1
- package/features/folders/getFolderModel/FolderModelContext.js.map +1 -1
- package/features/folders/getFolderModel/FolderModelDto.d.ts +1 -1
- package/features/folders/getFolderModel/FolderModelDto.js.map +1 -1
- package/features/folders/getFolderModel/GetFolderModel.d.ts +3 -3
- package/features/folders/getFolderModel/GetFolderModel.js.map +1 -1
- package/features/folders/getFolderModel/GetFolderModelGqlGateway.d.ts +4 -4
- package/features/folders/getFolderModel/GetFolderModelGqlGateway.js.map +1 -1
- package/features/folders/getFolderModel/GetFolderModelRepository.d.ts +2 -2
- package/features/folders/getFolderModel/GetFolderModelRepository.js.map +1 -1
- package/features/folders/getFolderModel/GetFolderModelUseCase.d.ts +2 -2
- package/features/folders/getFolderModel/GetFolderModelUseCase.js.map +1 -1
- package/features/folders/getFolderModel/IGetFolderModelGateway.d.ts +1 -1
- package/features/folders/getFolderModel/IGetFolderModelGateway.js.map +1 -1
- package/features/folders/getFolderModel/IGetFolderModelRepository.d.ts +1 -1
- package/features/folders/getFolderModel/IGetFolderModelRepository.js.map +1 -1
- package/features/folders/index.d.ts +1 -0
- package/features/folders/index.js +1 -0
- package/features/folders/index.js.map +1 -1
- package/features/folders/listFolders/FolderDto.d.ts +2 -2
- package/features/folders/listFolders/FolderDto.js.map +1 -1
- package/features/folders/listFolders/FolderGqlDto.d.ts +1 -1
- package/features/folders/listFolders/FolderGqlDto.js.map +1 -1
- package/features/folders/listFolders/IListFoldersGateway.d.ts +1 -1
- package/features/folders/listFolders/IListFoldersGateway.js.map +1 -1
- package/features/folders/listFolders/ListFolders.d.ts +5 -5
- package/features/folders/listFolders/ListFolders.js.map +1 -1
- package/features/folders/listFolders/ListFoldersCompressedGqlGateway.d.ts +3 -3
- package/features/folders/listFolders/ListFoldersCompressedGqlGateway.js.map +1 -1
- package/features/folders/listFolders/ListFoldersGqlGateway.d.ts +3 -3
- package/features/folders/listFolders/ListFoldersGqlGateway.js.map +1 -1
- package/features/folders/listFolders/ListFoldersRepository.d.ts +3 -3
- package/features/folders/listFolders/ListFoldersRepository.js.map +1 -1
- package/features/folders/listFolders/ListFoldersUseCase.d.ts +2 -2
- package/features/folders/listFolders/ListFoldersUseCase.js.map +1 -1
- package/features/folders/listFolders/ListFoldersUseCaseWithLoading.d.ts +2 -2
- package/features/folders/listFolders/ListFoldersUseCaseWithLoading.js.map +1 -1
- package/features/folders/listFolders/useListFolders.d.ts +1 -1
- package/features/folders/listFolders/useListFolders.js.map +1 -1
- package/features/folders/listFoldersByParentIds/FolderDto.d.ts +2 -2
- package/features/folders/listFoldersByParentIds/FolderDto.js.map +1 -1
- package/features/folders/listFoldersByParentIds/FolderGqlDto.d.ts +1 -1
- package/features/folders/listFoldersByParentIds/FolderGqlDto.js.map +1 -1
- package/features/folders/listFoldersByParentIds/IListFoldersByParentIdsGateway.d.ts +1 -1
- package/features/folders/listFoldersByParentIds/IListFoldersByParentIdsGateway.js.map +1 -1
- package/features/folders/listFoldersByParentIds/ListFoldersByParentIds.d.ts +5 -5
- package/features/folders/listFoldersByParentIds/ListFoldersByParentIds.js.map +1 -1
- package/features/folders/listFoldersByParentIds/ListFoldersByParentIdsGqlGateway.d.ts +3 -3
- package/features/folders/listFoldersByParentIds/ListFoldersByParentIdsGqlGateway.js.map +1 -1
- package/features/folders/listFoldersByParentIds/ListFoldersByParentIdsRepository.d.ts +3 -3
- package/features/folders/listFoldersByParentIds/ListFoldersByParentIdsRepository.js.map +1 -1
- package/features/folders/listFoldersByParentIds/ListFoldersByParentIdsRepositoryWithLoadedCache.d.ts +2 -2
- package/features/folders/listFoldersByParentIds/ListFoldersByParentIdsRepositoryWithLoadedCache.js.map +1 -1
- package/features/folders/listFoldersByParentIds/ListFoldersByParentIdsUseCase.d.ts +2 -2
- package/features/folders/listFoldersByParentIds/ListFoldersByParentIdsUseCase.js.map +1 -1
- package/features/folders/listFoldersByParentIds/ListFoldersByParentIdsUseCaseWithLoading.d.ts +3 -3
- package/features/folders/listFoldersByParentIds/ListFoldersByParentIdsUseCaseWithLoading.js.map +1 -1
- package/features/folders/listFoldersByParentIds/useListFoldersByParentIds.d.ts +1 -1
- package/features/folders/listFoldersByParentIds/useListFoldersByParentIds.js.map +1 -1
- package/features/folders/updateFolder/FolderDto.d.ts +1 -1
- package/features/folders/updateFolder/FolderDto.js.map +1 -1
- package/features/folders/updateFolder/FolderGqlDto.d.ts +1 -1
- package/features/folders/updateFolder/FolderGqlDto.js.map +1 -1
- package/features/folders/updateFolder/IUpdateFolderGateway.d.ts +2 -2
- package/features/folders/updateFolder/IUpdateFolderGateway.js.map +1 -1
- package/features/folders/updateFolder/IUpdateFolderRepository.d.ts +1 -1
- package/features/folders/updateFolder/IUpdateFolderRepository.js.map +1 -1
- package/features/folders/updateFolder/IUpdateFolderUseCase.d.ts +1 -1
- package/features/folders/updateFolder/IUpdateFolderUseCase.js.map +1 -1
- package/features/folders/updateFolder/UpdateFolder.d.ts +2 -2
- package/features/folders/updateFolder/UpdateFolder.js.map +1 -1
- package/features/folders/updateFolder/UpdateFolder.test.js.map +1 -1
- package/features/folders/updateFolder/UpdateFolderGqlGateway.d.ts +4 -4
- package/features/folders/updateFolder/UpdateFolderGqlGateway.js.map +1 -1
- package/features/folders/updateFolder/UpdateFolderRepository.d.ts +3 -3
- package/features/folders/updateFolder/UpdateFolderRepository.js.map +1 -1
- package/features/folders/updateFolder/UpdateFolderRepositoryWithPathChange.d.ts +2 -2
- package/features/folders/updateFolder/UpdateFolderRepositoryWithPathChange.js.map +1 -1
- package/features/folders/updateFolder/UpdateFolderRepositoryWithPermissionsChange.d.ts +2 -2
- package/features/folders/updateFolder/UpdateFolderRepositoryWithPermissionsChange.js.map +1 -1
- package/features/folders/updateFolder/UpdateFolderUseCase.d.ts +2 -2
- package/features/folders/updateFolder/UpdateFolderUseCase.js.map +1 -1
- package/features/folders/updateFolder/UpdateFolderUseCaseWithLoading.d.ts +2 -2
- package/features/folders/updateFolder/UpdateFolderUseCaseWithLoading.js.map +1 -1
- package/features/folders/updateFolder/UpdateFolderUseCaseWithoutInheritedPermissions.d.ts +1 -1
- package/features/folders/updateFolder/UpdateFolderUseCaseWithoutInheritedPermissions.js.map +1 -1
- package/features/folders/updateFolder/useUpdateFolder.d.ts +1 -1
- package/features/folders/updateFolder/useUpdateFolder.js.map +1 -1
- package/graphql/app.gql.d.ts +1 -1
- package/graphql/app.gql.js.map +1 -1
- package/graphql/records/common.d.ts +1 -1
- package/graphql/records/common.js.map +1 -1
- package/graphql/records/createRecord.d.ts +1 -1
- package/graphql/records/createRecord.js.map +1 -1
- package/graphql/records/deleteRecord.d.ts +1 -1
- package/graphql/records/deleteRecord.js.map +1 -1
- package/graphql/records/getRecord.d.ts +1 -1
- package/graphql/records/getRecord.js.map +1 -1
- package/graphql/records/listRecords.d.ts +1 -1
- package/graphql/records/listRecords.js.map +1 -1
- package/graphql/records/listTags.d.ts +1 -1
- package/graphql/records/listTags.js.map +1 -1
- package/graphql/records/moveRecord.d.ts +1 -1
- package/graphql/records/moveRecord.js.map +1 -1
- package/graphql/records/types.d.ts +1 -1
- package/graphql/records/types.js.map +1 -1
- package/graphql/records/updateRecord.d.ts +1 -1
- package/graphql/records/updateRecord.js.map +1 -1
- package/handlers.d.ts +4 -4
- package/handlers.js.map +1 -1
- package/hooks/useAcoApp.d.ts +1 -1
- package/hooks/useAcoApp.js.map +1 -1
- package/hooks/useAcoList.d.ts +2 -2
- package/hooks/useAcoList.js.map +1 -1
- package/hooks/useRecords.d.ts +2 -2
- package/hooks/useRecords.js.map +1 -1
- package/hooks/useTags.d.ts +1 -1
- package/hooks/useTags.js.map +1 -1
- package/index.d.ts +2 -0
- package/index.js +1 -0
- package/index.js.map +1 -1
- package/package.json +18 -18
- package/sorting.d.ts +1 -1
- package/sorting.js.map +1 -1
- package/table.types.d.ts +6 -4
- package/table.types.js.map +1 -1
- package/types.d.ts +2 -2
- package/types.js +0 -1
- package/types.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["gql","ROOT_FOLDER","UPDATE_FOLDER","FOLDER_FIELDS","UpdateFolderGqlGateway","constructor","client","modelFields","execute","folder","id","title","slug","permissions","parentId","extensions","data","response","mutate","mutation","variables","filter","p","inheritedFrom","Error","error","aco","updateFolder","message"],"sources":["UpdateFolderGqlGateway.ts"],"sourcesContent":["import ApolloClient from \"apollo-client\";\nimport gql from \"graphql-tag\";\nimport { IUpdateFolderGateway } from \"./IUpdateFolderGateway\";\nimport { FolderDto } from \"./FolderDto\";\nimport { AcoError, FolderItem } from \"~/types\";\nimport { ROOT_FOLDER } from \"~/constants\";\n\nexport interface UpdateFolderResponse {\n aco: {\n updateFolder: {\n data: FolderItem;\n error: AcoError | null;\n };\n };\n}\n\nexport interface UpdateFolderVariables {\n id: string;\n data: Partial<\n Omit<\n FolderItem,\n \"id\" | \"createdOn\" | \"createdBy\" | \"savedOn\" | \"savedBy\" | \"modifiedOn\" | \"modifiedBy\"\n >\n >;\n}\n\nexport const UPDATE_FOLDER = (FOLDER_FIELDS: string) => gql`\n mutation UpdateFolder($id: ID!, $data: FolderUpdateInput!) {\n aco {\n updateFolder(id: $id, data: $data) {\n data ${FOLDER_FIELDS}\n error {\n code\n data\n message\n }\n }\n }\n }\n`;\n\nexport class UpdateFolderGqlGateway implements IUpdateFolderGateway {\n private client: ApolloClient<any>;\n private modelFields: string;\n\n constructor(client: ApolloClient<any>, modelFields: string) {\n this.client = client;\n this.modelFields = modelFields;\n }\n\n async execute(folder: FolderDto) {\n const { id, title, slug, permissions, parentId, extensions } = folder;\n\n const { data: response } = await this.client.mutate<\n UpdateFolderResponse,\n UpdateFolderVariables\n >({\n mutation: UPDATE_FOLDER(this.modelFields),\n variables: {\n id,\n data: {\n title,\n slug,\n extensions,\n parentId: parentId === ROOT_FOLDER ? null : parentId,\n permissions: permissions.filter(p => !p.inheritedFrom)\n }\n }\n });\n\n if (!response) {\n throw new Error(\"Network error while updating folder.\");\n }\n\n const { data, error } = response.aco.updateFolder;\n\n if (!data) {\n throw new Error(error?.message || \"Could not update folder\");\n }\n\n return data;\n }\n}\n"],"mappings":"AACA,OAAOA,GAAG,MAAM,aAAa;AAI7B,SAASC,WAAW;AAqBpB,OAAO,MAAMC,aAAa,GAAIC,aAAqB,IAAKH,GAAG;AAC3D;AACA;AACA;AACA,uBAAuBG,aAAa;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAED,OAAO,MAAMC,sBAAsB,CAAiC;EAIhEC,WAAWA,CAACC,MAAyB,EAAEC,WAAmB,EAAE;IACxD,IAAI,CAACD,MAAM,GAAGA,MAAM;IACpB,IAAI,CAACC,WAAW,GAAGA,WAAW;EAClC;EAEA,MAAMC,OAAOA,CAACC,MAAiB,EAAE;IAC7B,MAAM;MAAEC,EAAE;MAAEC,KAAK;MAAEC,IAAI;MAAEC,WAAW;MAAEC,QAAQ;MAAEC;IAAW,CAAC,GAAGN,MAAM;IAErE,MAAM;MAAEO,IAAI,EAAEC;IAAS,CAAC,GAAG,MAAM,IAAI,CAACX,MAAM,CAACY,MAAM,CAGjD;MACEC,QAAQ,EAAEjB,aAAa,CAAC,IAAI,CAACK,WAAW,CAAC;MACzCa,SAAS,EAAE;QACPV,EAAE;QACFM,IAAI,EAAE;UACFL,KAAK;UACLC,IAAI;UACJG,UAAU;UACVD,QAAQ,EAAEA,QAAQ,KAAKb,WAAW,GAAG,IAAI,GAAGa,QAAQ;UACpDD,WAAW,EAAEA,WAAW,CAACQ,MAAM,CAACC,CAAC,IAAI,CAACA,CAAC,CAACC,aAAa;QACzD;MACJ;IACJ,CAAC,CAAC;IAEF,IAAI,CAACN,QAAQ,EAAE;MACX,MAAM,IAAIO,KAAK,CAAC,sCAAsC,CAAC;IAC3D;IAEA,MAAM;MAAER,IAAI;MAAES;IAAM,CAAC,GAAGR,QAAQ,CAACS,GAAG,CAACC,YAAY;IAEjD,IAAI,CAACX,IAAI,EAAE;MACP,MAAM,IAAIQ,KAAK,CAACC,KAAK,EAAEG,OAAO,IAAI,yBAAyB,CAAC;IAChE;IAEA,OAAOZ,IAAI;EACf;AACJ","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["gql","ROOT_FOLDER","UPDATE_FOLDER","FOLDER_FIELDS","UpdateFolderGqlGateway","constructor","client","modelFields","execute","folder","id","title","slug","permissions","parentId","extensions","data","response","mutate","mutation","variables","filter","p","inheritedFrom","Error","error","aco","updateFolder","message"],"sources":["UpdateFolderGqlGateway.ts"],"sourcesContent":["import type ApolloClient from \"apollo-client\";\nimport gql from \"graphql-tag\";\nimport type { IUpdateFolderGateway } from \"./IUpdateFolderGateway\";\nimport type { FolderDto } from \"./FolderDto\";\nimport type { AcoError, FolderItem } from \"~/types\";\nimport { ROOT_FOLDER } from \"~/constants\";\n\nexport interface UpdateFolderResponse {\n aco: {\n updateFolder: {\n data: FolderItem;\n error: AcoError | null;\n };\n };\n}\n\nexport interface UpdateFolderVariables {\n id: string;\n data: Partial<\n Omit<\n FolderItem,\n \"id\" | \"createdOn\" | \"createdBy\" | \"savedOn\" | \"savedBy\" | \"modifiedOn\" | \"modifiedBy\"\n >\n >;\n}\n\nexport const UPDATE_FOLDER = (FOLDER_FIELDS: string) => gql`\n mutation UpdateFolder($id: ID!, $data: FolderUpdateInput!) {\n aco {\n updateFolder(id: $id, data: $data) {\n data ${FOLDER_FIELDS}\n error {\n code\n data\n message\n }\n }\n }\n }\n`;\n\nexport class UpdateFolderGqlGateway implements IUpdateFolderGateway {\n private client: ApolloClient<any>;\n private modelFields: string;\n\n constructor(client: ApolloClient<any>, modelFields: string) {\n this.client = client;\n this.modelFields = modelFields;\n }\n\n async execute(folder: FolderDto) {\n const { id, title, slug, permissions, parentId, extensions } = folder;\n\n const { data: response } = await this.client.mutate<\n UpdateFolderResponse,\n UpdateFolderVariables\n >({\n mutation: UPDATE_FOLDER(this.modelFields),\n variables: {\n id,\n data: {\n title,\n slug,\n extensions,\n parentId: parentId === ROOT_FOLDER ? null : parentId,\n permissions: permissions.filter(p => !p.inheritedFrom)\n }\n }\n });\n\n if (!response) {\n throw new Error(\"Network error while updating folder.\");\n }\n\n const { data, error } = response.aco.updateFolder;\n\n if (!data) {\n throw new Error(error?.message || \"Could not update folder\");\n }\n\n return data;\n }\n}\n"],"mappings":"AACA,OAAOA,GAAG,MAAM,aAAa;AAI7B,SAASC,WAAW;AAqBpB,OAAO,MAAMC,aAAa,GAAIC,aAAqB,IAAKH,GAAG;AAC3D;AACA;AACA;AACA,uBAAuBG,aAAa;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAED,OAAO,MAAMC,sBAAsB,CAAiC;EAIhEC,WAAWA,CAACC,MAAyB,EAAEC,WAAmB,EAAE;IACxD,IAAI,CAACD,MAAM,GAAGA,MAAM;IACpB,IAAI,CAACC,WAAW,GAAGA,WAAW;EAClC;EAEA,MAAMC,OAAOA,CAACC,MAAiB,EAAE;IAC7B,MAAM;MAAEC,EAAE;MAAEC,KAAK;MAAEC,IAAI;MAAEC,WAAW;MAAEC,QAAQ;MAAEC;IAAW,CAAC,GAAGN,MAAM;IAErE,MAAM;MAAEO,IAAI,EAAEC;IAAS,CAAC,GAAG,MAAM,IAAI,CAACX,MAAM,CAACY,MAAM,CAGjD;MACEC,QAAQ,EAAEjB,aAAa,CAAC,IAAI,CAACK,WAAW,CAAC;MACzCa,SAAS,EAAE;QACPV,EAAE;QACFM,IAAI,EAAE;UACFL,KAAK;UACLC,IAAI;UACJG,UAAU;UACVD,QAAQ,EAAEA,QAAQ,KAAKb,WAAW,GAAG,IAAI,GAAGa,QAAQ;UACpDD,WAAW,EAAEA,WAAW,CAACQ,MAAM,CAACC,CAAC,IAAI,CAACA,CAAC,CAACC,aAAa;QACzD;MACJ;IACJ,CAAC,CAAC;IAEF,IAAI,CAACN,QAAQ,EAAE;MACX,MAAM,IAAIO,KAAK,CAAC,sCAAsC,CAAC;IAC3D;IAEA,MAAM;MAAER,IAAI;MAAES;IAAM,CAAC,GAAGR,QAAQ,CAACS,GAAG,CAACC,YAAY;IAEjD,IAAI,CAACX,IAAI,EAAE;MACP,MAAM,IAAIQ,KAAK,CAACC,KAAK,EAAEG,OAAO,IAAI,yBAAyB,CAAC;IAChE;IAEA,OAAOZ,IAAI;EACf;AACJ","ignoreList":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { IUpdateFolderRepository } from "./IUpdateFolderRepository";
|
|
2
|
-
import { ListCache } from "../cache";
|
|
1
|
+
import type { IUpdateFolderRepository } from "./IUpdateFolderRepository";
|
|
2
|
+
import type { ListCache } from "../cache";
|
|
3
3
|
import { Folder } from "../Folder";
|
|
4
|
-
import { IUpdateFolderGateway } from "./IUpdateFolderGateway";
|
|
4
|
+
import type { IUpdateFolderGateway } from "./IUpdateFolderGateway";
|
|
5
5
|
export declare class UpdateFolderRepository implements IUpdateFolderRepository {
|
|
6
6
|
private cache;
|
|
7
7
|
private gateway;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Folder","UpdateFolderRepository","constructor","cache","gateway","execute","folder","dto","id","title","slug","permissions","parentId","extensions","result","updateItems","f","create"],"sources":["UpdateFolderRepository.ts"],"sourcesContent":["import { IUpdateFolderRepository } from \"./IUpdateFolderRepository\";\nimport { ListCache } from \"../cache\";\nimport { Folder } from \"../Folder\";\nimport { IUpdateFolderGateway } from \"./IUpdateFolderGateway\";\nimport { FolderDto } from \"./FolderDto\";\n\nexport class UpdateFolderRepository implements IUpdateFolderRepository {\n private cache: ListCache<Folder>;\n private gateway: IUpdateFolderGateway;\n\n constructor(cache: ListCache<Folder>, gateway: IUpdateFolderGateway) {\n this.cache = cache;\n this.gateway = gateway;\n }\n\n async execute(folder: Folder) {\n const dto: FolderDto = {\n id: folder.id,\n title: folder.title,\n slug: folder.slug,\n permissions: folder.permissions,\n parentId: folder.parentId,\n extensions: folder.extensions\n };\n\n const result = await this.gateway.execute(dto);\n\n this.cache.updateItems(f => {\n if (f.id === folder.id) {\n return Folder.create(result);\n }\n\n return Folder.create(f);\n });\n }\n}\n"],"mappings":"AAEA,SAASA,MAAM;AAIf,OAAO,MAAMC,sBAAsB,CAAoC;EAInEC,WAAWA,CAACC,KAAwB,EAAEC,OAA6B,EAAE;IACjE,IAAI,CAACD,KAAK,GAAGA,KAAK;IAClB,IAAI,CAACC,OAAO,GAAGA,OAAO;EAC1B;EAEA,MAAMC,OAAOA,CAACC,MAAc,EAAE;IAC1B,MAAMC,GAAc,GAAG;MACnBC,EAAE,EAAEF,MAAM,CAACE,EAAE;MACbC,KAAK,EAAEH,MAAM,CAACG,KAAK;MACnBC,IAAI,EAAEJ,MAAM,CAACI,IAAI;MACjBC,WAAW,EAAEL,MAAM,CAACK,WAAW;MAC/BC,QAAQ,EAAEN,MAAM,CAACM,QAAQ;MACzBC,UAAU,EAAEP,MAAM,CAACO;IACvB,CAAC;IAED,MAAMC,MAAM,GAAG,MAAM,IAAI,CAACV,OAAO,CAACC,OAAO,CAACE,GAAG,CAAC;IAE9C,IAAI,CAACJ,KAAK,CAACY,WAAW,CAACC,CAAC,IAAI;MACxB,IAAIA,CAAC,CAACR,EAAE,KAAKF,MAAM,CAACE,EAAE,EAAE;QACpB,OAAOR,MAAM,CAACiB,MAAM,CAACH,MAAM,CAAC;MAChC;MAEA,OAAOd,MAAM,CAACiB,MAAM,CAACD,CAAC,CAAC;IAC3B,CAAC,CAAC;EACN;AACJ","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["Folder","UpdateFolderRepository","constructor","cache","gateway","execute","folder","dto","id","title","slug","permissions","parentId","extensions","result","updateItems","f","create"],"sources":["UpdateFolderRepository.ts"],"sourcesContent":["import type { IUpdateFolderRepository } from \"./IUpdateFolderRepository\";\nimport type { ListCache } from \"../cache\";\nimport { Folder } from \"../Folder\";\nimport type { IUpdateFolderGateway } from \"./IUpdateFolderGateway\";\nimport type { FolderDto } from \"./FolderDto\";\n\nexport class UpdateFolderRepository implements IUpdateFolderRepository {\n private cache: ListCache<Folder>;\n private gateway: IUpdateFolderGateway;\n\n constructor(cache: ListCache<Folder>, gateway: IUpdateFolderGateway) {\n this.cache = cache;\n this.gateway = gateway;\n }\n\n async execute(folder: Folder) {\n const dto: FolderDto = {\n id: folder.id,\n title: folder.title,\n slug: folder.slug,\n permissions: folder.permissions,\n parentId: folder.parentId,\n extensions: folder.extensions\n };\n\n const result = await this.gateway.execute(dto);\n\n this.cache.updateItems(f => {\n if (f.id === folder.id) {\n return Folder.create(result);\n }\n\n return Folder.create(f);\n });\n }\n}\n"],"mappings":"AAEA,SAASA,MAAM;AAIf,OAAO,MAAMC,sBAAsB,CAAoC;EAInEC,WAAWA,CAACC,KAAwB,EAAEC,OAA6B,EAAE;IACjE,IAAI,CAACD,KAAK,GAAGA,KAAK;IAClB,IAAI,CAACC,OAAO,GAAGA,OAAO;EAC1B;EAEA,MAAMC,OAAOA,CAACC,MAAc,EAAE;IAC1B,MAAMC,GAAc,GAAG;MACnBC,EAAE,EAAEF,MAAM,CAACE,EAAE;MACbC,KAAK,EAAEH,MAAM,CAACG,KAAK;MACnBC,IAAI,EAAEJ,MAAM,CAACI,IAAI;MACjBC,WAAW,EAAEL,MAAM,CAACK,WAAW;MAC/BC,QAAQ,EAAEN,MAAM,CAACM,QAAQ;MACzBC,UAAU,EAAEP,MAAM,CAACO;IACvB,CAAC;IAED,MAAMC,MAAM,GAAG,MAAM,IAAI,CAACV,OAAO,CAACC,OAAO,CAACE,GAAG,CAAC;IAE9C,IAAI,CAACJ,KAAK,CAACY,WAAW,CAACC,CAAC,IAAI;MACxB,IAAIA,CAAC,CAACR,EAAE,KAAKF,MAAM,CAACE,EAAE,EAAE;QACpB,OAAOR,MAAM,CAACiB,MAAM,CAACH,MAAM,CAAC;MAChC;MAEA,OAAOd,MAAM,CAACiB,MAAM,CAACD,CAAC,CAAC;IAC3B,CAAC,CAAC;EACN;AACJ","ignoreList":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { IUpdateFolderRepository } from "./IUpdateFolderRepository";
|
|
2
|
-
import { ListCache } from "../cache";
|
|
1
|
+
import type { IUpdateFolderRepository } from "./IUpdateFolderRepository";
|
|
2
|
+
import type { ListCache } from "../cache";
|
|
3
3
|
import { Folder } from "../Folder";
|
|
4
4
|
export declare class UpdateFolderRepositoryWithPathChange implements IUpdateFolderRepository {
|
|
5
5
|
private cache;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Path","Folder","UpdateFolderRepositoryWithPathChange","constructor","cache","decoretee","execute","folder","folderPath","path","cachedFolderPath","getItem","f","id","updatedFolder","directChildren","listDirectChildren","length","updateChildrenPathsRecursively","children","parentFolder","child","updatedChild","updateItems","newPath","create","slug","updated","grandChildren","getItems","filter","parentId"],"sources":["UpdateFolderRepositoryWithPathChange.ts"],"sourcesContent":["import { Path } from \"@webiny/shared-aco\";\nimport { IUpdateFolderRepository } from \"./IUpdateFolderRepository\";\nimport { ListCache } from \"../cache\";\nimport { Folder } from \"../Folder\";\n\nexport class UpdateFolderRepositoryWithPathChange implements IUpdateFolderRepository {\n private cache: ListCache<Folder>;\n private decoretee: IUpdateFolderRepository;\n\n constructor(cache: ListCache<Folder>, decoretee: IUpdateFolderRepository) {\n this.cache = cache;\n this.decoretee = decoretee;\n }\n\n async execute(folder: Folder) {\n const folderPath = folder.path;\n const cachedFolderPath = this.cache.getItem(f => f.id === folder.id)?.path;\n\n // Update the folder\n await this.decoretee.execute(folder);\n\n // If the folder is not in the cache, we can't proceed to update its children paths.\n if (!cachedFolderPath) {\n return;\n }\n\n // If the folder path has not changed, we don't need to update anything.\n if (cachedFolderPath === folderPath) {\n return;\n }\n\n // Fetch the updated folder from the cache (with the new path)\n const updatedFolder = this.cache.getItem(f => f.id === folder.id);\n if (!updatedFolder) {\n return;\n }\n\n // List direct children of the updated folder\n const directChildren = this.listDirectChildren(updatedFolder);\n if (!directChildren.length) {\n return;\n }\n\n this.updateChildrenPathsRecursively(directChildren, updatedFolder);\n }\n\n private updateChildrenPathsRecursively(children: Folder[], parentFolder: Folder) {\n for (const child of children) {\n let updatedChild: Folder | undefined;\n\n // Update the child's path in the cache\n this.cache.updateItems(f => {\n if (f.id === child.id) {\n const newPath = Path.create(f.slug, parentFolder.path); // Use the updated parent's path\n const updated = Folder.create({\n ...f,\n path: newPath\n });\n\n updatedChild = updated; // Store the updated child for recursion\n return updated;\n }\n return f;\n });\n\n // Recurse for the child's children\n if (updatedChild) {\n const grandChildren = this.listDirectChildren(updatedChild);\n if (grandChildren.length) {\n this.updateChildrenPathsRecursively(grandChildren, updatedChild);\n }\n }\n }\n }\n\n private listDirectChildren(folder: Folder) {\n return this.cache.getItems().filter(f => f.parentId === folder.id);\n }\n}\n"],"mappings":"AAAA,SAASA,IAAI,QAAQ,oBAAoB;AAGzC,SAASC,MAAM;AAEf,OAAO,MAAMC,oCAAoC,CAAoC;EAIjFC,WAAWA,CAACC,KAAwB,EAAEC,SAAkC,EAAE;IACtE,IAAI,CAACD,KAAK,GAAGA,KAAK;IAClB,IAAI,CAACC,SAAS,GAAGA,SAAS;EAC9B;EAEA,MAAMC,OAAOA,CAACC,MAAc,EAAE;IAC1B,MAAMC,UAAU,GAAGD,MAAM,CAACE,IAAI;IAC9B,MAAMC,gBAAgB,GAAG,IAAI,CAACN,KAAK,CAACO,OAAO,CAACC,CAAC,IAAIA,CAAC,CAACC,EAAE,KAAKN,MAAM,CAACM,EAAE,CAAC,EAAEJ,IAAI;;IAE1E;IACA,MAAM,IAAI,CAACJ,SAAS,CAACC,OAAO,CAACC,MAAM,CAAC;;IAEpC;IACA,IAAI,CAACG,gBAAgB,EAAE;MACnB;IACJ;;IAEA;IACA,IAAIA,gBAAgB,KAAKF,UAAU,EAAE;MACjC;IACJ;;IAEA;IACA,MAAMM,aAAa,GAAG,IAAI,CAACV,KAAK,CAACO,OAAO,CAACC,CAAC,IAAIA,CAAC,CAACC,EAAE,KAAKN,MAAM,CAACM,EAAE,CAAC;IACjE,IAAI,CAACC,aAAa,EAAE;MAChB;IACJ;;IAEA;IACA,MAAMC,cAAc,GAAG,IAAI,CAACC,kBAAkB,CAACF,aAAa,CAAC;IAC7D,IAAI,CAACC,cAAc,CAACE,MAAM,EAAE;MACxB;IACJ;IAEA,IAAI,CAACC,8BAA8B,CAACH,cAAc,EAAED,aAAa,CAAC;EACtE;EAEQI,8BAA8BA,CAACC,QAAkB,EAAEC,YAAoB,EAAE;IAC7E,KAAK,MAAMC,KAAK,IAAIF,QAAQ,EAAE;MAC1B,IAAIG,YAAgC;;MAEpC;MACA,IAAI,CAAClB,KAAK,CAACmB,WAAW,CAACX,CAAC,IAAI;QACxB,IAAIA,CAAC,CAACC,EAAE,KAAKQ,KAAK,CAACR,EAAE,EAAE;UACnB,MAAMW,OAAO,GAAGxB,IAAI,CAACyB,MAAM,CAACb,CAAC,CAACc,IAAI,EAAEN,YAAY,CAACX,IAAI,CAAC,CAAC,CAAC;UACxD,MAAMkB,OAAO,GAAG1B,MAAM,CAACwB,MAAM,CAAC;YAC1B,GAAGb,CAAC;YACJH,IAAI,EAAEe;UACV,CAAC,CAAC;UAEFF,YAAY,GAAGK,OAAO,CAAC,CAAC;UACxB,OAAOA,OAAO;QAClB;QACA,OAAOf,CAAC;MACZ,CAAC,CAAC;;MAEF;MACA,IAAIU,YAAY,EAAE;QACd,MAAMM,aAAa,GAAG,IAAI,CAACZ,kBAAkB,CAACM,YAAY,CAAC;QAC3D,IAAIM,aAAa,CAACX,MAAM,EAAE;UACtB,IAAI,CAACC,8BAA8B,CAACU,aAAa,EAAEN,YAAY,CAAC;QACpE;MACJ;IACJ;EACJ;EAEQN,kBAAkBA,CAACT,MAAc,EAAE;IACvC,OAAO,IAAI,CAACH,KAAK,CAACyB,QAAQ,CAAC,CAAC,CAACC,MAAM,CAAClB,CAAC,IAAIA,CAAC,CAACmB,QAAQ,KAAKxB,MAAM,CAACM,EAAE,CAAC;EACtE;AACJ","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["Path","Folder","UpdateFolderRepositoryWithPathChange","constructor","cache","decoretee","execute","folder","folderPath","path","cachedFolderPath","getItem","f","id","updatedFolder","directChildren","listDirectChildren","length","updateChildrenPathsRecursively","children","parentFolder","child","updatedChild","updateItems","newPath","create","slug","updated","grandChildren","getItems","filter","parentId"],"sources":["UpdateFolderRepositoryWithPathChange.ts"],"sourcesContent":["import { Path } from \"@webiny/shared-aco\";\nimport type { IUpdateFolderRepository } from \"./IUpdateFolderRepository\";\nimport type { ListCache } from \"../cache\";\nimport { Folder } from \"../Folder\";\n\nexport class UpdateFolderRepositoryWithPathChange implements IUpdateFolderRepository {\n private cache: ListCache<Folder>;\n private decoretee: IUpdateFolderRepository;\n\n constructor(cache: ListCache<Folder>, decoretee: IUpdateFolderRepository) {\n this.cache = cache;\n this.decoretee = decoretee;\n }\n\n async execute(folder: Folder) {\n const folderPath = folder.path;\n const cachedFolderPath = this.cache.getItem(f => f.id === folder.id)?.path;\n\n // Update the folder\n await this.decoretee.execute(folder);\n\n // If the folder is not in the cache, we can't proceed to update its children paths.\n if (!cachedFolderPath) {\n return;\n }\n\n // If the folder path has not changed, we don't need to update anything.\n if (cachedFolderPath === folderPath) {\n return;\n }\n\n // Fetch the updated folder from the cache (with the new path)\n const updatedFolder = this.cache.getItem(f => f.id === folder.id);\n if (!updatedFolder) {\n return;\n }\n\n // List direct children of the updated folder\n const directChildren = this.listDirectChildren(updatedFolder);\n if (!directChildren.length) {\n return;\n }\n\n this.updateChildrenPathsRecursively(directChildren, updatedFolder);\n }\n\n private updateChildrenPathsRecursively(children: Folder[], parentFolder: Folder) {\n for (const child of children) {\n let updatedChild: Folder | undefined;\n\n // Update the child's path in the cache\n this.cache.updateItems(f => {\n if (f.id === child.id) {\n const newPath = Path.create(f.slug, parentFolder.path); // Use the updated parent's path\n const updated = Folder.create({\n ...f,\n path: newPath\n });\n\n updatedChild = updated; // Store the updated child for recursion\n return updated;\n }\n return f;\n });\n\n // Recurse for the child's children\n if (updatedChild) {\n const grandChildren = this.listDirectChildren(updatedChild);\n if (grandChildren.length) {\n this.updateChildrenPathsRecursively(grandChildren, updatedChild);\n }\n }\n }\n }\n\n private listDirectChildren(folder: Folder) {\n return this.cache.getItems().filter(f => f.parentId === folder.id);\n }\n}\n"],"mappings":"AAAA,SAASA,IAAI,QAAQ,oBAAoB;AAGzC,SAASC,MAAM;AAEf,OAAO,MAAMC,oCAAoC,CAAoC;EAIjFC,WAAWA,CAACC,KAAwB,EAAEC,SAAkC,EAAE;IACtE,IAAI,CAACD,KAAK,GAAGA,KAAK;IAClB,IAAI,CAACC,SAAS,GAAGA,SAAS;EAC9B;EAEA,MAAMC,OAAOA,CAACC,MAAc,EAAE;IAC1B,MAAMC,UAAU,GAAGD,MAAM,CAACE,IAAI;IAC9B,MAAMC,gBAAgB,GAAG,IAAI,CAACN,KAAK,CAACO,OAAO,CAACC,CAAC,IAAIA,CAAC,CAACC,EAAE,KAAKN,MAAM,CAACM,EAAE,CAAC,EAAEJ,IAAI;;IAE1E;IACA,MAAM,IAAI,CAACJ,SAAS,CAACC,OAAO,CAACC,MAAM,CAAC;;IAEpC;IACA,IAAI,CAACG,gBAAgB,EAAE;MACnB;IACJ;;IAEA;IACA,IAAIA,gBAAgB,KAAKF,UAAU,EAAE;MACjC;IACJ;;IAEA;IACA,MAAMM,aAAa,GAAG,IAAI,CAACV,KAAK,CAACO,OAAO,CAACC,CAAC,IAAIA,CAAC,CAACC,EAAE,KAAKN,MAAM,CAACM,EAAE,CAAC;IACjE,IAAI,CAACC,aAAa,EAAE;MAChB;IACJ;;IAEA;IACA,MAAMC,cAAc,GAAG,IAAI,CAACC,kBAAkB,CAACF,aAAa,CAAC;IAC7D,IAAI,CAACC,cAAc,CAACE,MAAM,EAAE;MACxB;IACJ;IAEA,IAAI,CAACC,8BAA8B,CAACH,cAAc,EAAED,aAAa,CAAC;EACtE;EAEQI,8BAA8BA,CAACC,QAAkB,EAAEC,YAAoB,EAAE;IAC7E,KAAK,MAAMC,KAAK,IAAIF,QAAQ,EAAE;MAC1B,IAAIG,YAAgC;;MAEpC;MACA,IAAI,CAAClB,KAAK,CAACmB,WAAW,CAACX,CAAC,IAAI;QACxB,IAAIA,CAAC,CAACC,EAAE,KAAKQ,KAAK,CAACR,EAAE,EAAE;UACnB,MAAMW,OAAO,GAAGxB,IAAI,CAACyB,MAAM,CAACb,CAAC,CAACc,IAAI,EAAEN,YAAY,CAACX,IAAI,CAAC,CAAC,CAAC;UACxD,MAAMkB,OAAO,GAAG1B,MAAM,CAACwB,MAAM,CAAC;YAC1B,GAAGb,CAAC;YACJH,IAAI,EAAEe;UACV,CAAC,CAAC;UAEFF,YAAY,GAAGK,OAAO,CAAC,CAAC;UACxB,OAAOA,OAAO;QAClB;QACA,OAAOf,CAAC;MACZ,CAAC,CAAC;;MAEF;MACA,IAAIU,YAAY,EAAE;QACd,MAAMM,aAAa,GAAG,IAAI,CAACZ,kBAAkB,CAACM,YAAY,CAAC;QAC3D,IAAIM,aAAa,CAACX,MAAM,EAAE;UACtB,IAAI,CAACC,8BAA8B,CAACU,aAAa,EAAEN,YAAY,CAAC;QACpE;MACJ;IACJ;EACJ;EAEQN,kBAAkBA,CAACT,MAAc,EAAE;IACvC,OAAO,IAAI,CAACH,KAAK,CAACyB,QAAQ,CAAC,CAAC,CAACC,MAAM,CAAClB,CAAC,IAAIA,CAAC,CAACmB,QAAQ,KAAKxB,MAAM,CAACM,EAAE,CAAC;EACtE;AACJ","ignoreList":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { IUpdateFolderRepository } from "./IUpdateFolderRepository";
|
|
2
|
-
import { ListCache } from "../cache";
|
|
1
|
+
import type { IUpdateFolderRepository } from "./IUpdateFolderRepository";
|
|
2
|
+
import type { ListCache } from "../cache";
|
|
3
3
|
import { Folder } from "../Folder";
|
|
4
4
|
export declare class UpdateFolderRepositoryWithPermissionsChange implements IUpdateFolderRepository {
|
|
5
5
|
private cache;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["isEqual","Permissions","Folder","UpdateFolderRepositoryWithPermissionsChange","constructor","cache","decoretee","execute","folder","folderPermissions","permissions","cachedFolderPermissions","getItem","f","id","parentFolder","parentId","updatedFolder","updateFolderPermissions","directChildren","listDirectChildren","length","updateChildrenPermissionsRecursively","children","child","updatedChild","grandChildren","folderId","updateItems","create","getItems","filter"],"sources":["UpdateFolderRepositoryWithPermissionsChange.ts"],"sourcesContent":["import isEqual from \"lodash/isEqual\";\nimport { Permissions } from \"@webiny/shared-aco\";\nimport { IUpdateFolderRepository } from \"./IUpdateFolderRepository\";\nimport { ListCache } from \"../cache\";\nimport { Folder } from \"../Folder\";\n\nexport class UpdateFolderRepositoryWithPermissionsChange implements IUpdateFolderRepository {\n private cache: ListCache<Folder>;\n private decoretee: IUpdateFolderRepository;\n\n constructor(cache: ListCache<Folder>, decoretee: IUpdateFolderRepository) {\n this.cache = cache;\n this.decoretee = decoretee;\n }\n\n async execute(folder: Folder) {\n const folderPermissions = [...folder.permissions];\n const cachedFolderPermissions = this.cache.getItem(f => f.id === folder.id)?.permissions;\n\n // Let's run the original use case and update the folder.\n await this.decoretee.execute(folder);\n\n if (!cachedFolderPermissions) {\n // If the folder is not in the cache, we can't proceed to update its children permissions.\n return;\n }\n\n if (isEqual(cachedFolderPermissions, folderPermissions)) {\n // If the permissions are the same, we don't need to update anything.\n return;\n }\n\n // If the permissions have changed, we need to update the folder and its children.\n // Starting with the folder itself, inheriting permissions from its parent folder.\n const parentFolder = this.cache.getItem(f => f.id === folder.parentId);\n const updatedFolder = this.updateFolderPermissions(folder.id, parentFolder);\n\n // Now we need to update the permissions of all permissions of the folder's children.\n const directChildren = this.listDirectChildren(updatedFolder);\n if (directChildren.length) {\n this.updateChildrenPermissionsRecursively(directChildren, updatedFolder);\n }\n }\n\n private updateChildrenPermissionsRecursively(children: Folder[], parentFolder: Folder) {\n for (const child of children) {\n const updatedChild = this.updateFolderPermissions(child.id, parentFolder);\n const grandChildren = this.listDirectChildren(updatedChild);\n if (grandChildren.length) {\n this.updateChildrenPermissionsRecursively(grandChildren, updatedChild);\n }\n }\n }\n\n private updateFolderPermissions(folderId: string, parentFolder: Folder | undefined): Folder {\n let updatedFolder: Folder | undefined;\n this.cache.updateItems(f => {\n if (f.id === folderId) {\n const permissions = Permissions.create(f.permissions, parentFolder);\n updatedFolder = Folder.create({ ...f, permissions });\n return updatedFolder;\n }\n return f;\n });\n\n return updatedFolder!;\n }\n\n private listDirectChildren(folder: Folder) {\n return this.cache.getItems().filter(f => f.parentId === folder.id);\n }\n}\n"],"mappings":"AAAA,OAAOA,OAAO,MAAM,gBAAgB;AACpC,SAASC,WAAW,QAAQ,oBAAoB;AAGhD,SAASC,MAAM;AAEf,OAAO,MAAMC,2CAA2C,CAAoC;EAIxFC,WAAWA,CAACC,KAAwB,EAAEC,SAAkC,EAAE;IACtE,IAAI,CAACD,KAAK,GAAGA,KAAK;IAClB,IAAI,CAACC,SAAS,GAAGA,SAAS;EAC9B;EAEA,MAAMC,OAAOA,CAACC,MAAc,EAAE;IAC1B,MAAMC,iBAAiB,GAAG,CAAC,GAAGD,MAAM,CAACE,WAAW,CAAC;IACjD,MAAMC,uBAAuB,GAAG,IAAI,CAACN,KAAK,CAACO,OAAO,CAACC,CAAC,IAAIA,CAAC,CAACC,EAAE,KAAKN,MAAM,CAACM,EAAE,CAAC,EAAEJ,WAAW;;IAExF;IACA,MAAM,IAAI,CAACJ,SAAS,CAACC,OAAO,CAACC,MAAM,CAAC;IAEpC,IAAI,CAACG,uBAAuB,EAAE;MAC1B;MACA;IACJ;IAEA,IAAIX,OAAO,CAACW,uBAAuB,EAAEF,iBAAiB,CAAC,EAAE;MACrD;MACA;IACJ;;IAEA;IACA;IACA,MAAMM,YAAY,GAAG,IAAI,CAACV,KAAK,CAACO,OAAO,CAACC,CAAC,IAAIA,CAAC,CAACC,EAAE,KAAKN,MAAM,CAACQ,QAAQ,CAAC;IACtE,MAAMC,aAAa,GAAG,IAAI,CAACC,uBAAuB,CAACV,MAAM,CAACM,EAAE,EAAEC,YAAY,CAAC;;IAE3E;IACA,MAAMI,cAAc,GAAG,IAAI,CAACC,kBAAkB,CAACH,aAAa,CAAC;IAC7D,IAAIE,cAAc,CAACE,MAAM,EAAE;MACvB,IAAI,CAACC,oCAAoC,CAACH,cAAc,EAAEF,aAAa,CAAC;IAC5E;EACJ;EAEQK,oCAAoCA,CAACC,QAAkB,EAAER,YAAoB,EAAE;IACnF,KAAK,MAAMS,KAAK,IAAID,QAAQ,EAAE;MAC1B,MAAME,YAAY,GAAG,IAAI,CAACP,uBAAuB,CAACM,KAAK,CAACV,EAAE,EAAEC,YAAY,CAAC;MACzE,MAAMW,aAAa,GAAG,IAAI,CAACN,kBAAkB,CAACK,YAAY,CAAC;MAC3D,IAAIC,aAAa,CAACL,MAAM,EAAE;QACtB,IAAI,CAACC,oCAAoC,CAACI,aAAa,EAAED,YAAY,CAAC;MAC1E;IACJ;EACJ;EAEQP,uBAAuBA,CAACS,QAAgB,EAAEZ,YAAgC,EAAU;IACxF,IAAIE,aAAiC;IACrC,IAAI,CAACZ,KAAK,CAACuB,WAAW,CAACf,CAAC,IAAI;MACxB,IAAIA,CAAC,CAACC,EAAE,KAAKa,QAAQ,EAAE;QACnB,MAAMjB,WAAW,GAAGT,WAAW,CAAC4B,MAAM,CAAChB,CAAC,CAACH,WAAW,EAAEK,YAAY,CAAC;QACnEE,aAAa,GAAGf,MAAM,CAAC2B,MAAM,CAAC;UAAE,GAAGhB,CAAC;UAAEH;QAAY,CAAC,CAAC;QACpD,OAAOO,aAAa;MACxB;MACA,OAAOJ,CAAC;IACZ,CAAC,CAAC;IAEF,OAAOI,aAAa;EACxB;EAEQG,kBAAkBA,CAACZ,MAAc,EAAE;IACvC,OAAO,IAAI,CAACH,KAAK,CAACyB,QAAQ,CAAC,CAAC,CAACC,MAAM,CAAClB,CAAC,IAAIA,CAAC,CAACG,QAAQ,KAAKR,MAAM,CAACM,EAAE,CAAC;EACtE;AACJ","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["isEqual","Permissions","Folder","UpdateFolderRepositoryWithPermissionsChange","constructor","cache","decoretee","execute","folder","folderPermissions","permissions","cachedFolderPermissions","getItem","f","id","parentFolder","parentId","updatedFolder","updateFolderPermissions","directChildren","listDirectChildren","length","updateChildrenPermissionsRecursively","children","child","updatedChild","grandChildren","folderId","updateItems","create","getItems","filter"],"sources":["UpdateFolderRepositoryWithPermissionsChange.ts"],"sourcesContent":["import isEqual from \"lodash/isEqual\";\nimport { Permissions } from \"@webiny/shared-aco\";\nimport type { IUpdateFolderRepository } from \"./IUpdateFolderRepository\";\nimport type { ListCache } from \"../cache\";\nimport { Folder } from \"../Folder\";\n\nexport class UpdateFolderRepositoryWithPermissionsChange implements IUpdateFolderRepository {\n private cache: ListCache<Folder>;\n private decoretee: IUpdateFolderRepository;\n\n constructor(cache: ListCache<Folder>, decoretee: IUpdateFolderRepository) {\n this.cache = cache;\n this.decoretee = decoretee;\n }\n\n async execute(folder: Folder) {\n const folderPermissions = [...folder.permissions];\n const cachedFolderPermissions = this.cache.getItem(f => f.id === folder.id)?.permissions;\n\n // Let's run the original use case and update the folder.\n await this.decoretee.execute(folder);\n\n if (!cachedFolderPermissions) {\n // If the folder is not in the cache, we can't proceed to update its children permissions.\n return;\n }\n\n if (isEqual(cachedFolderPermissions, folderPermissions)) {\n // If the permissions are the same, we don't need to update anything.\n return;\n }\n\n // If the permissions have changed, we need to update the folder and its children.\n // Starting with the folder itself, inheriting permissions from its parent folder.\n const parentFolder = this.cache.getItem(f => f.id === folder.parentId);\n const updatedFolder = this.updateFolderPermissions(folder.id, parentFolder);\n\n // Now we need to update the permissions of all permissions of the folder's children.\n const directChildren = this.listDirectChildren(updatedFolder);\n if (directChildren.length) {\n this.updateChildrenPermissionsRecursively(directChildren, updatedFolder);\n }\n }\n\n private updateChildrenPermissionsRecursively(children: Folder[], parentFolder: Folder) {\n for (const child of children) {\n const updatedChild = this.updateFolderPermissions(child.id, parentFolder);\n const grandChildren = this.listDirectChildren(updatedChild);\n if (grandChildren.length) {\n this.updateChildrenPermissionsRecursively(grandChildren, updatedChild);\n }\n }\n }\n\n private updateFolderPermissions(folderId: string, parentFolder: Folder | undefined): Folder {\n let updatedFolder: Folder | undefined;\n this.cache.updateItems(f => {\n if (f.id === folderId) {\n const permissions = Permissions.create(f.permissions, parentFolder);\n updatedFolder = Folder.create({ ...f, permissions });\n return updatedFolder;\n }\n return f;\n });\n\n return updatedFolder!;\n }\n\n private listDirectChildren(folder: Folder) {\n return this.cache.getItems().filter(f => f.parentId === folder.id);\n }\n}\n"],"mappings":"AAAA,OAAOA,OAAO,MAAM,gBAAgB;AACpC,SAASC,WAAW,QAAQ,oBAAoB;AAGhD,SAASC,MAAM;AAEf,OAAO,MAAMC,2CAA2C,CAAoC;EAIxFC,WAAWA,CAACC,KAAwB,EAAEC,SAAkC,EAAE;IACtE,IAAI,CAACD,KAAK,GAAGA,KAAK;IAClB,IAAI,CAACC,SAAS,GAAGA,SAAS;EAC9B;EAEA,MAAMC,OAAOA,CAACC,MAAc,EAAE;IAC1B,MAAMC,iBAAiB,GAAG,CAAC,GAAGD,MAAM,CAACE,WAAW,CAAC;IACjD,MAAMC,uBAAuB,GAAG,IAAI,CAACN,KAAK,CAACO,OAAO,CAACC,CAAC,IAAIA,CAAC,CAACC,EAAE,KAAKN,MAAM,CAACM,EAAE,CAAC,EAAEJ,WAAW;;IAExF;IACA,MAAM,IAAI,CAACJ,SAAS,CAACC,OAAO,CAACC,MAAM,CAAC;IAEpC,IAAI,CAACG,uBAAuB,EAAE;MAC1B;MACA;IACJ;IAEA,IAAIX,OAAO,CAACW,uBAAuB,EAAEF,iBAAiB,CAAC,EAAE;MACrD;MACA;IACJ;;IAEA;IACA;IACA,MAAMM,YAAY,GAAG,IAAI,CAACV,KAAK,CAACO,OAAO,CAACC,CAAC,IAAIA,CAAC,CAACC,EAAE,KAAKN,MAAM,CAACQ,QAAQ,CAAC;IACtE,MAAMC,aAAa,GAAG,IAAI,CAACC,uBAAuB,CAACV,MAAM,CAACM,EAAE,EAAEC,YAAY,CAAC;;IAE3E;IACA,MAAMI,cAAc,GAAG,IAAI,CAACC,kBAAkB,CAACH,aAAa,CAAC;IAC7D,IAAIE,cAAc,CAACE,MAAM,EAAE;MACvB,IAAI,CAACC,oCAAoC,CAACH,cAAc,EAAEF,aAAa,CAAC;IAC5E;EACJ;EAEQK,oCAAoCA,CAACC,QAAkB,EAAER,YAAoB,EAAE;IACnF,KAAK,MAAMS,KAAK,IAAID,QAAQ,EAAE;MAC1B,MAAME,YAAY,GAAG,IAAI,CAACP,uBAAuB,CAACM,KAAK,CAACV,EAAE,EAAEC,YAAY,CAAC;MACzE,MAAMW,aAAa,GAAG,IAAI,CAACN,kBAAkB,CAACK,YAAY,CAAC;MAC3D,IAAIC,aAAa,CAACL,MAAM,EAAE;QACtB,IAAI,CAACC,oCAAoC,CAACI,aAAa,EAAED,YAAY,CAAC;MAC1E;IACJ;EACJ;EAEQP,uBAAuBA,CAACS,QAAgB,EAAEZ,YAAgC,EAAU;IACxF,IAAIE,aAAiC;IACrC,IAAI,CAACZ,KAAK,CAACuB,WAAW,CAACf,CAAC,IAAI;MACxB,IAAIA,CAAC,CAACC,EAAE,KAAKa,QAAQ,EAAE;QACnB,MAAMjB,WAAW,GAAGT,WAAW,CAAC4B,MAAM,CAAChB,CAAC,CAACH,WAAW,EAAEK,YAAY,CAAC;QACnEE,aAAa,GAAGf,MAAM,CAAC2B,MAAM,CAAC;UAAE,GAAGhB,CAAC;UAAEH;QAAY,CAAC,CAAC;QACpD,OAAOO,aAAa;MACxB;MACA,OAAOJ,CAAC;IACZ,CAAC,CAAC;IAEF,OAAOI,aAAa;EACxB;EAEQG,kBAAkBA,CAACZ,MAAc,EAAE;IACvC,OAAO,IAAI,CAACH,KAAK,CAACyB,QAAQ,CAAC,CAAC,CAACC,MAAM,CAAClB,CAAC,IAAIA,CAAC,CAACG,QAAQ,KAAKR,MAAM,CAACM,EAAE,CAAC;EACtE;AACJ","ignoreList":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { UpdateFolderParams, IUpdateFolderUseCase } from "./IUpdateFolderUseCase";
|
|
2
|
-
import { IUpdateFolderRepository } from "./IUpdateFolderRepository";
|
|
1
|
+
import type { UpdateFolderParams, IUpdateFolderUseCase } from "./IUpdateFolderUseCase";
|
|
2
|
+
import type { IUpdateFolderRepository } from "./IUpdateFolderRepository";
|
|
3
3
|
export declare class UpdateFolderUseCase implements IUpdateFolderUseCase {
|
|
4
4
|
private repository;
|
|
5
5
|
constructor(repository: IUpdateFolderRepository);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Folder","UpdateFolderUseCase","constructor","repository","execute","params","create","id","title","slug","type","parentId","permissions","extensions"],"sources":["UpdateFolderUseCase.ts"],"sourcesContent":["import { UpdateFolderParams, IUpdateFolderUseCase } from \"./IUpdateFolderUseCase\";\nimport { IUpdateFolderRepository } from \"./IUpdateFolderRepository\";\nimport { Folder } from \"../Folder\";\n\nexport class UpdateFolderUseCase implements IUpdateFolderUseCase {\n private repository: IUpdateFolderRepository;\n\n constructor(repository: IUpdateFolderRepository) {\n this.repository = repository;\n }\n\n async execute(params: UpdateFolderParams) {\n await this.repository.execute(\n Folder.create({\n id: params.id,\n title: params.title,\n slug: params.slug,\n type: params.type,\n parentId: params.parentId,\n permissions: params.permissions,\n extensions: params.extensions\n })\n );\n }\n}\n"],"mappings":"AAEA,SAASA,MAAM;AAEf,OAAO,MAAMC,mBAAmB,CAAiC;EAG7DC,WAAWA,CAACC,UAAmC,EAAE;IAC7C,IAAI,CAACA,UAAU,GAAGA,UAAU;EAChC;EAEA,MAAMC,OAAOA,CAACC,MAA0B,EAAE;IACtC,MAAM,IAAI,CAACF,UAAU,CAACC,OAAO,CACzBJ,MAAM,CAACM,MAAM,CAAC;MACVC,EAAE,EAAEF,MAAM,CAACE,EAAE;MACbC,KAAK,EAAEH,MAAM,CAACG,KAAK;MACnBC,IAAI,EAAEJ,MAAM,CAACI,IAAI;MACjBC,IAAI,EAAEL,MAAM,CAACK,IAAI;MACjBC,QAAQ,EAAEN,MAAM,CAACM,QAAQ;MACzBC,WAAW,EAAEP,MAAM,CAACO,WAAW;MAC/BC,UAAU,EAAER,MAAM,CAACQ;IACvB,CAAC,CACL,CAAC;EACL;AACJ","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["Folder","UpdateFolderUseCase","constructor","repository","execute","params","create","id","title","slug","type","parentId","permissions","extensions"],"sources":["UpdateFolderUseCase.ts"],"sourcesContent":["import type { UpdateFolderParams, IUpdateFolderUseCase } from \"./IUpdateFolderUseCase\";\nimport type { IUpdateFolderRepository } from \"./IUpdateFolderRepository\";\nimport { Folder } from \"../Folder\";\n\nexport class UpdateFolderUseCase implements IUpdateFolderUseCase {\n private repository: IUpdateFolderRepository;\n\n constructor(repository: IUpdateFolderRepository) {\n this.repository = repository;\n }\n\n async execute(params: UpdateFolderParams) {\n await this.repository.execute(\n Folder.create({\n id: params.id,\n title: params.title,\n slug: params.slug,\n type: params.type,\n parentId: params.parentId,\n permissions: params.permissions,\n extensions: params.extensions\n })\n );\n }\n}\n"],"mappings":"AAEA,SAASA,MAAM;AAEf,OAAO,MAAMC,mBAAmB,CAAiC;EAG7DC,WAAWA,CAACC,UAAmC,EAAE;IAC7C,IAAI,CAACA,UAAU,GAAGA,UAAU;EAChC;EAEA,MAAMC,OAAOA,CAACC,MAA0B,EAAE;IACtC,MAAM,IAAI,CAACF,UAAU,CAACC,OAAO,CACzBJ,MAAM,CAACM,MAAM,CAAC;MACVC,EAAE,EAAEF,MAAM,CAACE,EAAE;MACbC,KAAK,EAAEH,MAAM,CAACG,KAAK;MACnBC,IAAI,EAAEJ,MAAM,CAACI,IAAI;MACjBC,IAAI,EAAEL,MAAM,CAACK,IAAI;MACjBC,QAAQ,EAAEN,MAAM,CAACM,QAAQ;MACzBC,WAAW,EAAEP,MAAM,CAACO,WAAW;MAC/BC,UAAU,EAAER,MAAM,CAACQ;IACvB,CAAC,CACL,CAAC;EACL;AACJ","ignoreList":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ILoadingRepository } from "@webiny/app-utils";
|
|
2
|
-
import { IUpdateFolderUseCase, UpdateFolderParams } from "./IUpdateFolderUseCase";
|
|
1
|
+
import type { ILoadingRepository } from "@webiny/app-utils";
|
|
2
|
+
import type { IUpdateFolderUseCase, UpdateFolderParams } from "./IUpdateFolderUseCase";
|
|
3
3
|
export declare class UpdateFolderUseCaseWithLoading implements IUpdateFolderUseCase {
|
|
4
4
|
private loadingRepository;
|
|
5
5
|
private useCase;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["LoadingActionsEnum","UpdateFolderUseCaseWithLoading","constructor","loadingRepository","useCase","execute","params","runCallBack","update"],"sources":["UpdateFolderUseCaseWithLoading.ts"],"sourcesContent":["import { ILoadingRepository } from \"@webiny/app-utils\";\nimport { LoadingActionsEnum } from \"~/types\";\nimport { IUpdateFolderUseCase, UpdateFolderParams } from \"./IUpdateFolderUseCase\";\n\nexport class UpdateFolderUseCaseWithLoading implements IUpdateFolderUseCase {\n private loadingRepository: ILoadingRepository;\n private useCase: IUpdateFolderUseCase;\n\n constructor(loadingRepository: ILoadingRepository, useCase: IUpdateFolderUseCase) {\n this.loadingRepository = loadingRepository;\n this.useCase = useCase;\n }\n\n async execute(params: UpdateFolderParams) {\n await this.loadingRepository.runCallBack(\n this.useCase.execute(params),\n LoadingActionsEnum.update\n );\n }\n}\n"],"mappings":"AACA,SAASA,kBAAkB;AAG3B,OAAO,MAAMC,8BAA8B,CAAiC;EAIxEC,WAAWA,CAACC,iBAAqC,EAAEC,OAA6B,EAAE;IAC9E,IAAI,CAACD,iBAAiB,GAAGA,iBAAiB;IAC1C,IAAI,CAACC,OAAO,GAAGA,OAAO;EAC1B;EAEA,MAAMC,OAAOA,CAACC,MAA0B,EAAE;IACtC,MAAM,IAAI,CAACH,iBAAiB,CAACI,WAAW,CACpC,IAAI,CAACH,OAAO,CAACC,OAAO,CAACC,MAAM,CAAC,EAC5BN,kBAAkB,CAACQ,MACvB,CAAC;EACL;AACJ","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["LoadingActionsEnum","UpdateFolderUseCaseWithLoading","constructor","loadingRepository","useCase","execute","params","runCallBack","update"],"sources":["UpdateFolderUseCaseWithLoading.ts"],"sourcesContent":["import type { ILoadingRepository } from \"@webiny/app-utils\";\nimport { LoadingActionsEnum } from \"~/types\";\nimport type { IUpdateFolderUseCase, UpdateFolderParams } from \"./IUpdateFolderUseCase\";\n\nexport class UpdateFolderUseCaseWithLoading implements IUpdateFolderUseCase {\n private loadingRepository: ILoadingRepository;\n private useCase: IUpdateFolderUseCase;\n\n constructor(loadingRepository: ILoadingRepository, useCase: IUpdateFolderUseCase) {\n this.loadingRepository = loadingRepository;\n this.useCase = useCase;\n }\n\n async execute(params: UpdateFolderParams) {\n await this.loadingRepository.runCallBack(\n this.useCase.execute(params),\n LoadingActionsEnum.update\n );\n }\n}\n"],"mappings":"AACA,SAASA,kBAAkB;AAG3B,OAAO,MAAMC,8BAA8B,CAAiC;EAIxEC,WAAWA,CAACC,iBAAqC,EAAEC,OAA6B,EAAE;IAC9E,IAAI,CAACD,iBAAiB,GAAGA,iBAAiB;IAC1C,IAAI,CAACC,OAAO,GAAGA,OAAO;EAC1B;EAEA,MAAMC,OAAOA,CAACC,MAA0B,EAAE;IACtC,MAAM,IAAI,CAACH,iBAAiB,CAACI,WAAW,CACpC,IAAI,CAACH,OAAO,CAACC,OAAO,CAACC,MAAM,CAAC,EAC5BN,kBAAkB,CAACQ,MACvB,CAAC;EACL;AACJ","ignoreList":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IUpdateFolderUseCase, UpdateFolderParams } from "./IUpdateFolderUseCase";
|
|
1
|
+
import type { IUpdateFolderUseCase, UpdateFolderParams } from "./IUpdateFolderUseCase";
|
|
2
2
|
export declare class UpdateFolderUseCaseWithoutInheritedPermissions implements IUpdateFolderUseCase {
|
|
3
3
|
private useCase;
|
|
4
4
|
constructor(useCase: IUpdateFolderUseCase);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["UpdateFolderUseCaseWithoutInheritedPermissions","constructor","useCase","execute","params","permissions","filter","p","inheritedFrom"],"sources":["UpdateFolderUseCaseWithoutInheritedPermissions.ts"],"sourcesContent":["import { IUpdateFolderUseCase, UpdateFolderParams } from \"./IUpdateFolderUseCase\";\n\nexport class UpdateFolderUseCaseWithoutInheritedPermissions implements IUpdateFolderUseCase {\n private useCase: IUpdateFolderUseCase;\n\n constructor(useCase: IUpdateFolderUseCase) {\n this.useCase = useCase;\n }\n\n async execute(params: UpdateFolderParams) {\n // We must omit all inherited permissions.\n const permissions = params.permissions.filter(p => !p.inheritedFrom);\n\n await this.useCase.execute({\n ...params,\n permissions\n });\n }\n}\n"],"mappings":"AAEA,OAAO,MAAMA,8CAA8C,CAAiC;EAGxFC,WAAWA,CAACC,OAA6B,EAAE;IACvC,IAAI,CAACA,OAAO,GAAGA,OAAO;EAC1B;EAEA,MAAMC,OAAOA,CAACC,MAA0B,EAAE;IACtC;IACA,MAAMC,WAAW,GAAGD,MAAM,CAACC,WAAW,CAACC,MAAM,CAACC,CAAC,IAAI,CAACA,CAAC,CAACC,aAAa,CAAC;IAEpE,MAAM,IAAI,CAACN,OAAO,CAACC,OAAO,CAAC;MACvB,GAAGC,MAAM;MACTC;IACJ,CAAC,CAAC;EACN;AACJ","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["UpdateFolderUseCaseWithoutInheritedPermissions","constructor","useCase","execute","params","permissions","filter","p","inheritedFrom"],"sources":["UpdateFolderUseCaseWithoutInheritedPermissions.ts"],"sourcesContent":["import type { IUpdateFolderUseCase, UpdateFolderParams } from \"./IUpdateFolderUseCase\";\n\nexport class UpdateFolderUseCaseWithoutInheritedPermissions implements IUpdateFolderUseCase {\n private useCase: IUpdateFolderUseCase;\n\n constructor(useCase: IUpdateFolderUseCase) {\n this.useCase = useCase;\n }\n\n async execute(params: UpdateFolderParams) {\n // We must omit all inherited permissions.\n const permissions = params.permissions.filter(p => !p.inheritedFrom);\n\n await this.useCase.execute({\n ...params,\n permissions\n });\n }\n}\n"],"mappings":"AAEA,OAAO,MAAMA,8CAA8C,CAAiC;EAGxFC,WAAWA,CAACC,OAA6B,EAAE;IACvC,IAAI,CAACA,OAAO,GAAGA,OAAO;EAC1B;EAEA,MAAMC,OAAOA,CAACC,MAA0B,EAAE;IACtC;IACA,MAAMC,WAAW,GAAGD,MAAM,CAACC,WAAW,CAACC,MAAM,CAACC,CAAC,IAAI,CAACA,CAAC,CAACC,aAAa,CAAC;IAEpE,MAAM,IAAI,CAACN,OAAO,CAACC,OAAO,CAAC;MACvB,GAAGC,MAAM;MACTC;IACJ,CAAC,CAAC;EACN;AACJ","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useCallback","useApolloClient","UpdateFolderGqlGateway","UpdateFolder","useFoldersType","useGetFolderGraphQLSelection","useUpdateFolder","client","type","fields","gateway","updateFolder","params","instance","getInstance","execute"],"sources":["useUpdateFolder.ts"],"sourcesContent":["import { useCallback } from \"react\";\nimport { useApolloClient } from \"@apollo/react-hooks\";\nimport { UpdateFolderGqlGateway } from \"./UpdateFolderGqlGateway\";\nimport { UpdateFolder } from \"./UpdateFolder\";\nimport { UpdateFolderParams } from \"./IUpdateFolderUseCase\";\nimport { useFoldersType, useGetFolderGraphQLSelection } from \"~/hooks\";\n\nexport const useUpdateFolder = () => {\n const client = useApolloClient();\n const type = useFoldersType();\n const fields = useGetFolderGraphQLSelection();\n const gateway = new UpdateFolderGqlGateway(client, fields);\n\n const updateFolder = useCallback(\n (params: UpdateFolderParams) => {\n const instance = UpdateFolder.getInstance(type, gateway);\n return instance.execute(params);\n },\n [type, gateway]\n );\n\n return {\n updateFolder\n };\n};\n"],"mappings":"AAAA,SAASA,WAAW,QAAQ,OAAO;AACnC,SAASC,eAAe,QAAQ,qBAAqB;AACrD,SAASC,sBAAsB;AAC/B,SAASC,YAAY;AAErB,SAASC,cAAc,EAAEC,4BAA4B;AAErD,OAAO,MAAMC,eAAe,GAAGA,CAAA,KAAM;EACjC,MAAMC,MAAM,GAAGN,eAAe,CAAC,CAAC;EAChC,MAAMO,IAAI,GAAGJ,cAAc,CAAC,CAAC;EAC7B,MAAMK,MAAM,GAAGJ,4BAA4B,CAAC,CAAC;EAC7C,MAAMK,OAAO,GAAG,IAAIR,sBAAsB,CAACK,MAAM,EAAEE,MAAM,CAAC;EAE1D,MAAME,YAAY,GAAGX,WAAW,CAC3BY,MAA0B,IAAK;IAC5B,MAAMC,QAAQ,GAAGV,YAAY,CAACW,WAAW,CAACN,IAAI,EAAEE,OAAO,CAAC;IACxD,OAAOG,QAAQ,CAACE,OAAO,CAACH,MAAM,CAAC;EACnC,CAAC,EACD,CAACJ,IAAI,EAAEE,OAAO,CAClB,CAAC;EAED,OAAO;IACHC;EACJ,CAAC;AACL,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["useCallback","useApolloClient","UpdateFolderGqlGateway","UpdateFolder","useFoldersType","useGetFolderGraphQLSelection","useUpdateFolder","client","type","fields","gateway","updateFolder","params","instance","getInstance","execute"],"sources":["useUpdateFolder.ts"],"sourcesContent":["import { useCallback } from \"react\";\nimport { useApolloClient } from \"@apollo/react-hooks\";\nimport { UpdateFolderGqlGateway } from \"./UpdateFolderGqlGateway\";\nimport { UpdateFolder } from \"./UpdateFolder\";\nimport type { UpdateFolderParams } from \"./IUpdateFolderUseCase\";\nimport { useFoldersType, useGetFolderGraphQLSelection } from \"~/hooks\";\n\nexport const useUpdateFolder = () => {\n const client = useApolloClient();\n const type = useFoldersType();\n const fields = useGetFolderGraphQLSelection();\n const gateway = new UpdateFolderGqlGateway(client, fields);\n\n const updateFolder = useCallback(\n (params: UpdateFolderParams) => {\n const instance = UpdateFolder.getInstance(type, gateway);\n return instance.execute(params);\n },\n [type, gateway]\n );\n\n return {\n updateFolder\n };\n};\n"],"mappings":"AAAA,SAASA,WAAW,QAAQ,OAAO;AACnC,SAASC,eAAe,QAAQ,qBAAqB;AACrD,SAASC,sBAAsB;AAC/B,SAASC,YAAY;AAErB,SAASC,cAAc,EAAEC,4BAA4B;AAErD,OAAO,MAAMC,eAAe,GAAGA,CAAA,KAAM;EACjC,MAAMC,MAAM,GAAGN,eAAe,CAAC,CAAC;EAChC,MAAMO,IAAI,GAAGJ,cAAc,CAAC,CAAC;EAC7B,MAAMK,MAAM,GAAGJ,4BAA4B,CAAC,CAAC;EAC7C,MAAMK,OAAO,GAAG,IAAIR,sBAAsB,CAACK,MAAM,EAAEE,MAAM,CAAC;EAE1D,MAAME,YAAY,GAAGX,WAAW,CAC3BY,MAA0B,IAAK;IAC5B,MAAMC,QAAQ,GAAGV,YAAY,CAACW,WAAW,CAACN,IAAI,EAAEE,OAAO,CAAC;IACxD,OAAOG,QAAQ,CAACE,OAAO,CAACH,MAAM,CAAC;EACnC,CAAC,EACD,CAACJ,IAAI,EAAEE,OAAO,CAClB,CAAC;EAED,OAAO;IACHC;EACJ,CAAC;AACL,CAAC","ignoreList":[]}
|
package/graphql/app.gql.d.ts
CHANGED
package/graphql/app.gql.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["gql","createGetAppQuery"],"sources":["app.gql.ts"],"sourcesContent":["import gql from \"graphql-tag\";\nimport { AcoError, AcoModel } from \"~/types\";\n\nexport interface GraphQlAcoApp {\n id: string;\n model: AcoModel;\n}\nexport interface GetAppResult {\n aco: {\n app: {\n data: GraphQlAcoApp | null;\n error: AcoError | null;\n };\n };\n}\nexport interface GetAppVariables {\n id: string;\n}\n\nexport const createGetAppQuery = () => {\n return gql`\n query GetApp($id: ID!) {\n aco {\n app: getApp(id: $id) {\n data {\n id\n model\n }\n error {\n code\n message\n data\n stack\n }\n }\n }\n }\n `;\n};\n"],"mappings":"AAAA,OAAOA,GAAG,MAAM,aAAa;AAmB7B,OAAO,MAAMC,iBAAiB,GAAGA,CAAA,KAAM;EACnC,OAAOD,GAAG;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["gql","createGetAppQuery"],"sources":["app.gql.ts"],"sourcesContent":["import gql from \"graphql-tag\";\nimport type { AcoError, AcoModel } from \"~/types\";\n\nexport interface GraphQlAcoApp {\n id: string;\n model: AcoModel;\n}\nexport interface GetAppResult {\n aco: {\n app: {\n data: GraphQlAcoApp | null;\n error: AcoError | null;\n };\n };\n}\nexport interface GetAppVariables {\n id: string;\n}\n\nexport const createGetAppQuery = () => {\n return gql`\n query GetApp($id: ID!) {\n aco {\n app: getApp(id: $id) {\n data {\n id\n model\n }\n error {\n code\n message\n data\n stack\n }\n }\n }\n }\n `;\n};\n"],"mappings":"AAAA,OAAOA,GAAG,MAAM,aAAa;AAmB7B,OAAO,MAAMC,iBAAiB,GAAGA,CAAA,KAAM;EACnC,OAAOD,GAAG;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC","ignoreList":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AcoModel } from "../../types";
|
|
1
|
+
import type { AcoModel } from "../../types";
|
|
2
2
|
export declare const ERROR_FIELD = "\n error {\n code\n data\n message\n }\n";
|
|
3
3
|
export declare const createAppFields: (model: AcoModel) => string;
|
|
4
4
|
export declare const LIST_META_FIELD = "\n meta {\n cursor\n totalCount\n hasMoreItems\n }\n";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["plugins","ERROR_FIELD","defaultFields","createFieldsList","model","fields","fieldPlugins","byType","reduce","acc","item","field","type","collection","console","log","graphql","queryField","selection","push","fieldId","join","createAppFields","LIST_META_FIELD"],"sources":["common.ts"],"sourcesContent":["import { AcoModel, AcoModelField } from \"~/types\";\nimport { plugins } from \"@webiny/plugins\";\n\nexport const ERROR_FIELD = /* GraphQL */ `\n error {\n code\n data\n message\n }\n`;\ninterface CreateFieldsListParams {\n model: AcoModel;\n fields: AcoModelField[];\n}\n\nconst defaultFields = [\n \"id\",\n \"createdOn\",\n \"savedOn\",\n \"modifiedOn\",\n \"createdBy {id type displayName}\",\n \"savedBy {id type displayName}\",\n \"modifiedBy {id type displayName}\"\n];\n\nconst createFieldsList = ({ model, fields }: CreateFieldsListParams): string => {\n const fieldPlugins: Record<string, any> = plugins\n .byType(\"cms-editor-field-type\")\n .reduce((acc: any, item: any) => ({ ...acc, [item.field.type]: item.field }), {});\n\n return fields\n .reduce<string[]>(\n (collection, field) => {\n if (!fieldPlugins[field.type]) {\n console.log(`Unknown field plugin for field type \"${field.type}\".`);\n return collection;\n }\n const { graphql } = fieldPlugins[field.type];\n\n if (graphql && graphql.queryField) {\n const { queryField } = graphql;\n const selection =\n typeof queryField === \"string\" ? queryField : queryField({ model, field });\n\n collection.push(`${field.fieldId} ${selection}`);\n return collection;\n }\n\n collection.push(field.fieldId);\n\n return collection;\n },\n [...defaultFields]\n )\n .join(\"\\n\");\n};\n\nexport const createAppFields = (model: AcoModel) => {\n return createFieldsList({\n model,\n fields: model.fields\n });\n};\n\nexport const LIST_META_FIELD = /* GraphQL */ `\n meta {\n cursor\n totalCount\n hasMoreItems\n }\n`;\n"],"mappings":"AACA,SAASA,OAAO,QAAQ,iBAAiB;AAEzC,OAAO,MAAMC,WAAW,GAAG,aAAc;AACzC;AACA;AACA;AACA;AACA;AACA,CAAC;AAMD,MAAMC,aAAa,GAAG,CAClB,IAAI,EACJ,WAAW,EACX,SAAS,EACT,YAAY,EACZ,iCAAiC,EACjC,+BAA+B,EAC/B,kCAAkC,CACrC;AAED,MAAMC,gBAAgB,GAAGA,CAAC;EAAEC,KAAK;EAAEC;AAA+B,CAAC,KAAa;EAC5E,MAAMC,YAAiC,GAAGN,OAAO,CAC5CO,MAAM,CAAC,uBAAuB,CAAC,CAC/BC,MAAM,CAAC,CAACC,GAAQ,EAAEC,IAAS,MAAM;IAAE,GAAGD,GAAG;IAAE,CAACC,IAAI,CAACC,KAAK,CAACC,IAAI,GAAGF,IAAI,CAACC;EAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;EAErF,OAAON,MAAM,CACRG,MAAM,CACH,CAACK,UAAU,EAAEF,KAAK,KAAK;IACnB,IAAI,CAACL,YAAY,CAACK,KAAK,CAACC,IAAI,CAAC,EAAE;MAC3BE,OAAO,CAACC,GAAG,CAAC,wCAAwCJ,KAAK,CAACC,IAAI,IAAI,CAAC;MACnE,OAAOC,UAAU;IACrB;IACA,MAAM;MAAEG;IAAQ,CAAC,GAAGV,YAAY,CAACK,KAAK,CAACC,IAAI,CAAC;IAE5C,IAAII,OAAO,IAAIA,OAAO,CAACC,UAAU,EAAE;MAC/B,MAAM;QAAEA;MAAW,CAAC,GAAGD,OAAO;MAC9B,MAAME,SAAS,GACX,OAAOD,UAAU,KAAK,QAAQ,GAAGA,UAAU,GAAGA,UAAU,CAAC;QAAEb,KAAK;QAAEO;MAAM,CAAC,CAAC;MAE9EE,UAAU,CAACM,IAAI,CAAC,GAAGR,KAAK,CAACS,OAAO,IAAIF,SAAS,EAAE,CAAC;MAChD,OAAOL,UAAU;IACrB;IAEAA,UAAU,CAACM,IAAI,CAACR,KAAK,CAACS,OAAO,CAAC;IAE9B,OAAOP,UAAU;EACrB,CAAC,EACD,CAAC,GAAGX,aAAa,CACrB,CAAC,CACAmB,IAAI,CAAC,IAAI,CAAC;AACnB,CAAC;AAED,OAAO,MAAMC,eAAe,GAAIlB,KAAe,IAAK;EAChD,OAAOD,gBAAgB,CAAC;IACpBC,KAAK;IACLC,MAAM,EAAED,KAAK,CAACC;EAClB,CAAC,CAAC;AACN,CAAC;AAED,OAAO,MAAMkB,eAAe,GAAG,aAAc;AAC7C;AACA;AACA;AACA;AACA;AACA,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["plugins","ERROR_FIELD","defaultFields","createFieldsList","model","fields","fieldPlugins","byType","reduce","acc","item","field","type","collection","console","log","graphql","queryField","selection","push","fieldId","join","createAppFields","LIST_META_FIELD"],"sources":["common.ts"],"sourcesContent":["import type { AcoModel, AcoModelField } from \"~/types\";\nimport { plugins } from \"@webiny/plugins\";\n\nexport const ERROR_FIELD = /* GraphQL */ `\n error {\n code\n data\n message\n }\n`;\ninterface CreateFieldsListParams {\n model: AcoModel;\n fields: AcoModelField[];\n}\n\nconst defaultFields = [\n \"id\",\n \"createdOn\",\n \"savedOn\",\n \"modifiedOn\",\n \"createdBy {id type displayName}\",\n \"savedBy {id type displayName}\",\n \"modifiedBy {id type displayName}\"\n];\n\nconst createFieldsList = ({ model, fields }: CreateFieldsListParams): string => {\n const fieldPlugins: Record<string, any> = plugins\n .byType(\"cms-editor-field-type\")\n .reduce((acc: any, item: any) => ({ ...acc, [item.field.type]: item.field }), {});\n\n return fields\n .reduce<string[]>(\n (collection, field) => {\n if (!fieldPlugins[field.type]) {\n console.log(`Unknown field plugin for field type \"${field.type}\".`);\n return collection;\n }\n const { graphql } = fieldPlugins[field.type];\n\n if (graphql && graphql.queryField) {\n const { queryField } = graphql;\n const selection =\n typeof queryField === \"string\" ? queryField : queryField({ model, field });\n\n collection.push(`${field.fieldId} ${selection}`);\n return collection;\n }\n\n collection.push(field.fieldId);\n\n return collection;\n },\n [...defaultFields]\n )\n .join(\"\\n\");\n};\n\nexport const createAppFields = (model: AcoModel) => {\n return createFieldsList({\n model,\n fields: model.fields\n });\n};\n\nexport const LIST_META_FIELD = /* GraphQL */ `\n meta {\n cursor\n totalCount\n hasMoreItems\n }\n`;\n"],"mappings":"AACA,SAASA,OAAO,QAAQ,iBAAiB;AAEzC,OAAO,MAAMC,WAAW,GAAG,aAAc;AACzC;AACA;AACA;AACA;AACA;AACA,CAAC;AAMD,MAAMC,aAAa,GAAG,CAClB,IAAI,EACJ,WAAW,EACX,SAAS,EACT,YAAY,EACZ,iCAAiC,EACjC,+BAA+B,EAC/B,kCAAkC,CACrC;AAED,MAAMC,gBAAgB,GAAGA,CAAC;EAAEC,KAAK;EAAEC;AAA+B,CAAC,KAAa;EAC5E,MAAMC,YAAiC,GAAGN,OAAO,CAC5CO,MAAM,CAAC,uBAAuB,CAAC,CAC/BC,MAAM,CAAC,CAACC,GAAQ,EAAEC,IAAS,MAAM;IAAE,GAAGD,GAAG;IAAE,CAACC,IAAI,CAACC,KAAK,CAACC,IAAI,GAAGF,IAAI,CAACC;EAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;EAErF,OAAON,MAAM,CACRG,MAAM,CACH,CAACK,UAAU,EAAEF,KAAK,KAAK;IACnB,IAAI,CAACL,YAAY,CAACK,KAAK,CAACC,IAAI,CAAC,EAAE;MAC3BE,OAAO,CAACC,GAAG,CAAC,wCAAwCJ,KAAK,CAACC,IAAI,IAAI,CAAC;MACnE,OAAOC,UAAU;IACrB;IACA,MAAM;MAAEG;IAAQ,CAAC,GAAGV,YAAY,CAACK,KAAK,CAACC,IAAI,CAAC;IAE5C,IAAII,OAAO,IAAIA,OAAO,CAACC,UAAU,EAAE;MAC/B,MAAM;QAAEA;MAAW,CAAC,GAAGD,OAAO;MAC9B,MAAME,SAAS,GACX,OAAOD,UAAU,KAAK,QAAQ,GAAGA,UAAU,GAAGA,UAAU,CAAC;QAAEb,KAAK;QAAEO;MAAM,CAAC,CAAC;MAE9EE,UAAU,CAACM,IAAI,CAAC,GAAGR,KAAK,CAACS,OAAO,IAAIF,SAAS,EAAE,CAAC;MAChD,OAAOL,UAAU;IACrB;IAEAA,UAAU,CAACM,IAAI,CAACR,KAAK,CAACS,OAAO,CAAC;IAE9B,OAAOP,UAAU;EACrB,CAAC,EACD,CAAC,GAAGX,aAAa,CACrB,CAAC,CACAmB,IAAI,CAAC,IAAI,CAAC;AACnB,CAAC;AAED,OAAO,MAAMC,eAAe,GAAIlB,KAAe,IAAK;EAChD,OAAOD,gBAAgB,CAAC;IACpBC,KAAK;IACLC,MAAM,EAAED,KAAK,CAACC;EAClB,CAAC,CAAC;AACN,CAAC;AAED,OAAO,MAAMkB,eAAe,GAAG,aAAc;AAC7C;AACA;AACA;AACA;AACA;AACA,CAAC","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { AcoAppMode, AcoModel } from "../../types";
|
|
1
|
+
import type { AcoAppMode, AcoModel } from "../../types";
|
|
2
2
|
export declare const createCreateRecord: (model: AcoModel, mode: AcoAppMode) => import("graphql").DocumentNode | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["gql","createAppFields","ERROR_FIELD","createCreateRecord","model","mode","singularApiName"],"sources":["createRecord.ts"],"sourcesContent":["import gql from \"graphql-tag\";\nimport { AcoAppMode, AcoModel } from \"~/types\";\nimport { createAppFields, ERROR_FIELD } from \"./common\";\n\nexport const createCreateRecord = (model: AcoModel, mode: AcoAppMode) => {\n if (mode === \"cms\") {\n return null;\n }\n const { singularApiName } = model;\n return gql`\n mutation Create${singularApiName}($data: ${singularApiName}CreateInput!) {\n search {\n content: create${singularApiName}(data: $data) {\n data {\n ${createAppFields(model)}\n }\n ${ERROR_FIELD}\n }\n }\n }\n `;\n};\n"],"mappings":"AAAA,OAAOA,GAAG,MAAM,aAAa;AAE7B,SAASC,eAAe,EAAEC,WAAW;AAErC,OAAO,MAAMC,kBAAkB,GAAGA,CAACC,KAAe,EAAEC,IAAgB,KAAK;EACrE,IAAIA,IAAI,KAAK,KAAK,EAAE;IAChB,OAAO,IAAI;EACf;EACA,MAAM;IAAEC;EAAgB,CAAC,GAAGF,KAAK;EACjC,OAAOJ,GAAG;AACd,yBAAyBM,eAAe,WAAWA,eAAe;AAClE;AACA,iCAAiCA,eAAe;AAChD;AACA,0BAA0BL,eAAe,CAACG,KAAK,CAAC;AAChD;AACA,sBAAsBF,WAAW;AACjC;AACA;AACA;AACA,KAAK;AACL,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["gql","createAppFields","ERROR_FIELD","createCreateRecord","model","mode","singularApiName"],"sources":["createRecord.ts"],"sourcesContent":["import gql from \"graphql-tag\";\nimport type { AcoAppMode, AcoModel } from \"~/types\";\nimport { createAppFields, ERROR_FIELD } from \"./common\";\n\nexport const createCreateRecord = (model: AcoModel, mode: AcoAppMode) => {\n if (mode === \"cms\") {\n return null;\n }\n const { singularApiName } = model;\n return gql`\n mutation Create${singularApiName}($data: ${singularApiName}CreateInput!) {\n search {\n content: create${singularApiName}(data: $data) {\n data {\n ${createAppFields(model)}\n }\n ${ERROR_FIELD}\n }\n }\n }\n `;\n};\n"],"mappings":"AAAA,OAAOA,GAAG,MAAM,aAAa;AAE7B,SAASC,eAAe,EAAEC,WAAW;AAErC,OAAO,MAAMC,kBAAkB,GAAGA,CAACC,KAAe,EAAEC,IAAgB,KAAK;EACrE,IAAIA,IAAI,KAAK,KAAK,EAAE;IAChB,OAAO,IAAI;EACf;EACA,MAAM;IAAEC;EAAgB,CAAC,GAAGF,KAAK;EACjC,OAAOJ,GAAG;AACd,yBAAyBM,eAAe,WAAWA,eAAe;AAClE;AACA,iCAAiCA,eAAe;AAChD;AACA,0BAA0BL,eAAe,CAACG,KAAK,CAAC;AAChD;AACA,sBAAsBF,WAAW;AACjC;AACA;AACA;AACA,KAAK;AACL,CAAC","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { AcoAppMode, AcoModel } from "../../types";
|
|
1
|
+
import type { AcoAppMode, AcoModel } from "../../types";
|
|
2
2
|
export declare const createDeleteRecord: (model: AcoModel, mode: AcoAppMode) => import("graphql").DocumentNode | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["gql","ERROR_FIELD","createDeleteRecord","model","mode","singularApiName"],"sources":["deleteRecord.ts"],"sourcesContent":["import gql from \"graphql-tag\";\nimport { AcoAppMode, AcoModel } from \"~/types\";\nimport { ERROR_FIELD } from \"./common\";\n\nexport const createDeleteRecord = (model: AcoModel, mode: AcoAppMode) => {\n if (mode === \"cms\") {\n return null;\n }\n const { singularApiName } = model;\n return gql`\n mutation Delete${singularApiName}($id: ID!) {\n search {\n content: delete${singularApiName}(id: $id) {\n data\n ${ERROR_FIELD}\n }\n }\n }\n `;\n};\n"],"mappings":"AAAA,OAAOA,GAAG,MAAM,aAAa;AAE7B,SAASC,WAAW;AAEpB,OAAO,MAAMC,kBAAkB,GAAGA,CAACC,KAAe,EAAEC,IAAgB,KAAK;EACrE,IAAIA,IAAI,KAAK,KAAK,EAAE;IAChB,OAAO,IAAI;EACf;EACA,MAAM;IAAEC;EAAgB,CAAC,GAAGF,KAAK;EACjC,OAAOH,GAAG;AACd,yBAAyBK,eAAe;AACxC;AACA,iCAAiCA,eAAe;AAChD;AACA,sBAAsBJ,WAAW;AACjC;AACA;AACA;AACA,KAAK;AACL,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["gql","ERROR_FIELD","createDeleteRecord","model","mode","singularApiName"],"sources":["deleteRecord.ts"],"sourcesContent":["import gql from \"graphql-tag\";\nimport type { AcoAppMode, AcoModel } from \"~/types\";\nimport { ERROR_FIELD } from \"./common\";\n\nexport const createDeleteRecord = (model: AcoModel, mode: AcoAppMode) => {\n if (mode === \"cms\") {\n return null;\n }\n const { singularApiName } = model;\n return gql`\n mutation Delete${singularApiName}($id: ID!) {\n search {\n content: delete${singularApiName}(id: $id) {\n data\n ${ERROR_FIELD}\n }\n }\n }\n `;\n};\n"],"mappings":"AAAA,OAAOA,GAAG,MAAM,aAAa;AAE7B,SAASC,WAAW;AAEpB,OAAO,MAAMC,kBAAkB,GAAGA,CAACC,KAAe,EAAEC,IAAgB,KAAK;EACrE,IAAIA,IAAI,KAAK,KAAK,EAAE;IAChB,OAAO,IAAI;EACf;EACA,MAAM;IAAEC;EAAgB,CAAC,GAAGF,KAAK;EACjC,OAAOH,GAAG;AACd,yBAAyBK,eAAe;AACxC;AACA,iCAAiCA,eAAe;AAChD;AACA,sBAAsBJ,WAAW;AACjC;AACA;AACA;AACA,KAAK;AACL,CAAC","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { AcoAppMode, AcoModel } from "../../types";
|
|
1
|
+
import type { AcoAppMode, AcoModel } from "../../types";
|
|
2
2
|
export declare const createGetRecord: (model: AcoModel, mode: AcoAppMode) => import("graphql").DocumentNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["gql","createAppFields","ERROR_FIELD","createReadQuery","createGetRecord","model","mode","singularApiName"],"sources":["getRecord.ts"],"sourcesContent":["import gql from \"graphql-tag\";\nimport { AcoAppMode, AcoModel } from \"~/types\";\nimport { createAppFields, ERROR_FIELD } from \"./common\";\nimport { createReadQuery } from \"@webiny/app-headless-cms-common\";\n\nexport const createGetRecord = (model: AcoModel, mode: AcoAppMode) => {\n if (mode === \"cms\") {\n return createReadQuery(model);\n }\n const { singularApiName } = model;\n return gql`\n query Get${singularApiName}($entryId: ID!) {\n search {\n content: get${singularApiName}(id: $entryId) {\n data {\n ${createAppFields(model)}\n }\n ${ERROR_FIELD}\n }\n }\n }\n `;\n};\n"],"mappings":"AAAA,OAAOA,GAAG,MAAM,aAAa;AAE7B,SAASC,eAAe,EAAEC,WAAW;AACrC,SAASC,eAAe,QAAQ,iCAAiC;AAEjE,OAAO,MAAMC,eAAe,GAAGA,CAACC,KAAe,EAAEC,IAAgB,KAAK;EAClE,IAAIA,IAAI,KAAK,KAAK,EAAE;IAChB,OAAOH,eAAe,CAACE,KAAK,CAAC;EACjC;EACA,MAAM;IAAEE;EAAgB,CAAC,GAAGF,KAAK;EACjC,OAAOL,GAAG;AACd,mBAAmBO,eAAe;AAClC;AACA,8BAA8BA,eAAe;AAC7C;AACA,0BAA0BN,eAAe,CAACI,KAAK,CAAC;AAChD;AACA,sBAAsBH,WAAW;AACjC;AACA;AACA;AACA,KAAK;AACL,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["gql","createAppFields","ERROR_FIELD","createReadQuery","createGetRecord","model","mode","singularApiName"],"sources":["getRecord.ts"],"sourcesContent":["import gql from \"graphql-tag\";\nimport type { AcoAppMode, AcoModel } from \"~/types\";\nimport { createAppFields, ERROR_FIELD } from \"./common\";\nimport { createReadQuery } from \"@webiny/app-headless-cms-common\";\n\nexport const createGetRecord = (model: AcoModel, mode: AcoAppMode) => {\n if (mode === \"cms\") {\n return createReadQuery(model);\n }\n const { singularApiName } = model;\n return gql`\n query Get${singularApiName}($entryId: ID!) {\n search {\n content: get${singularApiName}(id: $entryId) {\n data {\n ${createAppFields(model)}\n }\n ${ERROR_FIELD}\n }\n }\n }\n `;\n};\n"],"mappings":"AAAA,OAAOA,GAAG,MAAM,aAAa;AAE7B,SAASC,eAAe,EAAEC,WAAW;AACrC,SAASC,eAAe,QAAQ,iCAAiC;AAEjE,OAAO,MAAMC,eAAe,GAAGA,CAACC,KAAe,EAAEC,IAAgB,KAAK;EAClE,IAAIA,IAAI,KAAK,KAAK,EAAE;IAChB,OAAOH,eAAe,CAACE,KAAK,CAAC;EACjC;EACA,MAAM;IAAEE;EAAgB,CAAC,GAAGF,KAAK;EACjC,OAAOL,GAAG;AACd,mBAAmBO,eAAe;AAClC;AACA,8BAA8BA,eAAe;AAC7C;AACA,0BAA0BN,eAAe,CAACI,KAAK,CAAC;AAChD;AACA,sBAAsBH,WAAW;AACjC;AACA;AACA;AACA,KAAK;AACL,CAAC","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { AcoAppMode, AcoModel } from "../../types";
|
|
1
|
+
import type { AcoAppMode, AcoModel } from "../../types";
|
|
2
2
|
export declare const createListRecords: (model: AcoModel, mode: AcoAppMode, fieldIds: string[]) => import("graphql").DocumentNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["gql","createAppFields","ERROR_FIELD","LIST_META_FIELD","createListQuery","createListRecords","model","mode","fieldIds","defaultFields","fields","filter","field","includes","type","additionalFields","fieldId","uniqueFields","Map","map","values","singularApiName","pluralApiName"],"sources":["listRecords.ts"],"sourcesContent":["import gql from \"graphql-tag\";\nimport { AcoAppMode, AcoModel } from \"~/types\";\nimport { createAppFields, ERROR_FIELD, LIST_META_FIELD } from \"./common\";\nimport { createListQuery } from \"@webiny/app-headless-cms-common\";\n\nexport const createListRecords = (model: AcoModel, mode: AcoAppMode, fieldIds: string[]) => {\n if (mode === \"cms\") {\n /**\n * We will include only the simplest fields.\n * TODO: remove default fields in a future release, as field selection will be injected by ACO configs.\n */\n const defaultFields = model.fields.filter(field => {\n return [\"text\", \"number\", \"boolean\", \"file\", \"long-text\", \"ref\", \"datetime\"].includes(\n field.type\n );\n });\n\n const additionalFields = model.fields.filter(field => {\n return fieldIds.includes(field.fieldId);\n });\n\n const uniqueFields = [\n ...new Map(\n [...defaultFields, ...additionalFields].map(field => [field.fieldId, field])\n ).values()\n ];\n\n return createListQuery(model, uniqueFields);\n }\n const { singularApiName, pluralApiName } = model;\n return gql`\n query List${pluralApiName}($where: ${singularApiName}ListWhereInput, $limit: Int, $after: String, $sort: [${singularApiName}ListSorter!], $search: String) {\n search {\n content: list${pluralApiName}(where: $where, limit: $limit, after: $after, sort: $sort, search: $search) {\n data {\n ${createAppFields(model)}\n }\n ${LIST_META_FIELD}\n ${ERROR_FIELD}\n }\n }\n }\n `;\n};\n"],"mappings":"AAAA,OAAOA,GAAG,MAAM,aAAa;AAE7B,SAASC,eAAe,EAAEC,WAAW,EAAEC,eAAe;AACtD,SAASC,eAAe,QAAQ,iCAAiC;AAEjE,OAAO,MAAMC,iBAAiB,GAAGA,CAACC,KAAe,EAAEC,IAAgB,EAAEC,QAAkB,KAAK;EACxF,IAAID,IAAI,KAAK,KAAK,EAAE;IAChB;AACR;AACA;AACA;IACQ,MAAME,aAAa,GAAGH,KAAK,CAACI,MAAM,CAACC,MAAM,CAACC,KAAK,IAAI;MAC/C,OAAO,CAAC,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,UAAU,CAAC,CAACC,QAAQ,CACjFD,KAAK,CAACE,IACV,CAAC;IACL,CAAC,CAAC;IAEF,MAAMC,gBAAgB,GAAGT,KAAK,CAACI,MAAM,CAACC,MAAM,CAACC,KAAK,IAAI;MAClD,OAAOJ,QAAQ,CAACK,QAAQ,CAACD,KAAK,CAACI,OAAO,CAAC;IAC3C,CAAC,CAAC;IAEF,MAAMC,YAAY,GAAG,CACjB,GAAG,IAAIC,GAAG,CACN,CAAC,GAAGT,aAAa,EAAE,GAAGM,gBAAgB,CAAC,CAACI,GAAG,CAACP,KAAK,IAAI,CAACA,KAAK,CAACI,OAAO,EAAEJ,KAAK,CAAC,CAC/E,CAAC,CAACQ,MAAM,CAAC,CAAC,CACb;IAED,OAAOhB,eAAe,CAACE,KAAK,EAAEW,YAAY,CAAC;EAC/C;EACA,MAAM;IAAEI,eAAe;IAAEC;EAAc,CAAC,GAAGhB,KAAK;EAChD,OAAON,GAAG;AACd,oBAAoBsB,aAAa,YAAYD,eAAe,wDAAwDA,eAAe;AACnI;AACA,+BAA+BC,aAAa;AAC5C;AACA,0BAA0BrB,eAAe,CAACK,KAAK,CAAC;AAChD;AACA,sBAAsBH,eAAe;AACrC,sBAAsBD,WAAW;AACjC;AACA;AACA;AACA,KAAK;AACL,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["gql","createAppFields","ERROR_FIELD","LIST_META_FIELD","createListQuery","createListRecords","model","mode","fieldIds","defaultFields","fields","filter","field","includes","type","additionalFields","fieldId","uniqueFields","Map","map","values","singularApiName","pluralApiName"],"sources":["listRecords.ts"],"sourcesContent":["import gql from \"graphql-tag\";\nimport type { AcoAppMode, AcoModel } from \"~/types\";\nimport { createAppFields, ERROR_FIELD, LIST_META_FIELD } from \"./common\";\nimport { createListQuery } from \"@webiny/app-headless-cms-common\";\n\nexport const createListRecords = (model: AcoModel, mode: AcoAppMode, fieldIds: string[]) => {\n if (mode === \"cms\") {\n /**\n * We will include only the simplest fields.\n * TODO: remove default fields in a future release, as field selection will be injected by ACO configs.\n */\n const defaultFields = model.fields.filter(field => {\n return [\"text\", \"number\", \"boolean\", \"file\", \"long-text\", \"ref\", \"datetime\"].includes(\n field.type\n );\n });\n\n const additionalFields = model.fields.filter(field => {\n return fieldIds.includes(field.fieldId);\n });\n\n const uniqueFields = [\n ...new Map(\n [...defaultFields, ...additionalFields].map(field => [field.fieldId, field])\n ).values()\n ];\n\n return createListQuery(model, uniqueFields);\n }\n const { singularApiName, pluralApiName } = model;\n return gql`\n query List${pluralApiName}($where: ${singularApiName}ListWhereInput, $limit: Int, $after: String, $sort: [${singularApiName}ListSorter!], $search: String) {\n search {\n content: list${pluralApiName}(where: $where, limit: $limit, after: $after, sort: $sort, search: $search) {\n data {\n ${createAppFields(model)}\n }\n ${LIST_META_FIELD}\n ${ERROR_FIELD}\n }\n }\n }\n `;\n};\n"],"mappings":"AAAA,OAAOA,GAAG,MAAM,aAAa;AAE7B,SAASC,eAAe,EAAEC,WAAW,EAAEC,eAAe;AACtD,SAASC,eAAe,QAAQ,iCAAiC;AAEjE,OAAO,MAAMC,iBAAiB,GAAGA,CAACC,KAAe,EAAEC,IAAgB,EAAEC,QAAkB,KAAK;EACxF,IAAID,IAAI,KAAK,KAAK,EAAE;IAChB;AACR;AACA;AACA;IACQ,MAAME,aAAa,GAAGH,KAAK,CAACI,MAAM,CAACC,MAAM,CAACC,KAAK,IAAI;MAC/C,OAAO,CAAC,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,UAAU,CAAC,CAACC,QAAQ,CACjFD,KAAK,CAACE,IACV,CAAC;IACL,CAAC,CAAC;IAEF,MAAMC,gBAAgB,GAAGT,KAAK,CAACI,MAAM,CAACC,MAAM,CAACC,KAAK,IAAI;MAClD,OAAOJ,QAAQ,CAACK,QAAQ,CAACD,KAAK,CAACI,OAAO,CAAC;IAC3C,CAAC,CAAC;IAEF,MAAMC,YAAY,GAAG,CACjB,GAAG,IAAIC,GAAG,CACN,CAAC,GAAGT,aAAa,EAAE,GAAGM,gBAAgB,CAAC,CAACI,GAAG,CAACP,KAAK,IAAI,CAACA,KAAK,CAACI,OAAO,EAAEJ,KAAK,CAAC,CAC/E,CAAC,CAACQ,MAAM,CAAC,CAAC,CACb;IAED,OAAOhB,eAAe,CAACE,KAAK,EAAEW,YAAY,CAAC;EAC/C;EACA,MAAM;IAAEI,eAAe;IAAEC;EAAc,CAAC,GAAGhB,KAAK;EAChD,OAAON,GAAG;AACd,oBAAoBsB,aAAa,YAAYD,eAAe,wDAAwDA,eAAe;AACnI;AACA,+BAA+BC,aAAa;AAC5C;AACA,0BAA0BrB,eAAe,CAACK,KAAK,CAAC;AAChD;AACA,sBAAsBH,eAAe;AACrC,sBAAsBD,WAAW;AACjC;AACA;AACA;AACA,KAAK;AACL,CAAC","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { AcoAppMode, AcoModel } from "../../types";
|
|
1
|
+
import type { AcoAppMode, AcoModel } from "../../types";
|
|
2
2
|
export declare const createListTags: (model: AcoModel, mode: AcoAppMode) => import("graphql").DocumentNode | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["gql","ERROR_FIELD","LIST_META_FIELD","createListTags","model","mode","pluralApiName"],"sources":["listTags.ts"],"sourcesContent":["import gql from \"graphql-tag\";\nimport { AcoAppMode, AcoModel } from \"~/types\";\nimport { ERROR_FIELD, LIST_META_FIELD } from \"./common\";\n\nexport const createListTags = (model: AcoModel, mode: AcoAppMode) => {\n if (mode === \"cms\") {\n return null;\n }\n const { pluralApiName } = model;\n return gql`\n query List${pluralApiName}Tags($where: AcoSearchRecordTagListWhereInput) {\n search {\n content: list${pluralApiName}Tags(where: $where) {\n data {\n tag\n }\n ${LIST_META_FIELD}\n ${ERROR_FIELD}\n }\n }\n }\n `;\n};\n"],"mappings":"AAAA,OAAOA,GAAG,MAAM,aAAa;AAE7B,SAASC,WAAW,EAAEC,eAAe;AAErC,OAAO,MAAMC,cAAc,GAAGA,CAACC,KAAe,EAAEC,IAAgB,KAAK;EACjE,IAAIA,IAAI,KAAK,KAAK,EAAE;IAChB,OAAO,IAAI;EACf;EACA,MAAM;IAAEC;EAAc,CAAC,GAAGF,KAAK;EAC/B,OAAOJ,GAAG;AACd,oBAAoBM,aAAa;AACjC;AACA,+BAA+BA,aAAa;AAC5C;AACA;AACA;AACA,sBAAsBJ,eAAe;AACrC,sBAAsBD,WAAW;AACjC;AACA;AACA;AACA,KAAK;AACL,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["gql","ERROR_FIELD","LIST_META_FIELD","createListTags","model","mode","pluralApiName"],"sources":["listTags.ts"],"sourcesContent":["import gql from \"graphql-tag\";\nimport type { AcoAppMode, AcoModel } from \"~/types\";\nimport { ERROR_FIELD, LIST_META_FIELD } from \"./common\";\n\nexport const createListTags = (model: AcoModel, mode: AcoAppMode) => {\n if (mode === \"cms\") {\n return null;\n }\n const { pluralApiName } = model;\n return gql`\n query List${pluralApiName}Tags($where: AcoSearchRecordTagListWhereInput) {\n search {\n content: list${pluralApiName}Tags(where: $where) {\n data {\n tag\n }\n ${LIST_META_FIELD}\n ${ERROR_FIELD}\n }\n }\n }\n `;\n};\n"],"mappings":"AAAA,OAAOA,GAAG,MAAM,aAAa;AAE7B,SAASC,WAAW,EAAEC,eAAe;AAErC,OAAO,MAAMC,cAAc,GAAGA,CAACC,KAAe,EAAEC,IAAgB,KAAK;EACjE,IAAIA,IAAI,KAAK,KAAK,EAAE;IAChB,OAAO,IAAI;EACf;EACA,MAAM;IAAEC;EAAc,CAAC,GAAGF,KAAK;EAC/B,OAAOJ,GAAG;AACd,oBAAoBM,aAAa;AACjC;AACA,+BAA+BA,aAAa;AAC5C;AACA;AACA;AACA,sBAAsBJ,eAAe;AACrC,sBAAsBD,WAAW;AACjC;AACA;AACA;AACA,KAAK;AACL,CAAC","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { AcoAppMode, AcoModel } from "../../types";
|
|
1
|
+
import type { AcoAppMode, AcoModel } from "../../types";
|
|
2
2
|
export declare const createMoveRecord: (model: AcoModel, mode: AcoAppMode) => import("graphql").DocumentNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["gql","ERROR_FIELD","createMoveRecord","model","mode","singularApiName"],"sources":["moveRecord.ts"],"sourcesContent":["import gql from \"graphql-tag\";\nimport { AcoAppMode, AcoModel } from \"~/types\";\nimport { ERROR_FIELD } from \"./common\";\n\nexport const createMoveRecord = (model: AcoModel, mode: AcoAppMode) => {\n const { singularApiName } = model;\n if (mode === \"cms\") {\n return gql`\n mutation Move${singularApiName}($id: ID!, $folderId: ID!) {\n content: move${singularApiName}(revision: $id, folderId: $folderId) {\n data\n ${ERROR_FIELD}\n }\n }\n `;\n }\n return gql`\n mutation Move${singularApiName}($id: ID!, $folderId: ID!) {\n search {\n content: move${singularApiName}(id: $id, folderId: $folderId) {\n data\n ${ERROR_FIELD}\n }\n }\n }\n `;\n};\n"],"mappings":"AAAA,OAAOA,GAAG,MAAM,aAAa;AAE7B,SAASC,WAAW;AAEpB,OAAO,MAAMC,gBAAgB,GAAGA,CAACC,KAAe,EAAEC,IAAgB,KAAK;EACnE,MAAM;IAAEC;EAAgB,CAAC,GAAGF,KAAK;EACjC,IAAIC,IAAI,KAAK,KAAK,EAAE;IAChB,OAAOJ,GAAG;AAClB,2BAA2BK,eAAe;AAC1C,+BAA+BA,eAAe;AAC9C;AACA,sBAAsBJ,WAAW;AACjC;AACA;AACA,SAAS;EACL;EACA,OAAOD,GAAG;AACd,uBAAuBK,eAAe;AACtC;AACA,+BAA+BA,eAAe;AAC9C;AACA,sBAAsBJ,WAAW;AACjC;AACA;AACA;AACA,KAAK;AACL,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["gql","ERROR_FIELD","createMoveRecord","model","mode","singularApiName"],"sources":["moveRecord.ts"],"sourcesContent":["import gql from \"graphql-tag\";\nimport type { AcoAppMode, AcoModel } from \"~/types\";\nimport { ERROR_FIELD } from \"./common\";\n\nexport const createMoveRecord = (model: AcoModel, mode: AcoAppMode) => {\n const { singularApiName } = model;\n if (mode === \"cms\") {\n return gql`\n mutation Move${singularApiName}($id: ID!, $folderId: ID!) {\n content: move${singularApiName}(revision: $id, folderId: $folderId) {\n data\n ${ERROR_FIELD}\n }\n }\n `;\n }\n return gql`\n mutation Move${singularApiName}($id: ID!, $folderId: ID!) {\n search {\n content: move${singularApiName}(id: $id, folderId: $folderId) {\n data\n ${ERROR_FIELD}\n }\n }\n }\n `;\n};\n"],"mappings":"AAAA,OAAOA,GAAG,MAAM,aAAa;AAE7B,SAASC,WAAW;AAEpB,OAAO,MAAMC,gBAAgB,GAAGA,CAACC,KAAe,EAAEC,IAAgB,KAAK;EACnE,MAAM;IAAEC;EAAgB,CAAC,GAAGF,KAAK;EACjC,IAAIC,IAAI,KAAK,KAAK,EAAE;IAChB,OAAOJ,GAAG;AAClB,2BAA2BK,eAAe;AAC1C,+BAA+BA,eAAe;AAC9C;AACA,sBAAsBJ,WAAW;AACjC;AACA;AACA,SAAS;EACL;EACA,OAAOD,GAAG;AACd,uBAAuBK,eAAe;AACtC;AACA,+BAA+BA,eAAe;AAC9C;AACA,sBAAsBJ,WAAW;AACjC;AACA;AACA;AACA,KAAK;AACL,CAAC","ignoreList":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AcoError, ListMeta, ListSearchRecordsSort, SearchRecordItem, TagItem } from "../../types";
|
|
1
|
+
import type { AcoError, ListMeta, ListSearchRecordsSort, SearchRecordItem, TagItem } from "../../types";
|
|
2
2
|
export interface UpdateSearchRecordResponse {
|
|
3
3
|
search: {
|
|
4
4
|
updateRecord: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import { AcoError, ListMeta, ListSearchRecordsSort, SearchRecordItem, TagItem } from \"~/types\";\n\nexport interface UpdateSearchRecordResponse {\n search: {\n updateRecord: {\n data: SearchRecordItem | null;\n error: AcoError | null;\n };\n };\n}\n\nexport interface UpdateSearchRecordVariables {\n id: string;\n data: Pick<SearchRecordItem, \"location\" | \"title\" | \"content\" | \"data\">;\n}\n\nexport interface MoveSearchRecordResponse {\n search: {\n moveRecord: {\n data: boolean | null;\n error: AcoError | null;\n };\n };\n}\n\nexport interface MoveSearchRecordVariables {\n id: string;\n folderId: string;\n}\n\nexport interface ListTagsWhereQueryVariables {\n tags_in?: string[];\n tags_startsWith?: string;\n tags_not_startsWith?: string;\n AND?: ListTagsWhereQueryVariables[];\n OR?: ListTagsWhereQueryVariables[];\n}\n\nexport interface ListTagsQueryVariables {\n where?: ListTagsWhereQueryVariables;\n}\n\nexport interface ListTagsResponse {\n search: {\n content: {\n data: TagItem[] | null;\n error: AcoError | null;\n };\n };\n}\n\nexport interface ListSearchRecordsResponse {\n search: {\n content: {\n data: SearchRecordItem[] | null;\n meta: ListMeta | null;\n error: AcoError | null;\n };\n };\n}\n\ninterface ListSearchRecordsWhereLocationQueryVariables {\n folderId?: string;\n folderId_in?: string[];\n folderId_not_in?: string[];\n}\n\nexport interface ListSearchRecordsWhereQueryVariables {\n location?: ListSearchRecordsWhereLocationQueryVariables;\n wbyAco_location?: ListSearchRecordsWhereLocationQueryVariables;\n createdBy?: string;\n tags_in?: string[];\n tags_startsWith?: string;\n tags_not_startsWith?: string;\n AND?: ListSearchRecordsWhereQueryVariables[];\n OR?: ListSearchRecordsWhereQueryVariables[];\n}\n\nexport interface ListSearchRecordsQueryVariables {\n where?: ListSearchRecordsWhereQueryVariables;\n search?: string;\n limit?: number;\n after?: string | null;\n sort?: ListSearchRecordsSort;\n}\n\nexport interface GetSearchRecordResponse {\n search: {\n content: {\n data: SearchRecordItem | null;\n error: AcoError | null;\n };\n };\n}\n\nexport interface GetSearchRecordQueryVariables {\n entryId: string;\n}\n\nexport interface DeleteSearchRecordVariables {\n id: string;\n}\n\nexport interface DeleteSearchRecordResponse {\n search: {\n content: {\n data: boolean;\n error: AcoError | null;\n };\n };\n}\n\nexport interface CreateSearchRecordResponse {\n search: {\n content: {\n data: SearchRecordItem | null;\n error: AcoError | null;\n };\n };\n}\n\nexport interface CreateSearchRecordVariables {\n data: Omit<\n SearchRecordItem,\n \"id\" | \"createdOn\" | \"savedOn\" | \"modifiedOn\" | \"createdBy\" | \"savedBy\" | \"modifiedBy\"\n >;\n}\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type { AcoError, ListMeta, ListSearchRecordsSort, SearchRecordItem, TagItem } from \"~/types\";\n\nexport interface UpdateSearchRecordResponse {\n search: {\n updateRecord: {\n data: SearchRecordItem | null;\n error: AcoError | null;\n };\n };\n}\n\nexport interface UpdateSearchRecordVariables {\n id: string;\n data: Pick<SearchRecordItem, \"location\" | \"title\" | \"content\" | \"data\">;\n}\n\nexport interface MoveSearchRecordResponse {\n search: {\n moveRecord: {\n data: boolean | null;\n error: AcoError | null;\n };\n };\n}\n\nexport interface MoveSearchRecordVariables {\n id: string;\n folderId: string;\n}\n\nexport interface ListTagsWhereQueryVariables {\n tags_in?: string[];\n tags_startsWith?: string;\n tags_not_startsWith?: string;\n AND?: ListTagsWhereQueryVariables[];\n OR?: ListTagsWhereQueryVariables[];\n}\n\nexport interface ListTagsQueryVariables {\n where?: ListTagsWhereQueryVariables;\n}\n\nexport interface ListTagsResponse {\n search: {\n content: {\n data: TagItem[] | null;\n error: AcoError | null;\n };\n };\n}\n\nexport interface ListSearchRecordsResponse {\n search: {\n content: {\n data: SearchRecordItem[] | null;\n meta: ListMeta | null;\n error: AcoError | null;\n };\n };\n}\n\ninterface ListSearchRecordsWhereLocationQueryVariables {\n folderId?: string;\n folderId_in?: string[];\n folderId_not_in?: string[];\n}\n\nexport interface ListSearchRecordsWhereQueryVariables {\n location?: ListSearchRecordsWhereLocationQueryVariables;\n wbyAco_location?: ListSearchRecordsWhereLocationQueryVariables;\n createdBy?: string;\n tags_in?: string[];\n tags_startsWith?: string;\n tags_not_startsWith?: string;\n AND?: ListSearchRecordsWhereQueryVariables[];\n OR?: ListSearchRecordsWhereQueryVariables[];\n}\n\nexport interface ListSearchRecordsQueryVariables {\n where?: ListSearchRecordsWhereQueryVariables;\n search?: string;\n limit?: number;\n after?: string | null;\n sort?: ListSearchRecordsSort;\n}\n\nexport interface GetSearchRecordResponse {\n search: {\n content: {\n data: SearchRecordItem | null;\n error: AcoError | null;\n };\n };\n}\n\nexport interface GetSearchRecordQueryVariables {\n entryId: string;\n}\n\nexport interface DeleteSearchRecordVariables {\n id: string;\n}\n\nexport interface DeleteSearchRecordResponse {\n search: {\n content: {\n data: boolean;\n error: AcoError | null;\n };\n };\n}\n\nexport interface CreateSearchRecordResponse {\n search: {\n content: {\n data: SearchRecordItem | null;\n error: AcoError | null;\n };\n };\n}\n\nexport interface CreateSearchRecordVariables {\n data: Omit<\n SearchRecordItem,\n \"id\" | \"createdOn\" | \"savedOn\" | \"modifiedOn\" | \"createdBy\" | \"savedBy\" | \"modifiedBy\"\n >;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { AcoAppMode, AcoModel } from "../../types";
|
|
1
|
+
import type { AcoAppMode, AcoModel } from "../../types";
|
|
2
2
|
export declare const createUpdateRecord: (model: AcoModel, mode: AcoAppMode) => import("graphql").DocumentNode | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["gql","createAppFields","ERROR_FIELD","createUpdateRecord","model","mode","singularApiName"],"sources":["updateRecord.ts"],"sourcesContent":["import gql from \"graphql-tag\";\nimport { AcoAppMode, AcoModel } from \"~/types\";\nimport { createAppFields, ERROR_FIELD } from \"./common\";\n\nexport const createUpdateRecord = (model: AcoModel, mode: AcoAppMode) => {\n if (mode === \"cms\") {\n return null;\n }\n const { singularApiName } = model;\n return gql`\n mutation Update${singularApiName}($id: ID!, $data: ${singularApiName}UpdateInput!) {\n search {\n content: update${singularApiName}(id: $id, data: $data) {\n data {\n ${createAppFields(model)}\n }\n ${ERROR_FIELD}\n }\n }\n }\n `;\n};\n"],"mappings":"AAAA,OAAOA,GAAG,MAAM,aAAa;AAE7B,SAASC,eAAe,EAAEC,WAAW;AAErC,OAAO,MAAMC,kBAAkB,GAAGA,CAACC,KAAe,EAAEC,IAAgB,KAAK;EACrE,IAAIA,IAAI,KAAK,KAAK,EAAE;IAChB,OAAO,IAAI;EACf;EACA,MAAM;IAAEC;EAAgB,CAAC,GAAGF,KAAK;EACjC,OAAOJ,GAAG;AACd,yBAAyBM,eAAe,qBAAqBA,eAAe;AAC5E;AACA,iCAAiCA,eAAe;AAChD;AACA,0BAA0BL,eAAe,CAACG,KAAK,CAAC;AAChD;AACA,sBAAsBF,WAAW;AACjC;AACA;AACA;AACA,KAAK;AACL,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["gql","createAppFields","ERROR_FIELD","createUpdateRecord","model","mode","singularApiName"],"sources":["updateRecord.ts"],"sourcesContent":["import gql from \"graphql-tag\";\nimport type { AcoAppMode, AcoModel } from \"~/types\";\nimport { createAppFields, ERROR_FIELD } from \"./common\";\n\nexport const createUpdateRecord = (model: AcoModel, mode: AcoAppMode) => {\n if (mode === \"cms\") {\n return null;\n }\n const { singularApiName } = model;\n return gql`\n mutation Update${singularApiName}($id: ID!, $data: ${singularApiName}UpdateInput!) {\n search {\n content: update${singularApiName}(id: $id, data: $data) {\n data {\n ${createAppFields(model)}\n }\n ${ERROR_FIELD}\n }\n }\n }\n `;\n};\n"],"mappings":"AAAA,OAAOA,GAAG,MAAM,aAAa;AAE7B,SAASC,eAAe,EAAEC,WAAW;AAErC,OAAO,MAAMC,kBAAkB,GAAGA,CAACC,KAAe,EAAEC,IAAgB,KAAK;EACrE,IAAIA,IAAI,KAAK,KAAK,EAAE;IAChB,OAAO,IAAI;EACf;EACA,MAAM;IAAEC;EAAgB,CAAC,GAAGF,KAAK;EACjC,OAAOJ,GAAG;AACd,yBAAyBM,eAAe,qBAAqBA,eAAe;AAC5E;AACA,iCAAiCA,eAAe;AAChD;AACA,0BAA0BL,eAAe,CAACG,KAAK,CAAC;AAChD;AACA,sBAAsBF,WAAW;AACjC;AACA;AACA;AACA,KAAK;AACL,CAAC","ignoreList":[]}
|
package/handlers.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Dispatch, SetStateAction } from "react";
|
|
2
|
-
import { ApolloQueryResult } from "apollo-client/core/types";
|
|
3
|
-
import { FetchResult } from "apollo-link";
|
|
4
|
-
import { Loading, LoadingActions } from "./types";
|
|
1
|
+
import type { Dispatch, SetStateAction } from "react";
|
|
2
|
+
import type { ApolloQueryResult } from "apollo-client/core/types";
|
|
3
|
+
import type { FetchResult } from "apollo-link";
|
|
4
|
+
import type { Loading, LoadingActions } from "./types";
|
|
5
5
|
/**
|
|
6
6
|
* A simple wrapper for Apollo fetching operations that handles the `loading` state as side effect.
|
|
7
7
|
*
|
package/handlers.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["apolloFetchingHandler","loadingHandler","apolloQuery","response","action","setState","flag","state","dataLoader","loader","finally"],"sources":["handlers.tsx"],"sourcesContent":["import { Dispatch, SetStateAction } from \"react\";\nimport { ApolloQueryResult } from \"apollo-client/core/types\";\nimport { FetchResult } from \"apollo-link\";\nimport { Loading, LoadingActions } from \"~/types\";\n\n/**\n * A simple wrapper for Apollo fetching operations that handles the `loading` state as side effect.\n *\n * @param loadingHandler: function that handle the loading state.\n * @param apolloQuery: Apollo Query or Mutation\n */\nexport const apolloFetchingHandler = async <ListSearchRecordsResponse = any,>(\n loadingHandler: (flag: boolean) => void,\n apolloQuery: () => Promise<\n ApolloQueryResult<ListSearchRecordsResponse> | FetchResult<ListSearchRecordsResponse>\n >\n) => {\n loadingHandler(true);\n\n const response = await apolloQuery();\n loadingHandler(false);\n\n return response;\n};\n\n/**\n * A simple function to handle `loading` state.\n *\n * @param action: the `action` that has been performed.\n * @param setState: the logic to update the loading state.\n */\nexport const loadingHandler = (\n action: LoadingActions,\n setState?: Dispatch<SetStateAction<Loading<LoadingActions>>>\n) => {\n return (flag: boolean) => {\n if (!setState) {\n return;\n }\n setState(state => {\n return {\n ...state,\n [action]: flag\n };\n });\n };\n};\n\n/**\n * A data loader wrapper that manages the loading state via a callback.\n * `loader` can be any function that returns a Promise.\n */\nexport async function dataLoader<T>(\n loadingHandler: (flag: boolean) => void,\n loader: () => Promise<T>\n) {\n loadingHandler(true);\n\n return loader().finally(() => {\n loadingHandler(false);\n });\n}\n"],"mappings":"AAKA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,qBAAqB,GAAG,MAAAA,CACjCC,cAAuC,EACvCC,WAEC,KACA;EACDD,cAAc,CAAC,IAAI,CAAC;EAEpB,MAAME,QAAQ,GAAG,MAAMD,WAAW,CAAC,CAAC;EACpCD,cAAc,CAAC,KAAK,CAAC;EAErB,OAAOE,QAAQ;AACnB,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMF,cAAc,GAAGA,CAC1BG,MAAsB,EACtBC,QAA4D,KAC3D;EACD,OAAQC,IAAa,IAAK;IACtB,IAAI,CAACD,QAAQ,EAAE;MACX;IACJ;IACAA,QAAQ,CAACE,KAAK,IAAI;MACd,OAAO;QACH,GAAGA,KAAK;QACR,CAACH,MAAM,GAAGE;MACd,CAAC;IACL,CAAC,CAAC;EACN,CAAC;AACL,CAAC;;AAED;AACA;AACA;AACA;AACA,OAAO,eAAeE,UAAUA,CAC5BP,cAAuC,EACvCQ,MAAwB,EAC1B;EACER,cAAc,CAAC,IAAI,CAAC;EAEpB,OAAOQ,MAAM,CAAC,CAAC,CAACC,OAAO,CAAC,MAAM;IAC1BT,cAAc,CAAC,KAAK,CAAC;EACzB,CAAC,CAAC;AACN","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["apolloFetchingHandler","loadingHandler","apolloQuery","response","action","setState","flag","state","dataLoader","loader","finally"],"sources":["handlers.tsx"],"sourcesContent":["import type { Dispatch, SetStateAction } from \"react\";\nimport type { ApolloQueryResult } from \"apollo-client/core/types\";\nimport type { FetchResult } from \"apollo-link\";\nimport type { Loading, LoadingActions } from \"~/types\";\n\n/**\n * A simple wrapper for Apollo fetching operations that handles the `loading` state as side effect.\n *\n * @param loadingHandler: function that handle the loading state.\n * @param apolloQuery: Apollo Query or Mutation\n */\nexport const apolloFetchingHandler = async <ListSearchRecordsResponse = any,>(\n loadingHandler: (flag: boolean) => void,\n apolloQuery: () => Promise<\n ApolloQueryResult<ListSearchRecordsResponse> | FetchResult<ListSearchRecordsResponse>\n >\n) => {\n loadingHandler(true);\n\n const response = await apolloQuery();\n loadingHandler(false);\n\n return response;\n};\n\n/**\n * A simple function to handle `loading` state.\n *\n * @param action: the `action` that has been performed.\n * @param setState: the logic to update the loading state.\n */\nexport const loadingHandler = (\n action: LoadingActions,\n setState?: Dispatch<SetStateAction<Loading<LoadingActions>>>\n) => {\n return (flag: boolean) => {\n if (!setState) {\n return;\n }\n setState(state => {\n return {\n ...state,\n [action]: flag\n };\n });\n };\n};\n\n/**\n * A data loader wrapper that manages the loading state via a callback.\n * `loader` can be any function that returns a Promise.\n */\nexport async function dataLoader<T>(\n loadingHandler: (flag: boolean) => void,\n loader: () => Promise<T>\n) {\n loadingHandler(true);\n\n return loader().finally(() => {\n loadingHandler(false);\n });\n}\n"],"mappings":"AAKA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,qBAAqB,GAAG,MAAAA,CACjCC,cAAuC,EACvCC,WAEC,KACA;EACDD,cAAc,CAAC,IAAI,CAAC;EAEpB,MAAME,QAAQ,GAAG,MAAMD,WAAW,CAAC,CAAC;EACpCD,cAAc,CAAC,KAAK,CAAC;EAErB,OAAOE,QAAQ;AACnB,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMF,cAAc,GAAGA,CAC1BG,MAAsB,EACtBC,QAA4D,KAC3D;EACD,OAAQC,IAAa,IAAK;IACtB,IAAI,CAACD,QAAQ,EAAE;MACX;IACJ;IACAA,QAAQ,CAACE,KAAK,IAAI;MACd,OAAO;QACH,GAAGA,KAAK;QACR,CAACH,MAAM,GAAGE;MACd,CAAC;IACL,CAAC,CAAC;EACN,CAAC;AACL,CAAC;;AAED;AACA;AACA;AACA;AACA,OAAO,eAAeE,UAAUA,CAC5BP,cAAuC,EACvCQ,MAAwB,EAC1B;EACER,cAAc,CAAC,IAAI,CAAC;EAEpB,OAAOQ,MAAM,CAAC,CAAC,CAACC,OAAO,CAAC,MAAM;IAC1BT,cAAc,CAAC,KAAK,CAAC;EACzB,CAAC,CAAC;AACN","ignoreList":[]}
|
package/hooks/useAcoApp.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { AcoAppProviderContext } from "../contexts/app";
|
|
1
|
+
import type { AcoAppProviderContext } from "../contexts/app";
|
|
2
2
|
export declare const useAcoApp: () => AcoAppProviderContext;
|
package/hooks/useAcoApp.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useContext","AcoAppContext","useAcoApp","context","Error","app","folderIdPath","folderIdInPath","model","client","mode","loading","error"],"sources":["useAcoApp.ts"],"sourcesContent":["import { useContext } from \"react\";\nimport {
|
|
1
|
+
{"version":3,"names":["useContext","AcoAppContext","useAcoApp","context","Error","app","folderIdPath","folderIdInPath","model","client","mode","loading","error"],"sources":["useAcoApp.ts"],"sourcesContent":["import { useContext } from \"react\";\nimport type { AcoAppProviderContext } from \"~/contexts/app\";\nimport { AcoAppContext } from \"~/contexts/app\";\n\nexport const useAcoApp = (): AcoAppProviderContext => {\n const context = useContext(AcoAppContext);\n\n if (!context) {\n throw new Error(\"useAcoApp must be used within a AcoAppContext\");\n }\n\n return {\n app: context.app,\n folderIdPath: context.folderIdPath,\n folderIdInPath: context.folderIdInPath,\n model: context.model,\n client: context.client,\n mode: context.mode,\n loading: context.loading,\n error: context.error\n };\n};\n"],"mappings":"AAAA,SAASA,UAAU,QAAQ,OAAO;AAElC,SAASC,aAAa;AAEtB,OAAO,MAAMC,SAAS,GAAGA,CAAA,KAA6B;EAClD,MAAMC,OAAO,GAAGH,UAAU,CAACC,aAAa,CAAC;EAEzC,IAAI,CAACE,OAAO,EAAE;IACV,MAAM,IAAIC,KAAK,CAAC,+CAA+C,CAAC;EACpE;EAEA,OAAO;IACHC,GAAG,EAAEF,OAAO,CAACE,GAAG;IAChBC,YAAY,EAAEH,OAAO,CAACG,YAAY;IAClCC,cAAc,EAAEJ,OAAO,CAACI,cAAc;IACtCC,KAAK,EAAEL,OAAO,CAACK,KAAK;IACpBC,MAAM,EAAEN,OAAO,CAACM,MAAM;IACtBC,IAAI,EAAEP,OAAO,CAACO,IAAI;IAClBC,OAAO,EAAER,OAAO,CAACQ,OAAO;IACxBC,KAAK,EAAET,OAAO,CAACS;EACnB,CAAC;AACL,CAAC","ignoreList":[]}
|
package/hooks/useAcoList.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { AcoListContextData } from "../contexts/acoList";
|
|
2
|
-
import { GenericSearchData } from "../types";
|
|
1
|
+
import type { AcoListContextData } from "../contexts/acoList";
|
|
2
|
+
import type { GenericSearchData } from "../types";
|
|
3
3
|
export declare const useAcoList: <T extends GenericSearchData>() => AcoListContextData<T>;
|
package/hooks/useAcoList.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useContext","AcoListContext","useAcoList","context","Error"],"sources":["useAcoList.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"names":["useContext","AcoListContext","useAcoList","context","Error"],"sources":["useAcoList.ts"],"sourcesContent":["import type { Context } from \"react\";\nimport { useContext } from \"react\";\nimport type { AcoListContextData } from \"~/contexts/acoList\";\nimport { AcoListContext } from \"~/contexts/acoList\";\nimport type { GenericSearchData } from \"~/types\";\n\nexport const useAcoList = <T extends GenericSearchData>() => {\n const context = useContext<AcoListContextData<T>>(\n AcoListContext as unknown as Context<AcoListContextData<T>>\n );\n if (!context) {\n throw new Error(\"useAcoList must be used within a AcoListContext\");\n }\n\n return context;\n};\n"],"mappings":"AACA,SAASA,UAAU,QAAQ,OAAO;AAElC,SAASC,cAAc;AAGvB,OAAO,MAAMC,UAAU,GAAGA,CAAA,KAAmC;EACzD,MAAMC,OAAO,GAAGH,UAAU,CACtBC,cACJ,CAAC;EACD,IAAI,CAACE,OAAO,EAAE;IACV,MAAM,IAAIC,KAAK,CAAC,iDAAiD,CAAC;EACtE;EAEA,OAAOD,OAAO;AAClB,CAAC","ignoreList":[]}
|
package/hooks/useRecords.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { ListRecordsParams } from "../contexts/records";
|
|
3
|
-
import { DeletableSearchRecordItem, MovableSearchRecordItem, SearchRecordItem } from "../types";
|
|
2
|
+
import type { ListRecordsParams } from "../contexts/records";
|
|
3
|
+
import type { DeletableSearchRecordItem, MovableSearchRecordItem, SearchRecordItem } from "../types";
|
|
4
4
|
export declare const useRecords: import("@webiny/app-admin").GenericHook<string, {
|
|
5
5
|
/**
|
|
6
6
|
* NOTE: you do NOT need to call `listRecords` from this hook on component mount, because you already have folders in the `listRecords` property.
|
package/hooks/useRecords.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["dotPropImmutable","useContext","useEffect","useMemo","makeDecoratable","SearchRecordsContext","useAcoApp","useNavigateFolder","useRecords","folderId","context","Error","folderIdPath","currentFolderId","records","loading","meta","listRecords","getRecord","createRecord","updateRecord","moveRecord","deleteRecord","addRecordToCache","updateRecordInCache","removeRecordFromCache","where","set","filter","record","recordFolderId","get","params","id"],"sources":["useRecords.ts"],"sourcesContent":["import dotPropImmutable from \"dot-prop-immutable\";\nimport { useContext, useEffect, useMemo } from \"react\";\nimport { makeDecoratable } from \"@webiny/app-admin\";\nimport { ListRecordsParams
|
|
1
|
+
{"version":3,"names":["dotPropImmutable","useContext","useEffect","useMemo","makeDecoratable","SearchRecordsContext","useAcoApp","useNavigateFolder","useRecords","folderId","context","Error","folderIdPath","currentFolderId","records","loading","meta","listRecords","getRecord","createRecord","updateRecord","moveRecord","deleteRecord","addRecordToCache","updateRecordInCache","removeRecordFromCache","where","set","filter","record","recordFolderId","get","params","id"],"sources":["useRecords.ts"],"sourcesContent":["import dotPropImmutable from \"dot-prop-immutable\";\nimport { useContext, useEffect, useMemo } from \"react\";\nimport { makeDecoratable } from \"@webiny/app-admin\";\nimport type { ListRecordsParams } from \"~/contexts/records\";\nimport { SearchRecordsContext } from \"~/contexts/records\";\nimport type { DeletableSearchRecordItem, MovableSearchRecordItem, SearchRecordItem } from \"~/types\";\nimport { useAcoApp } from \"~/hooks/useAcoApp\";\nimport { useNavigateFolder } from \"~/hooks/useNavigateFolder\";\n\nexport const useRecords = makeDecoratable((folderId?: string) => {\n const context = useContext(SearchRecordsContext);\n\n if (!context) {\n throw new Error(\"useSearchRecords must be used within a SearchRecordsContext\");\n }\n\n const { folderIdPath } = useAcoApp();\n\n const { currentFolderId } = useNavigateFolder();\n\n const {\n records,\n loading,\n meta,\n listRecords,\n getRecord,\n createRecord,\n updateRecord,\n moveRecord,\n deleteRecord,\n addRecordToCache,\n updateRecordInCache,\n removeRecordFromCache\n } = context;\n\n useEffect(() => {\n /**\n * On first mount, call `listRecords`, which will either issue a network request, or load links from cache.\n * We don't need to store the result of it to any local state; that is managed by the context provider.\n */\n if (!folderId) {\n return;\n }\n const where = dotPropImmutable.set({}, folderIdPath, folderId);\n listRecords({\n where\n });\n }, [folderId]);\n\n return useMemo(\n () => ({\n /**\n * NOTE: you do NOT need to call `listRecords` from this hook on component mount, because you already have folders in the `listRecords` property.\n * As soon as you call `useRecords()`, you'll initiate fetching of `records`, which is managed by the `SearchRecordContext`.\n * Since this method lists records with pagination, you might need to call it multiple times passing the `after` param.\n */\n loading,\n meta,\n records: records.filter(record => {\n const recordFolderId = dotPropImmutable.get(record, folderIdPath);\n return recordFolderId === folderId || recordFolderId === currentFolderId;\n }),\n listRecords(params: ListRecordsParams) {\n const where = dotPropImmutable.set(params.where || {}, folderIdPath, folderId);\n return listRecords({\n ...params,\n where\n });\n },\n getRecord(id: string) {\n return getRecord(id);\n },\n createRecord(record: Omit<SearchRecordItem, \"id\">) {\n return createRecord(record);\n },\n updateRecord(record: SearchRecordItem) {\n return updateRecord(record, folderId);\n },\n moveRecord(params: MovableSearchRecordItem) {\n return moveRecord(params);\n },\n deleteRecord(record: DeletableSearchRecordItem) {\n return deleteRecord(record);\n },\n addRecordToCache,\n removeRecordFromCache,\n updateRecordInCache\n }),\n [records, loading, meta, currentFolderId, folderId]\n );\n});\n"],"mappings":"AAAA,OAAOA,gBAAgB,MAAM,oBAAoB;AACjD,SAASC,UAAU,EAAEC,SAAS,EAAEC,OAAO,QAAQ,OAAO;AACtD,SAASC,eAAe,QAAQ,mBAAmB;AAEnD,SAASC,oBAAoB;AAE7B,SAASC,SAAS;AAClB,SAASC,iBAAiB;AAE1B,OAAO,MAAMC,UAAU,GAAGJ,eAAe,CAAEK,QAAiB,IAAK;EAC7D,MAAMC,OAAO,GAAGT,UAAU,CAACI,oBAAoB,CAAC;EAEhD,IAAI,CAACK,OAAO,EAAE;IACV,MAAM,IAAIC,KAAK,CAAC,6DAA6D,CAAC;EAClF;EAEA,MAAM;IAAEC;EAAa,CAAC,GAAGN,SAAS,CAAC,CAAC;EAEpC,MAAM;IAAEO;EAAgB,CAAC,GAAGN,iBAAiB,CAAC,CAAC;EAE/C,MAAM;IACFO,OAAO;IACPC,OAAO;IACPC,IAAI;IACJC,WAAW;IACXC,SAAS;IACTC,YAAY;IACZC,YAAY;IACZC,UAAU;IACVC,YAAY;IACZC,gBAAgB;IAChBC,mBAAmB;IACnBC;EACJ,CAAC,GAAGf,OAAO;EAEXR,SAAS,CAAC,MAAM;IACZ;AACR;AACA;AACA;IACQ,IAAI,CAACO,QAAQ,EAAE;MACX;IACJ;IACA,MAAMiB,KAAK,GAAG1B,gBAAgB,CAAC2B,GAAG,CAAC,CAAC,CAAC,EAAEf,YAAY,EAAEH,QAAQ,CAAC;IAC9DQ,WAAW,CAAC;MACRS;IACJ,CAAC,CAAC;EACN,CAAC,EAAE,CAACjB,QAAQ,CAAC,CAAC;EAEd,OAAON,OAAO,CACV,OAAO;IACH;AACZ;AACA;AACA;AACA;IACYY,OAAO;IACPC,IAAI;IACJF,OAAO,EAAEA,OAAO,CAACc,MAAM,CAACC,MAAM,IAAI;MAC9B,MAAMC,cAAc,GAAG9B,gBAAgB,CAAC+B,GAAG,CAACF,MAAM,EAAEjB,YAAY,CAAC;MACjE,OAAOkB,cAAc,KAAKrB,QAAQ,IAAIqB,cAAc,KAAKjB,eAAe;IAC5E,CAAC,CAAC;IACFI,WAAWA,CAACe,MAAyB,EAAE;MACnC,MAAMN,KAAK,GAAG1B,gBAAgB,CAAC2B,GAAG,CAACK,MAAM,CAACN,KAAK,IAAI,CAAC,CAAC,EAAEd,YAAY,EAAEH,QAAQ,CAAC;MAC9E,OAAOQ,WAAW,CAAC;QACf,GAAGe,MAAM;QACTN;MACJ,CAAC,CAAC;IACN,CAAC;IACDR,SAASA,CAACe,EAAU,EAAE;MAClB,OAAOf,SAAS,CAACe,EAAE,CAAC;IACxB,CAAC;IACDd,YAAYA,CAACU,MAAoC,EAAE;MAC/C,OAAOV,YAAY,CAACU,MAAM,CAAC;IAC/B,CAAC;IACDT,YAAYA,CAACS,MAAwB,EAAE;MACnC,OAAOT,YAAY,CAACS,MAAM,EAAEpB,QAAQ,CAAC;IACzC,CAAC;IACDY,UAAUA,CAACW,MAA+B,EAAE;MACxC,OAAOX,UAAU,CAACW,MAAM,CAAC;IAC7B,CAAC;IACDV,YAAYA,CAACO,MAAiC,EAAE;MAC5C,OAAOP,YAAY,CAACO,MAAM,CAAC;IAC/B,CAAC;IACDN,gBAAgB;IAChBE,qBAAqB;IACrBD;EACJ,CAAC,CAAC,EACF,CAACV,OAAO,EAAEC,OAAO,EAAEC,IAAI,EAAEH,eAAe,EAAEJ,QAAQ,CACtD,CAAC;AACL,CAAC,CAAC","ignoreList":[]}
|
package/hooks/useTags.d.ts
CHANGED
package/hooks/useTags.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useContext","useEffect","useMemo","SearchRecordsContext","useAcoApp","useTags","params","tagsModifier","where","context","app","Error","tags","loading","listTags","id"],"sources":["useTags.ts"],"sourcesContent":["import { useContext, useEffect, useMemo } from \"react\";\nimport { SearchRecordsContext } from \"~/contexts/records\";\nimport { ListTagsWhereQueryVariables, TagItem } from \"~/types\";\nimport { useAcoApp } from \"~/hooks/useAcoApp\";\n\ninterface UseTagsParams {\n tagsModifier?: (tags: TagItem[]) => TagItem[];\n where?: ListTagsWhereQueryVariables;\n}\n\nexport const useTags = (params: UseTagsParams) => {\n const { tagsModifier, where } = params;\n\n const context = useContext(SearchRecordsContext);\n const { app } = useAcoApp();\n\n if (!context) {\n throw new Error(\"useTags must be used within a SearchRecordsContext\");\n }\n\n const { tags, loading, listTags } = context;\n\n useEffect(() => {\n listTags({ where });\n }, [app.id]);\n\n return useMemo(\n () => ({\n /**\n * NOTE: you do NOT need to call `listTags` from this hook on component mount, because you already have tags in the `listTags` property.\n * As soon as you call `useTags()`, you'll initiate fetching of `tags`, which is managed by the `SearchRecordContext`.\n */\n loading,\n tags: tagsModifier && typeof tagsModifier === \"function\" ? tagsModifier(tags) : tags\n }),\n [tags, loading]\n );\n};\n"],"mappings":"AAAA,SAASA,UAAU,EAAEC,SAAS,EAAEC,OAAO,QAAQ,OAAO;AACtD,SAASC,oBAAoB;AAE7B,SAASC,SAAS;AAOlB,OAAO,MAAMC,OAAO,GAAIC,MAAqB,IAAK;EAC9C,MAAM;IAAEC,YAAY;IAAEC;EAAM,CAAC,GAAGF,MAAM;EAEtC,MAAMG,OAAO,GAAGT,UAAU,CAACG,oBAAoB,CAAC;EAChD,MAAM;IAAEO;EAAI,CAAC,GAAGN,SAAS,CAAC,CAAC;EAE3B,IAAI,CAACK,OAAO,EAAE;IACV,MAAM,IAAIE,KAAK,CAAC,oDAAoD,CAAC;EACzE;EAEA,MAAM;IAAEC,IAAI;IAAEC,OAAO;IAAEC;EAAS,CAAC,GAAGL,OAAO;EAE3CR,SAAS,CAAC,MAAM;IACZa,QAAQ,CAAC;MAAEN;IAAM,CAAC,CAAC;EACvB,CAAC,EAAE,CAACE,GAAG,CAACK,EAAE,CAAC,CAAC;EAEZ,OAAOb,OAAO,CACV,OAAO;IACH;AACZ;AACA;AACA;IACYW,OAAO;IACPD,IAAI,EAAEL,YAAY,IAAI,OAAOA,YAAY,KAAK,UAAU,GAAGA,YAAY,CAACK,IAAI,CAAC,GAAGA;EACpF,CAAC,CAAC,EACF,CAACA,IAAI,EAAEC,OAAO,CAClB,CAAC;AACL,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["useContext","useEffect","useMemo","SearchRecordsContext","useAcoApp","useTags","params","tagsModifier","where","context","app","Error","tags","loading","listTags","id"],"sources":["useTags.ts"],"sourcesContent":["import { useContext, useEffect, useMemo } from \"react\";\nimport { SearchRecordsContext } from \"~/contexts/records\";\nimport type { ListTagsWhereQueryVariables, TagItem } from \"~/types\";\nimport { useAcoApp } from \"~/hooks/useAcoApp\";\n\ninterface UseTagsParams {\n tagsModifier?: (tags: TagItem[]) => TagItem[];\n where?: ListTagsWhereQueryVariables;\n}\n\nexport const useTags = (params: UseTagsParams) => {\n const { tagsModifier, where } = params;\n\n const context = useContext(SearchRecordsContext);\n const { app } = useAcoApp();\n\n if (!context) {\n throw new Error(\"useTags must be used within a SearchRecordsContext\");\n }\n\n const { tags, loading, listTags } = context;\n\n useEffect(() => {\n listTags({ where });\n }, [app.id]);\n\n return useMemo(\n () => ({\n /**\n * NOTE: you do NOT need to call `listTags` from this hook on component mount, because you already have tags in the `listTags` property.\n * As soon as you call `useTags()`, you'll initiate fetching of `tags`, which is managed by the `SearchRecordContext`.\n */\n loading,\n tags: tagsModifier && typeof tagsModifier === \"function\" ? tagsModifier(tags) : tags\n }),\n [tags, loading]\n );\n};\n"],"mappings":"AAAA,SAASA,UAAU,EAAEC,SAAS,EAAEC,OAAO,QAAQ,OAAO;AACtD,SAASC,oBAAoB;AAE7B,SAASC,SAAS;AAOlB,OAAO,MAAMC,OAAO,GAAIC,MAAqB,IAAK;EAC9C,MAAM;IAAEC,YAAY;IAAEC;EAAM,CAAC,GAAGF,MAAM;EAEtC,MAAMG,OAAO,GAAGT,UAAU,CAACG,oBAAoB,CAAC;EAChD,MAAM;IAAEO;EAAI,CAAC,GAAGN,SAAS,CAAC,CAAC;EAE3B,IAAI,CAACK,OAAO,EAAE;IACV,MAAM,IAAIE,KAAK,CAAC,oDAAoD,CAAC;EACzE;EAEA,MAAM;IAAEC,IAAI;IAAEC,OAAO;IAAEC;EAAS,CAAC,GAAGL,OAAO;EAE3CR,SAAS,CAAC,MAAM;IACZa,QAAQ,CAAC;MAAEN;IAAM,CAAC,CAAC;EACvB,CAAC,EAAE,CAACE,GAAG,CAACK,EAAE,CAAC,CAAC;EAEZ,OAAOb,OAAO,CACV,OAAO;IACH;AACZ;AACA;AACA;IACYW,OAAO;IACPD,IAAI,EAAEL,YAAY,IAAI,OAAOA,YAAY,KAAK,UAAU,GAAGA,YAAY,CAACK,IAAI,CAAC,GAAGA;EACpF,CAAC,CAAC,EACF,CAACA,IAAI,EAAEC,OAAO,CAClB,CAAC;AACL,CAAC","ignoreList":[]}
|
package/index.d.ts
CHANGED
package/index.js
CHANGED
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./app\";\nexport * from \"./components\";\nexport * from \"./config\";\nexport * from \"./contexts\";\nexport * from \"./hooks\";\nexport * from \"./features\";\nexport * from \"./dialogs\";\nexport * from \"./sorting\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./app\";\nexport * from \"./components\";\nexport * from \"./config\";\nexport * from \"./contexts\";\nexport * from \"./hooks\";\nexport * from \"./features\";\nexport * from \"./dialogs\";\nexport * from \"./sorting\";\nexport type { TableRow, FolderTableRow, RecordTableRow } from \"./table.types\";\nexport type { ListMeta } from \"./types\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAA0B","ignoreList":[]}
|