@kubb/plugin-react-query 3.0.0-alpha.10 → 3.0.0-alpha.11

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.
@@ -1,40 +1,45 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }// src/components/Mutation.tsx
2
- var _transformers = require('@kubb/core/transformers'); var _transformers2 = _interopRequireDefault(_transformers);
3
- var _utils = require('@kubb/core/utils');
4
- var _hooks = require('@kubb/plugin-oas/hooks');
5
- var _utils3 = require('@kubb/plugin-oas/utils');
6
- var _react = require('@kubb/react');
7
- var _plugints = require('@kubb/plugin-ts');
1
+ 'use strict';
8
2
 
9
- // src/components/SchemaType.tsx
3
+ var transformers2 = require('@kubb/core/transformers');
4
+ var utils = require('@kubb/core/utils');
5
+ var hooks = require('@kubb/plugin-oas/hooks');
6
+ var utils$1 = require('@kubb/plugin-oas/utils');
7
+ var react = require('@kubb/react');
8
+ var pluginTs = require('@kubb/plugin-ts');
9
+ var jsxRuntime = require('@kubb/react/jsx-runtime');
10
+ var oas = require('@kubb/oas');
11
+ var core = require('@kubb/core');
12
+ var pluginZod = require('@kubb/plugin-zod');
10
13
 
14
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
11
15
 
16
+ var transformers2__default = /*#__PURE__*/_interopDefault(transformers2);
12
17
 
13
- var _jsxruntime = require('@kubb/react/jsx-runtime');
18
+ // src/components/Mutation.tsx
14
19
  function SchemaType() {
15
20
  const {
16
21
  plugin: {
17
22
  options: { dataReturnType }
18
23
  }
19
- } = _react.useApp.call(void 0, );
20
- const { getSchemas, getName } = _hooks.useOperationManager.call(void 0, );
21
- const operation = _hooks.useOperation.call(void 0, );
22
- const schemas = getSchemas(operation, { pluginKey: [_plugints.pluginTsName], type: "type" });
24
+ } = react.useApp();
25
+ const { getSchemas, getName } = hooks.useOperationManager();
26
+ const operation = hooks.useOperation();
27
+ const schemas = getSchemas(operation, { pluginKey: [pluginTs.pluginTsName], type: "type" });
23
28
  const [TData, TError, TRequest, TPathParams, TQueryParams, THeaderParams, TResponse] = [
24
29
  schemas.response.name,
25
- _optionalChain([schemas, 'access', _ => _.errors, 'optionalAccess', _2 => _2.map, 'call', _3 => _3((item) => item.name), 'access', _4 => _4.join, 'call', _5 => _5(" | ")]) || "never",
26
- _optionalChain([schemas, 'access', _6 => _6.request, 'optionalAccess', _7 => _7.name]) || "never",
27
- _optionalChain([schemas, 'access', _8 => _8.pathParams, 'optionalAccess', _9 => _9.name]) || "never",
28
- _optionalChain([schemas, 'access', _10 => _10.queryParams, 'optionalAccess', _11 => _11.name]) || "never",
29
- _optionalChain([schemas, 'access', _12 => _12.headerParams, 'optionalAccess', _13 => _13.name]) || "never",
30
+ schemas.errors?.map((item) => item.name).join(" | ") || "never",
31
+ schemas.request?.name || "never",
32
+ schemas.pathParams?.name || "never",
33
+ schemas.queryParams?.name || "never",
34
+ schemas.headerParams?.name || "never",
30
35
  schemas.response.name
31
36
  ];
32
37
  const factoryName = getName(operation, { type: "type" });
33
38
  const clientType = `${factoryName}Client`;
34
39
  const isFormData = operation.getContentType() === "multipart/form-data";
35
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
36
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.File.Source, { name: clientType, isTypeOnly: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.Type, { name: clientType, children: `typeof client<${TResponse}, ${TError}, ${isFormData ? "FormData" : TRequest}>` }) }),
37
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.File.Source, { name: factoryName, isTypeOnly: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.Type, { name: factoryName, children: `
40
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
41
+ /* @__PURE__ */ jsxRuntime.jsx(react.File.Source, { name: clientType, isTypeOnly: true, children: /* @__PURE__ */ jsxRuntime.jsx(react.Type, { name: clientType, children: `typeof client<${TResponse}, ${TError}, ${isFormData ? "FormData" : TRequest}>` }) }),
42
+ /* @__PURE__ */ jsxRuntime.jsx(react.File.Source, { name: factoryName, isTypeOnly: true, children: /* @__PURE__ */ jsxRuntime.jsx(react.Type, { name: factoryName, children: `
38
43
  {
39
44
  data: ${TData}
40
45
  error: ${TError}
@@ -51,10 +56,6 @@ function SchemaType() {
51
56
  ` }) })
52
57
  ] });
53
58
  }
54
-
55
- // src/components/Mutation.tsx
56
- var _oas = require('@kubb/oas');
57
-
58
59
  function Template({ name, params, mutateParams, JSDoc, client, hook, dataReturnType }) {
59
60
  const isFormData = client.contentType === "multipart/form-data";
60
61
  const headers = [
@@ -70,8 +71,8 @@ function Template({ name, params, mutateParams, JSDoc, client, hook, dataReturnT
70
71
  headers.length ? `headers: { ${headers}, ...clientOptions.headers }` : void 0,
71
72
  "...clientOptions"
72
73
  ].filter(Boolean);
73
- const resolvedClientOptions = `${_transformers2.default.createIndent(4)}${clientOptions.join(`,
74
- ${_transformers2.default.createIndent(4)}`)}`;
74
+ const resolvedClientOptions = `${transformers2__default.default.createIndent(4)}${clientOptions.join(`,
75
+ ${transformers2__default.default.createIndent(4)}`)}`;
75
76
  const formData = isFormData ? `
76
77
  const formData = new FormData()
77
78
  if(data) {
@@ -83,7 +84,7 @@ ${_transformers2.default.createIndent(4)}`)}`;
83
84
  })
84
85
  }
85
86
  ` : void 0;
86
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.File.Source, { name, isExportable: true, isIndexable: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.Function, { export: true, name, params, JSDoc, children: `
87
+ return /* @__PURE__ */ jsxRuntime.jsx(react.File.Source, { name, isExportable: true, isIndexable: true, children: /* @__PURE__ */ jsxRuntime.jsx(react.Function, { export: true, name, params, JSDoc, children: `
87
88
  const { mutation: mutationOptions, client: clientOptions = {} } = options ?? {}
88
89
 
89
90
  return ${hook.name}({
@@ -107,40 +108,40 @@ function RootTemplate({ children }) {
107
108
  mutate
108
109
  }
109
110
  }
110
- } = _react.useApp.call(void 0, );
111
- const { getSchemas, getFile } = _hooks.useOperationManager.call(void 0, );
112
- const operation = _hooks.useOperation.call(void 0, );
113
- const schemas = getSchemas(operation, { pluginKey: [_plugints.pluginTsName], type: "type" });
111
+ } = react.useApp();
112
+ const { getSchemas, getFile } = hooks.useOperationManager();
113
+ const operation = hooks.useOperation();
114
+ const schemas = getSchemas(operation, { pluginKey: [pluginTs.pluginTsName], type: "type" });
114
115
  const file = getFile(operation);
115
- const fileType = getFile(operation, { pluginKey: [_plugints.pluginTsName] });
116
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _react.File, { baseName: file.baseName, path: file.path, meta: file.meta, children: [
117
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.File.Import, { name: "client", path: importPath }),
118
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.File.Import, { name: ["ResponseConfig"], path: importPath, isTypeOnly: true }),
119
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
120
- _react.File.Import,
116
+ const fileType = getFile(operation, { pluginKey: [pluginTs.pluginTsName] });
117
+ return /* @__PURE__ */ jsxRuntime.jsxs(react.File, { baseName: file.baseName, path: file.path, meta: file.meta, children: [
118
+ /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: "client", path: importPath }),
119
+ /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: ["ResponseConfig"], path: importPath, isTypeOnly: true }),
120
+ /* @__PURE__ */ jsxRuntime.jsx(
121
+ react.File.Import,
121
122
  {
122
123
  name: [
123
- _optionalChain([schemas, 'access', _14 => _14.request, 'optionalAccess', _15 => _15.name]),
124
+ schemas.request?.name,
124
125
  schemas.response.name,
125
- _optionalChain([schemas, 'access', _16 => _16.pathParams, 'optionalAccess', _17 => _17.name]),
126
- _optionalChain([schemas, 'access', _18 => _18.queryParams, 'optionalAccess', _19 => _19.name]),
127
- _optionalChain([schemas, 'access', _20 => _20.headerParams, 'optionalAccess', _21 => _21.name]),
128
- ..._optionalChain([schemas, 'access', _22 => _22.errors, 'optionalAccess', _23 => _23.map, 'call', _24 => _24((error) => error.name)]) || []
126
+ schemas.pathParams?.name,
127
+ schemas.queryParams?.name,
128
+ schemas.headerParams?.name,
129
+ ...schemas.errors?.map((error) => error.name) || []
129
130
  ].filter(Boolean),
130
131
  root: file.path,
131
132
  path: fileType.path,
132
133
  isTypeOnly: true
133
134
  }
134
135
  ),
135
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
136
- _react.File.Import,
136
+ /* @__PURE__ */ jsxRuntime.jsx(
137
+ react.File.Import,
137
138
  {
138
139
  name: ["UseMutationOptions", "UseMutationResult"],
139
140
  path: typeof mutate !== "boolean" && mutate.importPath ? mutate.importPath : "@tanstack/react-query",
140
141
  isTypeOnly: true
141
142
  }
142
143
  ),
143
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.File.Import, { name: ["useMutation"], path: typeof mutate !== "boolean" && mutate.importPath ? mutate.importPath : "@tanstack/react-query" }),
144
+ /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: ["useMutation"], path: typeof mutate !== "boolean" && mutate.importPath ? mutate.importPath : "@tanstack/react-query" }),
144
145
  children
145
146
  ] });
146
147
  }
@@ -150,44 +151,44 @@ function Mutation({ Template: Template6 = defaultTemplates.default }) {
150
151
  plugin: {
151
152
  options: { dataReturnType, mutate }
152
153
  }
153
- } = _react.useApp.call(void 0, );
154
- const operation = _hooks.useOperation.call(void 0, );
155
- const { getSchemas, getName } = _hooks.useOperationManager.call(void 0, );
154
+ } = react.useApp();
155
+ const operation = hooks.useOperation();
156
+ const { getSchemas, getName } = hooks.useOperationManager();
156
157
  const name = getName(operation, { type: "function" });
157
- const schemas = getSchemas(operation, { pluginKey: [_plugints.pluginTsName], type: "type" });
158
+ const schemas = getSchemas(operation, { pluginKey: [pluginTs.pluginTsName], type: "type" });
158
159
  const contentType = operation.getContentType();
159
- const params = new (0, _utils.FunctionParams)();
160
- const mutateParams = new (0, _utils.FunctionParams)();
160
+ const params = new utils.FunctionParams();
161
+ const mutateParams = new utils.FunctionParams();
161
162
  const factoryName = getName(operation, { type: "type" });
162
- const requestType = mutate && mutate.variablesType === "mutate" ? _optionalChain([_utils.FunctionParams, 'access', _25 => _25.toObject, 'call', _26 => _26([
163
- ..._utils3.getASTParams.call(void 0, schemas.pathParams, { typed: true }),
163
+ const requestType = mutate && mutate.variablesType === "mutate" ? utils.FunctionParams.toObject([
164
+ ...utils$1.getASTParams(schemas.pathParams, { typed: true }),
164
165
  {
165
166
  name: "params",
166
167
  type: `${factoryName}['queryParams']`,
167
- enabled: !!_optionalChain([schemas, 'access', _27 => _27.queryParams, 'optionalAccess', _28 => _28.name]),
168
- required: _oas.isRequired.call(void 0, _optionalChain([schemas, 'access', _29 => _29.queryParams, 'optionalAccess', _30 => _30.schema]))
168
+ enabled: !!schemas.queryParams?.name,
169
+ required: oas.isRequired(schemas.queryParams?.schema)
169
170
  },
170
171
  {
171
172
  name: "headers",
172
173
  type: `${factoryName}['headerParams']`,
173
- enabled: !!_optionalChain([schemas, 'access', _31 => _31.headerParams, 'optionalAccess', _32 => _32.name]),
174
- required: _oas.isRequired.call(void 0, _optionalChain([schemas, 'access', _33 => _33.headerParams, 'optionalAccess', _34 => _34.schema]))
174
+ enabled: !!schemas.headerParams?.name,
175
+ required: oas.isRequired(schemas.headerParams?.schema)
175
176
  },
176
177
  {
177
178
  name: "data",
178
179
  type: `${factoryName}['request']`,
179
- enabled: !!_optionalChain([schemas, 'access', _35 => _35.request, 'optionalAccess', _36 => _36.name]),
180
- required: _oas.isRequired.call(void 0, _optionalChain([schemas, 'access', _37 => _37.request, 'optionalAccess', _38 => _38.schema]))
180
+ enabled: !!schemas.request?.name,
181
+ required: oas.isRequired(schemas.request?.schema)
181
182
  }
182
- ]), 'optionalAccess', _39 => _39.type]) : _optionalChain([schemas, 'access', _40 => _40.request, 'optionalAccess', _41 => _41.name]) ? `${factoryName}['request']` : "never";
183
+ ])?.type : schemas.request?.name ? `${factoryName}['request']` : "never";
183
184
  const client = {
184
185
  method: operation.method,
185
- path: new (0, _utils.URLPath)(operation.path),
186
+ path: new utils.URLPath(operation.path),
186
187
  generics: [`${factoryName}["data"]`, `${factoryName}["error"]`, requestType ? `${factoryName}["request"]` : "void"].join(", "),
187
- withQueryParams: !!_optionalChain([schemas, 'access', _42 => _42.queryParams, 'optionalAccess', _43 => _43.name]),
188
- withData: !!_optionalChain([schemas, 'access', _44 => _44.request, 'optionalAccess', _45 => _45.name]),
189
- withPathParams: !!_optionalChain([schemas, 'access', _46 => _46.pathParams, 'optionalAccess', _47 => _47.name]),
190
- withHeaders: !!_optionalChain([schemas, 'access', _48 => _48.headerParams, 'optionalAccess', _49 => _49.name]),
188
+ withQueryParams: !!schemas.queryParams?.name,
189
+ withData: !!schemas.request?.name,
190
+ withPathParams: !!schemas.pathParams?.name,
191
+ withHeaders: !!schemas.headerParams?.name,
191
192
  contentType
192
193
  };
193
194
  const hook = {
@@ -197,9 +198,9 @@ function Mutation({ Template: Template6 = defaultTemplates.default }) {
197
198
  const resultGenerics = [
198
199
  `${factoryName}["response"]`,
199
200
  `${factoryName}["error"]`,
200
- mutate && _optionalChain([mutate, 'optionalAccess', _50 => _50.variablesType]) === "mutate" ? requestType : `${factoryName}["request"]`
201
+ mutate && mutate?.variablesType === "mutate" ? requestType : `${factoryName}["request"]`
201
202
  ];
202
- if (mutate && _optionalChain([mutate, 'optionalAccess', _51 => _51.variablesType]) === "mutate") {
203
+ if (mutate && mutate?.variablesType === "mutate") {
203
204
  params.add([
204
205
  {
205
206
  name: "options",
@@ -212,38 +213,38 @@ function Mutation({ Template: Template6 = defaultTemplates.default }) {
212
213
  ]);
213
214
  mutateParams.add([
214
215
  [
215
- ..._utils3.getASTParams.call(void 0, schemas.pathParams, { typed: false }),
216
+ ...utils$1.getASTParams(schemas.pathParams, { typed: false }),
216
217
  {
217
218
  name: "params",
218
219
  enabled: client.withQueryParams,
219
- required: _oas.isRequired.call(void 0, _optionalChain([schemas, 'access', _52 => _52.queryParams, 'optionalAccess', _53 => _53.schema]))
220
+ required: oas.isRequired(schemas.queryParams?.schema)
220
221
  },
221
222
  {
222
223
  name: "headers",
223
224
  enabled: client.withHeaders,
224
- required: _oas.isRequired.call(void 0, _optionalChain([schemas, 'access', _54 => _54.headerParams, 'optionalAccess', _55 => _55.schema]))
225
+ required: oas.isRequired(schemas.headerParams?.schema)
225
226
  },
226
227
  {
227
228
  name: "data",
228
- enabled: !!_optionalChain([schemas, 'access', _56 => _56.request, 'optionalAccess', _57 => _57.name]),
229
- required: _oas.isRequired.call(void 0, _optionalChain([schemas, 'access', _58 => _58.request, 'optionalAccess', _59 => _59.schema]))
229
+ enabled: !!schemas.request?.name,
230
+ required: oas.isRequired(schemas.request?.schema)
230
231
  }
231
232
  ]
232
233
  ]);
233
234
  } else {
234
235
  params.add([
235
- ..._utils3.getASTParams.call(void 0, schemas.pathParams, { typed: true }),
236
+ ...utils$1.getASTParams(schemas.pathParams, { typed: true }),
236
237
  {
237
238
  name: "params",
238
239
  type: `${factoryName}['queryParams']`,
239
240
  enabled: client.withQueryParams,
240
- required: _oas.isRequired.call(void 0, _optionalChain([schemas, 'access', _60 => _60.queryParams, 'optionalAccess', _61 => _61.schema]))
241
+ required: oas.isRequired(schemas.queryParams?.schema)
241
242
  },
242
243
  {
243
244
  name: "headers",
244
245
  type: `${factoryName}['headerParams']`,
245
246
  enabled: client.withHeaders,
246
- required: _oas.isRequired.call(void 0, _optionalChain([schemas, 'access', _62 => _62.headerParams, 'optionalAccess', _63 => _63.schema]))
247
+ required: oas.isRequired(schemas.headerParams?.schema)
247
248
  },
248
249
  {
249
250
  name: "options",
@@ -257,19 +258,19 @@ function Mutation({ Template: Template6 = defaultTemplates.default }) {
257
258
  mutateParams.add([
258
259
  {
259
260
  name: "data",
260
- enabled: !!_optionalChain([schemas, 'access', _64 => _64.request, 'optionalAccess', _65 => _65.name]),
261
- required: _oas.isRequired.call(void 0, _optionalChain([schemas, 'access', _66 => _66.request, 'optionalAccess', _67 => _67.schema]))
261
+ enabled: !!schemas.request?.name,
262
+ required: oas.isRequired(schemas.request?.schema)
262
263
  }
263
264
  ]);
264
265
  }
265
266
  if (!mutate) {
266
267
  return null;
267
268
  }
268
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
269
+ return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsx(
269
270
  Template6,
270
271
  {
271
272
  name,
272
- JSDoc: { comments: _utils3.getComments.call(void 0, operation) },
273
+ JSDoc: { comments: utils$1.getComments(operation) },
273
274
  client,
274
275
  hook,
275
276
  params: params.toString(),
@@ -282,28 +283,15 @@ Mutation.File = function({ ...props }) {
282
283
  const templates = { ...defaultTemplates, ...props.templates };
283
284
  const Template6 = templates.default;
284
285
  const RootTemplate2 = templates.root;
285
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, RootTemplate2, { children: [
286
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, SchemaType, {}),
287
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Mutation, { Template: Template6 })
286
+ return /* @__PURE__ */ jsxRuntime.jsxs(RootTemplate2, { children: [
287
+ /* @__PURE__ */ jsxRuntime.jsx(SchemaType, {}),
288
+ /* @__PURE__ */ jsxRuntime.jsx(Mutation, { Template: Template6 })
288
289
  ] });
289
290
  };
290
291
  Mutation.templates = defaultTemplates;
291
-
292
- // src/components/Query.tsx
293
- var _core = require('@kubb/core');
294
-
295
-
296
-
297
-
298
- var _pluginzod = require('@kubb/plugin-zod');
299
-
300
-
301
-
302
- // src/utils.ts
303
-
304
292
  var reactQueryDepRegex = /@tanstack\/(react|solid|vue|svelte)-query/;
305
293
  function getImportNames() {
306
- const isV5 = new (0, _core.PackageManager)().isValidSync(reactQueryDepRegex, ">=5");
294
+ const isV5 = new core.PackageManager().isValidSync(reactQueryDepRegex, ">=5");
307
295
  return {
308
296
  mutation: {
309
297
  react: {
@@ -393,26 +381,21 @@ function getImportNames() {
393
381
  }
394
382
  };
395
383
  }
396
-
397
- // src/components/QueryImports.tsx
398
-
399
-
400
-
401
384
  function Template2({ path, hookPath = path, isInfinite, hookName, queryOptions, optionsType, resultType }) {
402
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
403
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.File.Import, { name: [optionsType, resultType], path, isTypeOnly: true }),
404
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.File.Import, { name: [hookName], path: hookPath }),
405
- queryOptions && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.File.Import, { name: [queryOptions].filter(Boolean), path }),
406
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.File.Import, { name: ["QueryKey", "WithRequired", isInfinite ? "InfiniteData" : void 0].filter(Boolean), path, isTypeOnly: true })
385
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
386
+ /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: [optionsType, resultType], path, isTypeOnly: true }),
387
+ /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: [hookName], path: hookPath }),
388
+ queryOptions && /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: [queryOptions].filter(Boolean), path }),
389
+ /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: ["QueryKey", "WithRequired", isInfinite ? "InfiniteData" : void 0].filter(Boolean), path, isTypeOnly: true })
407
390
  ] });
408
391
  }
409
392
  var defaultTemplates2 = {
410
393
  get react() {
411
394
  return function({ context, hookPath, ...rest }) {
412
395
  const importNames = getImportNames();
413
- const isV5 = new (0, _core.PackageManager)().isValidSync(reactQueryDepRegex, ">=5");
396
+ const isV5 = new core.PackageManager().isValidSync(reactQueryDepRegex, ">=5");
414
397
  const { isInfinite, isSuspense } = context;
415
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
398
+ return /* @__PURE__ */ jsxRuntime.jsx(
416
399
  Template2,
417
400
  {
418
401
  isInfinite,
@@ -427,9 +410,9 @@ var defaultTemplates2 = {
427
410
  get solid() {
428
411
  return function({ context, hookPath, ...rest }) {
429
412
  const importNames = getImportNames();
430
- const isV5 = new (0, _core.PackageManager)().isValidSync(reactQueryDepRegex, ">=5");
413
+ const isV5 = new core.PackageManager().isValidSync(reactQueryDepRegex, ">=5");
431
414
  const { isInfinite } = context;
432
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
415
+ return /* @__PURE__ */ jsxRuntime.jsx(
433
416
  Template2,
434
417
  {
435
418
  isInfinite,
@@ -444,9 +427,9 @@ var defaultTemplates2 = {
444
427
  get svelte() {
445
428
  return function({ context, hookPath, ...rest }) {
446
429
  const importNames = getImportNames();
447
- const isV5 = new (0, _core.PackageManager)().isValidSync(reactQueryDepRegex, ">=5");
430
+ const isV5 = new core.PackageManager().isValidSync(reactQueryDepRegex, ">=5");
448
431
  const { isInfinite } = context;
449
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
432
+ return /* @__PURE__ */ jsxRuntime.jsx(
450
433
  Template2,
451
434
  {
452
435
  isInfinite,
@@ -461,12 +444,12 @@ var defaultTemplates2 = {
461
444
  get vue() {
462
445
  return function({ context, hookPath, ...rest }) {
463
446
  const importNames = getImportNames();
464
- const isV5 = new (0, _core.PackageManager)().isValidSync(reactQueryDepRegex, ">=5");
447
+ const isV5 = new core.PackageManager().isValidSync(reactQueryDepRegex, ">=5");
465
448
  const { isInfinite } = context;
466
449
  const path = "@tanstack/vue-query";
467
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
468
- isV5 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
469
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
450
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
451
+ isV5 && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
452
+ /* @__PURE__ */ jsxRuntime.jsx(
470
453
  Template2,
471
454
  {
472
455
  isInfinite,
@@ -476,27 +459,27 @@ var defaultTemplates2 = {
476
459
  ...rest
477
460
  }
478
461
  ),
479
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.File.Import, { name: ["QueryObserverOptions"], path, isTypeOnly: true })
462
+ /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: ["QueryObserverOptions"], path, isTypeOnly: true })
480
463
  ] }),
481
- !isV5 && isInfinite && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
482
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.File.Import, { name: [importNames.queryInfinite.vue.resultType], path, isTypeOnly: true }),
483
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.File.Import, { name: [importNames.queryInfinite.vue.optionsType], path: "@tanstack/vue-query/build/lib/types", isTypeOnly: true }),
484
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.File.Import, { name: [importNames.queryInfinite.vue.hookName], path })
464
+ !isV5 && isInfinite && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
465
+ /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: [importNames.queryInfinite.vue.resultType], path, isTypeOnly: true }),
466
+ /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: [importNames.queryInfinite.vue.optionsType], path: "@tanstack/vue-query/build/lib/types", isTypeOnly: true }),
467
+ /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: [importNames.queryInfinite.vue.hookName], path })
485
468
  ] }),
486
- !isV5 && !isInfinite && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
487
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.File.Import, { name: [importNames.query.vue.resultType], path, isTypeOnly: true }),
488
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.File.Import, { name: [importNames.query.vue.optionsType], path: "@tanstack/vue-query/build/lib/types", isTypeOnly: true }),
489
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.File.Import, { name: [importNames.query.vue.hookName], path })
469
+ !isV5 && !isInfinite && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
470
+ /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: [importNames.query.vue.resultType], path, isTypeOnly: true }),
471
+ /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: [importNames.query.vue.optionsType], path: "@tanstack/vue-query/build/lib/types", isTypeOnly: true }),
472
+ /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: [importNames.query.vue.hookName], path })
490
473
  ] }),
491
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.File.Import, { name: ["unref"], path: "vue" }),
492
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.File.Import, { name: ["MaybeRef"], path: "vue", isTypeOnly: true }),
493
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.File.Import, { name: ["QueryKey", "WithRequired"], path, isTypeOnly: true })
474
+ /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: ["unref"], path: "vue" }),
475
+ /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: ["MaybeRef"], path: "vue", isTypeOnly: true }),
476
+ /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: ["QueryKey", "WithRequired"], path, isTypeOnly: true })
494
477
  ] });
495
478
  };
496
479
  }
497
480
  };
498
481
  function QueryImports({ hookPath, isInfinite, isSuspense, Template: Template6 = defaultTemplates2.react }) {
499
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
482
+ return /* @__PURE__ */ jsxRuntime.jsx(
500
483
  Template6,
501
484
  {
502
485
  hookPath,
@@ -508,35 +491,26 @@ function QueryImports({ hookPath, isInfinite, isSuspense, Template: Template6 =
508
491
  );
509
492
  }
510
493
  QueryImports.templates = defaultTemplates2;
511
-
512
- // src/components/QueryKey.tsx
513
-
514
-
515
-
516
-
517
-
518
-
519
-
520
494
  function Template3({ name, typeName, params, generics, returnType, JSDoc, keys }) {
521
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
522
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.File.Source, { name, isExportable: true, isIndexable: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.Function.Arrow, { name, export: true, generics, params, returnType, singleLine: true, JSDoc, children: `[${keys}] as const` }) }),
523
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.File.Source, { name: typeName, isExportable: true, isIndexable: true, isTypeOnly: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.Type, { name: typeName, export: true, children: `ReturnType<typeof ${name}>` }) })
495
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
496
+ /* @__PURE__ */ jsxRuntime.jsx(react.File.Source, { name, isExportable: true, isIndexable: true, children: /* @__PURE__ */ jsxRuntime.jsx(react.Function.Arrow, { name, export: true, generics, params, returnType, singleLine: true, JSDoc, children: `[${keys}] as const` }) }),
497
+ /* @__PURE__ */ jsxRuntime.jsx(react.File.Source, { name: typeName, isExportable: true, isIndexable: true, isTypeOnly: true, children: /* @__PURE__ */ jsxRuntime.jsx(react.Type, { name: typeName, export: true, children: `ReturnType<typeof ${name}>` }) })
524
498
  ] });
525
499
  }
526
500
  var defaultTemplates3 = {
527
501
  get react() {
528
502
  return function(props) {
529
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Template3, { ...props });
503
+ return /* @__PURE__ */ jsxRuntime.jsx(Template3, { ...props });
530
504
  };
531
505
  },
532
506
  get solid() {
533
507
  return function(props) {
534
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Template3, { ...props });
508
+ return /* @__PURE__ */ jsxRuntime.jsx(Template3, { ...props });
535
509
  };
536
510
  },
537
511
  get svelte() {
538
512
  return function(props) {
539
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Template3, { ...props });
513
+ return /* @__PURE__ */ jsxRuntime.jsx(Template3, { ...props });
540
514
  };
541
515
  },
542
516
  get vue() {
@@ -546,24 +520,24 @@ var defaultTemplates3 = {
546
520
  plugin: {
547
521
  options: { pathParamsType, query }
548
522
  }
549
- } = _react.useApp.call(void 0, );
550
- const { getSchemas } = _hooks.useOperationManager.call(void 0, );
551
- const operation = _hooks.useOperation.call(void 0, );
552
- const schemas = getSchemas(operation, { pluginKey: [_plugints.pluginTsName], type: "type" });
553
- const path = new (0, _utils.URLPath)(operation.path);
554
- const params = new (0, _utils.FunctionParams)();
555
- const withQueryParams = !!_optionalChain([schemas, 'access', _68 => _68.queryParams, 'optionalAccess', _69 => _69.name]);
556
- const withRequest = !!_optionalChain([schemas, 'access', _70 => _70.request, 'optionalAccess', _71 => _71.name]);
523
+ } = react.useApp();
524
+ const { getSchemas } = hooks.useOperationManager();
525
+ const operation = hooks.useOperation();
526
+ const schemas = getSchemas(operation, { pluginKey: [pluginTs.pluginTsName], type: "type" });
527
+ const path = new utils.URLPath(operation.path);
528
+ const params = new utils.FunctionParams();
529
+ const withQueryParams = !!schemas.queryParams?.name;
530
+ const withRequest = !!schemas.request?.name;
557
531
  params.add([
558
532
  ...pathParamsType === "object" ? [
559
- _utils3.getASTParams.call(void 0, schemas.pathParams, {
533
+ utils$1.getASTParams(schemas.pathParams, {
560
534
  typed: true,
561
535
  override: (item) => ({
562
536
  ...item,
563
537
  type: `MaybeRef<${item.type}>`
564
538
  })
565
539
  })
566
- ] : _utils3.getASTParams.call(void 0, schemas.pathParams, {
540
+ ] : utils$1.getASTParams(schemas.pathParams, {
567
541
  typed: true,
568
542
  override: (item) => ({
569
543
  ...item,
@@ -574,13 +548,13 @@ var defaultTemplates3 = {
574
548
  name: "params",
575
549
  type: `MaybeRef<${`${factory.name}["queryParams"]`}>`,
576
550
  enabled: withQueryParams,
577
- required: _oas.isRequired.call(void 0, _optionalChain([schemas, 'access', _72 => _72.queryParams, 'optionalAccess', _73 => _73.schema]))
551
+ required: oas.isRequired(schemas.queryParams?.schema)
578
552
  },
579
553
  {
580
554
  name: "request",
581
555
  type: `MaybeRef<${`${factory.name}["request"]`}>`,
582
556
  enabled: withRequest,
583
- required: _oas.isRequired.call(void 0, _optionalChain([schemas, 'access', _74 => _74.request, 'optionalAccess', _75 => _75.schema]))
557
+ required: oas.isRequired(schemas.request?.schema)
584
558
  }
585
559
  ]);
586
560
  const keys = [
@@ -592,7 +566,7 @@ var defaultTemplates3 = {
592
566
  withQueryParams ? "...(params ? [params] : [])" : void 0,
593
567
  withRequest ? "...(request ? [request] : [])" : void 0
594
568
  ].filter(Boolean);
595
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Template3, { ...rest, params: params.toString(), keys: keys.join(", ") });
569
+ return /* @__PURE__ */ jsxRuntime.jsx(Template3, { ...rest, params: params.toString(), keys: keys.join(", ") });
596
570
  };
597
571
  }
598
572
  };
@@ -601,27 +575,27 @@ function QueryKey({ name, typeName, factory, keysFn, Template: Template6 = defau
601
575
  plugin: {
602
576
  options: { pathParamsType }
603
577
  }
604
- } = _react.useApp.call(void 0, );
605
- const { getSchemas } = _hooks.useOperationManager.call(void 0, );
606
- const operation = _hooks.useOperation.call(void 0, );
607
- const schemas = getSchemas(operation, { pluginKey: [_plugints.pluginTsName], type: "type" });
608
- const path = new (0, _utils.URLPath)(operation.path);
609
- const params = new (0, _utils.FunctionParams)();
610
- const withQueryParams = !!_optionalChain([schemas, 'access', _76 => _76.queryParams, 'optionalAccess', _77 => _77.name]);
611
- const withRequest = !!_optionalChain([schemas, 'access', _78 => _78.request, 'optionalAccess', _79 => _79.name]);
578
+ } = react.useApp();
579
+ const { getSchemas } = hooks.useOperationManager();
580
+ const operation = hooks.useOperation();
581
+ const schemas = getSchemas(operation, { pluginKey: [pluginTs.pluginTsName], type: "type" });
582
+ const path = new utils.URLPath(operation.path);
583
+ const params = new utils.FunctionParams();
584
+ const withQueryParams = !!schemas.queryParams?.name;
585
+ const withRequest = !!schemas.request?.name;
612
586
  params.add([
613
- ...pathParamsType === "object" ? [_utils3.getASTParams.call(void 0, schemas.pathParams, { typed: true })] : _utils3.getASTParams.call(void 0, schemas.pathParams, { typed: true }),
587
+ ...pathParamsType === "object" ? [utils$1.getASTParams(schemas.pathParams, { typed: true })] : utils$1.getASTParams(schemas.pathParams, { typed: true }),
614
588
  {
615
589
  name: "params",
616
590
  type: `${factory.name}["queryParams"]`,
617
591
  enabled: withQueryParams,
618
- required: _oas.isRequired.call(void 0, _optionalChain([schemas, 'access', _80 => _80.queryParams, 'optionalAccess', _81 => _81.schema]))
592
+ required: oas.isRequired(schemas.queryParams?.schema)
619
593
  },
620
594
  {
621
595
  name: "data",
622
596
  type: `${factory.name}["request"]`,
623
597
  enabled: withRequest,
624
- required: _oas.isRequired.call(void 0, _optionalChain([schemas, 'access', _82 => _82.request, 'optionalAccess', _83 => _83.schema]))
598
+ required: oas.isRequired(schemas.request?.schema)
625
599
  }
626
600
  ]);
627
601
  const keys = [
@@ -632,23 +606,11 @@ function QueryKey({ name, typeName, factory, keysFn, Template: Template6 = defau
632
606
  withQueryParams ? "...(params ? [params] : [])" : void 0,
633
607
  withRequest ? "...(data ? [data] : [])" : void 0
634
608
  ].filter(Boolean);
635
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Template6, { typeName, name, params: params.toString(), keys: keysFn(keys).join(", "), context: { factory } });
609
+ return /* @__PURE__ */ jsxRuntime.jsx(Template6, { typeName, name, params: params.toString(), keys: keysFn(keys).join(", "), context: { factory } });
636
610
  }
637
611
  QueryKey.templates = defaultTemplates3;
638
-
639
- // src/components/QueryOptions.tsx
640
-
641
-
642
-
643
-
644
-
645
-
646
-
647
-
648
-
649
-
650
612
  function Template4({ name, params, generics, returnType, JSDoc, hook, client, infinite, dataReturnType, parser }) {
651
- const isV5 = new (0, _core.PackageManager)().isValidSync(reactQueryDepRegex, ">=5");
613
+ const isV5 = new core.PackageManager().isValidSync(reactQueryDepRegex, ">=5");
652
614
  const isFormData = client.contentType === "multipart/form-data";
653
615
  const headers = [
654
616
  client.contentType !== "application/json" ? `'Content-Type': '${client.contentType}'` : void 0,
@@ -676,10 +638,10 @@ function Template4({ name, params, generics, returnType, JSDoc, hook, client, in
676
638
  isV5 && !!infinite && !infinite.cursorParam && dataReturnType === "data" ? "getNextPageParam: (lastPage, _allPages, lastPageParam) => Array.isArray(lastPage) && lastPage.length === 0 ? undefined : lastPageParam + 1" : void 0,
677
639
  isV5 && !!infinite && !infinite.cursorParam ? "getPreviousPageParam: (_firstPage, _allPages, firstPageParam) => firstPageParam <= 1 ? undefined : firstPageParam - 1" : void 0
678
640
  ].filter(Boolean);
679
- const resolvedClientOptions = `${_transformers2.default.createIndent(4)}${clientOptions.join(`,
680
- ${_transformers2.default.createIndent(4)}`)}`;
681
- const resolvedQueryOptions = `${_transformers2.default.createIndent(4)}${queryOptions.join(`,
682
- ${_transformers2.default.createIndent(4)}`)}`;
641
+ const resolvedClientOptions = `${transformers2__default.default.createIndent(4)}${clientOptions.join(`,
642
+ ${transformers2__default.default.createIndent(4)}`)}`;
643
+ const resolvedQueryOptions = `${transformers2__default.default.createIndent(4)}${queryOptions.join(`,
644
+ ${transformers2__default.default.createIndent(4)}`)}`;
683
645
  let returnRes = parser ? `return ${parser}(res.data)` : "return res.data";
684
646
  if (dataReturnType === "full") {
685
647
  returnRes = parser ? `return {...res, data: ${parser}(res.data)}` : "return res";
@@ -697,7 +659,7 @@ ${_transformers2.default.createIndent(4)}`)}`;
697
659
  ` : void 0;
698
660
  if (infinite) {
699
661
  if (isV5) {
700
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.File.Source, { name, isExportable: true, isIndexable: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.Function, { name, export: true, params, JSDoc, children: `
662
+ return /* @__PURE__ */ jsxRuntime.jsx(react.File.Source, { name, isExportable: true, isIndexable: true, children: /* @__PURE__ */ jsxRuntime.jsx(react.Function, { name, export: true, params, JSDoc, children: `
701
663
  const queryKey = ${hook.queryKey}
702
664
 
703
665
  return infiniteQueryOptions({
@@ -716,7 +678,7 @@ ${_transformers2.default.createIndent(4)}`)}`;
716
678
 
717
679
  ` }) });
718
680
  }
719
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.File.Source, { name, isExportable: true, isIndexable: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.Function, { name, export: true, generics, returnType, params, JSDoc, children: `
681
+ return /* @__PURE__ */ jsxRuntime.jsx(react.File.Source, { name, isExportable: true, isIndexable: true, children: /* @__PURE__ */ jsxRuntime.jsx(react.Function, { name, export: true, generics, returnType, params, JSDoc, children: `
720
682
  const queryKey = ${hook.queryKey}
721
683
 
722
684
  return {
@@ -736,7 +698,7 @@ ${_transformers2.default.createIndent(4)}`)}`;
736
698
  ` }) });
737
699
  }
738
700
  if (isV5) {
739
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.File.Source, { name, isExportable: true, isIndexable: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.Function, { name, export: true, params, JSDoc, children: `
701
+ return /* @__PURE__ */ jsxRuntime.jsx(react.File.Source, { name, isExportable: true, isIndexable: true, children: /* @__PURE__ */ jsxRuntime.jsx(react.Function, { name, export: true, params, JSDoc, children: `
740
702
  const queryKey = ${hook.queryKey}
741
703
 
742
704
  return queryOptions({
@@ -755,7 +717,7 @@ ${_transformers2.default.createIndent(4)}`)}`;
755
717
 
756
718
  ` }) });
757
719
  }
758
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.File.Source, { name, isExportable: true, isIndexable: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.Function, { name, export: true, generics, returnType, params, JSDoc, children: `
720
+ return /* @__PURE__ */ jsxRuntime.jsx(react.File.Source, { name, isExportable: true, isIndexable: true, children: /* @__PURE__ */ jsxRuntime.jsx(react.Function, { name, export: true, generics, returnType, params, JSDoc, children: `
759
721
  const queryKey = ${hook.queryKey}
760
722
 
761
723
  return {
@@ -777,17 +739,17 @@ ${_transformers2.default.createIndent(4)}`)}`;
777
739
  var defaultTemplates4 = {
778
740
  get react() {
779
741
  return function(props) {
780
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Template4, { ...props });
742
+ return /* @__PURE__ */ jsxRuntime.jsx(Template4, { ...props });
781
743
  };
782
744
  },
783
745
  get solid() {
784
746
  return function(props) {
785
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Template4, { ...props });
747
+ return /* @__PURE__ */ jsxRuntime.jsx(Template4, { ...props });
786
748
  };
787
749
  },
788
750
  get svelte() {
789
751
  return function(props) {
790
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Template4, { ...props });
752
+ return /* @__PURE__ */ jsxRuntime.jsx(Template4, { ...props });
791
753
  };
792
754
  },
793
755
  get vue() {
@@ -797,47 +759,47 @@ var defaultTemplates4 = {
797
759
  plugin: {
798
760
  options: { pathParamsType }
799
761
  }
800
- } = _react.useApp.call(void 0, );
801
- const { getSchemas } = _hooks.useOperationManager.call(void 0, );
802
- const operation = _hooks.useOperation.call(void 0, );
803
- const schemas = getSchemas(operation, { pluginKey: [_plugints.pluginTsName], type: "type" });
804
- const params = new (0, _utils.FunctionParams)();
805
- const queryKeyParams = new (0, _utils.FunctionParams)();
762
+ } = react.useApp();
763
+ const { getSchemas } = hooks.useOperationManager();
764
+ const operation = hooks.useOperation();
765
+ const schemas = getSchemas(operation, { pluginKey: [pluginTs.pluginTsName], type: "type" });
766
+ const params = new utils.FunctionParams();
767
+ const queryKeyParams = new utils.FunctionParams();
806
768
  params.add([
807
769
  ...pathParamsType === "object" ? [
808
- _utils3.getASTParams.call(void 0, schemas.pathParams, {
770
+ utils$1.getASTParams(schemas.pathParams, {
809
771
  typed: true,
810
772
  override: (item) => ({
811
773
  ...item,
812
- name: item.name ? `ref${_transformers2.default.pascalCase(item.name)}` : void 0,
774
+ name: item.name ? `ref${transformers2__default.default.pascalCase(item.name)}` : void 0,
813
775
  type: `MaybeRef<${item.type}>`
814
776
  })
815
777
  })
816
- ] : _utils3.getASTParams.call(void 0, schemas.pathParams, {
778
+ ] : utils$1.getASTParams(schemas.pathParams, {
817
779
  typed: true,
818
780
  override: (item) => ({
819
781
  ...item,
820
- name: item.name ? `ref${_transformers2.default.pascalCase(item.name)}` : void 0,
782
+ name: item.name ? `ref${transformers2__default.default.pascalCase(item.name)}` : void 0,
821
783
  type: `MaybeRef<${item.type}>`
822
784
  })
823
785
  }),
824
786
  {
825
787
  name: "refParams",
826
- type: `MaybeRef<${_optionalChain([schemas, 'access', _84 => _84.queryParams, 'optionalAccess', _85 => _85.name])}>`,
788
+ type: `MaybeRef<${schemas.queryParams?.name}>`,
827
789
  enabled: client.withQueryParams,
828
- required: _oas.isRequired.call(void 0, _optionalChain([schemas, 'access', _86 => _86.queryParams, 'optionalAccess', _87 => _87.schema]))
790
+ required: oas.isRequired(schemas.queryParams?.schema)
829
791
  },
830
792
  {
831
793
  name: "refHeaders",
832
- type: `MaybeRef<${_optionalChain([schemas, 'access', _88 => _88.headerParams, 'optionalAccess', _89 => _89.name])}>`,
794
+ type: `MaybeRef<${schemas.headerParams?.name}>`,
833
795
  enabled: client.withHeaders,
834
- required: _oas.isRequired.call(void 0, _optionalChain([schemas, 'access', _90 => _90.headerParams, 'optionalAccess', _91 => _91.schema]))
796
+ required: oas.isRequired(schemas.headerParams?.schema)
835
797
  },
836
798
  {
837
799
  name: "refData",
838
- type: `MaybeRef<${_optionalChain([schemas, 'access', _92 => _92.request, 'optionalAccess', _93 => _93.name])}>`,
800
+ type: `MaybeRef<${schemas.request?.name}>`,
839
801
  enabled: client.withData,
840
- required: _oas.isRequired.call(void 0, _optionalChain([schemas, 'access', _94 => _94.request, 'optionalAccess', _95 => _95.schema]))
802
+ required: oas.isRequired(schemas.request?.schema)
841
803
  },
842
804
  {
843
805
  name: "options",
@@ -847,37 +809,37 @@ var defaultTemplates4 = {
847
809
  ]);
848
810
  queryKeyParams.add([
849
811
  ...pathParamsType === "object" ? [
850
- _utils3.getASTParams.call(void 0, schemas.pathParams, {
812
+ utils$1.getASTParams(schemas.pathParams, {
851
813
  override: (item) => ({
852
814
  ...item,
853
- name: item.name ? `ref${_transformers2.default.pascalCase(item.name)}` : void 0
815
+ name: item.name ? `ref${transformers2__default.default.pascalCase(item.name)}` : void 0
854
816
  })
855
817
  })
856
- ] : _utils3.getASTParams.call(void 0, schemas.pathParams, {
818
+ ] : utils$1.getASTParams(schemas.pathParams, {
857
819
  override: (item) => ({
858
820
  ...item,
859
- name: item.name ? `ref${_transformers2.default.pascalCase(item.name)}` : void 0
821
+ name: item.name ? `ref${transformers2__default.default.pascalCase(item.name)}` : void 0
860
822
  })
861
823
  }),
862
824
  {
863
825
  name: "refParams",
864
826
  enabled: client.withQueryParams,
865
- required: _oas.isRequired.call(void 0, _optionalChain([schemas, 'access', _96 => _96.queryParams, 'optionalAccess', _97 => _97.schema]))
827
+ required: oas.isRequired(schemas.queryParams?.schema)
866
828
  },
867
829
  {
868
830
  name: "refData",
869
831
  enabled: client.withData,
870
- required: _oas.isRequired.call(void 0, _optionalChain([schemas, 'access', _98 => _98.request, 'optionalAccess', _99 => _99.schema]))
832
+ required: oas.isRequired(schemas.request?.schema)
871
833
  }
872
834
  ]);
873
835
  const unrefs = params.items.filter((item) => item.enabled).map((item) => {
874
- return item.name ? `const ${_transformers2.default.camelCase(item.name.replace("ref", ""))} = unref(${item.name})` : void 0;
836
+ return item.name ? `const ${transformers2__default.default.camelCase(item.name.replace("ref", ""))} = unref(${item.name})` : void 0;
875
837
  }).join("\n");
876
838
  const hook = {
877
839
  queryKey: `${queryKey}(${queryKeyParams.toString()})`,
878
840
  children: unrefs
879
841
  };
880
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Template4, { ...rest, params: params.toString(), hook, client });
842
+ return /* @__PURE__ */ jsxRuntime.jsx(Template4, { ...rest, params: params.toString(), hook, client });
881
843
  };
882
844
  }
883
845
  };
@@ -888,12 +850,12 @@ function QueryOptions({ factory, infinite, suspense, resultType, dataReturnType,
888
850
  key: pluginKey,
889
851
  options: { parser, pathParamsType, queryOptions }
890
852
  }
891
- } = _react.useApp.call(void 0, );
892
- const { getSchemas } = _hooks.useOperationManager.call(void 0, );
893
- const operation = _hooks.useOperation.call(void 0, );
853
+ } = react.useApp();
854
+ const { getSchemas } = hooks.useOperationManager();
855
+ const operation = hooks.useOperation();
894
856
  const contentType = operation.getContentType();
895
- const schemas = getSchemas(operation, { pluginKey: [_plugints.pluginTsName], type: "type" });
896
- const zodSchemas = getSchemas(operation, { pluginKey: [_pluginzod.pluginZodName], type: "function" });
857
+ const schemas = getSchemas(operation, { pluginKey: [pluginTs.pluginTsName], type: "type" });
858
+ const zodSchemas = getSchemas(operation, { pluginKey: [pluginZod.pluginZodName], type: "function" });
897
859
  const queryKey = pluginManager.resolveName({
898
860
  name: [factory.name, infinite ? "Infinite" : void 0, suspense ? "Suspense" : void 0, "QueryKey"].filter(Boolean).join(""),
899
861
  pluginKey
@@ -902,18 +864,18 @@ function QueryOptions({ factory, infinite, suspense, resultType, dataReturnType,
902
864
  name: [factory.name, infinite ? "Infinite" : void 0, suspense ? "Suspense" : void 0, "QueryOptions"].filter(Boolean).join(""),
903
865
  pluginKey
904
866
  });
905
- const generics = new (0, _utils.FunctionParams)();
906
- const params = new (0, _utils.FunctionParams)();
907
- const queryKeyParams = new (0, _utils.FunctionParams)();
867
+ const generics = new utils.FunctionParams();
868
+ const params = new utils.FunctionParams();
869
+ const queryKeyParams = new utils.FunctionParams();
908
870
  const clientGenerics = [`${factory.name}['data']`, `${factory.name}['error']`];
909
871
  const resultGenerics = suspense ? [`${factory.name}['response']`, `${factory.name}["error"]`, "TData"] : [`${factory.name}['response']`, `${factory.name}["error"]`, "TData", "TQueryData"];
910
872
  const client = {
911
- withQueryParams: !!_optionalChain([schemas, 'access', _100 => _100.queryParams, 'optionalAccess', _101 => _101.name]),
912
- withData: !!_optionalChain([schemas, 'access', _102 => _102.request, 'optionalAccess', _103 => _103.name]),
913
- withPathParams: !!_optionalChain([schemas, 'access', _104 => _104.pathParams, 'optionalAccess', _105 => _105.name]),
914
- withHeaders: !!_optionalChain([schemas, 'access', _106 => _106.headerParams, 'optionalAccess', _107 => _107.name]),
873
+ withQueryParams: !!schemas.queryParams?.name,
874
+ withData: !!schemas.request?.name,
875
+ withPathParams: !!schemas.pathParams?.name,
876
+ withHeaders: !!schemas.headerParams?.name,
915
877
  method: operation.method,
916
- path: new (0, _utils.URLPath)(operation.path),
878
+ path: new utils.URLPath(operation.path),
917
879
  generics: clientGenerics.toString(),
918
880
  contentType
919
881
  };
@@ -922,24 +884,24 @@ function QueryOptions({ factory, infinite, suspense, resultType, dataReturnType,
922
884
  suspense ? void 0 : { type: "TQueryData", default: `${factory.name}["response"]` }
923
885
  ]);
924
886
  params.add([
925
- ...pathParamsType === "object" ? [_utils3.getASTParams.call(void 0, schemas.pathParams, { typed: true })] : _utils3.getASTParams.call(void 0, schemas.pathParams, { typed: true }),
887
+ ...pathParamsType === "object" ? [utils$1.getASTParams(schemas.pathParams, { typed: true })] : utils$1.getASTParams(schemas.pathParams, { typed: true }),
926
888
  {
927
889
  name: "params",
928
890
  type: `${factory.name}['queryParams']`,
929
891
  enabled: client.withQueryParams,
930
- required: _oas.isRequired.call(void 0, _optionalChain([schemas, 'access', _108 => _108.queryParams, 'optionalAccess', _109 => _109.schema]))
892
+ required: oas.isRequired(schemas.queryParams?.schema)
931
893
  },
932
894
  {
933
895
  name: "headers",
934
896
  type: `${factory.name}['headerParams']`,
935
897
  enabled: client.withHeaders,
936
- required: _oas.isRequired.call(void 0, _optionalChain([schemas, 'access', _110 => _110.headerParams, 'optionalAccess', _111 => _111.schema]))
898
+ required: oas.isRequired(schemas.headerParams?.schema)
937
899
  },
938
900
  {
939
901
  name: "data",
940
902
  type: `${factory.name}['request']`,
941
903
  enabled: client.withData,
942
- required: _oas.isRequired.call(void 0, _optionalChain([schemas, 'access', _112 => _112.request, 'optionalAccess', _113 => _113.schema]))
904
+ required: oas.isRequired(schemas.request?.schema)
943
905
  },
944
906
  {
945
907
  name: "options",
@@ -948,16 +910,16 @@ function QueryOptions({ factory, infinite, suspense, resultType, dataReturnType,
948
910
  }
949
911
  ]);
950
912
  queryKeyParams.add([
951
- ...pathParamsType === "object" ? [_utils3.getASTParams.call(void 0, schemas.pathParams)] : _utils3.getASTParams.call(void 0, schemas.pathParams),
913
+ ...pathParamsType === "object" ? [utils$1.getASTParams(schemas.pathParams)] : utils$1.getASTParams(schemas.pathParams),
952
914
  {
953
915
  name: "params",
954
916
  enabled: client.withQueryParams,
955
- required: _oas.isRequired.call(void 0, _optionalChain([schemas, 'access', _114 => _114.queryParams, 'optionalAccess', _115 => _115.schema]))
917
+ required: oas.isRequired(schemas.queryParams?.schema)
956
918
  },
957
919
  {
958
920
  name: "data",
959
921
  enabled: client.withData,
960
- required: _oas.isRequired.call(void 0, _optionalChain([schemas, 'access', _116 => _116.request, 'optionalAccess', _117 => _117.schema]))
922
+ required: oas.isRequired(schemas.request?.schema)
961
923
  }
962
924
  ]);
963
925
  const hook = {
@@ -966,7 +928,7 @@ function QueryOptions({ factory, infinite, suspense, resultType, dataReturnType,
966
928
  if (!queryOptions) {
967
929
  return null;
968
930
  }
969
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
931
+ return /* @__PURE__ */ jsxRuntime.jsx(
970
932
  Template6,
971
933
  {
972
934
  name: queryOptionsName,
@@ -986,15 +948,11 @@ function QueryOptions({ factory, infinite, suspense, resultType, dataReturnType,
986
948
  );
987
949
  }
988
950
  QueryOptions.templates = defaultTemplates4;
989
-
990
- // src/components/Query.tsx
991
-
992
-
993
951
  function Template5({ name, generics, returnType, params, JSDoc, hook, infinite }) {
994
- const isV5 = new (0, _core.PackageManager)().isValidSync(reactQueryDepRegex, ">=5");
952
+ const isV5 = new core.PackageManager().isValidSync(reactQueryDepRegex, ">=5");
995
953
  const resolvedReturnType = `${returnType} & { queryKey: TQueryKey }`;
996
954
  if (isV5) {
997
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.File.Source, { name, isExportable: true, isIndexable: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.Function, { name, export: true, generics, returnType: resolvedReturnType, params, JSDoc, children: `
955
+ return /* @__PURE__ */ jsxRuntime.jsx(react.File.Source, { name, isExportable: true, isIndexable: true, children: /* @__PURE__ */ jsxRuntime.jsx(react.Function, { name, export: true, generics, returnType: resolvedReturnType, params, JSDoc, children: `
998
956
  const { query: queryOptions, client: clientOptions = {} } = options ?? {}
999
957
  const queryKey = queryOptions?.queryKey ?? ${hook.queryKey}
1000
958
 
@@ -1010,7 +968,7 @@ function Template5({ name, generics, returnType, params, JSDoc, hook, infinite }
1010
968
 
1011
969
  ` }) });
1012
970
  }
1013
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.File.Source, { name, isExportable: true, isIndexable: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.Function, { name, export: true, generics, returnType: resolvedReturnType, params, JSDoc, children: `
971
+ return /* @__PURE__ */ jsxRuntime.jsx(react.File.Source, { name, isExportable: true, isIndexable: true, children: /* @__PURE__ */ jsxRuntime.jsx(react.Function, { name, export: true, generics, returnType: resolvedReturnType, params, JSDoc, children: `
1014
972
  const { query: queryOptions, client: clientOptions = {} } = options ?? {}
1015
973
  const queryKey = queryOptions?.queryKey ?? ${hook.queryKey}
1016
974
 
@@ -1029,17 +987,17 @@ function Template5({ name, generics, returnType, params, JSDoc, hook, infinite }
1029
987
  var defaultTemplates5 = {
1030
988
  get react() {
1031
989
  return function(props) {
1032
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Template5, { ...props });
990
+ return /* @__PURE__ */ jsxRuntime.jsx(Template5, { ...props });
1033
991
  };
1034
992
  },
1035
993
  get solid() {
1036
994
  return function(props) {
1037
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Template5, { ...props });
995
+ return /* @__PURE__ */ jsxRuntime.jsx(Template5, { ...props });
1038
996
  };
1039
997
  },
1040
998
  get svelte() {
1041
999
  return function(props) {
1042
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Template5, { ...props });
1000
+ return /* @__PURE__ */ jsxRuntime.jsx(Template5, { ...props });
1043
1001
  };
1044
1002
  },
1045
1003
  get vue() {
@@ -1051,9 +1009,9 @@ var defaultTemplates5 = {
1051
1009
  key: pluginKey,
1052
1010
  options: { pathParamsType }
1053
1011
  }
1054
- } = _react.useApp.call(void 0, );
1055
- const operation = _hooks.useOperation.call(void 0, );
1056
- const { getSchemas } = _hooks.useOperationManager.call(void 0, );
1012
+ } = react.useApp();
1013
+ const operation = hooks.useOperation();
1014
+ const { getSchemas } = hooks.useOperationManager();
1057
1015
  const importNames = getImportNames();
1058
1016
  const queryOptions = pluginManager.resolveName({
1059
1017
  name: `${factory.name}QueryOptions`,
@@ -1062,53 +1020,53 @@ var defaultTemplates5 = {
1062
1020
  const hookName = rest.infinite ? importNames.queryInfinite.vue.hookName : importNames.query.vue.hookName;
1063
1021
  const resultType = rest.infinite ? importNames.queryInfinite.vue.resultType : importNames.query.vue.resultType;
1064
1022
  const optionsType = rest.infinite ? importNames.queryInfinite.vue.optionsType : importNames.query.vue.optionsType;
1065
- const schemas = getSchemas(operation, { pluginKey: [_plugints.pluginTsName], type: "type" });
1066
- const isV5 = new (0, _core.PackageManager)().isValidSync(reactQueryDepRegex, ">=5");
1067
- const params = new (0, _utils.FunctionParams)();
1068
- const queryParams = new (0, _utils.FunctionParams)();
1069
- const queryKeyParams = new (0, _utils.FunctionParams)();
1023
+ const schemas = getSchemas(operation, { pluginKey: [pluginTs.pluginTsName], type: "type" });
1024
+ const isV5 = new core.PackageManager().isValidSync(reactQueryDepRegex, ">=5");
1025
+ const params = new utils.FunctionParams();
1026
+ const queryParams = new utils.FunctionParams();
1027
+ const queryKeyParams = new utils.FunctionParams();
1070
1028
  const client = {
1071
- withQueryParams: !!_optionalChain([schemas, 'access', _118 => _118.queryParams, 'optionalAccess', _119 => _119.name]),
1072
- withData: !!_optionalChain([schemas, 'access', _120 => _120.request, 'optionalAccess', _121 => _121.name]),
1073
- withPathParams: !!_optionalChain([schemas, 'access', _122 => _122.pathParams, 'optionalAccess', _123 => _123.name]),
1074
- withHeaders: !!_optionalChain([schemas, 'access', _124 => _124.headerParams, 'optionalAccess', _125 => _125.name])
1029
+ withQueryParams: !!schemas.queryParams?.name,
1030
+ withData: !!schemas.request?.name,
1031
+ withPathParams: !!schemas.pathParams?.name,
1032
+ withHeaders: !!schemas.headerParams?.name
1075
1033
  };
1076
1034
  const resultGenerics = ["TData", `${factory.name}['error']`];
1077
1035
  const queryOptionsOverrideGenerics = [`${factory.name}['response']`, `${factory.name}['error']`, "TData", "TQueryKey"];
1078
1036
  const queryOptionsGenerics = ["TData", "TQueryData"];
1079
1037
  params.add([
1080
1038
  ...pathParamsType === "object" ? [
1081
- _utils3.getASTParams.call(void 0, schemas.pathParams, {
1039
+ utils$1.getASTParams(schemas.pathParams, {
1082
1040
  typed: true,
1083
1041
  override: (item) => ({
1084
1042
  ...item,
1085
- name: item.name ? `ref${_transformers2.default.pascalCase(item.name)}` : void 0
1043
+ name: item.name ? `ref${transformers2__default.default.pascalCase(item.name)}` : void 0
1086
1044
  })
1087
1045
  })
1088
- ] : _utils3.getASTParams.call(void 0, schemas.pathParams, {
1046
+ ] : utils$1.getASTParams(schemas.pathParams, {
1089
1047
  typed: true,
1090
1048
  override: (item) => ({
1091
1049
  ...item,
1092
- name: item.name ? `ref${_transformers2.default.pascalCase(item.name)}` : void 0
1050
+ name: item.name ? `ref${transformers2__default.default.pascalCase(item.name)}` : void 0
1093
1051
  })
1094
1052
  }),
1095
1053
  {
1096
1054
  name: "refParams",
1097
- type: `MaybeRef<${_optionalChain([schemas, 'access', _126 => _126.queryParams, 'optionalAccess', _127 => _127.name])}>`,
1055
+ type: `MaybeRef<${schemas.queryParams?.name}>`,
1098
1056
  enabled: client.withQueryParams,
1099
- required: _oas.isRequired.call(void 0, _optionalChain([schemas, 'access', _128 => _128.queryParams, 'optionalAccess', _129 => _129.schema]))
1057
+ required: oas.isRequired(schemas.queryParams?.schema)
1100
1058
  },
1101
1059
  {
1102
1060
  name: "refHeaders",
1103
- type: `MaybeRef<${_optionalChain([schemas, 'access', _130 => _130.headerParams, 'optionalAccess', _131 => _131.name])}>`,
1061
+ type: `MaybeRef<${schemas.headerParams?.name}>`,
1104
1062
  enabled: client.withHeaders,
1105
- required: _oas.isRequired.call(void 0, _optionalChain([schemas, 'access', _132 => _132.headerParams, 'optionalAccess', _133 => _133.schema]))
1063
+ required: oas.isRequired(schemas.headerParams?.schema)
1106
1064
  },
1107
1065
  {
1108
1066
  name: "refData",
1109
- type: `MaybeRef<${_optionalChain([schemas, 'access', _134 => _134.request, 'optionalAccess', _135 => _135.name])}>`,
1067
+ type: `MaybeRef<${schemas.request?.name}>`,
1110
1068
  enabled: client.withData,
1111
- required: _oas.isRequired.call(void 0, _optionalChain([schemas, 'access', _136 => _136.request, 'optionalAccess', _137 => _137.schema]))
1069
+ required: oas.isRequired(schemas.request?.schema)
1112
1070
  },
1113
1071
  {
1114
1072
  name: "options",
@@ -1120,22 +1078,22 @@ var defaultTemplates5 = {
1120
1078
  }
1121
1079
  ]);
1122
1080
  queryParams.add([
1123
- ..._utils3.getASTParams.call(void 0, schemas.pathParams, {
1081
+ ...utils$1.getASTParams(schemas.pathParams, {
1124
1082
  typed: false,
1125
1083
  override: (item) => ({
1126
1084
  ...item,
1127
- name: item.name ? `ref${_transformers2.default.pascalCase(item.name)}` : void 0
1085
+ name: item.name ? `ref${transformers2__default.default.pascalCase(item.name)}` : void 0
1128
1086
  })
1129
1087
  }),
1130
1088
  {
1131
1089
  name: "refParams",
1132
1090
  enabled: client.withQueryParams,
1133
- required: _oas.isRequired.call(void 0, _optionalChain([schemas, 'access', _138 => _138.queryParams, 'optionalAccess', _139 => _139.schema]))
1091
+ required: oas.isRequired(schemas.queryParams?.schema)
1134
1092
  },
1135
1093
  {
1136
1094
  name: "refHeaders",
1137
1095
  enabled: client.withHeaders,
1138
- required: _oas.isRequired.call(void 0, _optionalChain([schemas, 'access', _140 => _140.headerParams, 'optionalAccess', _141 => _141.schema]))
1096
+ required: oas.isRequired(schemas.headerParams?.schema)
1139
1097
  },
1140
1098
  {
1141
1099
  name: "clientOptions",
@@ -1144,30 +1102,30 @@ var defaultTemplates5 = {
1144
1102
  ]);
1145
1103
  queryKeyParams.add([
1146
1104
  ...pathParamsType === "object" ? [
1147
- _utils3.getASTParams.call(void 0, schemas.pathParams, {
1105
+ utils$1.getASTParams(schemas.pathParams, {
1148
1106
  override: (item) => ({
1149
1107
  ...item,
1150
- name: item.name ? `ref${_transformers2.default.pascalCase(item.name)}` : void 0
1108
+ name: item.name ? `ref${transformers2__default.default.pascalCase(item.name)}` : void 0
1151
1109
  })
1152
1110
  })
1153
- ] : _utils3.getASTParams.call(void 0, schemas.pathParams, {
1111
+ ] : utils$1.getASTParams(schemas.pathParams, {
1154
1112
  override: (item) => ({
1155
1113
  ...item,
1156
- name: item.name ? `ref${_transformers2.default.pascalCase(item.name)}` : void 0
1114
+ name: item.name ? `ref${transformers2__default.default.pascalCase(item.name)}` : void 0
1157
1115
  })
1158
1116
  }),
1159
1117
  {
1160
1118
  name: "refParams",
1161
1119
  enabled: client.withQueryParams,
1162
- required: _oas.isRequired.call(void 0, _optionalChain([schemas, 'access', _142 => _142.queryParams, 'optionalAccess', _143 => _143.schema]))
1120
+ required: oas.isRequired(schemas.queryParams?.schema)
1163
1121
  },
1164
1122
  {
1165
1123
  name: "refData",
1166
1124
  enabled: client.withData,
1167
- required: _oas.isRequired.call(void 0, _optionalChain([schemas, 'access', _144 => _144.request, 'optionalAccess', _145 => _145.schema]))
1125
+ required: oas.isRequired(schemas.request?.schema)
1168
1126
  }
1169
1127
  ]);
1170
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1128
+ return /* @__PURE__ */ jsxRuntime.jsx(
1171
1129
  Template5,
1172
1130
  {
1173
1131
  ...rest,
@@ -1200,12 +1158,12 @@ function Query({
1200
1158
  key: pluginKey,
1201
1159
  options: { dataReturnType, pathParamsType }
1202
1160
  }
1203
- } = _react.useApp.call(void 0, );
1204
- const operation = _hooks.useOperation.call(void 0, );
1205
- const { getSchemas, getName } = _hooks.useOperationManager.call(void 0, );
1206
- const schemas = getSchemas(operation, { pluginKey: [_plugints.pluginTsName], type: "type" });
1161
+ } = react.useApp();
1162
+ const operation = hooks.useOperation();
1163
+ const { getSchemas, getName } = hooks.useOperationManager();
1164
+ const schemas = getSchemas(operation, { pluginKey: [pluginTs.pluginTsName], type: "type" });
1207
1165
  const name = getName(operation, { type: "function" });
1208
- const isV5 = new (0, _core.PackageManager)().isValidSync(reactQueryDepRegex, ">=5");
1166
+ const isV5 = new core.PackageManager().isValidSync(reactQueryDepRegex, ">=5");
1209
1167
  const queryKey = pluginManager.resolveName({
1210
1168
  name: [factory.name, props.infinite ? "Infinite" : void 0, props.suspense ? "Suspense" : void 0, "QueryKey"].filter(Boolean).join(""),
1211
1169
  pluginKey
@@ -1219,17 +1177,17 @@ function Query({
1219
1177
  name: [factory.name, props.infinite ? "Infinite" : void 0, props.suspense ? "Suspense" : void 0, "QueryOptions"].filter(Boolean).join(""),
1220
1178
  pluginKey
1221
1179
  });
1222
- const generics = new (0, _utils.FunctionParams)();
1223
- const params = new (0, _utils.FunctionParams)();
1224
- const queryParams = new (0, _utils.FunctionParams)();
1225
- const queryKeyParams = new (0, _utils.FunctionParams)();
1180
+ const generics = new utils.FunctionParams();
1181
+ const params = new utils.FunctionParams();
1182
+ const queryParams = new utils.FunctionParams();
1183
+ const queryKeyParams = new utils.FunctionParams();
1226
1184
  const client = {
1227
1185
  method: operation.method,
1228
- path: new (0, _utils.URLPath)(operation.path),
1229
- withQueryParams: !!_optionalChain([schemas, 'access', _146 => _146.queryParams, 'optionalAccess', _147 => _147.name]),
1230
- withData: !!_optionalChain([schemas, 'access', _148 => _148.request, 'optionalAccess', _149 => _149.name]),
1231
- withPathParams: !!_optionalChain([schemas, 'access', _150 => _150.pathParams, 'optionalAccess', _151 => _151.name]),
1232
- withHeaders: !!_optionalChain([schemas, 'access', _152 => _152.headerParams, 'optionalAccess', _153 => _153.name])
1186
+ path: new utils.URLPath(operation.path),
1187
+ withQueryParams: !!schemas.queryParams?.name,
1188
+ withData: !!schemas.request?.name,
1189
+ withPathParams: !!schemas.pathParams?.name,
1190
+ withHeaders: !!schemas.headerParams?.name
1233
1191
  };
1234
1192
  generics.add([
1235
1193
  {
@@ -1243,24 +1201,24 @@ function Query({
1243
1201
  const queryOptionsOverrideGenerics = props.suspense ? [`${factory.name}['response']`, `${factory.name}['error']`, "TData", "TQueryKey"] : [`${factory.name}['response']`, `${factory.name}['error']`, "TData", "TQueryData", "TQueryKey"];
1244
1202
  const queryOptionsGenerics = props.suspense ? ["TData"] : ["TData", "TQueryData"];
1245
1203
  params.add([
1246
- ...pathParamsType === "object" ? [_utils3.getASTParams.call(void 0, schemas.pathParams, { typed: true })] : _utils3.getASTParams.call(void 0, schemas.pathParams, { typed: true }),
1204
+ ...pathParamsType === "object" ? [utils$1.getASTParams(schemas.pathParams, { typed: true })] : utils$1.getASTParams(schemas.pathParams, { typed: true }),
1247
1205
  {
1248
1206
  name: "params",
1249
1207
  type: `${factory.name}['queryParams']`,
1250
1208
  enabled: client.withQueryParams,
1251
- required: _oas.isRequired.call(void 0, _optionalChain([schemas, 'access', _154 => _154.queryParams, 'optionalAccess', _155 => _155.schema]))
1209
+ required: oas.isRequired(schemas.queryParams?.schema)
1252
1210
  },
1253
1211
  {
1254
1212
  name: "headers",
1255
1213
  type: `${factory.name}['headerParams']`,
1256
1214
  enabled: client.withHeaders,
1257
- required: _oas.isRequired.call(void 0, _optionalChain([schemas, 'access', _156 => _156.headerParams, 'optionalAccess', _157 => _157.schema]))
1215
+ required: oas.isRequired(schemas.headerParams?.schema)
1258
1216
  },
1259
1217
  {
1260
1218
  name: "data",
1261
1219
  type: `${factory.name}['request']`,
1262
1220
  enabled: client.withData,
1263
- required: _oas.isRequired.call(void 0, _optionalChain([schemas, 'access', _158 => _158.request, 'optionalAccess', _159 => _159.schema]))
1221
+ required: oas.isRequired(schemas.request?.schema)
1264
1222
  },
1265
1223
  {
1266
1224
  name: "options",
@@ -1272,21 +1230,21 @@ function Query({
1272
1230
  }
1273
1231
  ]);
1274
1232
  queryParams.add([
1275
- ...pathParamsType === "object" ? [_utils3.getASTParams.call(void 0, schemas.pathParams)] : _utils3.getASTParams.call(void 0, schemas.pathParams),
1233
+ ...pathParamsType === "object" ? [utils$1.getASTParams(schemas.pathParams)] : utils$1.getASTParams(schemas.pathParams),
1276
1234
  {
1277
1235
  name: "params",
1278
1236
  enabled: client.withQueryParams,
1279
- required: _oas.isRequired.call(void 0, _optionalChain([schemas, 'access', _160 => _160.queryParams, 'optionalAccess', _161 => _161.schema]))
1237
+ required: oas.isRequired(schemas.queryParams?.schema)
1280
1238
  },
1281
1239
  {
1282
1240
  name: "headers",
1283
1241
  enabled: client.withHeaders,
1284
- required: _oas.isRequired.call(void 0, _optionalChain([schemas, 'access', _162 => _162.headerParams, 'optionalAccess', _163 => _163.schema]))
1242
+ required: oas.isRequired(schemas.headerParams?.schema)
1285
1243
  },
1286
1244
  {
1287
1245
  name: "data",
1288
1246
  enabled: client.withData,
1289
- required: _oas.isRequired.call(void 0, _optionalChain([schemas, 'access', _164 => _164.request, 'optionalAccess', _165 => _165.schema]))
1247
+ required: oas.isRequired(schemas.request?.schema)
1290
1248
  },
1291
1249
  {
1292
1250
  name: "clientOptions",
@@ -1294,16 +1252,16 @@ function Query({
1294
1252
  }
1295
1253
  ]);
1296
1254
  queryKeyParams.add([
1297
- ...pathParamsType === "object" ? [_utils3.getASTParams.call(void 0, schemas.pathParams)] : _utils3.getASTParams.call(void 0, schemas.pathParams),
1255
+ ...pathParamsType === "object" ? [utils$1.getASTParams(schemas.pathParams)] : utils$1.getASTParams(schemas.pathParams),
1298
1256
  {
1299
1257
  name: "params",
1300
1258
  enabled: client.withQueryParams,
1301
- required: _oas.isRequired.call(void 0, _optionalChain([schemas, 'access', _166 => _166.queryParams, 'optionalAccess', _167 => _167.schema]))
1259
+ required: oas.isRequired(schemas.queryParams?.schema)
1302
1260
  },
1303
1261
  {
1304
1262
  name: "data",
1305
1263
  enabled: client.withData,
1306
- required: _oas.isRequired.call(void 0, _optionalChain([schemas, 'access', _168 => _168.request, 'optionalAccess', _169 => _169.schema]))
1264
+ required: oas.isRequired(schemas.request?.schema)
1307
1265
  }
1308
1266
  ]);
1309
1267
  const hook = {
@@ -1312,8 +1270,8 @@ function Query({
1312
1270
  queryOptions: isV5 ? `${queryOptions}(${queryParams.toString()})` : `${queryOptions}<${queryOptionsGenerics.join(", ")}>(${queryParams.toString()})`,
1313
1271
  queryKey: `${queryKey}(${queryKeyParams.toString()})`
1314
1272
  };
1315
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
1316
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1273
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1274
+ /* @__PURE__ */ jsxRuntime.jsx(
1317
1275
  QueryKey,
1318
1276
  {
1319
1277
  keysFn: props.query ? props.query.queryKey : (keys) => keys,
@@ -1323,7 +1281,7 @@ function Query({
1323
1281
  typeName: queryKeyType
1324
1282
  }
1325
1283
  ),
1326
- props.queryOptions && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1284
+ props.queryOptions && /* @__PURE__ */ jsxRuntime.jsx(
1327
1285
  QueryOptions,
1328
1286
  {
1329
1287
  Template: QueryOptionsTemplate,
@@ -1334,12 +1292,12 @@ function Query({
1334
1292
  suspense: props.suspense
1335
1293
  }
1336
1294
  ),
1337
- props.query && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1295
+ props.query && /* @__PURE__ */ jsxRuntime.jsx(
1338
1296
  Template6,
1339
1297
  {
1340
1298
  name: [name, props.infinite ? "Infinite" : void 0, props.suspense ? "Suspense" : void 0].filter(Boolean).join(""),
1341
1299
  generics: generics.toString(),
1342
- JSDoc: { comments: _utils3.getComments.call(void 0, operation) },
1300
+ JSDoc: { comments: utils$1.getComments(operation) },
1343
1301
  params: params.toString(),
1344
1302
  returnType: `${resultType}<${resultGenerics.join(", ")}>`,
1345
1303
  hook,
@@ -1364,51 +1322,51 @@ Query.File = function({ templates }) {
1364
1322
  parser
1365
1323
  }
1366
1324
  }
1367
- } = _react.useApp.call(void 0, );
1368
- const { getSchemas, getFile, getName } = _hooks.useOperationManager.call(void 0, );
1369
- const operation = _hooks.useOperation.call(void 0, );
1370
- const schemas = getSchemas(operation, { pluginKey: [_plugints.pluginTsName], type: "type" });
1371
- const zodSchemas = getSchemas(operation, { pluginKey: [_pluginzod.pluginZodName], type: "function" });
1325
+ } = react.useApp();
1326
+ const { getSchemas, getFile, getName } = hooks.useOperationManager();
1327
+ const operation = hooks.useOperation();
1328
+ const schemas = getSchemas(operation, { pluginKey: [pluginTs.pluginTsName], type: "type" });
1329
+ const zodSchemas = getSchemas(operation, { pluginKey: [pluginZod.pluginZodName], type: "function" });
1372
1330
  const file = getFile(operation);
1373
- const fileType = getFile(operation, { pluginKey: [_plugints.pluginTsName] });
1331
+ const fileType = getFile(operation, { pluginKey: [pluginTs.pluginTsName] });
1374
1332
  const fileZodSchemas = getFile(operation, {
1375
- pluginKey: [_pluginzod.pluginZodName]
1333
+ pluginKey: [pluginZod.pluginZodName]
1376
1334
  });
1377
1335
  const factoryName = getName(operation, { type: "type" });
1378
1336
  const importNames = getImportNames();
1379
- const isV5 = new (0, _core.PackageManager)().isValidSync(reactQueryDepRegex, ">=5");
1380
- const Template6 = _optionalChain([templates, 'optionalAccess', _170 => _170.query, 'access', _171 => _171["react"]]) || defaultTemplates5["react"];
1381
- const QueryOptionsTemplate = _optionalChain([templates, 'optionalAccess', _172 => _172.queryOptions, 'access', _173 => _173["react"]]) || QueryOptions.templates["react"];
1382
- const QueryKeyTemplate = _optionalChain([templates, 'optionalAccess', _174 => _174.queryKey, 'access', _175 => _175["react"]]) || QueryKey.templates["react"];
1383
- const Import = _optionalChain([templates, 'optionalAccess', _176 => _176.queryImports, 'access', _177 => _177["react"]]) || QueryImports.templates["react"];
1337
+ const isV5 = new core.PackageManager().isValidSync(reactQueryDepRegex, ">=5");
1338
+ const Template6 = templates?.query["react"] || defaultTemplates5["react"];
1339
+ const QueryOptionsTemplate = templates?.queryOptions["react"] || QueryOptions.templates["react"];
1340
+ const QueryKeyTemplate = templates?.queryKey["react"] || QueryKey.templates["react"];
1341
+ const Import = templates?.queryImports["react"] || QueryImports.templates["react"];
1384
1342
  const factory = {
1385
1343
  name: factoryName
1386
1344
  };
1387
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _react.File, { baseName: file.baseName, path: file.path, meta: file.meta, children: [
1388
- parser === "zod" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.File.Import, { name: [_optionalChain([zodSchemas, 'access', _178 => _178.response, 'optionalAccess', _179 => _179.name])], root: file.path, path: fileZodSchemas.path }),
1389
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.File.Import, { name: "client", path: importPath }),
1390
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.File.Import, { name: ["ResponseConfig"], path: importPath, isTypeOnly: true }),
1391
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1392
- _react.File.Import,
1345
+ return /* @__PURE__ */ jsxRuntime.jsxs(react.File, { baseName: file.baseName, path: file.path, meta: file.meta, children: [
1346
+ parser === "zod" && /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: [zodSchemas.response?.name], root: file.path, path: fileZodSchemas.path }),
1347
+ /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: "client", path: importPath }),
1348
+ /* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: ["ResponseConfig"], path: importPath, isTypeOnly: true }),
1349
+ /* @__PURE__ */ jsxRuntime.jsx(
1350
+ react.File.Import,
1393
1351
  {
1394
1352
  name: [
1395
- _optionalChain([schemas, 'access', _180 => _180.request, 'optionalAccess', _181 => _181.name]),
1353
+ schemas.request?.name,
1396
1354
  schemas.response.name,
1397
- _optionalChain([schemas, 'access', _182 => _182.pathParams, 'optionalAccess', _183 => _183.name]),
1398
- _optionalChain([schemas, 'access', _184 => _184.queryParams, 'optionalAccess', _185 => _185.name]),
1399
- _optionalChain([schemas, 'access', _186 => _186.headerParams, 'optionalAccess', _187 => _187.name]),
1400
- ..._optionalChain([schemas, 'access', _188 => _188.errors, 'optionalAccess', _189 => _189.map, 'call', _190 => _190((error) => error.name)]) || []
1355
+ schemas.pathParams?.name,
1356
+ schemas.queryParams?.name,
1357
+ schemas.headerParams?.name,
1358
+ ...schemas.errors?.map((error) => error.name) || []
1401
1359
  ].filter(Boolean),
1402
1360
  root: file.path,
1403
1361
  path: fileType.path,
1404
1362
  isTypeOnly: true
1405
1363
  }
1406
1364
  ),
1407
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, QueryImports, { hookPath: typeof query !== "boolean" ? query.importPath : void 0, Template: Import, isInfinite: false, isSuspense: false }),
1408
- !!infinite && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, QueryImports, { hookPath: typeof query !== "boolean" ? query.importPath : void 0, Template: Import, isInfinite: true, isSuspense: false }),
1409
- !!suspense && isV5 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, QueryImports, { hookPath: typeof query !== "boolean" ? query.importPath : void 0, Template: Import, isInfinite: false, isSuspense: true }),
1410
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, SchemaType, {}),
1411
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1365
+ /* @__PURE__ */ jsxRuntime.jsx(QueryImports, { hookPath: typeof query !== "boolean" ? query.importPath : void 0, Template: Import, isInfinite: false, isSuspense: false }),
1366
+ !!infinite && /* @__PURE__ */ jsxRuntime.jsx(QueryImports, { hookPath: typeof query !== "boolean" ? query.importPath : void 0, Template: Import, isInfinite: true, isSuspense: false }),
1367
+ !!suspense && isV5 && /* @__PURE__ */ jsxRuntime.jsx(QueryImports, { hookPath: typeof query !== "boolean" ? query.importPath : void 0, Template: Import, isInfinite: false, isSuspense: true }),
1368
+ /* @__PURE__ */ jsxRuntime.jsx(SchemaType, {}),
1369
+ /* @__PURE__ */ jsxRuntime.jsx(
1412
1370
  Query,
1413
1371
  {
1414
1372
  factory,
@@ -1424,7 +1382,7 @@ Query.File = function({ templates }) {
1424
1382
  optionsType: importNames.query["react"].optionsType
1425
1383
  }
1426
1384
  ),
1427
- !!infinite && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1385
+ !!infinite && /* @__PURE__ */ jsxRuntime.jsx(
1428
1386
  Query,
1429
1387
  {
1430
1388
  factory,
@@ -1440,7 +1398,7 @@ Query.File = function({ templates }) {
1440
1398
  optionsType: importNames.queryInfinite["react"].optionsType
1441
1399
  }
1442
1400
  ),
1443
- !!suspense && isV5 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1401
+ !!suspense && isV5 && /* @__PURE__ */ jsxRuntime.jsx(
1444
1402
  Query,
1445
1403
  {
1446
1404
  factory,
@@ -1460,11 +1418,10 @@ Query.File = function({ templates }) {
1460
1418
  };
1461
1419
  Query.templates = defaultTemplates5;
1462
1420
 
1463
-
1464
-
1465
-
1466
-
1467
-
1468
-
1469
- exports.Mutation = Mutation; exports.QueryImports = QueryImports; exports.QueryKey = QueryKey; exports.QueryOptions = QueryOptions; exports.Query = Query;
1421
+ exports.Mutation = Mutation;
1422
+ exports.Query = Query;
1423
+ exports.QueryImports = QueryImports;
1424
+ exports.QueryKey = QueryKey;
1425
+ exports.QueryOptions = QueryOptions;
1426
+ //# sourceMappingURL=chunk-7ZODZVKP.cjs.map
1470
1427
  //# sourceMappingURL=chunk-7ZODZVKP.cjs.map