Skip to content

Commit d4fbbbc

Browse files
committed
feat: refresh snapshots
1 parent 1b71339 commit d4fbbbc

File tree

18 files changed

+1956
-0
lines changed

18 files changed

+1956
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
// This file is auto-generated by @hey-api/openapi-ts
2+
3+
import { type Options, getFoo, getBar } from '../sdk.gen';
4+
import { queryOptions } from '@tanstack/angular-query-experimental';
5+
import type { GetFooData, GetBarData } from '../types.gen';
6+
import { client as _heyApiClient } from '../client.gen';
7+
8+
export type QueryKey<TOptions extends Options> = [
9+
Pick<TOptions, 'baseUrl' | 'body' | 'headers' | 'path' | 'query'> & {
10+
_id: string;
11+
_infinite?: boolean;
12+
tags?: ReadonlyArray<string>;
13+
}
14+
];
15+
16+
const createQueryKey = <TOptions extends Options>(id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray<string>): [
17+
QueryKey<TOptions>[0]
18+
] => {
19+
const params: QueryKey<TOptions>[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? _heyApiClient).getConfig().baseUrl } as QueryKey<TOptions>[0];
20+
if (infinite) {
21+
params._infinite = infinite;
22+
}
23+
if (tags) {
24+
params.tags = tags;
25+
}
26+
if (options?.body) {
27+
params.body = options.body;
28+
}
29+
if (options?.headers) {
30+
params.headers = options.headers;
31+
}
32+
if (options?.path) {
33+
params.path = options.path;
34+
}
35+
if (options?.query) {
36+
params.query = options.query;
37+
}
38+
return [
39+
params
40+
];
41+
};
42+
43+
export const getFooQueryKey = (options?: Options<GetFooData>) => createQueryKey('getFoo', options);
44+
45+
export const getFooOptions = (options?: Options<GetFooData>) => {
46+
return queryOptions({
47+
queryFn: async ({ queryKey, signal }) => {
48+
const { data } = await getFoo({
49+
...options,
50+
...queryKey[0],
51+
signal,
52+
throwOnError: true
53+
});
54+
return data;
55+
},
56+
queryKey: getFooQueryKey(options),
57+
meta: {
58+
id: 'getFoo',
59+
method: 'get',
60+
path: '/foo'
61+
}
62+
});
63+
};
64+
65+
export const getBarQueryKey = (options?: Options<GetBarData>) => createQueryKey('getBar', options);
66+
67+
export const getBarOptions = (options?: Options<GetBarData>) => {
68+
return queryOptions({
69+
queryFn: async ({ queryKey, signal }) => {
70+
const { data } = await getBar({
71+
...options,
72+
...queryKey[0],
73+
signal,
74+
throwOnError: true
75+
});
76+
return data;
77+
},
78+
queryKey: getBarQueryKey(options),
79+
meta: {
80+
id: 'getBar',
81+
method: 'get',
82+
path: '/bar'
83+
}
84+
});
85+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
// This file is auto-generated by @hey-api/openapi-ts
2+
3+
import { type Options, getFoo, getBar } from '../sdk.gen';
4+
import { queryOptions } from '@tanstack/react-query';
5+
import type { GetFooData, GetBarData } from '../types.gen';
6+
import { client as _heyApiClient } from '../client.gen';
7+
8+
export type QueryKey<TOptions extends Options> = [
9+
Pick<TOptions, 'baseUrl' | 'body' | 'headers' | 'path' | 'query'> & {
10+
_id: string;
11+
_infinite?: boolean;
12+
tags?: ReadonlyArray<string>;
13+
}
14+
];
15+
16+
const createQueryKey = <TOptions extends Options>(id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray<string>): [
17+
QueryKey<TOptions>[0]
18+
] => {
19+
const params: QueryKey<TOptions>[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? _heyApiClient).getConfig().baseUrl } as QueryKey<TOptions>[0];
20+
if (infinite) {
21+
params._infinite = infinite;
22+
}
23+
if (tags) {
24+
params.tags = tags;
25+
}
26+
if (options?.body) {
27+
params.body = options.body;
28+
}
29+
if (options?.headers) {
30+
params.headers = options.headers;
31+
}
32+
if (options?.path) {
33+
params.path = options.path;
34+
}
35+
if (options?.query) {
36+
params.query = options.query;
37+
}
38+
return [
39+
params
40+
];
41+
};
42+
43+
export const getFooQueryKey = (options?: Options<GetFooData>) => createQueryKey('getFoo', options);
44+
45+
export const getFooOptions = (options?: Options<GetFooData>) => {
46+
return queryOptions({
47+
queryFn: async ({ queryKey, signal }) => {
48+
const { data } = await getFoo({
49+
...options,
50+
...queryKey[0],
51+
signal,
52+
throwOnError: true
53+
});
54+
return data;
55+
},
56+
queryKey: getFooQueryKey(options),
57+
meta: {
58+
id: 'getFoo',
59+
method: 'get',
60+
path: '/foo'
61+
}
62+
});
63+
};
64+
65+
export const getBarQueryKey = (options?: Options<GetBarData>) => createQueryKey('getBar', options);
66+
67+
export const getBarOptions = (options?: Options<GetBarData>) => {
68+
return queryOptions({
69+
queryFn: async ({ queryKey, signal }) => {
70+
const { data } = await getBar({
71+
...options,
72+
...queryKey[0],
73+
signal,
74+
throwOnError: true
75+
});
76+
return data;
77+
},
78+
queryKey: getBarQueryKey(options),
79+
meta: {
80+
id: 'getBar',
81+
method: 'get',
82+
path: '/bar'
83+
}
84+
});
85+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
// This file is auto-generated by @hey-api/openapi-ts
2+
3+
import { type Options, getFoo, getBar } from '../sdk.gen';
4+
import { queryOptions } from '@tanstack/solid-query';
5+
import type { GetFooData, GetBarData } from '../types.gen';
6+
import { client as _heyApiClient } from '../client.gen';
7+
8+
export type QueryKey<TOptions extends Options> = [
9+
Pick<TOptions, 'baseUrl' | 'body' | 'headers' | 'path' | 'query'> & {
10+
_id: string;
11+
_infinite?: boolean;
12+
tags?: ReadonlyArray<string>;
13+
}
14+
];
15+
16+
const createQueryKey = <TOptions extends Options>(id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray<string>): [
17+
QueryKey<TOptions>[0]
18+
] => {
19+
const params: QueryKey<TOptions>[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? _heyApiClient).getConfig().baseUrl } as QueryKey<TOptions>[0];
20+
if (infinite) {
21+
params._infinite = infinite;
22+
}
23+
if (tags) {
24+
params.tags = tags;
25+
}
26+
if (options?.body) {
27+
params.body = options.body;
28+
}
29+
if (options?.headers) {
30+
params.headers = options.headers;
31+
}
32+
if (options?.path) {
33+
params.path = options.path;
34+
}
35+
if (options?.query) {
36+
params.query = options.query;
37+
}
38+
return [
39+
params
40+
];
41+
};
42+
43+
export const getFooQueryKey = (options?: Options<GetFooData>) => createQueryKey('getFoo', options);
44+
45+
export const getFooOptions = (options?: Options<GetFooData>) => {
46+
return queryOptions({
47+
queryFn: async ({ queryKey, signal }) => {
48+
const { data } = await getFoo({
49+
...options,
50+
...queryKey[0],
51+
signal,
52+
throwOnError: true
53+
});
54+
return data;
55+
},
56+
queryKey: getFooQueryKey(options),
57+
meta: {
58+
id: 'getFoo',
59+
method: 'get',
60+
path: '/foo'
61+
}
62+
});
63+
};
64+
65+
export const getBarQueryKey = (options?: Options<GetBarData>) => createQueryKey('getBar', options);
66+
67+
export const getBarOptions = (options?: Options<GetBarData>) => {
68+
return queryOptions({
69+
queryFn: async ({ queryKey, signal }) => {
70+
const { data } = await getBar({
71+
...options,
72+
...queryKey[0],
73+
signal,
74+
throwOnError: true
75+
});
76+
return data;
77+
},
78+
queryKey: getBarQueryKey(options),
79+
meta: {
80+
id: 'getBar',
81+
method: 'get',
82+
path: '/bar'
83+
}
84+
});
85+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
// This file is auto-generated by @hey-api/openapi-ts
2+
3+
import { type Options, getFoo, getBar } from '../sdk.gen';
4+
import { queryOptions } from '@tanstack/svelte-query';
5+
import type { GetFooData, GetBarData } from '../types.gen';
6+
import { client as _heyApiClient } from '../client.gen';
7+
8+
export type QueryKey<TOptions extends Options> = [
9+
Pick<TOptions, 'baseUrl' | 'body' | 'headers' | 'path' | 'query'> & {
10+
_id: string;
11+
_infinite?: boolean;
12+
tags?: ReadonlyArray<string>;
13+
}
14+
];
15+
16+
const createQueryKey = <TOptions extends Options>(id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray<string>): [
17+
QueryKey<TOptions>[0]
18+
] => {
19+
const params: QueryKey<TOptions>[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? _heyApiClient).getConfig().baseUrl } as QueryKey<TOptions>[0];
20+
if (infinite) {
21+
params._infinite = infinite;
22+
}
23+
if (tags) {
24+
params.tags = tags;
25+
}
26+
if (options?.body) {
27+
params.body = options.body;
28+
}
29+
if (options?.headers) {
30+
params.headers = options.headers;
31+
}
32+
if (options?.path) {
33+
params.path = options.path;
34+
}
35+
if (options?.query) {
36+
params.query = options.query;
37+
}
38+
return [
39+
params
40+
];
41+
};
42+
43+
export const getFooQueryKey = (options?: Options<GetFooData>) => createQueryKey('getFoo', options);
44+
45+
export const getFooOptions = (options?: Options<GetFooData>) => {
46+
return queryOptions({
47+
queryFn: async ({ queryKey, signal }) => {
48+
const { data } = await getFoo({
49+
...options,
50+
...queryKey[0],
51+
signal,
52+
throwOnError: true
53+
});
54+
return data;
55+
},
56+
queryKey: getFooQueryKey(options),
57+
meta: {
58+
id: 'getFoo',
59+
method: 'get',
60+
path: '/foo'
61+
}
62+
});
63+
};
64+
65+
export const getBarQueryKey = (options?: Options<GetBarData>) => createQueryKey('getBar', options);
66+
67+
export const getBarOptions = (options?: Options<GetBarData>) => {
68+
return queryOptions({
69+
queryFn: async ({ queryKey, signal }) => {
70+
const { data } = await getBar({
71+
...options,
72+
...queryKey[0],
73+
signal,
74+
throwOnError: true
75+
});
76+
return data;
77+
},
78+
queryKey: getBarQueryKey(options),
79+
meta: {
80+
id: 'getBar',
81+
method: 'get',
82+
path: '/bar'
83+
}
84+
});
85+
};

0 commit comments

Comments
 (0)