@kubb/plugin-fetch 5.0.0-beta.81 → 5.0.0-beta.84
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +41 -43
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +6 -8
- package/dist/index.js.map +1 -1
- package/package.json +5 -7
- package/src/generators/clientGenerator.tsx +2 -2
- package/src/plugin.ts +2 -2
- package/src/types.ts +1 -1
- package/templates/fetch.ts +20 -10
- package/templates/serializers.ts +4 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __name } from "./rolldown-runtime-C0LytTxp.js";
|
|
2
|
-
import { Exclude, Group, Include, Output, OutputOptions, Override, PluginFactoryOptions, Resolver, ast } from "
|
|
2
|
+
import { Exclude, Group, Include, Output, OutputOptions, Override, PluginFactoryOptions, Resolver, ast } from "kubb/kit";
|
|
3
3
|
//#region ../../internals/client/src/types.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* Validator applied to request and response bodies using schemas from `@kubb/plugin-zod`.
|
|
@@ -179,7 +179,7 @@ declare global {
|
|
|
179
179
|
* operation using the shared `Operation` component: a grouped `<Name>Request` type and a function that
|
|
180
180
|
* forwards a single `options` object to the bundled `client` and returns the `RequestResult`.
|
|
181
181
|
*/
|
|
182
|
-
declare const clientGenerator: import("
|
|
182
|
+
declare const clientGenerator: import("kubb/kit").Generator<PluginFetch, unknown>;
|
|
183
183
|
//#endregion
|
|
184
184
|
//#region src/plugin.d.ts
|
|
185
185
|
/**
|
|
@@ -195,7 +195,7 @@ declare const pluginFetchName = "plugin-fetch";
|
|
|
195
195
|
*
|
|
196
196
|
* @example
|
|
197
197
|
* ```ts
|
|
198
|
-
* import { defineConfig } from 'kubb'
|
|
198
|
+
* import { defineConfig } from 'kubb/config'
|
|
199
199
|
* import { pluginTs } from '@kubb/plugin-ts'
|
|
200
200
|
* import { pluginFetch } from '@kubb/plugin-fetch'
|
|
201
201
|
*
|
|
@@ -209,7 +209,7 @@ declare const pluginFetchName = "plugin-fetch";
|
|
|
209
209
|
* })
|
|
210
210
|
* ```
|
|
211
211
|
*/
|
|
212
|
-
declare const pluginFetch: (options?: Options | undefined) => import("
|
|
212
|
+
declare const pluginFetch: (options?: Options | undefined) => import("kubb/kit").Plugin<PluginFetch>;
|
|
213
213
|
//#endregion
|
|
214
214
|
export { type Options, type PluginFetch, type ResolvedOptions, type ResolverClient, clientGenerator, pluginFetch as default, pluginFetch, pluginFetchName };
|
|
215
215
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import "./rolldown-runtime-C0LytTxp.js";
|
|
2
2
|
import path from "node:path";
|
|
3
|
-
import { ast, defineGenerator, definePlugin, defineResolver } from "
|
|
4
|
-
import { File, Function, jsxRenderer } from "
|
|
3
|
+
import { ast, defineGenerator, definePlugin, defineResolver } from "kubb/kit";
|
|
4
|
+
import { File, Function, jsxRenderer } from "kubb/jsx";
|
|
5
5
|
import { createFunctionParameter, createFunctionParameters, functionPrinter, pluginTsName } from "@kubb/plugin-ts";
|
|
6
|
-
import { Fragment, jsx, jsxs } from "
|
|
6
|
+
import { Fragment, jsx, jsxs } from "kubb/jsx/jsx-runtime";
|
|
7
7
|
import { pluginZodName } from "@kubb/plugin-zod";
|
|
8
|
-
import { buildJSDoc } from "@kubb/ast/utils";
|
|
9
|
-
import { macroSimplifyUnion } from "@kubb/ast/macros";
|
|
10
8
|
import { fileURLToPath } from "node:url";
|
|
11
9
|
//#region ../../internals/utils/src/casing.ts
|
|
12
10
|
/**
|
|
@@ -920,7 +918,7 @@ function buildSdkMethod({ node, name, tsResolver, zodResolver, validator, securi
|
|
|
920
918
|
})
|
|
921
919
|
});
|
|
922
920
|
const generics = signature.generics.length ? `<${signature.generics.join(", ")}>` : "";
|
|
923
|
-
const jsdoc = buildJSDoc(buildOperationComments(node, {
|
|
921
|
+
const jsdoc = ast.buildJSDoc(buildOperationComments(node, {
|
|
924
922
|
link: "urlPath",
|
|
925
923
|
linkPosition: "beforeDeprecated",
|
|
926
924
|
splitLines: true
|
|
@@ -1234,7 +1232,7 @@ function createSdkGenerator() {
|
|
|
1234
1232
|
* drops union members a broader scalar already covers, keeping the generated response and error
|
|
1235
1233
|
* unions tidy. A plugin wires them with `ctx.setMacros([...defaultMacros, ...userMacros])`.
|
|
1236
1234
|
*/
|
|
1237
|
-
const defaultMacros = [macroSimplifyUnion];
|
|
1235
|
+
const defaultMacros = [ast.macroSimplifyUnion];
|
|
1238
1236
|
//#endregion
|
|
1239
1237
|
//#region ../../internals/client/src/resolver.ts
|
|
1240
1238
|
/**
|
|
@@ -1406,7 +1404,7 @@ const pluginFetchName = "plugin-fetch";
|
|
|
1406
1404
|
*
|
|
1407
1405
|
* @example
|
|
1408
1406
|
* ```ts
|
|
1409
|
-
* import { defineConfig } from 'kubb'
|
|
1407
|
+
* import { defineConfig } from 'kubb/config'
|
|
1410
1408
|
* import { pluginTs } from '@kubb/plugin-ts'
|
|
1411
1409
|
* import { pluginFetch } from '@kubb/plugin-fetch'
|
|
1412
1410
|
*
|