From 9e81b470bfcb0374cc796629d431f108aa274764 Mon Sep 17 00:00:00 2001 From: Corepex Date: Fri, 13 Dec 2024 09:13:27 +0000 Subject: [PATCH] Apply latest automatic api client updates --- .../data-object/data-object-api-slice.gen.ts | 70 +++++++++---------- .../tabs/workflow/workflow-api-slice.gen.ts | 12 ++-- .../modules/element/element-api-slice.gen.ts | 26 +++++++ 3 files changed, 67 insertions(+), 41 deletions(-) diff --git a/assets/js/src/core/modules/data-object/data-object-api-slice.gen.ts b/assets/js/src/core/modules/data-object/data-object-api-slice.gen.ts index f135fb194..e71b6085e 100644 --- a/assets/js/src/core/modules/data-object/data-object-api-slice.gen.ts +++ b/assets/js/src/core/modules/data-object/data-object-api-slice.gen.ts @@ -73,6 +73,17 @@ const injectedRtkApi = api }), invalidatesTags: ["Data Objects"], }), + dataObjectGetSelectOptions: build.mutation< + DataObjectGetSelectOptionsApiResponse, + DataObjectGetSelectOptionsApiArg + >({ + query: (queryArg) => ({ + url: `/pimcore-studio/api/data-objects/select-options`, + method: "POST", + body: queryArg.body, + }), + invalidatesTags: ["Data Objects"], + }), dataObjectGetTree: build.query({ query: (queryArg) => ({ url: `/pimcore-studio/api/data-objects/tree`, @@ -198,6 +209,18 @@ export type DataObjectReplaceContentApiArg = { /** TargetId of the data-object */ targetId: number; }; +export type DataObjectGetSelectOptionsApiResponse = /** status 200 List of dynamic select options */ { + totalItems: number; + items: SelectOption[]; +}; +export type DataObjectGetSelectOptionsApiArg = { + body: { + objectId: number; + fieldName: string; + changedData?: object; + context: object; + }; +}; export type DataObjectGetTreeApiResponse = /** status 200 Paginated data objects with total count as header param as JSON */ { totalItems: number; @@ -221,41 +244,7 @@ export type DataObjectGetTreeApiArg = { /** Include all descendants in the result. */ pathIncludeDescendants?: boolean; /** Filter by class. */ - className?: - | "AccessoryPart" - | "asdf" - | "BodyStyle" - | "Car" - | "Category" - | "ComplexLayout" - | "Customer" - | "CustomerSegment" - | "CustomerSegmentGroup" - | "datatypetest" - | "datetest" - | "Event" - | "fieldtest" - | "FilterDefinition" - | "foo5" - | "LinkActivityDefinition" - | "Manufacturer" - | "mappingTest" - | "News" - | "OfferToolCustomProduct" - | "OfferToolOffer" - | "OfferToolOfferItem" - | "OnlineShopOrder" - | "OnlineShopOrderItem" - | "OnlineShopTaxClass" - | "OnlineShopVoucherSeries" - | "OnlineShopVoucherToken" - | "PortalUser" - | "PortalUserGroup" - | "simple" - | "StudioFieldTypeTest" - | "TermSegmentBuilderDefinition" - | "Test" - | "unittest"; + className?: string; }; export type Error = { /** Message */ @@ -503,6 +492,16 @@ export type Layout = { /** Border */ border: boolean; }; +export type SelectOption = { + /** AdditionalAttributes */ + additionalAttributes?: { + [key: string]: string | number | boolean | object | any[]; + }; + /** Key */ + key: string; + /** Value */ + value: string; +}; export const { useDataObjectAddMutation, useDataObjectCloneMutation, @@ -513,5 +512,6 @@ export const { useDataObjectGetLayoutByIdQuery, useDataObjectPatchByIdMutation, useDataObjectReplaceContentMutation, + useDataObjectGetSelectOptionsMutation, useDataObjectGetTreeQuery, } = injectedRtkApi; diff --git a/assets/js/src/core/modules/element/editor/shared-tab-manager/tabs/workflow/workflow-api-slice.gen.ts b/assets/js/src/core/modules/element/editor/shared-tab-manager/tabs/workflow/workflow-api-slice.gen.ts index 71b4f2702..f7d764fb1 100644 --- a/assets/js/src/core/modules/element/editor/shared-tab-manager/tabs/workflow/workflow-api-slice.gen.ts +++ b/assets/js/src/core/modules/element/editor/shared-tab-manager/tabs/workflow/workflow-api-slice.gen.ts @@ -106,14 +106,14 @@ export type DevError = { export type SubmitAction = { /** type of the action */ actionType: string; - /** id of the element */ + /** Id of the element */ elementId: number; - /** type of the element */ + /** Type of the element */ elementType: string; - /** name of the workflow */ - workflowName: string; - /** transition */ - transition: string; + /** Id of the workflow */ + workflowId?: string; + /** Id of the transition */ + transitionId?: string; /** workflowOptions */ workflowOptions: object; }; diff --git a/assets/js/src/core/modules/element/element-api-slice.gen.ts b/assets/js/src/core/modules/element/element-api-slice.gen.ts index 976ab5752..6720624b9 100644 --- a/assets/js/src/core/modules/element/element-api-slice.gen.ts +++ b/assets/js/src/core/modules/element/element-api-slice.gen.ts @@ -34,6 +34,12 @@ const injectedRtkApi = api }), providesTags: ["Elements"], }), + elementGetSubtype: build.query({ + query: (queryArg) => ({ + url: `/pimcore-studio/api/elements/${queryArg.elementType}/subtype/${queryArg.id}`, + }), + providesTags: ["Elements"], + }), }), overrideExisting: false, }); @@ -74,6 +80,13 @@ export type ElementGetIdByPathApiArg = { /** Filter elements by matching element path. */ elementPath: string; }; +export type ElementGetSubtypeApiResponse = /** status 200 Subtype of the element */ Subtype; +export type ElementGetSubtypeApiArg = { + /** Id of the element */ + id: number; + /** Filter elements by matching element type. */ + elementType: "asset" | "document" | "data-object"; +}; export type Error = { /** Message */ message: string; @@ -98,9 +111,22 @@ export type FolderData = { /** Folder Name */ folderName: string; }; +export type Subtype = { + /** AdditionalAttributes */ + additionalAttributes?: { + [key: string]: string | number | boolean | object | any[]; + }; + /** Element Id */ + elementId: number; + /** Element Type */ + elementType: string; + /** Element Subtype */ + elementSubtype: string; +}; export const { useElementDeleteMutation, useElementGetDeleteInfoQuery, useElementFolderCreateMutation, useElementGetIdByPathQuery, + useElementGetSubtypeQuery, } = injectedRtkApi;