@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.
Files changed (89) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/api.schemas.d.ts +1809 -0
  3. package/dist/api.schemas.js +61 -0
  4. package/dist/auth/auth.d.ts +79 -0
  5. package/dist/auth/auth.js +71 -0
  6. package/dist/breed/breed.d.ts +144 -0
  7. package/dist/breed/breed.js +148 -0
  8. package/dist/club-documents/club-documents.d.ts +73 -0
  9. package/dist/club-documents/club-documents.js +78 -0
  10. package/dist/club-stats/club-stats.d.ts +34 -0
  11. package/dist/club-stats/club-stats.js +40 -0
  12. package/dist/content-dictionary/content-dictionary.d.ts +116 -0
  13. package/dist/content-dictionary/content-dictionary.js +116 -0
  14. package/dist/dog-references/dog-references.d.ts +357 -0
  15. package/dist/dog-references/dog-references.js +358 -0
  16. package/dist/dogs/dogs.d.ts +348 -0
  17. package/dist/dogs/dogs.js +329 -0
  18. package/dist/event-reports/event-reports.d.ts +73 -0
  19. package/dist/event-reports/event-reports.js +78 -0
  20. package/dist/events/events.d.ts +73 -0
  21. package/dist/events/events.js +78 -0
  22. package/dist/galleries/galleries.d.ts +105 -0
  23. package/dist/galleries/galleries.js +117 -0
  24. package/dist/home/home.d.ts +34 -0
  25. package/dist/home/home.js +40 -0
  26. package/dist/import-breedarchive/import-breedarchive.d.ts +174 -0
  27. package/dist/import-breedarchive/import-breedarchive.js +140 -0
  28. package/dist/import-hybrid/import-hybrid.d.ts +131 -0
  29. package/dist/import-hybrid/import-hybrid.js +107 -0
  30. package/dist/import-hybrid-full/import-hybrid-full.d.ts +131 -0
  31. package/dist/import-hybrid-full/import-hybrid-full.js +107 -0
  32. package/dist/import-zooportal/import-zooportal.d.ts +143 -0
  33. package/dist/import-zooportal/import-zooportal.js +107 -0
  34. package/dist/{index.ts → index.d.ts} +0 -1
  35. package/dist/index.js +31 -0
  36. package/dist/judges/judges.d.ts +144 -0
  37. package/dist/judges/judges.js +148 -0
  38. package/dist/leadership/leadership.d.ts +143 -0
  39. package/dist/leadership/leadership.js +148 -0
  40. package/dist/my-achievements/my-achievements.d.ts +84 -0
  41. package/dist/my-achievements/my-achievements.js +77 -0
  42. package/dist/my-applications/my-applications.d.ts +287 -0
  43. package/dist/my-applications/my-applications.js +207 -0
  44. package/dist/my-dogs/my-dogs.d.ts +326 -0
  45. package/dist/my-dogs/my-dogs.js +245 -0
  46. package/dist/my-kennels/my-kennels.d.ts +287 -0
  47. package/dist/my-kennels/my-kennels.js +207 -0
  48. package/dist/my-litters/my-litters.d.ts +287 -0
  49. package/dist/my-litters/my-litters.js +207 -0
  50. package/dist/news/news.d.ts +73 -0
  51. package/dist/news/news.js +78 -0
  52. package/dist/pages/pages.d.ts +73 -0
  53. package/dist/pages/pages.js +78 -0
  54. package/dist/profile/profile.d.ts +96 -0
  55. package/dist/profile/profile.js +72 -0
  56. package/dist/status-of-import-task/status-of-import-task.d.ts +41 -0
  57. package/dist/status-of-import-task/status-of-import-task.js +39 -0
  58. package/impact-report.html +108 -0
  59. package/impact-report.json +52 -0
  60. package/package.json +6 -2
  61. package/postinstall.js +29 -0
  62. package/dist/.api-sync/incremental-spec.json +0 -71
  63. package/dist/api.schemas.ts +0 -12
  64. package/dist/auth/auth.ts +0 -221
  65. package/dist/breed/breed.ts +0 -434
  66. package/dist/club-documents/club-documents.ts +0 -231
  67. package/dist/club-stats/club-stats.ts +0 -122
  68. package/dist/content-dictionary/content-dictionary.ts +0 -345
  69. package/dist/dog-references/dog-references.ts +0 -1043
  70. package/dist/dogs/dogs.ts +0 -972
  71. package/dist/event-reports/event-reports.ts +0 -231
  72. package/dist/events/events.ts +0 -231
  73. package/dist/galleries/galleries.ts +0 -332
  74. package/dist/home/home.ts +0 -122
  75. package/dist/import-breedarchive/import-breedarchive.ts +0 -417
  76. package/dist/import-hybrid/import-hybrid.ts +0 -320
  77. package/dist/import-hybrid-full/import-hybrid-full.ts +0 -320
  78. package/dist/import-zooportal/import-zooportal.ts +0 -335
  79. package/dist/judges/judges.ts +0 -434
  80. package/dist/leadership/leadership.ts +0 -433
  81. package/dist/my-achievements/my-achievements.ts +0 -243
  82. package/dist/my-applications/my-applications.ts +0 -665
  83. package/dist/my-dogs/my-dogs.ts +0 -772
  84. package/dist/my-kennels/my-kennels.ts +0 -665
  85. package/dist/my-litters/my-litters.ts +0 -665
  86. package/dist/news/news.ts +0 -231
  87. package/dist/pages/pages.ts +0 -231
  88. package/dist/profile/profile.ts +0 -246
  89. package/dist/status-of-import-task/status-of-import-task.ts +0 -129
@@ -0,0 +1,61 @@
1
+ export const ApplicationTypeEnum = {
2
+ membership: 'membership',
3
+ litter_registration: 'litter_registration',
4
+ kennel_registration: 'kennel_registration',
5
+ document_request: 'document_request',
6
+ complaint: 'complaint',
7
+ other: 'other',
8
+ };
9
+ export const ApplicationStatusEnum = {
10
+ new: 'new',
11
+ in_progress: 'in_progress',
12
+ done: 'done',
13
+ rejected: 'rejected',
14
+ };
15
+ export const BlankEnum = {
16
+ '': '',
17
+ };
18
+ export const CategoryEnum = {
19
+ history: 'history',
20
+ character: 'character',
21
+ care: 'care',
22
+ grooming: 'grooming',
23
+ feeding: 'feeding',
24
+ };
25
+ export const BreedArticleCategory = { ...CategoryEnum, ...BlankEnum, };
26
+ export const DocumentTypeEnum = {
27
+ charter: 'charter',
28
+ regulation: 'regulation',
29
+ standard: 'standard',
30
+ form: 'form',
31
+ };
32
+ export const DogSexEnum = {
33
+ male: 'male',
34
+ female: 'female',
35
+ };
36
+ export const DogSex = { ...DogSexEnum, ...BlankEnum, };
37
+ export const Sex6bbEnum = {
38
+ NUMBER_1: 1,
39
+ NUMBER_2: 2,
40
+ };
41
+ export const DogRequestSex = { ...DogSexEnum, ...BlankEnum, };
42
+ export const EventTypeEnum = {
43
+ exhibition: 'exhibition',
44
+ seminar: 'seminar',
45
+ meeting: 'meeting',
46
+ other: 'other',
47
+ };
48
+ export const EventEventType = { ...EventTypeEnum, ...BlankEnum, };
49
+ export const LitterStatusEnum = {
50
+ announced: 'announced',
51
+ born: 'born',
52
+ sold: 'sold',
53
+ };
54
+ export const MembershipTypeEnum = {
55
+ physical: 'physical',
56
+ legal: 'legal',
57
+ };
58
+ export const NullEnum = {};
59
+ export const PatchedDogRequestSex = { ...DogSexEnum, ...BlankEnum, };
60
+ export const UserProfileMembershipType = { ...MembershipTypeEnum, ...BlankEnum, };
61
+ export const UserProfileRequestMembershipType = { ...MembershipTypeEnum, ...BlankEnum, };
@@ -0,0 +1,79 @@
1
+ import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query';
2
+ import type { LoginRequestRequest, LoginSuccess } from '../api.schemas';
3
+ /**
4
+ * Аутентификация пользователя по email и паролю. Устанавливает сессионный cookie.
5
+ * @summary Вход в систему
6
+ */
7
+ export type authLoginCreateResponse200 = {
8
+ data: LoginSuccess;
9
+ status: 200;
10
+ };
11
+ export type authLoginCreateResponse401 = {
12
+ data: void;
13
+ status: 401;
14
+ };
15
+ export type authLoginCreateResponseSuccess = (authLoginCreateResponse200) & {
16
+ headers: Headers;
17
+ };
18
+ export type authLoginCreateResponseError = (authLoginCreateResponse401) & {
19
+ headers: Headers;
20
+ };
21
+ export type authLoginCreateResponse = (authLoginCreateResponseSuccess | authLoginCreateResponseError);
22
+ export declare const getAuthLoginCreateUrl: () => string;
23
+ export declare const authLoginCreate: (loginRequestRequest: LoginRequestRequest, options?: RequestInit) => Promise<authLoginCreateResponse>;
24
+ export declare const getAuthLoginCreateMutationOptions: <TError = void, TContext = unknown>(options?: {
25
+ mutation?: UseMutationOptions<Awaited<ReturnType<typeof authLoginCreate>>, TError, {
26
+ data: LoginRequestRequest;
27
+ }, TContext>;
28
+ fetch?: RequestInit;
29
+ }) => UseMutationOptions<Awaited<ReturnType<typeof authLoginCreate>>, TError, {
30
+ data: LoginRequestRequest;
31
+ }, TContext>;
32
+ export type AuthLoginCreateMutationResult = NonNullable<Awaited<ReturnType<typeof authLoginCreate>>>;
33
+ export type AuthLoginCreateMutationBody = LoginRequestRequest;
34
+ export type AuthLoginCreateMutationError = void;
35
+ /**
36
+ * @summary Вход в систему
37
+ */
38
+ export declare const useAuthLoginCreate: <TError = void, TContext = unknown>(options?: {
39
+ mutation?: UseMutationOptions<Awaited<ReturnType<typeof authLoginCreate>>, TError, {
40
+ data: LoginRequestRequest;
41
+ }, TContext>;
42
+ fetch?: RequestInit;
43
+ }) => UseMutationResult<Awaited<ReturnType<typeof authLoginCreate>>, TError, {
44
+ data: LoginRequestRequest;
45
+ }, TContext>;
46
+ /**
47
+ * Завершает текущую сессию пользователя.
48
+ * @summary Выход из системы
49
+ */
50
+ export type authLogoutCreateResponse200 = {
51
+ data: void;
52
+ status: 200;
53
+ };
54
+ export type authLogoutCreateResponse401 = {
55
+ data: void;
56
+ status: 401;
57
+ };
58
+ export type authLogoutCreateResponseSuccess = (authLogoutCreateResponse200) & {
59
+ headers: Headers;
60
+ };
61
+ export type authLogoutCreateResponseError = (authLogoutCreateResponse401) & {
62
+ headers: Headers;
63
+ };
64
+ export type authLogoutCreateResponse = (authLogoutCreateResponseSuccess | authLogoutCreateResponseError);
65
+ export declare const getAuthLogoutCreateUrl: () => string;
66
+ export declare const authLogoutCreate: (options?: RequestInit) => Promise<authLogoutCreateResponse>;
67
+ export declare const getAuthLogoutCreateMutationOptions: <TError = void, TContext = unknown>(options?: {
68
+ mutation?: UseMutationOptions<Awaited<ReturnType<typeof authLogoutCreate>>, TError, void, TContext>;
69
+ fetch?: RequestInit;
70
+ }) => UseMutationOptions<Awaited<ReturnType<typeof authLogoutCreate>>, TError, void, TContext>;
71
+ export type AuthLogoutCreateMutationResult = NonNullable<Awaited<ReturnType<typeof authLogoutCreate>>>;
72
+ export type AuthLogoutCreateMutationError = void;
73
+ /**
74
+ * @summary Выход из системы
75
+ */
76
+ export declare const useAuthLogoutCreate: <TError = void, TContext = unknown>(options?: {
77
+ mutation?: UseMutationOptions<Awaited<ReturnType<typeof authLogoutCreate>>, TError, void, TContext>;
78
+ fetch?: RequestInit;
79
+ }) => UseMutationResult<Awaited<ReturnType<typeof authLogoutCreate>>, TError, void, TContext>;
@@ -0,0 +1,71 @@
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 } from '@tanstack/react-query';
9
+ export const getAuthLoginCreateUrl = () => {
10
+ return `/api/auth/login/`;
11
+ };
12
+ export const authLoginCreate = async (loginRequestRequest, options) => {
13
+ const res = await fetch(getAuthLoginCreateUrl(), {
14
+ ...options,
15
+ method: 'POST',
16
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
17
+ body: JSON.stringify(loginRequestRequest)
18
+ });
19
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
20
+ const data = body ? JSON.parse(body) : {};
21
+ return { data, status: res.status, headers: res.headers };
22
+ };
23
+ export const getAuthLoginCreateMutationOptions = (options) => {
24
+ const mutationKey = ['authLoginCreate'];
25
+ const { mutation: mutationOptions, fetch: fetchOptions } = options ?
26
+ options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
27
+ options
28
+ : { ...options, mutation: { ...options.mutation, mutationKey } }
29
+ : { mutation: { mutationKey, }, fetch: undefined };
30
+ const mutationFn = (props) => {
31
+ const { data } = props ?? {};
32
+ return authLoginCreate(data, fetchOptions);
33
+ };
34
+ return { mutationFn, ...mutationOptions };
35
+ };
36
+ /**
37
+ * @summary Вход в систему
38
+ */
39
+ export const useAuthLoginCreate = (options) => {
40
+ return useMutation(getAuthLoginCreateMutationOptions(options));
41
+ };
42
+ export const getAuthLogoutCreateUrl = () => {
43
+ return `/api/auth/logout/`;
44
+ };
45
+ export const authLogoutCreate = async (options) => {
46
+ const res = await fetch(getAuthLogoutCreateUrl(), {
47
+ ...options,
48
+ method: 'POST'
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 getAuthLogoutCreateMutationOptions = (options) => {
55
+ const mutationKey = ['authLogoutCreate'];
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 = () => {
62
+ return authLogoutCreate(fetchOptions);
63
+ };
64
+ return { mutationFn, ...mutationOptions };
65
+ };
66
+ /**
67
+ * @summary Выход из системы
68
+ */
69
+ export const useAuthLogoutCreate = (options) => {
70
+ return useMutation(getAuthLogoutCreateMutationOptions(options));
71
+ };
@@ -0,0 +1,144 @@
1
+ import type { QueryKey, UseQueryOptions, UseQueryResult } from '@tanstack/react-query';
2
+ import type { BreedArticle, BreedArticlesListParams, BreedStandard, BreedStandardsListParams, PaginatedBreedArticleList, PaginatedBreedStandardList } from '../api.schemas';
3
+ /**
4
+ * Возвращает список статей. Поддерживает фильтрацию по категории.
5
+ * @summary Список статей о породе
6
+ */
7
+ export type breedArticlesListResponse200 = {
8
+ data: PaginatedBreedArticleList;
9
+ status: 200;
10
+ };
11
+ export type breedArticlesListResponseSuccess = (breedArticlesListResponse200) & {
12
+ headers: Headers;
13
+ };
14
+ export type breedArticlesListResponse = (breedArticlesListResponseSuccess);
15
+ export declare const getBreedArticlesListUrl: (params?: BreedArticlesListParams) => string;
16
+ export declare const breedArticlesList: (params?: BreedArticlesListParams, options?: RequestInit) => Promise<breedArticlesListResponse>;
17
+ export declare const getBreedArticlesListQueryKey: (params?: BreedArticlesListParams) => readonly ["/api/breed/articles/", ...BreedArticlesListParams[]];
18
+ export declare const getBreedArticlesListQueryOptions: <TData = Awaited<ReturnType<typeof breedArticlesList>>, TError = unknown>(params?: BreedArticlesListParams, options?: {
19
+ query?: UseQueryOptions<Awaited<ReturnType<typeof breedArticlesList>>, TError, TData>;
20
+ fetch?: RequestInit;
21
+ }) => UseQueryOptions<Awaited<ReturnType<typeof breedArticlesList>>, TError, TData> & {
22
+ queryKey: QueryKey;
23
+ };
24
+ export type BreedArticlesListQueryResult = NonNullable<Awaited<ReturnType<typeof breedArticlesList>>>;
25
+ export type BreedArticlesListQueryError = unknown;
26
+ /**
27
+ * @summary Список статей о породе
28
+ */
29
+ export declare function useBreedArticlesList<TData = Awaited<ReturnType<typeof breedArticlesList>>, TError = unknown>(params?: BreedArticlesListParams, options?: {
30
+ query?: UseQueryOptions<Awaited<ReturnType<typeof breedArticlesList>>, TError, TData>;
31
+ fetch?: RequestInit;
32
+ }): UseQueryResult<TData, TError> & {
33
+ queryKey: QueryKey;
34
+ };
35
+ /**
36
+ * API статей о породе
37
+ * @summary Получить статью о породе по ID
38
+ */
39
+ export type breedArticlesRetrieveResponse200 = {
40
+ data: BreedArticle;
41
+ status: 200;
42
+ };
43
+ export type breedArticlesRetrieveResponse404 = {
44
+ data: void;
45
+ status: 404;
46
+ };
47
+ export type breedArticlesRetrieveResponseSuccess = (breedArticlesRetrieveResponse200) & {
48
+ headers: Headers;
49
+ };
50
+ export type breedArticlesRetrieveResponseError = (breedArticlesRetrieveResponse404) & {
51
+ headers: Headers;
52
+ };
53
+ export type breedArticlesRetrieveResponse = (breedArticlesRetrieveResponseSuccess | breedArticlesRetrieveResponseError);
54
+ export declare const getBreedArticlesRetrieveUrl: (id: number) => string;
55
+ export declare const breedArticlesRetrieve: (id: number, options?: RequestInit) => Promise<breedArticlesRetrieveResponse>;
56
+ export declare const getBreedArticlesRetrieveQueryKey: (id: number) => readonly [`/api/breed/articles/${number}/`];
57
+ export declare const getBreedArticlesRetrieveQueryOptions: <TData = Awaited<ReturnType<typeof breedArticlesRetrieve>>, TError = void>(id: number, options?: {
58
+ query?: UseQueryOptions<Awaited<ReturnType<typeof breedArticlesRetrieve>>, TError, TData>;
59
+ fetch?: RequestInit;
60
+ }) => UseQueryOptions<Awaited<ReturnType<typeof breedArticlesRetrieve>>, TError, TData> & {
61
+ queryKey: QueryKey;
62
+ };
63
+ export type BreedArticlesRetrieveQueryResult = NonNullable<Awaited<ReturnType<typeof breedArticlesRetrieve>>>;
64
+ export type BreedArticlesRetrieveQueryError = void;
65
+ /**
66
+ * @summary Получить статью о породе по ID
67
+ */
68
+ export declare function useBreedArticlesRetrieve<TData = Awaited<ReturnType<typeof breedArticlesRetrieve>>, TError = void>(id: number, options?: {
69
+ query?: UseQueryOptions<Awaited<ReturnType<typeof breedArticlesRetrieve>>, TError, TData>;
70
+ fetch?: RequestInit;
71
+ }): UseQueryResult<TData, TError> & {
72
+ queryKey: QueryKey;
73
+ };
74
+ /**
75
+ * API стандартов породы
76
+ * @summary Список стандартов породы
77
+ */
78
+ export type breedStandardsListResponse200 = {
79
+ data: PaginatedBreedStandardList;
80
+ status: 200;
81
+ };
82
+ export type breedStandardsListResponseSuccess = (breedStandardsListResponse200) & {
83
+ headers: Headers;
84
+ };
85
+ export type breedStandardsListResponse = (breedStandardsListResponseSuccess);
86
+ export declare const getBreedStandardsListUrl: (params?: BreedStandardsListParams) => string;
87
+ export declare const breedStandardsList: (params?: BreedStandardsListParams, options?: RequestInit) => Promise<breedStandardsListResponse>;
88
+ export declare const getBreedStandardsListQueryKey: (params?: BreedStandardsListParams) => readonly ["/api/breed/standards/", ...BreedStandardsListParams[]];
89
+ export declare const getBreedStandardsListQueryOptions: <TData = Awaited<ReturnType<typeof breedStandardsList>>, TError = unknown>(params?: BreedStandardsListParams, options?: {
90
+ query?: UseQueryOptions<Awaited<ReturnType<typeof breedStandardsList>>, TError, TData>;
91
+ fetch?: RequestInit;
92
+ }) => UseQueryOptions<Awaited<ReturnType<typeof breedStandardsList>>, TError, TData> & {
93
+ queryKey: QueryKey;
94
+ };
95
+ export type BreedStandardsListQueryResult = NonNullable<Awaited<ReturnType<typeof breedStandardsList>>>;
96
+ export type BreedStandardsListQueryError = unknown;
97
+ /**
98
+ * @summary Список стандартов породы
99
+ */
100
+ export declare function useBreedStandardsList<TData = Awaited<ReturnType<typeof breedStandardsList>>, TError = unknown>(params?: BreedStandardsListParams, options?: {
101
+ query?: UseQueryOptions<Awaited<ReturnType<typeof breedStandardsList>>, TError, TData>;
102
+ fetch?: RequestInit;
103
+ }): UseQueryResult<TData, TError> & {
104
+ queryKey: QueryKey;
105
+ };
106
+ /**
107
+ * API стандартов породы
108
+ * @summary Получить стандарт породы по ID
109
+ */
110
+ export type breedStandardsRetrieveResponse200 = {
111
+ data: BreedStandard;
112
+ status: 200;
113
+ };
114
+ export type breedStandardsRetrieveResponse404 = {
115
+ data: void;
116
+ status: 404;
117
+ };
118
+ export type breedStandardsRetrieveResponseSuccess = (breedStandardsRetrieveResponse200) & {
119
+ headers: Headers;
120
+ };
121
+ export type breedStandardsRetrieveResponseError = (breedStandardsRetrieveResponse404) & {
122
+ headers: Headers;
123
+ };
124
+ export type breedStandardsRetrieveResponse = (breedStandardsRetrieveResponseSuccess | breedStandardsRetrieveResponseError);
125
+ export declare const getBreedStandardsRetrieveUrl: (id: number) => string;
126
+ export declare const breedStandardsRetrieve: (id: number, options?: RequestInit) => Promise<breedStandardsRetrieveResponse>;
127
+ export declare const getBreedStandardsRetrieveQueryKey: (id: number) => readonly [`/api/breed/standards/${number}/`];
128
+ export declare const getBreedStandardsRetrieveQueryOptions: <TData = Awaited<ReturnType<typeof breedStandardsRetrieve>>, TError = void>(id: number, options?: {
129
+ query?: UseQueryOptions<Awaited<ReturnType<typeof breedStandardsRetrieve>>, TError, TData>;
130
+ fetch?: RequestInit;
131
+ }) => UseQueryOptions<Awaited<ReturnType<typeof breedStandardsRetrieve>>, TError, TData> & {
132
+ queryKey: QueryKey;
133
+ };
134
+ export type BreedStandardsRetrieveQueryResult = NonNullable<Awaited<ReturnType<typeof breedStandardsRetrieve>>>;
135
+ export type BreedStandardsRetrieveQueryError = void;
136
+ /**
137
+ * @summary Получить стандарт породы по ID
138
+ */
139
+ export declare function useBreedStandardsRetrieve<TData = Awaited<ReturnType<typeof breedStandardsRetrieve>>, TError = void>(id: number, options?: {
140
+ query?: UseQueryOptions<Awaited<ReturnType<typeof breedStandardsRetrieve>>, TError, TData>;
141
+ fetch?: RequestInit;
142
+ }): UseQueryResult<TData, TError> & {
143
+ queryKey: QueryKey;
144
+ };
@@ -0,0 +1,148 @@
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 getBreedArticlesListUrl = (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/breed/articles/?${stringifiedParams}` : `/api/breed/articles/`;
19
+ };
20
+ export const breedArticlesList = async (params, options) => {
21
+ const res = await fetch(getBreedArticlesListUrl(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 getBreedArticlesListQueryKey = (params) => {
30
+ return [
31
+ `/api/breed/articles/`, ...(params ? [params] : [])
32
+ ];
33
+ };
34
+ export const getBreedArticlesListQueryOptions = (params, options) => {
35
+ const { query: queryOptions, fetch: fetchOptions } = options ?? {};
36
+ const queryKey = queryOptions?.queryKey ?? getBreedArticlesListQueryKey(params);
37
+ const queryFn = ({ signal }) => breedArticlesList(params, { signal, ...fetchOptions });
38
+ return { queryKey, queryFn, ...queryOptions };
39
+ };
40
+ /**
41
+ * @summary Список статей о породе
42
+ */
43
+ export function useBreedArticlesList(params, options) {
44
+ const queryOptions = getBreedArticlesListQueryOptions(params, options);
45
+ const query = useQuery(queryOptions);
46
+ return { ...query, queryKey: queryOptions.queryKey };
47
+ }
48
+ export const getBreedArticlesRetrieveUrl = (id) => {
49
+ return `/api/breed/articles/${id}/`;
50
+ };
51
+ export const breedArticlesRetrieve = async (id, options) => {
52
+ const res = await fetch(getBreedArticlesRetrieveUrl(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 getBreedArticlesRetrieveQueryKey = (id) => {
61
+ return [
62
+ `/api/breed/articles/${id}/`
63
+ ];
64
+ };
65
+ export const getBreedArticlesRetrieveQueryOptions = (id, options) => {
66
+ const { query: queryOptions, fetch: fetchOptions } = options ?? {};
67
+ const queryKey = queryOptions?.queryKey ?? getBreedArticlesRetrieveQueryKey(id);
68
+ const queryFn = ({ signal }) => breedArticlesRetrieve(id, { signal, ...fetchOptions });
69
+ return { queryKey, queryFn, enabled: !!(id), ...queryOptions };
70
+ };
71
+ /**
72
+ * @summary Получить статью о породе по ID
73
+ */
74
+ export function useBreedArticlesRetrieve(id, options) {
75
+ const queryOptions = getBreedArticlesRetrieveQueryOptions(id, options);
76
+ const query = useQuery(queryOptions);
77
+ return { ...query, queryKey: queryOptions.queryKey };
78
+ }
79
+ ;
80
+ export const getBreedStandardsListUrl = (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/breed/standards/?${stringifiedParams}` : `/api/breed/standards/`;
89
+ };
90
+ export const breedStandardsList = async (params, options) => {
91
+ const res = await fetch(getBreedStandardsListUrl(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 getBreedStandardsListQueryKey = (params) => {
100
+ return [
101
+ `/api/breed/standards/`, ...(params ? [params] : [])
102
+ ];
103
+ };
104
+ export const getBreedStandardsListQueryOptions = (params, options) => {
105
+ const { query: queryOptions, fetch: fetchOptions } = options ?? {};
106
+ const queryKey = queryOptions?.queryKey ?? getBreedStandardsListQueryKey(params);
107
+ const queryFn = ({ signal }) => breedStandardsList(params, { signal, ...fetchOptions });
108
+ return { queryKey, queryFn, ...queryOptions };
109
+ };
110
+ /**
111
+ * @summary Список стандартов породы
112
+ */
113
+ export function useBreedStandardsList(params, options) {
114
+ const queryOptions = getBreedStandardsListQueryOptions(params, options);
115
+ const query = useQuery(queryOptions);
116
+ return { ...query, queryKey: queryOptions.queryKey };
117
+ }
118
+ export const getBreedStandardsRetrieveUrl = (id) => {
119
+ return `/api/breed/standards/${id}/`;
120
+ };
121
+ export const breedStandardsRetrieve = async (id, options) => {
122
+ const res = await fetch(getBreedStandardsRetrieveUrl(id), {
123
+ ...options,
124
+ method: 'GET'
125
+ });
126
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
127
+ const data = body ? JSON.parse(body) : {};
128
+ return { data, status: res.status, headers: res.headers };
129
+ };
130
+ export const getBreedStandardsRetrieveQueryKey = (id) => {
131
+ return [
132
+ `/api/breed/standards/${id}/`
133
+ ];
134
+ };
135
+ export const getBreedStandardsRetrieveQueryOptions = (id, options) => {
136
+ const { query: queryOptions, fetch: fetchOptions } = options ?? {};
137
+ const queryKey = queryOptions?.queryKey ?? getBreedStandardsRetrieveQueryKey(id);
138
+ const queryFn = ({ signal }) => breedStandardsRetrieve(id, { signal, ...fetchOptions });
139
+ return { queryKey, queryFn, enabled: !!(id), ...queryOptions };
140
+ };
141
+ /**
142
+ * @summary Получить стандарт породы по ID
143
+ */
144
+ export function useBreedStandardsRetrieve(id, options) {
145
+ const queryOptions = getBreedStandardsRetrieveQueryOptions(id, options);
146
+ const query = useQuery(queryOptions);
147
+ return { ...query, queryKey: queryOptions.queryKey };
148
+ }
@@ -0,0 +1,73 @@
1
+ import type { QueryKey, UseQueryOptions, UseQueryResult } from '@tanstack/react-query';
2
+ import type { ClubDocument, ClubDocumentsListParams, PaginatedClubDocumentList } from '../api.schemas';
3
+ /**
4
+ * API документов клуба
5
+ * @summary Список документов клуба
6
+ */
7
+ export type clubDocumentsListResponse200 = {
8
+ data: PaginatedClubDocumentList;
9
+ status: 200;
10
+ };
11
+ export type clubDocumentsListResponseSuccess = (clubDocumentsListResponse200) & {
12
+ headers: Headers;
13
+ };
14
+ export type clubDocumentsListResponse = (clubDocumentsListResponseSuccess);
15
+ export declare const getClubDocumentsListUrl: (params?: ClubDocumentsListParams) => string;
16
+ export declare const clubDocumentsList: (params?: ClubDocumentsListParams, options?: RequestInit) => Promise<clubDocumentsListResponse>;
17
+ export declare const getClubDocumentsListQueryKey: (params?: ClubDocumentsListParams) => readonly ["/api/club/documents/", ...ClubDocumentsListParams[]];
18
+ export declare const getClubDocumentsListQueryOptions: <TData = Awaited<ReturnType<typeof clubDocumentsList>>, TError = unknown>(params?: ClubDocumentsListParams, options?: {
19
+ query?: UseQueryOptions<Awaited<ReturnType<typeof clubDocumentsList>>, TError, TData>;
20
+ fetch?: RequestInit;
21
+ }) => UseQueryOptions<Awaited<ReturnType<typeof clubDocumentsList>>, TError, TData> & {
22
+ queryKey: QueryKey;
23
+ };
24
+ export type ClubDocumentsListQueryResult = NonNullable<Awaited<ReturnType<typeof clubDocumentsList>>>;
25
+ export type ClubDocumentsListQueryError = unknown;
26
+ /**
27
+ * @summary Список документов клуба
28
+ */
29
+ export declare function useClubDocumentsList<TData = Awaited<ReturnType<typeof clubDocumentsList>>, TError = unknown>(params?: ClubDocumentsListParams, options?: {
30
+ query?: UseQueryOptions<Awaited<ReturnType<typeof clubDocumentsList>>, TError, TData>;
31
+ fetch?: RequestInit;
32
+ }): UseQueryResult<TData, TError> & {
33
+ queryKey: QueryKey;
34
+ };
35
+ /**
36
+ * API документов клуба
37
+ * @summary Получить документ клуба по ID
38
+ */
39
+ export type clubDocumentsRetrieveResponse200 = {
40
+ data: ClubDocument;
41
+ status: 200;
42
+ };
43
+ export type clubDocumentsRetrieveResponse404 = {
44
+ data: void;
45
+ status: 404;
46
+ };
47
+ export type clubDocumentsRetrieveResponseSuccess = (clubDocumentsRetrieveResponse200) & {
48
+ headers: Headers;
49
+ };
50
+ export type clubDocumentsRetrieveResponseError = (clubDocumentsRetrieveResponse404) & {
51
+ headers: Headers;
52
+ };
53
+ export type clubDocumentsRetrieveResponse = (clubDocumentsRetrieveResponseSuccess | clubDocumentsRetrieveResponseError);
54
+ export declare const getClubDocumentsRetrieveUrl: (id: number) => string;
55
+ export declare const clubDocumentsRetrieve: (id: number, options?: RequestInit) => Promise<clubDocumentsRetrieveResponse>;
56
+ export declare const getClubDocumentsRetrieveQueryKey: (id: number) => readonly [`/api/club/documents/${number}/`];
57
+ export declare const getClubDocumentsRetrieveQueryOptions: <TData = Awaited<ReturnType<typeof clubDocumentsRetrieve>>, TError = void>(id: number, options?: {
58
+ query?: UseQueryOptions<Awaited<ReturnType<typeof clubDocumentsRetrieve>>, TError, TData>;
59
+ fetch?: RequestInit;
60
+ }) => UseQueryOptions<Awaited<ReturnType<typeof clubDocumentsRetrieve>>, TError, TData> & {
61
+ queryKey: QueryKey;
62
+ };
63
+ export type ClubDocumentsRetrieveQueryResult = NonNullable<Awaited<ReturnType<typeof clubDocumentsRetrieve>>>;
64
+ export type ClubDocumentsRetrieveQueryError = void;
65
+ /**
66
+ * @summary Получить документ клуба по ID
67
+ */
68
+ export declare function useClubDocumentsRetrieve<TData = Awaited<ReturnType<typeof clubDocumentsRetrieve>>, TError = void>(id: number, options?: {
69
+ query?: UseQueryOptions<Awaited<ReturnType<typeof clubDocumentsRetrieve>>, 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 getClubDocumentsListUrl = (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/club/documents/?${stringifiedParams}` : `/api/club/documents/`;
19
+ };
20
+ export const clubDocumentsList = async (params, options) => {
21
+ const res = await fetch(getClubDocumentsListUrl(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 getClubDocumentsListQueryKey = (params) => {
30
+ return [
31
+ `/api/club/documents/`, ...(params ? [params] : [])
32
+ ];
33
+ };
34
+ export const getClubDocumentsListQueryOptions = (params, options) => {
35
+ const { query: queryOptions, fetch: fetchOptions } = options ?? {};
36
+ const queryKey = queryOptions?.queryKey ?? getClubDocumentsListQueryKey(params);
37
+ const queryFn = ({ signal }) => clubDocumentsList(params, { signal, ...fetchOptions });
38
+ return { queryKey, queryFn, ...queryOptions };
39
+ };
40
+ /**
41
+ * @summary Список документов клуба
42
+ */
43
+ export function useClubDocumentsList(params, options) {
44
+ const queryOptions = getClubDocumentsListQueryOptions(params, options);
45
+ const query = useQuery(queryOptions);
46
+ return { ...query, queryKey: queryOptions.queryKey };
47
+ }
48
+ export const getClubDocumentsRetrieveUrl = (id) => {
49
+ return `/api/club/documents/${id}/`;
50
+ };
51
+ export const clubDocumentsRetrieve = async (id, options) => {
52
+ const res = await fetch(getClubDocumentsRetrieveUrl(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 getClubDocumentsRetrieveQueryKey = (id) => {
61
+ return [
62
+ `/api/club/documents/${id}/`
63
+ ];
64
+ };
65
+ export const getClubDocumentsRetrieveQueryOptions = (id, options) => {
66
+ const { query: queryOptions, fetch: fetchOptions } = options ?? {};
67
+ const queryKey = queryOptions?.queryKey ?? getClubDocumentsRetrieveQueryKey(id);
68
+ const queryFn = ({ signal }) => clubDocumentsRetrieve(id, { signal, ...fetchOptions });
69
+ return { queryKey, queryFn, enabled: !!(id), ...queryOptions };
70
+ };
71
+ /**
72
+ * @summary Получить документ клуба по ID
73
+ */
74
+ export function useClubDocumentsRetrieve(id, options) {
75
+ const queryOptions = getClubDocumentsRetrieveQueryOptions(id, options);
76
+ const query = useQuery(queryOptions);
77
+ return { ...query, queryKey: queryOptions.queryKey };
78
+ }