@umbraco-cms/backoffice 14.0.0-695f1c3f → 14.0.0-709b3cbf
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/dist-cms/apps/app/app.element.js +1 -1
- package/dist-cms/apps/app/index.d.ts +1 -0
- package/dist-cms/apps/app/index.js +1 -0
- package/dist-cms/assets/lang/en-us.js +18 -18
- package/dist-cms/assets/lang/en-us.ts +18 -18
- package/dist-cms/custom-elements.json +71 -49
- package/dist-cms/external/backend-api/index.js +1 -1
- package/dist-cms/external/backend-api/src/index.d.ts +17 -1
- package/dist-cms/external/backend-api/src/models/CreateContentRequestModelBaseDocumentValueModelDocumentVariantRequestModel.d.ts +1 -0
- package/dist-cms/external/backend-api/src/models/CreateContentRequestModelBaseMediaValueModelMediaVariantRequestModel.d.ts +1 -0
- package/dist-cms/external/backend-api/src/models/CreateContentTypeRequestModelBaseCreateDocumentTypePropertyTypeRequestModelCreateDocumentTypePropertyTypeContainerRequestModel.d.ts +2 -0
- package/dist-cms/external/backend-api/src/models/CreateContentTypeRequestModelBaseCreateMediaTypePropertyTypeRequestModelCreateMediaTypePropertyTypeContainerRequestModel.d.ts +20 -0
- package/dist-cms/external/backend-api/src/models/CreateMediaTypePropertyTypeContainerRequestModel.d.ts +2 -0
- package/dist-cms/external/backend-api/src/models/CreateMediaTypePropertyTypeRequestModel.d.ts +2 -0
- package/dist-cms/external/backend-api/src/models/CreateMediaTypeRequestModel.d.ts +2 -0
- package/dist-cms/external/backend-api/src/models/DeleteUserGroupsRequestModel.d.ts +3 -0
- package/dist-cms/external/backend-api/src/models/DeleteUsersRequestModel.d.ts +3 -0
- package/dist-cms/external/backend-api/src/models/ItemSortingRequestModel.d.ts +4 -0
- package/dist-cms/external/backend-api/src/models/ProblemDetailsBuilderModel.d.ts +1 -0
- package/dist-cms/external/backend-api/src/models/RelationResponseModel.d.ts +2 -2
- package/dist-cms/external/backend-api/src/models/ResetPasswordRequestModel.d.ts +3 -0
- package/dist-cms/external/backend-api/src/models/ResetPasswordTokenRequestModel.d.ts +4 -0
- package/dist-cms/external/backend-api/src/models/SortingRequestModel.d.ts +5 -0
- package/dist-cms/external/backend-api/src/models/UpdateContentTypeRequestModelBaseUpdateMediaTypePropertyTypeRequestModelUpdateMediaTypePropertyTypeContainerRequestModel.d.ts +18 -0
- package/dist-cms/external/backend-api/src/models/{UpdateFolderReponseModel.d.ts → UpdateFolderResponseModel.d.ts} +1 -1
- package/dist-cms/external/backend-api/src/models/UpdateMediaTypePropertyTypeContainerRequestModel.d.ts +2 -0
- package/dist-cms/external/backend-api/src/models/UpdateMediaTypePropertyTypeRequestModel.d.ts +2 -0
- package/dist-cms/external/backend-api/src/models/UpdateMediaTypeRequestModel.d.ts +2 -0
- package/dist-cms/external/backend-api/src/models/VerifyResetPasswordTokenRequestModel.d.ts +4 -0
- package/dist-cms/external/backend-api/src/services/DataTypeResource.d.ts +2 -2
- package/dist-cms/external/backend-api/src/services/DocumentResource.d.ts +21 -21
- package/dist-cms/external/backend-api/src/services/DocumentTypeResource.d.ts +35 -3
- package/dist-cms/external/backend-api/src/services/MediaResource.d.ts +13 -5
- package/dist-cms/external/backend-api/src/services/MediaTypeResource.d.ts +56 -0
- package/dist-cms/external/backend-api/src/services/RelationResource.d.ts +1 -9
- package/dist-cms/external/backend-api/src/services/SecurityResource.d.ts +24 -0
- package/dist-cms/external/backend-api/src/services/UserGroupResource.d.ts +8 -0
- package/dist-cms/external/backend-api/src/services/UserResource.d.ts +8 -0
- package/dist-cms/external/router-slot/config.d.ts +8 -0
- package/dist-cms/external/router-slot/index.d.ts +4 -3
- package/dist-cms/external/router-slot/index.js +1 -1
- package/dist-cms/external/router-slot/model.d.ts +123 -0
- package/dist-cms/external/router-slot/router-slot.d.ts +111 -0
- package/dist-cms/external/router-slot/util/anchor.d.ts +5 -0
- package/dist-cms/external/router-slot/util/events.d.ts +26 -0
- package/dist-cms/external/router-slot/util/history.d.ts +32 -0
- package/dist-cms/external/router-slot/util/index.d.ts +6 -0
- package/dist-cms/external/router-slot/util/router.d.ts +72 -0
- package/dist-cms/external/router-slot/util/shadow.d.ts +15 -0
- package/dist-cms/external/router-slot/util/url.d.ts +78 -0
- package/dist-cms/external/router-slot/util.d.ts +1 -0
- package/dist-cms/libs/observable-api/observer.js +2 -1
- package/dist-cms/mocks/browser-handlers.js +3 -1
- package/dist-cms/mocks/data/document.data.d.ts +6 -2
- package/dist-cms/mocks/data/document.data.js +54 -4
- package/dist-cms/mocks/data/entity.data.js +0 -2
- package/dist-cms/mocks/data/scripts.data.d.ts +21 -0
- package/dist-cms/mocks/data/scripts.data.js +205 -0
- package/dist-cms/mocks/handlers/{document.handlers.js → document/document.handlers.js} +28 -40
- package/dist-cms/mocks/handlers/document/index.d.ts +1 -0
- package/dist-cms/mocks/handlers/document/index.js +5 -0
- package/dist-cms/mocks/handlers/document/item.handlers.d.ts +1 -0
- package/dist-cms/mocks/handlers/document/item.handlers.js +13 -0
- package/dist-cms/mocks/handlers/document/recycle-bin.handlers.d.ts +1 -0
- package/dist-cms/mocks/handlers/document/recycle-bin.handlers.js +16 -0
- package/dist-cms/mocks/handlers/document/slug.d.ts +1 -0
- package/dist-cms/mocks/handlers/document/slug.js +1 -0
- package/dist-cms/mocks/handlers/document/tree.handlers.d.ts +1 -0
- package/dist-cms/mocks/handlers/document/tree.handlers.js +16 -0
- package/dist-cms/mocks/handlers/scripts.handlers.d.ts +2 -0
- package/dist-cms/mocks/handlers/scripts.handlers.js +83 -0
- package/dist-cms/packages/core/components/input-list-base/input-list-base.js +1 -1
- package/dist-cms/packages/core/content-type/content-type-container-structure-helper.class.js +2 -2
- package/dist-cms/packages/core/content-type/content-type-property-structure-helper.class.js +1 -1
- package/dist-cms/packages/core/content-type/content-type-structure-manager.class.d.ts +15 -15
- package/dist-cms/packages/core/content-type/content-type-structure-manager.class.js +79 -103
- package/dist-cms/packages/core/culture/components/index.d.ts +1 -0
- package/dist-cms/packages/core/culture/components/index.js +1 -0
- package/dist-cms/packages/{settings/cultures → core/culture}/components/input-culture-select/input-culture-select.element.js +5 -5
- package/dist-cms/packages/core/culture/index.d.ts +2 -0
- package/dist-cms/packages/core/culture/index.js +2 -0
- package/dist-cms/packages/core/culture/manifests.d.ts +1 -0
- package/dist-cms/packages/{settings/cultures → core/culture}/repository/culture.repository.js +1 -1
- package/dist-cms/packages/{settings/cultures → core/culture}/repository/manifests.d.ts +1 -1
- package/dist-cms/packages/{settings/cultures → core/culture}/repository/manifests.js +1 -1
- package/dist-cms/packages/core/entity-action/common/trash/trash.action.d.ts +1 -1
- package/dist-cms/packages/core/entity-action/common/trash/trash.action.js +1 -1
- package/dist-cms/packages/core/index.d.ts +1 -0
- package/dist-cms/packages/core/index.js +3 -0
- package/dist-cms/packages/core/modal/token/create-document-modal.token.d.ts +8 -0
- package/dist-cms/packages/core/modal/token/create-document-modal.token.js +5 -0
- package/dist-cms/packages/core/modal/token/index.d.ts +1 -1
- package/dist-cms/packages/core/modal/token/index.js +1 -1
- package/dist-cms/packages/core/store/store-base.d.ts +18 -6
- package/dist-cms/packages/core/store/store-base.js +22 -6
- package/dist-cms/packages/documents/document-types/entity-actions/manifests.js +1 -1
- package/dist-cms/packages/documents/document-types/manifests.js +0 -2
- package/dist-cms/packages/documents/document-types/repository/document-type-item.store.d.ts +20 -0
- package/dist-cms/packages/documents/document-types/repository/document-type-item.store.js +23 -0
- package/dist-cms/packages/documents/document-types/repository/document-type.repository.d.ts +5 -21
- package/dist-cms/packages/documents/document-types/repository/document-type.repository.js +26 -20
- package/dist-cms/packages/documents/document-types/repository/manifests.d.ts +3 -2
- package/dist-cms/packages/documents/document-types/repository/manifests.js +9 -1
- package/dist-cms/packages/documents/document-types/repository/sources/document-type-item.server.data.d.ts +25 -0
- package/dist-cms/packages/documents/document-types/repository/sources/document-type-item.server.data.js +32 -0
- package/dist-cms/packages/documents/document-types/repository/sources/document-type.server.data.d.ts +1 -1
- package/dist-cms/packages/documents/document-types/repository/sources/document-type.server.data.js +1 -12
- package/dist-cms/packages/documents/document-types/workspace/document-type-workspace.context.js +27 -27
- package/dist-cms/packages/documents/document-types/workspace/views/design/document-type-workspace-view-edit.element.js +8 -4
- package/dist-cms/packages/documents/documents/entity-actions/create/create-document-modal.element.d.ts +17 -0
- package/dist-cms/packages/documents/{document-types/modals/allowed-document-types/allowed-document-types-modal.element.js → documents/entity-actions/create/create-document-modal.element.js} +29 -38
- package/dist-cms/packages/documents/documents/entity-actions/create/create.action.d.ts +0 -2
- package/dist-cms/packages/documents/documents/entity-actions/create/create.action.js +7 -23
- package/dist-cms/packages/documents/documents/entity-actions/create/manifests.d.ts +2 -0
- package/dist-cms/packages/documents/documents/entity-actions/create/manifests.js +27 -0
- package/dist-cms/packages/documents/documents/entity-actions/manifests.d.ts +2 -2
- package/dist-cms/packages/documents/documents/entity-actions/manifests.js +15 -48
- package/dist-cms/packages/documents/documents/index.d.ts +1 -0
- package/dist-cms/packages/documents/documents/index.js +1 -0
- package/dist-cms/packages/documents/documents/manifests.d.ts +13 -1
- package/dist-cms/packages/documents/documents/manifests.js +2 -0
- package/dist-cms/packages/documents/documents/menu-item/manifests.js +1 -1
- package/dist-cms/packages/documents/documents/recycle-bin/entity-action/manifests.d.ts +14 -0
- package/dist-cms/packages/documents/documents/recycle-bin/entity-action/manifests.js +18 -0
- package/dist-cms/packages/documents/documents/recycle-bin/index.d.ts +1 -0
- package/dist-cms/packages/documents/documents/recycle-bin/index.js +1 -0
- package/dist-cms/packages/documents/documents/recycle-bin/manifests.d.ts +13 -0
- package/dist-cms/packages/documents/documents/recycle-bin/manifests.js +5 -0
- package/dist-cms/packages/documents/documents/recycle-bin/menu-item/manifests.d.ts +1 -0
- package/dist-cms/packages/documents/documents/recycle-bin/menu-item/manifests.js +14 -0
- package/dist-cms/packages/documents/documents/recycle-bin/repository/document-recycle-bin.repository.d.ts +28 -0
- package/dist-cms/packages/documents/documents/recycle-bin/repository/document-recycle-bin.repository.js +56 -0
- package/dist-cms/packages/documents/documents/recycle-bin/repository/document-recycle.bin.tree.store.d.ts +18 -0
- package/dist-cms/packages/documents/documents/recycle-bin/repository/document-recycle.bin.tree.store.js +19 -0
- package/dist-cms/packages/documents/documents/recycle-bin/repository/index.d.ts +1 -0
- package/dist-cms/packages/documents/documents/recycle-bin/repository/index.js +1 -0
- package/dist-cms/packages/documents/documents/recycle-bin/repository/manifests.d.ts +4 -0
- package/dist-cms/packages/documents/documents/recycle-bin/repository/manifests.js +17 -0
- package/dist-cms/packages/documents/documents/recycle-bin/repository/sources/document-recycle-bin.tree.server.data.d.ts +29 -0
- package/dist-cms/packages/documents/documents/recycle-bin/repository/sources/document-recycle-bin.tree.server.data.js +49 -0
- package/dist-cms/packages/documents/documents/recycle-bin/tree/manifests.d.ts +2 -0
- package/dist-cms/packages/documents/documents/recycle-bin/tree/manifests.js +19 -0
- package/dist-cms/packages/documents/documents/repository/document-item.store.d.ts +20 -0
- package/dist-cms/packages/documents/documents/repository/document-item.store.js +23 -0
- package/dist-cms/packages/documents/documents/repository/document.repository.d.ts +10 -9
- package/dist-cms/packages/documents/documents/repository/document.repository.js +47 -25
- package/dist-cms/packages/documents/documents/repository/document.store.d.ts +0 -12
- package/dist-cms/packages/documents/documents/repository/document.store.js +0 -16
- package/dist-cms/packages/documents/documents/repository/sources/document-item.server.data.d.ts +24 -0
- package/dist-cms/packages/documents/documents/repository/sources/document-item.server.data.js +31 -0
- package/dist-cms/packages/documents/documents/repository/sources/document.server.data.d.ts +9 -21
- package/dist-cms/packages/documents/documents/repository/sources/document.server.data.js +33 -62
- package/dist-cms/packages/documents/documents/workspace/manifests.js +6 -4
- package/dist-cms/packages/documents/manifests.d.ts +13 -1
- package/dist-cms/packages/settings/dashboards/performance-profiling/dashboard-performance-profiling.element.d.ts +3 -1
- package/dist-cms/packages/settings/dashboards/performance-profiling/dashboard-performance-profiling.element.js +26 -40
- package/dist-cms/packages/settings/manifests.js +0 -2
- package/dist-cms/packages/settings/relation-types/workspace/views/relation/workspace-view-relation-type-relation.element.js +17 -17
- package/dist-cms/packages/templating/manifests.js +2 -0
- package/dist-cms/packages/templating/scripts/config.d.ts +20 -0
- package/dist-cms/packages/templating/scripts/config.js +22 -0
- package/dist-cms/packages/templating/scripts/entity-actions/create/create-empty.action.d.ts +8 -0
- package/dist-cms/packages/templating/scripts/entity-actions/create/create-empty.action.js +9 -0
- package/dist-cms/packages/templating/scripts/entity-actions/manifests.d.ts +2 -0
- package/dist-cms/packages/templating/scripts/entity-actions/manifests.js +56 -0
- package/dist-cms/packages/templating/scripts/index.d.ts +2 -0
- package/dist-cms/packages/templating/scripts/index.js +2 -0
- package/dist-cms/packages/templating/scripts/manifests.d.ts +1 -0
- package/dist-cms/packages/templating/scripts/manifests.js +12 -0
- package/dist-cms/packages/templating/scripts/menu-item/manifests.d.ts +1 -0
- package/dist-cms/packages/templating/scripts/menu-item/manifests.js +16 -0
- package/dist-cms/packages/templating/scripts/repository/index.d.ts +1 -0
- package/dist-cms/packages/templating/scripts/repository/index.js +1 -0
- package/dist-cms/packages/templating/scripts/repository/manifests.d.ts +2 -0
- package/dist-cms/packages/templating/scripts/repository/manifests.js +23 -0
- package/dist-cms/packages/templating/scripts/repository/scripts.repository.d.ts +71 -0
- package/dist-cms/packages/templating/scripts/repository/scripts.repository.js +154 -0
- package/dist-cms/packages/templating/scripts/repository/scripts.store.d.ts +31 -0
- package/dist-cms/packages/templating/scripts/repository/scripts.store.js +37 -0
- package/dist-cms/packages/templating/scripts/repository/scripts.tree.store.d.ts +19 -0
- package/dist-cms/packages/templating/scripts/repository/scripts.tree.store.js +21 -0
- package/dist-cms/packages/templating/scripts/repository/sources/index.d.ts +11 -0
- package/dist-cms/packages/templating/scripts/repository/sources/index.js +1 -0
- package/dist-cms/packages/templating/scripts/repository/sources/scripts.detail.server.data.d.ts +41 -0
- package/dist-cms/packages/templating/scripts/repository/sources/scripts.detail.server.data.js +57 -0
- package/dist-cms/packages/templating/scripts/repository/sources/scripts.folder.server.data.d.ts +17 -0
- package/dist-cms/packages/templating/scripts/repository/sources/scripts.folder.server.data.js +23 -0
- package/dist-cms/packages/templating/scripts/repository/sources/scripts.tree.server.data.d.ts +14 -0
- package/dist-cms/packages/templating/scripts/repository/sources/scripts.tree.server.data.js +31 -0
- package/dist-cms/packages/templating/scripts/tree/manifests.d.ts +2 -0
- package/dist-cms/packages/templating/scripts/tree/manifests.js +20 -0
- package/dist-cms/packages/templating/scripts/workspace/manifests.d.ts +2 -0
- package/dist-cms/packages/templating/scripts/workspace/manifests.js +32 -0
- package/dist-cms/packages/templating/scripts/workspace/scripts-workspace-edit.element.d.ts +24 -0
- package/dist-cms/packages/templating/scripts/workspace/scripts-workspace-edit.element.js +171 -0
- package/dist-cms/packages/templating/scripts/workspace/scripts-workspace.context.d.ts +23 -0
- package/dist-cms/packages/templating/scripts/workspace/scripts-workspace.context.js +87 -0
- package/dist-cms/packages/templating/scripts/workspace/scripts-workspace.element.d.ts +14 -0
- package/dist-cms/packages/templating/scripts/workspace/scripts-workspace.element.js +50 -0
- package/dist-cms/packages/templating/templates/modals/query-builder/query-builder.element.d.ts +1 -1
- package/dist-cms/packages/templating/templates/modals/query-builder/query-builder.element.js +1 -1
- package/dist-cms/packages/users/current-user/modals/current-user/current-user-modal.element.js +2 -2
- package/dist-cms/packages/users/user-groups/collection/user-group-collection-header.element.js +2 -2
- package/dist-cms/packages/users/user-groups/collection/user-group-collection-view.element.js +6 -6
- package/dist-cms/packages/users/user-groups/workspace/user-group-workspace-editor.element.js +15 -12
- package/dist-cms/packages/users/users/collection/user-collection-header.element.js +18 -11
- package/dist-cms/packages/users/users/collection/views/grid/user-collection-grid-view.element.js +6 -6
- package/dist-cms/packages/users/users/collection/views/table/column-layouts/status/user-table-status-column-layout.element.js +3 -3
- package/dist-cms/packages/users/users/index.d.ts +1 -0
- package/dist-cms/packages/users/users/index.js +1 -0
- package/dist-cms/packages/users/users/repository/index.d.ts +1 -0
- package/dist-cms/packages/users/users/repository/index.js +1 -0
- package/dist-cms/packages/users/users/workspace/user-workspace-editor.element.js +36 -35
- package/dist-cms/packages/users/utils.d.ts +5 -2
- package/dist-cms/packages/users/utils.js +14 -14
- package/dist-cms/shared/repository/data-source/folder-data-source.interface.d.ts +2 -2
- package/dist-cms/shared/repository/folder-repository.interface.d.ts +2 -2
- package/dist-cms/shared/router/index.d.ts +1 -1
- package/dist-cms/shared/router/index.js +1 -1
- package/dist-cms/tsconfig.build.tsbuildinfo +1 -1
- package/dist-cms/vscode-html-custom-data.json +33 -23
- package/package.json +4 -4
- package/dist-cms/packages/core/modal/token/allowed-document-types-modal.token.d.ts +0 -9
- package/dist-cms/packages/core/modal/token/allowed-document-types-modal.token.js +0 -5
- package/dist-cms/packages/documents/document-types/modals/allowed-document-types/allowed-document-types-modal.element.d.ts +0 -19
- package/dist-cms/packages/documents/document-types/modals/manifests.d.ts +0 -2
- package/dist-cms/packages/documents/document-types/modals/manifests.js +0 -9
- package/dist-cms/packages/settings/cultures/components/index.d.ts +0 -1
- package/dist-cms/packages/settings/cultures/components/index.js +0 -1
- package/dist-cms/packages/settings/cultures/manifests.d.ts +0 -1
- package/dist-cms/shared/context/index.d.ts +0 -1
- package/dist-cms/shared/context/index.js +0 -1
- package/router-slot-2.3.0.tgz +0 -0
- /package/dist-cms/{shared/context → apps/app}/app.context.d.ts +0 -0
- /package/dist-cms/{shared/context → apps/app}/app.context.js +0 -0
- /package/dist-cms/mocks/handlers/{document.handlers.d.ts → document/document.handlers.d.ts} +0 -0
- /package/dist-cms/packages/{settings/cultures → core/culture}/components/input-culture-select/input-culture-select.element.d.ts +0 -0
- /package/dist-cms/packages/{settings/cultures → core/culture}/manifests.js +0 -0
- /package/dist-cms/packages/{settings/cultures → core/culture}/repository/culture.repository.d.ts +0 -0
- /package/dist-cms/packages/{settings/cultures → core/culture}/repository/sources/culture.server.data.d.ts +0 -0
- /package/dist-cms/packages/{settings/cultures → core/culture}/repository/sources/culture.server.data.js +0 -0
- /package/dist-cms/packages/{settings/cultures → core/culture}/repository/sources/index.d.ts +0 -0
- /package/dist-cms/packages/{settings/cultures → core/culture}/repository/sources/index.js +0 -0
|
@@ -23,16 +23,15 @@ export declare class UmbDocumentRepository implements UmbTreeRepository<Document
|
|
|
23
23
|
error: import("../../../../external/backend-api/index.js").ApiError | import("../../../../external/backend-api/index.js").CancelError | undefined;
|
|
24
24
|
asObservable: () => import("rxjs").Observable<import("../../../../external/backend-api/index.js").EntityTreeItemResponseModel[]>;
|
|
25
25
|
}>;
|
|
26
|
-
|
|
27
|
-
requestAllowedDocumentTypesOf(id: string): Promise<import("../../../../shared/repository/index.js").DataSourceResponse<import("../../../../external/backend-api/index.js").PagedDocumentTypeResponseModel>>;
|
|
28
|
-
requestItemsLegacy(ids: Array<string>): Promise<{
|
|
29
|
-
data: any[] | undefined;
|
|
30
|
-
error: import("../../../../external/backend-api/index.js").ApiError | import("../../../../external/backend-api/index.js").CancelError | undefined;
|
|
31
|
-
asObservable: () => import("rxjs").Observable<import("../../../../external/backend-api/index.js").EntityTreeItemResponseModel[]>;
|
|
32
|
-
}>;
|
|
26
|
+
requestAllowedDocumentTypesOf(id: string | null): Promise<import("../../../../shared/repository/index.js").DataSourceResponse<import("../../../../external/backend-api/index.js").PagedDocumentTypeResponseModel>>;
|
|
33
27
|
rootTreeItems(): Promise<import("rxjs").Observable<import("../../../../external/backend-api/index.js").EntityTreeItemResponseModel[]>>;
|
|
34
28
|
treeItemsOf(parentId: string | null): Promise<import("rxjs").Observable<import("../../../../external/backend-api/index.js").EntityTreeItemResponseModel[]>>;
|
|
35
|
-
|
|
29
|
+
requestItems(ids: Array<string>): Promise<{
|
|
30
|
+
data: import("../../../../external/backend-api/index.js").DocumentItemResponseModel[] | undefined;
|
|
31
|
+
error: import("../../../../external/backend-api/index.js").ApiError | import("../../../../external/backend-api/index.js").CancelError | undefined;
|
|
32
|
+
asObservable: () => import("rxjs").Observable<import("../../../../external/backend-api/index.js").DocumentItemResponseModel[]>;
|
|
33
|
+
}>;
|
|
34
|
+
items(ids: Array<string>): Promise<import("rxjs").Observable<import("../../../../external/backend-api/index.js").DocumentItemResponseModel[]>>;
|
|
36
35
|
createScaffold(documentTypeKey: string, preset?: Partial<CreateDocumentRequestModel>): Promise<{
|
|
37
36
|
data: DocumentResponseModel;
|
|
38
37
|
}>;
|
|
@@ -62,7 +61,9 @@ export declare class UmbDocumentRepository implements UmbTreeRepository<Document
|
|
|
62
61
|
delete(id: string): Promise<{
|
|
63
62
|
error: import("../../../../external/backend-api/index.js").ApiError | import("../../../../external/backend-api/index.js").CancelError | undefined;
|
|
64
63
|
}>;
|
|
65
|
-
trash(
|
|
64
|
+
trash(id: string): Promise<{
|
|
65
|
+
error: import("../../../../external/backend-api/index.js").ApiError | import("../../../../external/backend-api/index.js").CancelError | undefined;
|
|
66
|
+
}>;
|
|
66
67
|
saveAndPublish(): Promise<void>;
|
|
67
68
|
saveAndPreview(): Promise<void>;
|
|
68
69
|
saveAndSchedule(): Promise<void>;
|
|
@@ -2,6 +2,8 @@ import { UmbDocumentServerDataSource } from './sources/document.server.data.js';
|
|
|
2
2
|
import { UMB_DOCUMENT_STORE_CONTEXT_TOKEN } from './document.store.js';
|
|
3
3
|
import { UMB_DOCUMENT_TREE_STORE_CONTEXT_TOKEN } from './document.tree.store.js';
|
|
4
4
|
import { UmbDocumentTreeServerDataSource } from './sources/document.tree.server.data.js';
|
|
5
|
+
import { UMB_DOCUMENT_ITEM_STORE_CONTEXT_TOKEN } from './document-item.store.js';
|
|
6
|
+
import { UmbDocumentItemServerDataSource } from './sources/document-item.server.data.js';
|
|
5
7
|
import { UmbContextConsumerController } from '../../../../libs/context-api/index.js';
|
|
6
8
|
import { UMB_NOTIFICATION_CONTEXT_TOKEN } from '../../../core/notification/index.js';
|
|
7
9
|
export class UmbDocumentRepository {
|
|
@@ -11,12 +13,15 @@ export class UmbDocumentRepository {
|
|
|
11
13
|
#treeStore;
|
|
12
14
|
#detailDataSource;
|
|
13
15
|
#store;
|
|
16
|
+
#itemSource;
|
|
17
|
+
#itemStore;
|
|
14
18
|
#notificationContext;
|
|
15
19
|
constructor(host) {
|
|
16
20
|
this.#host = host;
|
|
17
21
|
// TODO: figure out how spin up get the correct data source
|
|
18
22
|
this.#treeSource = new UmbDocumentTreeServerDataSource(this.#host);
|
|
19
23
|
this.#detailDataSource = new UmbDocumentServerDataSource(this.#host);
|
|
24
|
+
this.#itemSource = new UmbDocumentItemServerDataSource(this.#host);
|
|
20
25
|
this.#init = Promise.all([
|
|
21
26
|
new UmbContextConsumerController(this.#host, UMB_DOCUMENT_TREE_STORE_CONTEXT_TOKEN, (instance) => {
|
|
22
27
|
this.#treeStore = instance;
|
|
@@ -24,12 +29,14 @@ export class UmbDocumentRepository {
|
|
|
24
29
|
new UmbContextConsumerController(this.#host, UMB_DOCUMENT_STORE_CONTEXT_TOKEN, (instance) => {
|
|
25
30
|
this.#store = instance;
|
|
26
31
|
}),
|
|
32
|
+
new UmbContextConsumerController(this.#host, UMB_DOCUMENT_ITEM_STORE_CONTEXT_TOKEN, (instance) => {
|
|
33
|
+
this.#itemStore = instance;
|
|
34
|
+
}),
|
|
27
35
|
new UmbContextConsumerController(this.#host, UMB_NOTIFICATION_CONTEXT_TOKEN, (instance) => {
|
|
28
36
|
this.#notificationContext = instance;
|
|
29
37
|
}),
|
|
30
38
|
]);
|
|
31
39
|
}
|
|
32
|
-
// TODO: Trash
|
|
33
40
|
// TODO: Move
|
|
34
41
|
// TREE:
|
|
35
42
|
async requestTreeRoot() {
|
|
@@ -62,23 +69,12 @@ export class UmbDocumentRepository {
|
|
|
62
69
|
return { data, error, asObservable: () => this.#treeStore.childrenOf(parentId) };
|
|
63
70
|
}
|
|
64
71
|
// Structure permissions;
|
|
65
|
-
async requestAllowedDocumentTypesAtRoot() {
|
|
66
|
-
return this.#detailDataSource.getAllowedDocumentTypesAtRoot();
|
|
67
|
-
}
|
|
68
72
|
async requestAllowedDocumentTypesOf(id) {
|
|
69
|
-
if (
|
|
73
|
+
if (id === undefined)
|
|
70
74
|
throw new Error('Id is missing');
|
|
71
75
|
await this.#init;
|
|
72
76
|
return this.#detailDataSource.getAllowedDocumentTypesOf(id);
|
|
73
77
|
}
|
|
74
|
-
async requestItemsLegacy(ids) {
|
|
75
|
-
await this.#init;
|
|
76
|
-
if (!ids) {
|
|
77
|
-
throw new Error('Ids are missing');
|
|
78
|
-
}
|
|
79
|
-
const { data, error } = await this.#treeSource.getItems(ids);
|
|
80
|
-
return { data, error, asObservable: () => this.#treeStore.items(ids) };
|
|
81
|
-
}
|
|
82
78
|
async rootTreeItems() {
|
|
83
79
|
await this.#init;
|
|
84
80
|
return this.#treeStore.rootItems;
|
|
@@ -87,9 +83,20 @@ export class UmbDocumentRepository {
|
|
|
87
83
|
await this.#init;
|
|
88
84
|
return this.#treeStore.childrenOf(parentId);
|
|
89
85
|
}
|
|
90
|
-
|
|
86
|
+
// ITEMS:
|
|
87
|
+
async requestItems(ids) {
|
|
88
|
+
if (!ids)
|
|
89
|
+
throw new Error('Keys are missing');
|
|
90
|
+
await this.#init;
|
|
91
|
+
const { data, error } = await this.#itemSource.getItems(ids);
|
|
92
|
+
if (data) {
|
|
93
|
+
this.#itemStore?.appendItems(data);
|
|
94
|
+
}
|
|
95
|
+
return { data, error, asObservable: () => this.#itemStore.items(ids) };
|
|
96
|
+
}
|
|
97
|
+
async items(ids) {
|
|
91
98
|
await this.#init;
|
|
92
|
-
return this.#
|
|
99
|
+
return this.#itemStore.items(ids);
|
|
93
100
|
}
|
|
94
101
|
// DETAILS:
|
|
95
102
|
async createScaffold(documentTypeKey, preset) {
|
|
@@ -129,10 +136,10 @@ export class UmbDocumentRepository {
|
|
|
129
136
|
// Consider to look up the data before fetching from the server
|
|
130
137
|
this.#store?.append(item);
|
|
131
138
|
// TODO: Update tree store with the new item? or ask tree to request the new item?
|
|
132
|
-
// TODO: Revisit this call, as we should be able to update tree on client.
|
|
133
|
-
await this.requestRootTreeItems();
|
|
134
139
|
const notification = { data: { message: `Document created` } };
|
|
135
140
|
this.#notificationContext?.peek('positive', notification);
|
|
141
|
+
// TODO: Revisit this call, as we should be able to update tree on client.
|
|
142
|
+
await this.requestRootTreeItems();
|
|
136
143
|
return { data: item };
|
|
137
144
|
}
|
|
138
145
|
return { error };
|
|
@@ -151,10 +158,10 @@ export class UmbDocumentRepository {
|
|
|
151
158
|
this.#store?.append(item);
|
|
152
159
|
//this.#treeStore?.updateItem(item.id, { name: item.name });// Port data to tree store.
|
|
153
160
|
// TODO: would be nice to align the stores on methods/methodNames.
|
|
154
|
-
// TODO: Revisit this call, as we should be able to update tree on client.
|
|
155
|
-
await this.requestRootTreeItems();
|
|
156
161
|
const notification = { data: { message: `Document saved` } };
|
|
157
162
|
this.#notificationContext?.peek('positive', notification);
|
|
163
|
+
// TODO: Revisit this call, as we should be able to update tree on client.
|
|
164
|
+
await this.requestRootTreeItems();
|
|
158
165
|
}
|
|
159
166
|
return { error };
|
|
160
167
|
}
|
|
@@ -168,21 +175,36 @@ export class UmbDocumentRepository {
|
|
|
168
175
|
// TODO: we currently don't use the detail store for anything.
|
|
169
176
|
// Consider to look up the data before fetching from the server.
|
|
170
177
|
// Consider notify a workspace if a document is deleted from the store while someone is editing it.
|
|
171
|
-
|
|
172
|
-
this.#store?.remove([id]);
|
|
178
|
+
this.#store?.removeItem(id);
|
|
173
179
|
this.#treeStore?.removeItem(id);
|
|
180
|
+
this.#itemStore?.removeItem(id);
|
|
174
181
|
const notification = { data: { message: `Document deleted` } };
|
|
175
182
|
this.#notificationContext?.peek('positive', notification);
|
|
176
183
|
}
|
|
177
184
|
return { error };
|
|
178
185
|
}
|
|
186
|
+
async trash(id) {
|
|
187
|
+
if (!id)
|
|
188
|
+
throw new Error('Id is missing');
|
|
189
|
+
await this.#init;
|
|
190
|
+
const { error } = await this.#detailDataSource.trash(id);
|
|
191
|
+
if (!error) {
|
|
192
|
+
// TODO: we currently don't use the detail store for anything.
|
|
193
|
+
// Consider to look up the data before fetching from the server.
|
|
194
|
+
// Consider notify a workspace if a document is deleted from the store while someone is editing it.
|
|
195
|
+
// TODO: Temp hack: would should update a property isTrashed (maybe) on the item instead of removing them.
|
|
196
|
+
this.#store?.removeItem(id);
|
|
197
|
+
this.#treeStore?.removeItem(id);
|
|
198
|
+
this.#itemStore?.removeItem(id);
|
|
199
|
+
// TODO: append to recycle bin store
|
|
200
|
+
const notification = { data: { message: `Document moved to recycle bin` } };
|
|
201
|
+
this.#notificationContext?.peek('positive', notification);
|
|
202
|
+
}
|
|
203
|
+
return { error };
|
|
204
|
+
}
|
|
179
205
|
// Listing all currently known methods we need to implement:
|
|
180
206
|
// these currently only covers posting data
|
|
181
207
|
// TODO: find a good way to split these
|
|
182
|
-
async trash(ids) {
|
|
183
|
-
console.log('document trash: ' + ids);
|
|
184
|
-
alert('implement trash');
|
|
185
|
-
}
|
|
186
208
|
async saveAndPublish() {
|
|
187
209
|
alert('save and publish');
|
|
188
210
|
}
|
|
@@ -15,23 +15,11 @@ export declare class UmbDocumentStore extends UmbStoreBase {
|
|
|
15
15
|
* @memberof UmbDocumentDetailStore
|
|
16
16
|
*/
|
|
17
17
|
constructor(host: UmbControllerHostElement);
|
|
18
|
-
/**
|
|
19
|
-
* Append a document to the store
|
|
20
|
-
* @param {DocumentDetails} document
|
|
21
|
-
* @memberof UmbDocumentDetailStore
|
|
22
|
-
*/
|
|
23
|
-
append(document: DocumentResponseModel): void;
|
|
24
18
|
/**
|
|
25
19
|
* Retrieve a document from the store
|
|
26
20
|
* @param {string} id
|
|
27
21
|
* @memberof UmbDocumentStore
|
|
28
22
|
*/
|
|
29
23
|
byId(id: DocumentResponseModel['id']): import("rxjs").Observable<any>;
|
|
30
|
-
/**
|
|
31
|
-
* Removes documents in the store with the given uniques
|
|
32
|
-
* @param {string[]} uniques
|
|
33
|
-
* @memberof UmbDocumentDetailStore
|
|
34
|
-
*/
|
|
35
|
-
remove(uniques: Array<DocumentResponseModel['id']>): void;
|
|
36
24
|
}
|
|
37
25
|
export declare const UMB_DOCUMENT_STORE_CONTEXT_TOKEN: UmbContextToken<UmbDocumentStore, UmbDocumentStore>;
|
|
@@ -16,14 +16,6 @@ export class UmbDocumentStore extends UmbStoreBase {
|
|
|
16
16
|
constructor(host) {
|
|
17
17
|
super(host, UMB_DOCUMENT_STORE_CONTEXT_TOKEN.toString(), new UmbArrayState([], (x) => x.id));
|
|
18
18
|
}
|
|
19
|
-
/**
|
|
20
|
-
* Append a document to the store
|
|
21
|
-
* @param {DocumentDetails} document
|
|
22
|
-
* @memberof UmbDocumentDetailStore
|
|
23
|
-
*/
|
|
24
|
-
append(document) {
|
|
25
|
-
this._data.append([document]);
|
|
26
|
-
}
|
|
27
19
|
/**
|
|
28
20
|
* Retrieve a document from the store
|
|
29
21
|
* @param {string} id
|
|
@@ -32,13 +24,5 @@ export class UmbDocumentStore extends UmbStoreBase {
|
|
|
32
24
|
byId(id) {
|
|
33
25
|
return this._data.asObservablePart((x) => x.find((y) => y.id === id));
|
|
34
26
|
}
|
|
35
|
-
/**
|
|
36
|
-
* Removes documents in the store with the given uniques
|
|
37
|
-
* @param {string[]} uniques
|
|
38
|
-
* @memberof UmbDocumentDetailStore
|
|
39
|
-
*/
|
|
40
|
-
remove(uniques) {
|
|
41
|
-
this._data.remove(uniques);
|
|
42
|
-
}
|
|
43
27
|
}
|
|
44
28
|
export const UMB_DOCUMENT_STORE_CONTEXT_TOKEN = new UmbContextToken('UmbDocumentStore');
|
package/dist-cms/packages/documents/documents/repository/sources/document-item.server.data.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { UmbItemDataSource } from '../../../../../shared/repository/index.js';
|
|
2
|
+
import { DocumentItemResponseModel } from '../../../../../external/backend-api/index.js';
|
|
3
|
+
import { UmbControllerHostElement } from '../../../../../libs/controller-api/index.js';
|
|
4
|
+
/**
|
|
5
|
+
* A data source for Document items that fetches data from the server
|
|
6
|
+
* @export
|
|
7
|
+
* @class UmbDocumentItemServerDataSource
|
|
8
|
+
* @implements {DocumentItemDataSource}
|
|
9
|
+
*/
|
|
10
|
+
export declare class UmbDocumentItemServerDataSource implements UmbItemDataSource<DocumentItemResponseModel> {
|
|
11
|
+
#private;
|
|
12
|
+
/**
|
|
13
|
+
* Creates an instance of UmbDocumentItemServerDataSource.
|
|
14
|
+
* @param {UmbControllerHostElement} host
|
|
15
|
+
* @memberof UmbDocumentItemServerDataSource
|
|
16
|
+
*/
|
|
17
|
+
constructor(host: UmbControllerHostElement);
|
|
18
|
+
/**
|
|
19
|
+
* Fetches the items for the given ids from the server
|
|
20
|
+
* @param {Array<string>} ids
|
|
21
|
+
* @memberof UmbDocumentItemServerDataSource
|
|
22
|
+
*/
|
|
23
|
+
getItems(ids: Array<string>): Promise<import("../../../../../shared/repository/index.js").DataSourceResponse<DocumentItemResponseModel[]>>;
|
|
24
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { DocumentResource } from '../../../../../external/backend-api/index.js';
|
|
2
|
+
import { tryExecuteAndNotify } from '../../../../../shared/resources/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* A data source for Document items that fetches data from the server
|
|
5
|
+
* @export
|
|
6
|
+
* @class UmbDocumentItemServerDataSource
|
|
7
|
+
* @implements {DocumentItemDataSource}
|
|
8
|
+
*/
|
|
9
|
+
export class UmbDocumentItemServerDataSource {
|
|
10
|
+
#host;
|
|
11
|
+
/**
|
|
12
|
+
* Creates an instance of UmbDocumentItemServerDataSource.
|
|
13
|
+
* @param {UmbControllerHostElement} host
|
|
14
|
+
* @memberof UmbDocumentItemServerDataSource
|
|
15
|
+
*/
|
|
16
|
+
constructor(host) {
|
|
17
|
+
this.#host = host;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Fetches the items for the given ids from the server
|
|
21
|
+
* @param {Array<string>} ids
|
|
22
|
+
* @memberof UmbDocumentItemServerDataSource
|
|
23
|
+
*/
|
|
24
|
+
async getItems(ids) {
|
|
25
|
+
if (!ids)
|
|
26
|
+
throw new Error('Ids are missing');
|
|
27
|
+
return tryExecuteAndNotify(this.#host, DocumentResource.getDocumentItem({
|
|
28
|
+
id: ids,
|
|
29
|
+
}));
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -18,13 +18,13 @@ export declare class UmbDocumentServerDataSource implements UmbDataSource<Create
|
|
|
18
18
|
/**
|
|
19
19
|
* Fetches a Document with the given id from the server
|
|
20
20
|
* @param {string} id
|
|
21
|
-
* @return {*}
|
|
22
21
|
* @memberof UmbDocumentServerDataSource
|
|
23
22
|
*/
|
|
24
23
|
get(id: string): Promise<import("../../../../../shared/repository/index.js").DataSourceResponse<DocumentResponseModel>>;
|
|
25
24
|
/**
|
|
26
25
|
* Creates a new Document scaffold
|
|
27
|
-
* @param {
|
|
26
|
+
* @param {string} documentTypeId
|
|
27
|
+
* @param {Partial<CreateDocumentRequestModel>} [preset]
|
|
28
28
|
* @return {*}
|
|
29
29
|
* @memberof UmbDocumentServerDataSource
|
|
30
30
|
*/
|
|
@@ -34,45 +34,33 @@ export declare class UmbDocumentServerDataSource implements UmbDataSource<Create
|
|
|
34
34
|
/**
|
|
35
35
|
* Inserts a new Document on the server
|
|
36
36
|
* @param {Document} document
|
|
37
|
-
* @return {*}
|
|
38
37
|
* @memberof UmbDocumentServerDataSource
|
|
39
38
|
*/
|
|
40
|
-
insert(document: CreateDocumentRequestModel
|
|
41
|
-
id: string;
|
|
42
|
-
}): Promise<import("../../../../../shared/repository/index.js").DataSourceResponse<string>>;
|
|
39
|
+
insert(document: CreateDocumentRequestModel): Promise<import("../../../../../shared/repository/index.js").DataSourceResponse<string>>;
|
|
43
40
|
/**
|
|
44
41
|
* Updates a Document on the server
|
|
45
|
-
* @param {
|
|
42
|
+
* @param {string} id
|
|
43
|
+
* @param {UpdateDocumentRequestModel} document
|
|
46
44
|
* @return {*}
|
|
47
45
|
* @memberof UmbDocumentServerDataSource
|
|
48
46
|
*/
|
|
49
47
|
update(id: string, document: UpdateDocumentRequestModel): Promise<import("../../../../../shared/repository/index.js").DataSourceResponse<any>>;
|
|
50
48
|
/**
|
|
51
|
-
*
|
|
52
|
-
* @param {
|
|
53
|
-
* @return {*}
|
|
49
|
+
* Moves a Document to the recycle bin on the server
|
|
50
|
+
* @param {string} id
|
|
54
51
|
* @memberof UmbDocumentServerDataSource
|
|
55
52
|
*/
|
|
56
|
-
trash(id: string): Promise<import("../../../../../shared/repository/index.js").DataSourceResponse<
|
|
53
|
+
trash(id: string): Promise<import("../../../../../shared/repository/index.js").DataSourceResponse<any>>;
|
|
57
54
|
/**
|
|
58
55
|
* Deletes a Document on the server
|
|
59
56
|
* @param {string} id
|
|
60
|
-
* @return {*}
|
|
61
57
|
* @memberof UmbDocumentServerDataSource
|
|
62
58
|
*/
|
|
63
59
|
delete(id: string): Promise<import("../../../../../shared/repository/index.js").DataSourceResponse<any>>;
|
|
64
60
|
/**
|
|
65
61
|
* Get the allowed document types for a given parent id
|
|
66
62
|
* @param {string} id
|
|
67
|
-
* @return {*}
|
|
68
|
-
* @memberof UmbDocumentTypeServerDataSource
|
|
69
|
-
*/
|
|
70
|
-
getAllowedDocumentTypesOf(id: string): Promise<import("../../../../../shared/repository/index.js").DataSourceResponse<import("../../../../../external/backend-api/index.js").PagedDocumentTypeResponseModel>>;
|
|
71
|
-
/**
|
|
72
|
-
* Get the allowed document types for root
|
|
73
|
-
* @param {string} id
|
|
74
|
-
* @return {*}
|
|
75
63
|
* @memberof UmbDocumentTypeServerDataSource
|
|
76
64
|
*/
|
|
77
|
-
|
|
65
|
+
getAllowedDocumentTypesOf(id: string | null): Promise<import("../../../../../shared/repository/index.js").DataSourceResponse<import("../../../../../external/backend-api/index.js").PagedDocumentTypeResponseModel>>;
|
|
78
66
|
}
|
|
@@ -20,20 +20,19 @@ export class UmbDocumentServerDataSource {
|
|
|
20
20
|
/**
|
|
21
21
|
* Fetches a Document with the given id from the server
|
|
22
22
|
* @param {string} id
|
|
23
|
-
* @return {*}
|
|
24
23
|
* @memberof UmbDocumentServerDataSource
|
|
25
24
|
*/
|
|
26
25
|
async get(id) {
|
|
27
|
-
if (!id)
|
|
26
|
+
if (!id)
|
|
28
27
|
throw new Error('Id is missing');
|
|
29
|
-
}
|
|
30
28
|
return tryExecuteAndNotify(this.#host, DocumentResource.getDocumentById({
|
|
31
29
|
id,
|
|
32
30
|
}));
|
|
33
31
|
}
|
|
34
32
|
/**
|
|
35
33
|
* Creates a new Document scaffold
|
|
36
|
-
* @param {
|
|
34
|
+
* @param {string} documentTypeId
|
|
35
|
+
* @param {Partial<CreateDocumentRequestModel>} [preset]
|
|
37
36
|
* @return {*}
|
|
38
37
|
* @memberof UmbDocumentServerDataSource
|
|
39
38
|
*/
|
|
@@ -42,7 +41,6 @@ export class UmbDocumentServerDataSource {
|
|
|
42
41
|
urls: [],
|
|
43
42
|
templateId: null,
|
|
44
43
|
parentId: null,
|
|
45
|
-
id: UmbId.new(),
|
|
46
44
|
contentTypeId: documentTypeId,
|
|
47
45
|
values: [],
|
|
48
46
|
variants: [
|
|
@@ -57,103 +55,76 @@ export class UmbDocumentServerDataSource {
|
|
|
57
55
|
},
|
|
58
56
|
],
|
|
59
57
|
...preset,
|
|
58
|
+
id: UmbId.new(),
|
|
60
59
|
};
|
|
61
60
|
return { data };
|
|
62
61
|
}
|
|
63
62
|
/**
|
|
64
63
|
* Inserts a new Document on the server
|
|
65
64
|
* @param {Document} document
|
|
66
|
-
* @return {*}
|
|
67
65
|
* @memberof UmbDocumentServerDataSource
|
|
68
66
|
*/
|
|
69
67
|
async insert(document) {
|
|
70
68
|
if (!document.id)
|
|
71
69
|
throw new Error('Id is missing');
|
|
72
|
-
|
|
73
|
-
const unFroozenDocument = { ...document };
|
|
74
|
-
unFroozenDocument.id = undefined;
|
|
75
|
-
unFroozenDocument.variants =
|
|
76
|
-
unFroozenDocument.variants?.map((variant) => {
|
|
77
|
-
return { ...variant };
|
|
78
|
-
}) ?? [];
|
|
79
|
-
return tryExecuteAndNotify(this.#host, DocumentResource.postDocument({ requestBody: unFroozenDocument }));
|
|
70
|
+
return tryExecuteAndNotify(this.#host, DocumentResource.postDocument({ requestBody: document }));
|
|
80
71
|
}
|
|
81
72
|
/**
|
|
82
73
|
* Updates a Document on the server
|
|
83
|
-
* @param {
|
|
74
|
+
* @param {string} id
|
|
75
|
+
* @param {UpdateDocumentRequestModel} document
|
|
84
76
|
* @return {*}
|
|
85
77
|
* @memberof UmbDocumentServerDataSource
|
|
86
78
|
*/
|
|
87
79
|
async update(id, document) {
|
|
88
80
|
if (!id)
|
|
89
81
|
throw new Error('Id is missing');
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
82
|
+
/* TODO: look into why typescript doesn't complain about getting another model than UpdateDocumentRequestModel
|
|
83
|
+
Maybe we should simplify the sources, and always send the biggest model.
|
|
84
|
+
Then it is up to the data source to format the data correctly before passing it to wherever */
|
|
85
|
+
const requestBody = {
|
|
86
|
+
templateId: document.templateId,
|
|
87
|
+
values: document.values,
|
|
88
|
+
variants: document.variants?.map((variant) => ({
|
|
89
|
+
culture: variant.culture,
|
|
90
|
+
segment: variant.segment,
|
|
91
|
+
name: variant.name,
|
|
92
|
+
})),
|
|
93
|
+
};
|
|
94
|
+
return tryExecuteAndNotify(this.#host, DocumentResource.putDocumentById({ id, requestBody }));
|
|
98
95
|
}
|
|
99
96
|
/**
|
|
100
|
-
*
|
|
101
|
-
* @param {
|
|
102
|
-
* @return {*}
|
|
97
|
+
* Moves a Document to the recycle bin on the server
|
|
98
|
+
* @param {string} id
|
|
103
99
|
* @memberof UmbDocumentServerDataSource
|
|
104
100
|
*/
|
|
105
101
|
async trash(id) {
|
|
106
|
-
if (!id)
|
|
107
|
-
throw new Error('
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
return tryExecuteAndNotify(this.#host, fetch('/umbraco/management/api/v1/document/trash', {
|
|
111
|
-
method: 'POST',
|
|
112
|
-
body: JSON.stringify([id]),
|
|
113
|
-
headers: {
|
|
114
|
-
'Content-Type': 'application/json',
|
|
115
|
-
},
|
|
116
|
-
}));
|
|
102
|
+
if (!id)
|
|
103
|
+
throw new Error('Document ID is missing');
|
|
104
|
+
// TODO: if we get a trash endpoint, we should use that instead.
|
|
105
|
+
return tryExecuteAndNotify(this.#host, DocumentResource.putDocumentByIdMoveToRecycleBin({ id }));
|
|
117
106
|
}
|
|
118
107
|
/**
|
|
119
108
|
* Deletes a Document on the server
|
|
120
109
|
* @param {string} id
|
|
121
|
-
* @return {*}
|
|
122
110
|
* @memberof UmbDocumentServerDataSource
|
|
123
111
|
*/
|
|
124
112
|
async delete(id) {
|
|
125
|
-
if (!id)
|
|
126
|
-
throw new Error('
|
|
127
|
-
|
|
128
|
-
return tryExecuteAndNotify(this.#host, fetch('/umbraco/management/api/v1/document/trash', {
|
|
129
|
-
method: 'POST',
|
|
130
|
-
body: JSON.stringify([id]),
|
|
131
|
-
headers: {
|
|
132
|
-
'Content-Type': 'application/json',
|
|
133
|
-
},
|
|
134
|
-
}).then((res) => res.json()));
|
|
113
|
+
if (!id)
|
|
114
|
+
throw new Error('Document ID is missing');
|
|
115
|
+
return this.trash(id);
|
|
135
116
|
}
|
|
136
117
|
/**
|
|
137
118
|
* Get the allowed document types for a given parent id
|
|
138
119
|
* @param {string} id
|
|
139
|
-
* @return {*}
|
|
140
120
|
* @memberof UmbDocumentTypeServerDataSource
|
|
141
121
|
*/
|
|
142
122
|
async getAllowedDocumentTypesOf(id) {
|
|
143
|
-
if (
|
|
123
|
+
if (id === undefined)
|
|
144
124
|
throw new Error('Id is missing');
|
|
125
|
+
// TODO: remove when null is allowed as id.
|
|
126
|
+
const hackId = id === null ? undefined : id;
|
|
145
127
|
// TODO: Notice, here we need to implement pagination.
|
|
146
|
-
return tryExecuteAndNotify(this.#host, DocumentResource.
|
|
147
|
-
}
|
|
148
|
-
/**
|
|
149
|
-
* Get the allowed document types for root
|
|
150
|
-
* @param {string} id
|
|
151
|
-
* @return {*}
|
|
152
|
-
* @memberof UmbDocumentTypeServerDataSource
|
|
153
|
-
*/
|
|
154
|
-
async getAllowedDocumentTypesAtRoot() {
|
|
155
|
-
console.log('source requestAllowedDocumentTypesAtRoot');
|
|
156
|
-
// TODO: Notice, here we need to implement pagination.
|
|
157
|
-
return tryExecuteAndNotify(this.#host, DocumentResource.getDocumentRootAllowedDocumentTypes({}));
|
|
128
|
+
return tryExecuteAndNotify(this.#host, DocumentResource.getDocumentAllowedDocumentTypes({ parentId: hackId }));
|
|
158
129
|
}
|
|
159
130
|
}
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import { UmbDocumentSaveAndPublishWorkspaceAction } from './actions/save-and-publish.action.js';
|
|
2
|
-
import { UmbDocumentSaveAndPreviewWorkspaceAction } from './actions/save-and-preview.action.js';
|
|
3
|
-
import { UmbSaveAndScheduleDocumentWorkspaceAction } from './actions/save-and-schedule.action.js';
|
|
4
1
|
import { UmbSaveWorkspaceAction } from '../../../core/workspace/index.js';
|
|
5
2
|
const workspace = {
|
|
6
3
|
type: 'workspace',
|
|
@@ -68,6 +65,7 @@ const workspaceViewCollections = [
|
|
|
68
65
|
*/
|
|
69
66
|
];
|
|
70
67
|
const workspaceActions = [
|
|
68
|
+
/*
|
|
71
69
|
{
|
|
72
70
|
type: 'workspaceAction',
|
|
73
71
|
alias: 'Umb.WorkspaceAction.Document.SaveAndPublish',
|
|
@@ -86,6 +84,7 @@ const workspaceActions = [
|
|
|
86
84
|
},
|
|
87
85
|
],
|
|
88
86
|
},
|
|
87
|
+
*/
|
|
89
88
|
{
|
|
90
89
|
type: 'workspaceAction',
|
|
91
90
|
alias: 'Umb.WorkspaceAction.Document.Save',
|
|
@@ -93,7 +92,8 @@ const workspaceActions = [
|
|
|
93
92
|
weight: 80,
|
|
94
93
|
meta: {
|
|
95
94
|
label: 'Save',
|
|
96
|
-
look: '
|
|
95
|
+
look: 'primary',
|
|
96
|
+
color: 'positive',
|
|
97
97
|
api: UmbSaveWorkspaceAction,
|
|
98
98
|
},
|
|
99
99
|
conditions: [
|
|
@@ -103,6 +103,7 @@ const workspaceActions = [
|
|
|
103
103
|
},
|
|
104
104
|
],
|
|
105
105
|
},
|
|
106
|
+
/*
|
|
106
107
|
{
|
|
107
108
|
type: 'workspaceAction',
|
|
108
109
|
alias: 'Umb.WorkspaceAction.Document.SaveAndPreview',
|
|
@@ -135,5 +136,6 @@ const workspaceActions = [
|
|
|
135
136
|
},
|
|
136
137
|
],
|
|
137
138
|
},
|
|
139
|
+
*/
|
|
138
140
|
];
|
|
139
141
|
export const manifests = [workspace, ...workspaceEditorViews, ...workspaceViewCollections, ...workspaceActions];
|
|
@@ -1 +1,13 @@
|
|
|
1
|
-
export declare const manifests: import("
|
|
1
|
+
export declare const manifests: (import("../../libs/extension-api/types.js").ManifestBase | {
|
|
2
|
+
type: string;
|
|
3
|
+
alias: string;
|
|
4
|
+
name: string;
|
|
5
|
+
weight: number;
|
|
6
|
+
meta: {
|
|
7
|
+
icon: string;
|
|
8
|
+
label: string;
|
|
9
|
+
repositoryAlias: string;
|
|
10
|
+
api: typeof import("../core/index.js").UmbTrashEntityAction;
|
|
11
|
+
entityTypes: string[];
|
|
12
|
+
};
|
|
13
|
+
})[];
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { UmbLitElement } from '../../../../shared/lit-element/index.js';
|
|
2
2
|
export declare class UmbDashboardPerformanceProfilingElement extends UmbLitElement {
|
|
3
|
-
private
|
|
3
|
+
#private;
|
|
4
|
+
private _profilingStatus;
|
|
4
5
|
private _isDebugMode;
|
|
6
|
+
private _toggle;
|
|
5
7
|
firstUpdated(): void;
|
|
6
8
|
private _getProfilingStatus;
|
|
7
9
|
private _changeProfilingStatus;
|