rehive 4.1.2 → 4.1.4
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/admin.d.mts +106 -43
- package/dist/admin.d.ts +106 -43
- package/dist/admin.js +1 -1
- package/dist/admin.mjs +1 -1
- package/dist/auth.d.mts +2 -2
- package/dist/auth.d.ts +2 -2
- package/dist/auth.js +1 -1
- package/dist/auth.mjs +1 -1
- package/dist/{chunk-442DXMRO.mjs → chunk-4WSHB6U6.mjs} +1 -1
- package/dist/chunk-AVPKHYGS.js +7 -0
- package/dist/chunk-KUT5NSX7.mjs +7 -0
- package/dist/chunk-KZWBOQHZ.mjs +7 -0
- package/dist/{chunk-VTR4XNHH.js → chunk-PE6PG7ZE.js} +1 -1
- package/dist/chunk-UYYU5OJ4.js +7 -0
- package/dist/{chunk-BGMUBB76.js → chunk-X6YDNXYV.js} +1 -1
- package/dist/{chunk-FC42NTFK.mjs → chunk-Z7BUNKND.mjs} +1 -1
- package/dist/{create-api-client-2vNCP2LN.d.mts → create-api-client-C-LEZku2.d.mts} +1 -1
- package/dist/{create-api-client-D-Z8R83N.d.ts → create-api-client-ebyTfhcm.d.ts} +1 -1
- package/dist/{create-auth-CHzmb_8_.d.mts → create-auth-DsnHpEf0.d.mts} +47 -8
- package/dist/{create-auth-CHzmb_8_.d.ts → create-auth-DsnHpEf0.d.ts} +47 -8
- package/dist/extensions/alchemy.d.mts +3 -3
- package/dist/extensions/alchemy.d.ts +3 -3
- package/dist/extensions/alchemy.js +5 -5
- package/dist/extensions/alchemy.mjs +5 -5
- package/dist/extensions/app.d.mts +3 -3
- package/dist/extensions/app.d.ts +3 -3
- package/dist/extensions/app.js +5 -5
- package/dist/extensions/app.mjs +5 -5
- package/dist/extensions/billing.d.mts +3 -3
- package/dist/extensions/billing.d.ts +3 -3
- package/dist/extensions/billing.js +5 -5
- package/dist/extensions/billing.mjs +5 -5
- package/dist/extensions/bridge.d.mts +190 -16
- package/dist/extensions/bridge.d.ts +190 -16
- package/dist/extensions/bridge.js +5 -5
- package/dist/extensions/bridge.mjs +5 -5
- package/dist/extensions/builder.d.mts +3 -3
- package/dist/extensions/builder.d.ts +3 -3
- package/dist/extensions/builder.js +5 -5
- package/dist/extensions/builder.mjs +5 -5
- package/dist/extensions/business.d.mts +82 -47
- package/dist/extensions/business.d.ts +82 -47
- package/dist/extensions/business.js +5 -5
- package/dist/extensions/business.mjs +5 -5
- package/dist/extensions/conversion.d.mts +3 -3
- package/dist/extensions/conversion.d.ts +3 -3
- package/dist/extensions/conversion.js +5 -5
- package/dist/extensions/conversion.mjs +5 -5
- package/dist/extensions/mass-send.d.mts +3 -3
- package/dist/extensions/mass-send.d.ts +3 -3
- package/dist/extensions/mass-send.js +5 -5
- package/dist/extensions/mass-send.mjs +5 -5
- package/dist/extensions/notifications.d.mts +3 -3
- package/dist/extensions/notifications.d.ts +3 -3
- package/dist/extensions/notifications.js +5 -5
- package/dist/extensions/notifications.mjs +5 -5
- package/dist/extensions/payment-requests.d.mts +7 -3
- package/dist/extensions/payment-requests.d.ts +7 -3
- package/dist/extensions/payment-requests.js +5 -5
- package/dist/extensions/payment-requests.mjs +5 -5
- package/dist/extensions/products.d.mts +3 -3
- package/dist/extensions/products.d.ts +3 -3
- package/dist/extensions/products.js +5 -5
- package/dist/extensions/products.mjs +5 -5
- package/dist/extensions/rain.d.mts +3 -3
- package/dist/extensions/rain.d.ts +3 -3
- package/dist/extensions/rain.js +5 -5
- package/dist/extensions/rain.mjs +5 -5
- package/dist/extensions/rewards.d.mts +3 -3
- package/dist/extensions/rewards.d.ts +3 -3
- package/dist/extensions/rewards.js +5 -5
- package/dist/extensions/rewards.mjs +5 -5
- package/dist/extensions/stellar-testnet.d.mts +3 -3
- package/dist/extensions/stellar-testnet.d.ts +3 -3
- package/dist/extensions/stellar-testnet.js +5 -5
- package/dist/extensions/stellar-testnet.mjs +5 -5
- package/dist/extensions/stellar.d.mts +3 -3
- package/dist/extensions/stellar.d.ts +3 -3
- package/dist/extensions/stellar.js +5 -5
- package/dist/extensions/stellar.mjs +5 -5
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/react.d.mts +2 -2
- package/dist/react.d.ts +2 -2
- package/dist/react.js +1 -1
- package/dist/react.mjs +1 -1
- package/dist/user.d.mts +16 -6
- package/dist/user.d.ts +16 -6
- package/dist/user.js +1 -1
- package/dist/user.mjs +1 -1
- package/package.json +1 -1
- package/src/extensions/alchemy/openapi-ts/client/client.gen.ts +5 -3
- package/src/extensions/alchemy/openapi-ts/core/bodySerializer.gen.ts +6 -8
- package/src/extensions/alchemy/openapi-ts/core/params.gen.ts +1 -1
- package/src/extensions/app/openapi-ts/client/client.gen.ts +5 -3
- package/src/extensions/app/openapi-ts/core/bodySerializer.gen.ts +6 -8
- package/src/extensions/app/openapi-ts/core/params.gen.ts +1 -1
- package/src/extensions/billing/openapi-ts/client/client.gen.ts +5 -3
- package/src/extensions/billing/openapi-ts/core/bodySerializer.gen.ts +6 -8
- package/src/extensions/billing/openapi-ts/core/params.gen.ts +1 -1
- package/src/extensions/bridge/openapi-ts/client/client.gen.ts +5 -3
- package/src/extensions/bridge/openapi-ts/core/bodySerializer.gen.ts +6 -8
- package/src/extensions/bridge/openapi-ts/core/params.gen.ts +1 -1
- package/src/extensions/bridge/openapi-ts/index.ts +2 -2
- package/src/extensions/bridge/openapi-ts/sdk.gen.ts +43 -1
- package/src/extensions/bridge/openapi-ts/types.gen.ts +201 -11
- package/src/extensions/builder/openapi-ts/client/client.gen.ts +5 -3
- package/src/extensions/builder/openapi-ts/core/bodySerializer.gen.ts +6 -8
- package/src/extensions/builder/openapi-ts/core/params.gen.ts +1 -1
- package/src/extensions/business/openapi-ts/client/client.gen.ts +5 -3
- package/src/extensions/business/openapi-ts/core/bodySerializer.gen.ts +6 -8
- package/src/extensions/business/openapi-ts/core/params.gen.ts +1 -1
- package/src/extensions/business/openapi-ts/types.gen.ts +79 -44
- package/src/extensions/conversion/openapi-ts/client/client.gen.ts +5 -3
- package/src/extensions/conversion/openapi-ts/core/bodySerializer.gen.ts +6 -8
- package/src/extensions/conversion/openapi-ts/core/params.gen.ts +1 -1
- package/src/extensions/mass-send/openapi-ts/client/client.gen.ts +5 -3
- package/src/extensions/mass-send/openapi-ts/core/bodySerializer.gen.ts +6 -8
- package/src/extensions/mass-send/openapi-ts/core/params.gen.ts +1 -1
- package/src/extensions/notifications/openapi-ts/client/client.gen.ts +5 -3
- package/src/extensions/notifications/openapi-ts/core/bodySerializer.gen.ts +6 -8
- package/src/extensions/notifications/openapi-ts/core/params.gen.ts +1 -1
- package/src/extensions/payment-requests/openapi-ts/client/client.gen.ts +5 -3
- package/src/extensions/payment-requests/openapi-ts/core/bodySerializer.gen.ts +6 -8
- package/src/extensions/payment-requests/openapi-ts/core/params.gen.ts +1 -1
- package/src/extensions/payment-requests/openapi-ts/types.gen.ts +4 -0
- package/src/extensions/products/openapi-ts/client/client.gen.ts +5 -3
- package/src/extensions/products/openapi-ts/core/bodySerializer.gen.ts +6 -8
- package/src/extensions/products/openapi-ts/core/params.gen.ts +1 -1
- package/src/extensions/rain/openapi-ts/client/client.gen.ts +5 -3
- package/src/extensions/rain/openapi-ts/core/bodySerializer.gen.ts +6 -8
- package/src/extensions/rain/openapi-ts/core/params.gen.ts +1 -1
- package/src/extensions/rewards/openapi-ts/client/client.gen.ts +5 -3
- package/src/extensions/rewards/openapi-ts/core/bodySerializer.gen.ts +6 -8
- package/src/extensions/rewards/openapi-ts/core/params.gen.ts +1 -1
- package/src/extensions/stellar/openapi-ts/client/client.gen.ts +5 -3
- package/src/extensions/stellar/openapi-ts/core/bodySerializer.gen.ts +6 -8
- package/src/extensions/stellar/openapi-ts/core/params.gen.ts +1 -1
- package/src/extensions/stellar-testnet/openapi-ts/client/client.gen.ts +5 -3
- package/src/extensions/stellar-testnet/openapi-ts/core/bodySerializer.gen.ts +6 -8
- package/src/extensions/stellar-testnet/openapi-ts/core/params.gen.ts +1 -1
- package/src/platform/admin/openapi-ts/client/client.gen.ts +5 -3
- package/src/platform/admin/openapi-ts/core/bodySerializer.gen.ts +6 -8
- package/src/platform/admin/openapi-ts/core/params.gen.ts +1 -1
- package/src/platform/admin/openapi-ts/sdk.gen.ts +61 -0
- package/src/platform/admin/openapi-ts/types.gen.ts +103 -40
- package/src/platform/user/openapi-ts/client/client.gen.ts +5 -3
- package/src/platform/user/openapi-ts/core/bodySerializer.gen.ts +6 -8
- package/src/platform/user/openapi-ts/core/params.gen.ts +1 -1
- package/src/platform/user/openapi-ts/index.ts +2 -2
- package/src/platform/user/openapi-ts/sdk.gen.ts +43 -1
- package/src/platform/user/openapi-ts/types.gen.ts +54 -7
- package/dist/chunk-6WLL3XNH.js +0 -7
- package/dist/chunk-LTRLQIIM.js +0 -7
- package/dist/chunk-WTKM56EI.mjs +0 -7
- package/dist/chunk-WVAFSUTF.mjs +0 -7
|
@@ -96,7 +96,7 @@ interface Params {
|
|
|
96
96
|
|
|
97
97
|
const stripEmptySlots = (params: Params) => {
|
|
98
98
|
for (const [slot, value] of Object.entries(params)) {
|
|
99
|
-
if (value && typeof value === 'object' && !Object.keys(value).length) {
|
|
99
|
+
if (value && typeof value === 'object' && !Array.isArray(value) && !Object.keys(value).length) {
|
|
100
100
|
delete params[slot as Slot];
|
|
101
101
|
}
|
|
102
102
|
}
|
|
@@ -37,7 +37,7 @@ export const createClient = (config: Config = {}): Client => {
|
|
|
37
37
|
...options,
|
|
38
38
|
fetch: options.fetch ?? _config.fetch ?? globalThis.fetch,
|
|
39
39
|
headers: mergeHeaders(_config.headers, options.headers),
|
|
40
|
-
serializedBody: undefined,
|
|
40
|
+
serializedBody: undefined as string | undefined,
|
|
41
41
|
};
|
|
42
42
|
|
|
43
43
|
if (opts.security) {
|
|
@@ -52,7 +52,7 @@ export const createClient = (config: Config = {}): Client => {
|
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
if (opts.body !== undefined && opts.bodySerializer) {
|
|
55
|
-
opts.serializedBody = opts.bodySerializer(opts.body);
|
|
55
|
+
opts.serializedBody = opts.bodySerializer(opts.body) as string | undefined;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
// remove Content-Type header if body is empty to avoid sending invalid requests
|
|
@@ -258,8 +258,10 @@ export const createClient = (config: Config = {}): Client => {
|
|
|
258
258
|
});
|
|
259
259
|
};
|
|
260
260
|
|
|
261
|
+
const _buildUrl: Client['buildUrl'] = (options) => buildUrl({ ..._config, ...options });
|
|
262
|
+
|
|
261
263
|
return {
|
|
262
|
-
buildUrl,
|
|
264
|
+
buildUrl: _buildUrl,
|
|
263
265
|
connect: makeMethodFn('CONNECT'),
|
|
264
266
|
delete: makeMethodFn('DELETE'),
|
|
265
267
|
get: makeMethodFn('GET'),
|
|
@@ -4,7 +4,7 @@ import type { ArrayStyle, ObjectStyle, SerializerOptions } from './pathSerialize
|
|
|
4
4
|
|
|
5
5
|
export type QuerySerializer = (query: Record<string, unknown>) => string;
|
|
6
6
|
|
|
7
|
-
export type BodySerializer = (body:
|
|
7
|
+
export type BodySerializer = (body: unknown) => unknown;
|
|
8
8
|
|
|
9
9
|
type QuerySerializerOptionsObject = {
|
|
10
10
|
allowReserved?: boolean;
|
|
@@ -39,12 +39,10 @@ const serializeUrlSearchParamsPair = (data: URLSearchParams, key: string, value:
|
|
|
39
39
|
};
|
|
40
40
|
|
|
41
41
|
export const formDataBodySerializer = {
|
|
42
|
-
bodySerializer:
|
|
43
|
-
body: T,
|
|
44
|
-
): FormData => {
|
|
42
|
+
bodySerializer: (body: unknown): FormData => {
|
|
45
43
|
const data = new FormData();
|
|
46
44
|
|
|
47
|
-
Object.entries(body).forEach(([key, value]) => {
|
|
45
|
+
Object.entries(body as Record<string, unknown>).forEach(([key, value]) => {
|
|
48
46
|
if (value === undefined || value === null) {
|
|
49
47
|
return;
|
|
50
48
|
}
|
|
@@ -60,15 +58,15 @@ export const formDataBodySerializer = {
|
|
|
60
58
|
};
|
|
61
59
|
|
|
62
60
|
export const jsonBodySerializer = {
|
|
63
|
-
bodySerializer:
|
|
61
|
+
bodySerializer: (body: unknown): string =>
|
|
64
62
|
JSON.stringify(body, (_key, value) => (typeof value === 'bigint' ? value.toString() : value)),
|
|
65
63
|
};
|
|
66
64
|
|
|
67
65
|
export const urlSearchParamsBodySerializer = {
|
|
68
|
-
bodySerializer:
|
|
66
|
+
bodySerializer: (body: unknown): string => {
|
|
69
67
|
const data = new URLSearchParams();
|
|
70
68
|
|
|
71
|
-
Object.entries(body).forEach(([key, value]) => {
|
|
69
|
+
Object.entries(body as Record<string, unknown>).forEach(([key, value]) => {
|
|
72
70
|
if (value === undefined || value === null) {
|
|
73
71
|
return;
|
|
74
72
|
}
|
|
@@ -96,7 +96,7 @@ interface Params {
|
|
|
96
96
|
|
|
97
97
|
const stripEmptySlots = (params: Params) => {
|
|
98
98
|
for (const [slot, value] of Object.entries(params)) {
|
|
99
|
-
if (value && typeof value === 'object' && !Object.keys(value).length) {
|
|
99
|
+
if (value && typeof value === 'object' && !Array.isArray(value) && !Object.keys(value).length) {
|
|
100
100
|
delete params[slot as Slot];
|
|
101
101
|
}
|
|
102
102
|
}
|
|
@@ -37,7 +37,7 @@ export const createClient = (config: Config = {}): Client => {
|
|
|
37
37
|
...options,
|
|
38
38
|
fetch: options.fetch ?? _config.fetch ?? globalThis.fetch,
|
|
39
39
|
headers: mergeHeaders(_config.headers, options.headers),
|
|
40
|
-
serializedBody: undefined,
|
|
40
|
+
serializedBody: undefined as string | undefined,
|
|
41
41
|
};
|
|
42
42
|
|
|
43
43
|
if (opts.security) {
|
|
@@ -52,7 +52,7 @@ export const createClient = (config: Config = {}): Client => {
|
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
if (opts.body !== undefined && opts.bodySerializer) {
|
|
55
|
-
opts.serializedBody = opts.bodySerializer(opts.body);
|
|
55
|
+
opts.serializedBody = opts.bodySerializer(opts.body) as string | undefined;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
// remove Content-Type header if body is empty to avoid sending invalid requests
|
|
@@ -258,8 +258,10 @@ export const createClient = (config: Config = {}): Client => {
|
|
|
258
258
|
});
|
|
259
259
|
};
|
|
260
260
|
|
|
261
|
+
const _buildUrl: Client['buildUrl'] = (options) => buildUrl({ ..._config, ...options });
|
|
262
|
+
|
|
261
263
|
return {
|
|
262
|
-
buildUrl,
|
|
264
|
+
buildUrl: _buildUrl,
|
|
263
265
|
connect: makeMethodFn('CONNECT'),
|
|
264
266
|
delete: makeMethodFn('DELETE'),
|
|
265
267
|
get: makeMethodFn('GET'),
|
|
@@ -4,7 +4,7 @@ import type { ArrayStyle, ObjectStyle, SerializerOptions } from './pathSerialize
|
|
|
4
4
|
|
|
5
5
|
export type QuerySerializer = (query: Record<string, unknown>) => string;
|
|
6
6
|
|
|
7
|
-
export type BodySerializer = (body:
|
|
7
|
+
export type BodySerializer = (body: unknown) => unknown;
|
|
8
8
|
|
|
9
9
|
type QuerySerializerOptionsObject = {
|
|
10
10
|
allowReserved?: boolean;
|
|
@@ -39,12 +39,10 @@ const serializeUrlSearchParamsPair = (data: URLSearchParams, key: string, value:
|
|
|
39
39
|
};
|
|
40
40
|
|
|
41
41
|
export const formDataBodySerializer = {
|
|
42
|
-
bodySerializer:
|
|
43
|
-
body: T,
|
|
44
|
-
): FormData => {
|
|
42
|
+
bodySerializer: (body: unknown): FormData => {
|
|
45
43
|
const data = new FormData();
|
|
46
44
|
|
|
47
|
-
Object.entries(body).forEach(([key, value]) => {
|
|
45
|
+
Object.entries(body as Record<string, unknown>).forEach(([key, value]) => {
|
|
48
46
|
if (value === undefined || value === null) {
|
|
49
47
|
return;
|
|
50
48
|
}
|
|
@@ -60,15 +58,15 @@ export const formDataBodySerializer = {
|
|
|
60
58
|
};
|
|
61
59
|
|
|
62
60
|
export const jsonBodySerializer = {
|
|
63
|
-
bodySerializer:
|
|
61
|
+
bodySerializer: (body: unknown): string =>
|
|
64
62
|
JSON.stringify(body, (_key, value) => (typeof value === 'bigint' ? value.toString() : value)),
|
|
65
63
|
};
|
|
66
64
|
|
|
67
65
|
export const urlSearchParamsBodySerializer = {
|
|
68
|
-
bodySerializer:
|
|
66
|
+
bodySerializer: (body: unknown): string => {
|
|
69
67
|
const data = new URLSearchParams();
|
|
70
68
|
|
|
71
|
-
Object.entries(body).forEach(([key, value]) => {
|
|
69
|
+
Object.entries(body as Record<string, unknown>).forEach(([key, value]) => {
|
|
72
70
|
if (value === undefined || value === null) {
|
|
73
71
|
return;
|
|
74
72
|
}
|
|
@@ -96,7 +96,7 @@ interface Params {
|
|
|
96
96
|
|
|
97
97
|
const stripEmptySlots = (params: Params) => {
|
|
98
98
|
for (const [slot, value] of Object.entries(params)) {
|
|
99
|
-
if (value && typeof value === 'object' && !Object.keys(value).length) {
|
|
99
|
+
if (value && typeof value === 'object' && !Array.isArray(value) && !Object.keys(value).length) {
|
|
100
100
|
delete params[slot as Slot];
|
|
101
101
|
}
|
|
102
102
|
}
|
|
@@ -271,6 +271,7 @@ export type CompanyConfiguration = {
|
|
|
271
271
|
readonly request_notification_id: string | null;
|
|
272
272
|
reminder_default?: boolean;
|
|
273
273
|
request_param_config?: string | null;
|
|
274
|
+
generate_user_operational_accounts?: boolean;
|
|
274
275
|
};
|
|
275
276
|
|
|
276
277
|
export type CompanyConfigurationResponse = {
|
|
@@ -654,6 +655,7 @@ export type PatchedCompanyConfiguration = {
|
|
|
654
655
|
readonly request_notification_id?: string | null;
|
|
655
656
|
reminder_default?: boolean;
|
|
656
657
|
request_param_config?: string | null;
|
|
658
|
+
generate_user_operational_accounts?: boolean;
|
|
657
659
|
};
|
|
658
660
|
|
|
659
661
|
/**
|
|
@@ -1391,6 +1393,7 @@ export type CompanyConfigurationWritable = {
|
|
|
1391
1393
|
base_redirect_url?: string | null;
|
|
1392
1394
|
reminder_default?: boolean;
|
|
1393
1395
|
request_param_config?: string | null;
|
|
1396
|
+
generate_user_operational_accounts?: boolean;
|
|
1394
1397
|
};
|
|
1395
1398
|
|
|
1396
1399
|
export type CompanyConfigurationResponseWritable = {
|
|
@@ -1717,6 +1720,7 @@ export type PatchedCompanyConfigurationWritable = {
|
|
|
1717
1720
|
base_redirect_url?: string | null;
|
|
1718
1721
|
reminder_default?: boolean;
|
|
1719
1722
|
request_param_config?: string | null;
|
|
1723
|
+
generate_user_operational_accounts?: boolean;
|
|
1720
1724
|
};
|
|
1721
1725
|
|
|
1722
1726
|
/**
|
|
@@ -37,7 +37,7 @@ export const createClient = (config: Config = {}): Client => {
|
|
|
37
37
|
...options,
|
|
38
38
|
fetch: options.fetch ?? _config.fetch ?? globalThis.fetch,
|
|
39
39
|
headers: mergeHeaders(_config.headers, options.headers),
|
|
40
|
-
serializedBody: undefined,
|
|
40
|
+
serializedBody: undefined as string | undefined,
|
|
41
41
|
};
|
|
42
42
|
|
|
43
43
|
if (opts.security) {
|
|
@@ -52,7 +52,7 @@ export const createClient = (config: Config = {}): Client => {
|
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
if (opts.body !== undefined && opts.bodySerializer) {
|
|
55
|
-
opts.serializedBody = opts.bodySerializer(opts.body);
|
|
55
|
+
opts.serializedBody = opts.bodySerializer(opts.body) as string | undefined;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
// remove Content-Type header if body is empty to avoid sending invalid requests
|
|
@@ -258,8 +258,10 @@ export const createClient = (config: Config = {}): Client => {
|
|
|
258
258
|
});
|
|
259
259
|
};
|
|
260
260
|
|
|
261
|
+
const _buildUrl: Client['buildUrl'] = (options) => buildUrl({ ..._config, ...options });
|
|
262
|
+
|
|
261
263
|
return {
|
|
262
|
-
buildUrl,
|
|
264
|
+
buildUrl: _buildUrl,
|
|
263
265
|
connect: makeMethodFn('CONNECT'),
|
|
264
266
|
delete: makeMethodFn('DELETE'),
|
|
265
267
|
get: makeMethodFn('GET'),
|
|
@@ -4,7 +4,7 @@ import type { ArrayStyle, ObjectStyle, SerializerOptions } from './pathSerialize
|
|
|
4
4
|
|
|
5
5
|
export type QuerySerializer = (query: Record<string, unknown>) => string;
|
|
6
6
|
|
|
7
|
-
export type BodySerializer = (body:
|
|
7
|
+
export type BodySerializer = (body: unknown) => unknown;
|
|
8
8
|
|
|
9
9
|
type QuerySerializerOptionsObject = {
|
|
10
10
|
allowReserved?: boolean;
|
|
@@ -39,12 +39,10 @@ const serializeUrlSearchParamsPair = (data: URLSearchParams, key: string, value:
|
|
|
39
39
|
};
|
|
40
40
|
|
|
41
41
|
export const formDataBodySerializer = {
|
|
42
|
-
bodySerializer:
|
|
43
|
-
body: T,
|
|
44
|
-
): FormData => {
|
|
42
|
+
bodySerializer: (body: unknown): FormData => {
|
|
45
43
|
const data = new FormData();
|
|
46
44
|
|
|
47
|
-
Object.entries(body).forEach(([key, value]) => {
|
|
45
|
+
Object.entries(body as Record<string, unknown>).forEach(([key, value]) => {
|
|
48
46
|
if (value === undefined || value === null) {
|
|
49
47
|
return;
|
|
50
48
|
}
|
|
@@ -60,15 +58,15 @@ export const formDataBodySerializer = {
|
|
|
60
58
|
};
|
|
61
59
|
|
|
62
60
|
export const jsonBodySerializer = {
|
|
63
|
-
bodySerializer:
|
|
61
|
+
bodySerializer: (body: unknown): string =>
|
|
64
62
|
JSON.stringify(body, (_key, value) => (typeof value === 'bigint' ? value.toString() : value)),
|
|
65
63
|
};
|
|
66
64
|
|
|
67
65
|
export const urlSearchParamsBodySerializer = {
|
|
68
|
-
bodySerializer:
|
|
66
|
+
bodySerializer: (body: unknown): string => {
|
|
69
67
|
const data = new URLSearchParams();
|
|
70
68
|
|
|
71
|
-
Object.entries(body).forEach(([key, value]) => {
|
|
69
|
+
Object.entries(body as Record<string, unknown>).forEach(([key, value]) => {
|
|
72
70
|
if (value === undefined || value === null) {
|
|
73
71
|
return;
|
|
74
72
|
}
|
|
@@ -96,7 +96,7 @@ interface Params {
|
|
|
96
96
|
|
|
97
97
|
const stripEmptySlots = (params: Params) => {
|
|
98
98
|
for (const [slot, value] of Object.entries(params)) {
|
|
99
|
-
if (value && typeof value === 'object' && !Object.keys(value).length) {
|
|
99
|
+
if (value && typeof value === 'object' && !Array.isArray(value) && !Object.keys(value).length) {
|
|
100
100
|
delete params[slot as Slot];
|
|
101
101
|
}
|
|
102
102
|
}
|
|
@@ -37,7 +37,7 @@ export const createClient = (config: Config = {}): Client => {
|
|
|
37
37
|
...options,
|
|
38
38
|
fetch: options.fetch ?? _config.fetch ?? globalThis.fetch,
|
|
39
39
|
headers: mergeHeaders(_config.headers, options.headers),
|
|
40
|
-
serializedBody: undefined,
|
|
40
|
+
serializedBody: undefined as string | undefined,
|
|
41
41
|
};
|
|
42
42
|
|
|
43
43
|
if (opts.security) {
|
|
@@ -52,7 +52,7 @@ export const createClient = (config: Config = {}): Client => {
|
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
if (opts.body !== undefined && opts.bodySerializer) {
|
|
55
|
-
opts.serializedBody = opts.bodySerializer(opts.body);
|
|
55
|
+
opts.serializedBody = opts.bodySerializer(opts.body) as string | undefined;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
// remove Content-Type header if body is empty to avoid sending invalid requests
|
|
@@ -258,8 +258,10 @@ export const createClient = (config: Config = {}): Client => {
|
|
|
258
258
|
});
|
|
259
259
|
};
|
|
260
260
|
|
|
261
|
+
const _buildUrl: Client['buildUrl'] = (options) => buildUrl({ ..._config, ...options });
|
|
262
|
+
|
|
261
263
|
return {
|
|
262
|
-
buildUrl,
|
|
264
|
+
buildUrl: _buildUrl,
|
|
263
265
|
connect: makeMethodFn('CONNECT'),
|
|
264
266
|
delete: makeMethodFn('DELETE'),
|
|
265
267
|
get: makeMethodFn('GET'),
|
|
@@ -4,7 +4,7 @@ import type { ArrayStyle, ObjectStyle, SerializerOptions } from './pathSerialize
|
|
|
4
4
|
|
|
5
5
|
export type QuerySerializer = (query: Record<string, unknown>) => string;
|
|
6
6
|
|
|
7
|
-
export type BodySerializer = (body:
|
|
7
|
+
export type BodySerializer = (body: unknown) => unknown;
|
|
8
8
|
|
|
9
9
|
type QuerySerializerOptionsObject = {
|
|
10
10
|
allowReserved?: boolean;
|
|
@@ -39,12 +39,10 @@ const serializeUrlSearchParamsPair = (data: URLSearchParams, key: string, value:
|
|
|
39
39
|
};
|
|
40
40
|
|
|
41
41
|
export const formDataBodySerializer = {
|
|
42
|
-
bodySerializer:
|
|
43
|
-
body: T,
|
|
44
|
-
): FormData => {
|
|
42
|
+
bodySerializer: (body: unknown): FormData => {
|
|
45
43
|
const data = new FormData();
|
|
46
44
|
|
|
47
|
-
Object.entries(body).forEach(([key, value]) => {
|
|
45
|
+
Object.entries(body as Record<string, unknown>).forEach(([key, value]) => {
|
|
48
46
|
if (value === undefined || value === null) {
|
|
49
47
|
return;
|
|
50
48
|
}
|
|
@@ -60,15 +58,15 @@ export const formDataBodySerializer = {
|
|
|
60
58
|
};
|
|
61
59
|
|
|
62
60
|
export const jsonBodySerializer = {
|
|
63
|
-
bodySerializer:
|
|
61
|
+
bodySerializer: (body: unknown): string =>
|
|
64
62
|
JSON.stringify(body, (_key, value) => (typeof value === 'bigint' ? value.toString() : value)),
|
|
65
63
|
};
|
|
66
64
|
|
|
67
65
|
export const urlSearchParamsBodySerializer = {
|
|
68
|
-
bodySerializer:
|
|
66
|
+
bodySerializer: (body: unknown): string => {
|
|
69
67
|
const data = new URLSearchParams();
|
|
70
68
|
|
|
71
|
-
Object.entries(body).forEach(([key, value]) => {
|
|
69
|
+
Object.entries(body as Record<string, unknown>).forEach(([key, value]) => {
|
|
72
70
|
if (value === undefined || value === null) {
|
|
73
71
|
return;
|
|
74
72
|
}
|
|
@@ -96,7 +96,7 @@ interface Params {
|
|
|
96
96
|
|
|
97
97
|
const stripEmptySlots = (params: Params) => {
|
|
98
98
|
for (const [slot, value] of Object.entries(params)) {
|
|
99
|
-
if (value && typeof value === 'object' && !Object.keys(value).length) {
|
|
99
|
+
if (value && typeof value === 'object' && !Array.isArray(value) && !Object.keys(value).length) {
|
|
100
100
|
delete params[slot as Slot];
|
|
101
101
|
}
|
|
102
102
|
}
|
|
@@ -37,7 +37,7 @@ export const createClient = (config: Config = {}): Client => {
|
|
|
37
37
|
...options,
|
|
38
38
|
fetch: options.fetch ?? _config.fetch ?? globalThis.fetch,
|
|
39
39
|
headers: mergeHeaders(_config.headers, options.headers),
|
|
40
|
-
serializedBody: undefined,
|
|
40
|
+
serializedBody: undefined as string | undefined,
|
|
41
41
|
};
|
|
42
42
|
|
|
43
43
|
if (opts.security) {
|
|
@@ -52,7 +52,7 @@ export const createClient = (config: Config = {}): Client => {
|
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
if (opts.body !== undefined && opts.bodySerializer) {
|
|
55
|
-
opts.serializedBody = opts.bodySerializer(opts.body);
|
|
55
|
+
opts.serializedBody = opts.bodySerializer(opts.body) as string | undefined;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
// remove Content-Type header if body is empty to avoid sending invalid requests
|
|
@@ -258,8 +258,10 @@ export const createClient = (config: Config = {}): Client => {
|
|
|
258
258
|
});
|
|
259
259
|
};
|
|
260
260
|
|
|
261
|
+
const _buildUrl: Client['buildUrl'] = (options) => buildUrl({ ..._config, ...options });
|
|
262
|
+
|
|
261
263
|
return {
|
|
262
|
-
buildUrl,
|
|
264
|
+
buildUrl: _buildUrl,
|
|
263
265
|
connect: makeMethodFn('CONNECT'),
|
|
264
266
|
delete: makeMethodFn('DELETE'),
|
|
265
267
|
get: makeMethodFn('GET'),
|
|
@@ -4,7 +4,7 @@ import type { ArrayStyle, ObjectStyle, SerializerOptions } from './pathSerialize
|
|
|
4
4
|
|
|
5
5
|
export type QuerySerializer = (query: Record<string, unknown>) => string;
|
|
6
6
|
|
|
7
|
-
export type BodySerializer = (body:
|
|
7
|
+
export type BodySerializer = (body: unknown) => unknown;
|
|
8
8
|
|
|
9
9
|
type QuerySerializerOptionsObject = {
|
|
10
10
|
allowReserved?: boolean;
|
|
@@ -39,12 +39,10 @@ const serializeUrlSearchParamsPair = (data: URLSearchParams, key: string, value:
|
|
|
39
39
|
};
|
|
40
40
|
|
|
41
41
|
export const formDataBodySerializer = {
|
|
42
|
-
bodySerializer:
|
|
43
|
-
body: T,
|
|
44
|
-
): FormData => {
|
|
42
|
+
bodySerializer: (body: unknown): FormData => {
|
|
45
43
|
const data = new FormData();
|
|
46
44
|
|
|
47
|
-
Object.entries(body).forEach(([key, value]) => {
|
|
45
|
+
Object.entries(body as Record<string, unknown>).forEach(([key, value]) => {
|
|
48
46
|
if (value === undefined || value === null) {
|
|
49
47
|
return;
|
|
50
48
|
}
|
|
@@ -60,15 +58,15 @@ export const formDataBodySerializer = {
|
|
|
60
58
|
};
|
|
61
59
|
|
|
62
60
|
export const jsonBodySerializer = {
|
|
63
|
-
bodySerializer:
|
|
61
|
+
bodySerializer: (body: unknown): string =>
|
|
64
62
|
JSON.stringify(body, (_key, value) => (typeof value === 'bigint' ? value.toString() : value)),
|
|
65
63
|
};
|
|
66
64
|
|
|
67
65
|
export const urlSearchParamsBodySerializer = {
|
|
68
|
-
bodySerializer:
|
|
66
|
+
bodySerializer: (body: unknown): string => {
|
|
69
67
|
const data = new URLSearchParams();
|
|
70
68
|
|
|
71
|
-
Object.entries(body).forEach(([key, value]) => {
|
|
69
|
+
Object.entries(body as Record<string, unknown>).forEach(([key, value]) => {
|
|
72
70
|
if (value === undefined || value === null) {
|
|
73
71
|
return;
|
|
74
72
|
}
|
|
@@ -96,7 +96,7 @@ interface Params {
|
|
|
96
96
|
|
|
97
97
|
const stripEmptySlots = (params: Params) => {
|
|
98
98
|
for (const [slot, value] of Object.entries(params)) {
|
|
99
|
-
if (value && typeof value === 'object' && !Object.keys(value).length) {
|
|
99
|
+
if (value && typeof value === 'object' && !Array.isArray(value) && !Object.keys(value).length) {
|
|
100
100
|
delete params[slot as Slot];
|
|
101
101
|
}
|
|
102
102
|
}
|
|
@@ -37,7 +37,7 @@ export const createClient = (config: Config = {}): Client => {
|
|
|
37
37
|
...options,
|
|
38
38
|
fetch: options.fetch ?? _config.fetch ?? globalThis.fetch,
|
|
39
39
|
headers: mergeHeaders(_config.headers, options.headers),
|
|
40
|
-
serializedBody: undefined,
|
|
40
|
+
serializedBody: undefined as string | undefined,
|
|
41
41
|
};
|
|
42
42
|
|
|
43
43
|
if (opts.security) {
|
|
@@ -52,7 +52,7 @@ export const createClient = (config: Config = {}): Client => {
|
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
if (opts.body !== undefined && opts.bodySerializer) {
|
|
55
|
-
opts.serializedBody = opts.bodySerializer(opts.body);
|
|
55
|
+
opts.serializedBody = opts.bodySerializer(opts.body) as string | undefined;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
// remove Content-Type header if body is empty to avoid sending invalid requests
|
|
@@ -258,8 +258,10 @@ export const createClient = (config: Config = {}): Client => {
|
|
|
258
258
|
});
|
|
259
259
|
};
|
|
260
260
|
|
|
261
|
+
const _buildUrl: Client['buildUrl'] = (options) => buildUrl({ ..._config, ...options });
|
|
262
|
+
|
|
261
263
|
return {
|
|
262
|
-
buildUrl,
|
|
264
|
+
buildUrl: _buildUrl,
|
|
263
265
|
connect: makeMethodFn('CONNECT'),
|
|
264
266
|
delete: makeMethodFn('DELETE'),
|
|
265
267
|
get: makeMethodFn('GET'),
|
|
@@ -4,7 +4,7 @@ import type { ArrayStyle, ObjectStyle, SerializerOptions } from './pathSerialize
|
|
|
4
4
|
|
|
5
5
|
export type QuerySerializer = (query: Record<string, unknown>) => string;
|
|
6
6
|
|
|
7
|
-
export type BodySerializer = (body:
|
|
7
|
+
export type BodySerializer = (body: unknown) => unknown;
|
|
8
8
|
|
|
9
9
|
type QuerySerializerOptionsObject = {
|
|
10
10
|
allowReserved?: boolean;
|
|
@@ -39,12 +39,10 @@ const serializeUrlSearchParamsPair = (data: URLSearchParams, key: string, value:
|
|
|
39
39
|
};
|
|
40
40
|
|
|
41
41
|
export const formDataBodySerializer = {
|
|
42
|
-
bodySerializer:
|
|
43
|
-
body: T,
|
|
44
|
-
): FormData => {
|
|
42
|
+
bodySerializer: (body: unknown): FormData => {
|
|
45
43
|
const data = new FormData();
|
|
46
44
|
|
|
47
|
-
Object.entries(body).forEach(([key, value]) => {
|
|
45
|
+
Object.entries(body as Record<string, unknown>).forEach(([key, value]) => {
|
|
48
46
|
if (value === undefined || value === null) {
|
|
49
47
|
return;
|
|
50
48
|
}
|
|
@@ -60,15 +58,15 @@ export const formDataBodySerializer = {
|
|
|
60
58
|
};
|
|
61
59
|
|
|
62
60
|
export const jsonBodySerializer = {
|
|
63
|
-
bodySerializer:
|
|
61
|
+
bodySerializer: (body: unknown): string =>
|
|
64
62
|
JSON.stringify(body, (_key, value) => (typeof value === 'bigint' ? value.toString() : value)),
|
|
65
63
|
};
|
|
66
64
|
|
|
67
65
|
export const urlSearchParamsBodySerializer = {
|
|
68
|
-
bodySerializer:
|
|
66
|
+
bodySerializer: (body: unknown): string => {
|
|
69
67
|
const data = new URLSearchParams();
|
|
70
68
|
|
|
71
|
-
Object.entries(body).forEach(([key, value]) => {
|
|
69
|
+
Object.entries(body as Record<string, unknown>).forEach(([key, value]) => {
|
|
72
70
|
if (value === undefined || value === null) {
|
|
73
71
|
return;
|
|
74
72
|
}
|
|
@@ -96,7 +96,7 @@ interface Params {
|
|
|
96
96
|
|
|
97
97
|
const stripEmptySlots = (params: Params) => {
|
|
98
98
|
for (const [slot, value] of Object.entries(params)) {
|
|
99
|
-
if (value && typeof value === 'object' && !Object.keys(value).length) {
|
|
99
|
+
if (value && typeof value === 'object' && !Array.isArray(value) && !Object.keys(value).length) {
|
|
100
100
|
delete params[slot as Slot];
|
|
101
101
|
}
|
|
102
102
|
}
|
|
@@ -37,7 +37,7 @@ export const createClient = (config: Config = {}): Client => {
|
|
|
37
37
|
...options,
|
|
38
38
|
fetch: options.fetch ?? _config.fetch ?? globalThis.fetch,
|
|
39
39
|
headers: mergeHeaders(_config.headers, options.headers),
|
|
40
|
-
serializedBody: undefined,
|
|
40
|
+
serializedBody: undefined as string | undefined,
|
|
41
41
|
};
|
|
42
42
|
|
|
43
43
|
if (opts.security) {
|
|
@@ -52,7 +52,7 @@ export const createClient = (config: Config = {}): Client => {
|
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
if (opts.body !== undefined && opts.bodySerializer) {
|
|
55
|
-
opts.serializedBody = opts.bodySerializer(opts.body);
|
|
55
|
+
opts.serializedBody = opts.bodySerializer(opts.body) as string | undefined;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
// remove Content-Type header if body is empty to avoid sending invalid requests
|
|
@@ -258,8 +258,10 @@ export const createClient = (config: Config = {}): Client => {
|
|
|
258
258
|
});
|
|
259
259
|
};
|
|
260
260
|
|
|
261
|
+
const _buildUrl: Client['buildUrl'] = (options) => buildUrl({ ..._config, ...options });
|
|
262
|
+
|
|
261
263
|
return {
|
|
262
|
-
buildUrl,
|
|
264
|
+
buildUrl: _buildUrl,
|
|
263
265
|
connect: makeMethodFn('CONNECT'),
|
|
264
266
|
delete: makeMethodFn('DELETE'),
|
|
265
267
|
get: makeMethodFn('GET'),
|
|
@@ -4,7 +4,7 @@ import type { ArrayStyle, ObjectStyle, SerializerOptions } from './pathSerialize
|
|
|
4
4
|
|
|
5
5
|
export type QuerySerializer = (query: Record<string, unknown>) => string;
|
|
6
6
|
|
|
7
|
-
export type BodySerializer = (body:
|
|
7
|
+
export type BodySerializer = (body: unknown) => unknown;
|
|
8
8
|
|
|
9
9
|
type QuerySerializerOptionsObject = {
|
|
10
10
|
allowReserved?: boolean;
|
|
@@ -39,12 +39,10 @@ const serializeUrlSearchParamsPair = (data: URLSearchParams, key: string, value:
|
|
|
39
39
|
};
|
|
40
40
|
|
|
41
41
|
export const formDataBodySerializer = {
|
|
42
|
-
bodySerializer:
|
|
43
|
-
body: T,
|
|
44
|
-
): FormData => {
|
|
42
|
+
bodySerializer: (body: unknown): FormData => {
|
|
45
43
|
const data = new FormData();
|
|
46
44
|
|
|
47
|
-
Object.entries(body).forEach(([key, value]) => {
|
|
45
|
+
Object.entries(body as Record<string, unknown>).forEach(([key, value]) => {
|
|
48
46
|
if (value === undefined || value === null) {
|
|
49
47
|
return;
|
|
50
48
|
}
|
|
@@ -60,15 +58,15 @@ export const formDataBodySerializer = {
|
|
|
60
58
|
};
|
|
61
59
|
|
|
62
60
|
export const jsonBodySerializer = {
|
|
63
|
-
bodySerializer:
|
|
61
|
+
bodySerializer: (body: unknown): string =>
|
|
64
62
|
JSON.stringify(body, (_key, value) => (typeof value === 'bigint' ? value.toString() : value)),
|
|
65
63
|
};
|
|
66
64
|
|
|
67
65
|
export const urlSearchParamsBodySerializer = {
|
|
68
|
-
bodySerializer:
|
|
66
|
+
bodySerializer: (body: unknown): string => {
|
|
69
67
|
const data = new URLSearchParams();
|
|
70
68
|
|
|
71
|
-
Object.entries(body).forEach(([key, value]) => {
|
|
69
|
+
Object.entries(body as Record<string, unknown>).forEach(([key, value]) => {
|
|
72
70
|
if (value === undefined || value === null) {
|
|
73
71
|
return;
|
|
74
72
|
}
|
|
@@ -96,7 +96,7 @@ interface Params {
|
|
|
96
96
|
|
|
97
97
|
const stripEmptySlots = (params: Params) => {
|
|
98
98
|
for (const [slot, value] of Object.entries(params)) {
|
|
99
|
-
if (value && typeof value === 'object' && !Object.keys(value).length) {
|
|
99
|
+
if (value && typeof value === 'object' && !Array.isArray(value) && !Object.keys(value).length) {
|
|
100
100
|
delete params[slot as Slot];
|
|
101
101
|
}
|
|
102
102
|
}
|
|
@@ -37,7 +37,7 @@ export const createClient = (config: Config = {}): Client => {
|
|
|
37
37
|
...options,
|
|
38
38
|
fetch: options.fetch ?? _config.fetch ?? globalThis.fetch,
|
|
39
39
|
headers: mergeHeaders(_config.headers, options.headers),
|
|
40
|
-
serializedBody: undefined,
|
|
40
|
+
serializedBody: undefined as string | undefined,
|
|
41
41
|
};
|
|
42
42
|
|
|
43
43
|
if (opts.security) {
|
|
@@ -52,7 +52,7 @@ export const createClient = (config: Config = {}): Client => {
|
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
if (opts.body !== undefined && opts.bodySerializer) {
|
|
55
|
-
opts.serializedBody = opts.bodySerializer(opts.body);
|
|
55
|
+
opts.serializedBody = opts.bodySerializer(opts.body) as string | undefined;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
// remove Content-Type header if body is empty to avoid sending invalid requests
|
|
@@ -258,8 +258,10 @@ export const createClient = (config: Config = {}): Client => {
|
|
|
258
258
|
});
|
|
259
259
|
};
|
|
260
260
|
|
|
261
|
+
const _buildUrl: Client['buildUrl'] = (options) => buildUrl({ ..._config, ...options });
|
|
262
|
+
|
|
261
263
|
return {
|
|
262
|
-
buildUrl,
|
|
264
|
+
buildUrl: _buildUrl,
|
|
263
265
|
connect: makeMethodFn('CONNECT'),
|
|
264
266
|
delete: makeMethodFn('DELETE'),
|
|
265
267
|
get: makeMethodFn('GET'),
|