@omerikanec/api-client-demo 2.0.3 → 2.0.4
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/dist/{api.schemas.ts → api.schemas.d.ts} +2 -3
- package/dist/api.schemas.js +1 -0
- package/dist/auth/auth.d.ts +82 -0
- package/dist/auth/auth.js +71 -0
- package/dist/breed/breed.d.ts +147 -0
- package/dist/breed/breed.js +148 -0
- package/dist/club-documents/club-documents.d.ts +76 -0
- package/dist/club-documents/club-documents.js +78 -0
- package/dist/club-stats/club-stats.d.ts +37 -0
- package/dist/club-stats/club-stats.js +40 -0
- package/dist/content-dictionary/content-dictionary.d.ts +119 -0
- package/dist/content-dictionary/content-dictionary.js +116 -0
- package/dist/dog-references/dog-references.d.ts +360 -0
- package/dist/dog-references/dog-references.js +358 -0
- package/dist/dogs/dogs.d.ts +351 -0
- package/dist/dogs/dogs.js +329 -0
- package/dist/event-reports/event-reports.d.ts +76 -0
- package/dist/event-reports/event-reports.js +78 -0
- package/dist/events/events.d.ts +76 -0
- package/dist/events/events.js +78 -0
- package/dist/galleries/galleries.d.ts +108 -0
- package/dist/galleries/galleries.js +117 -0
- package/dist/home/home.d.ts +37 -0
- package/dist/home/home.js +40 -0
- package/dist/import-breedarchive/import-breedarchive.d.ts +177 -0
- package/dist/import-breedarchive/import-breedarchive.js +140 -0
- package/dist/import-hybrid/import-hybrid.d.ts +134 -0
- package/dist/import-hybrid/import-hybrid.js +107 -0
- package/dist/import-hybrid-full/import-hybrid-full.d.ts +134 -0
- package/dist/import-hybrid-full/import-hybrid-full.js +107 -0
- package/dist/import-zooportal/import-zooportal.d.ts +146 -0
- package/dist/import-zooportal/import-zooportal.js +107 -0
- package/dist/{index.ts → index.d.ts} +0 -1
- package/dist/index.js +31 -0
- package/dist/judges/judges.d.ts +147 -0
- package/dist/judges/judges.js +148 -0
- package/dist/leadership/leadership.d.ts +146 -0
- package/dist/leadership/leadership.js +148 -0
- package/dist/my-achievements/my-achievements.d.ts +87 -0
- package/dist/my-achievements/my-achievements.js +77 -0
- package/dist/my-applications/my-applications.d.ts +290 -0
- package/dist/my-applications/my-applications.js +207 -0
- package/dist/my-dogs/my-dogs.d.ts +329 -0
- package/dist/my-dogs/my-dogs.js +245 -0
- package/dist/my-kennels/my-kennels.d.ts +290 -0
- package/dist/my-kennels/my-kennels.js +207 -0
- package/dist/my-litters/my-litters.d.ts +290 -0
- package/dist/my-litters/my-litters.js +207 -0
- package/dist/news/news.d.ts +76 -0
- package/dist/news/news.js +78 -0
- package/dist/pages/pages.d.ts +76 -0
- package/dist/pages/pages.js +78 -0
- package/dist/profile/profile.d.ts +99 -0
- package/dist/profile/profile.js +72 -0
- package/dist/status-of-import-task/status-of-import-task.d.ts +44 -0
- package/dist/status-of-import-task/status-of-import-task.js +39 -0
- package/package.json +1 -1
- package/dist/.api-sync/incremental-spec.json +0 -71
- package/dist/auth/auth.ts +0 -221
- package/dist/breed/breed.ts +0 -434
- package/dist/club-documents/club-documents.ts +0 -231
- package/dist/club-stats/club-stats.ts +0 -122
- package/dist/content-dictionary/content-dictionary.ts +0 -345
- package/dist/dog-references/dog-references.ts +0 -1043
- package/dist/dogs/dogs.ts +0 -972
- package/dist/event-reports/event-reports.ts +0 -231
- package/dist/events/events.ts +0 -231
- package/dist/galleries/galleries.ts +0 -332
- package/dist/home/home.ts +0 -122
- package/dist/import-breedarchive/import-breedarchive.ts +0 -417
- package/dist/import-hybrid/import-hybrid.ts +0 -320
- package/dist/import-hybrid-full/import-hybrid-full.ts +0 -320
- package/dist/import-zooportal/import-zooportal.ts +0 -335
- package/dist/judges/judges.ts +0 -434
- package/dist/leadership/leadership.ts +0 -433
- package/dist/my-achievements/my-achievements.ts +0 -243
- package/dist/my-applications/my-applications.ts +0 -665
- package/dist/my-dogs/my-dogs.ts +0 -772
- package/dist/my-kennels/my-kennels.ts +0 -665
- package/dist/my-litters/my-litters.ts +0 -665
- package/dist/news/news.ts +0 -231
- package/dist/pages/pages.ts +0 -231
- package/dist/profile/profile.ts +0 -246
- package/dist/status-of-import-task/status-of-import-task.ts +0 -129
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import type { QueryKey, UseQueryOptions, UseQueryResult } from '@tanstack/react-query';
|
|
2
|
+
import type { EventReport, EventReportsListParams, PaginatedEventReportList } from '../api.schemas';
|
|
3
|
+
type AwaitedInput<T> = PromiseLike<T> | T;
|
|
4
|
+
type Awaited<O> = O extends AwaitedInput<infer T> ? T : never;
|
|
5
|
+
/**
|
|
6
|
+
* API отчетов о мероприятиях
|
|
7
|
+
* @summary Список отчётов о мероприятиях
|
|
8
|
+
*/
|
|
9
|
+
export type eventReportsListResponse200 = {
|
|
10
|
+
data: PaginatedEventReportList;
|
|
11
|
+
status: 200;
|
|
12
|
+
};
|
|
13
|
+
export type eventReportsListResponseSuccess = (eventReportsListResponse200) & {
|
|
14
|
+
headers: Headers;
|
|
15
|
+
};
|
|
16
|
+
export type eventReportsListResponse = (eventReportsListResponseSuccess);
|
|
17
|
+
export declare const getEventReportsListUrl: (params?: EventReportsListParams) => string;
|
|
18
|
+
export declare const eventReportsList: (params?: EventReportsListParams, options?: RequestInit) => Promise<eventReportsListResponse>;
|
|
19
|
+
export declare const getEventReportsListQueryKey: (params?: EventReportsListParams) => readonly ["/api/event-reports/", ...EventReportsListParams[]];
|
|
20
|
+
export declare const getEventReportsListQueryOptions: <TData = Awaited<ReturnType<typeof eventReportsList>>, TError = unknown>(params?: EventReportsListParams, options?: {
|
|
21
|
+
query?: UseQueryOptions<Awaited<ReturnType<typeof eventReportsList>>, TError, TData>;
|
|
22
|
+
fetch?: RequestInit;
|
|
23
|
+
}) => UseQueryOptions<Awaited<ReturnType<typeof eventReportsList>>, TError, TData> & {
|
|
24
|
+
queryKey: QueryKey;
|
|
25
|
+
};
|
|
26
|
+
export type EventReportsListQueryResult = NonNullable<Awaited<ReturnType<typeof eventReportsList>>>;
|
|
27
|
+
export type EventReportsListQueryError = unknown;
|
|
28
|
+
/**
|
|
29
|
+
* @summary Список отчётов о мероприятиях
|
|
30
|
+
*/
|
|
31
|
+
export declare function useEventReportsList<TData = Awaited<ReturnType<typeof eventReportsList>>, TError = unknown>(params?: EventReportsListParams, options?: {
|
|
32
|
+
query?: UseQueryOptions<Awaited<ReturnType<typeof eventReportsList>>, TError, TData>;
|
|
33
|
+
fetch?: RequestInit;
|
|
34
|
+
}): UseQueryResult<TData, TError> & {
|
|
35
|
+
queryKey: QueryKey;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* API отчетов о мероприятиях
|
|
39
|
+
* @summary Получить отчёт о мероприятии по ID
|
|
40
|
+
*/
|
|
41
|
+
export type eventReportsRetrieveResponse200 = {
|
|
42
|
+
data: EventReport;
|
|
43
|
+
status: 200;
|
|
44
|
+
};
|
|
45
|
+
export type eventReportsRetrieveResponse404 = {
|
|
46
|
+
data: void;
|
|
47
|
+
status: 404;
|
|
48
|
+
};
|
|
49
|
+
export type eventReportsRetrieveResponseSuccess = (eventReportsRetrieveResponse200) & {
|
|
50
|
+
headers: Headers;
|
|
51
|
+
};
|
|
52
|
+
export type eventReportsRetrieveResponseError = (eventReportsRetrieveResponse404) & {
|
|
53
|
+
headers: Headers;
|
|
54
|
+
};
|
|
55
|
+
export type eventReportsRetrieveResponse = (eventReportsRetrieveResponseSuccess | eventReportsRetrieveResponseError);
|
|
56
|
+
export declare const getEventReportsRetrieveUrl: (id: number) => string;
|
|
57
|
+
export declare const eventReportsRetrieve: (id: number, options?: RequestInit) => Promise<eventReportsRetrieveResponse>;
|
|
58
|
+
export declare const getEventReportsRetrieveQueryKey: (id: number) => readonly [`/api/event-reports/${number}/`];
|
|
59
|
+
export declare const getEventReportsRetrieveQueryOptions: <TData = Awaited<ReturnType<typeof eventReportsRetrieve>>, TError = void>(id: number, options?: {
|
|
60
|
+
query?: UseQueryOptions<Awaited<ReturnType<typeof eventReportsRetrieve>>, TError, TData>;
|
|
61
|
+
fetch?: RequestInit;
|
|
62
|
+
}) => UseQueryOptions<Awaited<ReturnType<typeof eventReportsRetrieve>>, TError, TData> & {
|
|
63
|
+
queryKey: QueryKey;
|
|
64
|
+
};
|
|
65
|
+
export type EventReportsRetrieveQueryResult = NonNullable<Awaited<ReturnType<typeof eventReportsRetrieve>>>;
|
|
66
|
+
export type EventReportsRetrieveQueryError = void;
|
|
67
|
+
/**
|
|
68
|
+
* @summary Получить отчёт о мероприятии по ID
|
|
69
|
+
*/
|
|
70
|
+
export declare function useEventReportsRetrieve<TData = Awaited<ReturnType<typeof eventReportsRetrieve>>, TError = void>(id: number, options?: {
|
|
71
|
+
query?: UseQueryOptions<Awaited<ReturnType<typeof eventReportsRetrieve>>, TError, TData>;
|
|
72
|
+
fetch?: RequestInit;
|
|
73
|
+
}): UseQueryResult<TData, TError> & {
|
|
74
|
+
queryKey: QueryKey;
|
|
75
|
+
};
|
|
76
|
+
export {};
|
|
@@ -0,0 +1,78 @@
|
|
|
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 { useQuery } from '@tanstack/react-query';
|
|
9
|
+
;
|
|
10
|
+
export const getEventReportsListUrl = (params) => {
|
|
11
|
+
const normalizedParams = new URLSearchParams();
|
|
12
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
13
|
+
if (value !== undefined) {
|
|
14
|
+
normalizedParams.append(key, value === null ? 'null' : value.toString());
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
const stringifiedParams = normalizedParams.toString();
|
|
18
|
+
return stringifiedParams.length > 0 ? `/api/event-reports/?${stringifiedParams}` : `/api/event-reports/`;
|
|
19
|
+
};
|
|
20
|
+
export const eventReportsList = async (params, options) => {
|
|
21
|
+
const res = await fetch(getEventReportsListUrl(params), {
|
|
22
|
+
...options,
|
|
23
|
+
method: 'GET'
|
|
24
|
+
});
|
|
25
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
26
|
+
const data = body ? JSON.parse(body) : {};
|
|
27
|
+
return { data, status: res.status, headers: res.headers };
|
|
28
|
+
};
|
|
29
|
+
export const getEventReportsListQueryKey = (params) => {
|
|
30
|
+
return [
|
|
31
|
+
`/api/event-reports/`, ...(params ? [params] : [])
|
|
32
|
+
];
|
|
33
|
+
};
|
|
34
|
+
export const getEventReportsListQueryOptions = (params, options) => {
|
|
35
|
+
const { query: queryOptions, fetch: fetchOptions } = options ?? {};
|
|
36
|
+
const queryKey = queryOptions?.queryKey ?? getEventReportsListQueryKey(params);
|
|
37
|
+
const queryFn = ({ signal }) => eventReportsList(params, { signal, ...fetchOptions });
|
|
38
|
+
return { queryKey, queryFn, ...queryOptions };
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* @summary Список отчётов о мероприятиях
|
|
42
|
+
*/
|
|
43
|
+
export function useEventReportsList(params, options) {
|
|
44
|
+
const queryOptions = getEventReportsListQueryOptions(params, options);
|
|
45
|
+
const query = useQuery(queryOptions);
|
|
46
|
+
return { ...query, queryKey: queryOptions.queryKey };
|
|
47
|
+
}
|
|
48
|
+
export const getEventReportsRetrieveUrl = (id) => {
|
|
49
|
+
return `/api/event-reports/${id}/`;
|
|
50
|
+
};
|
|
51
|
+
export const eventReportsRetrieve = async (id, options) => {
|
|
52
|
+
const res = await fetch(getEventReportsRetrieveUrl(id), {
|
|
53
|
+
...options,
|
|
54
|
+
method: 'GET'
|
|
55
|
+
});
|
|
56
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
57
|
+
const data = body ? JSON.parse(body) : {};
|
|
58
|
+
return { data, status: res.status, headers: res.headers };
|
|
59
|
+
};
|
|
60
|
+
export const getEventReportsRetrieveQueryKey = (id) => {
|
|
61
|
+
return [
|
|
62
|
+
`/api/event-reports/${id}/`
|
|
63
|
+
];
|
|
64
|
+
};
|
|
65
|
+
export const getEventReportsRetrieveQueryOptions = (id, options) => {
|
|
66
|
+
const { query: queryOptions, fetch: fetchOptions } = options ?? {};
|
|
67
|
+
const queryKey = queryOptions?.queryKey ?? getEventReportsRetrieveQueryKey(id);
|
|
68
|
+
const queryFn = ({ signal }) => eventReportsRetrieve(id, { signal, ...fetchOptions });
|
|
69
|
+
return { queryKey, queryFn, enabled: !!(id), ...queryOptions };
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* @summary Получить отчёт о мероприятии по ID
|
|
73
|
+
*/
|
|
74
|
+
export function useEventReportsRetrieve(id, options) {
|
|
75
|
+
const queryOptions = getEventReportsRetrieveQueryOptions(id, options);
|
|
76
|
+
const query = useQuery(queryOptions);
|
|
77
|
+
return { ...query, queryKey: queryOptions.queryKey };
|
|
78
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import type { QueryKey, UseQueryOptions, UseQueryResult } from '@tanstack/react-query';
|
|
2
|
+
import type { Event, EventsListParams, PaginatedEventList } from '../api.schemas';
|
|
3
|
+
type AwaitedInput<T> = PromiseLike<T> | T;
|
|
4
|
+
type Awaited<O> = O extends AwaitedInput<infer T> ? T : never;
|
|
5
|
+
/**
|
|
6
|
+
* Возвращает список мероприятий. Поддерживает фильтрацию по датам и типу.
|
|
7
|
+
* @summary Список мероприятий
|
|
8
|
+
*/
|
|
9
|
+
export type eventsListResponse200 = {
|
|
10
|
+
data: PaginatedEventList;
|
|
11
|
+
status: 200;
|
|
12
|
+
};
|
|
13
|
+
export type eventsListResponseSuccess = (eventsListResponse200) & {
|
|
14
|
+
headers: Headers;
|
|
15
|
+
};
|
|
16
|
+
export type eventsListResponse = (eventsListResponseSuccess);
|
|
17
|
+
export declare const getEventsListUrl: (params?: EventsListParams) => string;
|
|
18
|
+
export declare const eventsList: (params?: EventsListParams, options?: RequestInit) => Promise<eventsListResponse>;
|
|
19
|
+
export declare const getEventsListQueryKey: (params?: EventsListParams) => readonly ["/api/events/", ...EventsListParams[]];
|
|
20
|
+
export declare const getEventsListQueryOptions: <TData = Awaited<ReturnType<typeof eventsList>>, TError = unknown>(params?: EventsListParams, options?: {
|
|
21
|
+
query?: UseQueryOptions<Awaited<ReturnType<typeof eventsList>>, TError, TData>;
|
|
22
|
+
fetch?: RequestInit;
|
|
23
|
+
}) => UseQueryOptions<Awaited<ReturnType<typeof eventsList>>, TError, TData> & {
|
|
24
|
+
queryKey: QueryKey;
|
|
25
|
+
};
|
|
26
|
+
export type EventsListQueryResult = NonNullable<Awaited<ReturnType<typeof eventsList>>>;
|
|
27
|
+
export type EventsListQueryError = unknown;
|
|
28
|
+
/**
|
|
29
|
+
* @summary Список мероприятий
|
|
30
|
+
*/
|
|
31
|
+
export declare function useEventsList<TData = Awaited<ReturnType<typeof eventsList>>, TError = unknown>(params?: EventsListParams, options?: {
|
|
32
|
+
query?: UseQueryOptions<Awaited<ReturnType<typeof eventsList>>, TError, TData>;
|
|
33
|
+
fetch?: RequestInit;
|
|
34
|
+
}): UseQueryResult<TData, TError> & {
|
|
35
|
+
queryKey: QueryKey;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* API мероприятий
|
|
39
|
+
* @summary Получить мероприятие по ID
|
|
40
|
+
*/
|
|
41
|
+
export type eventsRetrieveResponse200 = {
|
|
42
|
+
data: Event;
|
|
43
|
+
status: 200;
|
|
44
|
+
};
|
|
45
|
+
export type eventsRetrieveResponse404 = {
|
|
46
|
+
data: void;
|
|
47
|
+
status: 404;
|
|
48
|
+
};
|
|
49
|
+
export type eventsRetrieveResponseSuccess = (eventsRetrieveResponse200) & {
|
|
50
|
+
headers: Headers;
|
|
51
|
+
};
|
|
52
|
+
export type eventsRetrieveResponseError = (eventsRetrieveResponse404) & {
|
|
53
|
+
headers: Headers;
|
|
54
|
+
};
|
|
55
|
+
export type eventsRetrieveResponse = (eventsRetrieveResponseSuccess | eventsRetrieveResponseError);
|
|
56
|
+
export declare const getEventsRetrieveUrl: (id: number) => string;
|
|
57
|
+
export declare const eventsRetrieve: (id: number, options?: RequestInit) => Promise<eventsRetrieveResponse>;
|
|
58
|
+
export declare const getEventsRetrieveQueryKey: (id: number) => readonly [`/api/events/${number}/`];
|
|
59
|
+
export declare const getEventsRetrieveQueryOptions: <TData = Awaited<ReturnType<typeof eventsRetrieve>>, TError = void>(id: number, options?: {
|
|
60
|
+
query?: UseQueryOptions<Awaited<ReturnType<typeof eventsRetrieve>>, TError, TData>;
|
|
61
|
+
fetch?: RequestInit;
|
|
62
|
+
}) => UseQueryOptions<Awaited<ReturnType<typeof eventsRetrieve>>, TError, TData> & {
|
|
63
|
+
queryKey: QueryKey;
|
|
64
|
+
};
|
|
65
|
+
export type EventsRetrieveQueryResult = NonNullable<Awaited<ReturnType<typeof eventsRetrieve>>>;
|
|
66
|
+
export type EventsRetrieveQueryError = void;
|
|
67
|
+
/**
|
|
68
|
+
* @summary Получить мероприятие по ID
|
|
69
|
+
*/
|
|
70
|
+
export declare function useEventsRetrieve<TData = Awaited<ReturnType<typeof eventsRetrieve>>, TError = void>(id: number, options?: {
|
|
71
|
+
query?: UseQueryOptions<Awaited<ReturnType<typeof eventsRetrieve>>, TError, TData>;
|
|
72
|
+
fetch?: RequestInit;
|
|
73
|
+
}): UseQueryResult<TData, TError> & {
|
|
74
|
+
queryKey: QueryKey;
|
|
75
|
+
};
|
|
76
|
+
export {};
|
|
@@ -0,0 +1,78 @@
|
|
|
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 { useQuery } from '@tanstack/react-query';
|
|
9
|
+
;
|
|
10
|
+
export const getEventsListUrl = (params) => {
|
|
11
|
+
const normalizedParams = new URLSearchParams();
|
|
12
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
13
|
+
if (value !== undefined) {
|
|
14
|
+
normalizedParams.append(key, value === null ? 'null' : value.toString());
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
const stringifiedParams = normalizedParams.toString();
|
|
18
|
+
return stringifiedParams.length > 0 ? `/api/events/?${stringifiedParams}` : `/api/events/`;
|
|
19
|
+
};
|
|
20
|
+
export const eventsList = async (params, options) => {
|
|
21
|
+
const res = await fetch(getEventsListUrl(params), {
|
|
22
|
+
...options,
|
|
23
|
+
method: 'GET'
|
|
24
|
+
});
|
|
25
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
26
|
+
const data = body ? JSON.parse(body) : {};
|
|
27
|
+
return { data, status: res.status, headers: res.headers };
|
|
28
|
+
};
|
|
29
|
+
export const getEventsListQueryKey = (params) => {
|
|
30
|
+
return [
|
|
31
|
+
`/api/events/`, ...(params ? [params] : [])
|
|
32
|
+
];
|
|
33
|
+
};
|
|
34
|
+
export const getEventsListQueryOptions = (params, options) => {
|
|
35
|
+
const { query: queryOptions, fetch: fetchOptions } = options ?? {};
|
|
36
|
+
const queryKey = queryOptions?.queryKey ?? getEventsListQueryKey(params);
|
|
37
|
+
const queryFn = ({ signal }) => eventsList(params, { signal, ...fetchOptions });
|
|
38
|
+
return { queryKey, queryFn, ...queryOptions };
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* @summary Список мероприятий
|
|
42
|
+
*/
|
|
43
|
+
export function useEventsList(params, options) {
|
|
44
|
+
const queryOptions = getEventsListQueryOptions(params, options);
|
|
45
|
+
const query = useQuery(queryOptions);
|
|
46
|
+
return { ...query, queryKey: queryOptions.queryKey };
|
|
47
|
+
}
|
|
48
|
+
export const getEventsRetrieveUrl = (id) => {
|
|
49
|
+
return `/api/events/${id}/`;
|
|
50
|
+
};
|
|
51
|
+
export const eventsRetrieve = async (id, options) => {
|
|
52
|
+
const res = await fetch(getEventsRetrieveUrl(id), {
|
|
53
|
+
...options,
|
|
54
|
+
method: 'GET'
|
|
55
|
+
});
|
|
56
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
57
|
+
const data = body ? JSON.parse(body) : {};
|
|
58
|
+
return { data, status: res.status, headers: res.headers };
|
|
59
|
+
};
|
|
60
|
+
export const getEventsRetrieveQueryKey = (id) => {
|
|
61
|
+
return [
|
|
62
|
+
`/api/events/${id}/`
|
|
63
|
+
];
|
|
64
|
+
};
|
|
65
|
+
export const getEventsRetrieveQueryOptions = (id, options) => {
|
|
66
|
+
const { query: queryOptions, fetch: fetchOptions } = options ?? {};
|
|
67
|
+
const queryKey = queryOptions?.queryKey ?? getEventsRetrieveQueryKey(id);
|
|
68
|
+
const queryFn = ({ signal }) => eventsRetrieve(id, { signal, ...fetchOptions });
|
|
69
|
+
return { queryKey, queryFn, enabled: !!(id), ...queryOptions };
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* @summary Получить мероприятие по ID
|
|
73
|
+
*/
|
|
74
|
+
export function useEventsRetrieve(id, options) {
|
|
75
|
+
const queryOptions = getEventsRetrieveQueryOptions(id, options);
|
|
76
|
+
const query = useQuery(queryOptions);
|
|
77
|
+
return { ...query, queryKey: queryOptions.queryKey };
|
|
78
|
+
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import type { QueryKey, UseQueryOptions, UseQueryResult } from '@tanstack/react-query';
|
|
2
|
+
import type { GalleriesHighlightsListParams, GalleriesListParams, Gallery, PaginatedGalleryList } from '../api.schemas';
|
|
3
|
+
type AwaitedInput<T> = PromiseLike<T> | T;
|
|
4
|
+
type Awaited<O> = O extends AwaitedInput<infer T> ? T : never;
|
|
5
|
+
/**
|
|
6
|
+
* API галерей
|
|
7
|
+
* @summary Список галерей
|
|
8
|
+
*/
|
|
9
|
+
export type galleriesListResponse200 = {
|
|
10
|
+
data: PaginatedGalleryList;
|
|
11
|
+
status: 200;
|
|
12
|
+
};
|
|
13
|
+
export type galleriesListResponseSuccess = (galleriesListResponse200) & {
|
|
14
|
+
headers: Headers;
|
|
15
|
+
};
|
|
16
|
+
export type galleriesListResponse = (galleriesListResponseSuccess);
|
|
17
|
+
export declare const getGalleriesListUrl: (params?: GalleriesListParams) => string;
|
|
18
|
+
export declare const galleriesList: (params?: GalleriesListParams, options?: RequestInit) => Promise<galleriesListResponse>;
|
|
19
|
+
export declare const getGalleriesListQueryKey: (params?: GalleriesListParams) => readonly ["/api/galleries/", ...GalleriesListParams[]];
|
|
20
|
+
export declare const getGalleriesListQueryOptions: <TData = Awaited<ReturnType<typeof galleriesList>>, TError = unknown>(params?: GalleriesListParams, options?: {
|
|
21
|
+
query?: UseQueryOptions<Awaited<ReturnType<typeof galleriesList>>, TError, TData>;
|
|
22
|
+
fetch?: RequestInit;
|
|
23
|
+
}) => UseQueryOptions<Awaited<ReturnType<typeof galleriesList>>, TError, TData> & {
|
|
24
|
+
queryKey: QueryKey;
|
|
25
|
+
};
|
|
26
|
+
export type GalleriesListQueryResult = NonNullable<Awaited<ReturnType<typeof galleriesList>>>;
|
|
27
|
+
export type GalleriesListQueryError = unknown;
|
|
28
|
+
/**
|
|
29
|
+
* @summary Список галерей
|
|
30
|
+
*/
|
|
31
|
+
export declare function useGalleriesList<TData = Awaited<ReturnType<typeof galleriesList>>, TError = unknown>(params?: GalleriesListParams, options?: {
|
|
32
|
+
query?: UseQueryOptions<Awaited<ReturnType<typeof galleriesList>>, TError, TData>;
|
|
33
|
+
fetch?: RequestInit;
|
|
34
|
+
}): UseQueryResult<TData, TError> & {
|
|
35
|
+
queryKey: QueryKey;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* API галерей
|
|
39
|
+
* @summary Получить галерею по ID
|
|
40
|
+
*/
|
|
41
|
+
export type galleriesRetrieveResponse200 = {
|
|
42
|
+
data: Gallery;
|
|
43
|
+
status: 200;
|
|
44
|
+
};
|
|
45
|
+
export type galleriesRetrieveResponse404 = {
|
|
46
|
+
data: void;
|
|
47
|
+
status: 404;
|
|
48
|
+
};
|
|
49
|
+
export type galleriesRetrieveResponseSuccess = (galleriesRetrieveResponse200) & {
|
|
50
|
+
headers: Headers;
|
|
51
|
+
};
|
|
52
|
+
export type galleriesRetrieveResponseError = (galleriesRetrieveResponse404) & {
|
|
53
|
+
headers: Headers;
|
|
54
|
+
};
|
|
55
|
+
export type galleriesRetrieveResponse = (galleriesRetrieveResponseSuccess | galleriesRetrieveResponseError);
|
|
56
|
+
export declare const getGalleriesRetrieveUrl: (id: number) => string;
|
|
57
|
+
export declare const galleriesRetrieve: (id: number, options?: RequestInit) => Promise<galleriesRetrieveResponse>;
|
|
58
|
+
export declare const getGalleriesRetrieveQueryKey: (id: number) => readonly [`/api/galleries/${number}/`];
|
|
59
|
+
export declare const getGalleriesRetrieveQueryOptions: <TData = Awaited<ReturnType<typeof galleriesRetrieve>>, TError = void>(id: number, options?: {
|
|
60
|
+
query?: UseQueryOptions<Awaited<ReturnType<typeof galleriesRetrieve>>, TError, TData>;
|
|
61
|
+
fetch?: RequestInit;
|
|
62
|
+
}) => UseQueryOptions<Awaited<ReturnType<typeof galleriesRetrieve>>, TError, TData> & {
|
|
63
|
+
queryKey: QueryKey;
|
|
64
|
+
};
|
|
65
|
+
export type GalleriesRetrieveQueryResult = NonNullable<Awaited<ReturnType<typeof galleriesRetrieve>>>;
|
|
66
|
+
export type GalleriesRetrieveQueryError = void;
|
|
67
|
+
/**
|
|
68
|
+
* @summary Получить галерею по ID
|
|
69
|
+
*/
|
|
70
|
+
export declare function useGalleriesRetrieve<TData = Awaited<ReturnType<typeof galleriesRetrieve>>, TError = void>(id: number, options?: {
|
|
71
|
+
query?: UseQueryOptions<Awaited<ReturnType<typeof galleriesRetrieve>>, TError, TData>;
|
|
72
|
+
fetch?: RequestInit;
|
|
73
|
+
}): UseQueryResult<TData, TError> & {
|
|
74
|
+
queryKey: QueryKey;
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* Возвращает галереи, отмеченные как избранные (для главной страницы).
|
|
78
|
+
* @summary Избранные галереи
|
|
79
|
+
*/
|
|
80
|
+
export type galleriesHighlightsListResponse200 = {
|
|
81
|
+
data: PaginatedGalleryList;
|
|
82
|
+
status: 200;
|
|
83
|
+
};
|
|
84
|
+
export type galleriesHighlightsListResponseSuccess = (galleriesHighlightsListResponse200) & {
|
|
85
|
+
headers: Headers;
|
|
86
|
+
};
|
|
87
|
+
export type galleriesHighlightsListResponse = (galleriesHighlightsListResponseSuccess);
|
|
88
|
+
export declare const getGalleriesHighlightsListUrl: (params?: GalleriesHighlightsListParams) => string;
|
|
89
|
+
export declare const galleriesHighlightsList: (params?: GalleriesHighlightsListParams, options?: RequestInit) => Promise<galleriesHighlightsListResponse>;
|
|
90
|
+
export declare const getGalleriesHighlightsListQueryKey: (params?: GalleriesHighlightsListParams) => readonly ["/api/galleries/highlights/", ...GalleriesHighlightsListParams[]];
|
|
91
|
+
export declare const getGalleriesHighlightsListQueryOptions: <TData = Awaited<ReturnType<typeof galleriesHighlightsList>>, TError = unknown>(params?: GalleriesHighlightsListParams, options?: {
|
|
92
|
+
query?: UseQueryOptions<Awaited<ReturnType<typeof galleriesHighlightsList>>, TError, TData>;
|
|
93
|
+
fetch?: RequestInit;
|
|
94
|
+
}) => UseQueryOptions<Awaited<ReturnType<typeof galleriesHighlightsList>>, TError, TData> & {
|
|
95
|
+
queryKey: QueryKey;
|
|
96
|
+
};
|
|
97
|
+
export type GalleriesHighlightsListQueryResult = NonNullable<Awaited<ReturnType<typeof galleriesHighlightsList>>>;
|
|
98
|
+
export type GalleriesHighlightsListQueryError = unknown;
|
|
99
|
+
/**
|
|
100
|
+
* @summary Избранные галереи
|
|
101
|
+
*/
|
|
102
|
+
export declare function useGalleriesHighlightsList<TData = Awaited<ReturnType<typeof galleriesHighlightsList>>, TError = unknown>(params?: GalleriesHighlightsListParams, options?: {
|
|
103
|
+
query?: UseQueryOptions<Awaited<ReturnType<typeof galleriesHighlightsList>>, TError, TData>;
|
|
104
|
+
fetch?: RequestInit;
|
|
105
|
+
}): UseQueryResult<TData, TError> & {
|
|
106
|
+
queryKey: QueryKey;
|
|
107
|
+
};
|
|
108
|
+
export {};
|
|
@@ -0,0 +1,117 @@
|
|
|
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 { useQuery } from '@tanstack/react-query';
|
|
9
|
+
;
|
|
10
|
+
export const getGalleriesListUrl = (params) => {
|
|
11
|
+
const normalizedParams = new URLSearchParams();
|
|
12
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
13
|
+
if (value !== undefined) {
|
|
14
|
+
normalizedParams.append(key, value === null ? 'null' : value.toString());
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
const stringifiedParams = normalizedParams.toString();
|
|
18
|
+
return stringifiedParams.length > 0 ? `/api/galleries/?${stringifiedParams}` : `/api/galleries/`;
|
|
19
|
+
};
|
|
20
|
+
export const galleriesList = async (params, options) => {
|
|
21
|
+
const res = await fetch(getGalleriesListUrl(params), {
|
|
22
|
+
...options,
|
|
23
|
+
method: 'GET'
|
|
24
|
+
});
|
|
25
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
26
|
+
const data = body ? JSON.parse(body) : {};
|
|
27
|
+
return { data, status: res.status, headers: res.headers };
|
|
28
|
+
};
|
|
29
|
+
export const getGalleriesListQueryKey = (params) => {
|
|
30
|
+
return [
|
|
31
|
+
`/api/galleries/`, ...(params ? [params] : [])
|
|
32
|
+
];
|
|
33
|
+
};
|
|
34
|
+
export const getGalleriesListQueryOptions = (params, options) => {
|
|
35
|
+
const { query: queryOptions, fetch: fetchOptions } = options ?? {};
|
|
36
|
+
const queryKey = queryOptions?.queryKey ?? getGalleriesListQueryKey(params);
|
|
37
|
+
const queryFn = ({ signal }) => galleriesList(params, { signal, ...fetchOptions });
|
|
38
|
+
return { queryKey, queryFn, ...queryOptions };
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* @summary Список галерей
|
|
42
|
+
*/
|
|
43
|
+
export function useGalleriesList(params, options) {
|
|
44
|
+
const queryOptions = getGalleriesListQueryOptions(params, options);
|
|
45
|
+
const query = useQuery(queryOptions);
|
|
46
|
+
return { ...query, queryKey: queryOptions.queryKey };
|
|
47
|
+
}
|
|
48
|
+
export const getGalleriesRetrieveUrl = (id) => {
|
|
49
|
+
return `/api/galleries/${id}/`;
|
|
50
|
+
};
|
|
51
|
+
export const galleriesRetrieve = async (id, options) => {
|
|
52
|
+
const res = await fetch(getGalleriesRetrieveUrl(id), {
|
|
53
|
+
...options,
|
|
54
|
+
method: 'GET'
|
|
55
|
+
});
|
|
56
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
57
|
+
const data = body ? JSON.parse(body) : {};
|
|
58
|
+
return { data, status: res.status, headers: res.headers };
|
|
59
|
+
};
|
|
60
|
+
export const getGalleriesRetrieveQueryKey = (id) => {
|
|
61
|
+
return [
|
|
62
|
+
`/api/galleries/${id}/`
|
|
63
|
+
];
|
|
64
|
+
};
|
|
65
|
+
export const getGalleriesRetrieveQueryOptions = (id, options) => {
|
|
66
|
+
const { query: queryOptions, fetch: fetchOptions } = options ?? {};
|
|
67
|
+
const queryKey = queryOptions?.queryKey ?? getGalleriesRetrieveQueryKey(id);
|
|
68
|
+
const queryFn = ({ signal }) => galleriesRetrieve(id, { signal, ...fetchOptions });
|
|
69
|
+
return { queryKey, queryFn, enabled: !!(id), ...queryOptions };
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* @summary Получить галерею по ID
|
|
73
|
+
*/
|
|
74
|
+
export function useGalleriesRetrieve(id, options) {
|
|
75
|
+
const queryOptions = getGalleriesRetrieveQueryOptions(id, options);
|
|
76
|
+
const query = useQuery(queryOptions);
|
|
77
|
+
return { ...query, queryKey: queryOptions.queryKey };
|
|
78
|
+
}
|
|
79
|
+
;
|
|
80
|
+
export const getGalleriesHighlightsListUrl = (params) => {
|
|
81
|
+
const normalizedParams = new URLSearchParams();
|
|
82
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
83
|
+
if (value !== undefined) {
|
|
84
|
+
normalizedParams.append(key, value === null ? 'null' : value.toString());
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
const stringifiedParams = normalizedParams.toString();
|
|
88
|
+
return stringifiedParams.length > 0 ? `/api/galleries/highlights/?${stringifiedParams}` : `/api/galleries/highlights/`;
|
|
89
|
+
};
|
|
90
|
+
export const galleriesHighlightsList = async (params, options) => {
|
|
91
|
+
const res = await fetch(getGalleriesHighlightsListUrl(params), {
|
|
92
|
+
...options,
|
|
93
|
+
method: 'GET'
|
|
94
|
+
});
|
|
95
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
96
|
+
const data = body ? JSON.parse(body) : {};
|
|
97
|
+
return { data, status: res.status, headers: res.headers };
|
|
98
|
+
};
|
|
99
|
+
export const getGalleriesHighlightsListQueryKey = (params) => {
|
|
100
|
+
return [
|
|
101
|
+
`/api/galleries/highlights/`, ...(params ? [params] : [])
|
|
102
|
+
];
|
|
103
|
+
};
|
|
104
|
+
export const getGalleriesHighlightsListQueryOptions = (params, options) => {
|
|
105
|
+
const { query: queryOptions, fetch: fetchOptions } = options ?? {};
|
|
106
|
+
const queryKey = queryOptions?.queryKey ?? getGalleriesHighlightsListQueryKey(params);
|
|
107
|
+
const queryFn = ({ signal }) => galleriesHighlightsList(params, { signal, ...fetchOptions });
|
|
108
|
+
return { queryKey, queryFn, ...queryOptions };
|
|
109
|
+
};
|
|
110
|
+
/**
|
|
111
|
+
* @summary Избранные галереи
|
|
112
|
+
*/
|
|
113
|
+
export function useGalleriesHighlightsList(params, options) {
|
|
114
|
+
const queryOptions = getGalleriesHighlightsListQueryOptions(params, options);
|
|
115
|
+
const query = useQuery(queryOptions);
|
|
116
|
+
return { ...query, queryKey: queryOptions.queryKey };
|
|
117
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { QueryKey, UseQueryOptions, UseQueryResult } from '@tanstack/react-query';
|
|
2
|
+
import type { ActivityFeedResponse } from '../api.schemas';
|
|
3
|
+
type AwaitedInput<T> = PromiseLike<T> | T;
|
|
4
|
+
type Awaited<O> = O extends AwaitedInput<infer T> ? T : never;
|
|
5
|
+
/**
|
|
6
|
+
* Возвращает последние сообщения из Telegram-канала клуба (кешируется на 1 минуту).
|
|
7
|
+
* @summary Лента активности
|
|
8
|
+
*/
|
|
9
|
+
export type activityFeedRetrieveResponse200 = {
|
|
10
|
+
data: ActivityFeedResponse;
|
|
11
|
+
status: 200;
|
|
12
|
+
};
|
|
13
|
+
export type activityFeedRetrieveResponseSuccess = (activityFeedRetrieveResponse200) & {
|
|
14
|
+
headers: Headers;
|
|
15
|
+
};
|
|
16
|
+
export type activityFeedRetrieveResponse = (activityFeedRetrieveResponseSuccess);
|
|
17
|
+
export declare const getActivityFeedRetrieveUrl: () => string;
|
|
18
|
+
export declare const activityFeedRetrieve: (options?: RequestInit) => Promise<activityFeedRetrieveResponse>;
|
|
19
|
+
export declare const getActivityFeedRetrieveQueryKey: () => readonly ["/api/activity-feed/"];
|
|
20
|
+
export declare const getActivityFeedRetrieveQueryOptions: <TData = Awaited<ReturnType<typeof activityFeedRetrieve>>, TError = unknown>(options?: {
|
|
21
|
+
query?: UseQueryOptions<Awaited<ReturnType<typeof activityFeedRetrieve>>, TError, TData>;
|
|
22
|
+
fetch?: RequestInit;
|
|
23
|
+
}) => UseQueryOptions<Awaited<ReturnType<typeof activityFeedRetrieve>>, TError, TData> & {
|
|
24
|
+
queryKey: QueryKey;
|
|
25
|
+
};
|
|
26
|
+
export type ActivityFeedRetrieveQueryResult = NonNullable<Awaited<ReturnType<typeof activityFeedRetrieve>>>;
|
|
27
|
+
export type ActivityFeedRetrieveQueryError = unknown;
|
|
28
|
+
/**
|
|
29
|
+
* @summary Лента активности
|
|
30
|
+
*/
|
|
31
|
+
export declare function useActivityFeedRetrieve<TData = Awaited<ReturnType<typeof activityFeedRetrieve>>, TError = unknown>(options?: {
|
|
32
|
+
query?: UseQueryOptions<Awaited<ReturnType<typeof activityFeedRetrieve>>, TError, TData>;
|
|
33
|
+
fetch?: RequestInit;
|
|
34
|
+
}): UseQueryResult<TData, TError> & {
|
|
35
|
+
queryKey: QueryKey;
|
|
36
|
+
};
|
|
37
|
+
export {};
|
|
@@ -0,0 +1,40 @@
|
|
|
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 { useQuery } from '@tanstack/react-query';
|
|
9
|
+
;
|
|
10
|
+
export const getActivityFeedRetrieveUrl = () => {
|
|
11
|
+
return `/api/activity-feed/`;
|
|
12
|
+
};
|
|
13
|
+
export const activityFeedRetrieve = async (options) => {
|
|
14
|
+
const res = await fetch(getActivityFeedRetrieveUrl(), {
|
|
15
|
+
...options,
|
|
16
|
+
method: 'GET'
|
|
17
|
+
});
|
|
18
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
19
|
+
const data = body ? JSON.parse(body) : {};
|
|
20
|
+
return { data, status: res.status, headers: res.headers };
|
|
21
|
+
};
|
|
22
|
+
export const getActivityFeedRetrieveQueryKey = () => {
|
|
23
|
+
return [
|
|
24
|
+
`/api/activity-feed/`
|
|
25
|
+
];
|
|
26
|
+
};
|
|
27
|
+
export const getActivityFeedRetrieveQueryOptions = (options) => {
|
|
28
|
+
const { query: queryOptions, fetch: fetchOptions } = options ?? {};
|
|
29
|
+
const queryKey = queryOptions?.queryKey ?? getActivityFeedRetrieveQueryKey();
|
|
30
|
+
const queryFn = ({ signal }) => activityFeedRetrieve({ signal, ...fetchOptions });
|
|
31
|
+
return { queryKey, queryFn, ...queryOptions };
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* @summary Лента активности
|
|
35
|
+
*/
|
|
36
|
+
export function useActivityFeedRetrieve(options) {
|
|
37
|
+
const queryOptions = getActivityFeedRetrieveQueryOptions(options);
|
|
38
|
+
const query = useQuery(queryOptions);
|
|
39
|
+
return { ...query, queryKey: queryOptions.queryKey };
|
|
40
|
+
}
|