@@ -67,6 +67,7 @@ import type {
6767 GetApiAuctionsTagItemTagArchiveOverviewParams,
6868 GetApiAuctionsTagItemTagRecentOverviewParams,
6969 GetApiAuctionsTagItemTagSoldParams,
70+ GetApiBazaarItemTagExportParams,
7071 GetApiBazaarItemTagHistoryParams,
7172 GetApiBazaarItemTagSnapshotParams,
7273 GetApiCraftProfitParams,
@@ -2443,30 +2444,41 @@ export function useGetApiBazaarItemTagSnapshot<TData = Awaited<ReturnType<typeof
24432444
24442445
24452446/**
2446- * @deprecated
2447+ * @summary Exports detailed item data for a specific item, if there is no start/end specified it will return a compressed file with 20sec increments of the last 2 weeks
2448+ For longer timeframes we only keep 5min increments and return those, optionally with full orderbook for each point.
2449+ Note that this endpoint requires a google id token of an account with prem+ and is subject to strict non distribute and non profit license terms
24472450 */
2448- export type getApiBazaarPlayerPlayerIdOrdersResponse200 = {
2449- data: Offer[]
2451+ export type getApiBazaarItemTagExportResponse200 = {
2452+ data: null
24502453 status: 200
24512454}
24522455
2453- export type getApiBazaarPlayerPlayerIdOrdersResponseComposite = getApiBazaarPlayerPlayerIdOrdersResponse200 ;
2456+ export type getApiBazaarItemTagExportResponseComposite = getApiBazaarItemTagExportResponse200 ;
24542457
2455- export type getApiBazaarPlayerPlayerIdOrdersResponse = getApiBazaarPlayerPlayerIdOrdersResponseComposite & {
2458+ export type getApiBazaarItemTagExportResponse = getApiBazaarItemTagExportResponseComposite & {
24562459 headers: Headers;
24572460}
24582461
2459- export const getGetApiBazaarPlayerPlayerIdOrdersUrl = (playerId: string,) => {
2462+ export const getGetApiBazaarItemTagExportUrl = (itemTag: string,
2463+ params?: GetApiBazaarItemTagExportParams,) => {
2464+ const normalizedParams = new URLSearchParams();
24602465
2466+ Object.entries(params || {}).forEach(([key, value]) => {
2467+
2468+ if (value !== undefined) {
2469+ normalizedParams.append(key, value === null ? 'null' : value.toString())
2470+ }
2471+ });
24612472
2462-
2473+ const stringifiedParams = normalizedParams.toString();
24632474
2464- return `https://sky.coflnet.com/api/bazaar/player/${playerId}/orders `
2475+ return stringifiedParams.length > 0 ? `https://sky.coflnet.com/api/bazaar/${itemTag}/export?${stringifiedParams}` : `https://sky.coflnet.com/api/bazaar/${itemTag}/export `
24652476}
24662477
2467- export const getApiBazaarPlayerPlayerIdOrders = async (playerId: string, options?: RequestInit): Promise<getApiBazaarPlayerPlayerIdOrdersResponse> => {
2478+ export const getApiBazaarItemTagExport = async (itemTag: string,
2479+ params?: GetApiBazaarItemTagExportParams, options?: RequestInit): Promise<getApiBazaarItemTagExportResponse> => {
24682480
2469- const res = await fetch(getGetApiBazaarPlayerPlayerIdOrdersUrl(playerId ),
2481+ const res = await fetch(getGetApiBazaarItemTagExportUrl(itemTag,params ),
24702482 {
24712483 ...options,
24722484 method: 'GET'
@@ -2476,74 +2488,82 @@ export const getApiBazaarPlayerPlayerIdOrders = async (playerId: string, options
24762488)
24772489
24782490 const body = [204, 205, 304].includes(res.status) ? null : await res.text()
2479- const data: getApiBazaarPlayerPlayerIdOrdersResponse ['data'] = body ? JSON.parse(body) : {}
2491+ const data: getApiBazaarItemTagExportResponse ['data'] = body ? JSON.parse(body) : {}
24802492
2481- return { data, status: res.status, headers: res.headers } as getApiBazaarPlayerPlayerIdOrdersResponse
2493+ return { data, status: res.status, headers: res.headers } as getApiBazaarItemTagExportResponse
24822494}
24832495
24842496
24852497
2486- export const getGetApiBazaarPlayerPlayerIdOrdersQueryKey = (playerId?: string,) => {
2487- return [`https://sky.coflnet.com/api/bazaar/player/${playerId}/orders`] as const;
2498+ export const getGetApiBazaarItemTagExportQueryKey = (itemTag?: string,
2499+ params?: GetApiBazaarItemTagExportParams,) => {
2500+ return [`https://sky.coflnet.com/api/bazaar/${itemTag}/export`, ...(params ? [params]: [])] as const;
24882501 }
24892502
24902503
2491- export const getGetApiBazaarPlayerPlayerIdOrdersQueryOptions = <TData = Awaited<ReturnType<typeof getApiBazaarPlayerPlayerIdOrders>>, TError = unknown>(playerId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiBazaarPlayerPlayerIdOrders>>, TError, TData>>, fetch?: RequestInit}
2504+ export const getGetApiBazaarItemTagExportQueryOptions = <TData = Awaited<ReturnType<typeof getApiBazaarItemTagExport>>, TError = unknown>(itemTag: string,
2505+ params?: GetApiBazaarItemTagExportParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiBazaarItemTagExport>>, TError, TData>>, fetch?: RequestInit}
24922506) => {
24932507
24942508const {query: queryOptions, fetch: fetchOptions} = options ?? {};
24952509
2496- const queryKey = queryOptions?.queryKey ?? getGetApiBazaarPlayerPlayerIdOrdersQueryKey(playerId );
2510+ const queryKey = queryOptions?.queryKey ?? getGetApiBazaarItemTagExportQueryKey(itemTag,params );
24972511
24982512
24992513
2500- const queryFn: QueryFunction<Awaited<ReturnType<typeof getApiBazaarPlayerPlayerIdOrders >>> = ({ signal }) => getApiBazaarPlayerPlayerIdOrders(playerId , { signal, ...fetchOptions });
2514+ const queryFn: QueryFunction<Awaited<ReturnType<typeof getApiBazaarItemTagExport >>> = ({ signal }) => getApiBazaarItemTagExport(itemTag,params , { signal, ...fetchOptions });
25012515
25022516
25032517
25042518
25052519
2506- return { queryKey, queryFn, enabled: !!(playerId ), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getApiBazaarPlayerPlayerIdOrders >>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
2520+ return { queryKey, queryFn, enabled: !!(itemTag ), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getApiBazaarItemTagExport >>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
25072521}
25082522
2509- export type GetApiBazaarPlayerPlayerIdOrdersQueryResult = NonNullable<Awaited<ReturnType<typeof getApiBazaarPlayerPlayerIdOrders >>>
2510- export type GetApiBazaarPlayerPlayerIdOrdersQueryError = unknown
2523+ export type GetApiBazaarItemTagExportQueryResult = NonNullable<Awaited<ReturnType<typeof getApiBazaarItemTagExport >>>
2524+ export type GetApiBazaarItemTagExportQueryError = unknown
25112525
25122526
2513- export function useGetApiBazaarPlayerPlayerIdOrders<TData = Awaited<ReturnType<typeof getApiBazaarPlayerPlayerIdOrders>>, TError = unknown>(
2514- playerId: string, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiBazaarPlayerPlayerIdOrders>>, TError, TData>> & Pick<
2527+ export function useGetApiBazaarItemTagExport<TData = Awaited<ReturnType<typeof getApiBazaarItemTagExport>>, TError = unknown>(
2528+ itemTag: string,
2529+ params: undefined | GetApiBazaarItemTagExportParams, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiBazaarItemTagExport>>, TError, TData>> & Pick<
25152530 DefinedInitialDataOptions<
2516- Awaited<ReturnType<typeof getApiBazaarPlayerPlayerIdOrders >>,
2531+ Awaited<ReturnType<typeof getApiBazaarItemTagExport >>,
25172532 TError,
2518- Awaited<ReturnType<typeof getApiBazaarPlayerPlayerIdOrders >>
2533+ Awaited<ReturnType<typeof getApiBazaarItemTagExport >>
25192534 > , 'initialData'
25202535 >, fetch?: RequestInit}
25212536 , queryClient?: QueryClient
25222537 ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
2523- export function useGetApiBazaarPlayerPlayerIdOrders<TData = Awaited<ReturnType<typeof getApiBazaarPlayerPlayerIdOrders>>, TError = unknown>(
2524- playerId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiBazaarPlayerPlayerIdOrders>>, TError, TData>> & Pick<
2538+ export function useGetApiBazaarItemTagExport<TData = Awaited<ReturnType<typeof getApiBazaarItemTagExport>>, TError = unknown>(
2539+ itemTag: string,
2540+ params?: GetApiBazaarItemTagExportParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiBazaarItemTagExport>>, TError, TData>> & Pick<
25252541 UndefinedInitialDataOptions<
2526- Awaited<ReturnType<typeof getApiBazaarPlayerPlayerIdOrders >>,
2542+ Awaited<ReturnType<typeof getApiBazaarItemTagExport >>,
25272543 TError,
2528- Awaited<ReturnType<typeof getApiBazaarPlayerPlayerIdOrders >>
2544+ Awaited<ReturnType<typeof getApiBazaarItemTagExport >>
25292545 > , 'initialData'
25302546 >, fetch?: RequestInit}
25312547 , queryClient?: QueryClient
25322548 ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
2533- export function useGetApiBazaarPlayerPlayerIdOrders<TData = Awaited<ReturnType<typeof getApiBazaarPlayerPlayerIdOrders>>, TError = unknown>(
2534- playerId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiBazaarPlayerPlayerIdOrders>>, TError, TData>>, fetch?: RequestInit}
2549+ export function useGetApiBazaarItemTagExport<TData = Awaited<ReturnType<typeof getApiBazaarItemTagExport>>, TError = unknown>(
2550+ itemTag: string,
2551+ params?: GetApiBazaarItemTagExportParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiBazaarItemTagExport>>, TError, TData>>, fetch?: RequestInit}
25352552 , queryClient?: QueryClient
25362553 ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
25372554/**
2538- * @deprecated
2555+ * @summary Exports detailed item data for a specific item, if there is no start/end specified it will return a compressed file with 20sec increments of the last 2 weeks
2556+ For longer timeframes we only keep 5min increments and return those, optionally with full orderbook for each point.
2557+ Note that this endpoint requires a google id token of an account with prem+ and is subject to strict non distribute and non profit license terms
25392558 */
25402559
2541- export function useGetApiBazaarPlayerPlayerIdOrders<TData = Awaited<ReturnType<typeof getApiBazaarPlayerPlayerIdOrders>>, TError = unknown>(
2542- playerId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiBazaarPlayerPlayerIdOrders>>, TError, TData>>, fetch?: RequestInit}
2560+ export function useGetApiBazaarItemTagExport<TData = Awaited<ReturnType<typeof getApiBazaarItemTagExport>>, TError = unknown>(
2561+ itemTag: string,
2562+ params?: GetApiBazaarItemTagExportParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiBazaarItemTagExport>>, TError, TData>>, fetch?: RequestInit}
25432563 , queryClient?: QueryClient
25442564 ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
25452565
2546- const queryOptions = getGetApiBazaarPlayerPlayerIdOrdersQueryOptions(playerId ,options)
2566+ const queryOptions = getGetApiBazaarItemTagExportQueryOptions(itemTag,params ,options)
25472567
25482568 const query = useQuery(queryOptions , queryClient) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
25492569
0 commit comments