@kubb/plugin-client 4.4.0 → 4.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Operations-CmHRmAdn.js → Operations-HWuo-D3O.js} +2 -2
- package/dist/{Operations-CmHRmAdn.js.map → Operations-HWuo-D3O.js.map} +1 -1
- package/dist/{Operations-DXjVfmrY.cjs → Operations-b9-WgfsC.cjs} +36 -8
- package/dist/{Operations-DXjVfmrY.cjs.map → Operations-b9-WgfsC.cjs.map} +1 -1
- package/dist/components.cjs +1 -1
- package/dist/components.d.cts +1 -1
- package/dist/components.d.ts +1 -1
- package/dist/components.js +1 -1
- package/dist/{generators-C_ySk_ES.cjs → generators-BZihoaAC.cjs} +69 -60
- package/dist/generators-BZihoaAC.cjs.map +1 -0
- package/dist/{generators-0Sc5zPfx.js → generators-CQvDx6Mq.js} +60 -51
- package/dist/generators-CQvDx6Mq.js.map +1 -0
- package/dist/generators.cjs +2 -2
- package/dist/generators.d.cts +4 -4
- package/dist/generators.d.ts +4 -4
- package/dist/generators.js +2 -2
- package/dist/index.cjs +20 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +14 -3
- package/dist/index.js.map +1 -1
- package/dist/{types-CMiGIvE1.d.cts → types-BI2oGQis.d.ts} +187 -307
- package/dist/{types-BtM-bA4L.d.ts → types-DQTXVaz_.d.cts} +187 -307
- package/package.json +20 -26
- package/src/generators/clientGenerator.tsx +25 -7
- package/src/generators/groupedClientGenerator.tsx +6 -6
- package/src/generators/index.ts +1 -1
- package/src/generators/operationsGenerator.tsx +4 -4
- package/src/plugin.ts +21 -1
- package/src/types.ts +6 -5
- package/{src → templates}/clients/axios.ts +1 -2
- package/dist/chunk-CUT6urMc.cjs +0 -30
- package/dist/clients/axios.cjs +0 -40
- package/dist/clients/axios.cjs.map +0 -1
- package/dist/clients/axios.d.cts +0 -39
- package/dist/clients/axios.d.ts +0 -39
- package/dist/clients/axios.js +0 -33
- package/dist/clients/axios.js.map +0 -1
- package/dist/clients/fetch.cjs +0 -48
- package/dist/clients/fetch.cjs.map +0 -1
- package/dist/clients/fetch.d.cts +0 -39
- package/dist/clients/fetch.d.ts +0 -39
- package/dist/clients/fetch.js +0 -43
- package/dist/clients/fetch.js.map +0 -1
- package/dist/generators-0Sc5zPfx.js.map +0 -1
- package/dist/generators-C_ySk_ES.cjs.map +0 -1
- /package/{src → templates}/clients/fetch.ts +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubb/plugin-client",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.5.0",
|
|
4
4
|
"description": "API client generator plugin for Kubb, creating type-safe HTTP clients (Axios, Fetch) from OpenAPI specifications for making API requests.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"api-client",
|
|
@@ -31,14 +31,6 @@
|
|
|
31
31
|
"import": "./dist/index.js",
|
|
32
32
|
"require": "./dist/index.cjs"
|
|
33
33
|
},
|
|
34
|
-
"./clients/axios": {
|
|
35
|
-
"import": "./dist/clients/axios.js",
|
|
36
|
-
"require": "./dist/clients/axios.cjs"
|
|
37
|
-
},
|
|
38
|
-
"./clients/fetch": {
|
|
39
|
-
"import": "./dist/clients/fetch.js",
|
|
40
|
-
"require": "./dist/clients/fetch.cjs"
|
|
41
|
-
},
|
|
42
34
|
"./components": {
|
|
43
35
|
"import": "./dist/components.js",
|
|
44
36
|
"require": "./dist/components.cjs"
|
|
@@ -47,6 +39,7 @@
|
|
|
47
39
|
"import": "./dist/generators.js",
|
|
48
40
|
"require": "./dist/generators.cjs"
|
|
49
41
|
},
|
|
42
|
+
"./templates/*": "./templates/*",
|
|
50
43
|
"./package.json": "./package.json"
|
|
51
44
|
},
|
|
52
45
|
"main": "./dist/index.cjs",
|
|
@@ -59,38 +52,39 @@
|
|
|
59
52
|
],
|
|
60
53
|
"generators": [
|
|
61
54
|
"./dist/generators.d.ts"
|
|
62
|
-
],
|
|
63
|
-
"clients/axios": [
|
|
64
|
-
"./dist/clients/axios.d.ts"
|
|
65
|
-
],
|
|
66
|
-
"clients/fetch": [
|
|
67
|
-
"./dist/clients/fetch.d.ts"
|
|
68
55
|
]
|
|
69
56
|
}
|
|
70
57
|
},
|
|
71
58
|
"files": [
|
|
72
59
|
"src",
|
|
73
60
|
"dist",
|
|
61
|
+
"templates",
|
|
74
62
|
"*.d.ts",
|
|
75
63
|
"*.d.cts",
|
|
76
64
|
"!/**/**.test.**",
|
|
77
65
|
"!/**/__tests__/**"
|
|
78
66
|
],
|
|
67
|
+
"size-limit": [
|
|
68
|
+
{
|
|
69
|
+
"path": "./dist/*.js",
|
|
70
|
+
"limit": "510 KiB",
|
|
71
|
+
"gzip": true
|
|
72
|
+
}
|
|
73
|
+
],
|
|
79
74
|
"dependencies": {
|
|
80
|
-
"@kubb/react-fabric": "0.2.
|
|
81
|
-
"
|
|
82
|
-
"@kubb/
|
|
83
|
-
"@kubb/
|
|
84
|
-
"@kubb/plugin-
|
|
85
|
-
"@kubb/plugin-
|
|
75
|
+
"@kubb/react-fabric": "0.2.14",
|
|
76
|
+
"jiti": "^2.6.1",
|
|
77
|
+
"@kubb/core": "4.5.0",
|
|
78
|
+
"@kubb/oas": "4.5.0",
|
|
79
|
+
"@kubb/plugin-oas": "4.5.0",
|
|
80
|
+
"@kubb/plugin-ts": "4.5.0",
|
|
81
|
+
"@kubb/plugin-zod": "4.5.0"
|
|
86
82
|
},
|
|
87
83
|
"devDependencies": {
|
|
88
|
-
"axios": "^1.13.
|
|
89
|
-
"tsdown": "^0.15.11",
|
|
90
|
-
"typescript": "^5.9.3"
|
|
84
|
+
"axios": "^1.13.1"
|
|
91
85
|
},
|
|
92
86
|
"peerDependencies": {
|
|
93
|
-
"@kubb/react-fabric": "0.2.
|
|
87
|
+
"@kubb/react-fabric": "0.2.14",
|
|
94
88
|
"axios": "^1.7.2"
|
|
95
89
|
},
|
|
96
90
|
"peerDependenciesMeta": {
|
|
@@ -106,7 +100,7 @@
|
|
|
106
100
|
"registry": "https://registry.npmjs.org/"
|
|
107
101
|
},
|
|
108
102
|
"scripts": {
|
|
109
|
-
"build": "tsdown",
|
|
103
|
+
"build": "tsdown && size-limit",
|
|
110
104
|
"clean": "npx rimraf ./dist",
|
|
111
105
|
"lint": "bun biome lint .",
|
|
112
106
|
"lint:fix": "bun biome lint --fix --unsafe .",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import path from 'node:path'
|
|
2
|
+
import { usePluginManager } from '@kubb/core/hooks'
|
|
3
|
+
import { createReactGenerator } from '@kubb/plugin-oas/generators'
|
|
3
4
|
import { useOas, useOperationManager } from '@kubb/plugin-oas/hooks'
|
|
4
5
|
import { getBanner, getFooter } from '@kubb/plugin-oas/utils'
|
|
5
6
|
import { pluginTsName } from '@kubb/plugin-ts'
|
|
@@ -11,13 +12,15 @@ import type { PluginClient } from '../types'
|
|
|
11
12
|
|
|
12
13
|
export const clientGenerator = createReactGenerator<PluginClient>({
|
|
13
14
|
name: 'client',
|
|
14
|
-
Operation({
|
|
15
|
+
Operation({ config, plugin, operation, generator }) {
|
|
15
16
|
const pluginManager = usePluginManager()
|
|
16
17
|
const {
|
|
18
|
+
options,
|
|
17
19
|
options: { output, urlType },
|
|
18
|
-
} =
|
|
20
|
+
} = plugin
|
|
21
|
+
|
|
19
22
|
const oas = useOas()
|
|
20
|
-
const { getSchemas, getName, getFile } = useOperationManager()
|
|
23
|
+
const { getSchemas, getName, getFile } = useOperationManager(generator)
|
|
21
24
|
|
|
22
25
|
const client = {
|
|
23
26
|
name: getName(operation, { type: 'function' }),
|
|
@@ -47,8 +50,23 @@ export const clientGenerator = createReactGenerator<PluginClient>({
|
|
|
47
50
|
banner={getBanner({ oas, output, config: pluginManager.config })}
|
|
48
51
|
footer={getFooter({ oas, output })}
|
|
49
52
|
>
|
|
50
|
-
|
|
51
|
-
|
|
53
|
+
{options.importPath ? (
|
|
54
|
+
<>
|
|
55
|
+
<File.Import name={'fetch'} path={options.importPath} />
|
|
56
|
+
<File.Import name={['RequestConfig', 'ResponseErrorConfig']} path={options.importPath} isTypeOnly />
|
|
57
|
+
</>
|
|
58
|
+
) : (
|
|
59
|
+
<>
|
|
60
|
+
<File.Import name={'fetch'} root={client.file.path} path={path.resolve(config.root, config.output.path, '.kubb/fetcher.ts')} />
|
|
61
|
+
<File.Import
|
|
62
|
+
name={['RequestConfig', 'ResponseErrorConfig']}
|
|
63
|
+
root={client.file.path}
|
|
64
|
+
path={path.resolve(config.root, config.output.path, '.kubb/fetcher.ts')}
|
|
65
|
+
isTypeOnly
|
|
66
|
+
/>
|
|
67
|
+
</>
|
|
68
|
+
)}
|
|
69
|
+
|
|
52
70
|
{options.parser === 'zod' && (
|
|
53
71
|
<File.Import name={[zod.schemas.response.name, zod.schemas.request?.name].filter(Boolean)} root={client.file.path} path={zod.file.path} />
|
|
54
72
|
)}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { usePlugin, usePluginManager } from '@kubb/core/hooks'
|
|
1
|
+
import { usePluginManager } from '@kubb/core/hooks'
|
|
3
2
|
import { camelCase } from '@kubb/core/transformers'
|
|
4
|
-
import {
|
|
3
|
+
import type { KubbFile } from '@kubb/fabric-core/types'
|
|
4
|
+
import { createReactGenerator } from '@kubb/plugin-oas/generators'
|
|
5
5
|
import { useOas, useOperationManager } from '@kubb/plugin-oas/hooks'
|
|
6
6
|
import { getBanner, getFooter } from '@kubb/plugin-oas/utils'
|
|
7
7
|
import { File, Function } from '@kubb/react-fabric'
|
|
@@ -9,12 +9,12 @@ import type { PluginClient } from '../types'
|
|
|
9
9
|
|
|
10
10
|
export const groupedClientGenerator = createReactGenerator<PluginClient>({
|
|
11
11
|
name: 'groupedClient',
|
|
12
|
-
Operations({ operations }) {
|
|
13
|
-
const { options, key: pluginKey } =
|
|
12
|
+
Operations({ operations, generator, plugin }) {
|
|
13
|
+
const { options, key: pluginKey } = plugin
|
|
14
14
|
const pluginManager = usePluginManager()
|
|
15
15
|
|
|
16
16
|
const oas = useOas()
|
|
17
|
-
const { getName, getFile, getGroup } = useOperationManager()
|
|
17
|
+
const { getName, getFile, getGroup } = useOperationManager(generator)
|
|
18
18
|
|
|
19
19
|
const controllers = operations.reduce(
|
|
20
20
|
(acc, operation) => {
|
package/src/generators/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { createReactGenerator } from '@kubb/plugin-oas'
|
|
1
|
+
import { usePluginManager } from '@kubb/core/hooks'
|
|
2
|
+
import { createReactGenerator } from '@kubb/plugin-oas/generators'
|
|
3
3
|
import { useOas } from '@kubb/plugin-oas/hooks'
|
|
4
4
|
import { getBanner, getFooter } from '@kubb/plugin-oas/utils'
|
|
5
5
|
import { File } from '@kubb/react-fabric'
|
|
@@ -8,11 +8,11 @@ import type { PluginClient } from '../types'
|
|
|
8
8
|
|
|
9
9
|
export const operationsGenerator = createReactGenerator<PluginClient>({
|
|
10
10
|
name: 'client',
|
|
11
|
-
Operations({ operations }) {
|
|
11
|
+
Operations({ operations, plugin }) {
|
|
12
12
|
const {
|
|
13
13
|
key: pluginKey,
|
|
14
14
|
options: { output },
|
|
15
|
-
} =
|
|
15
|
+
} = plugin
|
|
16
16
|
const pluginManager = usePluginManager()
|
|
17
17
|
|
|
18
18
|
const oas = useOas()
|
package/src/plugin.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import path from 'node:path'
|
|
2
2
|
import { createPlugin, type Group, getBarrelFiles, getMode, type Plugin, PluginManager } from '@kubb/core'
|
|
3
3
|
import { camelCase } from '@kubb/core/transformers'
|
|
4
|
+
import { resolveModuleSource } from '@kubb/core/utils'
|
|
4
5
|
import type { PluginOas as SwaggerPluginOptions } from '@kubb/plugin-oas'
|
|
5
6
|
import { OperationGenerator, pluginOasName } from '@kubb/plugin-oas'
|
|
6
7
|
import { pluginZodName } from '@kubb/plugin-zod'
|
|
@@ -29,13 +30,14 @@ export const pluginClient = createPlugin<PluginClient>((options) => {
|
|
|
29
30
|
generators = [clientGenerator, group ? groupedClientGenerator : undefined, operations ? operationsGenerator : undefined].filter(Boolean),
|
|
30
31
|
parser = 'client',
|
|
31
32
|
client = 'axios',
|
|
32
|
-
importPath
|
|
33
|
+
importPath,
|
|
33
34
|
contentType,
|
|
34
35
|
} = options
|
|
35
36
|
|
|
36
37
|
return {
|
|
37
38
|
name: pluginClientName,
|
|
38
39
|
options: {
|
|
40
|
+
client,
|
|
39
41
|
output,
|
|
40
42
|
group,
|
|
41
43
|
parser,
|
|
@@ -99,6 +101,24 @@ export const pluginClient = createPlugin<PluginClient>((options) => {
|
|
|
99
101
|
const mode = getMode(path.resolve(root, output.path))
|
|
100
102
|
const baseURL = await swaggerPlugin.context.getBaseURL()
|
|
101
103
|
|
|
104
|
+
// pre add bundled fetcher
|
|
105
|
+
const containsFetcher = this.fileManager.files.some((file) => file.baseName === 'fetcher.ts')
|
|
106
|
+
|
|
107
|
+
if (!this.plugin.options.importPath && !containsFetcher) {
|
|
108
|
+
await this.addFile({
|
|
109
|
+
baseName: 'fetcher.ts',
|
|
110
|
+
path: path.resolve(root, '.kubb/fetcher.ts'),
|
|
111
|
+
sources: [
|
|
112
|
+
{
|
|
113
|
+
name: 'fetcher',
|
|
114
|
+
value: resolveModuleSource(
|
|
115
|
+
this.plugin.options.client === 'fetch' ? '@kubb/plugin-client/templates/clients/fetch' : '@kubb/plugin-client/templates/clients/axios',
|
|
116
|
+
).source,
|
|
117
|
+
},
|
|
118
|
+
],
|
|
119
|
+
})
|
|
120
|
+
}
|
|
121
|
+
|
|
102
122
|
const operationGenerator = new OperationGenerator(
|
|
103
123
|
baseURL
|
|
104
124
|
? {
|
package/src/types.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { Group, Output, PluginFactoryOptions, ResolveNameParams } from '@kubb/core'
|
|
2
2
|
|
|
3
3
|
import type { contentType, Oas } from '@kubb/oas'
|
|
4
|
-
import type { Exclude,
|
|
4
|
+
import type { Exclude, Include, Override, ResolvePathOptions } from '@kubb/plugin-oas'
|
|
5
|
+
import type { Generator } from '@kubb/plugin-oas/generators'
|
|
5
6
|
|
|
6
7
|
export type Options = {
|
|
7
8
|
/**
|
|
@@ -46,7 +47,6 @@ export type Options = {
|
|
|
46
47
|
* Path to the client import path that will be used to do the API calls.
|
|
47
48
|
* It will be used as `import client from '${client.importPath}'`.
|
|
48
49
|
* It allows both relative and absolute path but be aware that we will not change the path.
|
|
49
|
-
* @default '@kubb/plugin-client/clients/axios'
|
|
50
50
|
*/
|
|
51
51
|
importPath?: string
|
|
52
52
|
/**
|
|
@@ -87,8 +87,8 @@ export type Options = {
|
|
|
87
87
|
parser?: 'client' | 'zod'
|
|
88
88
|
/**
|
|
89
89
|
* Which client should be used to do the HTTP calls
|
|
90
|
-
* - 'axios' will use `@kubb/plugin-client/
|
|
91
|
-
* - 'fetch' will use `@kubb/plugin-client/
|
|
90
|
+
* - 'axios' will use `@kubb/plugin-client/templates/axios` to fetch data.
|
|
91
|
+
* - 'fetch' will use `@kubb/plugin-client/templates/fetch` to fetch data.
|
|
92
92
|
* @default 'axios'
|
|
93
93
|
*/
|
|
94
94
|
client?: 'axios' | 'fetch'
|
|
@@ -108,9 +108,10 @@ type ResolvedOptions = {
|
|
|
108
108
|
output: Output<Oas>
|
|
109
109
|
group?: Options['group']
|
|
110
110
|
baseURL: string | undefined
|
|
111
|
+
client: Options['client']
|
|
111
112
|
parser: NonNullable<Options['parser']>
|
|
112
113
|
urlType: NonNullable<Options['urlType']>
|
|
113
|
-
importPath:
|
|
114
|
+
importPath: Options['importPath']
|
|
114
115
|
dataReturnType: NonNullable<Options['dataReturnType']>
|
|
115
116
|
pathParamsType: NonNullable<Options['pathParamsType']>
|
|
116
117
|
paramsType: NonNullable<Options['paramsType']>
|
package/dist/chunk-CUT6urMc.cjs
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
//#region rolldown:runtime
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __copyProps = (to, from, except, desc) => {
|
|
9
|
-
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
10
|
-
key = keys[i];
|
|
11
|
-
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
12
|
-
get: ((k) => from[k]).bind(null, key),
|
|
13
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
19
|
-
value: mod,
|
|
20
|
-
enumerable: true
|
|
21
|
-
}) : target, mod));
|
|
22
|
-
|
|
23
|
-
//#endregion
|
|
24
|
-
|
|
25
|
-
Object.defineProperty(exports, '__toESM', {
|
|
26
|
-
enumerable: true,
|
|
27
|
-
get: function () {
|
|
28
|
-
return __toESM;
|
|
29
|
-
}
|
|
30
|
-
});
|
package/dist/clients/axios.cjs
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
|
-
const require_chunk = require('../chunk-CUT6urMc.cjs');
|
|
3
|
-
let axios = require("axios");
|
|
4
|
-
axios = require_chunk.__toESM(axios);
|
|
5
|
-
|
|
6
|
-
//#region src/clients/axios.ts
|
|
7
|
-
let _config = {
|
|
8
|
-
baseURL: typeof AXIOS_BASE !== "undefined" ? AXIOS_BASE : void 0,
|
|
9
|
-
headers: typeof AXIOS_HEADERS !== "undefined" ? JSON.parse(AXIOS_HEADERS) : void 0
|
|
10
|
-
};
|
|
11
|
-
const getConfig = () => _config;
|
|
12
|
-
const setConfig = (config) => {
|
|
13
|
-
_config = config;
|
|
14
|
-
return getConfig();
|
|
15
|
-
};
|
|
16
|
-
const axiosInstance = axios.default.create(getConfig());
|
|
17
|
-
const client = async (config) => {
|
|
18
|
-
const globalConfig = getConfig();
|
|
19
|
-
return axiosInstance.request({
|
|
20
|
-
...globalConfig,
|
|
21
|
-
...config,
|
|
22
|
-
headers: {
|
|
23
|
-
...globalConfig.headers,
|
|
24
|
-
...config.headers
|
|
25
|
-
}
|
|
26
|
-
}).catch((e) => {
|
|
27
|
-
throw e;
|
|
28
|
-
});
|
|
29
|
-
};
|
|
30
|
-
client.getConfig = getConfig;
|
|
31
|
-
client.setConfig = setConfig;
|
|
32
|
-
var axios_default = client;
|
|
33
|
-
|
|
34
|
-
//#endregion
|
|
35
|
-
exports.axiosInstance = axiosInstance;
|
|
36
|
-
exports.client = client;
|
|
37
|
-
exports.default = axios_default;
|
|
38
|
-
exports.getConfig = getConfig;
|
|
39
|
-
exports.setConfig = setConfig;
|
|
40
|
-
//# sourceMappingURL=axios.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"axios.cjs","names":["_config: Partial<RequestConfig>"],"sources":["../../src/clients/axios.ts"],"sourcesContent":["import axios from 'axios'\n\nimport type { AxiosError, AxiosHeaders, AxiosRequestConfig, AxiosResponse } from 'axios'\n\ndeclare const AXIOS_BASE: string\ndeclare const AXIOS_HEADERS: string\n\n/**\n * Subset of AxiosRequestConfig\n */\nexport type RequestConfig<TData = unknown> = {\n baseURL?: string\n url?: string\n method?: 'GET' | 'PUT' | 'PATCH' | 'POST' | 'DELETE' | 'OPTIONS' | 'HEAD'\n params?: unknown\n data?: TData | FormData\n responseType?: 'arraybuffer' | 'blob' | 'document' | 'json' | 'text' | 'stream'\n signal?: AbortSignal\n validateStatus?: (status: number) => boolean\n headers?: AxiosRequestConfig['headers']\n}\n\n/**\n * Subset of AxiosResponse\n */\nexport type ResponseConfig<TData = unknown> = {\n data: TData\n status: number\n statusText: string\n headers: AxiosResponse['headers']\n}\n\nexport type ResponseErrorConfig<TError = unknown> = AxiosError<TError>\n\nlet _config: Partial<RequestConfig> = {\n baseURL: typeof AXIOS_BASE !== 'undefined' ? AXIOS_BASE : undefined,\n headers: typeof AXIOS_HEADERS !== 'undefined' ? (JSON.parse(AXIOS_HEADERS) as AxiosHeaders) : undefined,\n}\n\nexport const getConfig = () => _config\n\nexport const setConfig = (config: RequestConfig) => {\n _config = config\n return getConfig()\n}\n\nexport const axiosInstance = axios.create(getConfig())\n\nexport const client = async <TData, TError = unknown, TVariables = unknown>(config: RequestConfig<TVariables>): Promise<ResponseConfig<TData>> => {\n const globalConfig = getConfig()\n\n return axiosInstance\n .request<TData, ResponseConfig<TData>>({\n ...globalConfig,\n ...config,\n headers: {\n ...globalConfig.headers,\n ...config.headers,\n },\n })\n .catch((e: AxiosError<TError>) => {\n throw e\n })\n}\n\nclient.getConfig = getConfig\nclient.setConfig = setConfig\n\nexport default client\n"],"mappings":";;;;;;AAkCA,IAAIA,UAAkC;CACpC,SAAS,OAAO,eAAe,cAAc,aAAa;CAC1D,SAAS,OAAO,kBAAkB,cAAe,KAAK,MAAM,cAAc,GAAoB;CAC/F;AAED,MAAa,kBAAkB;AAE/B,MAAa,aAAa,WAA0B;AAClD,WAAU;AACV,QAAO,WAAW;;AAGpB,MAAa,gBAAgB,cAAM,OAAO,WAAW,CAAC;AAEtD,MAAa,SAAS,OAAsD,WAAsE;CAChJ,MAAM,eAAe,WAAW;AAEhC,QAAO,cACJ,QAAsC;EACrC,GAAG;EACH,GAAG;EACH,SAAS;GACP,GAAG,aAAa;GAChB,GAAG,OAAO;GACX;EACF,CAAC,CACD,OAAO,MAA0B;AAChC,QAAM;GACN;;AAGN,OAAO,YAAY;AACnB,OAAO,YAAY;AAEnB,oBAAe"}
|
package/dist/clients/axios.d.cts
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import * as axios0 from "axios";
|
|
2
|
-
import { AxiosError, AxiosRequestConfig, AxiosResponse } from "axios";
|
|
3
|
-
|
|
4
|
-
//#region src/clients/axios.d.ts
|
|
5
|
-
/**
|
|
6
|
-
* Subset of AxiosRequestConfig
|
|
7
|
-
*/
|
|
8
|
-
type RequestConfig<TData = unknown> = {
|
|
9
|
-
baseURL?: string;
|
|
10
|
-
url?: string;
|
|
11
|
-
method?: 'GET' | 'PUT' | 'PATCH' | 'POST' | 'DELETE' | 'OPTIONS' | 'HEAD';
|
|
12
|
-
params?: unknown;
|
|
13
|
-
data?: TData | FormData;
|
|
14
|
-
responseType?: 'arraybuffer' | 'blob' | 'document' | 'json' | 'text' | 'stream';
|
|
15
|
-
signal?: AbortSignal;
|
|
16
|
-
validateStatus?: (status: number) => boolean;
|
|
17
|
-
headers?: AxiosRequestConfig['headers'];
|
|
18
|
-
};
|
|
19
|
-
/**
|
|
20
|
-
* Subset of AxiosResponse
|
|
21
|
-
*/
|
|
22
|
-
type ResponseConfig<TData = unknown> = {
|
|
23
|
-
data: TData;
|
|
24
|
-
status: number;
|
|
25
|
-
statusText: string;
|
|
26
|
-
headers: AxiosResponse['headers'];
|
|
27
|
-
};
|
|
28
|
-
type ResponseErrorConfig<TError = unknown> = AxiosError<TError>;
|
|
29
|
-
declare const getConfig: () => Partial<RequestConfig<unknown>>;
|
|
30
|
-
declare const setConfig: (config: RequestConfig) => Partial<RequestConfig<unknown>>;
|
|
31
|
-
declare const axiosInstance: axios0.AxiosInstance;
|
|
32
|
-
declare const client: {
|
|
33
|
-
<TData, TError = unknown, TVariables = unknown>(config: RequestConfig<TVariables>): Promise<ResponseConfig<TData>>;
|
|
34
|
-
getConfig: () => Partial<RequestConfig<unknown>>;
|
|
35
|
-
setConfig: (config: RequestConfig) => Partial<RequestConfig<unknown>>;
|
|
36
|
-
};
|
|
37
|
-
//#endregion
|
|
38
|
-
export { RequestConfig, ResponseConfig, ResponseErrorConfig, axiosInstance, client, client as default, getConfig, setConfig };
|
|
39
|
-
//# sourceMappingURL=axios.d.cts.map
|
package/dist/clients/axios.d.ts
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import * as axios0 from "axios";
|
|
2
|
-
import { AxiosError, AxiosRequestConfig, AxiosResponse } from "axios";
|
|
3
|
-
|
|
4
|
-
//#region src/clients/axios.d.ts
|
|
5
|
-
/**
|
|
6
|
-
* Subset of AxiosRequestConfig
|
|
7
|
-
*/
|
|
8
|
-
type RequestConfig<TData = unknown> = {
|
|
9
|
-
baseURL?: string;
|
|
10
|
-
url?: string;
|
|
11
|
-
method?: 'GET' | 'PUT' | 'PATCH' | 'POST' | 'DELETE' | 'OPTIONS' | 'HEAD';
|
|
12
|
-
params?: unknown;
|
|
13
|
-
data?: TData | FormData;
|
|
14
|
-
responseType?: 'arraybuffer' | 'blob' | 'document' | 'json' | 'text' | 'stream';
|
|
15
|
-
signal?: AbortSignal;
|
|
16
|
-
validateStatus?: (status: number) => boolean;
|
|
17
|
-
headers?: AxiosRequestConfig['headers'];
|
|
18
|
-
};
|
|
19
|
-
/**
|
|
20
|
-
* Subset of AxiosResponse
|
|
21
|
-
*/
|
|
22
|
-
type ResponseConfig<TData = unknown> = {
|
|
23
|
-
data: TData;
|
|
24
|
-
status: number;
|
|
25
|
-
statusText: string;
|
|
26
|
-
headers: AxiosResponse['headers'];
|
|
27
|
-
};
|
|
28
|
-
type ResponseErrorConfig<TError = unknown> = AxiosError<TError>;
|
|
29
|
-
declare const getConfig: () => Partial<RequestConfig<unknown>>;
|
|
30
|
-
declare const setConfig: (config: RequestConfig) => Partial<RequestConfig<unknown>>;
|
|
31
|
-
declare const axiosInstance: axios0.AxiosInstance;
|
|
32
|
-
declare const client: {
|
|
33
|
-
<TData, TError = unknown, TVariables = unknown>(config: RequestConfig<TVariables>): Promise<ResponseConfig<TData>>;
|
|
34
|
-
getConfig: () => Partial<RequestConfig<unknown>>;
|
|
35
|
-
setConfig: (config: RequestConfig) => Partial<RequestConfig<unknown>>;
|
|
36
|
-
};
|
|
37
|
-
//#endregion
|
|
38
|
-
export { RequestConfig, ResponseConfig, ResponseErrorConfig, axiosInstance, client, client as default, getConfig, setConfig };
|
|
39
|
-
//# sourceMappingURL=axios.d.ts.map
|
package/dist/clients/axios.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import axios from "axios";
|
|
2
|
-
|
|
3
|
-
//#region src/clients/axios.ts
|
|
4
|
-
let _config = {
|
|
5
|
-
baseURL: typeof AXIOS_BASE !== "undefined" ? AXIOS_BASE : void 0,
|
|
6
|
-
headers: typeof AXIOS_HEADERS !== "undefined" ? JSON.parse(AXIOS_HEADERS) : void 0
|
|
7
|
-
};
|
|
8
|
-
const getConfig = () => _config;
|
|
9
|
-
const setConfig = (config) => {
|
|
10
|
-
_config = config;
|
|
11
|
-
return getConfig();
|
|
12
|
-
};
|
|
13
|
-
const axiosInstance = axios.create(getConfig());
|
|
14
|
-
const client = async (config) => {
|
|
15
|
-
const globalConfig = getConfig();
|
|
16
|
-
return axiosInstance.request({
|
|
17
|
-
...globalConfig,
|
|
18
|
-
...config,
|
|
19
|
-
headers: {
|
|
20
|
-
...globalConfig.headers,
|
|
21
|
-
...config.headers
|
|
22
|
-
}
|
|
23
|
-
}).catch((e) => {
|
|
24
|
-
throw e;
|
|
25
|
-
});
|
|
26
|
-
};
|
|
27
|
-
client.getConfig = getConfig;
|
|
28
|
-
client.setConfig = setConfig;
|
|
29
|
-
var axios_default = client;
|
|
30
|
-
|
|
31
|
-
//#endregion
|
|
32
|
-
export { axiosInstance, client, axios_default as default, getConfig, setConfig };
|
|
33
|
-
//# sourceMappingURL=axios.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"axios.js","names":["_config: Partial<RequestConfig>"],"sources":["../../src/clients/axios.ts"],"sourcesContent":["import axios from 'axios'\n\nimport type { AxiosError, AxiosHeaders, AxiosRequestConfig, AxiosResponse } from 'axios'\n\ndeclare const AXIOS_BASE: string\ndeclare const AXIOS_HEADERS: string\n\n/**\n * Subset of AxiosRequestConfig\n */\nexport type RequestConfig<TData = unknown> = {\n baseURL?: string\n url?: string\n method?: 'GET' | 'PUT' | 'PATCH' | 'POST' | 'DELETE' | 'OPTIONS' | 'HEAD'\n params?: unknown\n data?: TData | FormData\n responseType?: 'arraybuffer' | 'blob' | 'document' | 'json' | 'text' | 'stream'\n signal?: AbortSignal\n validateStatus?: (status: number) => boolean\n headers?: AxiosRequestConfig['headers']\n}\n\n/**\n * Subset of AxiosResponse\n */\nexport type ResponseConfig<TData = unknown> = {\n data: TData\n status: number\n statusText: string\n headers: AxiosResponse['headers']\n}\n\nexport type ResponseErrorConfig<TError = unknown> = AxiosError<TError>\n\nlet _config: Partial<RequestConfig> = {\n baseURL: typeof AXIOS_BASE !== 'undefined' ? AXIOS_BASE : undefined,\n headers: typeof AXIOS_HEADERS !== 'undefined' ? (JSON.parse(AXIOS_HEADERS) as AxiosHeaders) : undefined,\n}\n\nexport const getConfig = () => _config\n\nexport const setConfig = (config: RequestConfig) => {\n _config = config\n return getConfig()\n}\n\nexport const axiosInstance = axios.create(getConfig())\n\nexport const client = async <TData, TError = unknown, TVariables = unknown>(config: RequestConfig<TVariables>): Promise<ResponseConfig<TData>> => {\n const globalConfig = getConfig()\n\n return axiosInstance\n .request<TData, ResponseConfig<TData>>({\n ...globalConfig,\n ...config,\n headers: {\n ...globalConfig.headers,\n ...config.headers,\n },\n })\n .catch((e: AxiosError<TError>) => {\n throw e\n })\n}\n\nclient.getConfig = getConfig\nclient.setConfig = setConfig\n\nexport default client\n"],"mappings":";;;AAkCA,IAAIA,UAAkC;CACpC,SAAS,OAAO,eAAe,cAAc,aAAa;CAC1D,SAAS,OAAO,kBAAkB,cAAe,KAAK,MAAM,cAAc,GAAoB;CAC/F;AAED,MAAa,kBAAkB;AAE/B,MAAa,aAAa,WAA0B;AAClD,WAAU;AACV,QAAO,WAAW;;AAGpB,MAAa,gBAAgB,MAAM,OAAO,WAAW,CAAC;AAEtD,MAAa,SAAS,OAAsD,WAAsE;CAChJ,MAAM,eAAe,WAAW;AAEhC,QAAO,cACJ,QAAsC;EACrC,GAAG;EACH,GAAG;EACH,SAAS;GACP,GAAG,aAAa;GAChB,GAAG,OAAO;GACX;EACF,CAAC,CACD,OAAO,MAA0B;AAChC,QAAM;GACN;;AAGN,OAAO,YAAY;AACnB,OAAO,YAAY;AAEnB,oBAAe"}
|
package/dist/clients/fetch.cjs
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
|
-
|
|
3
|
-
//#region src/clients/fetch.ts
|
|
4
|
-
let _config = {};
|
|
5
|
-
const getConfig = () => _config;
|
|
6
|
-
const setConfig = (config) => {
|
|
7
|
-
_config = config;
|
|
8
|
-
return getConfig();
|
|
9
|
-
};
|
|
10
|
-
const client = async (paramsConfig) => {
|
|
11
|
-
const normalizedParams = new URLSearchParams();
|
|
12
|
-
const config = {
|
|
13
|
-
...getConfig(),
|
|
14
|
-
...paramsConfig
|
|
15
|
-
};
|
|
16
|
-
Object.entries(config.params || {}).forEach(([key, value]) => {
|
|
17
|
-
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
18
|
-
});
|
|
19
|
-
let targetUrl = [config.baseURL, config.url].filter(Boolean).join("");
|
|
20
|
-
if (config.params) targetUrl += `?${normalizedParams}`;
|
|
21
|
-
const response = await fetch(targetUrl, {
|
|
22
|
-
credentials: config.credentials || "same-origin",
|
|
23
|
-
method: config.method?.toUpperCase(),
|
|
24
|
-
body: JSON.stringify(config.data),
|
|
25
|
-
signal: config.signal,
|
|
26
|
-
headers: config.headers
|
|
27
|
-
});
|
|
28
|
-
return {
|
|
29
|
-
data: [
|
|
30
|
-
204,
|
|
31
|
-
205,
|
|
32
|
-
304
|
|
33
|
-
].includes(response.status) || !response.body ? {} : await response.json(),
|
|
34
|
-
status: response.status,
|
|
35
|
-
statusText: response.statusText,
|
|
36
|
-
headers: response.headers
|
|
37
|
-
};
|
|
38
|
-
};
|
|
39
|
-
client.getConfig = getConfig;
|
|
40
|
-
client.setConfig = setConfig;
|
|
41
|
-
var fetch_default = client;
|
|
42
|
-
|
|
43
|
-
//#endregion
|
|
44
|
-
exports.client = client;
|
|
45
|
-
exports.default = fetch_default;
|
|
46
|
-
exports.getConfig = getConfig;
|
|
47
|
-
exports.setConfig = setConfig;
|
|
48
|
-
//# sourceMappingURL=fetch.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fetch.cjs","names":["_config: Partial<RequestConfig>"],"sources":["../../src/clients/fetch.ts"],"sourcesContent":["/**\n * RequestCredentials\n */\nexport type RequestCredentials = 'omit' | 'same-origin' | 'include'\n\n/**\n * Subset of FetchRequestConfig\n */\nexport type RequestConfig<TData = unknown> = {\n baseURL?: string\n url?: string\n method?: 'GET' | 'PUT' | 'PATCH' | 'POST' | 'DELETE' | 'OPTIONS' | 'HEAD'\n params?: unknown\n data?: TData | FormData\n responseType?: 'arraybuffer' | 'blob' | 'document' | 'json' | 'text' | 'stream'\n signal?: AbortSignal\n headers?: [string, string][] | Record<string, string>\n credentials?: RequestCredentials\n}\n\n/**\n * Subset of FetchResponse\n */\nexport type ResponseConfig<TData = unknown> = {\n data: TData\n status: number\n statusText: string\n headers: Headers\n}\n\nlet _config: Partial<RequestConfig> = {}\n\nexport const getConfig = () => _config\n\nexport const setConfig = (config: Partial<RequestConfig>) => {\n _config = config\n return getConfig()\n}\n\nexport type ResponseErrorConfig<TError = unknown> = TError\n\nexport const client = async <TData, _TError = unknown, TVariables = unknown>(paramsConfig: RequestConfig<TVariables>): Promise<ResponseConfig<TData>> => {\n const normalizedParams = new URLSearchParams()\n\n const globalConfig = getConfig()\n const config = { ...globalConfig, ...paramsConfig }\n\n Object.entries(config.params || {}).forEach(([key, value]) => {\n if (value !== undefined) {\n normalizedParams.append(key, value === null ? 'null' : value.toString())\n }\n })\n\n let targetUrl = [config.baseURL, config.url].filter(Boolean).join('')\n\n if (config.params) {\n targetUrl += `?${normalizedParams}`\n }\n\n const response = await fetch(targetUrl, {\n credentials: config.credentials || 'same-origin',\n method: config.method?.toUpperCase(),\n body: JSON.stringify(config.data),\n signal: config.signal,\n headers: config.headers,\n })\n\n const data = [204, 205, 304].includes(response.status) || !response.body ? {} : await response.json()\n\n return {\n data: data as TData,\n status: response.status,\n statusText: response.statusText,\n headers: response.headers as Headers,\n }\n}\n\nclient.getConfig = getConfig\nclient.setConfig = setConfig\n\nexport default client\n"],"mappings":";;;AA8BA,IAAIA,UAAkC,EAAE;AAExC,MAAa,kBAAkB;AAE/B,MAAa,aAAa,WAAmC;AAC3D,WAAU;AACV,QAAO,WAAW;;AAKpB,MAAa,SAAS,OAAuD,iBAA4E;CACvJ,MAAM,mBAAmB,IAAI,iBAAiB;CAG9C,MAAM,SAAS;EAAE,GADI,WAAW;EACE,GAAG;EAAc;AAEnD,QAAO,QAAQ,OAAO,UAAU,EAAE,CAAC,CAAC,SAAS,CAAC,KAAK,WAAW;AAC5D,MAAI,UAAU,OACZ,kBAAiB,OAAO,KAAK,UAAU,OAAO,SAAS,MAAM,UAAU,CAAC;GAE1E;CAEF,IAAI,YAAY,CAAC,OAAO,SAAS,OAAO,IAAI,CAAC,OAAO,QAAQ,CAAC,KAAK,GAAG;AAErE,KAAI,OAAO,OACT,cAAa,IAAI;CAGnB,MAAM,WAAW,MAAM,MAAM,WAAW;EACtC,aAAa,OAAO,eAAe;EACnC,QAAQ,OAAO,QAAQ,aAAa;EACpC,MAAM,KAAK,UAAU,OAAO,KAAK;EACjC,QAAQ,OAAO;EACf,SAAS,OAAO;EACjB,CAAC;AAIF,QAAO;EACL,MAHW;GAAC;GAAK;GAAK;GAAI,CAAC,SAAS,SAAS,OAAO,IAAI,CAAC,SAAS,OAAO,EAAE,GAAG,MAAM,SAAS,MAAM;EAInG,QAAQ,SAAS;EACjB,YAAY,SAAS;EACrB,SAAS,SAAS;EACnB;;AAGH,OAAO,YAAY;AACnB,OAAO,YAAY;AAEnB,oBAAe"}
|
package/dist/clients/fetch.d.cts
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
//#region src/clients/fetch.d.ts
|
|
2
|
-
/**
|
|
3
|
-
* RequestCredentials
|
|
4
|
-
*/
|
|
5
|
-
type RequestCredentials = 'omit' | 'same-origin' | 'include';
|
|
6
|
-
/**
|
|
7
|
-
* Subset of FetchRequestConfig
|
|
8
|
-
*/
|
|
9
|
-
type RequestConfig<TData = unknown> = {
|
|
10
|
-
baseURL?: string;
|
|
11
|
-
url?: string;
|
|
12
|
-
method?: 'GET' | 'PUT' | 'PATCH' | 'POST' | 'DELETE' | 'OPTIONS' | 'HEAD';
|
|
13
|
-
params?: unknown;
|
|
14
|
-
data?: TData | FormData;
|
|
15
|
-
responseType?: 'arraybuffer' | 'blob' | 'document' | 'json' | 'text' | 'stream';
|
|
16
|
-
signal?: AbortSignal;
|
|
17
|
-
headers?: [string, string][] | Record<string, string>;
|
|
18
|
-
credentials?: RequestCredentials;
|
|
19
|
-
};
|
|
20
|
-
/**
|
|
21
|
-
* Subset of FetchResponse
|
|
22
|
-
*/
|
|
23
|
-
type ResponseConfig<TData = unknown> = {
|
|
24
|
-
data: TData;
|
|
25
|
-
status: number;
|
|
26
|
-
statusText: string;
|
|
27
|
-
headers: Headers;
|
|
28
|
-
};
|
|
29
|
-
declare const getConfig: () => Partial<RequestConfig<unknown>>;
|
|
30
|
-
declare const setConfig: (config: Partial<RequestConfig>) => Partial<RequestConfig<unknown>>;
|
|
31
|
-
type ResponseErrorConfig<TError = unknown> = TError;
|
|
32
|
-
declare const client: {
|
|
33
|
-
<TData, _TError = unknown, TVariables = unknown>(paramsConfig: RequestConfig<TVariables>): Promise<ResponseConfig<TData>>;
|
|
34
|
-
getConfig: () => Partial<RequestConfig<unknown>>;
|
|
35
|
-
setConfig: (config: Partial<RequestConfig>) => Partial<RequestConfig<unknown>>;
|
|
36
|
-
};
|
|
37
|
-
//#endregion
|
|
38
|
-
export { RequestConfig, RequestCredentials, ResponseConfig, ResponseErrorConfig, client, client as default, getConfig, setConfig };
|
|
39
|
-
//# sourceMappingURL=fetch.d.cts.map
|
package/dist/clients/fetch.d.ts
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
//#region src/clients/fetch.d.ts
|
|
2
|
-
/**
|
|
3
|
-
* RequestCredentials
|
|
4
|
-
*/
|
|
5
|
-
type RequestCredentials = 'omit' | 'same-origin' | 'include';
|
|
6
|
-
/**
|
|
7
|
-
* Subset of FetchRequestConfig
|
|
8
|
-
*/
|
|
9
|
-
type RequestConfig<TData = unknown> = {
|
|
10
|
-
baseURL?: string;
|
|
11
|
-
url?: string;
|
|
12
|
-
method?: 'GET' | 'PUT' | 'PATCH' | 'POST' | 'DELETE' | 'OPTIONS' | 'HEAD';
|
|
13
|
-
params?: unknown;
|
|
14
|
-
data?: TData | FormData;
|
|
15
|
-
responseType?: 'arraybuffer' | 'blob' | 'document' | 'json' | 'text' | 'stream';
|
|
16
|
-
signal?: AbortSignal;
|
|
17
|
-
headers?: [string, string][] | Record<string, string>;
|
|
18
|
-
credentials?: RequestCredentials;
|
|
19
|
-
};
|
|
20
|
-
/**
|
|
21
|
-
* Subset of FetchResponse
|
|
22
|
-
*/
|
|
23
|
-
type ResponseConfig<TData = unknown> = {
|
|
24
|
-
data: TData;
|
|
25
|
-
status: number;
|
|
26
|
-
statusText: string;
|
|
27
|
-
headers: Headers;
|
|
28
|
-
};
|
|
29
|
-
declare const getConfig: () => Partial<RequestConfig<unknown>>;
|
|
30
|
-
declare const setConfig: (config: Partial<RequestConfig>) => Partial<RequestConfig<unknown>>;
|
|
31
|
-
type ResponseErrorConfig<TError = unknown> = TError;
|
|
32
|
-
declare const client: {
|
|
33
|
-
<TData, _TError = unknown, TVariables = unknown>(paramsConfig: RequestConfig<TVariables>): Promise<ResponseConfig<TData>>;
|
|
34
|
-
getConfig: () => Partial<RequestConfig<unknown>>;
|
|
35
|
-
setConfig: (config: Partial<RequestConfig>) => Partial<RequestConfig<unknown>>;
|
|
36
|
-
};
|
|
37
|
-
//#endregion
|
|
38
|
-
export { RequestConfig, RequestCredentials, ResponseConfig, ResponseErrorConfig, client, client as default, getConfig, setConfig };
|
|
39
|
-
//# sourceMappingURL=fetch.d.ts.map
|