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.
Files changed (158) hide show
  1. package/dist/admin.d.mts +106 -43
  2. package/dist/admin.d.ts +106 -43
  3. package/dist/admin.js +1 -1
  4. package/dist/admin.mjs +1 -1
  5. package/dist/auth.d.mts +2 -2
  6. package/dist/auth.d.ts +2 -2
  7. package/dist/auth.js +1 -1
  8. package/dist/auth.mjs +1 -1
  9. package/dist/{chunk-442DXMRO.mjs → chunk-4WSHB6U6.mjs} +1 -1
  10. package/dist/chunk-AVPKHYGS.js +7 -0
  11. package/dist/chunk-KUT5NSX7.mjs +7 -0
  12. package/dist/chunk-KZWBOQHZ.mjs +7 -0
  13. package/dist/{chunk-VTR4XNHH.js → chunk-PE6PG7ZE.js} +1 -1
  14. package/dist/chunk-UYYU5OJ4.js +7 -0
  15. package/dist/{chunk-BGMUBB76.js → chunk-X6YDNXYV.js} +1 -1
  16. package/dist/{chunk-FC42NTFK.mjs → chunk-Z7BUNKND.mjs} +1 -1
  17. package/dist/{create-api-client-2vNCP2LN.d.mts → create-api-client-C-LEZku2.d.mts} +1 -1
  18. package/dist/{create-api-client-D-Z8R83N.d.ts → create-api-client-ebyTfhcm.d.ts} +1 -1
  19. package/dist/{create-auth-CHzmb_8_.d.mts → create-auth-DsnHpEf0.d.mts} +47 -8
  20. package/dist/{create-auth-CHzmb_8_.d.ts → create-auth-DsnHpEf0.d.ts} +47 -8
  21. package/dist/extensions/alchemy.d.mts +3 -3
  22. package/dist/extensions/alchemy.d.ts +3 -3
  23. package/dist/extensions/alchemy.js +5 -5
  24. package/dist/extensions/alchemy.mjs +5 -5
  25. package/dist/extensions/app.d.mts +3 -3
  26. package/dist/extensions/app.d.ts +3 -3
  27. package/dist/extensions/app.js +5 -5
  28. package/dist/extensions/app.mjs +5 -5
  29. package/dist/extensions/billing.d.mts +3 -3
  30. package/dist/extensions/billing.d.ts +3 -3
  31. package/dist/extensions/billing.js +5 -5
  32. package/dist/extensions/billing.mjs +5 -5
  33. package/dist/extensions/bridge.d.mts +190 -16
  34. package/dist/extensions/bridge.d.ts +190 -16
  35. package/dist/extensions/bridge.js +5 -5
  36. package/dist/extensions/bridge.mjs +5 -5
  37. package/dist/extensions/builder.d.mts +3 -3
  38. package/dist/extensions/builder.d.ts +3 -3
  39. package/dist/extensions/builder.js +5 -5
  40. package/dist/extensions/builder.mjs +5 -5
  41. package/dist/extensions/business.d.mts +82 -47
  42. package/dist/extensions/business.d.ts +82 -47
  43. package/dist/extensions/business.js +5 -5
  44. package/dist/extensions/business.mjs +5 -5
  45. package/dist/extensions/conversion.d.mts +3 -3
  46. package/dist/extensions/conversion.d.ts +3 -3
  47. package/dist/extensions/conversion.js +5 -5
  48. package/dist/extensions/conversion.mjs +5 -5
  49. package/dist/extensions/mass-send.d.mts +3 -3
  50. package/dist/extensions/mass-send.d.ts +3 -3
  51. package/dist/extensions/mass-send.js +5 -5
  52. package/dist/extensions/mass-send.mjs +5 -5
  53. package/dist/extensions/notifications.d.mts +3 -3
  54. package/dist/extensions/notifications.d.ts +3 -3
  55. package/dist/extensions/notifications.js +5 -5
  56. package/dist/extensions/notifications.mjs +5 -5
  57. package/dist/extensions/payment-requests.d.mts +7 -3
  58. package/dist/extensions/payment-requests.d.ts +7 -3
  59. package/dist/extensions/payment-requests.js +5 -5
  60. package/dist/extensions/payment-requests.mjs +5 -5
  61. package/dist/extensions/products.d.mts +3 -3
  62. package/dist/extensions/products.d.ts +3 -3
  63. package/dist/extensions/products.js +5 -5
  64. package/dist/extensions/products.mjs +5 -5
  65. package/dist/extensions/rain.d.mts +3 -3
  66. package/dist/extensions/rain.d.ts +3 -3
  67. package/dist/extensions/rain.js +5 -5
  68. package/dist/extensions/rain.mjs +5 -5
  69. package/dist/extensions/rewards.d.mts +3 -3
  70. package/dist/extensions/rewards.d.ts +3 -3
  71. package/dist/extensions/rewards.js +5 -5
  72. package/dist/extensions/rewards.mjs +5 -5
  73. package/dist/extensions/stellar-testnet.d.mts +3 -3
  74. package/dist/extensions/stellar-testnet.d.ts +3 -3
  75. package/dist/extensions/stellar-testnet.js +5 -5
  76. package/dist/extensions/stellar-testnet.mjs +5 -5
  77. package/dist/extensions/stellar.d.mts +3 -3
  78. package/dist/extensions/stellar.d.ts +3 -3
  79. package/dist/extensions/stellar.js +5 -5
  80. package/dist/extensions/stellar.mjs +5 -5
  81. package/dist/index.d.mts +2 -2
  82. package/dist/index.d.ts +2 -2
  83. package/dist/index.js +1 -1
  84. package/dist/index.mjs +1 -1
  85. package/dist/react.d.mts +2 -2
  86. package/dist/react.d.ts +2 -2
  87. package/dist/react.js +1 -1
  88. package/dist/react.mjs +1 -1
  89. package/dist/user.d.mts +16 -6
  90. package/dist/user.d.ts +16 -6
  91. package/dist/user.js +1 -1
  92. package/dist/user.mjs +1 -1
  93. package/package.json +1 -1
  94. package/src/extensions/alchemy/openapi-ts/client/client.gen.ts +5 -3
  95. package/src/extensions/alchemy/openapi-ts/core/bodySerializer.gen.ts +6 -8
  96. package/src/extensions/alchemy/openapi-ts/core/params.gen.ts +1 -1
  97. package/src/extensions/app/openapi-ts/client/client.gen.ts +5 -3
  98. package/src/extensions/app/openapi-ts/core/bodySerializer.gen.ts +6 -8
  99. package/src/extensions/app/openapi-ts/core/params.gen.ts +1 -1
  100. package/src/extensions/billing/openapi-ts/client/client.gen.ts +5 -3
  101. package/src/extensions/billing/openapi-ts/core/bodySerializer.gen.ts +6 -8
  102. package/src/extensions/billing/openapi-ts/core/params.gen.ts +1 -1
  103. package/src/extensions/bridge/openapi-ts/client/client.gen.ts +5 -3
  104. package/src/extensions/bridge/openapi-ts/core/bodySerializer.gen.ts +6 -8
  105. package/src/extensions/bridge/openapi-ts/core/params.gen.ts +1 -1
  106. package/src/extensions/bridge/openapi-ts/index.ts +2 -2
  107. package/src/extensions/bridge/openapi-ts/sdk.gen.ts +43 -1
  108. package/src/extensions/bridge/openapi-ts/types.gen.ts +201 -11
  109. package/src/extensions/builder/openapi-ts/client/client.gen.ts +5 -3
  110. package/src/extensions/builder/openapi-ts/core/bodySerializer.gen.ts +6 -8
  111. package/src/extensions/builder/openapi-ts/core/params.gen.ts +1 -1
  112. package/src/extensions/business/openapi-ts/client/client.gen.ts +5 -3
  113. package/src/extensions/business/openapi-ts/core/bodySerializer.gen.ts +6 -8
  114. package/src/extensions/business/openapi-ts/core/params.gen.ts +1 -1
  115. package/src/extensions/business/openapi-ts/types.gen.ts +79 -44
  116. package/src/extensions/conversion/openapi-ts/client/client.gen.ts +5 -3
  117. package/src/extensions/conversion/openapi-ts/core/bodySerializer.gen.ts +6 -8
  118. package/src/extensions/conversion/openapi-ts/core/params.gen.ts +1 -1
  119. package/src/extensions/mass-send/openapi-ts/client/client.gen.ts +5 -3
  120. package/src/extensions/mass-send/openapi-ts/core/bodySerializer.gen.ts +6 -8
  121. package/src/extensions/mass-send/openapi-ts/core/params.gen.ts +1 -1
  122. package/src/extensions/notifications/openapi-ts/client/client.gen.ts +5 -3
  123. package/src/extensions/notifications/openapi-ts/core/bodySerializer.gen.ts +6 -8
  124. package/src/extensions/notifications/openapi-ts/core/params.gen.ts +1 -1
  125. package/src/extensions/payment-requests/openapi-ts/client/client.gen.ts +5 -3
  126. package/src/extensions/payment-requests/openapi-ts/core/bodySerializer.gen.ts +6 -8
  127. package/src/extensions/payment-requests/openapi-ts/core/params.gen.ts +1 -1
  128. package/src/extensions/payment-requests/openapi-ts/types.gen.ts +4 -0
  129. package/src/extensions/products/openapi-ts/client/client.gen.ts +5 -3
  130. package/src/extensions/products/openapi-ts/core/bodySerializer.gen.ts +6 -8
  131. package/src/extensions/products/openapi-ts/core/params.gen.ts +1 -1
  132. package/src/extensions/rain/openapi-ts/client/client.gen.ts +5 -3
  133. package/src/extensions/rain/openapi-ts/core/bodySerializer.gen.ts +6 -8
  134. package/src/extensions/rain/openapi-ts/core/params.gen.ts +1 -1
  135. package/src/extensions/rewards/openapi-ts/client/client.gen.ts +5 -3
  136. package/src/extensions/rewards/openapi-ts/core/bodySerializer.gen.ts +6 -8
  137. package/src/extensions/rewards/openapi-ts/core/params.gen.ts +1 -1
  138. package/src/extensions/stellar/openapi-ts/client/client.gen.ts +5 -3
  139. package/src/extensions/stellar/openapi-ts/core/bodySerializer.gen.ts +6 -8
  140. package/src/extensions/stellar/openapi-ts/core/params.gen.ts +1 -1
  141. package/src/extensions/stellar-testnet/openapi-ts/client/client.gen.ts +5 -3
  142. package/src/extensions/stellar-testnet/openapi-ts/core/bodySerializer.gen.ts +6 -8
  143. package/src/extensions/stellar-testnet/openapi-ts/core/params.gen.ts +1 -1
  144. package/src/platform/admin/openapi-ts/client/client.gen.ts +5 -3
  145. package/src/platform/admin/openapi-ts/core/bodySerializer.gen.ts +6 -8
  146. package/src/platform/admin/openapi-ts/core/params.gen.ts +1 -1
  147. package/src/platform/admin/openapi-ts/sdk.gen.ts +61 -0
  148. package/src/platform/admin/openapi-ts/types.gen.ts +103 -40
  149. package/src/platform/user/openapi-ts/client/client.gen.ts +5 -3
  150. package/src/platform/user/openapi-ts/core/bodySerializer.gen.ts +6 -8
  151. package/src/platform/user/openapi-ts/core/params.gen.ts +1 -1
  152. package/src/platform/user/openapi-ts/index.ts +2 -2
  153. package/src/platform/user/openapi-ts/sdk.gen.ts +43 -1
  154. package/src/platform/user/openapi-ts/types.gen.ts +54 -7
  155. package/dist/chunk-6WLL3XNH.js +0 -7
  156. package/dist/chunk-LTRLQIIM.js +0 -7
  157. package/dist/chunk-WTKM56EI.mjs +0 -7
  158. 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: any) => any;
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: <T extends Record<string, any> | Array<Record<string, any>>>(
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: <T>(body: T): string =>
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: <T extends Record<string, any> | Array<Record<string, any>>>(body: T): string => {
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: any) => any;
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: <T extends Record<string, any> | Array<Record<string, any>>>(
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: <T>(body: T): string =>
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: <T extends Record<string, any> | Array<Record<string, any>>>(body: T): string => {
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: any) => any;
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: <T extends Record<string, any> | Array<Record<string, any>>>(
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: <T>(body: T): string =>
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: <T extends Record<string, any> | Array<Record<string, any>>>(body: T): string => {
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: any) => any;
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: <T extends Record<string, any> | Array<Record<string, any>>>(
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: <T>(body: T): string =>
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: <T extends Record<string, any> | Array<Record<string, any>>>(body: T): string => {
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: any) => any;
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: <T extends Record<string, any> | Array<Record<string, any>>>(
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: <T>(body: T): string =>
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: <T extends Record<string, any> | Array<Record<string, any>>>(body: T): string => {
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: any) => any;
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: <T extends Record<string, any> | Array<Record<string, any>>>(
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: <T>(body: T): string =>
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: <T extends Record<string, any> | Array<Record<string, any>>>(body: T): string => {
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: any) => any;
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: <T extends Record<string, any> | Array<Record<string, any>>>(
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: <T>(body: T): string =>
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: <T extends Record<string, any> | Array<Record<string, any>>>(body: T): string => {
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'),