export type JsonNode = {string?: boolean | undefined, valueNode?: boolean | undefined, missingNode?: boolean | undefined, short?: boolean | undefined, double?: boolean | undefined, bigDecimal?: boolean | undefined, bigInteger?: boolean | undefined, textual?: boolean | undefined, boolean?: boolean | undefined, container?: boolean | undefined, object?: boolean | undefined, binary?: boolean | undefined, number?: boolean | undefined, nodeType?: ('ARRAY' | 'BINARY' | 'BOOLEAN' | 'MISSING' | 'NULL' | 'NUMBER' | 'OBJECT' | 'POJO' | 'STRING') | undefined, long?: boolean | undefined, pojo?: boolean | undefined, int?: boolean | undefined, integralNumber?: boolean | undefined, floatingPointNumber?: boolean | undefined, array?: boolean | undefined, empty?: boolean | undefined, ''?: boolean | undefined, float?: boolean | undefined, embeddedValue?: boolean | undefined}; export type TestActionDTO = {id?: string | undefined, type?: string | undefined, name?: string | undefined, transactionBoundary?: string | undefined, valueType?: string | undefined, value?: JsonNode | undefined, contextValues?: JsonNode | undefined, actionCounter?: number | undefined, ignoreActionCounter?: boolean | undefined, editable?: boolean | undefined, deletable?: boolean | undefined}; export type UpdateApiInflightTestModelsInflightTestModelIdActionActionIdArgs = {inflightTestModelId: string, actionId: string, activityId: string, executionId?: string | undefined, body: TestActionDTO}; export type UpdateApiInflightTestModelsInflightTestModelIdActionActionIdOptions = {baseUrl?: string | undefined, basicAuth?: {username: string, password: string} | undefined, fetch?: typeof fetch | undefined}; /** * Update an action in a test model * * PUT /inflight-test-models/{inflightTestModelId}/action/{actionId} */ export const updateApiInflightTestModelsInflightTestModelIdActionActionId = async (args: UpdateApiInflightTestModelsInflightTestModelIdActionActionIdArgs, options?: UpdateApiInflightTestModelsInflightTestModelIdActionActionIdOptions) => { const {baseUrl = "http://localhost:8090/inspect-api", fetch: fetchFn = fetch, basicAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (args.activityId != null) query.append("activityId", String(args.activityId)) if (args.executionId != null) query.append("executionId", String(args.executionId)) if (basicAuth !== undefined) headers.set('authorization', `Basic ${btoa(`${basicAuth.username}:${basicAuth.password}`)}`) const url = `${baseUrl.replace(/\/+$/, '')}/inflight-test-models/${encodeURIComponent(String(args.inflightTestModelId))}/action/${encodeURIComponent(String(args.actionId))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };