147 lines
4.6 KiB
TypeScript
147 lines
4.6 KiB
TypeScript
|
|
/**
|
||
|
|
* Generated by orval v8.8.1 🍺
|
||
|
|
* Do not edit manually.
|
||
|
|
* Veza Backend API
|
||
|
|
* Backend API for Veza platform.
|
||
|
|
* OpenAPI spec version: 1.2.0
|
||
|
|
*/
|
||
|
|
import {
|
||
|
|
useQuery
|
||
|
|
} from '@tanstack/react-query';
|
||
|
|
import type {
|
||
|
|
DataTag,
|
||
|
|
DefinedInitialDataOptions,
|
||
|
|
DefinedUseQueryResult,
|
||
|
|
QueryClient,
|
||
|
|
QueryFunction,
|
||
|
|
QueryKey,
|
||
|
|
UndefinedInitialDataOptions,
|
||
|
|
UseQueryOptions,
|
||
|
|
UseQueryResult
|
||
|
|
} from '@tanstack/react-query';
|
||
|
|
|
||
|
|
import type {
|
||
|
|
InternalHandlersWebRTCConfigResponse
|
||
|
|
} from '../model';
|
||
|
|
|
||
|
|
import { vezaMutator } from '../../api/orval-mutator';
|
||
|
|
|
||
|
|
|
||
|
|
type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Public — returns the ICE-server set the SPA feeds to RTCPeerConnection. STUN-only when no TURN is configured. TURN credentials are always emitted as static (REST shared-secret rotation deferred to v1.1).
|
||
|
|
* @summary WebRTC ICE configuration
|
||
|
|
*/
|
||
|
|
export type getConfigWebrtcResponse200 = {
|
||
|
|
data: InternalHandlersWebRTCConfigResponse
|
||
|
|
status: 200
|
||
|
|
}
|
||
|
|
|
||
|
|
export type getConfigWebrtcResponseSuccess = (getConfigWebrtcResponse200) & {
|
||
|
|
headers: Headers;
|
||
|
|
};
|
||
|
|
;
|
||
|
|
|
||
|
|
export type getConfigWebrtcResponse = (getConfigWebrtcResponseSuccess)
|
||
|
|
|
||
|
|
export const getGetConfigWebrtcUrl = () => {
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
return `/config/webrtc`
|
||
|
|
}
|
||
|
|
|
||
|
|
export const getConfigWebrtc = async ( options?: RequestInit): Promise<getConfigWebrtcResponse> => {
|
||
|
|
|
||
|
|
return vezaMutator<getConfigWebrtcResponse>(getGetConfigWebrtcUrl(),
|
||
|
|
{
|
||
|
|
...options,
|
||
|
|
method: 'GET'
|
||
|
|
|
||
|
|
|
||
|
|
}
|
||
|
|
);}
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
export const getGetConfigWebrtcQueryKey = () => {
|
||
|
|
return [
|
||
|
|
`/config/webrtc`
|
||
|
|
] as const;
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
export const getGetConfigWebrtcQueryOptions = <TData = Awaited<ReturnType<typeof getConfigWebrtc>>, TError = unknown>( options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getConfigWebrtc>>, TError, TData>>, request?: SecondParameter<typeof vezaMutator>}
|
||
|
|
) => {
|
||
|
|
|
||
|
|
const {query: queryOptions, request: requestOptions} = options ?? {};
|
||
|
|
|
||
|
|
const queryKey = queryOptions?.queryKey ?? getGetConfigWebrtcQueryKey();
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
const queryFn: QueryFunction<Awaited<ReturnType<typeof getConfigWebrtc>>> = ({ signal }) => getConfigWebrtc({ signal, ...requestOptions });
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getConfigWebrtc>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
|
||
|
|
}
|
||
|
|
|
||
|
|
export type GetConfigWebrtcQueryResult = NonNullable<Awaited<ReturnType<typeof getConfigWebrtc>>>
|
||
|
|
export type GetConfigWebrtcQueryError = unknown
|
||
|
|
|
||
|
|
|
||
|
|
export function useGetConfigWebrtc<TData = Awaited<ReturnType<typeof getConfigWebrtc>>, TError = unknown>(
|
||
|
|
options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getConfigWebrtc>>, TError, TData>> & Pick<
|
||
|
|
DefinedInitialDataOptions<
|
||
|
|
Awaited<ReturnType<typeof getConfigWebrtc>>,
|
||
|
|
TError,
|
||
|
|
Awaited<ReturnType<typeof getConfigWebrtc>>
|
||
|
|
> , 'initialData'
|
||
|
|
>, request?: SecondParameter<typeof vezaMutator>}
|
||
|
|
, queryClient?: QueryClient
|
||
|
|
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
||
|
|
export function useGetConfigWebrtc<TData = Awaited<ReturnType<typeof getConfigWebrtc>>, TError = unknown>(
|
||
|
|
options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getConfigWebrtc>>, TError, TData>> & Pick<
|
||
|
|
UndefinedInitialDataOptions<
|
||
|
|
Awaited<ReturnType<typeof getConfigWebrtc>>,
|
||
|
|
TError,
|
||
|
|
Awaited<ReturnType<typeof getConfigWebrtc>>
|
||
|
|
> , 'initialData'
|
||
|
|
>, request?: SecondParameter<typeof vezaMutator>}
|
||
|
|
, queryClient?: QueryClient
|
||
|
|
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
||
|
|
export function useGetConfigWebrtc<TData = Awaited<ReturnType<typeof getConfigWebrtc>>, TError = unknown>(
|
||
|
|
options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getConfigWebrtc>>, TError, TData>>, request?: SecondParameter<typeof vezaMutator>}
|
||
|
|
, queryClient?: QueryClient
|
||
|
|
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
||
|
|
/**
|
||
|
|
* @summary WebRTC ICE configuration
|
||
|
|
*/
|
||
|
|
|
||
|
|
export function useGetConfigWebrtc<TData = Awaited<ReturnType<typeof getConfigWebrtc>>, TError = unknown>(
|
||
|
|
options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getConfigWebrtc>>, TError, TData>>, request?: SecondParameter<typeof vezaMutator>}
|
||
|
|
, queryClient?: QueryClient
|
||
|
|
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
||
|
|
|
||
|
|
const queryOptions = getGetConfigWebrtcQueryOptions(options)
|
||
|
|
|
||
|
|
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
||
|
|
|
||
|
|
return { ...query, queryKey: queryOptions.queryKey };
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|