Skip to content

Commit e988ec6

Browse files
Merge branch 'develop' of https://github.com/Coflnet/hypixel-react into develop
2 parents 99d7199 + f2a4ca5 commit e988ec6

File tree

10 files changed

+542
-40
lines changed

10 files changed

+542
-40
lines changed

api/_generated/skyApi.schemas.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -578,6 +578,7 @@ export interface DescriptionSetting {
578578
replaceWhiteWith: string | null;
579579
noCookie: boolean;
580580
buyOrderPrices: boolean;
581+
disableAuctionStartedTime: boolean;
581582
/** @nullable */
582583
fields?: DescriptionField[][] | null;
583584
highlightInfo?: HighlightInfo;
@@ -2844,6 +2845,12 @@ export type GetApiBazaarItemTagSnapshotParams = {
28442845
timestamp?: string;
28452846
};
28462847

2848+
export type GetApiBazaarItemTagExportParams = {
2849+
start?: string;
2850+
end?: string;
2851+
fullOrderBook?: boolean;
2852+
};
2853+
28472854
export type GetApiCraftProfitParams = {
28482855
player?: string;
28492856
profile?: string;

api/_generated/skyApi.ts

Lines changed: 54 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -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

24942508
const {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

app/wiki/docs/api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ Get the lowest bin (Buy It Now) auctions for an item.
200200

201201
**Example cURL:**
202202
```bash
203-
curl -X GET "https://sky.coflnet.com/api/auctions/tag/GOLD_BLOCK/active/bin?limit=10"
203+
curl -X GET "https://sky.coflnet.com/api/auctions/tag/HYPERION/active/bin"
204204
```
205205

206206
**Example Node.js:**
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
.licenseHeader {
2+
display: flex;
3+
align-items: center;
4+
cursor: pointer;
5+
gap: 8px;
6+
font-weight: bold;
7+
margin-bottom: 5px;
8+
user-select: none;
9+
}
10+
11+
.licenseHeader:hover {
12+
color: #007bff;
13+
}
14+
15+
.licenseContent {
16+
padding: 10px;
17+
border: 1px solid #444;
18+
border-radius: 4px;
19+
background-color: rgba(0, 0, 0, 0.2);
20+
font-size: 0.85rem;
21+
margin-bottom: 15px;
22+
}
23+
24+
.tierInfo {
25+
padding: 10px;
26+
border-radius: 4px;
27+
margin-bottom: 15px;
28+
}
29+
30+
.premiumBadge {
31+
display: inline-block;
32+
padding: 2px 8px;
33+
border-radius: 4px;
34+
font-size: 0.85rem;
35+
font-weight: bold;
36+
}
37+
38+
.formGroup {
39+
margin-bottom: 15px;
40+
}
41+
42+
.label {
43+
font-weight: bold;
44+
min-width: 200px;
45+
display: inline-block;
46+
}
47+
48+
.noteText {
49+
font-size: 0.85rem;
50+
color: #aaa;
51+
margin-top: 5px;
52+
}
53+
54+
.checkboxContainer {
55+
margin-bottom: 15px;
56+
}
57+
58+
.checkboxContainer :global(.form-check) {
59+
pointer-events: auto;
60+
}
61+
62+
.checkboxContainer :global(.form-check-input) {
63+
cursor: pointer;
64+
pointer-events: auto;
65+
}
66+
67+
.checkboxContainer :global(.form-check-label) {
68+
cursor: pointer;
69+
pointer-events: auto;
70+
user-select: none;
71+
}
72+
73+
.centerPadded {
74+
text-align: center;
75+
padding: 20px;
76+
}
77+
78+
.actionButtonContainer {
79+
margin-top: 10px;
80+
}
81+
82+
.inlineElement {
83+
display: inline;
84+
}
85+
86+
.modalFooter {
87+
flex-wrap: wrap;
88+
gap: 10px;
89+
}
90+
91+
.footerNote {
92+
width: 100%;
93+
margin-bottom: 10px;
94+
font-size: 0.85rem;
95+
color: #f7f7f7;
96+
}

0 commit comments

Comments
 (0)