generator-kodly-react-app 1.0.15 → 1.0.16

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 (90) hide show
  1. package/generators/app/index.js +4 -0
  2. package/generators/app/templates/I18N_MIGRATION.md +13 -13
  3. package/generators/app/templates/STRUCTURE.md +26 -26
  4. package/generators/app/templates/index.html +6 -14
  5. package/generators/app/templates/openapi-ts.config.ts +12 -12
  6. package/generators/app/templates/postcss.config.js +0 -1
  7. package/generators/app/templates/src/app.tsx +20 -20
  8. package/generators/app/templates/src/components/layout/language-switcher.tsx +20 -16
  9. package/generators/app/templates/src/components/layout/page-layout.tsx +31 -0
  10. package/generators/app/templates/src/components/layout/theme-switcher.tsx +15 -14
  11. package/generators/app/templates/src/components/theme/theme-provider.tsx +20 -13
  12. package/generators/app/templates/src/components/ui/button.tsx +15 -14
  13. package/generators/app/templates/src/components/ui/card.tsx +23 -16
  14. package/generators/app/templates/src/components/ui/field.tsx +35 -35
  15. package/generators/app/templates/src/components/ui/form.tsx +66 -30
  16. package/generators/app/templates/src/components/ui/input-group.tsx +24 -24
  17. package/generators/app/templates/src/components/ui/input.tsx +8 -8
  18. package/generators/app/templates/src/components/ui/label.tsx +9 -9
  19. package/generators/app/templates/src/components/ui/select.tsx +0 -1
  20. package/generators/app/templates/src/components/ui/separator.tsx +10 -10
  21. package/generators/app/templates/src/components/ui/textarea.tsx +7 -7
  22. package/generators/app/templates/src/index.css +12 -2
  23. package/generators/app/templates/src/lib/i18n.ts +16 -14
  24. package/generators/app/templates/src/lib/routes.ts +2 -3
  25. package/generators/app/templates/src/lib/utils/error-handler.ts +21 -14
  26. package/generators/app/templates/src/lib/utils.ts +3 -3
  27. package/generators/app/templates/src/locales/index.ts +12 -12
  28. package/generators/app/templates/src/locales/ja/theme.json +0 -1
  29. package/generators/app/templates/src/main.tsx +10 -12
  30. package/generators/app/templates/src/modules/app/layouts/app-layout.tsx +14 -25
  31. package/generators/app/templates/src/modules/app/locales/app-en.json +0 -1
  32. package/generators/app/templates/src/modules/app/locales/app-ja.json +0 -1
  33. package/generators/app/templates/src/modules/auth/components/auth-form.tsx +83 -0
  34. package/generators/app/templates/src/modules/auth/components/forgot-password-form.tsx +27 -52
  35. package/generators/app/templates/src/modules/auth/components/login-form.tsx +42 -72
  36. package/generators/app/templates/src/modules/auth/components/login-link.tsx +12 -0
  37. package/generators/app/templates/src/modules/auth/components/reset-password-form.tsx +46 -92
  38. package/generators/app/templates/src/modules/auth/components/signup-form.tsx +35 -71
  39. package/generators/app/templates/src/modules/auth/contexts/auth-context.tsx +10 -6
  40. package/generators/app/templates/src/modules/auth/hooks/use-auth-hook.ts +51 -36
  41. package/generators/app/templates/src/modules/auth/layouts/auth-layout.tsx +12 -15
  42. package/generators/app/templates/src/modules/auth/locales/auth-en.json +0 -1
  43. package/generators/app/templates/src/modules/auth/locales/auth-ja.json +0 -1
  44. package/generators/app/templates/src/modules/auth/schemas/form-schemas.ts +14 -10
  45. package/generators/app/templates/src/modules/landing/components/auth-hero.tsx +20 -18
  46. package/generators/app/templates/src/modules/landing/components/welcome-hero.tsx +13 -11
  47. package/generators/app/templates/src/modules/landing/landing-page-layout.tsx +1 -24
  48. package/generators/app/templates/src/modules/landing/landing-page.tsx +11 -6
  49. package/generators/app/templates/src/modules/landing/layouts/landing-page-layout.tsx +2 -21
  50. package/generators/app/templates/src/modules/landing/locales/landing-en.json +0 -1
  51. package/generators/app/templates/src/openapi-client-config.ts +1 -1
  52. package/generators/app/templates/src/routeTree.gen.ts +188 -188
  53. package/generators/app/templates/src/router.tsx +2 -2
  54. package/generators/app/templates/src/routes/$.tsx +0 -1
  55. package/generators/app/templates/src/routes/__root.tsx +2 -2
  56. package/generators/app/templates/src/routes/_landing/index.tsx +3 -3
  57. package/generators/app/templates/src/routes/_landing/route.tsx +3 -3
  58. package/generators/app/templates/src/routes/app/index.tsx +6 -6
  59. package/generators/app/templates/src/routes/app/route.tsx +4 -4
  60. package/generators/app/templates/src/routes/auth/forgot-password.tsx +1 -1
  61. package/generators/app/templates/src/routes/auth/login.tsx +3 -3
  62. package/generators/app/templates/src/routes/auth/reset-password.tsx +3 -3
  63. package/generators/app/templates/src/routes/auth/route.tsx +12 -7
  64. package/generators/app/templates/src/routes/auth/signup.tsx +1 -2
  65. package/generators/app/templates/src/sdk/@tanstack/react-query.gen.ts +157 -76
  66. package/generators/app/templates/src/sdk/client/client.gen.ts +35 -37
  67. package/generators/app/templates/src/sdk/client/index.ts +8 -8
  68. package/generators/app/templates/src/sdk/client/types.gen.ts +22 -19
  69. package/generators/app/templates/src/sdk/client/utils.gen.ts +53 -45
  70. package/generators/app/templates/src/sdk/client.gen.ts +18 -5
  71. package/generators/app/templates/src/sdk/core/auth.gen.ts +6 -6
  72. package/generators/app/templates/src/sdk/core/bodySerializer.gen.ts +25 -27
  73. package/generators/app/templates/src/sdk/core/params.gen.ts +12 -12
  74. package/generators/app/templates/src/sdk/core/pathSerializer.gen.ts +40 -41
  75. package/generators/app/templates/src/sdk/core/queryKeySerializer.gen.ts +12 -29
  76. package/generators/app/templates/src/sdk/core/serverSentEvents.gen.ts +26 -24
  77. package/generators/app/templates/src/sdk/core/types.gen.ts +17 -15
  78. package/generators/app/templates/src/sdk/core/utils.gen.ts +18 -18
  79. package/generators/app/templates/src/sdk/index.ts +40 -2
  80. package/generators/app/templates/src/sdk/schemas.gen.ts +108 -166
  81. package/generators/app/templates/src/sdk/sdk.gen.ts +145 -63
  82. package/generators/app/templates/src/sdk/types.gen.ts +90 -84
  83. package/generators/app/templates/src/sdk/zod.gen.ts +57 -74
  84. package/generators/app/templates/src/types/i18n.d.ts +0 -1
  85. package/generators/app/templates/tailwind.config.js +0 -1
  86. package/generators/app/templates/tsconfig.app.json +0 -1
  87. package/generators/app/templates/tsconfig.json +0 -1
  88. package/generators/app/templates/tsr.config.json +4 -0
  89. package/generators/app/templates/vite.config.js +12 -12
  90. package/package.json +2 -4
@@ -1,91 +1,172 @@
1
1
  // This file is auto-generated by @hey-api/openapi-ts
2
2
 
3
- import type { DefaultError, UseMutationOptions } from '@tanstack/react-query';
4
- import type { AxiosError } from 'axios';
3
+ import type { DefaultError, UseMutationOptions } from "@tanstack/react-query";
4
+ import type { AxiosError } from "axios";
5
5
 
6
- import { loginUserAuth, logoutUserAuth, type Options, registerUserAuth, resetPasswordUserAuth, sendOtpUserAuth, validateTokenUserAuth } from '../sdk.gen';
7
- import type { LoginUserAuthData, LoginUserAuthResponse, LogoutUserAuthData, LogoutUserAuthResponse, RegisterUserAuthData, RegisterUserAuthResponse, ResetPasswordUserAuthData, ResetPasswordUserAuthResponse, SendOtpUserAuthData, SendOtpUserAuthResponse, ValidateTokenUserAuthData, ValidateTokenUserAuthResponse } from '../types.gen';
6
+ import {
7
+ loginUserAuth,
8
+ logoutUserAuth,
9
+ type Options,
10
+ registerUserAuth,
11
+ resetPasswordUserAuth,
12
+ sendOtpUserAuth,
13
+ validateTokenUserAuth,
14
+ } from "../sdk.gen";
15
+ import type {
16
+ LoginUserAuthData,
17
+ LoginUserAuthResponse,
18
+ LogoutUserAuthData,
19
+ LogoutUserAuthResponse,
20
+ RegisterUserAuthData,
21
+ RegisterUserAuthResponse,
22
+ ResetPasswordUserAuthData,
23
+ ResetPasswordUserAuthResponse,
24
+ SendOtpUserAuthData,
25
+ SendOtpUserAuthResponse,
26
+ ValidateTokenUserAuthData,
27
+ ValidateTokenUserAuthResponse,
28
+ } from "../types.gen";
8
29
 
9
- export const validateTokenUserAuthMutation = (options?: Partial<Options<ValidateTokenUserAuthData>>): UseMutationOptions<ValidateTokenUserAuthResponse, AxiosError<DefaultError>, Options<ValidateTokenUserAuthData>> => {
10
- const mutationOptions: UseMutationOptions<ValidateTokenUserAuthResponse, AxiosError<DefaultError>, Options<ValidateTokenUserAuthData>> = {
11
- mutationFn: async (fnOptions) => {
12
- const { data } = await validateTokenUserAuth({
13
- ...options,
14
- ...fnOptions,
15
- throwOnError: true
16
- });
17
- return data;
18
- }
19
- };
20
- return mutationOptions;
30
+ export const validateTokenUserAuthMutation = (
31
+ options?: Partial<Options<ValidateTokenUserAuthData>>,
32
+ ): UseMutationOptions<
33
+ ValidateTokenUserAuthResponse,
34
+ AxiosError<DefaultError>,
35
+ Options<ValidateTokenUserAuthData>
36
+ > => {
37
+ const mutationOptions: UseMutationOptions<
38
+ ValidateTokenUserAuthResponse,
39
+ AxiosError<DefaultError>,
40
+ Options<ValidateTokenUserAuthData>
41
+ > = {
42
+ mutationFn: async (fnOptions) => {
43
+ const { data } = await validateTokenUserAuth({
44
+ ...options,
45
+ ...fnOptions,
46
+ throwOnError: true,
47
+ });
48
+ return data;
49
+ },
50
+ };
51
+ return mutationOptions;
21
52
  };
22
53
 
23
- export const sendOtpUserAuthMutation = (options?: Partial<Options<SendOtpUserAuthData>>): UseMutationOptions<SendOtpUserAuthResponse, AxiosError<DefaultError>, Options<SendOtpUserAuthData>> => {
24
- const mutationOptions: UseMutationOptions<SendOtpUserAuthResponse, AxiosError<DefaultError>, Options<SendOtpUserAuthData>> = {
25
- mutationFn: async (fnOptions) => {
26
- const { data } = await sendOtpUserAuth({
27
- ...options,
28
- ...fnOptions,
29
- throwOnError: true
30
- });
31
- return data;
32
- }
33
- };
34
- return mutationOptions;
54
+ export const sendOtpUserAuthMutation = (
55
+ options?: Partial<Options<SendOtpUserAuthData>>,
56
+ ): UseMutationOptions<
57
+ SendOtpUserAuthResponse,
58
+ AxiosError<DefaultError>,
59
+ Options<SendOtpUserAuthData>
60
+ > => {
61
+ const mutationOptions: UseMutationOptions<
62
+ SendOtpUserAuthResponse,
63
+ AxiosError<DefaultError>,
64
+ Options<SendOtpUserAuthData>
65
+ > = {
66
+ mutationFn: async (fnOptions) => {
67
+ const { data } = await sendOtpUserAuth({
68
+ ...options,
69
+ ...fnOptions,
70
+ throwOnError: true,
71
+ });
72
+ return data;
73
+ },
74
+ };
75
+ return mutationOptions;
35
76
  };
36
77
 
37
- export const resetPasswordUserAuthMutation = (options?: Partial<Options<ResetPasswordUserAuthData>>): UseMutationOptions<ResetPasswordUserAuthResponse, AxiosError<DefaultError>, Options<ResetPasswordUserAuthData>> => {
38
- const mutationOptions: UseMutationOptions<ResetPasswordUserAuthResponse, AxiosError<DefaultError>, Options<ResetPasswordUserAuthData>> = {
39
- mutationFn: async (fnOptions) => {
40
- const { data } = await resetPasswordUserAuth({
41
- ...options,
42
- ...fnOptions,
43
- throwOnError: true
44
- });
45
- return data;
46
- }
47
- };
48
- return mutationOptions;
78
+ export const resetPasswordUserAuthMutation = (
79
+ options?: Partial<Options<ResetPasswordUserAuthData>>,
80
+ ): UseMutationOptions<
81
+ ResetPasswordUserAuthResponse,
82
+ AxiosError<DefaultError>,
83
+ Options<ResetPasswordUserAuthData>
84
+ > => {
85
+ const mutationOptions: UseMutationOptions<
86
+ ResetPasswordUserAuthResponse,
87
+ AxiosError<DefaultError>,
88
+ Options<ResetPasswordUserAuthData>
89
+ > = {
90
+ mutationFn: async (fnOptions) => {
91
+ const { data } = await resetPasswordUserAuth({
92
+ ...options,
93
+ ...fnOptions,
94
+ throwOnError: true,
95
+ });
96
+ return data;
97
+ },
98
+ };
99
+ return mutationOptions;
49
100
  };
50
101
 
51
- export const registerUserAuthMutation = (options?: Partial<Options<RegisterUserAuthData>>): UseMutationOptions<RegisterUserAuthResponse, AxiosError<DefaultError>, Options<RegisterUserAuthData>> => {
52
- const mutationOptions: UseMutationOptions<RegisterUserAuthResponse, AxiosError<DefaultError>, Options<RegisterUserAuthData>> = {
53
- mutationFn: async (fnOptions) => {
54
- const { data } = await registerUserAuth({
55
- ...options,
56
- ...fnOptions,
57
- throwOnError: true
58
- });
59
- return data;
60
- }
61
- };
62
- return mutationOptions;
102
+ export const registerUserAuthMutation = (
103
+ options?: Partial<Options<RegisterUserAuthData>>,
104
+ ): UseMutationOptions<
105
+ RegisterUserAuthResponse,
106
+ AxiosError<DefaultError>,
107
+ Options<RegisterUserAuthData>
108
+ > => {
109
+ const mutationOptions: UseMutationOptions<
110
+ RegisterUserAuthResponse,
111
+ AxiosError<DefaultError>,
112
+ Options<RegisterUserAuthData>
113
+ > = {
114
+ mutationFn: async (fnOptions) => {
115
+ const { data } = await registerUserAuth({
116
+ ...options,
117
+ ...fnOptions,
118
+ throwOnError: true,
119
+ });
120
+ return data;
121
+ },
122
+ };
123
+ return mutationOptions;
63
124
  };
64
125
 
65
- export const logoutUserAuthMutation = (options?: Partial<Options<LogoutUserAuthData>>): UseMutationOptions<LogoutUserAuthResponse, AxiosError<DefaultError>, Options<LogoutUserAuthData>> => {
66
- const mutationOptions: UseMutationOptions<LogoutUserAuthResponse, AxiosError<DefaultError>, Options<LogoutUserAuthData>> = {
67
- mutationFn: async (fnOptions) => {
68
- const { data } = await logoutUserAuth({
69
- ...options,
70
- ...fnOptions,
71
- throwOnError: true
72
- });
73
- return data;
74
- }
75
- };
76
- return mutationOptions;
126
+ export const logoutUserAuthMutation = (
127
+ options?: Partial<Options<LogoutUserAuthData>>,
128
+ ): UseMutationOptions<
129
+ LogoutUserAuthResponse,
130
+ AxiosError<DefaultError>,
131
+ Options<LogoutUserAuthData>
132
+ > => {
133
+ const mutationOptions: UseMutationOptions<
134
+ LogoutUserAuthResponse,
135
+ AxiosError<DefaultError>,
136
+ Options<LogoutUserAuthData>
137
+ > = {
138
+ mutationFn: async (fnOptions) => {
139
+ const { data } = await logoutUserAuth({
140
+ ...options,
141
+ ...fnOptions,
142
+ throwOnError: true,
143
+ });
144
+ return data;
145
+ },
146
+ };
147
+ return mutationOptions;
77
148
  };
78
149
 
79
- export const loginUserAuthMutation = (options?: Partial<Options<LoginUserAuthData>>): UseMutationOptions<LoginUserAuthResponse, AxiosError<DefaultError>, Options<LoginUserAuthData>> => {
80
- const mutationOptions: UseMutationOptions<LoginUserAuthResponse, AxiosError<DefaultError>, Options<LoginUserAuthData>> = {
81
- mutationFn: async (fnOptions) => {
82
- const { data } = await loginUserAuth({
83
- ...options,
84
- ...fnOptions,
85
- throwOnError: true
86
- });
87
- return data;
88
- }
89
- };
90
- return mutationOptions;
150
+ export const loginUserAuthMutation = (
151
+ options?: Partial<Options<LoginUserAuthData>>,
152
+ ): UseMutationOptions<
153
+ LoginUserAuthResponse,
154
+ AxiosError<DefaultError>,
155
+ Options<LoginUserAuthData>
156
+ > => {
157
+ const mutationOptions: UseMutationOptions<
158
+ LoginUserAuthResponse,
159
+ AxiosError<DefaultError>,
160
+ Options<LoginUserAuthData>
161
+ > = {
162
+ mutationFn: async (fnOptions) => {
163
+ const { data } = await loginUserAuth({
164
+ ...options,
165
+ ...fnOptions,
166
+ throwOnError: true,
167
+ });
168
+ return data;
169
+ },
170
+ };
171
+ return mutationOptions;
91
172
  };
@@ -1,26 +1,26 @@
1
1
  // This file is auto-generated by @hey-api/openapi-ts
2
2
 
3
- import type { AxiosError, AxiosInstance, RawAxiosRequestHeaders } from 'axios';
4
- import axios from 'axios';
3
+ import type { AxiosError, AxiosInstance, RawAxiosRequestHeaders } from "axios";
4
+ import axios from "axios";
5
5
 
6
- import { createSseClient } from '../core/serverSentEvents.gen';
7
- import type { HttpMethod } from '../core/types.gen';
8
- import { getValidRequestBody } from '../core/utils.gen';
9
- import type { Client, Config, RequestOptions } from './types.gen';
6
+ import { createSseClient } from "../core/serverSentEvents.gen";
7
+ import type { HttpMethod } from "../core/types.gen";
8
+ import { getValidRequestBody } from "../core/utils.gen";
9
+ import type { Client, Config, RequestOptions } from "./types.gen";
10
10
  import {
11
11
  buildUrl,
12
12
  createConfig,
13
13
  mergeConfigs,
14
14
  mergeHeaders,
15
15
  setAuthParams,
16
- } from './utils.gen';
16
+ } from "./utils.gen";
17
17
 
18
18
  export const createClient = (config: Config = {}): Client => {
19
19
  let _config = mergeConfigs(createConfig(), config);
20
20
 
21
21
  let instance: AxiosInstance;
22
22
 
23
- if (_config.axios && !('Axios' in _config.axios)) {
23
+ if (_config.axios && !("Axios" in _config.axios)) {
24
24
  instance = _config.axios;
25
25
  } else {
26
26
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
@@ -35,7 +35,7 @@ export const createClient = (config: Config = {}): Client => {
35
35
  instance.defaults = {
36
36
  ...instance.defaults,
37
37
  ..._config,
38
- // @ts-expect-error
38
+ // @ts-expect-error Axios defaults require method-specific headers; merged values retain those entries.
39
39
  headers: mergeHeaders(instance.defaults.headers, _config.headers),
40
40
  };
41
41
  return getConfig();
@@ -69,9 +69,9 @@ export const createClient = (config: Config = {}): Client => {
69
69
  return { opts, url };
70
70
  };
71
71
 
72
- // @ts-expect-error
73
- const request: Client['request'] = async (options) => {
74
- // @ts-expect-error
72
+ // @ts-expect-error The generic client return type depends on the selected throwOnError option.
73
+ const request: Client["request"] = async (options) => {
74
+ // @ts-expect-error The method generic is narrower than the shared request options at runtime.
75
75
  const { opts, url } = await beforeRequest(options);
76
76
  try {
77
77
  // assign Axios here for consistency with fetch
@@ -80,7 +80,7 @@ export const createClient = (config: Config = {}): Client => {
80
80
  const { auth, ...optsWithoutAuth } = opts;
81
81
  const response = await _axios({
82
82
  ...optsWithoutAuth,
83
- baseURL: '', // the baseURL is already included in `url`
83
+ baseURL: "", // the baseURL is already included in `url`
84
84
  data: getValidRequestBody(opts),
85
85
  headers: opts.headers as RawAxiosRequestHeaders,
86
86
  // let `paramsSerializer()` handle query params if it exists
@@ -90,7 +90,7 @@ export const createClient = (config: Config = {}): Client => {
90
90
 
91
91
  let { data } = response;
92
92
 
93
- if (opts.responseType === 'json') {
93
+ if (opts.responseType === "json") {
94
94
  if (opts.responseValidator) {
95
95
  await opts.responseValidator(data);
96
96
  }
@@ -109,7 +109,7 @@ export const createClient = (config: Config = {}): Client => {
109
109
  if (opts.throwOnError) {
110
110
  throw e;
111
111
  }
112
- // @ts-expect-error
112
+ // @ts-expect-error The client adds the documented error payload to the Axios error.
113
113
  e.error = e.response?.data ?? {};
114
114
  return e;
115
115
  }
@@ -128,10 +128,8 @@ export const createClient = (config: Config = {}): Client => {
128
128
  headers: opts.headers as Record<string, string>,
129
129
  method,
130
130
  serializedBody: getValidRequestBody(opts) as
131
- | BodyInit
132
- | null
133
- | undefined,
134
- // @ts-expect-error
131
+ BodyInit | null | undefined,
132
+ // @ts-expect-error Axios also accepts its legacy signal type; SSE requires a browser AbortSignal.
135
133
  signal: opts.signal,
136
134
  url,
137
135
  });
@@ -139,29 +137,29 @@ export const createClient = (config: Config = {}): Client => {
139
137
 
140
138
  return {
141
139
  buildUrl,
142
- connect: makeMethodFn('CONNECT'),
143
- delete: makeMethodFn('DELETE'),
144
- get: makeMethodFn('GET'),
140
+ connect: makeMethodFn("CONNECT"),
141
+ delete: makeMethodFn("DELETE"),
142
+ get: makeMethodFn("GET"),
145
143
  getConfig,
146
- head: makeMethodFn('HEAD'),
144
+ head: makeMethodFn("HEAD"),
147
145
  instance,
148
- options: makeMethodFn('OPTIONS'),
149
- patch: makeMethodFn('PATCH'),
150
- post: makeMethodFn('POST'),
151
- put: makeMethodFn('PUT'),
146
+ options: makeMethodFn("OPTIONS"),
147
+ patch: makeMethodFn("PATCH"),
148
+ post: makeMethodFn("POST"),
149
+ put: makeMethodFn("PUT"),
152
150
  request,
153
151
  setConfig,
154
152
  sse: {
155
- connect: makeSseFn('CONNECT'),
156
- delete: makeSseFn('DELETE'),
157
- get: makeSseFn('GET'),
158
- head: makeSseFn('HEAD'),
159
- options: makeSseFn('OPTIONS'),
160
- patch: makeSseFn('PATCH'),
161
- post: makeSseFn('POST'),
162
- put: makeSseFn('PUT'),
163
- trace: makeSseFn('TRACE'),
153
+ connect: makeSseFn("CONNECT"),
154
+ delete: makeSseFn("DELETE"),
155
+ get: makeSseFn("GET"),
156
+ head: makeSseFn("HEAD"),
157
+ options: makeSseFn("OPTIONS"),
158
+ patch: makeSseFn("PATCH"),
159
+ post: makeSseFn("POST"),
160
+ put: makeSseFn("PUT"),
161
+ trace: makeSseFn("TRACE"),
164
162
  },
165
- trace: makeMethodFn('TRACE'),
163
+ trace: makeMethodFn("TRACE"),
166
164
  } as Client;
167
165
  };
@@ -1,15 +1,15 @@
1
1
  // This file is auto-generated by @hey-api/openapi-ts
2
2
 
3
- export type { Auth } from '../core/auth.gen';
4
- export type { QuerySerializerOptions } from '../core/bodySerializer.gen';
3
+ export type { Auth } from "../core/auth.gen";
4
+ export type { QuerySerializerOptions } from "../core/bodySerializer.gen";
5
5
  export {
6
6
  formDataBodySerializer,
7
7
  jsonBodySerializer,
8
8
  urlSearchParamsBodySerializer,
9
- } from '../core/bodySerializer.gen';
10
- export { buildClientParams } from '../core/params.gen';
11
- export { serializeQueryKeyValue } from '../core/queryKeySerializer.gen';
12
- export { createClient } from './client.gen';
9
+ } from "../core/bodySerializer.gen";
10
+ export { buildClientParams } from "../core/params.gen";
11
+ export { serializeQueryKeyValue } from "../core/queryKeySerializer.gen";
12
+ export { createClient } from "./client.gen";
13
13
  export type {
14
14
  Client,
15
15
  ClientOptions,
@@ -19,5 +19,5 @@ export type {
19
19
  RequestOptions,
20
20
  RequestResult,
21
21
  TDataShape,
22
- } from './types.gen';
23
- export { createConfig } from './utils.gen';
22
+ } from "./types.gen";
23
+ export { createConfig } from "./utils.gen";
@@ -7,20 +7,21 @@ import type {
7
7
  AxiosResponse,
8
8
  AxiosStatic,
9
9
  CreateAxiosDefaults,
10
- } from 'axios';
10
+ } from "axios";
11
11
 
12
- import type { Auth } from '../core/auth.gen';
12
+ import type { Auth } from "../core/auth.gen";
13
13
  import type {
14
14
  ServerSentEventsOptions,
15
15
  ServerSentEventsResult,
16
- } from '../core/serverSentEvents.gen';
16
+ } from "../core/serverSentEvents.gen";
17
17
  import type {
18
18
  Client as CoreClient,
19
19
  Config as CoreConfig,
20
- } from '../core/types.gen';
20
+ } from "../core/types.gen";
21
21
 
22
22
  export interface Config<T extends ClientOptions = ClientOptions>
23
- extends Omit<CreateAxiosDefaults, 'auth' | 'baseURL' | 'headers' | 'method'>,
23
+ extends
24
+ Omit<CreateAxiosDefaults, "auth" | "baseURL" | "headers" | "method">,
24
25
  CoreConfig {
25
26
  /**
26
27
  * Axios implementation. You can use this option to provide either an
@@ -32,7 +33,7 @@ export interface Config<T extends ClientOptions = ClientOptions>
32
33
  /**
33
34
  * Base URL for all requests made by this client.
34
35
  */
35
- baseURL?: T['baseURL'];
36
+ baseURL?: T["baseURL"];
36
37
  /**
37
38
  * An object containing any HTTP headers that you want to pre-populate your
38
39
  * `Headers` object with.
@@ -56,23 +57,25 @@ export interface Config<T extends ClientOptions = ClientOptions>
56
57
  *
57
58
  * @default false
58
59
  */
59
- throwOnError?: T['throwOnError'];
60
+ throwOnError?: T["throwOnError"];
60
61
  }
61
62
 
62
63
  export interface RequestOptions<
63
64
  TData = unknown,
64
65
  ThrowOnError extends boolean = boolean,
65
66
  Url extends string = string,
66
- > extends Config<{
67
+ >
68
+ extends
69
+ Config<{
67
70
  throwOnError: ThrowOnError;
68
71
  }>,
69
72
  Pick<
70
73
  ServerSentEventsOptions<TData>,
71
- | 'onSseError'
72
- | 'onSseEvent'
73
- | 'sseDefaultRetryDelay'
74
- | 'sseMaxRetryAttempts'
75
- | 'sseMaxRetryDelay'
74
+ | "onSseError"
75
+ | "onSseEvent"
76
+ | "sseDefaultRetryDelay"
77
+ | "sseMaxRetryAttempts"
78
+ | "sseMaxRetryDelay"
76
79
  > {
77
80
  /**
78
81
  * Any body that you want to add to your request.
@@ -123,7 +126,7 @@ type MethodFn = <
123
126
  TError = unknown,
124
127
  ThrowOnError extends boolean = false,
125
128
  >(
126
- options: Omit<RequestOptions<TData, ThrowOnError>, 'method'>,
129
+ options: Omit<RequestOptions<TData, ThrowOnError>, "method">,
127
130
  ) => RequestResult<TData, TError, ThrowOnError>;
128
131
 
129
132
  type SseFn = <
@@ -131,7 +134,7 @@ type SseFn = <
131
134
  TError = unknown,
132
135
  ThrowOnError extends boolean = false,
133
136
  >(
134
- options: Omit<RequestOptions<TData, ThrowOnError>, 'method'>,
137
+ options: Omit<RequestOptions<TData, ThrowOnError>, "method">,
135
138
  ) => Promise<ServerSentEventsResult<TData, TError>>;
136
139
 
137
140
  type RequestFn = <
@@ -139,8 +142,8 @@ type RequestFn = <
139
142
  TError = unknown,
140
143
  ThrowOnError extends boolean = false,
141
144
  >(
142
- options: Omit<RequestOptions<TData, ThrowOnError>, 'method'> &
143
- Pick<Required<RequestOptions<TData, ThrowOnError>>, 'method'>,
145
+ options: Omit<RequestOptions<TData, ThrowOnError>, "method"> &
146
+ Pick<Required<RequestOptions<TData, ThrowOnError>>, "method">,
144
147
  ) => RequestResult<TData, TError, ThrowOnError>;
145
148
 
146
149
  type BuildUrlFn = <
@@ -192,6 +195,6 @@ export type Options<
192
195
  TResponse = unknown,
193
196
  > = OmitKeys<
194
197
  RequestOptions<TResponse, ThrowOnError>,
195
- 'body' | 'path' | 'query' | 'url'
198
+ "body" | "path" | "query" | "url"
196
199
  > &
197
- ([TData] extends [never] ? unknown : Omit<TData, 'url'>);
200
+ ([TData] extends [never] ? unknown : Omit<TData, "url">);