@omerikanec/api-client-demo 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +895 -0
- package/dist/api.schemas.ts +1923 -0
- package/dist/auth/auth.ts +221 -0
- package/dist/breed/breed.ts +434 -0
- package/dist/club-documents/club-documents.ts +231 -0
- package/dist/club-stats/club-stats.ts +122 -0
- package/dist/content-dictionary/content-dictionary.ts +345 -0
- package/dist/dog-references/dog-references.ts +1043 -0
- package/dist/dogs/dogs.ts +972 -0
- package/dist/event-reports/event-reports.ts +231 -0
- package/dist/events/events.ts +231 -0
- package/dist/galleries/galleries.ts +332 -0
- package/dist/home/home.ts +216 -0
- package/dist/import-breedarchive/import-breedarchive.ts +417 -0
- package/dist/import-hybrid/import-hybrid.ts +320 -0
- package/dist/import-hybrid-full/import-hybrid-full.ts +320 -0
- package/dist/import-zooportal/import-zooportal.ts +335 -0
- package/dist/index.ts +32 -0
- package/dist/judges/judges.ts +434 -0
- package/dist/leadership/leadership.ts +433 -0
- package/dist/my-achievements/my-achievements.ts +243 -0
- package/dist/my-applications/my-applications.ts +665 -0
- package/dist/my-dogs/my-dogs.ts +772 -0
- package/dist/my-kennels/my-kennels.ts +665 -0
- package/dist/my-litters/my-litters.ts +665 -0
- package/dist/news/news.ts +231 -0
- package/dist/pages/pages.ts +231 -0
- package/dist/profile/profile.ts +246 -0
- package/dist/status-of-import-task/status-of-import-task.ts +129 -0
- package/package.json +37 -0
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by orval v8.5.3 πΊ
|
|
3
|
+
* Do not edit manually.
|
|
4
|
+
* ΠΠΠ Π‘ΠΈΠ±ΠΈΡΡΠΊΠΈΠΉ Π₯Π°ΡΠΊΠΈ API
|
|
5
|
+
* API Π΄Π»Ρ ΠΠ°ΡΠΈΠΎΠ½Π°Π»ΡΠ½ΠΎΠ³ΠΎ ΠΊΠ»ΡΠ±Π° ΠΏΠΎΡΠΎΠ΄Ρ Π‘ΠΈΠ±ΠΈΡΡΠΊΠΈΠΉ Ρ
Π°ΡΠΊΠΈ
|
|
6
|
+
* OpenAPI spec version: 1.0.0
|
|
7
|
+
*/
|
|
8
|
+
import {
|
|
9
|
+
useQuery
|
|
10
|
+
} from '@tanstack/react-query';
|
|
11
|
+
import type {
|
|
12
|
+
QueryFunction,
|
|
13
|
+
QueryKey,
|
|
14
|
+
UseQueryOptions,
|
|
15
|
+
UseQueryResult
|
|
16
|
+
} from '@tanstack/react-query';
|
|
17
|
+
|
|
18
|
+
import type {
|
|
19
|
+
TaskStatusResponse
|
|
20
|
+
} from '../api.schemas';
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
type AwaitedInput<T> = PromiseLike<T> | T;
|
|
24
|
+
|
|
25
|
+
type Awaited<O> = O extends AwaitedInput<infer T> ? T : never;
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* ΠΠΎΠ»ΡΡΠΈΡΡ ΡΡΠ°ΡΡΡ Π²ΡΠΏΠΎΠ»Π½Π΅Π½ΠΈΡ Π·Π°Π΄Π°ΡΠΈ ΠΏΠΎ Π΅Ρ ID.
|
|
32
|
+
* @summary Π‘ΡΠ°ΡΡΡ Π·Π°Π΄Π°ΡΠΈ ΠΈΠΌΠΏΠΎΡΡΠ°
|
|
33
|
+
*/
|
|
34
|
+
export type dogsImportStatusRetrieveResponse200 = {
|
|
35
|
+
data: TaskStatusResponse
|
|
36
|
+
status: 200
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export type dogsImportStatusRetrieveResponse500 = {
|
|
40
|
+
data: void
|
|
41
|
+
status: 500
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export type dogsImportStatusRetrieveResponseSuccess = (dogsImportStatusRetrieveResponse200) & {
|
|
45
|
+
headers: Headers;
|
|
46
|
+
};
|
|
47
|
+
export type dogsImportStatusRetrieveResponseError = (dogsImportStatusRetrieveResponse500) & {
|
|
48
|
+
headers: Headers;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export type dogsImportStatusRetrieveResponse = (dogsImportStatusRetrieveResponseSuccess | dogsImportStatusRetrieveResponseError)
|
|
52
|
+
|
|
53
|
+
export const getDogsImportStatusRetrieveUrl = (taskId: string,) => {
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
return `/api/dogs/import/status/${taskId}/`
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export const dogsImportStatusRetrieve = async (taskId: string, options?: RequestInit): Promise<dogsImportStatusRetrieveResponse> => {
|
|
62
|
+
|
|
63
|
+
const res = await fetch(getDogsImportStatusRetrieveUrl(taskId),
|
|
64
|
+
{
|
|
65
|
+
...options,
|
|
66
|
+
method: 'GET'
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
}
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
73
|
+
|
|
74
|
+
const data: dogsImportStatusRetrieveResponse['data'] = body ? JSON.parse(body) : {}
|
|
75
|
+
return { data, status: res.status, headers: res.headers } as dogsImportStatusRetrieveResponse
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
export const getDogsImportStatusRetrieveQueryKey = (taskId: string,) => {
|
|
83
|
+
return [
|
|
84
|
+
`/api/dogs/import/status/${taskId}/`
|
|
85
|
+
] as const;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
export const getDogsImportStatusRetrieveQueryOptions = <TData = Awaited<ReturnType<typeof dogsImportStatusRetrieve>>, TError = void>(taskId: string, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof dogsImportStatusRetrieve>>, TError, TData>, fetch?: RequestInit}
|
|
90
|
+
) => {
|
|
91
|
+
|
|
92
|
+
const {query: queryOptions, fetch: fetchOptions} = options ?? {};
|
|
93
|
+
|
|
94
|
+
const queryKey = queryOptions?.queryKey ?? getDogsImportStatusRetrieveQueryKey(taskId);
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof dogsImportStatusRetrieve>>> = ({ signal }) => dogsImportStatusRetrieve(taskId, { signal, ...fetchOptions });
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
return { queryKey, queryFn, enabled: !!(taskId), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof dogsImportStatusRetrieve>>, TError, TData> & { queryKey: QueryKey }
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export type DogsImportStatusRetrieveQueryResult = NonNullable<Awaited<ReturnType<typeof dogsImportStatusRetrieve>>>
|
|
108
|
+
export type DogsImportStatusRetrieveQueryError = void
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* @summary Π‘ΡΠ°ΡΡΡ Π·Π°Π΄Π°ΡΠΈ ΠΈΠΌΠΏΠΎΡΡΠ°
|
|
113
|
+
*/
|
|
114
|
+
|
|
115
|
+
export function useDogsImportStatusRetrieve<TData = Awaited<ReturnType<typeof dogsImportStatusRetrieve>>, TError = void>(
|
|
116
|
+
taskId: string, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof dogsImportStatusRetrieve>>, TError, TData>, fetch?: RequestInit}
|
|
117
|
+
|
|
118
|
+
): UseQueryResult<TData, TError> & { queryKey: QueryKey } {
|
|
119
|
+
|
|
120
|
+
const queryOptions = getDogsImportStatusRetrieveQueryOptions(taskId,options)
|
|
121
|
+
|
|
122
|
+
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
|
|
123
|
+
|
|
124
|
+
return { ...query, queryKey: queryOptions.queryKey };
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
|
package/package.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@omerikanec/api-client-demo",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Auto-generated typed API client",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"sideEffects": false,
|
|
8
|
+
"main": "./dist/index.js",
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"import": "./dist/index.js"
|
|
14
|
+
},
|
|
15
|
+
"./*": {
|
|
16
|
+
"types": "./dist/*.d.ts",
|
|
17
|
+
"import": "./dist/*.js"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"dist",
|
|
22
|
+
"impact-report.json",
|
|
23
|
+
"impact-report.html",
|
|
24
|
+
"CHANGELOG.md"
|
|
25
|
+
],
|
|
26
|
+
"publishConfig": {
|
|
27
|
+
"registry": "https://registry.npmjs.org",
|
|
28
|
+
"access": "public"
|
|
29
|
+
},
|
|
30
|
+
"engines": {
|
|
31
|
+
"node": ">=18"
|
|
32
|
+
},
|
|
33
|
+
"peerDependencies": {
|
|
34
|
+
"@tanstack/react-query": ">=4.0.0",
|
|
35
|
+
"react": ">=17.0.0"
|
|
36
|
+
}
|
|
37
|
+
}
|