@omerikanec/api-client-demo 2.0.3 → 3.0.0
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 +17 -0
- package/dist/api.schemas.d.ts +1809 -0
- package/dist/api.schemas.js +61 -0
- package/dist/auth/auth.d.ts +79 -0
- package/dist/auth/auth.js +71 -0
- package/dist/breed/breed.d.ts +144 -0
- package/dist/breed/breed.js +148 -0
- package/dist/club-documents/club-documents.d.ts +73 -0
- package/dist/club-documents/club-documents.js +78 -0
- package/dist/club-stats/club-stats.d.ts +34 -0
- package/dist/club-stats/club-stats.js +40 -0
- package/dist/content-dictionary/content-dictionary.d.ts +116 -0
- package/dist/content-dictionary/content-dictionary.js +116 -0
- package/dist/dog-references/dog-references.d.ts +357 -0
- package/dist/dog-references/dog-references.js +358 -0
- package/dist/dogs/dogs.d.ts +348 -0
- package/dist/dogs/dogs.js +329 -0
- package/dist/event-reports/event-reports.d.ts +73 -0
- package/dist/event-reports/event-reports.js +78 -0
- package/dist/events/events.d.ts +73 -0
- package/dist/events/events.js +78 -0
- package/dist/galleries/galleries.d.ts +105 -0
- package/dist/galleries/galleries.js +117 -0
- package/dist/home/home.d.ts +34 -0
- package/dist/home/home.js +40 -0
- package/dist/import-breedarchive/import-breedarchive.d.ts +174 -0
- package/dist/import-breedarchive/import-breedarchive.js +140 -0
- package/dist/import-hybrid/import-hybrid.d.ts +131 -0
- package/dist/import-hybrid/import-hybrid.js +107 -0
- package/dist/import-hybrid-full/import-hybrid-full.d.ts +131 -0
- package/dist/import-hybrid-full/import-hybrid-full.js +107 -0
- package/dist/import-zooportal/import-zooportal.d.ts +143 -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 +144 -0
- package/dist/judges/judges.js +148 -0
- package/dist/leadership/leadership.d.ts +143 -0
- package/dist/leadership/leadership.js +148 -0
- package/dist/my-achievements/my-achievements.d.ts +84 -0
- package/dist/my-achievements/my-achievements.js +77 -0
- package/dist/my-applications/my-applications.d.ts +287 -0
- package/dist/my-applications/my-applications.js +207 -0
- package/dist/my-dogs/my-dogs.d.ts +326 -0
- package/dist/my-dogs/my-dogs.js +245 -0
- package/dist/my-kennels/my-kennels.d.ts +287 -0
- package/dist/my-kennels/my-kennels.js +207 -0
- package/dist/my-litters/my-litters.d.ts +287 -0
- package/dist/my-litters/my-litters.js +207 -0
- package/dist/news/news.d.ts +73 -0
- package/dist/news/news.js +78 -0
- package/dist/pages/pages.d.ts +73 -0
- package/dist/pages/pages.js +78 -0
- package/dist/profile/profile.d.ts +96 -0
- package/dist/profile/profile.js +72 -0
- package/dist/status-of-import-task/status-of-import-task.d.ts +41 -0
- package/dist/status-of-import-task/status-of-import-task.js +39 -0
- package/impact-report.html +108 -0
- package/impact-report.json +52 -0
- package/package.json +6 -2
- package/postinstall.js +29 -0
- package/dist/.api-sync/incremental-spec.json +0 -71
- package/dist/api.schemas.ts +0 -12
- 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,73 @@
|
|
|
1
|
+
import type { QueryKey, UseQueryOptions, UseQueryResult } from '@tanstack/react-query';
|
|
2
|
+
import type { Page, PagesListParams, PaginatedPageList } from '../api.schemas';
|
|
3
|
+
/**
|
|
4
|
+
* API CMS страниц
|
|
5
|
+
* @summary Список CMS-страниц
|
|
6
|
+
*/
|
|
7
|
+
export type pagesListResponse200 = {
|
|
8
|
+
data: PaginatedPageList;
|
|
9
|
+
status: 200;
|
|
10
|
+
};
|
|
11
|
+
export type pagesListResponseSuccess = (pagesListResponse200) & {
|
|
12
|
+
headers: Headers;
|
|
13
|
+
};
|
|
14
|
+
export type pagesListResponse = (pagesListResponseSuccess);
|
|
15
|
+
export declare const getPagesListUrl: (params?: PagesListParams) => string;
|
|
16
|
+
export declare const pagesList: (params?: PagesListParams, options?: RequestInit) => Promise<pagesListResponse>;
|
|
17
|
+
export declare const getPagesListQueryKey: (params?: PagesListParams) => readonly ["/api/pages/", ...PagesListParams[]];
|
|
18
|
+
export declare const getPagesListQueryOptions: <TData = Awaited<ReturnType<typeof pagesList>>, TError = unknown>(params?: PagesListParams, options?: {
|
|
19
|
+
query?: UseQueryOptions<Awaited<ReturnType<typeof pagesList>>, TError, TData>;
|
|
20
|
+
fetch?: RequestInit;
|
|
21
|
+
}) => UseQueryOptions<Awaited<ReturnType<typeof pagesList>>, TError, TData> & {
|
|
22
|
+
queryKey: QueryKey;
|
|
23
|
+
};
|
|
24
|
+
export type PagesListQueryResult = NonNullable<Awaited<ReturnType<typeof pagesList>>>;
|
|
25
|
+
export type PagesListQueryError = unknown;
|
|
26
|
+
/**
|
|
27
|
+
* @summary Список CMS-страниц
|
|
28
|
+
*/
|
|
29
|
+
export declare function usePagesList<TData = Awaited<ReturnType<typeof pagesList>>, TError = unknown>(params?: PagesListParams, options?: {
|
|
30
|
+
query?: UseQueryOptions<Awaited<ReturnType<typeof pagesList>>, TError, TData>;
|
|
31
|
+
fetch?: RequestInit;
|
|
32
|
+
}): UseQueryResult<TData, TError> & {
|
|
33
|
+
queryKey: QueryKey;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* API CMS страниц
|
|
37
|
+
* @summary Получить CMS-страницу по slug
|
|
38
|
+
*/
|
|
39
|
+
export type pagesRetrieveResponse200 = {
|
|
40
|
+
data: Page;
|
|
41
|
+
status: 200;
|
|
42
|
+
};
|
|
43
|
+
export type pagesRetrieveResponse404 = {
|
|
44
|
+
data: void;
|
|
45
|
+
status: 404;
|
|
46
|
+
};
|
|
47
|
+
export type pagesRetrieveResponseSuccess = (pagesRetrieveResponse200) & {
|
|
48
|
+
headers: Headers;
|
|
49
|
+
};
|
|
50
|
+
export type pagesRetrieveResponseError = (pagesRetrieveResponse404) & {
|
|
51
|
+
headers: Headers;
|
|
52
|
+
};
|
|
53
|
+
export type pagesRetrieveResponse = (pagesRetrieveResponseSuccess | pagesRetrieveResponseError);
|
|
54
|
+
export declare const getPagesRetrieveUrl: (slug: string) => string;
|
|
55
|
+
export declare const pagesRetrieve: (slug: string, options?: RequestInit) => Promise<pagesRetrieveResponse>;
|
|
56
|
+
export declare const getPagesRetrieveQueryKey: (slug: string) => readonly [`/api/pages/${string}/`];
|
|
57
|
+
export declare const getPagesRetrieveQueryOptions: <TData = Awaited<ReturnType<typeof pagesRetrieve>>, TError = void>(slug: string, options?: {
|
|
58
|
+
query?: UseQueryOptions<Awaited<ReturnType<typeof pagesRetrieve>>, TError, TData>;
|
|
59
|
+
fetch?: RequestInit;
|
|
60
|
+
}) => UseQueryOptions<Awaited<ReturnType<typeof pagesRetrieve>>, TError, TData> & {
|
|
61
|
+
queryKey: QueryKey;
|
|
62
|
+
};
|
|
63
|
+
export type PagesRetrieveQueryResult = NonNullable<Awaited<ReturnType<typeof pagesRetrieve>>>;
|
|
64
|
+
export type PagesRetrieveQueryError = void;
|
|
65
|
+
/**
|
|
66
|
+
* @summary Получить CMS-страницу по slug
|
|
67
|
+
*/
|
|
68
|
+
export declare function usePagesRetrieve<TData = Awaited<ReturnType<typeof pagesRetrieve>>, TError = void>(slug: string, options?: {
|
|
69
|
+
query?: UseQueryOptions<Awaited<ReturnType<typeof pagesRetrieve>>, TError, TData>;
|
|
70
|
+
fetch?: RequestInit;
|
|
71
|
+
}): UseQueryResult<TData, TError> & {
|
|
72
|
+
queryKey: QueryKey;
|
|
73
|
+
};
|
|
@@ -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 getPagesListUrl = (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/pages/?${stringifiedParams}` : `/api/pages/`;
|
|
19
|
+
};
|
|
20
|
+
export const pagesList = async (params, options) => {
|
|
21
|
+
const res = await fetch(getPagesListUrl(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 getPagesListQueryKey = (params) => {
|
|
30
|
+
return [
|
|
31
|
+
`/api/pages/`, ...(params ? [params] : [])
|
|
32
|
+
];
|
|
33
|
+
};
|
|
34
|
+
export const getPagesListQueryOptions = (params, options) => {
|
|
35
|
+
const { query: queryOptions, fetch: fetchOptions } = options ?? {};
|
|
36
|
+
const queryKey = queryOptions?.queryKey ?? getPagesListQueryKey(params);
|
|
37
|
+
const queryFn = ({ signal }) => pagesList(params, { signal, ...fetchOptions });
|
|
38
|
+
return { queryKey, queryFn, ...queryOptions };
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* @summary Список CMS-страниц
|
|
42
|
+
*/
|
|
43
|
+
export function usePagesList(params, options) {
|
|
44
|
+
const queryOptions = getPagesListQueryOptions(params, options);
|
|
45
|
+
const query = useQuery(queryOptions);
|
|
46
|
+
return { ...query, queryKey: queryOptions.queryKey };
|
|
47
|
+
}
|
|
48
|
+
export const getPagesRetrieveUrl = (slug) => {
|
|
49
|
+
return `/api/pages/${slug}/`;
|
|
50
|
+
};
|
|
51
|
+
export const pagesRetrieve = async (slug, options) => {
|
|
52
|
+
const res = await fetch(getPagesRetrieveUrl(slug), {
|
|
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 getPagesRetrieveQueryKey = (slug) => {
|
|
61
|
+
return [
|
|
62
|
+
`/api/pages/${slug}/`
|
|
63
|
+
];
|
|
64
|
+
};
|
|
65
|
+
export const getPagesRetrieveQueryOptions = (slug, options) => {
|
|
66
|
+
const { query: queryOptions, fetch: fetchOptions } = options ?? {};
|
|
67
|
+
const queryKey = queryOptions?.queryKey ?? getPagesRetrieveQueryKey(slug);
|
|
68
|
+
const queryFn = ({ signal }) => pagesRetrieve(slug, { signal, ...fetchOptions });
|
|
69
|
+
return { queryKey, queryFn, enabled: !!(slug), ...queryOptions };
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* @summary Получить CMS-страницу по slug
|
|
73
|
+
*/
|
|
74
|
+
export function usePagesRetrieve(slug, options) {
|
|
75
|
+
const queryOptions = getPagesRetrieveQueryOptions(slug, options);
|
|
76
|
+
const query = useQuery(queryOptions);
|
|
77
|
+
return { ...query, queryKey: queryOptions.queryKey };
|
|
78
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import type { QueryKey, UseMutationOptions, UseMutationResult, UseQueryOptions, UseQueryResult } from '@tanstack/react-query';
|
|
2
|
+
import type { UserProfile, UserProfileRequest } from '../api.schemas';
|
|
3
|
+
/**
|
|
4
|
+
* Возвращает профиль текущего авторизованного пользователя.
|
|
5
|
+
* @summary Получить свой профиль
|
|
6
|
+
*/
|
|
7
|
+
export type meRetrieveResponse200 = {
|
|
8
|
+
data: UserProfile;
|
|
9
|
+
status: 200;
|
|
10
|
+
};
|
|
11
|
+
export type meRetrieveResponse401 = {
|
|
12
|
+
data: void;
|
|
13
|
+
status: 401;
|
|
14
|
+
};
|
|
15
|
+
export type meRetrieveResponse404 = {
|
|
16
|
+
data: void;
|
|
17
|
+
status: 404;
|
|
18
|
+
};
|
|
19
|
+
export type meRetrieveResponseSuccess = (meRetrieveResponse200) & {
|
|
20
|
+
headers: Headers;
|
|
21
|
+
};
|
|
22
|
+
export type meRetrieveResponseError = (meRetrieveResponse401 | meRetrieveResponse404) & {
|
|
23
|
+
headers: Headers;
|
|
24
|
+
};
|
|
25
|
+
export type meRetrieveResponse = (meRetrieveResponseSuccess | meRetrieveResponseError);
|
|
26
|
+
export declare const getMeRetrieveUrl: () => string;
|
|
27
|
+
export declare const meRetrieve: (options?: RequestInit) => Promise<meRetrieveResponse>;
|
|
28
|
+
export declare const getMeRetrieveQueryKey: () => readonly ["/api/me/"];
|
|
29
|
+
export declare const getMeRetrieveQueryOptions: <TData = Awaited<ReturnType<typeof meRetrieve>>, TError = void>(options?: {
|
|
30
|
+
query?: UseQueryOptions<Awaited<ReturnType<typeof meRetrieve>>, TError, TData>;
|
|
31
|
+
fetch?: RequestInit;
|
|
32
|
+
}) => UseQueryOptions<Awaited<ReturnType<typeof meRetrieve>>, TError, TData> & {
|
|
33
|
+
queryKey: QueryKey;
|
|
34
|
+
};
|
|
35
|
+
export type MeRetrieveQueryResult = NonNullable<Awaited<ReturnType<typeof meRetrieve>>>;
|
|
36
|
+
export type MeRetrieveQueryError = void;
|
|
37
|
+
/**
|
|
38
|
+
* @summary Получить свой профиль
|
|
39
|
+
*/
|
|
40
|
+
export declare function useMeRetrieve<TData = Awaited<ReturnType<typeof meRetrieve>>, TError = void>(options?: {
|
|
41
|
+
query?: UseQueryOptions<Awaited<ReturnType<typeof meRetrieve>>, TError, TData>;
|
|
42
|
+
fetch?: RequestInit;
|
|
43
|
+
}): UseQueryResult<TData, TError> & {
|
|
44
|
+
queryKey: QueryKey;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Частичное обновление профиля текущего пользователя.
|
|
48
|
+
* @summary Обновить свой профиль
|
|
49
|
+
*/
|
|
50
|
+
export type meProfileUpdateResponse200 = {
|
|
51
|
+
data: UserProfile;
|
|
52
|
+
status: 200;
|
|
53
|
+
};
|
|
54
|
+
export type meProfileUpdateResponse400 = {
|
|
55
|
+
data: void;
|
|
56
|
+
status: 400;
|
|
57
|
+
};
|
|
58
|
+
export type meProfileUpdateResponse401 = {
|
|
59
|
+
data: void;
|
|
60
|
+
status: 401;
|
|
61
|
+
};
|
|
62
|
+
export type meProfileUpdateResponse404 = {
|
|
63
|
+
data: void;
|
|
64
|
+
status: 404;
|
|
65
|
+
};
|
|
66
|
+
export type meProfileUpdateResponseSuccess = (meProfileUpdateResponse200) & {
|
|
67
|
+
headers: Headers;
|
|
68
|
+
};
|
|
69
|
+
export type meProfileUpdateResponseError = (meProfileUpdateResponse400 | meProfileUpdateResponse401 | meProfileUpdateResponse404) & {
|
|
70
|
+
headers: Headers;
|
|
71
|
+
};
|
|
72
|
+
export type meProfileUpdateResponse = (meProfileUpdateResponseSuccess | meProfileUpdateResponseError);
|
|
73
|
+
export declare const getMeProfileUpdateUrl: () => string;
|
|
74
|
+
export declare const meProfileUpdate: (userProfileRequest: UserProfileRequest, options?: RequestInit) => Promise<meProfileUpdateResponse>;
|
|
75
|
+
export declare const getMeProfileUpdateMutationOptions: <TError = void, TContext = unknown>(options?: {
|
|
76
|
+
mutation?: UseMutationOptions<Awaited<ReturnType<typeof meProfileUpdate>>, TError, {
|
|
77
|
+
data: UserProfileRequest;
|
|
78
|
+
}, TContext>;
|
|
79
|
+
fetch?: RequestInit;
|
|
80
|
+
}) => UseMutationOptions<Awaited<ReturnType<typeof meProfileUpdate>>, TError, {
|
|
81
|
+
data: UserProfileRequest;
|
|
82
|
+
}, TContext>;
|
|
83
|
+
export type MeProfileUpdateMutationResult = NonNullable<Awaited<ReturnType<typeof meProfileUpdate>>>;
|
|
84
|
+
export type MeProfileUpdateMutationBody = UserProfileRequest;
|
|
85
|
+
export type MeProfileUpdateMutationError = void;
|
|
86
|
+
/**
|
|
87
|
+
* @summary Обновить свой профиль
|
|
88
|
+
*/
|
|
89
|
+
export declare const useMeProfileUpdate: <TError = void, TContext = unknown>(options?: {
|
|
90
|
+
mutation?: UseMutationOptions<Awaited<ReturnType<typeof meProfileUpdate>>, TError, {
|
|
91
|
+
data: UserProfileRequest;
|
|
92
|
+
}, TContext>;
|
|
93
|
+
fetch?: RequestInit;
|
|
94
|
+
}) => UseMutationResult<Awaited<ReturnType<typeof meProfileUpdate>>, TError, {
|
|
95
|
+
data: UserProfileRequest;
|
|
96
|
+
}, TContext>;
|
|
@@ -0,0 +1,72 @@
|
|
|
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 { useMutation, useQuery } from '@tanstack/react-query';
|
|
9
|
+
export const getMeRetrieveUrl = () => {
|
|
10
|
+
return `/api/me/`;
|
|
11
|
+
};
|
|
12
|
+
export const meRetrieve = async (options) => {
|
|
13
|
+
const res = await fetch(getMeRetrieveUrl(), {
|
|
14
|
+
...options,
|
|
15
|
+
method: 'GET'
|
|
16
|
+
});
|
|
17
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
18
|
+
const data = body ? JSON.parse(body) : {};
|
|
19
|
+
return { data, status: res.status, headers: res.headers };
|
|
20
|
+
};
|
|
21
|
+
export const getMeRetrieveQueryKey = () => {
|
|
22
|
+
return [
|
|
23
|
+
`/api/me/`
|
|
24
|
+
];
|
|
25
|
+
};
|
|
26
|
+
export const getMeRetrieveQueryOptions = (options) => {
|
|
27
|
+
const { query: queryOptions, fetch: fetchOptions } = options ?? {};
|
|
28
|
+
const queryKey = queryOptions?.queryKey ?? getMeRetrieveQueryKey();
|
|
29
|
+
const queryFn = ({ signal }) => meRetrieve({ signal, ...fetchOptions });
|
|
30
|
+
return { queryKey, queryFn, ...queryOptions };
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* @summary Получить свой профиль
|
|
34
|
+
*/
|
|
35
|
+
export function useMeRetrieve(options) {
|
|
36
|
+
const queryOptions = getMeRetrieveQueryOptions(options);
|
|
37
|
+
const query = useQuery(queryOptions);
|
|
38
|
+
return { ...query, queryKey: queryOptions.queryKey };
|
|
39
|
+
}
|
|
40
|
+
export const getMeProfileUpdateUrl = () => {
|
|
41
|
+
return `/api/me/profile/`;
|
|
42
|
+
};
|
|
43
|
+
export const meProfileUpdate = async (userProfileRequest, options) => {
|
|
44
|
+
const res = await fetch(getMeProfileUpdateUrl(), {
|
|
45
|
+
...options,
|
|
46
|
+
method: 'PUT',
|
|
47
|
+
headers: { 'Content-Type': 'application/json', ...options?.headers },
|
|
48
|
+
body: JSON.stringify(userProfileRequest)
|
|
49
|
+
});
|
|
50
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
51
|
+
const data = body ? JSON.parse(body) : {};
|
|
52
|
+
return { data, status: res.status, headers: res.headers };
|
|
53
|
+
};
|
|
54
|
+
export const getMeProfileUpdateMutationOptions = (options) => {
|
|
55
|
+
const mutationKey = ['meProfileUpdate'];
|
|
56
|
+
const { mutation: mutationOptions, fetch: fetchOptions } = options ?
|
|
57
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
58
|
+
options
|
|
59
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
60
|
+
: { mutation: { mutationKey, }, fetch: undefined };
|
|
61
|
+
const mutationFn = (props) => {
|
|
62
|
+
const { data } = props ?? {};
|
|
63
|
+
return meProfileUpdate(data, fetchOptions);
|
|
64
|
+
};
|
|
65
|
+
return { mutationFn, ...mutationOptions };
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* @summary Обновить свой профиль
|
|
69
|
+
*/
|
|
70
|
+
export const useMeProfileUpdate = (options) => {
|
|
71
|
+
return useMutation(getMeProfileUpdateMutationOptions(options));
|
|
72
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { QueryKey, UseQueryOptions, UseQueryResult } from '@tanstack/react-query';
|
|
2
|
+
import type { TaskStatusResponse } from '../api.schemas';
|
|
3
|
+
/**
|
|
4
|
+
* Получить статус выполнения задачи по её ID.
|
|
5
|
+
* @summary Статус задачи импорта
|
|
6
|
+
*/
|
|
7
|
+
export type dogsImportStatusRetrieveResponse200 = {
|
|
8
|
+
data: TaskStatusResponse;
|
|
9
|
+
status: 200;
|
|
10
|
+
};
|
|
11
|
+
export type dogsImportStatusRetrieveResponse500 = {
|
|
12
|
+
data: void;
|
|
13
|
+
status: 500;
|
|
14
|
+
};
|
|
15
|
+
export type dogsImportStatusRetrieveResponseSuccess = (dogsImportStatusRetrieveResponse200) & {
|
|
16
|
+
headers: Headers;
|
|
17
|
+
};
|
|
18
|
+
export type dogsImportStatusRetrieveResponseError = (dogsImportStatusRetrieveResponse500) & {
|
|
19
|
+
headers: Headers;
|
|
20
|
+
};
|
|
21
|
+
export type dogsImportStatusRetrieveResponse = (dogsImportStatusRetrieveResponseSuccess | dogsImportStatusRetrieveResponseError);
|
|
22
|
+
export declare const getDogsImportStatusRetrieveUrl: (taskId: string) => string;
|
|
23
|
+
export declare const dogsImportStatusRetrieve: (taskId: string, options?: RequestInit) => Promise<dogsImportStatusRetrieveResponse>;
|
|
24
|
+
export declare const getDogsImportStatusRetrieveQueryKey: (taskId: string) => readonly [`/api/dogs/import/status/${string}/`];
|
|
25
|
+
export declare const getDogsImportStatusRetrieveQueryOptions: <TData = Awaited<ReturnType<typeof dogsImportStatusRetrieve>>, TError = void>(taskId: string, options?: {
|
|
26
|
+
query?: UseQueryOptions<Awaited<ReturnType<typeof dogsImportStatusRetrieve>>, TError, TData>;
|
|
27
|
+
fetch?: RequestInit;
|
|
28
|
+
}) => UseQueryOptions<Awaited<ReturnType<typeof dogsImportStatusRetrieve>>, TError, TData> & {
|
|
29
|
+
queryKey: QueryKey;
|
|
30
|
+
};
|
|
31
|
+
export type DogsImportStatusRetrieveQueryResult = NonNullable<Awaited<ReturnType<typeof dogsImportStatusRetrieve>>>;
|
|
32
|
+
export type DogsImportStatusRetrieveQueryError = void;
|
|
33
|
+
/**
|
|
34
|
+
* @summary Статус задачи импорта
|
|
35
|
+
*/
|
|
36
|
+
export declare function useDogsImportStatusRetrieve<TData = Awaited<ReturnType<typeof dogsImportStatusRetrieve>>, TError = void>(taskId: string, options?: {
|
|
37
|
+
query?: UseQueryOptions<Awaited<ReturnType<typeof dogsImportStatusRetrieve>>, TError, TData>;
|
|
38
|
+
fetch?: RequestInit;
|
|
39
|
+
}): UseQueryResult<TData, TError> & {
|
|
40
|
+
queryKey: QueryKey;
|
|
41
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
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
|
+
export const getDogsImportStatusRetrieveUrl = (taskId) => {
|
|
10
|
+
return `/api/dogs/import/status/${taskId}/`;
|
|
11
|
+
};
|
|
12
|
+
export const dogsImportStatusRetrieve = async (taskId, options) => {
|
|
13
|
+
const res = await fetch(getDogsImportStatusRetrieveUrl(taskId), {
|
|
14
|
+
...options,
|
|
15
|
+
method: 'GET'
|
|
16
|
+
});
|
|
17
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
18
|
+
const data = body ? JSON.parse(body) : {};
|
|
19
|
+
return { data, status: res.status, headers: res.headers };
|
|
20
|
+
};
|
|
21
|
+
export const getDogsImportStatusRetrieveQueryKey = (taskId) => {
|
|
22
|
+
return [
|
|
23
|
+
`/api/dogs/import/status/${taskId}/`
|
|
24
|
+
];
|
|
25
|
+
};
|
|
26
|
+
export const getDogsImportStatusRetrieveQueryOptions = (taskId, options) => {
|
|
27
|
+
const { query: queryOptions, fetch: fetchOptions } = options ?? {};
|
|
28
|
+
const queryKey = queryOptions?.queryKey ?? getDogsImportStatusRetrieveQueryKey(taskId);
|
|
29
|
+
const queryFn = ({ signal }) => dogsImportStatusRetrieve(taskId, { signal, ...fetchOptions });
|
|
30
|
+
return { queryKey, queryFn, enabled: !!(taskId), ...queryOptions };
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* @summary Статус задачи импорта
|
|
34
|
+
*/
|
|
35
|
+
export function useDogsImportStatusRetrieve(taskId, options) {
|
|
36
|
+
const queryOptions = getDogsImportStatusRetrieveQueryOptions(taskId, options);
|
|
37
|
+
const query = useQuery(queryOptions);
|
|
38
|
+
return { ...query, queryKey: queryOptions.queryKey };
|
|
39
|
+
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<title>API Client Impact Report — Unreleased</title>
|
|
7
|
+
<style>
|
|
8
|
+
:root {
|
|
9
|
+
--bg: #1e1e1e; --fg: #d4d4d4; --border: #333;
|
|
10
|
+
--card: #252526; --accent: #569cd6;
|
|
11
|
+
--red: #f44336; --green: #4caf50; --orange: #ff9800;
|
|
12
|
+
--purple: #c586c0; --blue: #569cd6; --teal: #4ec9b0;
|
|
13
|
+
}
|
|
14
|
+
@media (prefers-color-scheme: light) {
|
|
15
|
+
:root {
|
|
16
|
+
--bg: #fff; --fg: #1e1e1e; --border: #e0e0e0;
|
|
17
|
+
--card: #f5f5f5; --accent: #1976d2;
|
|
18
|
+
--red: #d32f2f; --green: #388e3c; --orange: #f57c00;
|
|
19
|
+
--purple: #7b1fa2; --blue: #1976d2; --teal: #00796b;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
* { box-sizing: border-box; margin: 0; padding: 0; }
|
|
23
|
+
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; color: var(--fg); background: var(--bg); padding: 32px; max-width: 900px; margin: 0 auto; line-height: 1.6; }
|
|
24
|
+
h1 { font-size: 1.6em; margin-bottom: 4px; }
|
|
25
|
+
.meta { color: #888; font-size: 0.9em; margin-bottom: 24px; }
|
|
26
|
+
.badge { display: inline-block; padding: 2px 12px; border-radius: 12px; font-size: 0.75em; font-weight: 700; color: #fff; }
|
|
27
|
+
.stats { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 28px; padding: 16px; background: var(--card); border: 1px solid var(--border); border-radius: 8px; }
|
|
28
|
+
.stat { text-align: center; min-width: 70px; }
|
|
29
|
+
.stat-val { font-size: 1.8em; font-weight: 700; }
|
|
30
|
+
.stat-lbl { font-size: 0.72em; text-transform: uppercase; color: #888; letter-spacing: 0.5px; }
|
|
31
|
+
.section { margin-bottom: 28px; }
|
|
32
|
+
.section-title { font-size: 1.1em; font-weight: 600; margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
|
|
33
|
+
.group { margin-bottom: 12px; }
|
|
34
|
+
.group-name { font-family: 'Fira Code', 'Cascadia Code', monospace; font-size: 0.9em; font-weight: 600; margin-bottom: 4px; padding: 4px 8px; background: var(--card); border-radius: 4px; cursor: pointer; }
|
|
35
|
+
.group-name:hover { opacity: 0.8; }
|
|
36
|
+
.artifact { display: flex; align-items: center; gap: 8px; padding: 4px 12px; margin: 2px 0; border-radius: 4px; font-size: 0.85em; }
|
|
37
|
+
.artifact .name { font-family: 'Fira Code', 'Cascadia Code', monospace; }
|
|
38
|
+
.kind { font-size: 0.7em; padding: 1px 6px; border-radius: 3px; font-weight: 600; text-transform: uppercase; }
|
|
39
|
+
.kind-type { background: rgba(197,134,192,0.15); color: var(--purple); }
|
|
40
|
+
.kind-endpoint { background: rgba(86,156,214,0.15); color: var(--blue); }
|
|
41
|
+
.kind-hook { background: rgba(78,201,176,0.15); color: var(--teal); }
|
|
42
|
+
.change-added { border-left: 3px solid var(--green); }
|
|
43
|
+
.change-removed { border-left: 3px solid var(--red); }
|
|
44
|
+
.change-modified { border-left: 3px solid var(--orange); }
|
|
45
|
+
.change-breaking { border-left: 3px solid var(--red); background: rgba(244,67,54,0.05); }
|
|
46
|
+
.changelog { margin-bottom: 28px; }
|
|
47
|
+
.changelog ul { list-style: none; padding: 0; }
|
|
48
|
+
.changelog li { padding: 3px 0; font-size: 0.88em; }
|
|
49
|
+
.changelog li::before { content: '• '; color: #888; }
|
|
50
|
+
footer { margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--border); font-size: 0.8em; color: #888; }
|
|
51
|
+
</style>
|
|
52
|
+
</head>
|
|
53
|
+
<body>
|
|
54
|
+
<h1>API Client Impact Report <span class="badge" style="background: var(--red);">MAJOR</span></h1>
|
|
55
|
+
<div class="meta">Unreleased — 2026-06-21</div>
|
|
56
|
+
|
|
57
|
+
<div class="stats">
|
|
58
|
+
<div class="stat"><div class="stat-val" style="color: var(--purple);">1</div><div class="stat-lbl">Types</div></div>
|
|
59
|
+
<div class="stat"><div class="stat-val" style="color: var(--blue);">1</div><div class="stat-lbl">Endpoints</div></div>
|
|
60
|
+
<div class="stat"><div class="stat-val" style="color: var(--teal);">1</div><div class="stat-lbl">Hooks</div></div>
|
|
61
|
+
<div class="stat"><div class="stat-val" style="color: var(--green);">0</div><div class="stat-lbl">Added</div></div>
|
|
62
|
+
<div class="stat"><div class="stat-val" style="color: var(--orange);">0</div><div class="stat-lbl">Modified</div></div>
|
|
63
|
+
<div class="stat"><div class="stat-val" style="color: var(--red);">3</div><div class="stat-lbl">Removed / Breaking</div></div>
|
|
64
|
+
</div>
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
<div class="section">
|
|
68
|
+
<div class="section-title" style="color: var(--red);">⚠ Breaking Changes</div>
|
|
69
|
+
<div class="group">
|
|
70
|
+
<div class="group-name">/api/activity-feed/ (3)</div>
|
|
71
|
+
<div>
|
|
72
|
+
<div class="artifact change-breaking">
|
|
73
|
+
<span class="kind kind-hook">hook</span>
|
|
74
|
+
<span class="name">useActivity_feed_retrieve</span>
|
|
75
|
+
</div>
|
|
76
|
+
<div class="artifact change-breaking">
|
|
77
|
+
<span class="kind kind-endpoint">endpoint</span>
|
|
78
|
+
<span class="name">activity_feed_retrieve</span>
|
|
79
|
+
</div>
|
|
80
|
+
<div class="artifact change-breaking">
|
|
81
|
+
<span class="kind kind-type">type</span>
|
|
82
|
+
<span class="name">Activity_feed_retrieveResponse</span>
|
|
83
|
+
</div>
|
|
84
|
+
</div>
|
|
85
|
+
</div>
|
|
86
|
+
</div>
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
<div class="changelog">
|
|
92
|
+
<div class="section-title">Spec Changelog</div>
|
|
93
|
+
<h4 style="margin: 8px 0 4px; color: var(--red); font-size: 0.9em;">Breaking</h4><ul><li>Path removed: /api/activity-feed/</li></ul>
|
|
94
|
+
|
|
95
|
+
</div>
|
|
96
|
+
|
|
97
|
+
<footer>Generated by <strong>api-sync</strong> on 2026-06-21</footer>
|
|
98
|
+
|
|
99
|
+
<script>
|
|
100
|
+
document.querySelectorAll('.group-name').forEach(el => {
|
|
101
|
+
el.addEventListener('click', () => {
|
|
102
|
+
const body = el.nextElementSibling;
|
|
103
|
+
body.style.display = body.style.display === 'none' ? 'block' : 'none';
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
</script>
|
|
107
|
+
</body>
|
|
108
|
+
</html>
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"generatedBy": "api-sync",
|
|
3
|
+
"version": "unknown",
|
|
4
|
+
"date": "2026-06-21",
|
|
5
|
+
"bump": "major",
|
|
6
|
+
"breakingChanges": [
|
|
7
|
+
"Path removed: /api/activity-feed/"
|
|
8
|
+
],
|
|
9
|
+
"nonBreakingChanges": [],
|
|
10
|
+
"frontendImpact": {
|
|
11
|
+
"stats": {
|
|
12
|
+
"totalAffected": 3,
|
|
13
|
+
"typesAffected": 1,
|
|
14
|
+
"endpointsAffected": 1,
|
|
15
|
+
"hooksAffected": 1,
|
|
16
|
+
"added": 0,
|
|
17
|
+
"removed": 0,
|
|
18
|
+
"modified": 0,
|
|
19
|
+
"breaking": 3,
|
|
20
|
+
"deprecated": 0
|
|
21
|
+
},
|
|
22
|
+
"affected": [
|
|
23
|
+
{
|
|
24
|
+
"source": "/api/activity-feed/",
|
|
25
|
+
"name": "useActivity_feed_retrieve",
|
|
26
|
+
"kind": "hook",
|
|
27
|
+
"change": "breaking",
|
|
28
|
+
"reasons": [
|
|
29
|
+
"Path removed: /api/activity-feed/"
|
|
30
|
+
]
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"source": "/api/activity-feed/",
|
|
34
|
+
"name": "activity_feed_retrieve",
|
|
35
|
+
"kind": "endpoint",
|
|
36
|
+
"change": "breaking",
|
|
37
|
+
"reasons": [
|
|
38
|
+
"Path removed: /api/activity-feed/"
|
|
39
|
+
]
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"source": "/api/activity-feed/",
|
|
43
|
+
"name": "Activity_feed_retrieveResponse",
|
|
44
|
+
"kind": "type",
|
|
45
|
+
"change": "breaking",
|
|
46
|
+
"reasons": [
|
|
47
|
+
"Path removed: /api/activity-feed/"
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
]
|
|
51
|
+
}
|
|
52
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@omerikanec/api-client-demo",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "Auto-generated typed API client",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -21,7 +21,8 @@
|
|
|
21
21
|
"dist",
|
|
22
22
|
"impact-report.json",
|
|
23
23
|
"impact-report.html",
|
|
24
|
-
"CHANGELOG.md"
|
|
24
|
+
"CHANGELOG.md",
|
|
25
|
+
"postinstall.js"
|
|
25
26
|
],
|
|
26
27
|
"publishConfig": {
|
|
27
28
|
"registry": "https://registry.npmjs.org",
|
|
@@ -30,6 +31,9 @@
|
|
|
30
31
|
"engines": {
|
|
31
32
|
"node": ">=18"
|
|
32
33
|
},
|
|
34
|
+
"scripts": {
|
|
35
|
+
"postinstall": "node postinstall.js 2>/dev/null || true"
|
|
36
|
+
},
|
|
33
37
|
"peerDependencies": {
|
|
34
38
|
"@tanstack/react-query": ">=4.0.0",
|
|
35
39
|
"react": ">=17.0.0"
|
package/postinstall.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
const path = require('path');
|
|
3
|
+
|
|
4
|
+
try {
|
|
5
|
+
const pkgDir = __dirname;
|
|
6
|
+
const htmlReport = path.join(pkgDir, 'impact-report.html');
|
|
7
|
+
const jsonReport = path.join(pkgDir, 'impact-report.json');
|
|
8
|
+
const changelog = path.join(pkgDir, 'CHANGELOG.md');
|
|
9
|
+
|
|
10
|
+
const lines = [];
|
|
11
|
+
lines.push('');
|
|
12
|
+
lines.push(' ⚠ @omerikanec/api-client-demo@new — BREAKING CHANGES');
|
|
13
|
+
lines.push('');
|
|
14
|
+
lines.push(' 3 frontend artifact(s) affected:');
|
|
15
|
+
lines.push(' ✗ hook: useActivity_feed_retrieve');
|
|
16
|
+
lines.push(' ✗ endpoint: activity_feed_retrieve');
|
|
17
|
+
lines.push(' ✗ type: Activity_feed_retrieveResponse');
|
|
18
|
+
|
|
19
|
+
lines.push('');
|
|
20
|
+
lines.push(' Full details:');
|
|
21
|
+
lines.push(' HTML report : ' + htmlReport);
|
|
22
|
+
lines.push(' JSON report : ' + jsonReport);
|
|
23
|
+
lines.push(' Changelog : ' + changelog);
|
|
24
|
+
lines.push('');
|
|
25
|
+
lines.push(' Open the HTML report in your browser for a visual overview.');
|
|
26
|
+
lines.push('');
|
|
27
|
+
|
|
28
|
+
console.log(lines.join('\n'));
|
|
29
|
+
} catch {}
|