From 395f80afc7467c026e455b401fd7bbd6f883f68c Mon Sep 17 00:00:00 2001 From: "Alex \"mcmonkey\" Goodwin" Date: Sat, 14 Sep 2024 17:54:21 +0900 Subject: [PATCH] initial waterfall page replacement --- pages/waterfall/index.tsx | 74 +- src/api/generated.ts | 2622 +++++++++++++++++++------------------ 2 files changed, 1398 insertions(+), 1298 deletions(-) diff --git a/pages/waterfall/index.tsx b/pages/waterfall/index.tsx index eb46324..75d7a85 100644 --- a/pages/waterfall/index.tsx +++ b/pages/waterfall/index.tsx @@ -1,5 +1,5 @@ import React from 'react' -import { useGetBranch, useGetGitcommit, WorkflowRunStatus } from '../../src/api/generated' +import { useGetBranch, useGetGitcommit, useGetGitcommitsummary, WorkflowRunStatus } from '../../src/api/generated' import { Badge, Button, @@ -23,15 +23,12 @@ function GitCommitsList() { const [branchFilter, setBranchFilter] = React.useState('master') const [commitId, setCommitId] = React.useState('') const [workflowNameFilter, setWorkflowFilter] = React.useState('') - const { data: filteredJobResults, isLoading } = useGetGitcommit({ - operatingSystem: filterOS == 'Select OS' ? undefined : filterOS, - commitId: commitId == '' ? undefined : commitId, - branch: branchFilter == 'Select Branch' ? undefined : branchFilter, + const { data: filteredJobResults, isLoading } = useGetGitcommitsummary({ + branchName: branchFilter == 'Select Branch' ? undefined : branchFilter, page: currentPage, repoName: repoFilter, - pageSize: 1000, + pageSize: 10, }) - const { data: branchesQueryResults, isLoading: loadingBranchs } = useGetBranch({ repo_name: repoFilter }) @@ -43,55 +40,27 @@ function GitCommitsList() { } }, [router.query.repo]); - const groupedResults = React.useMemo(() => { - if (isLoading || !filteredJobResults || !filteredJobResults.jobResults) { - return []; - } - const byCommit = filteredJobResults.jobResults.reduce((acc, item) => { - const { commit_id, operating_system, status, git_repo, commit_message, commit_time, commit_hash } = item; - if (commit_id) { - if (!acc[commit_id]) { - // Initialize the entry for each commit_id with gitRepo and an empty osStatus map - acc[commit_id] = { gitRepo: git_repo, commitMessage: commit_message, commitTime: commit_time, commitHash: commit_hash, osStatus: {} }; - } - if (!acc[commit_id].osStatus[operating_system]) { - // Ensure the operating system entry is initialized as an empty array - acc[commit_id].osStatus[operating_system] = []; - } - // Append the status to the array of statuses for the current operating system - acc[commit_id].osStatus[operating_system].push(status); - } - return acc; - }, {}); - // Generate the final grouped results, including error handling for unexpected data types - return Object.keys(byCommit).map(commitId => ({ - commitId, - gitRepo: byCommit[commitId].gitRepo, - commitHash: byCommit[commitId].commitHash, - commitMessage: byCommit[commitId].commitMessage, - commitTime: byCommit[commitId].commitTime, - branch: byCommit[commitId].branch, - osStatus: Object.keys(byCommit[commitId].osStatus).map(os => { - const statuses = byCommit[commitId].osStatus[os]; - // First check if any statuses indicate failure - const isFailed = Array.isArray(statuses) && statuses.some(status => status === WorkflowRunStatus.WorkflowRunStatusFailed); - if (isFailed) { + return filteredJobResults?.commitSummaries?.map(commitSummary => ({ + gitRepo: repoFilter, + commitHash: commitSummary.commit_hash, + commitMessage: commitSummary.commit_name, + commitTime: commitSummary.timestamp, + branch: commitSummary.branch_name, + osStatus: Object.entries(commitSummary.status_summary || {}).map(([os, status]) => { + if (status === "FAILED") { return { os, status: 'red', // Red if any job has failed }; } - // Then check if any statuses indicate started - const isInProgress = Array.isArray(statuses) && statuses.some(status => status === WorkflowRunStatus.WorkflowRunStatusStarted); - if (isInProgress) { + if (status === "STARTED") { return { os, status: 'orange', // Yellow if any job is in progress }; } - // Default to green if none are failed or in progress return { os, status: 'green', // Green if all jobs have succeeded @@ -162,8 +131,8 @@ function GitCommitsList() { - {groupedResults.map( - ({ commitId, osStatus, gitRepo, commitMessage, commitTime, commitHash }, index) => ( + {groupedResults?.map( + ({ osStatus, gitRepo, commitMessage, commitTime, commitHash }, index) => ( - {commitMessage} - {commitTime !== undefined ? new Date(commitTime * 1000).toLocaleString() : commitTime} + {commitTime}
diff --git a/src/api/generated.ts b/src/api/generated.ts index d120215..c6a6963 100644 --- a/src/api/generated.ts +++ b/src/api/generated.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.23.0 🍺 + * Generated by orval v6.31.0 🍺 * Do not edit manually. * Comfy API * OpenAPI spec version: 1.0 @@ -13,6 +13,7 @@ import type { QueryFunction, QueryKey, UseMutationOptions, + UseMutationResult, UseQueryOptions, UseQueryResult } from '@tanstack/react-query' @@ -30,16 +31,16 @@ export type ListAllNodeVersions200 = { }; export type ListAllNodeVersionsParams = { - nodeId?: string; - statuses?: NodeVersionStatus[]; - /** - * The page number to retrieve. - */ - page?: number; - /** - * The number of items to include per page. - */ - pageSize?: number; +nodeId?: string; +statuses?: NodeVersionStatus[]; +/** + * The page number to retrieve. + */ +page?: number; +/** + * The number of items to include per page. + */ +pageSize?: number; }; export type PostUploadArtifact200 = { @@ -96,8 +97,8 @@ export type PostUploadArtifactBody = { }; export type SecurityScanParams = { - minAge?: string; - maxNodes?: number; +minAge?: string; +maxNodes?: number; }; export type CreatePersonalAccessToken201 = { @@ -126,10 +127,10 @@ export type GetPermissionOnPublisherNodes200 = { }; export type ListNodesForPublisherParams = { - /** - * Number of nodes to return per page - */ - include_banned?: boolean; +/** + * Number of nodes to return per page + */ +include_banned?: boolean; }; export type ValidatePublisher200 = { @@ -138,28 +139,28 @@ export type ValidatePublisher200 = { }; export type ValidatePublisherParams = { - /** - * The publisher username to validate. - */ - username: string; +/** + * The publisher username to validate. + */ +username: string; }; export type ListNodeVersionsParams = { - statuses?: NodeVersionStatus[]; +statuses?: NodeVersionStatus[]; }; export type PostNodeReviewParams = { - /** - * number of star given to the node version - */ - star: number; +/** + * number of star given to the node version + */ +star: number; }; export type InstallNodeParams = { - /** - * Specific version of the node to retrieve. If omitted, the latest version is returned. - */ - version?: string; +/** + * Specific version of the node to retrieve. If omitted, the latest version is returned. + */ +version?: string; }; export type SearchNodes200 = { @@ -175,22 +176,22 @@ export type SearchNodes200 = { }; export type SearchNodesParams = { - /** - * Page number of the nodes list - */ - page?: number; - /** - * Number of nodes to return per page - */ - limit?: number; - /** - * Keyword to search the nodes - */ - search?: string; - /** - * Number of nodes to return per page - */ - include_banned?: boolean; +/** + * Page number of the nodes list + */ +page?: number; +/** + * Number of nodes to return per page + */ +limit?: number; +/** + * Keyword to search the nodes + */ +search?: string; +/** + * Number of nodes to return per page + */ +include_banned?: boolean; }; export type ListAllNodes200 = { @@ -206,18 +207,46 @@ export type ListAllNodes200 = { }; export type ListAllNodesParams = { - /** - * Page number of the nodes list - */ - page?: number; - /** - * Number of nodes to return per page - */ - limit?: number; - /** - * Number of nodes to return per page - */ - include_banned?: boolean; +/** + * Page number of the nodes list + */ +page?: number; +/** + * Number of nodes to return per page + */ +limit?: number; +/** + * Number of nodes to return per page + */ +include_banned?: boolean; +}; + +export type GetGitcommitsummary500 = { + message?: string; +}; + +export type GetGitcommitsummary200 = { + commitSummaries?: GitCommitSummary[]; + totalNumberOfPages?: number; +}; + +export type GetGitcommitsummaryParams = { +/** + * The repository name to filter the git commits by. + */ +repoName?: string; +/** + * The branch name to filter the git commits by. + */ +branchName?: string; +/** + * The page number to retrieve. + */ +page?: number; +/** + * The number of items to include per page. + */ +pageSize?: number; }; export type GetGitcommit200 = { @@ -226,34 +255,34 @@ export type GetGitcommit200 = { }; export type GetGitcommitParams = { - /** - * The ID of the commit to fetch data for. - */ - commitId?: string; - /** - * The operating system to filter the CI data by. - */ - operatingSystem?: string; - /** - * The name of the workflow to filter the CI data by. - */ - workflowName?: string; - /** - * The branch of the gitcommit to filter the CI data by. - */ - branch?: string; - /** - * The page number to retrieve. - */ - page?: number; - /** - * The number of items to include per page. - */ - pageSize?: number; - /** - * The repo to filter by. - */ - repoName?: string; +/** + * The ID of the commit to fetch data for. + */ +commitId?: string; +/** + * The operating system to filter the CI data by. + */ +operatingSystem?: string; +/** + * The name of the workflow to filter the CI data by. + */ +workflowName?: string; +/** + * The branch of the gitcommit to filter the CI data by. + */ +branch?: string; +/** + * The page number to retrieve. + */ +page?: number; +/** + * The number of items to include per page. + */ +pageSize?: number; +/** + * The repo to filter by. + */ +repoName?: string; }; export type GetBranch200 = { @@ -261,10 +290,16 @@ export type GetBranch200 = { }; export type GetBranchParams = { - /** - * The repo to filter by. - */ - repo_name?: string; +/** + * The repo to filter by. + */ +repo_name?: string; +}; + +export type AdminUpdateNodeVersionBody = { + status?: NodeVersionStatus; + /** The reason for the status change. */ + status_reason?: string; }; export type WorkflowRunStatus = typeof WorkflowRunStatus[keyof typeof WorkflowRunStatus]; @@ -374,12 +409,6 @@ export const NodeVersionStatus = { NodeVersionStatusFlagged: 'NodeVersionStatusFlagged', } as const; -export type AdminUpdateNodeVersionBody = { - status?: NodeVersionStatus; - /** The reason for the status change. */ - status_reason?: string; -}; - export interface NodeVersion { /** Summary of changes made in this version */ changelog?: string; @@ -439,7 +468,7 @@ export interface Node { /** * Time series of VRAM usage. */ -export type MachineStatsVramTimeSeries = { [key: string]: any }; +export type MachineStatsVramTimeSeries = { [key: string]: unknown }; export interface MachineStats { /** Total CPU on the machine. */ @@ -466,6 +495,26 @@ export interface MachineStats { vram_time_series?: MachineStatsVramTimeSeries; } +/** + * A map of operating system to status pairs + */ +export type GitCommitSummaryStatusSummary = {[key: string]: string}; + +export interface GitCommitSummary { + /** The author of the commit */ + author?: string; + /** The branch where the commit was made */ + branch_name?: string; + /** The hash of the commit */ + commit_hash?: string; + /** The name of the commit */ + commit_name?: string; + /** A map of operating system to status pairs */ + status_summary?: GitCommitSummaryStatusSummary; + /** The timestamp when the commit was made */ + timestamp?: string; +} + export interface ErrorResponse { error: string; message: string; @@ -487,6 +536,8 @@ export interface ActionJobResult { author?: string; /** The average VRAM used by the job */ avg_vram?: number; + /** Name of the relevant git branch */ + branch_name?: string; /** The comfy run flags. E.g. `--low-vram` */ comfy_run_flags?: string; /** The hash of the commit */ @@ -499,8 +550,6 @@ export interface ActionJobResult { commit_time?: number; /** CUDA version used */ cuda_version?: string; - /** Name of the relevant git branch */ - branch_name?: string; /** The end time of the job as a Unix timestamp. */ end_time?: number; /** The repository name */ @@ -531,13 +580,7 @@ export interface ActionJobResult { -// eslint-disable-next-line -type SecondParameter any> = T extends ( - config: any, - args: infer P, -) => any - ? P - : never; +type SecondParameter any> = Parameters[1]; /** @@ -545,99 +588,101 @@ type SecondParameter any> = T extends ( * @summary Admin Update Node Version Status */ export const adminUpdateNodeVersion = ( - nodeId: string, - versionNumber: string, - adminUpdateNodeVersionBody: AdminUpdateNodeVersionBody, - options?: SecondParameter,) => { - - - return customInstance( - { - url: `/admin/nodes/${nodeId}/versions/${versionNumber}`, method: 'PUT', - headers: { 'Content-Type': 'application/json', }, + nodeId: string, + versionNumber: string, + adminUpdateNodeVersionBody: AdminUpdateNodeVersionBody, + options?: SecondParameter,) => { + + + return customInstance( + {url: `/admin/nodes/${nodeId}/versions/${versionNumber}`, method: 'PUT', + headers: {'Content-Type': 'application/json', }, data: adminUpdateNodeVersionBody }, - options); -} - + options); + } + export const getAdminUpdateNodeVersionMutationOptions = (options?: { mutation?: UseMutationOptions>, TError, { nodeId: string; versionNumber: string; data: AdminUpdateNodeVersionBody }, TContext>, request?: SecondParameter } - ): UseMutationOptions>, TError, { nodeId: string; versionNumber: string; data: AdminUpdateNodeVersionBody }, TContext> => { - const { mutation: mutationOptions, request: requestOptions } = options ?? {}; - + TContext = unknown>(options?: { mutation?:UseMutationOptions>, TError,{nodeId: string;versionNumber: string;data: AdminUpdateNodeVersionBody}, TContext>, request?: SecondParameter} +): UseMutationOptions>, TError,{nodeId: string;versionNumber: string;data: AdminUpdateNodeVersionBody}, TContext> => { +const {mutation: mutationOptions, request: requestOptions} = options ?? {}; + - const mutationFn: MutationFunction>, { nodeId: string; versionNumber: string; data: AdminUpdateNodeVersionBody }> = (props) => { - const { nodeId, versionNumber, data } = props ?? {}; + const mutationFn: MutationFunction>, {nodeId: string;versionNumber: string;data: AdminUpdateNodeVersionBody}> = (props) => { + const {nodeId,versionNumber,data} = props ?? {}; - return adminUpdateNodeVersion(nodeId, versionNumber, data, requestOptions) - } + return adminUpdateNodeVersion(nodeId,versionNumber,data,requestOptions) + } + + return { mutationFn, ...mutationOptions }} - return { mutationFn, ...mutationOptions } -} - -export type AdminUpdateNodeVersionMutationResult = NonNullable>> -export type AdminUpdateNodeVersionMutationBody = AdminUpdateNodeVersionBody -export type AdminUpdateNodeVersionMutationError = ErrorResponse | void + export type AdminUpdateNodeVersionMutationResult = NonNullable>> + export type AdminUpdateNodeVersionMutationBody = AdminUpdateNodeVersionBody + export type AdminUpdateNodeVersionMutationError = ErrorResponse | void -/** -* @summary Admin Update Node Version Status -*/ + /** + * @summary Admin Update Node Version Status + */ export const useAdminUpdateNodeVersion = (options?: { mutation?: UseMutationOptions>, TError, { nodeId: string; versionNumber: string; data: AdminUpdateNodeVersionBody }, TContext>, request?: SecondParameter } - ) => { - - const mutationOptions = getAdminUpdateNodeVersionMutationOptions(options); + TContext = unknown>(options?: { mutation?:UseMutationOptions>, TError,{nodeId: string;versionNumber: string;data: AdminUpdateNodeVersionBody}, TContext>, request?: SecondParameter} +): UseMutationResult< + Awaited>, + TError, + {nodeId: string;versionNumber: string;data: AdminUpdateNodeVersionBody}, + TContext + > => { - return useMutation(mutationOptions); -} + const mutationOptions = getAdminUpdateNodeVersionMutationOptions(options); + return useMutation(mutationOptions); + } + /** * Returns all branches for a given repo. * @summary Retrieve all distinct branches for a given repo */ export const getBranch = ( - params: GetBranchParams, - options?: SecondParameter, signal?: AbortSignal + params: GetBranchParams, + options?: SecondParameter,signal?: AbortSignal ) => { - - - return customInstance( - { - url: `/branch`, method: 'GET', - params, signal + + + return customInstance( + {url: `/branch`, method: 'GET', + params, signal }, - options); -} - + options); + } + export const getGetBranchQueryKey = (params: GetBranchParams,) => { - return [`/branch`, ...(params ? [params] : [])] as const; -} + return [`/branch`, ...(params ? [params]: [])] as const; + } - -export const getGetBranchQueryOptions = >, TError = void>(params: GetBranchParams, options?: { query?: Partial>, TError, TData>>, request?: SecondParameter } + +export const getGetBranchQueryOptions = >, TError = void>(params: GetBranchParams, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} ) => { - const { query: queryOptions, request: requestOptions } = options ?? {}; - - const queryKey = queryOptions?.queryKey ?? getGetBranchQueryKey(params); +const {query: queryOptions, request: requestOptions} = options ?? {}; + const queryKey = queryOptions?.queryKey ?? getGetBranchQueryKey(params); + - const queryFn: QueryFunction>> = ({ signal }) => getBranch(params, requestOptions, signal); + const queryFn: QueryFunction>> = ({ signal }) => getBranch(params, requestOptions, signal); + + - - - return { queryKey, queryFn, ...queryOptions } as UseQueryOptions>, TError, TData> & { queryKey: QueryKey } + return { queryKey, queryFn, ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: QueryKey } } export type GetBranchQueryResult = NonNullable>> @@ -647,15 +692,15 @@ export type GetBranchQueryError = void * @summary Retrieve all distinct branches for a given repo */ export const useGetBranch = >, TError = void>( - params: GetBranchParams, options?: { query?: Partial>, TError, TData>>, request?: SecondParameter } + params: GetBranchParams, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} -): UseQueryResult & { queryKey: QueryKey } => { + ): UseQueryResult & { queryKey: QueryKey } => { - const queryOptions = getGetBranchQueryOptions(params, options) + const queryOptions = getGetBranchQueryOptions(params,options) - const query = useQuery(queryOptions) as UseQueryResult & { queryKey: QueryKey }; + const query = useQuery(queryOptions) as UseQueryResult & { queryKey: QueryKey }; - query.queryKey = queryOptions.queryKey; + query.queryKey = queryOptions.queryKey ; return query; } @@ -668,41 +713,40 @@ export const useGetBranch = >, TErr * @summary Retrieve CI data for a given commit */ export const getGitcommit = ( - params?: GetGitcommitParams, - options?: SecondParameter, signal?: AbortSignal + params?: GetGitcommitParams, + options?: SecondParameter,signal?: AbortSignal ) => { - - - return customInstance( - { - url: `/gitcommit`, method: 'GET', - params, signal + + + return customInstance( + {url: `/gitcommit`, method: 'GET', + params, signal }, - options); -} - + options); + } + export const getGetGitcommitQueryKey = (params?: GetGitcommitParams,) => { - return [`/gitcommit`, ...(params ? [params] : [])] as const; -} - + return [`/gitcommit`, ...(params ? [params]: [])] as const; + } -export const getGetGitcommitQueryOptions = >, TError = void>(params?: GetGitcommitParams, options?: { query?: Partial>, TError, TData>>, request?: SecondParameter } + +export const getGetGitcommitQueryOptions = >, TError = void>(params?: GetGitcommitParams, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} ) => { - const { query: queryOptions, request: requestOptions } = options ?? {}; +const {query: queryOptions, request: requestOptions} = options ?? {}; - const queryKey = queryOptions?.queryKey ?? getGetGitcommitQueryKey(params); + const queryKey = queryOptions?.queryKey ?? getGetGitcommitQueryKey(params); + + const queryFn: QueryFunction>> = ({ signal }) => getGitcommit(params, requestOptions, signal); - const queryFn: QueryFunction>> = ({ signal }) => getGitcommit(params, requestOptions, signal); + + - - - - return { queryKey, queryFn, ...queryOptions } as UseQueryOptions>, TError, TData> & { queryKey: QueryKey } + return { queryKey, queryFn, ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: QueryKey } } export type GetGitcommitQueryResult = NonNullable>> @@ -712,15 +756,15 @@ export type GetGitcommitQueryError = void * @summary Retrieve CI data for a given commit */ export const useGetGitcommit = >, TError = void>( - params?: GetGitcommitParams, options?: { query?: Partial>, TError, TData>>, request?: SecondParameter } + params?: GetGitcommitParams, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} -): UseQueryResult & { queryKey: QueryKey } => { + ): UseQueryResult & { queryKey: QueryKey } => { - const queryOptions = getGetGitcommitQueryOptions(params, options) + const queryOptions = getGetGitcommitQueryOptions(params,options) - const query = useQuery(queryOptions) as UseQueryResult & { queryKey: QueryKey }; + const query = useQuery(queryOptions) as UseQueryResult & { queryKey: QueryKey }; - query.queryKey = queryOptions.queryKey; + query.queryKey = queryOptions.queryKey ; return query; } @@ -729,45 +773,108 @@ export const useGetGitcommit = > /** - * Returns a paginated list of nodes across all publishers. - * @summary Retrieves a list of nodes + * Returns a summary of git commits, including status, start time, and end time. + * @summary Retrieve a summary of git commits */ -export const listAllNodes = ( - params?: ListAllNodesParams, - options?: SecondParameter, signal?: AbortSignal +export const getGitcommitsummary = ( + params?: GetGitcommitsummaryParams, + options?: SecondParameter,signal?: AbortSignal ) => { + + + return customInstance( + {url: `/gitcommitsummary`, method: 'GET', + params, signal + }, + options); + } + +export const getGetGitcommitsummaryQueryKey = (params?: GetGitcommitsummaryParams,) => { + return [`/gitcommitsummary`, ...(params ? [params]: [])] as const; + } - return customInstance( - { - url: `/nodes`, method: 'GET', - params, signal - }, - options); + +export const getGetGitcommitsummaryQueryOptions = >, TError = GetGitcommitsummary500>(params?: GetGitcommitsummaryParams, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} +) => { + +const {query: queryOptions, request: requestOptions} = options ?? {}; + + const queryKey = queryOptions?.queryKey ?? getGetGitcommitsummaryQueryKey(params); + + + + const queryFn: QueryFunction>> = ({ signal }) => getGitcommitsummary(params, requestOptions, signal); + + + + + + return { queryKey, queryFn, ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: QueryKey } } +export type GetGitcommitsummaryQueryResult = NonNullable>> +export type GetGitcommitsummaryQueryError = GetGitcommitsummary500 -export const getListAllNodesQueryKey = (params?: ListAllNodesParams,) => { - return [`/nodes`, ...(params ? [params] : [])] as const; +/** + * @summary Retrieve a summary of git commits + */ +export const useGetGitcommitsummary = >, TError = GetGitcommitsummary500>( + params?: GetGitcommitsummaryParams, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} + + ): UseQueryResult & { queryKey: QueryKey } => { + + const queryOptions = getGetGitcommitsummaryQueryOptions(params,options) + + const query = useQuery(queryOptions) as UseQueryResult & { queryKey: QueryKey }; + + query.queryKey = queryOptions.queryKey ; + + return query; } -export const getListAllNodesQueryOptions = >, TError = void | ErrorResponse>(params?: ListAllNodesParams, options?: { query?: Partial>, TError, TData>>, request?: SecondParameter } -) => { - const { query: queryOptions, request: requestOptions } = options ?? {}; - const queryKey = queryOptions?.queryKey ?? getListAllNodesQueryKey(params); +/** + * Returns a paginated list of nodes across all publishers. + * @summary Retrieves a list of nodes + */ +export const listAllNodes = ( + params?: ListAllNodesParams, + options?: SecondParameter,signal?: AbortSignal +) => { + + + return customInstance( + {url: `/nodes`, method: 'GET', + params, signal + }, + options); + } + + +export const getListAllNodesQueryKey = (params?: ListAllNodesParams,) => { + return [`/nodes`, ...(params ? [params]: [])] as const; + } + +export const getListAllNodesQueryOptions = >, TError = void | ErrorResponse>(params?: ListAllNodesParams, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} +) => { +const {query: queryOptions, request: requestOptions} = options ?? {}; - const queryFn: QueryFunction>> = ({ signal }) => listAllNodes(params, requestOptions, signal); + const queryKey = queryOptions?.queryKey ?? getListAllNodesQueryKey(params); + + const queryFn: QueryFunction>> = ({ signal }) => listAllNodes(params, requestOptions, signal); + + - return { queryKey, queryFn, ...queryOptions } as UseQueryOptions>, TError, TData> & { queryKey: QueryKey } + return { queryKey, queryFn, ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: QueryKey } } export type ListAllNodesQueryResult = NonNullable>> @@ -777,15 +884,15 @@ export type ListAllNodesQueryError = void | ErrorResponse * @summary Retrieves a list of nodes */ export const useListAllNodes = >, TError = void | ErrorResponse>( - params?: ListAllNodesParams, options?: { query?: Partial>, TError, TData>>, request?: SecondParameter } + params?: ListAllNodesParams, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} -): UseQueryResult & { queryKey: QueryKey } => { + ): UseQueryResult & { queryKey: QueryKey } => { - const queryOptions = getListAllNodesQueryOptions(params, options) + const queryOptions = getListAllNodesQueryOptions(params,options) - const query = useQuery(queryOptions) as UseQueryResult & { queryKey: QueryKey }; + const query = useQuery(queryOptions) as UseQueryResult & { queryKey: QueryKey }; - query.queryKey = queryOptions.queryKey; + query.queryKey = queryOptions.queryKey ; return query; } @@ -797,95 +904,97 @@ export const useListAllNodes = > * @summary Reindex all nodes for searching. */ export const reindexNodes = ( - - options?: SecondParameter,) => { - - - return customInstance( - { - url: `/nodes/reindex`, method: 'POST' + + options?: SecondParameter,) => { + + + return customInstance( + {url: `/nodes/reindex`, method: 'POST' }, - options); -} - + options); + } + export const getReindexNodesMutationOptions = (options?: { mutation?: UseMutationOptions>, TError, void, TContext>, request?: SecondParameter } - ): UseMutationOptions>, TError, void, TContext> => { - const { mutation: mutationOptions, request: requestOptions } = options ?? {}; - - - + TContext = unknown>(options?: { mutation?:UseMutationOptions>, TError,void, TContext>, request?: SecondParameter} +): UseMutationOptions>, TError,void, TContext> => { +const {mutation: mutationOptions, request: requestOptions} = options ?? {}; - const mutationFn: MutationFunction>, void> = () => { + - return reindexNodes(requestOptions) - } + const mutationFn: MutationFunction>, void> = () => { + + return reindexNodes(requestOptions) + } + - return { mutationFn, ...mutationOptions } -} - -export type ReindexNodesMutationResult = NonNullable>> + return { mutationFn, ...mutationOptions }} -export type ReindexNodesMutationError = ErrorResponse + export type ReindexNodesMutationResult = NonNullable>> + + export type ReindexNodesMutationError = ErrorResponse -/** -* @summary Reindex all nodes for searching. -*/ + /** + * @summary Reindex all nodes for searching. + */ export const useReindexNodes = (options?: { mutation?: UseMutationOptions>, TError, void, TContext>, request?: SecondParameter } - ) => { - - const mutationOptions = getReindexNodesMutationOptions(options); + TContext = unknown>(options?: { mutation?:UseMutationOptions>, TError,void, TContext>, request?: SecondParameter} +): UseMutationResult< + Awaited>, + TError, + void, + TContext + > => { - return useMutation(mutationOptions); -} + const mutationOptions = getReindexNodesMutationOptions(options); + return useMutation(mutationOptions); + } + /** * Returns a paginated list of nodes across all publishers. * @summary Retrieves a list of nodes */ export const searchNodes = ( - params?: SearchNodesParams, - options?: SecondParameter, signal?: AbortSignal + params?: SearchNodesParams, + options?: SecondParameter,signal?: AbortSignal ) => { - - - return customInstance( - { - url: `/nodes/search`, method: 'GET', - params, signal + + + return customInstance( + {url: `/nodes/search`, method: 'GET', + params, signal }, - options); -} - + options); + } + export const getSearchNodesQueryKey = (params?: SearchNodesParams,) => { - return [`/nodes/search`, ...(params ? [params] : [])] as const; -} + return [`/nodes/search`, ...(params ? [params]: [])] as const; + } - -export const getSearchNodesQueryOptions = >, TError = void | ErrorResponse>(params?: SearchNodesParams, options?: { query?: Partial>, TError, TData>>, request?: SecondParameter } + +export const getSearchNodesQueryOptions = >, TError = void | ErrorResponse>(params?: SearchNodesParams, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} ) => { - const { query: queryOptions, request: requestOptions } = options ?? {}; - - const queryKey = queryOptions?.queryKey ?? getSearchNodesQueryKey(params); - - +const {query: queryOptions, request: requestOptions} = options ?? {}; - const queryFn: QueryFunction>> = ({ signal }) => searchNodes(params, requestOptions, signal); + const queryKey = queryOptions?.queryKey ?? getSearchNodesQueryKey(params); + + const queryFn: QueryFunction>> = ({ signal }) => searchNodes(params, requestOptions, signal); + + - return { queryKey, queryFn, ...queryOptions } as UseQueryOptions>, TError, TData> & { queryKey: QueryKey } + return { queryKey, queryFn, ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: QueryKey } } export type SearchNodesQueryResult = NonNullable>> @@ -895,15 +1004,15 @@ export type SearchNodesQueryError = void | ErrorResponse * @summary Retrieves a list of nodes */ export const useSearchNodes = >, TError = void | ErrorResponse>( - params?: SearchNodesParams, options?: { query?: Partial>, TError, TData>>, request?: SecondParameter } + params?: SearchNodesParams, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} -): UseQueryResult & { queryKey: QueryKey } => { + ): UseQueryResult & { queryKey: QueryKey } => { - const queryOptions = getSearchNodesQueryOptions(params, options) + const queryOptions = getSearchNodesQueryOptions(params,options) - const query = useQuery(queryOptions) as UseQueryResult & { queryKey: QueryKey }; + const query = useQuery(queryOptions) as UseQueryResult & { queryKey: QueryKey }; - query.queryKey = queryOptions.queryKey; + query.queryKey = queryOptions.queryKey ; return query; } @@ -916,40 +1025,39 @@ export const useSearchNodes = >, * @summary Retrieve a specific node by ID */ export const getNode = ( - nodeId: string, - options?: SecondParameter, signal?: AbortSignal + nodeId: string, + options?: SecondParameter,signal?: AbortSignal ) => { - - - return customInstance( - { - url: `/nodes/${nodeId}`, method: 'GET', signal + + + return customInstance( + {url: `/nodes/${nodeId}`, method: 'GET', signal }, - options); -} - + options); + } + export const getGetNodeQueryKey = (nodeId: string,) => { - return [`/nodes/${nodeId}`] as const; -} - + return [`/nodes/${nodeId}`] as const; + } -export const getGetNodeQueryOptions = >, TError = ErrorResponse>(nodeId: string, options?: { query?: Partial>, TError, TData>>, request?: SecondParameter } + +export const getGetNodeQueryOptions = >, TError = ErrorResponse>(nodeId: string, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} ) => { - const { query: queryOptions, request: requestOptions } = options ?? {}; - - const queryKey = queryOptions?.queryKey ?? getGetNodeQueryKey(nodeId); - +const {query: queryOptions, request: requestOptions} = options ?? {}; + const queryKey = queryOptions?.queryKey ?? getGetNodeQueryKey(nodeId); - const queryFn: QueryFunction>> = ({ signal }) => getNode(nodeId, requestOptions, signal); + + const queryFn: QueryFunction>> = ({ signal }) => getNode(nodeId, requestOptions, signal); + + - - return { queryKey, queryFn, enabled: !!(nodeId), ...queryOptions } as UseQueryOptions>, TError, TData> & { queryKey: QueryKey } + return { queryKey, queryFn, enabled: !!(nodeId), ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: QueryKey } } export type GetNodeQueryResult = NonNullable>> @@ -959,15 +1067,15 @@ export type GetNodeQueryError = ErrorResponse * @summary Retrieve a specific node by ID */ export const useGetNode = >, TError = ErrorResponse>( - nodeId: string, options?: { query?: Partial>, TError, TData>>, request?: SecondParameter } + nodeId: string, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} -): UseQueryResult & { queryKey: QueryKey } => { + ): UseQueryResult & { queryKey: QueryKey } => { - const queryOptions = getGetNodeQueryOptions(nodeId, options) + const queryOptions = getGetNodeQueryOptions(nodeId,options) - const query = useQuery(queryOptions) as UseQueryResult & { queryKey: QueryKey }; + const query = useQuery(queryOptions) as UseQueryResult & { queryKey: QueryKey }; - query.queryKey = queryOptions.queryKey; + query.queryKey = queryOptions.queryKey ; return query; } @@ -980,44 +1088,43 @@ export const useGetNode = >, TError = * @summary Returns a node version to be installed. */ export const installNode = ( - nodeId: string, - params?: InstallNodeParams, - options?: SecondParameter, signal?: AbortSignal + nodeId: string, + params?: InstallNodeParams, + options?: SecondParameter,signal?: AbortSignal ) => { - - - return customInstance( - { - url: `/nodes/${nodeId}/install`, method: 'GET', - params, signal + + + return customInstance( + {url: `/nodes/${nodeId}/install`, method: 'GET', + params, signal }, - options); -} - + options); + } + export const getInstallNodeQueryKey = (nodeId: string, - params?: InstallNodeParams,) => { - return [`/nodes/${nodeId}/install`, ...(params ? [params] : [])] as const; -} - + params?: InstallNodeParams,) => { + return [`/nodes/${nodeId}/install`, ...(params ? [params]: [])] as const; + } + export const getInstallNodeQueryOptions = >, TError = ErrorResponse>(nodeId: string, - params?: InstallNodeParams, options?: { query?: Partial>, TError, TData>>, request?: SecondParameter } + params?: InstallNodeParams, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} ) => { - const { query: queryOptions, request: requestOptions } = options ?? {}; - - const queryKey = queryOptions?.queryKey ?? getInstallNodeQueryKey(nodeId, params); +const {query: queryOptions, request: requestOptions} = options ?? {}; + const queryKey = queryOptions?.queryKey ?? getInstallNodeQueryKey(nodeId,params); + - const queryFn: QueryFunction>> = ({ signal }) => installNode(nodeId, params, requestOptions, signal); + const queryFn: QueryFunction>> = ({ signal }) => installNode(nodeId,params, requestOptions, signal); + + - - - return { queryKey, queryFn, enabled: !!(nodeId), ...queryOptions } as UseQueryOptions>, TError, TData> & { queryKey: QueryKey } + return { queryKey, queryFn, enabled: !!(nodeId), ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: QueryKey } } export type InstallNodeQueryResult = NonNullable>> @@ -1027,16 +1134,16 @@ export type InstallNodeQueryError = ErrorResponse * @summary Returns a node version to be installed. */ export const useInstallNode = >, TError = ErrorResponse>( - nodeId: string, - params?: InstallNodeParams, options?: { query?: Partial>, TError, TData>>, request?: SecondParameter } + nodeId: string, + params?: InstallNodeParams, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} -): UseQueryResult & { queryKey: QueryKey } => { + ): UseQueryResult & { queryKey: QueryKey } => { - const queryOptions = getInstallNodeQueryOptions(nodeId, params, options) + const queryOptions = getInstallNodeQueryOptions(nodeId,params,options) - const query = useQuery(queryOptions) as UseQueryResult & { queryKey: QueryKey }; + const query = useQuery(queryOptions) as UseQueryResult & { queryKey: QueryKey }; - query.queryKey = queryOptions.queryKey; + query.queryKey = queryOptions.queryKey ; return query; } @@ -1048,99 +1155,101 @@ export const useInstallNode = >, * @summary Add review to a specific version of a node */ export const postNodeReview = ( - nodeId: string, - params: PostNodeReviewParams, - options?: SecondParameter,) => { - - - return customInstance( - { - url: `/nodes/${nodeId}/reviews`, method: 'POST', - params + nodeId: string, + params: PostNodeReviewParams, + options?: SecondParameter,) => { + + + return customInstance( + {url: `/nodes/${nodeId}/reviews`, method: 'POST', + params }, - options); -} - + options); + } + export const getPostNodeReviewMutationOptions = (options?: { mutation?: UseMutationOptions>, TError, { nodeId: string; params: PostNodeReviewParams }, TContext>, request?: SecondParameter } - ): UseMutationOptions>, TError, { nodeId: string; params: PostNodeReviewParams }, TContext> => { - const { mutation: mutationOptions, request: requestOptions } = options ?? {}; - - + TContext = unknown>(options?: { mutation?:UseMutationOptions>, TError,{nodeId: string;params: PostNodeReviewParams}, TContext>, request?: SecondParameter} +): UseMutationOptions>, TError,{nodeId: string;params: PostNodeReviewParams}, TContext> => { +const {mutation: mutationOptions, request: requestOptions} = options ?? {}; + - const mutationFn: MutationFunction>, { nodeId: string; params: PostNodeReviewParams }> = (props) => { - const { nodeId, params } = props ?? {}; - return postNodeReview(nodeId, params, requestOptions) - } + const mutationFn: MutationFunction>, {nodeId: string;params: PostNodeReviewParams}> = (props) => { + const {nodeId,params} = props ?? {}; + return postNodeReview(nodeId,params,requestOptions) + } + - return { mutationFn, ...mutationOptions } -} - -export type PostNodeReviewMutationResult = NonNullable>> + return { mutationFn, ...mutationOptions }} -export type PostNodeReviewMutationError = void | Error | ErrorResponse + export type PostNodeReviewMutationResult = NonNullable>> + + export type PostNodeReviewMutationError = void | Error | ErrorResponse -/** -* @summary Add review to a specific version of a node -*/ + /** + * @summary Add review to a specific version of a node + */ export const usePostNodeReview = (options?: { mutation?: UseMutationOptions>, TError, { nodeId: string; params: PostNodeReviewParams }, TContext>, request?: SecondParameter } - ) => { - - const mutationOptions = getPostNodeReviewMutationOptions(options); + TContext = unknown>(options?: { mutation?:UseMutationOptions>, TError,{nodeId: string;params: PostNodeReviewParams}, TContext>, request?: SecondParameter} +): UseMutationResult< + Awaited>, + TError, + {nodeId: string;params: PostNodeReviewParams}, + TContext + > => { - return useMutation(mutationOptions); -} + const mutationOptions = getPostNodeReviewMutationOptions(options); + return useMutation(mutationOptions); + } + /** * @summary List all versions of a node */ export const listNodeVersions = ( - nodeId: string, - params?: ListNodeVersionsParams, - options?: SecondParameter, signal?: AbortSignal + nodeId: string, + params?: ListNodeVersionsParams, + options?: SecondParameter,signal?: AbortSignal ) => { - - - return customInstance( - { - url: `/nodes/${nodeId}/versions`, method: 'GET', - params, signal + + + return customInstance( + {url: `/nodes/${nodeId}/versions`, method: 'GET', + params, signal }, - options); -} - + options); + } + export const getListNodeVersionsQueryKey = (nodeId: string, - params?: ListNodeVersionsParams,) => { - return [`/nodes/${nodeId}/versions`, ...(params ? [params] : [])] as const; -} - + params?: ListNodeVersionsParams,) => { + return [`/nodes/${nodeId}/versions`, ...(params ? [params]: [])] as const; + } + export const getListNodeVersionsQueryOptions = >, TError = ErrorResponse | Error>(nodeId: string, - params?: ListNodeVersionsParams, options?: { query?: Partial>, TError, TData>>, request?: SecondParameter } + params?: ListNodeVersionsParams, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} ) => { - const { query: queryOptions, request: requestOptions } = options ?? {}; - - const queryKey = queryOptions?.queryKey ?? getListNodeVersionsQueryKey(nodeId, params); - - +const {query: queryOptions, request: requestOptions} = options ?? {}; - const queryFn: QueryFunction>> = ({ signal }) => listNodeVersions(nodeId, params, requestOptions, signal); + const queryKey = queryOptions?.queryKey ?? getListNodeVersionsQueryKey(nodeId,params); + + const queryFn: QueryFunction>> = ({ signal }) => listNodeVersions(nodeId,params, requestOptions, signal); + + - return { queryKey, queryFn, enabled: !!(nodeId), ...queryOptions } as UseQueryOptions>, TError, TData> & { queryKey: QueryKey } + return { queryKey, queryFn, enabled: !!(nodeId), ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: QueryKey } } export type ListNodeVersionsQueryResult = NonNullable>> @@ -1150,16 +1259,16 @@ export type ListNodeVersionsQueryError = ErrorResponse | Error * @summary List all versions of a node */ export const useListNodeVersions = >, TError = ErrorResponse | Error>( - nodeId: string, - params?: ListNodeVersionsParams, options?: { query?: Partial>, TError, TData>>, request?: SecondParameter } + nodeId: string, + params?: ListNodeVersionsParams, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} -): UseQueryResult & { queryKey: QueryKey } => { + ): UseQueryResult & { queryKey: QueryKey } => { - const queryOptions = getListNodeVersionsQueryOptions(nodeId, params, options) + const queryOptions = getListNodeVersionsQueryOptions(nodeId,params,options) - const query = useQuery(queryOptions) as UseQueryResult & { queryKey: QueryKey }; + const query = useQuery(queryOptions) as UseQueryResult & { queryKey: QueryKey }; - query.queryKey = queryOptions.queryKey; + query.queryKey = queryOptions.queryKey ; return query; } @@ -1171,43 +1280,42 @@ export const useListNodeVersions = , signal?: AbortSignal + nodeId: string, + versionId: string, + options?: SecondParameter,signal?: AbortSignal ) => { - - - return customInstance( - { - url: `/nodes/${nodeId}/versions/${versionId}`, method: 'GET', signal + + + return customInstance( + {url: `/nodes/${nodeId}/versions/${versionId}`, method: 'GET', signal }, - options); -} - + options); + } + export const getGetNodeVersionQueryKey = (nodeId: string, - versionId: string,) => { - return [`/nodes/${nodeId}/versions/${versionId}`] as const; -} - + versionId: string,) => { + return [`/nodes/${nodeId}/versions/${versionId}`] as const; + } + export const getGetNodeVersionQueryOptions = >, TError = Error | ErrorResponse>(nodeId: string, - versionId: string, options?: { query?: Partial>, TError, TData>>, request?: SecondParameter } + versionId: string, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} ) => { - const { query: queryOptions, request: requestOptions } = options ?? {}; - - const queryKey = queryOptions?.queryKey ?? getGetNodeVersionQueryKey(nodeId, versionId); - +const {query: queryOptions, request: requestOptions} = options ?? {}; + const queryKey = queryOptions?.queryKey ?? getGetNodeVersionQueryKey(nodeId,versionId); - const queryFn: QueryFunction>> = ({ signal }) => getNodeVersion(nodeId, versionId, requestOptions, signal); + + const queryFn: QueryFunction>> = ({ signal }) => getNodeVersion(nodeId,versionId, requestOptions, signal); + + - - return { queryKey, queryFn, enabled: !!(nodeId && versionId), ...queryOptions } as UseQueryOptions>, TError, TData> & { queryKey: QueryKey } + return { queryKey, queryFn, enabled: !!(nodeId && versionId), ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: QueryKey } } export type GetNodeVersionQueryResult = NonNullable>> @@ -1217,16 +1325,16 @@ export type GetNodeVersionQueryError = Error | ErrorResponse * @summary Retrieve a specific version of a node */ export const useGetNodeVersion = >, TError = Error | ErrorResponse>( - nodeId: string, - versionId: string, options?: { query?: Partial>, TError, TData>>, request?: SecondParameter } + nodeId: string, + versionId: string, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} -): UseQueryResult & { queryKey: QueryKey } => { + ): UseQueryResult & { queryKey: QueryKey } => { - const queryOptions = getGetNodeVersionQueryOptions(nodeId, versionId, options) + const queryOptions = getGetNodeVersionQueryOptions(nodeId,versionId,options) - const query = useQuery(queryOptions) as UseQueryResult & { queryKey: QueryKey }; + const query = useQuery(queryOptions) as UseQueryResult & { queryKey: QueryKey }; - query.queryKey = queryOptions.queryKey; + query.queryKey = queryOptions.queryKey ; return query; } @@ -1238,40 +1346,39 @@ export const useGetNodeVersion = , signal?: AbortSignal + + options?: SecondParameter,signal?: AbortSignal ) => { - - - return customInstance( - { - url: `/publishers`, method: 'GET', signal + + + return customInstance( + {url: `/publishers`, method: 'GET', signal }, - options); -} - + options); + } + export const getListPublishersQueryKey = () => { - return [`/publishers`] as const; -} - + return [`/publishers`] as const; + } -export const getListPublishersQueryOptions = >, TError = ErrorResponse>(options?: { query?: Partial>, TError, TData>>, request?: SecondParameter } + +export const getListPublishersQueryOptions = >, TError = ErrorResponse>( options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} ) => { - const { query: queryOptions, request: requestOptions } = options ?? {}; +const {query: queryOptions, request: requestOptions} = options ?? {}; - const queryKey = queryOptions?.queryKey ?? getListPublishersQueryKey(); + const queryKey = queryOptions?.queryKey ?? getListPublishersQueryKey(); + + const queryFn: QueryFunction>> = ({ signal }) => listPublishers(requestOptions, signal); - const queryFn: QueryFunction>> = ({ signal }) => listPublishers(requestOptions, signal); + + - - - - return { queryKey, queryFn, ...queryOptions } as UseQueryOptions>, TError, TData> & { queryKey: QueryKey } + return { queryKey, queryFn, ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: QueryKey } } export type ListPublishersQueryResult = NonNullable>> @@ -1281,15 +1388,15 @@ export type ListPublishersQueryError = ErrorResponse * @summary Retrieve all publishers */ export const useListPublishers = >, TError = ErrorResponse>( - options?: { query?: Partial>, TError, TData>>, request?: SecondParameter } + options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} -): UseQueryResult & { queryKey: QueryKey } => { + ): UseQueryResult & { queryKey: QueryKey } => { const queryOptions = getListPublishersQueryOptions(options) - const query = useQuery(queryOptions) as UseQueryResult & { queryKey: QueryKey }; + const query = useQuery(queryOptions) as UseQueryResult & { queryKey: QueryKey }; - query.queryKey = queryOptions.queryKey; + query.queryKey = queryOptions.queryKey ; return query; } @@ -1301,97 +1408,99 @@ export const useListPublishers = ,) => { - - - return customInstance( - { - url: `/publishers`, method: 'POST', - headers: { 'Content-Type': 'application/json', }, + publisher: Publisher, + options?: SecondParameter,) => { + + + return customInstance( + {url: `/publishers`, method: 'POST', + headers: {'Content-Type': 'application/json', }, data: publisher }, - options); -} - + options); + } + export const getCreatePublisherMutationOptions = (options?: { mutation?: UseMutationOptions>, TError, { data: Publisher }, TContext>, request?: SecondParameter } - ): UseMutationOptions>, TError, { data: Publisher }, TContext> => { - const { mutation: mutationOptions, request: requestOptions } = options ?? {}; - + TContext = unknown>(options?: { mutation?:UseMutationOptions>, TError,{data: Publisher}, TContext>, request?: SecondParameter} +): UseMutationOptions>, TError,{data: Publisher}, TContext> => { +const {mutation: mutationOptions, request: requestOptions} = options ?? {}; + - const mutationFn: MutationFunction>, { data: Publisher }> = (props) => { - const { data } = props ?? {}; + const mutationFn: MutationFunction>, {data: Publisher}> = (props) => { + const {data} = props ?? {}; - return createPublisher(data, requestOptions) - } + return createPublisher(data,requestOptions) + } + + return { mutationFn, ...mutationOptions }} - return { mutationFn, ...mutationOptions } -} - -export type CreatePublisherMutationResult = NonNullable>> -export type CreatePublisherMutationBody = Publisher -export type CreatePublisherMutationError = ErrorResponse | void + export type CreatePublisherMutationResult = NonNullable>> + export type CreatePublisherMutationBody = Publisher + export type CreatePublisherMutationError = ErrorResponse | void -/** -* @summary Create a new publisher -*/ + /** + * @summary Create a new publisher + */ export const useCreatePublisher = (options?: { mutation?: UseMutationOptions>, TError, { data: Publisher }, TContext>, request?: SecondParameter } - ) => { - - const mutationOptions = getCreatePublisherMutationOptions(options); + TContext = unknown>(options?: { mutation?:UseMutationOptions>, TError,{data: Publisher}, TContext>, request?: SecondParameter} +): UseMutationResult< + Awaited>, + TError, + {data: Publisher}, + TContext + > => { - return useMutation(mutationOptions); -} + const mutationOptions = getCreatePublisherMutationOptions(options); + return useMutation(mutationOptions); + } + /** * Checks if the publisher username is already taken. * @summary Validate if a publisher username is available */ export const validatePublisher = ( - params: ValidatePublisherParams, - options?: SecondParameter, signal?: AbortSignal + params: ValidatePublisherParams, + options?: SecondParameter,signal?: AbortSignal ) => { - - - return customInstance( - { - url: `/publishers/validate`, method: 'GET', - params, signal + + + return customInstance( + {url: `/publishers/validate`, method: 'GET', + params, signal }, - options); -} - + options); + } + export const getValidatePublisherQueryKey = (params: ValidatePublisherParams,) => { - return [`/publishers/validate`, ...(params ? [params] : [])] as const; -} + return [`/publishers/validate`, ...(params ? [params]: [])] as const; + } - -export const getValidatePublisherQueryOptions = >, TError = ErrorResponse>(params: ValidatePublisherParams, options?: { query?: Partial>, TError, TData>>, request?: SecondParameter } + +export const getValidatePublisherQueryOptions = >, TError = ErrorResponse>(params: ValidatePublisherParams, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} ) => { - const { query: queryOptions, request: requestOptions } = options ?? {}; - - const queryKey = queryOptions?.queryKey ?? getValidatePublisherQueryKey(params); - +const {query: queryOptions, request: requestOptions} = options ?? {}; + const queryKey = queryOptions?.queryKey ?? getValidatePublisherQueryKey(params); - const queryFn: QueryFunction>> = ({ signal }) => validatePublisher(params, requestOptions, signal); + + const queryFn: QueryFunction>> = ({ signal }) => validatePublisher(params, requestOptions, signal); + + - - return { queryKey, queryFn, ...queryOptions } as UseQueryOptions>, TError, TData> & { queryKey: QueryKey } + return { queryKey, queryFn, ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: QueryKey } } export type ValidatePublisherQueryResult = NonNullable>> @@ -1401,15 +1510,15 @@ export type ValidatePublisherQueryError = ErrorResponse * @summary Validate if a publisher username is available */ export const useValidatePublisher = >, TError = ErrorResponse>( - params: ValidatePublisherParams, options?: { query?: Partial>, TError, TData>>, request?: SecondParameter } + params: ValidatePublisherParams, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} -): UseQueryResult & { queryKey: QueryKey } => { + ): UseQueryResult & { queryKey: QueryKey } => { - const queryOptions = getValidatePublisherQueryOptions(params, options) + const queryOptions = getValidatePublisherQueryOptions(params,options) - const query = useQuery(queryOptions) as UseQueryResult & { queryKey: QueryKey }; + const query = useQuery(queryOptions) as UseQueryResult & { queryKey: QueryKey }; - query.queryKey = queryOptions.queryKey; + query.queryKey = queryOptions.queryKey ; return query; } @@ -1421,93 +1530,95 @@ export const useValidatePublisher = ,) => { - - - return customInstance( - { - url: `/publishers/${publisherId}`, method: 'DELETE' + publisherId: string, + options?: SecondParameter,) => { + + + return customInstance( + {url: `/publishers/${publisherId}`, method: 'DELETE' }, - options); -} - + options); + } + export const getDeletePublisherMutationOptions = (options?: { mutation?: UseMutationOptions>, TError, { publisherId: string }, TContext>, request?: SecondParameter } - ): UseMutationOptions>, TError, { publisherId: string }, TContext> => { - const { mutation: mutationOptions, request: requestOptions } = options ?? {}; + TContext = unknown>(options?: { mutation?:UseMutationOptions>, TError,{publisherId: string}, TContext>, request?: SecondParameter} +): UseMutationOptions>, TError,{publisherId: string}, TContext> => { +const {mutation: mutationOptions, request: requestOptions} = options ?? {}; + + const mutationFn: MutationFunction>, {publisherId: string}> = (props) => { + const {publisherId} = props ?? {}; - const mutationFn: MutationFunction>, { publisherId: string }> = (props) => { - const { publisherId } = props ?? {}; + return deletePublisher(publisherId,requestOptions) + } - return deletePublisher(publisherId, requestOptions) - } + + return { mutationFn, ...mutationOptions }} + export type DeletePublisherMutationResult = NonNullable>> + + export type DeletePublisherMutationError = ErrorResponse - return { mutationFn, ...mutationOptions } -} - -export type DeletePublisherMutationResult = NonNullable>> - -export type DeletePublisherMutationError = ErrorResponse - -/** -* @summary Delete a publisher -*/ + /** + * @summary Delete a publisher + */ export const useDeletePublisher = (options?: { mutation?: UseMutationOptions>, TError, { publisherId: string }, TContext>, request?: SecondParameter } - ) => { + TContext = unknown>(options?: { mutation?:UseMutationOptions>, TError,{publisherId: string}, TContext>, request?: SecondParameter} +): UseMutationResult< + Awaited>, + TError, + {publisherId: string}, + TContext + > => { - const mutationOptions = getDeletePublisherMutationOptions(options); - - return useMutation(mutationOptions); -} + const mutationOptions = getDeletePublisherMutationOptions(options); + return useMutation(mutationOptions); + } + /** * @summary Retrieve a publisher by ID */ export const getPublisher = ( - publisherId: string, - options?: SecondParameter, signal?: AbortSignal + publisherId: string, + options?: SecondParameter,signal?: AbortSignal ) => { - - - return customInstance( - { - url: `/publishers/${publisherId}`, method: 'GET', signal + + + return customInstance( + {url: `/publishers/${publisherId}`, method: 'GET', signal }, - options); -} - + options); + } + export const getGetPublisherQueryKey = (publisherId: string,) => { - return [`/publishers/${publisherId}`] as const; -} - + return [`/publishers/${publisherId}`] as const; + } -export const getGetPublisherQueryOptions = >, TError = ErrorResponse>(publisherId: string, options?: { query?: Partial>, TError, TData>>, request?: SecondParameter } + +export const getGetPublisherQueryOptions = >, TError = ErrorResponse>(publisherId: string, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} ) => { - const { query: queryOptions, request: requestOptions } = options ?? {}; - - const queryKey = queryOptions?.queryKey ?? getGetPublisherQueryKey(publisherId); - +const {query: queryOptions, request: requestOptions} = options ?? {}; + const queryKey = queryOptions?.queryKey ?? getGetPublisherQueryKey(publisherId); - const queryFn: QueryFunction>> = ({ signal }) => getPublisher(publisherId, requestOptions, signal); + + const queryFn: QueryFunction>> = ({ signal }) => getPublisher(publisherId, requestOptions, signal); + + - - return { queryKey, queryFn, enabled: !!(publisherId), ...queryOptions } as UseQueryOptions>, TError, TData> & { queryKey: QueryKey } + return { queryKey, queryFn, enabled: !!(publisherId), ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: QueryKey } } export type GetPublisherQueryResult = NonNullable>> @@ -1517,15 +1628,15 @@ export type GetPublisherQueryError = ErrorResponse * @summary Retrieve a publisher by ID */ export const useGetPublisher = >, TError = ErrorResponse>( - publisherId: string, options?: { query?: Partial>, TError, TData>>, request?: SecondParameter } + publisherId: string, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} -): UseQueryResult & { queryKey: QueryKey } => { + ): UseQueryResult & { queryKey: QueryKey } => { - const queryOptions = getGetPublisherQueryOptions(publisherId, options) + const queryOptions = getGetPublisherQueryOptions(publisherId,options) - const query = useQuery(queryOptions) as UseQueryResult & { queryKey: QueryKey }; + const query = useQuery(queryOptions) as UseQueryResult & { queryKey: QueryKey }; - query.queryKey = queryOptions.queryKey; + query.queryKey = queryOptions.queryKey ; return query; } @@ -1537,153 +1648,158 @@ export const useGetPublisher = > * @summary Update a publisher */ export const updatePublisher = ( - publisherId: string, - publisher: Publisher, - options?: SecondParameter,) => { - - - return customInstance( - { - url: `/publishers/${publisherId}`, method: 'PUT', - headers: { 'Content-Type': 'application/json', }, + publisherId: string, + publisher: Publisher, + options?: SecondParameter,) => { + + + return customInstance( + {url: `/publishers/${publisherId}`, method: 'PUT', + headers: {'Content-Type': 'application/json', }, data: publisher }, - options); -} - + options); + } + export const getUpdatePublisherMutationOptions = (options?: { mutation?: UseMutationOptions>, TError, { publisherId: string; data: Publisher }, TContext>, request?: SecondParameter } - ): UseMutationOptions>, TError, { publisherId: string; data: Publisher }, TContext> => { - const { mutation: mutationOptions, request: requestOptions } = options ?? {}; - + TContext = unknown>(options?: { mutation?:UseMutationOptions>, TError,{publisherId: string;data: Publisher}, TContext>, request?: SecondParameter} +): UseMutationOptions>, TError,{publisherId: string;data: Publisher}, TContext> => { +const {mutation: mutationOptions, request: requestOptions} = options ?? {}; + - const mutationFn: MutationFunction>, { publisherId: string; data: Publisher }> = (props) => { - const { publisherId, data } = props ?? {}; + const mutationFn: MutationFunction>, {publisherId: string;data: Publisher}> = (props) => { + const {publisherId,data} = props ?? {}; - return updatePublisher(publisherId, data, requestOptions) - } + return updatePublisher(publisherId,data,requestOptions) + } + + return { mutationFn, ...mutationOptions }} - return { mutationFn, ...mutationOptions } -} - -export type UpdatePublisherMutationResult = NonNullable>> -export type UpdatePublisherMutationBody = Publisher -export type UpdatePublisherMutationError = ErrorResponse | void + export type UpdatePublisherMutationResult = NonNullable>> + export type UpdatePublisherMutationBody = Publisher + export type UpdatePublisherMutationError = ErrorResponse | void -/** -* @summary Update a publisher -*/ + /** + * @summary Update a publisher + */ export const useUpdatePublisher = (options?: { mutation?: UseMutationOptions>, TError, { publisherId: string; data: Publisher }, TContext>, request?: SecondParameter } - ) => { + TContext = unknown>(options?: { mutation?:UseMutationOptions>, TError,{publisherId: string;data: Publisher}, TContext>, request?: SecondParameter} +): UseMutationResult< + Awaited>, + TError, + {publisherId: string;data: Publisher}, + TContext + > => { - const mutationOptions = getUpdatePublisherMutationOptions(options); - - return useMutation(mutationOptions); -} + const mutationOptions = getUpdatePublisherMutationOptions(options); + return useMutation(mutationOptions); + } + /** * @summary Ban a publisher */ export const banPublisher = ( - publisherId: string, - options?: SecondParameter,) => { - - - return customInstance( - { - url: `/publishers/${publisherId}/ban`, method: 'POST' + publisherId: string, + options?: SecondParameter,) => { + + + return customInstance( + {url: `/publishers/${publisherId}/ban`, method: 'POST' }, - options); -} - + options); + } + -export const getBanPublisherMutationOptions = (options?: { mutation?: UseMutationOptions>, TError, { publisherId: string }, TContext>, request?: SecondParameter } - ): UseMutationOptions>, TError, { publisherId: string }, TContext> => { - const { mutation: mutationOptions, request: requestOptions } = options ?? {}; +export const getBanPublisherMutationOptions = (options?: { mutation?:UseMutationOptions>, TError,{publisherId: string}, TContext>, request?: SecondParameter} +): UseMutationOptions>, TError,{publisherId: string}, TContext> => { +const {mutation: mutationOptions, request: requestOptions} = options ?? {}; + + const mutationFn: MutationFunction>, {publisherId: string}> = (props) => { + const {publisherId} = props ?? {}; - const mutationFn: MutationFunction>, { publisherId: string }> = (props) => { - const { publisherId } = props ?? {}; + return banPublisher(publisherId,requestOptions) + } - return banPublisher(publisherId, requestOptions) - } + + return { mutationFn, ...mutationOptions }} + export type BanPublisherMutationResult = NonNullable>> + + export type BanPublisherMutationError = void | ErrorResponse - return { mutationFn, ...mutationOptions } -} - -export type BanPublisherMutationResult = NonNullable>> + /** + * @summary Ban a publisher + */ +export const useBanPublisher = (options?: { mutation?:UseMutationOptions>, TError,{publisherId: string}, TContext>, request?: SecondParameter} +): UseMutationResult< + Awaited>, + TError, + {publisherId: string}, + TContext + > => { -export type BanPublisherMutationError = ErrorResponse - -/** -* @summary Ban a publisher -*/ -export const useBanPublisher = (options?: { mutation?: UseMutationOptions>, TError, { publisherId: string }, TContext>, request?: SecondParameter } - ) => { - - const mutationOptions = getBanPublisherMutationOptions(options); - - return useMutation(mutationOptions); -} + const mutationOptions = getBanPublisherMutationOptions(options); + return useMutation(mutationOptions); + } + /** * @summary Retrieve all nodes */ export const listNodesForPublisher = ( - publisherId: string, - params?: ListNodesForPublisherParams, - options?: SecondParameter, signal?: AbortSignal + publisherId: string, + params?: ListNodesForPublisherParams, + options?: SecondParameter,signal?: AbortSignal ) => { - - - return customInstance( - { - url: `/publishers/${publisherId}/nodes`, method: 'GET', - params, signal + + + return customInstance( + {url: `/publishers/${publisherId}/nodes`, method: 'GET', + params, signal }, - options); -} - + options); + } + export const getListNodesForPublisherQueryKey = (publisherId: string, - params?: ListNodesForPublisherParams,) => { - return [`/publishers/${publisherId}/nodes`, ...(params ? [params] : [])] as const; -} - + params?: ListNodesForPublisherParams,) => { + return [`/publishers/${publisherId}/nodes`, ...(params ? [params]: [])] as const; + } + export const getListNodesForPublisherQueryOptions = >, TError = ErrorResponse>(publisherId: string, - params?: ListNodesForPublisherParams, options?: { query?: Partial>, TError, TData>>, request?: SecondParameter } + params?: ListNodesForPublisherParams, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} ) => { - const { query: queryOptions, request: requestOptions } = options ?? {}; - - const queryKey = queryOptions?.queryKey ?? getListNodesForPublisherQueryKey(publisherId, params); +const {query: queryOptions, request: requestOptions} = options ?? {}; + const queryKey = queryOptions?.queryKey ?? getListNodesForPublisherQueryKey(publisherId,params); + - const queryFn: QueryFunction>> = ({ signal }) => listNodesForPublisher(publisherId, params, requestOptions, signal); + const queryFn: QueryFunction>> = ({ signal }) => listNodesForPublisher(publisherId,params, requestOptions, signal); + + - - - return { queryKey, queryFn, enabled: !!(publisherId), ...queryOptions } as UseQueryOptions>, TError, TData> & { queryKey: QueryKey } + return { queryKey, queryFn, enabled: !!(publisherId), ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: QueryKey } } export type ListNodesForPublisherQueryResult = NonNullable>> @@ -1693,16 +1809,16 @@ export type ListNodesForPublisherQueryError = ErrorResponse * @summary Retrieve all nodes */ export const useListNodesForPublisher = >, TError = ErrorResponse>( - publisherId: string, - params?: ListNodesForPublisherParams, options?: { query?: Partial>, TError, TData>>, request?: SecondParameter } + publisherId: string, + params?: ListNodesForPublisherParams, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} -): UseQueryResult & { queryKey: QueryKey } => { + ): UseQueryResult & { queryKey: QueryKey } => { - const queryOptions = getListNodesForPublisherQueryOptions(publisherId, params, options) + const queryOptions = getListNodesForPublisherQueryOptions(publisherId,params,options) - const query = useQuery(queryOptions) as UseQueryResult & { queryKey: QueryKey }; + const query = useQuery(queryOptions) as UseQueryResult & { queryKey: QueryKey }; - query.queryKey = queryOptions.queryKey; + query.queryKey = queryOptions.queryKey ; return query; } @@ -1714,264 +1830,275 @@ export const useListNodesForPublisher = ,) => { - - - return customInstance( - { - url: `/publishers/${publisherId}/nodes`, method: 'POST', - headers: { 'Content-Type': 'application/json', }, + publisherId: string, + node: Node, + options?: SecondParameter,) => { + + + return customInstance( + {url: `/publishers/${publisherId}/nodes`, method: 'POST', + headers: {'Content-Type': 'application/json', }, data: node }, - options); -} - + options); + } + export const getCreateNodeMutationOptions = (options?: { mutation?: UseMutationOptions>, TError, { publisherId: string; data: Node }, TContext>, request?: SecondParameter } - ): UseMutationOptions>, TError, { publisherId: string; data: Node }, TContext> => { - const { mutation: mutationOptions, request: requestOptions } = options ?? {}; + TContext = unknown>(options?: { mutation?:UseMutationOptions>, TError,{publisherId: string;data: Node}, TContext>, request?: SecondParameter} +): UseMutationOptions>, TError,{publisherId: string;data: Node}, TContext> => { +const {mutation: mutationOptions, request: requestOptions} = options ?? {}; + + const mutationFn: MutationFunction>, {publisherId: string;data: Node}> = (props) => { + const {publisherId,data} = props ?? {}; - const mutationFn: MutationFunction>, { publisherId: string; data: Node }> = (props) => { - const { publisherId, data } = props ?? {}; + return createNode(publisherId,data,requestOptions) + } - return createNode(publisherId, data, requestOptions) - } + + return { mutationFn, ...mutationOptions }} + export type CreateNodeMutationResult = NonNullable>> + export type CreateNodeMutationBody = Node + export type CreateNodeMutationError = ErrorResponse | void - return { mutationFn, ...mutationOptions } -} - -export type CreateNodeMutationResult = NonNullable>> -export type CreateNodeMutationBody = Node -export type CreateNodeMutationError = ErrorResponse | void - -/** -* @summary Create a new custom node -*/ + /** + * @summary Create a new custom node + */ export const useCreateNode = (options?: { mutation?: UseMutationOptions>, TError, { publisherId: string; data: Node }, TContext>, request?: SecondParameter } - ) => { + TContext = unknown>(options?: { mutation?:UseMutationOptions>, TError,{publisherId: string;data: Node}, TContext>, request?: SecondParameter} +): UseMutationResult< + Awaited>, + TError, + {publisherId: string;data: Node}, + TContext + > => { - const mutationOptions = getCreateNodeMutationOptions(options); - - return useMutation(mutationOptions); -} + const mutationOptions = getCreateNodeMutationOptions(options); + return useMutation(mutationOptions); + } + /** * @summary Delete a specific node */ export const deleteNode = ( - publisherId: string, - nodeId: string, - options?: SecondParameter,) => { - - - return customInstance( - { - url: `/publishers/${publisherId}/nodes/${nodeId}`, method: 'DELETE' + publisherId: string, + nodeId: string, + options?: SecondParameter,) => { + + + return customInstance( + {url: `/publishers/${publisherId}/nodes/${nodeId}`, method: 'DELETE' }, - options); -} - + options); + } + export const getDeleteNodeMutationOptions = (options?: { mutation?: UseMutationOptions>, TError, { publisherId: string; nodeId: string }, TContext>, request?: SecondParameter } - ): UseMutationOptions>, TError, { publisherId: string; nodeId: string }, TContext> => { - const { mutation: mutationOptions, request: requestOptions } = options ?? {}; - - - + TContext = unknown>(options?: { mutation?:UseMutationOptions>, TError,{publisherId: string;nodeId: string}, TContext>, request?: SecondParameter} +): UseMutationOptions>, TError,{publisherId: string;nodeId: string}, TContext> => { +const {mutation: mutationOptions, request: requestOptions} = options ?? {}; - const mutationFn: MutationFunction>, { publisherId: string; nodeId: string }> = (props) => { - const { publisherId, nodeId } = props ?? {}; + - return deleteNode(publisherId, nodeId, requestOptions) - } + const mutationFn: MutationFunction>, {publisherId: string;nodeId: string}> = (props) => { + const {publisherId,nodeId} = props ?? {}; + return deleteNode(publisherId,nodeId,requestOptions) + } + - return { mutationFn, ...mutationOptions } -} -export type DeleteNodeMutationResult = NonNullable>> + return { mutationFn, ...mutationOptions }} -export type DeleteNodeMutationError = ErrorResponse + export type DeleteNodeMutationResult = NonNullable>> + + export type DeleteNodeMutationError = ErrorResponse -/** -* @summary Delete a specific node -*/ + /** + * @summary Delete a specific node + */ export const useDeleteNode = (options?: { mutation?: UseMutationOptions>, TError, { publisherId: string; nodeId: string }, TContext>, request?: SecondParameter } - ) => { + TContext = unknown>(options?: { mutation?:UseMutationOptions>, TError,{publisherId: string;nodeId: string}, TContext>, request?: SecondParameter} +): UseMutationResult< + Awaited>, + TError, + {publisherId: string;nodeId: string}, + TContext + > => { - const mutationOptions = getDeleteNodeMutationOptions(options); - - return useMutation(mutationOptions); -} + const mutationOptions = getDeleteNodeMutationOptions(options); + return useMutation(mutationOptions); + } + /** * @summary Update a specific node */ export const updateNode = ( - publisherId: string, - nodeId: string, - node: Node, - options?: SecondParameter,) => { - - - return customInstance( - { - url: `/publishers/${publisherId}/nodes/${nodeId}`, method: 'PUT', - headers: { 'Content-Type': 'application/json', }, + publisherId: string, + nodeId: string, + node: Node, + options?: SecondParameter,) => { + + + return customInstance( + {url: `/publishers/${publisherId}/nodes/${nodeId}`, method: 'PUT', + headers: {'Content-Type': 'application/json', }, data: node }, - options); -} - + options); + } + export const getUpdateNodeMutationOptions = (options?: { mutation?: UseMutationOptions>, TError, { publisherId: string; nodeId: string; data: Node }, TContext>, request?: SecondParameter } - ): UseMutationOptions>, TError, { publisherId: string; nodeId: string; data: Node }, TContext> => { - const { mutation: mutationOptions, request: requestOptions } = options ?? {}; - - + TContext = unknown>(options?: { mutation?:UseMutationOptions>, TError,{publisherId: string;nodeId: string;data: Node}, TContext>, request?: SecondParameter} +): UseMutationOptions>, TError,{publisherId: string;nodeId: string;data: Node}, TContext> => { +const {mutation: mutationOptions, request: requestOptions} = options ?? {}; + - const mutationFn: MutationFunction>, { publisherId: string; nodeId: string; data: Node }> = (props) => { - const { publisherId, nodeId, data } = props ?? {}; - return updateNode(publisherId, nodeId, data, requestOptions) - } + const mutationFn: MutationFunction>, {publisherId: string;nodeId: string;data: Node}> = (props) => { + const {publisherId,nodeId,data} = props ?? {}; + return updateNode(publisherId,nodeId,data,requestOptions) + } + - return { mutationFn, ...mutationOptions } -} + return { mutationFn, ...mutationOptions }} -export type UpdateNodeMutationResult = NonNullable>> -export type UpdateNodeMutationBody = Node -export type UpdateNodeMutationError = ErrorResponse | void + export type UpdateNodeMutationResult = NonNullable>> + export type UpdateNodeMutationBody = Node + export type UpdateNodeMutationError = ErrorResponse | void -/** -* @summary Update a specific node -*/ + /** + * @summary Update a specific node + */ export const useUpdateNode = (options?: { mutation?: UseMutationOptions>, TError, { publisherId: string; nodeId: string; data: Node }, TContext>, request?: SecondParameter } - ) => { + TContext = unknown>(options?: { mutation?:UseMutationOptions>, TError,{publisherId: string;nodeId: string;data: Node}, TContext>, request?: SecondParameter} +): UseMutationResult< + Awaited>, + TError, + {publisherId: string;nodeId: string;data: Node}, + TContext + > => { - const mutationOptions = getUpdateNodeMutationOptions(options); - - return useMutation(mutationOptions); -} + const mutationOptions = getUpdateNodeMutationOptions(options); + return useMutation(mutationOptions); + } + /** * @summary Ban a publisher's Node */ export const banPublisherNode = ( - publisherId: string, - nodeId: string, - options?: SecondParameter,) => { - - - return customInstance( - { - url: `/publishers/${publisherId}/nodes/${nodeId}/ban`, method: 'POST' + publisherId: string, + nodeId: string, + options?: SecondParameter,) => { + + + return customInstance( + {url: `/publishers/${publisherId}/nodes/${nodeId}/ban`, method: 'POST' }, - options); -} - - - -export const getBanPublisherNodeMutationOptions = (options?: { mutation?: UseMutationOptions>, TError, { publisherId: string; nodeId: string }, TContext>, request?: SecondParameter } - ): UseMutationOptions>, TError, { publisherId: string; nodeId: string }, TContext> => { - const { mutation: mutationOptions, request: requestOptions } = options ?? {}; + options); + } + +export const getBanPublisherNodeMutationOptions = (options?: { mutation?:UseMutationOptions>, TError,{publisherId: string;nodeId: string}, TContext>, request?: SecondParameter} +): UseMutationOptions>, TError,{publisherId: string;nodeId: string}, TContext> => { +const {mutation: mutationOptions, request: requestOptions} = options ?? {}; + - const mutationFn: MutationFunction>, { publisherId: string; nodeId: string }> = (props) => { - const { publisherId, nodeId } = props ?? {}; - return banPublisherNode(publisherId, nodeId, requestOptions) - } + const mutationFn: MutationFunction>, {publisherId: string;nodeId: string}> = (props) => { + const {publisherId,nodeId} = props ?? {}; + return banPublisherNode(publisherId,nodeId,requestOptions) + } + - return { mutationFn, ...mutationOptions } -} - -export type BanPublisherNodeMutationResult = NonNullable>> + return { mutationFn, ...mutationOptions }} -export type BanPublisherNodeMutationError = ErrorResponse - -/** -* @summary Ban a publisher's Node -*/ -export const useBanPublisherNode = (options?: { mutation?: UseMutationOptions>, TError, { publisherId: string; nodeId: string }, TContext>, request?: SecondParameter } - ) => { + export type BanPublisherNodeMutationResult = NonNullable>> + + export type BanPublisherNodeMutationError = void | ErrorResponse - const mutationOptions = getBanPublisherNodeMutationOptions(options); + /** + * @summary Ban a publisher's Node + */ +export const useBanPublisherNode = (options?: { mutation?:UseMutationOptions>, TError,{publisherId: string;nodeId: string}, TContext>, request?: SecondParameter} +): UseMutationResult< + Awaited>, + TError, + {publisherId: string;nodeId: string}, + TContext + > => { - return useMutation(mutationOptions); -} + const mutationOptions = getBanPublisherNodeMutationOptions(options); + return useMutation(mutationOptions); + } + /** * @summary Retrieve permissions the user has for a given publisher */ export const getPermissionOnPublisherNodes = ( - publisherId: string, - nodeId: string, - options?: SecondParameter, signal?: AbortSignal + publisherId: string, + nodeId: string, + options?: SecondParameter,signal?: AbortSignal ) => { - - - return customInstance( - { - url: `/publishers/${publisherId}/nodes/${nodeId}/permissions`, method: 'GET', signal + + + return customInstance( + {url: `/publishers/${publisherId}/nodes/${nodeId}/permissions`, method: 'GET', signal }, - options); -} - + options); + } + export const getGetPermissionOnPublisherNodesQueryKey = (publisherId: string, - nodeId: string,) => { - return [`/publishers/${publisherId}/nodes/${nodeId}/permissions`] as const; -} - + nodeId: string,) => { + return [`/publishers/${publisherId}/nodes/${nodeId}/permissions`] as const; + } + export const getGetPermissionOnPublisherNodesQueryOptions = >, TError = ErrorResponse>(publisherId: string, - nodeId: string, options?: { query?: Partial>, TError, TData>>, request?: SecondParameter } + nodeId: string, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} ) => { - const { query: queryOptions, request: requestOptions } = options ?? {}; - - const queryKey = queryOptions?.queryKey ?? getGetPermissionOnPublisherNodesQueryKey(publisherId, nodeId); - - +const {query: queryOptions, request: requestOptions} = options ?? {}; - const queryFn: QueryFunction>> = ({ signal }) => getPermissionOnPublisherNodes(publisherId, nodeId, requestOptions, signal); + const queryKey = queryOptions?.queryKey ?? getGetPermissionOnPublisherNodesQueryKey(publisherId,nodeId); + + const queryFn: QueryFunction>> = ({ signal }) => getPermissionOnPublisherNodes(publisherId,nodeId, requestOptions, signal); + + - return { queryKey, queryFn, enabled: !!(publisherId && nodeId), ...queryOptions } as UseQueryOptions>, TError, TData> & { queryKey: QueryKey } + return { queryKey, queryFn, enabled: !!(publisherId && nodeId), ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: QueryKey } } export type GetPermissionOnPublisherNodesQueryResult = NonNullable>> @@ -1981,16 +2108,16 @@ export type GetPermissionOnPublisherNodesQueryError = ErrorResponse * @summary Retrieve permissions the user has for a given publisher */ export const useGetPermissionOnPublisherNodes = >, TError = ErrorResponse>( - publisherId: string, - nodeId: string, options?: { query?: Partial>, TError, TData>>, request?: SecondParameter } + publisherId: string, + nodeId: string, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} -): UseQueryResult & { queryKey: QueryKey } => { + ): UseQueryResult & { queryKey: QueryKey } => { - const queryOptions = getGetPermissionOnPublisherNodesQueryOptions(publisherId, nodeId, options) + const queryOptions = getGetPermissionOnPublisherNodesQueryOptions(publisherId,nodeId,options) - const query = useQuery(queryOptions) as UseQueryResult & { queryKey: QueryKey }; + const query = useQuery(queryOptions) as UseQueryResult & { queryKey: QueryKey }; - query.queryKey = queryOptions.queryKey; + query.queryKey = queryOptions.queryKey ; return query; } @@ -2002,211 +2129,219 @@ export const useGetPermissionOnPublisherNodes = ,) => { - - - return customInstance( - { - url: `/publishers/${publisherId}/nodes/${nodeId}/versions`, method: 'POST', - headers: { 'Content-Type': 'application/json', }, + publisherId: string, + nodeId: string, + publishNodeVersionBody: PublishNodeVersionBody, + options?: SecondParameter,) => { + + + return customInstance( + {url: `/publishers/${publisherId}/nodes/${nodeId}/versions`, method: 'POST', + headers: {'Content-Type': 'application/json', }, data: publishNodeVersionBody }, - options); -} - + options); + } + export const getPublishNodeVersionMutationOptions = (options?: { mutation?: UseMutationOptions>, TError, { publisherId: string; nodeId: string; data: PublishNodeVersionBody }, TContext>, request?: SecondParameter } - ): UseMutationOptions>, TError, { publisherId: string; nodeId: string; data: PublishNodeVersionBody }, TContext> => { - const { mutation: mutationOptions, request: requestOptions } = options ?? {}; + TContext = unknown>(options?: { mutation?:UseMutationOptions>, TError,{publisherId: string;nodeId: string;data: PublishNodeVersionBody}, TContext>, request?: SecondParameter} +): UseMutationOptions>, TError,{publisherId: string;nodeId: string;data: PublishNodeVersionBody}, TContext> => { +const {mutation: mutationOptions, request: requestOptions} = options ?? {}; + + const mutationFn: MutationFunction>, {publisherId: string;nodeId: string;data: PublishNodeVersionBody}> = (props) => { + const {publisherId,nodeId,data} = props ?? {}; - const mutationFn: MutationFunction>, { publisherId: string; nodeId: string; data: PublishNodeVersionBody }> = (props) => { - const { publisherId, nodeId, data } = props ?? {}; + return publishNodeVersion(publisherId,nodeId,data,requestOptions) + } - return publishNodeVersion(publisherId, nodeId, data, requestOptions) - } + + return { mutationFn, ...mutationOptions }} + export type PublishNodeVersionMutationResult = NonNullable>> + export type PublishNodeVersionMutationBody = PublishNodeVersionBody + export type PublishNodeVersionMutationError = ErrorResponse - return { mutationFn, ...mutationOptions } -} - -export type PublishNodeVersionMutationResult = NonNullable>> -export type PublishNodeVersionMutationBody = PublishNodeVersionBody -export type PublishNodeVersionMutationError = ErrorResponse - -/** -* @summary Publish a new version of a node -*/ + /** + * @summary Publish a new version of a node + */ export const usePublishNodeVersion = (options?: { mutation?: UseMutationOptions>, TError, { publisherId: string; nodeId: string; data: PublishNodeVersionBody }, TContext>, request?: SecondParameter } - ) => { + TContext = unknown>(options?: { mutation?:UseMutationOptions>, TError,{publisherId: string;nodeId: string;data: PublishNodeVersionBody}, TContext>, request?: SecondParameter} +): UseMutationResult< + Awaited>, + TError, + {publisherId: string;nodeId: string;data: PublishNodeVersionBody}, + TContext + > => { - const mutationOptions = getPublishNodeVersionMutationOptions(options); - - return useMutation(mutationOptions); -} + const mutationOptions = getPublishNodeVersionMutationOptions(options); + return useMutation(mutationOptions); + } + /** * @summary Unpublish (delete) a specific version of a node */ export const deleteNodeVersion = ( - publisherId: string, - nodeId: string, - versionId: string, - options?: SecondParameter,) => { - - - return customInstance( - { - url: `/publishers/${publisherId}/nodes/${nodeId}/versions/${versionId}`, method: 'DELETE' + publisherId: string, + nodeId: string, + versionId: string, + options?: SecondParameter,) => { + + + return customInstance( + {url: `/publishers/${publisherId}/nodes/${nodeId}/versions/${versionId}`, method: 'DELETE' }, - options); -} - + options); + } + export const getDeleteNodeVersionMutationOptions = (options?: { mutation?: UseMutationOptions>, TError, { publisherId: string; nodeId: string; versionId: string }, TContext>, request?: SecondParameter } - ): UseMutationOptions>, TError, { publisherId: string; nodeId: string; versionId: string }, TContext> => { - const { mutation: mutationOptions, request: requestOptions } = options ?? {}; + TContext = unknown>(options?: { mutation?:UseMutationOptions>, TError,{publisherId: string;nodeId: string;versionId: string}, TContext>, request?: SecondParameter} +): UseMutationOptions>, TError,{publisherId: string;nodeId: string;versionId: string}, TContext> => { +const {mutation: mutationOptions, request: requestOptions} = options ?? {}; + + const mutationFn: MutationFunction>, {publisherId: string;nodeId: string;versionId: string}> = (props) => { + const {publisherId,nodeId,versionId} = props ?? {}; - const mutationFn: MutationFunction>, { publisherId: string; nodeId: string; versionId: string }> = (props) => { - const { publisherId, nodeId, versionId } = props ?? {}; + return deleteNodeVersion(publisherId,nodeId,versionId,requestOptions) + } - return deleteNodeVersion(publisherId, nodeId, versionId, requestOptions) - } + + return { mutationFn, ...mutationOptions }} + export type DeleteNodeVersionMutationResult = NonNullable>> + + export type DeleteNodeVersionMutationError = ErrorResponse | Error - return { mutationFn, ...mutationOptions } -} - -export type DeleteNodeVersionMutationResult = NonNullable>> - -export type DeleteNodeVersionMutationError = ErrorResponse | Error - -/** -* @summary Unpublish (delete) a specific version of a node -*/ + /** + * @summary Unpublish (delete) a specific version of a node + */ export const useDeleteNodeVersion = (options?: { mutation?: UseMutationOptions>, TError, { publisherId: string; nodeId: string; versionId: string }, TContext>, request?: SecondParameter } - ) => { + TContext = unknown>(options?: { mutation?:UseMutationOptions>, TError,{publisherId: string;nodeId: string;versionId: string}, TContext>, request?: SecondParameter} +): UseMutationResult< + Awaited>, + TError, + {publisherId: string;nodeId: string;versionId: string}, + TContext + > => { - const mutationOptions = getDeleteNodeVersionMutationOptions(options); - - return useMutation(mutationOptions); -} + const mutationOptions = getDeleteNodeVersionMutationOptions(options); + return useMutation(mutationOptions); + } + /** * Update only the changelog and deprecated status of a specific version of a node. * @summary Update changelog and deprecation status of a node version */ export const updateNodeVersion = ( - publisherId: string, - nodeId: string, - versionId: string, - nodeVersionUpdateRequest: NodeVersionUpdateRequest, - options?: SecondParameter,) => { - - - return customInstance( - { - url: `/publishers/${publisherId}/nodes/${nodeId}/versions/${versionId}`, method: 'PUT', - headers: { 'Content-Type': 'application/json', }, + publisherId: string, + nodeId: string, + versionId: string, + nodeVersionUpdateRequest: NodeVersionUpdateRequest, + options?: SecondParameter,) => { + + + return customInstance( + {url: `/publishers/${publisherId}/nodes/${nodeId}/versions/${versionId}`, method: 'PUT', + headers: {'Content-Type': 'application/json', }, data: nodeVersionUpdateRequest }, - options); -} - + options); + } + export const getUpdateNodeVersionMutationOptions = (options?: { mutation?: UseMutationOptions>, TError, { publisherId: string; nodeId: string; versionId: string; data: NodeVersionUpdateRequest }, TContext>, request?: SecondParameter } - ): UseMutationOptions>, TError, { publisherId: string; nodeId: string; versionId: string; data: NodeVersionUpdateRequest }, TContext> => { - const { mutation: mutationOptions, request: requestOptions } = options ?? {}; + TContext = unknown>(options?: { mutation?:UseMutationOptions>, TError,{publisherId: string;nodeId: string;versionId: string;data: NodeVersionUpdateRequest}, TContext>, request?: SecondParameter} +): UseMutationOptions>, TError,{publisherId: string;nodeId: string;versionId: string;data: NodeVersionUpdateRequest}, TContext> => { +const {mutation: mutationOptions, request: requestOptions} = options ?? {}; + + const mutationFn: MutationFunction>, {publisherId: string;nodeId: string;versionId: string;data: NodeVersionUpdateRequest}> = (props) => { + const {publisherId,nodeId,versionId,data} = props ?? {}; - const mutationFn: MutationFunction>, { publisherId: string; nodeId: string; versionId: string; data: NodeVersionUpdateRequest }> = (props) => { - const { publisherId, nodeId, versionId, data } = props ?? {}; + return updateNodeVersion(publisherId,nodeId,versionId,data,requestOptions) + } - return updateNodeVersion(publisherId, nodeId, versionId, data, requestOptions) - } + + return { mutationFn, ...mutationOptions }} + export type UpdateNodeVersionMutationResult = NonNullable>> + export type UpdateNodeVersionMutationBody = NodeVersionUpdateRequest + export type UpdateNodeVersionMutationError = ErrorResponse | void - return { mutationFn, ...mutationOptions } -} - -export type UpdateNodeVersionMutationResult = NonNullable>> -export type UpdateNodeVersionMutationBody = NodeVersionUpdateRequest -export type UpdateNodeVersionMutationError = ErrorResponse | void - -/** -* @summary Update changelog and deprecation status of a node version -*/ + /** + * @summary Update changelog and deprecation status of a node version + */ export const useUpdateNodeVersion = (options?: { mutation?: UseMutationOptions>, TError, { publisherId: string; nodeId: string; versionId: string; data: NodeVersionUpdateRequest }, TContext>, request?: SecondParameter } - ) => { + TContext = unknown>(options?: { mutation?:UseMutationOptions>, TError,{publisherId: string;nodeId: string;versionId: string;data: NodeVersionUpdateRequest}, TContext>, request?: SecondParameter} +): UseMutationResult< + Awaited>, + TError, + {publisherId: string;nodeId: string;versionId: string;data: NodeVersionUpdateRequest}, + TContext + > => { - const mutationOptions = getUpdateNodeVersionMutationOptions(options); - - return useMutation(mutationOptions); -} + const mutationOptions = getUpdateNodeVersionMutationOptions(options); + return useMutation(mutationOptions); + } + /** * @summary Retrieve permissions the user has for a given publisher */ export const getPermissionOnPublisher = ( - publisherId: string, - options?: SecondParameter, signal?: AbortSignal + publisherId: string, + options?: SecondParameter,signal?: AbortSignal ) => { - - - return customInstance( - { - url: `/publishers/${publisherId}/permissions`, method: 'GET', signal + + + return customInstance( + {url: `/publishers/${publisherId}/permissions`, method: 'GET', signal }, - options); -} - + options); + } + export const getGetPermissionOnPublisherQueryKey = (publisherId: string,) => { - return [`/publishers/${publisherId}/permissions`] as const; -} - + return [`/publishers/${publisherId}/permissions`] as const; + } -export const getGetPermissionOnPublisherQueryOptions = >, TError = ErrorResponse>(publisherId: string, options?: { query?: Partial>, TError, TData>>, request?: SecondParameter } + +export const getGetPermissionOnPublisherQueryOptions = >, TError = ErrorResponse>(publisherId: string, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} ) => { - const { query: queryOptions, request: requestOptions } = options ?? {}; - - const queryKey = queryOptions?.queryKey ?? getGetPermissionOnPublisherQueryKey(publisherId); - +const {query: queryOptions, request: requestOptions} = options ?? {}; + const queryKey = queryOptions?.queryKey ?? getGetPermissionOnPublisherQueryKey(publisherId); - const queryFn: QueryFunction>> = ({ signal }) => getPermissionOnPublisher(publisherId, requestOptions, signal); + + const queryFn: QueryFunction>> = ({ signal }) => getPermissionOnPublisher(publisherId, requestOptions, signal); + + - - return { queryKey, queryFn, enabled: !!(publisherId), ...queryOptions } as UseQueryOptions>, TError, TData> & { queryKey: QueryKey } + return { queryKey, queryFn, enabled: !!(publisherId), ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: QueryKey } } export type GetPermissionOnPublisherQueryResult = NonNullable>> @@ -2216,15 +2351,15 @@ export type GetPermissionOnPublisherQueryError = ErrorResponse * @summary Retrieve permissions the user has for a given publisher */ export const useGetPermissionOnPublisher = >, TError = ErrorResponse>( - publisherId: string, options?: { query?: Partial>, TError, TData>>, request?: SecondParameter } + publisherId: string, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} -): UseQueryResult & { queryKey: QueryKey } => { + ): UseQueryResult & { queryKey: QueryKey } => { - const queryOptions = getGetPermissionOnPublisherQueryOptions(publisherId, options) + const queryOptions = getGetPermissionOnPublisherQueryOptions(publisherId,options) - const query = useQuery(queryOptions) as UseQueryResult & { queryKey: QueryKey }; + const query = useQuery(queryOptions) as UseQueryResult & { queryKey: QueryKey }; - query.queryKey = queryOptions.queryKey; + query.queryKey = queryOptions.queryKey ; return query; } @@ -2236,40 +2371,39 @@ export const useGetPermissionOnPublisher = , signal?: AbortSignal + publisherId: string, + options?: SecondParameter,signal?: AbortSignal ) => { - - - return customInstance( - { - url: `/publishers/${publisherId}/tokens`, method: 'GET', signal + + + return customInstance( + {url: `/publishers/${publisherId}/tokens`, method: 'GET', signal }, - options); -} - + options); + } + export const getListPersonalAccessTokensQueryKey = (publisherId: string,) => { - return [`/publishers/${publisherId}/tokens`] as const; -} - + return [`/publishers/${publisherId}/tokens`] as const; + } -export const getListPersonalAccessTokensQueryOptions = >, TError = ErrorResponse>(publisherId: string, options?: { query?: Partial>, TError, TData>>, request?: SecondParameter } + +export const getListPersonalAccessTokensQueryOptions = >, TError = ErrorResponse>(publisherId: string, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} ) => { - const { query: queryOptions, request: requestOptions } = options ?? {}; - - const queryKey = queryOptions?.queryKey ?? getListPersonalAccessTokensQueryKey(publisherId); - +const {query: queryOptions, request: requestOptions} = options ?? {}; + const queryKey = queryOptions?.queryKey ?? getListPersonalAccessTokensQueryKey(publisherId); - const queryFn: QueryFunction>> = ({ signal }) => listPersonalAccessTokens(publisherId, requestOptions, signal); + + const queryFn: QueryFunction>> = ({ signal }) => listPersonalAccessTokens(publisherId, requestOptions, signal); + + - - return { queryKey, queryFn, enabled: !!(publisherId), ...queryOptions } as UseQueryOptions>, TError, TData> & { queryKey: QueryKey } + return { queryKey, queryFn, enabled: !!(publisherId), ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: QueryKey } } export type ListPersonalAccessTokensQueryResult = NonNullable>> @@ -2279,15 +2413,15 @@ export type ListPersonalAccessTokensQueryError = ErrorResponse * @summary Retrieve all personal access tokens for a publisher */ export const useListPersonalAccessTokens = >, TError = ErrorResponse>( - publisherId: string, options?: { query?: Partial>, TError, TData>>, request?: SecondParameter } + publisherId: string, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} -): UseQueryResult & { queryKey: QueryKey } => { + ): UseQueryResult & { queryKey: QueryKey } => { - const queryOptions = getListPersonalAccessTokensQueryOptions(publisherId, options) + const queryOptions = getListPersonalAccessTokensQueryOptions(publisherId,options) - const query = useQuery(queryOptions) as UseQueryResult & { queryKey: QueryKey }; + const query = useQuery(queryOptions) as UseQueryResult & { queryKey: QueryKey }; - query.queryKey = queryOptions.queryKey; + query.queryKey = queryOptions.queryKey ; return query; } @@ -2299,170 +2433,175 @@ export const useListPersonalAccessTokens = ,) => { - - - return customInstance( - { - url: `/publishers/${publisherId}/tokens`, method: 'POST', - headers: { 'Content-Type': 'application/json', }, + publisherId: string, + personalAccessToken: PersonalAccessToken, + options?: SecondParameter,) => { + + + return customInstance( + {url: `/publishers/${publisherId}/tokens`, method: 'POST', + headers: {'Content-Type': 'application/json', }, data: personalAccessToken }, - options); -} - + options); + } + export const getCreatePersonalAccessTokenMutationOptions = (options?: { mutation?: UseMutationOptions>, TError, { publisherId: string; data: PersonalAccessToken }, TContext>, request?: SecondParameter } - ): UseMutationOptions>, TError, { publisherId: string; data: PersonalAccessToken }, TContext> => { - const { mutation: mutationOptions, request: requestOptions } = options ?? {}; - + TContext = unknown>(options?: { mutation?:UseMutationOptions>, TError,{publisherId: string;data: PersonalAccessToken}, TContext>, request?: SecondParameter} +): UseMutationOptions>, TError,{publisherId: string;data: PersonalAccessToken}, TContext> => { +const {mutation: mutationOptions, request: requestOptions} = options ?? {}; + - const mutationFn: MutationFunction>, { publisherId: string; data: PersonalAccessToken }> = (props) => { - const { publisherId, data } = props ?? {}; + const mutationFn: MutationFunction>, {publisherId: string;data: PersonalAccessToken}> = (props) => { + const {publisherId,data} = props ?? {}; - return createPersonalAccessToken(publisherId, data, requestOptions) - } + return createPersonalAccessToken(publisherId,data,requestOptions) + } + + return { mutationFn, ...mutationOptions }} - return { mutationFn, ...mutationOptions } -} - -export type CreatePersonalAccessTokenMutationResult = NonNullable>> -export type CreatePersonalAccessTokenMutationBody = PersonalAccessToken -export type CreatePersonalAccessTokenMutationError = ErrorResponse + export type CreatePersonalAccessTokenMutationResult = NonNullable>> + export type CreatePersonalAccessTokenMutationBody = PersonalAccessToken + export type CreatePersonalAccessTokenMutationError = ErrorResponse -/** -* @summary Create a new personal access token -*/ + /** + * @summary Create a new personal access token + */ export const useCreatePersonalAccessToken = (options?: { mutation?: UseMutationOptions>, TError, { publisherId: string; data: PersonalAccessToken }, TContext>, request?: SecondParameter } - ) => { - - const mutationOptions = getCreatePersonalAccessTokenMutationOptions(options); + TContext = unknown>(options?: { mutation?:UseMutationOptions>, TError,{publisherId: string;data: PersonalAccessToken}, TContext>, request?: SecondParameter} +): UseMutationResult< + Awaited>, + TError, + {publisherId: string;data: PersonalAccessToken}, + TContext + > => { - return useMutation(mutationOptions); -} + const mutationOptions = getCreatePersonalAccessTokenMutationOptions(options); + return useMutation(mutationOptions); + } + /** * @summary Delete a specific personal access token */ export const deletePersonalAccessToken = ( - publisherId: string, - tokenId: string, - options?: SecondParameter,) => { - - - return customInstance( - { - url: `/publishers/${publisherId}/tokens/${tokenId}`, method: 'DELETE' + publisherId: string, + tokenId: string, + options?: SecondParameter,) => { + + + return customInstance( + {url: `/publishers/${publisherId}/tokens/${tokenId}`, method: 'DELETE' }, - options); -} - + options); + } + export const getDeletePersonalAccessTokenMutationOptions = (options?: { mutation?: UseMutationOptions>, TError, { publisherId: string; tokenId: string }, TContext>, request?: SecondParameter } - ): UseMutationOptions>, TError, { publisherId: string; tokenId: string }, TContext> => { - const { mutation: mutationOptions, request: requestOptions } = options ?? {}; - - - + TContext = unknown>(options?: { mutation?:UseMutationOptions>, TError,{publisherId: string;tokenId: string}, TContext>, request?: SecondParameter} +): UseMutationOptions>, TError,{publisherId: string;tokenId: string}, TContext> => { +const {mutation: mutationOptions, request: requestOptions} = options ?? {}; - const mutationFn: MutationFunction>, { publisherId: string; tokenId: string }> = (props) => { - const { publisherId, tokenId } = props ?? {}; + - return deletePersonalAccessToken(publisherId, tokenId, requestOptions) - } + const mutationFn: MutationFunction>, {publisherId: string;tokenId: string}> = (props) => { + const {publisherId,tokenId} = props ?? {}; + return deletePersonalAccessToken(publisherId,tokenId,requestOptions) + } + - return { mutationFn, ...mutationOptions } -} -export type DeletePersonalAccessTokenMutationResult = NonNullable>> + return { mutationFn, ...mutationOptions }} -export type DeletePersonalAccessTokenMutationError = ErrorResponse + export type DeletePersonalAccessTokenMutationResult = NonNullable>> + + export type DeletePersonalAccessTokenMutationError = ErrorResponse -/** -* @summary Delete a specific personal access token -*/ + /** + * @summary Delete a specific personal access token + */ export const useDeletePersonalAccessToken = (options?: { mutation?: UseMutationOptions>, TError, { publisherId: string; tokenId: string }, TContext>, request?: SecondParameter } - ) => { + TContext = unknown>(options?: { mutation?:UseMutationOptions>, TError,{publisherId: string;tokenId: string}, TContext>, request?: SecondParameter} +): UseMutationResult< + Awaited>, + TError, + {publisherId: string;tokenId: string}, + TContext + > => { - const mutationOptions = getDeletePersonalAccessTokenMutationOptions(options); - - return useMutation(mutationOptions); -} + const mutationOptions = getDeletePersonalAccessTokenMutationOptions(options); + return useMutation(mutationOptions); + } + /** * Pull all pending node versions and conduct security scans. * @summary Security Scan */ export const securityScan = ( - params?: SecurityScanParams, - options?: SecondParameter, signal?: AbortSignal + params?: SecurityScanParams, + options?: SecondParameter,signal?: AbortSignal ) => { - - - return customInstance( - { - url: `/security-scan`, method: 'GET', - params, signal + + + return customInstance( + {url: `/security-scan`, method: 'GET', + params, signal }, - options); -} - + options); + } + export const getSecurityScanQueryKey = (params?: SecurityScanParams,) => { - return [`/security-scan`, ...(params ? [params] : [])] as const; -} + return [`/security-scan`, ...(params ? [params]: [])] as const; + } - -export const getSecurityScanQueryOptions = >, TError = ErrorResponse>(params?: SecurityScanParams, options?: { query?: Partial>, TError, TData>>, request?: SecondParameter } + +export const getSecurityScanQueryOptions = >, TError = ErrorResponse | void>(params?: SecurityScanParams, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} ) => { - const { query: queryOptions, request: requestOptions } = options ?? {}; - - const queryKey = queryOptions?.queryKey ?? getSecurityScanQueryKey(params); +const {query: queryOptions, request: requestOptions} = options ?? {}; + const queryKey = queryOptions?.queryKey ?? getSecurityScanQueryKey(params); + - const queryFn: QueryFunction>> = ({ signal }) => securityScan(params, requestOptions, signal); + const queryFn: QueryFunction>> = ({ signal }) => securityScan(params, requestOptions, signal); + + - - - return { queryKey, queryFn, ...queryOptions } as UseQueryOptions>, TError, TData> & { queryKey: QueryKey } + return { queryKey, queryFn, ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: QueryKey } } export type SecurityScanQueryResult = NonNullable>> -export type SecurityScanQueryError = ErrorResponse +export type SecurityScanQueryError = ErrorResponse | void /** * @summary Security Scan */ -export const useSecurityScan = >, TError = ErrorResponse>( - params?: SecurityScanParams, options?: { query?: Partial>, TError, TData>>, request?: SecondParameter } +export const useSecurityScan = >, TError = ErrorResponse | void>( + params?: SecurityScanParams, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} -): UseQueryResult & { queryKey: QueryKey } => { + ): UseQueryResult & { queryKey: QueryKey } => { - const queryOptions = getSecurityScanQueryOptions(params, options) + const queryOptions = getSecurityScanQueryOptions(params,options) - const query = useQuery(queryOptions) as UseQueryResult & { queryKey: QueryKey }; + const query = useQuery(queryOptions) as UseQueryResult & { queryKey: QueryKey }; - query.queryKey = queryOptions.queryKey; + query.queryKey = queryOptions.queryKey ; return query; } @@ -2474,95 +2613,97 @@ export const useSecurityScan = > * @summary Receive artifacts (output files) from the ComfyUI GitHub Action */ export const postUploadArtifact = ( - postUploadArtifactBody: PostUploadArtifactBody, - options?: SecondParameter,) => { - - - return customInstance( - { - url: `/upload-artifact`, method: 'POST', - headers: { 'Content-Type': 'application/json', }, + postUploadArtifactBody: PostUploadArtifactBody, + options?: SecondParameter,) => { + + + return customInstance( + {url: `/upload-artifact`, method: 'POST', + headers: {'Content-Type': 'application/json', }, data: postUploadArtifactBody }, - options); -} - + options); + } + export const getPostUploadArtifactMutationOptions = (options?: { mutation?: UseMutationOptions>, TError, { data: PostUploadArtifactBody }, TContext>, request?: SecondParameter } - ): UseMutationOptions>, TError, { data: PostUploadArtifactBody }, TContext> => { - const { mutation: mutationOptions, request: requestOptions } = options ?? {}; + TContext = unknown>(options?: { mutation?:UseMutationOptions>, TError,{data: PostUploadArtifactBody}, TContext>, request?: SecondParameter} +): UseMutationOptions>, TError,{data: PostUploadArtifactBody}, TContext> => { +const {mutation: mutationOptions, request: requestOptions} = options ?? {}; + + const mutationFn: MutationFunction>, {data: PostUploadArtifactBody}> = (props) => { + const {data} = props ?? {}; - const mutationFn: MutationFunction>, { data: PostUploadArtifactBody }> = (props) => { - const { data } = props ?? {}; + return postUploadArtifact(data,requestOptions) + } - return postUploadArtifact(data, requestOptions) - } + + return { mutationFn, ...mutationOptions }} + export type PostUploadArtifactMutationResult = NonNullable>> + export type PostUploadArtifactMutationBody = PostUploadArtifactBody + export type PostUploadArtifactMutationError = void - return { mutationFn, ...mutationOptions } -} - -export type PostUploadArtifactMutationResult = NonNullable>> -export type PostUploadArtifactMutationBody = PostUploadArtifactBody -export type PostUploadArtifactMutationError = void - -/** -* @summary Receive artifacts (output files) from the ComfyUI GitHub Action -*/ + /** + * @summary Receive artifacts (output files) from the ComfyUI GitHub Action + */ export const usePostUploadArtifact = (options?: { mutation?: UseMutationOptions>, TError, { data: PostUploadArtifactBody }, TContext>, request?: SecondParameter } - ) => { + TContext = unknown>(options?: { mutation?:UseMutationOptions>, TError,{data: PostUploadArtifactBody}, TContext>, request?: SecondParameter} +): UseMutationResult< + Awaited>, + TError, + {data: PostUploadArtifactBody}, + TContext + > => { - const mutationOptions = getPostUploadArtifactMutationOptions(options); - - return useMutation(mutationOptions); -} + const mutationOptions = getPostUploadArtifactMutationOptions(options); + return useMutation(mutationOptions); + } + /** * @summary Get information about the calling user. */ export const getUser = ( - - options?: SecondParameter, signal?: AbortSignal + + options?: SecondParameter,signal?: AbortSignal ) => { - - - return customInstance( - { - url: `/users`, method: 'GET', signal + + + return customInstance( + {url: `/users`, method: 'GET', signal }, - options); -} - + options); + } + export const getGetUserQueryKey = () => { - return [`/users`] as const; -} + return [`/users`] as const; + } - -export const getGetUserQueryOptions = >, TError = void>(options?: { query?: Partial>, TError, TData>>, request?: SecondParameter } + +export const getGetUserQueryOptions = >, TError = void>( options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} ) => { - const { query: queryOptions, request: requestOptions } = options ?? {}; - - const queryKey = queryOptions?.queryKey ?? getGetUserQueryKey(); - - +const {query: queryOptions, request: requestOptions} = options ?? {}; - const queryFn: QueryFunction>> = ({ signal }) => getUser(requestOptions, signal); + const queryKey = queryOptions?.queryKey ?? getGetUserQueryKey(); + + const queryFn: QueryFunction>> = ({ signal }) => getUser(requestOptions, signal); + + - return { queryKey, queryFn, ...queryOptions } as UseQueryOptions>, TError, TData> & { queryKey: QueryKey } + return { queryKey, queryFn, ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: QueryKey } } export type GetUserQueryResult = NonNullable>> @@ -2572,15 +2713,15 @@ export type GetUserQueryError = void * @summary Get information about the calling user. */ export const useGetUser = >, TError = void>( - options?: { query?: Partial>, TError, TData>>, request?: SecondParameter } + options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} -): UseQueryResult & { queryKey: QueryKey } => { + ): UseQueryResult & { queryKey: QueryKey } => { const queryOptions = getGetUserQueryOptions(options) - const query = useQuery(queryOptions) as UseQueryResult & { queryKey: QueryKey }; + const query = useQuery(queryOptions) as UseQueryResult & { queryKey: QueryKey }; - query.queryKey = queryOptions.queryKey; + query.queryKey = queryOptions.queryKey ; return query; } @@ -2592,40 +2733,39 @@ export const useGetUser = >, TError = * @summary Retrieve all publishers for a given user */ export const listPublishersForUser = ( - - options?: SecondParameter, signal?: AbortSignal + + options?: SecondParameter,signal?: AbortSignal ) => { - - - return customInstance( - { - url: `/users/publishers/`, method: 'GET', signal + + + return customInstance( + {url: `/users/publishers/`, method: 'GET', signal }, - options); -} - + options); + } + export const getListPublishersForUserQueryKey = () => { - return [`/users/publishers/`] as const; -} + return [`/users/publishers/`] as const; + } - -export const getListPublishersForUserQueryOptions = >, TError = ErrorResponse>(options?: { query?: Partial>, TError, TData>>, request?: SecondParameter } + +export const getListPublishersForUserQueryOptions = >, TError = ErrorResponse>( options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} ) => { - const { query: queryOptions, request: requestOptions } = options ?? {}; - - const queryKey = queryOptions?.queryKey ?? getListPublishersForUserQueryKey(); +const {query: queryOptions, request: requestOptions} = options ?? {}; + const queryKey = queryOptions?.queryKey ?? getListPublishersForUserQueryKey(); + - const queryFn: QueryFunction>> = ({ signal }) => listPublishersForUser(requestOptions, signal); + const queryFn: QueryFunction>> = ({ signal }) => listPublishersForUser(requestOptions, signal); + + - - - return { queryKey, queryFn, ...queryOptions } as UseQueryOptions>, TError, TData> & { queryKey: QueryKey } + return { queryKey, queryFn, ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: QueryKey } } export type ListPublishersForUserQueryResult = NonNullable>> @@ -2635,15 +2775,15 @@ export type ListPublishersForUserQueryError = ErrorResponse * @summary Retrieve all publishers for a given user */ export const useListPublishersForUser = >, TError = ErrorResponse>( - options?: { query?: Partial>, TError, TData>>, request?: SecondParameter } + options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} -): UseQueryResult & { queryKey: QueryKey } => { + ): UseQueryResult & { queryKey: QueryKey } => { const queryOptions = getListPublishersForUserQueryOptions(options) - const query = useQuery(queryOptions) as UseQueryResult & { queryKey: QueryKey }; + const query = useQuery(queryOptions) as UseQueryResult & { queryKey: QueryKey }; - query.queryKey = queryOptions.queryKey; + query.queryKey = queryOptions.queryKey ; return query; } @@ -2655,41 +2795,40 @@ export const useListPublishersForUser = , signal?: AbortSignal + params?: ListAllNodeVersionsParams, + options?: SecondParameter,signal?: AbortSignal ) => { - - - return customInstance( - { - url: `/versions`, method: 'GET', - params, signal + + + return customInstance( + {url: `/versions`, method: 'GET', + params, signal }, - options); -} - + options); + } + export const getListAllNodeVersionsQueryKey = (params?: ListAllNodeVersionsParams,) => { - return [`/versions`, ...(params ? [params] : [])] as const; -} - + return [`/versions`, ...(params ? [params]: [])] as const; + } -export const getListAllNodeVersionsQueryOptions = >, TError = ErrorResponse>(params?: ListAllNodeVersionsParams, options?: { query?: Partial>, TError, TData>>, request?: SecondParameter } + +export const getListAllNodeVersionsQueryOptions = >, TError = ErrorResponse>(params?: ListAllNodeVersionsParams, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} ) => { - const { query: queryOptions, request: requestOptions } = options ?? {}; +const {query: queryOptions, request: requestOptions} = options ?? {}; - const queryKey = queryOptions?.queryKey ?? getListAllNodeVersionsQueryKey(params); + const queryKey = queryOptions?.queryKey ?? getListAllNodeVersionsQueryKey(params); + + const queryFn: QueryFunction>> = ({ signal }) => listAllNodeVersions(params, requestOptions, signal); - const queryFn: QueryFunction>> = ({ signal }) => listAllNodeVersions(params, requestOptions, signal); + + - - - - return { queryKey, queryFn, ...queryOptions } as UseQueryOptions>, TError, TData> & { queryKey: QueryKey } + return { queryKey, queryFn, ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: QueryKey } } export type ListAllNodeVersionsQueryResult = NonNullable>> @@ -2699,15 +2838,15 @@ export type ListAllNodeVersionsQueryError = ErrorResponse * @summary List all node versions given some filters. */ export const useListAllNodeVersions = >, TError = ErrorResponse>( - params?: ListAllNodeVersionsParams, options?: { query?: Partial>, TError, TData>>, request?: SecondParameter } + params?: ListAllNodeVersionsParams, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} -): UseQueryResult & { queryKey: QueryKey } => { + ): UseQueryResult & { queryKey: QueryKey } => { - const queryOptions = getListAllNodeVersionsQueryOptions(params, options) + const queryOptions = getListAllNodeVersionsQueryOptions(params,options) - const query = useQuery(queryOptions) as UseQueryResult & { queryKey: QueryKey }; + const query = useQuery(queryOptions) as UseQueryResult & { queryKey: QueryKey }; - query.queryKey = queryOptions.queryKey; + query.queryKey = queryOptions.queryKey ; return query; } @@ -2719,40 +2858,39 @@ export const useListAllNodeVersions = , signal?: AbortSignal + workflowResultId: string, + options?: SecondParameter,signal?: AbortSignal ) => { - - - return customInstance( - { - url: `/workflowresult/${workflowResultId}`, method: 'GET', signal + + + return customInstance( + {url: `/workflowresult/${workflowResultId}`, method: 'GET', signal }, - options); -} - + options); + } + export const getGetWorkflowResultQueryKey = (workflowResultId: string,) => { - return [`/workflowresult/${workflowResultId}`] as const; -} + return [`/workflowresult/${workflowResultId}`] as const; + } - -export const getGetWorkflowResultQueryOptions = >, TError = ErrorResponse>(workflowResultId: string, options?: { query?: Partial>, TError, TData>>, request?: SecondParameter } + +export const getGetWorkflowResultQueryOptions = >, TError = ErrorResponse>(workflowResultId: string, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} ) => { - const { query: queryOptions, request: requestOptions } = options ?? {}; - - const queryKey = queryOptions?.queryKey ?? getGetWorkflowResultQueryKey(workflowResultId); - - +const {query: queryOptions, request: requestOptions} = options ?? {}; - const queryFn: QueryFunction>> = ({ signal }) => getWorkflowResult(workflowResultId, requestOptions, signal); + const queryKey = queryOptions?.queryKey ?? getGetWorkflowResultQueryKey(workflowResultId); + + const queryFn: QueryFunction>> = ({ signal }) => getWorkflowResult(workflowResultId, requestOptions, signal); + + - return { queryKey, queryFn, enabled: !!(workflowResultId), ...queryOptions } as UseQueryOptions>, TError, TData> & { queryKey: QueryKey } + return { queryKey, queryFn, enabled: !!(workflowResultId), ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: QueryKey } } export type GetWorkflowResultQueryResult = NonNullable>> @@ -2762,15 +2900,19 @@ export type GetWorkflowResultQueryError = ErrorResponse * @summary Retrieve a specific commit by ID */ export const useGetWorkflowResult = >, TError = ErrorResponse>( - workflowResultId: string, options?: { query?: Partial>, TError, TData>>, request?: SecondParameter } + workflowResultId: string, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} -): UseQueryResult & { queryKey: QueryKey } => { + ): UseQueryResult & { queryKey: QueryKey } => { - const queryOptions = getGetWorkflowResultQueryOptions(workflowResultId, options) + const queryOptions = getGetWorkflowResultQueryOptions(workflowResultId,options) - const query = useQuery(queryOptions) as UseQueryResult & { queryKey: QueryKey }; + const query = useQuery(queryOptions) as UseQueryResult & { queryKey: QueryKey }; - query.queryKey = queryOptions.queryKey; + query.queryKey = queryOptions.queryKey ; return query; } + + + +