rehive 4.2.0 → 4.2.1
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/README.md +17 -0
- package/dist/admin.d.mts +614 -116
- package/dist/admin.d.ts +614 -116
- 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-PCR54D6A.mjs → chunk-A53KSFBA.mjs} +1 -1
- package/dist/chunk-CRNPJD3E.js +6 -0
- package/dist/{chunk-ERD2XKSM.js → chunk-HXAEBUQM.js} +1 -1
- package/dist/chunk-IJBXROTB.mjs +6 -0
- package/dist/chunk-OV77OD2G.js +1 -0
- package/dist/chunk-RO2QGTSG.mjs +1 -0
- package/dist/chunk-TAABJLJG.mjs +6 -0
- package/dist/chunk-Y33FT632.js +6 -0
- package/dist/{create-api-client-B4Q01gHp.d.mts → create-api-client-Bkkri-AM.d.mts} +1 -1
- package/dist/{create-api-client-ADSlg8HX.d.ts → create-api-client-CgvKBlQ_.d.ts} +1 -1
- package/dist/{create-auth-CT_IFt3T.d.mts → create-auth-ChOASbvo.d.mts} +111 -100
- package/dist/{create-auth-CT_IFt3T.d.ts → create-auth-ChOASbvo.d.ts} +111 -100
- package/dist/extensions/alchemy.d.mts +175 -41
- package/dist/extensions/alchemy.d.ts +175 -41
- package/dist/extensions/alchemy.js +5 -6
- package/dist/extensions/alchemy.mjs +5 -6
- package/dist/extensions/app.d.mts +11 -10
- package/dist/extensions/app.d.ts +11 -10
- package/dist/extensions/app.js +5 -6
- package/dist/extensions/app.mjs +5 -6
- package/dist/extensions/billing.d.mts +11 -10
- package/dist/extensions/billing.d.ts +11 -10
- package/dist/extensions/billing.js +5 -6
- package/dist/extensions/billing.mjs +5 -6
- package/dist/extensions/bridge.d.mts +537 -38
- package/dist/extensions/bridge.d.ts +537 -38
- package/dist/extensions/bridge.js +5 -6
- package/dist/extensions/bridge.mjs +5 -6
- package/dist/extensions/builder.d.mts +8 -7
- package/dist/extensions/builder.d.ts +8 -7
- package/dist/extensions/builder.js +5 -6
- package/dist/extensions/builder.mjs +5 -6
- package/dist/extensions/business.d.mts +99 -63
- package/dist/extensions/business.d.ts +99 -63
- package/dist/extensions/business.js +5 -6
- package/dist/extensions/business.mjs +5 -6
- package/dist/extensions/conversion.d.mts +10 -9
- package/dist/extensions/conversion.d.ts +10 -9
- package/dist/extensions/conversion.js +5 -6
- package/dist/extensions/conversion.mjs +5 -6
- package/dist/extensions/mass-send.d.mts +8 -7
- package/dist/extensions/mass-send.d.ts +8 -7
- package/dist/extensions/mass-send.js +5 -6
- package/dist/extensions/mass-send.mjs +5 -6
- package/dist/extensions/notifications.d.mts +16 -15
- package/dist/extensions/notifications.d.ts +16 -15
- package/dist/extensions/notifications.js +5 -6
- package/dist/extensions/notifications.mjs +5 -6
- package/dist/extensions/payment-requests.d.mts +15 -10
- package/dist/extensions/payment-requests.d.ts +15 -10
- package/dist/extensions/payment-requests.js +5 -6
- package/dist/extensions/payment-requests.mjs +5 -6
- package/dist/extensions/products.d.mts +43 -42
- package/dist/extensions/products.d.ts +43 -42
- package/dist/extensions/products.js +5 -6
- package/dist/extensions/products.mjs +5 -6
- package/dist/extensions/rain.d.mts +22 -21
- package/dist/extensions/rain.d.ts +22 -21
- package/dist/extensions/rain.js +5 -6
- package/dist/extensions/rain.mjs +5 -6
- package/dist/extensions/rewards.d.mts +8 -7
- package/dist/extensions/rewards.d.ts +8 -7
- package/dist/extensions/rewards.js +5 -6
- package/dist/extensions/rewards.mjs +5 -6
- package/dist/extensions/stellar-testnet.d.mts +16 -15
- package/dist/extensions/stellar-testnet.d.ts +16 -15
- package/dist/extensions/stellar-testnet.js +5 -6
- package/dist/extensions/stellar-testnet.mjs +5 -6
- package/dist/extensions/stellar.d.mts +16 -15
- package/dist/extensions/stellar.d.ts +16 -15
- package/dist/extensions/stellar.js +5 -6
- package/dist/extensions/stellar.mjs +5 -6
- 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 +3 -11
- package/dist/react.d.ts +3 -11
- package/dist/react.js +1 -1
- package/dist/react.mjs +1 -1
- package/dist/user.d.mts +21 -10
- package/dist/user.d.ts +21 -10
- package/dist/user.js +1 -1
- package/dist/user.mjs +1 -1
- package/package.json +1 -1
- package/src/auth/create-auth.ts +184 -781
- package/src/auth/index.ts +2 -25
- package/src/auth/types/index.ts +0 -48
- package/src/extensions/alchemy/openapi-ts/client/client.gen.ts +17 -7
- package/src/extensions/alchemy/openapi-ts/client/types.gen.ts +2 -1
- package/src/extensions/alchemy/openapi-ts/client/utils.gen.ts +1 -1
- 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/alchemy/openapi-ts/core/serverSentEvents.gen.ts +4 -5
- package/src/extensions/alchemy/openapi-ts/core/types.gen.ts +1 -1
- package/src/extensions/alchemy/openapi-ts/core/utils.gen.ts +1 -1
- package/src/extensions/alchemy/openapi-ts/index.ts +2 -2
- package/src/extensions/alchemy/openapi-ts/sdk.gen.ts +44 -2
- package/src/extensions/alchemy/openapi-ts/types.gen.ts +177 -34
- package/src/extensions/app/openapi-ts/client/client.gen.ts +17 -7
- package/src/extensions/app/openapi-ts/client/types.gen.ts +2 -1
- package/src/extensions/app/openapi-ts/client/utils.gen.ts +1 -1
- 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/app/openapi-ts/core/serverSentEvents.gen.ts +4 -5
- package/src/extensions/app/openapi-ts/core/types.gen.ts +1 -1
- package/src/extensions/app/openapi-ts/core/utils.gen.ts +1 -1
- package/src/extensions/app/openapi-ts/sdk.gen.ts +1 -1
- package/src/extensions/app/openapi-ts/types.gen.ts +3 -3
- package/src/extensions/billing/openapi-ts/client/client.gen.ts +17 -7
- package/src/extensions/billing/openapi-ts/client/types.gen.ts +2 -1
- package/src/extensions/billing/openapi-ts/client/utils.gen.ts +1 -1
- 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/billing/openapi-ts/core/serverSentEvents.gen.ts +4 -5
- package/src/extensions/billing/openapi-ts/core/types.gen.ts +1 -1
- package/src/extensions/billing/openapi-ts/core/utils.gen.ts +1 -1
- package/src/extensions/billing/openapi-ts/sdk.gen.ts +1 -1
- package/src/extensions/billing/openapi-ts/types.gen.ts +3 -3
- package/src/extensions/bridge/openapi-ts/client/client.gen.ts +17 -7
- package/src/extensions/bridge/openapi-ts/client/types.gen.ts +2 -1
- package/src/extensions/bridge/openapi-ts/client/utils.gen.ts +1 -1
- 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/core/serverSentEvents.gen.ts +4 -5
- package/src/extensions/bridge/openapi-ts/core/types.gen.ts +1 -1
- package/src/extensions/bridge/openapi-ts/core/utils.gen.ts +1 -1
- package/src/extensions/bridge/openapi-ts/index.ts +2 -2
- package/src/extensions/bridge/openapi-ts/sdk.gen.ts +90 -2
- package/src/extensions/bridge/openapi-ts/types.gen.ts +572 -29
- package/src/extensions/builder/openapi-ts/client/client.gen.ts +17 -7
- package/src/extensions/builder/openapi-ts/client/types.gen.ts +2 -1
- package/src/extensions/builder/openapi-ts/client/utils.gen.ts +1 -1
- 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/builder/openapi-ts/core/serverSentEvents.gen.ts +4 -5
- package/src/extensions/builder/openapi-ts/core/types.gen.ts +1 -1
- package/src/extensions/builder/openapi-ts/core/utils.gen.ts +1 -1
- package/src/extensions/builder/openapi-ts/sdk.gen.ts +1 -1
- package/src/extensions/business/openapi-ts/client/client.gen.ts +17 -7
- package/src/extensions/business/openapi-ts/client/types.gen.ts +2 -1
- package/src/extensions/business/openapi-ts/client/utils.gen.ts +1 -1
- 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/core/serverSentEvents.gen.ts +4 -5
- package/src/extensions/business/openapi-ts/core/types.gen.ts +1 -1
- package/src/extensions/business/openapi-ts/core/utils.gen.ts +1 -1
- package/src/extensions/business/openapi-ts/sdk.gen.ts +1 -1
- package/src/extensions/business/openapi-ts/types.gen.ts +91 -56
- package/src/extensions/conversion/openapi-ts/client/client.gen.ts +17 -7
- package/src/extensions/conversion/openapi-ts/client/types.gen.ts +2 -1
- package/src/extensions/conversion/openapi-ts/client/utils.gen.ts +1 -1
- 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/conversion/openapi-ts/core/serverSentEvents.gen.ts +4 -5
- package/src/extensions/conversion/openapi-ts/core/types.gen.ts +1 -1
- package/src/extensions/conversion/openapi-ts/core/utils.gen.ts +1 -1
- package/src/extensions/conversion/openapi-ts/sdk.gen.ts +1 -1
- package/src/extensions/conversion/openapi-ts/types.gen.ts +2 -2
- package/src/extensions/mass-send/openapi-ts/client/client.gen.ts +17 -7
- package/src/extensions/mass-send/openapi-ts/client/types.gen.ts +2 -1
- package/src/extensions/mass-send/openapi-ts/client/utils.gen.ts +1 -1
- 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/mass-send/openapi-ts/core/serverSentEvents.gen.ts +4 -5
- package/src/extensions/mass-send/openapi-ts/core/types.gen.ts +1 -1
- package/src/extensions/mass-send/openapi-ts/core/utils.gen.ts +1 -1
- package/src/extensions/mass-send/openapi-ts/sdk.gen.ts +1 -1
- package/src/extensions/notifications/openapi-ts/client/client.gen.ts +17 -7
- package/src/extensions/notifications/openapi-ts/client/types.gen.ts +2 -1
- package/src/extensions/notifications/openapi-ts/client/utils.gen.ts +1 -1
- 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/notifications/openapi-ts/core/serverSentEvents.gen.ts +4 -5
- package/src/extensions/notifications/openapi-ts/core/types.gen.ts +1 -1
- package/src/extensions/notifications/openapi-ts/core/utils.gen.ts +1 -1
- package/src/extensions/notifications/openapi-ts/sdk.gen.ts +1 -1
- package/src/extensions/notifications/openapi-ts/types.gen.ts +8 -8
- package/src/extensions/payment-requests/openapi-ts/client/client.gen.ts +17 -7
- package/src/extensions/payment-requests/openapi-ts/client/types.gen.ts +2 -1
- package/src/extensions/payment-requests/openapi-ts/client/utils.gen.ts +1 -1
- 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/core/serverSentEvents.gen.ts +4 -5
- package/src/extensions/payment-requests/openapi-ts/core/types.gen.ts +1 -1
- package/src/extensions/payment-requests/openapi-ts/core/utils.gen.ts +1 -1
- package/src/extensions/payment-requests/openapi-ts/sdk.gen.ts +1 -1
- package/src/extensions/payment-requests/openapi-ts/types.gen.ts +7 -3
- package/src/extensions/products/openapi-ts/client/client.gen.ts +17 -7
- package/src/extensions/products/openapi-ts/client/types.gen.ts +2 -1
- package/src/extensions/products/openapi-ts/client/utils.gen.ts +1 -1
- 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/products/openapi-ts/core/serverSentEvents.gen.ts +4 -5
- package/src/extensions/products/openapi-ts/core/types.gen.ts +1 -1
- package/src/extensions/products/openapi-ts/core/utils.gen.ts +1 -1
- package/src/extensions/products/openapi-ts/sdk.gen.ts +1 -1
- package/src/extensions/products/openapi-ts/types.gen.ts +35 -35
- package/src/extensions/rain/openapi-ts/client/client.gen.ts +17 -7
- package/src/extensions/rain/openapi-ts/client/types.gen.ts +2 -1
- package/src/extensions/rain/openapi-ts/client/utils.gen.ts +1 -1
- 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/rain/openapi-ts/core/serverSentEvents.gen.ts +4 -5
- package/src/extensions/rain/openapi-ts/core/types.gen.ts +1 -1
- package/src/extensions/rain/openapi-ts/core/utils.gen.ts +1 -1
- package/src/extensions/rain/openapi-ts/sdk.gen.ts +1 -1
- package/src/extensions/rain/openapi-ts/types.gen.ts +14 -14
- package/src/extensions/rewards/openapi-ts/client/client.gen.ts +17 -7
- package/src/extensions/rewards/openapi-ts/client/types.gen.ts +2 -1
- package/src/extensions/rewards/openapi-ts/client/utils.gen.ts +1 -1
- 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/rewards/openapi-ts/core/serverSentEvents.gen.ts +4 -5
- package/src/extensions/rewards/openapi-ts/core/types.gen.ts +1 -1
- package/src/extensions/rewards/openapi-ts/core/utils.gen.ts +1 -1
- package/src/extensions/rewards/openapi-ts/sdk.gen.ts +1 -1
- package/src/extensions/stellar/openapi-ts/client/client.gen.ts +17 -7
- package/src/extensions/stellar/openapi-ts/client/types.gen.ts +2 -1
- package/src/extensions/stellar/openapi-ts/client/utils.gen.ts +1 -1
- 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/openapi-ts/core/serverSentEvents.gen.ts +4 -5
- package/src/extensions/stellar/openapi-ts/core/types.gen.ts +1 -1
- package/src/extensions/stellar/openapi-ts/core/utils.gen.ts +1 -1
- package/src/extensions/stellar/openapi-ts/sdk.gen.ts +1 -1
- package/src/extensions/stellar/openapi-ts/types.gen.ts +8 -8
- package/src/extensions/stellar-testnet/openapi-ts/client/client.gen.ts +17 -7
- package/src/extensions/stellar-testnet/openapi-ts/client/types.gen.ts +2 -1
- package/src/extensions/stellar-testnet/openapi-ts/client/utils.gen.ts +1 -1
- 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/extensions/stellar-testnet/openapi-ts/core/serverSentEvents.gen.ts +4 -5
- package/src/extensions/stellar-testnet/openapi-ts/core/types.gen.ts +1 -1
- package/src/extensions/stellar-testnet/openapi-ts/core/utils.gen.ts +1 -1
- package/src/extensions/stellar-testnet/openapi-ts/sdk.gen.ts +1 -1
- package/src/extensions/stellar-testnet/openapi-ts/types.gen.ts +8 -8
- package/src/platform/admin/openapi-ts/client/client.gen.ts +17 -7
- package/src/platform/admin/openapi-ts/client/types.gen.ts +2 -1
- package/src/platform/admin/openapi-ts/client/utils.gen.ts +1 -1
- 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/core/serverSentEvents.gen.ts +4 -5
- package/src/platform/admin/openapi-ts/core/types.gen.ts +1 -1
- package/src/platform/admin/openapi-ts/core/utils.gen.ts +1 -1
- package/src/platform/admin/openapi-ts/index.ts +2 -2
- package/src/platform/admin/openapi-ts/sdk.gen.ts +54 -12
- package/src/platform/admin/openapi-ts/types.gen.ts +623 -107
- package/src/platform/user/openapi-ts/client/client.gen.ts +17 -7
- package/src/platform/user/openapi-ts/client/types.gen.ts +2 -1
- package/src/platform/user/openapi-ts/client/utils.gen.ts +1 -1
- 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/core/serverSentEvents.gen.ts +4 -5
- package/src/platform/user/openapi-ts/core/types.gen.ts +1 -1
- package/src/platform/user/openapi-ts/core/utils.gen.ts +1 -1
- package/src/platform/user/openapi-ts/index.ts +2 -2
- package/src/platform/user/openapi-ts/sdk.gen.ts +30 -4
- package/src/platform/user/openapi-ts/types.gen.ts +116 -52
- package/dist/chunk-7USVOK77.js +0 -7
- package/dist/chunk-G3M5QMRX.js +0 -1
- package/dist/chunk-HSPTEN45.mjs +0 -1
- package/dist/chunk-HWXE5WBF.js +0 -7
- package/dist/chunk-MUN3POSM.mjs +0 -7
- package/dist/chunk-ZUZHOLAX.mjs +0 -7
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as ApiFactoryConfig, B as BoundSdk } from '../create-api-client-
|
|
2
|
-
import '../create-auth-
|
|
1
|
+
import { A as ApiFactoryConfig, B as BoundSdk } from '../create-api-client-CgvKBlQ_.js';
|
|
2
|
+
import '../create-auth-ChOASbvo.js';
|
|
3
3
|
|
|
4
4
|
type AuthToken = string | undefined;
|
|
5
5
|
interface Auth {
|
|
@@ -30,7 +30,7 @@ type ArrayStyle = 'form' | 'spaceDelimited' | 'pipeDelimited';
|
|
|
30
30
|
type ObjectStyle = 'form' | 'deepObject';
|
|
31
31
|
|
|
32
32
|
type QuerySerializer = (query: Record<string, unknown>) => string;
|
|
33
|
-
type BodySerializer = (body:
|
|
33
|
+
type BodySerializer = (body: unknown) => unknown;
|
|
34
34
|
type QuerySerializerOptionsObject = {
|
|
35
35
|
allowReserved?: boolean;
|
|
36
36
|
array?: Partial<SerializerOptions<ArrayStyle>>;
|
|
@@ -105,7 +105,7 @@ interface Config$1 {
|
|
|
105
105
|
requestValidator?: (data: unknown) => Promise<unknown>;
|
|
106
106
|
/**
|
|
107
107
|
* A function transforming response data before it's returned. This is useful
|
|
108
|
-
* for post-processing data, e.g
|
|
108
|
+
* for post-processing data, e.g., converting ISO strings into Date objects.
|
|
109
109
|
*/
|
|
110
110
|
responseTransformer?: (data: unknown) => Promise<unknown>;
|
|
111
111
|
/**
|
|
@@ -265,6 +265,7 @@ interface RequestOptions<TData = unknown, TResponseStyle extends ResponseStyle =
|
|
|
265
265
|
url: Url;
|
|
266
266
|
}
|
|
267
267
|
interface ResolvedRequestOptions<TResponseStyle extends ResponseStyle = 'data', ThrowOnError extends boolean = boolean, Url extends string = string> extends RequestOptions<unknown, TResponseStyle, ThrowOnError, Url> {
|
|
268
|
+
headers: Headers;
|
|
268
269
|
serializedBody?: string;
|
|
269
270
|
}
|
|
270
271
|
type RequestResult<TData = unknown, TError = unknown, ThrowOnError extends boolean = boolean, TResponseStyle extends ResponseStyle = 'data'> = ThrowOnError extends true ? Promise<TResponseStyle extends 'data' ? TData extends Record<string, unknown> ? TData[keyof TData] : TData : {
|
|
@@ -287,7 +288,7 @@ interface ClientOptions$1 {
|
|
|
287
288
|
throwOnError?: boolean;
|
|
288
289
|
}
|
|
289
290
|
type MethodFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = 'data'>(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, 'method'>) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
|
|
290
|
-
type SseFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = 'data'>(options: Omit<RequestOptions<
|
|
291
|
+
type SseFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = 'data'>(options: Omit<RequestOptions<never, TResponseStyle, ThrowOnError>, 'method'>) => Promise<ServerSentEventsResult<TData, TError>>;
|
|
291
292
|
type RequestFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = 'data'>(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, 'method'> & Pick<Required<RequestOptions<TData, TResponseStyle, ThrowOnError>>, 'method'>) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
|
|
292
293
|
type BuildUrlFn = <TData extends {
|
|
293
294
|
body?: unknown;
|
|
@@ -341,7 +342,7 @@ type AdminCard = {
|
|
|
341
342
|
* * `virtual` - Virtual
|
|
342
343
|
* * `physical` - Physical
|
|
343
344
|
*/
|
|
344
|
-
type: 'virtual' | 'physical';
|
|
345
|
+
readonly type: 'virtual' | 'physical';
|
|
345
346
|
readonly rain_id: string | null;
|
|
346
347
|
readonly created: number;
|
|
347
348
|
readonly updated: number;
|
|
@@ -360,7 +361,7 @@ type AdminCompany = {
|
|
|
360
361
|
* * `test` - Test
|
|
361
362
|
* * `production` - Production
|
|
362
363
|
*/
|
|
363
|
-
mode: 'test' | 'production';
|
|
364
|
+
readonly mode: 'test' | 'production';
|
|
364
365
|
readonly operational_account: string | null;
|
|
365
366
|
rain_api_key: string;
|
|
366
367
|
};
|
|
@@ -409,7 +410,7 @@ type AdminExtendedCard = {
|
|
|
409
410
|
* * `virtual` - Virtual
|
|
410
411
|
* * `physical` - Physical
|
|
411
412
|
*/
|
|
412
|
-
type: 'virtual' | 'physical';
|
|
413
|
+
readonly type: 'virtual' | 'physical';
|
|
413
414
|
readonly rain_id: string | null;
|
|
414
415
|
/**
|
|
415
416
|
* * `notActivated` - Not Activated
|
|
@@ -417,7 +418,7 @@ type AdminExtendedCard = {
|
|
|
417
418
|
* * `locked` - Locked
|
|
418
419
|
* * `canceled` - Canceled
|
|
419
420
|
*/
|
|
420
|
-
status: 'notActivated' | 'active' | 'locked' | 'canceled';
|
|
421
|
+
readonly status: 'notActivated' | 'active' | 'locked' | 'canceled';
|
|
421
422
|
readonly last_4: string;
|
|
422
423
|
readonly expiration_month: string;
|
|
423
424
|
readonly expiration_year: string;
|
|
@@ -442,7 +443,7 @@ type AdminUpdateCompany = {
|
|
|
442
443
|
* * `test` - Test
|
|
443
444
|
* * `production` - Production
|
|
444
445
|
*/
|
|
445
|
-
mode: 'test' | 'production';
|
|
446
|
+
readonly mode: 'test' | 'production';
|
|
446
447
|
operational_account?: string | null;
|
|
447
448
|
rain_api_key?: string;
|
|
448
449
|
};
|
|
@@ -556,7 +557,7 @@ type PatchedAdminUpdateCompany = {
|
|
|
556
557
|
* * `test` - Test
|
|
557
558
|
* * `production` - Production
|
|
558
559
|
*/
|
|
559
|
-
mode?: 'test' | 'production';
|
|
560
|
+
readonly mode?: 'test' | 'production';
|
|
560
561
|
operational_account?: string | null;
|
|
561
562
|
rain_api_key?: string;
|
|
562
563
|
};
|
|
@@ -863,7 +864,7 @@ type UserApplication = {
|
|
|
863
864
|
* * `ZM` - Zambia
|
|
864
865
|
* * `ZW` - Zimbabwe
|
|
865
866
|
*/
|
|
866
|
-
nationality: 'AF' | 'AX' | 'AL' | 'DZ' | 'AS' | 'AD' | 'AO' | 'AI' | 'AQ' | 'AG' | 'AR' | 'AM' | 'AW' | 'AU' | 'AT' | 'AZ' | 'BS' | 'BH' | 'BD' | 'BB' | 'BY' | 'BE' | 'BZ' | 'BJ' | 'BM' | 'BT' | 'BO' | 'BQ' | 'BA' | 'BW' | 'BV' | 'BR' | 'IO' | 'BN' | 'BG' | 'BF' | 'BI' | 'CV' | 'KH' | 'CM' | 'CA' | 'KY' | 'CF' | 'TD' | 'CL' | 'CN' | 'CX' | 'CC' | 'CO' | 'KM' | 'CG' | 'CD' | 'CK' | 'CR' | 'CI' | 'HR' | 'CU' | 'CW' | 'CY' | 'CZ' | 'DK' | 'DJ' | 'DM' | 'DO' | 'EC' | 'EG' | 'SV' | 'GQ' | 'ER' | 'EE' | 'SZ' | 'ET' | 'FK' | 'FO' | 'FJ' | 'FI' | 'FR' | 'GF' | 'PF' | 'TF' | 'GA' | 'GM' | 'GE' | 'DE' | 'GH' | 'GI' | 'GR' | 'GL' | 'GD' | 'GP' | 'GU' | 'GT' | 'GG' | 'GN' | 'GW' | 'GY' | 'HT' | 'HM' | 'VA' | 'HN' | 'HK' | 'HU' | 'IS' | 'IN' | 'ID' | 'IR' | 'IQ' | 'IE' | 'IM' | 'IL' | 'IT' | 'JM' | 'JP' | 'JE' | 'JO' | 'KZ' | 'KE' | 'KI' | 'KW' | 'KG' | 'LA' | 'LV' | 'LB' | 'LS' | 'LR' | 'LY' | 'LI' | 'LT' | 'LU' | 'MO' | 'MG' | 'MW' | 'MY' | 'MV' | 'ML' | 'MT' | 'MH' | 'MQ' | 'MR' | 'MU' | 'YT' | 'MX' | 'FM' | 'MD' | 'MC' | 'MN' | 'ME' | 'MS' | 'MA' | 'MZ' | 'MM' | 'NA' | 'NR' | 'NP' | 'NL' | 'NC' | 'NZ' | 'NI' | 'NE' | 'NG' | 'NU' | 'NF' | 'KP' | 'MK' | 'MP' | 'NO' | 'OM' | 'PK' | 'PW' | 'PS' | 'PA' | 'PG' | 'PY' | 'PE' | 'PH' | 'PN' | 'PL' | 'PT' | 'PR' | 'QA' | 'RE' | 'RO' | 'RU' | 'RW' | 'BL' | 'SH' | 'KN' | 'LC' | 'MF' | 'PM' | 'VC' | 'WS' | 'SM' | 'ST' | 'SA' | 'SN' | 'RS' | 'SC' | 'SL' | 'SG' | 'SX' | 'SK' | 'SI' | 'SB' | 'SO' | 'ZA' | 'GS' | 'KR' | 'SS' | 'ES' | 'LK' | 'SD' | 'SR' | 'SJ' | 'SE' | 'CH' | 'SY' | 'TW' | 'TJ' | 'TZ' | 'TH' | 'TL' | 'TG' | 'TK' | 'TO' | 'TT' | 'TN' | 'TR' | 'TM' | 'TC' | 'TV' | 'UG' | 'UA' | 'AE' | 'GB' | 'UM' | 'US' | 'UY' | 'UZ' | 'VU' | 'VE' | 'VN' | 'VG' | 'VI' | 'WF' | 'EH' | 'YE' | 'ZM' | 'ZW' | null;
|
|
867
|
+
readonly nationality: 'AF' | 'AX' | 'AL' | 'DZ' | 'AS' | 'AD' | 'AO' | 'AI' | 'AQ' | 'AG' | 'AR' | 'AM' | 'AW' | 'AU' | 'AT' | 'AZ' | 'BS' | 'BH' | 'BD' | 'BB' | 'BY' | 'BE' | 'BZ' | 'BJ' | 'BM' | 'BT' | 'BO' | 'BQ' | 'BA' | 'BW' | 'BV' | 'BR' | 'IO' | 'BN' | 'BG' | 'BF' | 'BI' | 'CV' | 'KH' | 'CM' | 'CA' | 'KY' | 'CF' | 'TD' | 'CL' | 'CN' | 'CX' | 'CC' | 'CO' | 'KM' | 'CG' | 'CD' | 'CK' | 'CR' | 'CI' | 'HR' | 'CU' | 'CW' | 'CY' | 'CZ' | 'DK' | 'DJ' | 'DM' | 'DO' | 'EC' | 'EG' | 'SV' | 'GQ' | 'ER' | 'EE' | 'SZ' | 'ET' | 'FK' | 'FO' | 'FJ' | 'FI' | 'FR' | 'GF' | 'PF' | 'TF' | 'GA' | 'GM' | 'GE' | 'DE' | 'GH' | 'GI' | 'GR' | 'GL' | 'GD' | 'GP' | 'GU' | 'GT' | 'GG' | 'GN' | 'GW' | 'GY' | 'HT' | 'HM' | 'VA' | 'HN' | 'HK' | 'HU' | 'IS' | 'IN' | 'ID' | 'IR' | 'IQ' | 'IE' | 'IM' | 'IL' | 'IT' | 'JM' | 'JP' | 'JE' | 'JO' | 'KZ' | 'KE' | 'KI' | 'KW' | 'KG' | 'LA' | 'LV' | 'LB' | 'LS' | 'LR' | 'LY' | 'LI' | 'LT' | 'LU' | 'MO' | 'MG' | 'MW' | 'MY' | 'MV' | 'ML' | 'MT' | 'MH' | 'MQ' | 'MR' | 'MU' | 'YT' | 'MX' | 'FM' | 'MD' | 'MC' | 'MN' | 'ME' | 'MS' | 'MA' | 'MZ' | 'MM' | 'NA' | 'NR' | 'NP' | 'NL' | 'NC' | 'NZ' | 'NI' | 'NE' | 'NG' | 'NU' | 'NF' | 'KP' | 'MK' | 'MP' | 'NO' | 'OM' | 'PK' | 'PW' | 'PS' | 'PA' | 'PG' | 'PY' | 'PE' | 'PH' | 'PN' | 'PL' | 'PT' | 'PR' | 'QA' | 'RE' | 'RO' | 'RU' | 'RW' | 'BL' | 'SH' | 'KN' | 'LC' | 'MF' | 'PM' | 'VC' | 'WS' | 'SM' | 'ST' | 'SA' | 'SN' | 'RS' | 'SC' | 'SL' | 'SG' | 'SX' | 'SK' | 'SI' | 'SB' | 'SO' | 'ZA' | 'GS' | 'KR' | 'SS' | 'ES' | 'LK' | 'SD' | 'SR' | 'SJ' | 'SE' | 'CH' | 'SY' | 'TW' | 'TJ' | 'TZ' | 'TH' | 'TL' | 'TG' | 'TK' | 'TO' | 'TT' | 'TN' | 'TR' | 'TM' | 'TC' | 'TV' | 'UG' | 'UA' | 'AE' | 'GB' | 'UM' | 'US' | 'UY' | 'UZ' | 'VU' | 'VE' | 'VN' | 'VG' | 'VI' | 'WF' | 'EH' | 'YE' | 'ZM' | 'ZW' | null;
|
|
867
868
|
readonly email: string | null;
|
|
868
869
|
readonly address: {
|
|
869
870
|
[key: string]: unknown;
|
|
@@ -878,7 +879,7 @@ type UserApplication = {
|
|
|
878
879
|
* * `canceled` - Canceled
|
|
879
880
|
* * `approved` - Approved
|
|
880
881
|
*/
|
|
881
|
-
status: 'pending' | 'needsInformation' | 'needsVerification' | 'manualReview' | 'denied' | 'locked' | 'canceled' | 'approved' | null;
|
|
882
|
+
readonly status: 'pending' | 'needsInformation' | 'needsVerification' | 'manualReview' | 'denied' | 'locked' | 'canceled' | 'approved' | null;
|
|
882
883
|
readonly completion_link: string | null;
|
|
883
884
|
readonly verification_link: string | null;
|
|
884
885
|
readonly errors: Array<string> | null;
|
|
@@ -904,7 +905,7 @@ type UserCard = {
|
|
|
904
905
|
* * `virtual` - Virtual
|
|
905
906
|
* * `physical` - Physical
|
|
906
907
|
*/
|
|
907
|
-
type: 'virtual' | 'physical';
|
|
908
|
+
readonly type: 'virtual' | 'physical';
|
|
908
909
|
readonly rain_id: string | null;
|
|
909
910
|
readonly created: number;
|
|
910
911
|
readonly updated: number;
|
|
@@ -1194,7 +1195,7 @@ type UserCreateApplication = {
|
|
|
1194
1195
|
* * `ZM` - Zambia
|
|
1195
1196
|
* * `ZW` - Zimbabwe
|
|
1196
1197
|
*/
|
|
1197
|
-
nationality: 'AF' | 'AX' | 'AL' | 'DZ' | 'AS' | 'AD' | 'AO' | 'AI' | 'AQ' | 'AG' | 'AR' | 'AM' | 'AW' | 'AU' | 'AT' | 'AZ' | 'BS' | 'BH' | 'BD' | 'BB' | 'BY' | 'BE' | 'BZ' | 'BJ' | 'BM' | 'BT' | 'BO' | 'BQ' | 'BA' | 'BW' | 'BV' | 'BR' | 'IO' | 'BN' | 'BG' | 'BF' | 'BI' | 'CV' | 'KH' | 'CM' | 'CA' | 'KY' | 'CF' | 'TD' | 'CL' | 'CN' | 'CX' | 'CC' | 'CO' | 'KM' | 'CG' | 'CD' | 'CK' | 'CR' | 'CI' | 'HR' | 'CU' | 'CW' | 'CY' | 'CZ' | 'DK' | 'DJ' | 'DM' | 'DO' | 'EC' | 'EG' | 'SV' | 'GQ' | 'ER' | 'EE' | 'SZ' | 'ET' | 'FK' | 'FO' | 'FJ' | 'FI' | 'FR' | 'GF' | 'PF' | 'TF' | 'GA' | 'GM' | 'GE' | 'DE' | 'GH' | 'GI' | 'GR' | 'GL' | 'GD' | 'GP' | 'GU' | 'GT' | 'GG' | 'GN' | 'GW' | 'GY' | 'HT' | 'HM' | 'VA' | 'HN' | 'HK' | 'HU' | 'IS' | 'IN' | 'ID' | 'IR' | 'IQ' | 'IE' | 'IM' | 'IL' | 'IT' | 'JM' | 'JP' | 'JE' | 'JO' | 'KZ' | 'KE' | 'KI' | 'KW' | 'KG' | 'LA' | 'LV' | 'LB' | 'LS' | 'LR' | 'LY' | 'LI' | 'LT' | 'LU' | 'MO' | 'MG' | 'MW' | 'MY' | 'MV' | 'ML' | 'MT' | 'MH' | 'MQ' | 'MR' | 'MU' | 'YT' | 'MX' | 'FM' | 'MD' | 'MC' | 'MN' | 'ME' | 'MS' | 'MA' | 'MZ' | 'MM' | 'NA' | 'NR' | 'NP' | 'NL' | 'NC' | 'NZ' | 'NI' | 'NE' | 'NG' | 'NU' | 'NF' | 'KP' | 'MK' | 'MP' | 'NO' | 'OM' | 'PK' | 'PW' | 'PS' | 'PA' | 'PG' | 'PY' | 'PE' | 'PH' | 'PN' | 'PL' | 'PT' | 'PR' | 'QA' | 'RE' | 'RO' | 'RU' | 'RW' | 'BL' | 'SH' | 'KN' | 'LC' | 'MF' | 'PM' | 'VC' | 'WS' | 'SM' | 'ST' | 'SA' | 'SN' | 'RS' | 'SC' | 'SL' | 'SG' | 'SX' | 'SK' | 'SI' | 'SB' | 'SO' | 'ZA' | 'GS' | 'KR' | 'SS' | 'ES' | 'LK' | 'SD' | 'SR' | 'SJ' | 'SE' | 'CH' | 'SY' | 'TW' | 'TJ' | 'TZ' | 'TH' | 'TL' | 'TG' | 'TK' | 'TO' | 'TT' | 'TN' | 'TR' | 'TM' | 'TC' | 'TV' | 'UG' | 'UA' | 'AE' | 'GB' | 'UM' | 'US' | 'UY' | 'UZ' | 'VU' | 'VE' | 'VN' | 'VG' | 'VI' | 'WF' | 'EH' | 'YE' | 'ZM' | 'ZW' | null;
|
|
1198
|
+
readonly nationality: 'AF' | 'AX' | 'AL' | 'DZ' | 'AS' | 'AD' | 'AO' | 'AI' | 'AQ' | 'AG' | 'AR' | 'AM' | 'AW' | 'AU' | 'AT' | 'AZ' | 'BS' | 'BH' | 'BD' | 'BB' | 'BY' | 'BE' | 'BZ' | 'BJ' | 'BM' | 'BT' | 'BO' | 'BQ' | 'BA' | 'BW' | 'BV' | 'BR' | 'IO' | 'BN' | 'BG' | 'BF' | 'BI' | 'CV' | 'KH' | 'CM' | 'CA' | 'KY' | 'CF' | 'TD' | 'CL' | 'CN' | 'CX' | 'CC' | 'CO' | 'KM' | 'CG' | 'CD' | 'CK' | 'CR' | 'CI' | 'HR' | 'CU' | 'CW' | 'CY' | 'CZ' | 'DK' | 'DJ' | 'DM' | 'DO' | 'EC' | 'EG' | 'SV' | 'GQ' | 'ER' | 'EE' | 'SZ' | 'ET' | 'FK' | 'FO' | 'FJ' | 'FI' | 'FR' | 'GF' | 'PF' | 'TF' | 'GA' | 'GM' | 'GE' | 'DE' | 'GH' | 'GI' | 'GR' | 'GL' | 'GD' | 'GP' | 'GU' | 'GT' | 'GG' | 'GN' | 'GW' | 'GY' | 'HT' | 'HM' | 'VA' | 'HN' | 'HK' | 'HU' | 'IS' | 'IN' | 'ID' | 'IR' | 'IQ' | 'IE' | 'IM' | 'IL' | 'IT' | 'JM' | 'JP' | 'JE' | 'JO' | 'KZ' | 'KE' | 'KI' | 'KW' | 'KG' | 'LA' | 'LV' | 'LB' | 'LS' | 'LR' | 'LY' | 'LI' | 'LT' | 'LU' | 'MO' | 'MG' | 'MW' | 'MY' | 'MV' | 'ML' | 'MT' | 'MH' | 'MQ' | 'MR' | 'MU' | 'YT' | 'MX' | 'FM' | 'MD' | 'MC' | 'MN' | 'ME' | 'MS' | 'MA' | 'MZ' | 'MM' | 'NA' | 'NR' | 'NP' | 'NL' | 'NC' | 'NZ' | 'NI' | 'NE' | 'NG' | 'NU' | 'NF' | 'KP' | 'MK' | 'MP' | 'NO' | 'OM' | 'PK' | 'PW' | 'PS' | 'PA' | 'PG' | 'PY' | 'PE' | 'PH' | 'PN' | 'PL' | 'PT' | 'PR' | 'QA' | 'RE' | 'RO' | 'RU' | 'RW' | 'BL' | 'SH' | 'KN' | 'LC' | 'MF' | 'PM' | 'VC' | 'WS' | 'SM' | 'ST' | 'SA' | 'SN' | 'RS' | 'SC' | 'SL' | 'SG' | 'SX' | 'SK' | 'SI' | 'SB' | 'SO' | 'ZA' | 'GS' | 'KR' | 'SS' | 'ES' | 'LK' | 'SD' | 'SR' | 'SJ' | 'SE' | 'CH' | 'SY' | 'TW' | 'TJ' | 'TZ' | 'TH' | 'TL' | 'TG' | 'TK' | 'TO' | 'TT' | 'TN' | 'TR' | 'TM' | 'TC' | 'TV' | 'UG' | 'UA' | 'AE' | 'GB' | 'UM' | 'US' | 'UY' | 'UZ' | 'VU' | 'VE' | 'VN' | 'VG' | 'VI' | 'WF' | 'EH' | 'YE' | 'ZM' | 'ZW' | null;
|
|
1198
1199
|
readonly email: string | null;
|
|
1199
1200
|
readonly address: {
|
|
1200
1201
|
[key: string]: unknown;
|
|
@@ -1209,7 +1210,7 @@ type UserCreateApplication = {
|
|
|
1209
1210
|
* * `canceled` - Canceled
|
|
1210
1211
|
* * `approved` - Approved
|
|
1211
1212
|
*/
|
|
1212
|
-
status: 'pending' | 'needsInformation' | 'needsVerification' | 'manualReview' | 'denied' | 'locked' | 'canceled' | 'approved' | null;
|
|
1213
|
+
readonly status: 'pending' | 'needsInformation' | 'needsVerification' | 'manualReview' | 'denied' | 'locked' | 'canceled' | 'approved' | null;
|
|
1213
1214
|
readonly completion_link: string | null;
|
|
1214
1215
|
readonly verification_link: string | null;
|
|
1215
1216
|
readonly errors: Array<string> | null;
|
|
@@ -1231,7 +1232,7 @@ type UserCreateCard = {
|
|
|
1231
1232
|
* * `virtual` - Virtual
|
|
1232
1233
|
* * `physical` - Physical
|
|
1233
1234
|
*/
|
|
1234
|
-
type: 'virtual' | 'physical';
|
|
1235
|
+
readonly type: 'virtual' | 'physical';
|
|
1235
1236
|
readonly rain_id: string | null;
|
|
1236
1237
|
readonly created: number;
|
|
1237
1238
|
readonly updated: number;
|
|
@@ -1250,7 +1251,7 @@ type UserExtendedCard = {
|
|
|
1250
1251
|
* * `virtual` - Virtual
|
|
1251
1252
|
* * `physical` - Physical
|
|
1252
1253
|
*/
|
|
1253
|
-
type: 'virtual' | 'physical';
|
|
1254
|
+
readonly type: 'virtual' | 'physical';
|
|
1254
1255
|
readonly rain_id: string | null;
|
|
1255
1256
|
/**
|
|
1256
1257
|
* * `notActivated` - Not Activated
|
|
@@ -1258,7 +1259,7 @@ type UserExtendedCard = {
|
|
|
1258
1259
|
* * `locked` - Locked
|
|
1259
1260
|
* * `canceled` - Canceled
|
|
1260
1261
|
*/
|
|
1261
|
-
status: 'notActivated' | 'active' | 'locked' | 'canceled';
|
|
1262
|
+
readonly status: 'notActivated' | 'active' | 'locked' | 'canceled';
|
|
1262
1263
|
readonly last_4: string;
|
|
1263
1264
|
readonly expiration_month: string;
|
|
1264
1265
|
readonly expiration_year: string;
|
|
@@ -1819,7 +1820,7 @@ type WebhookCreateResponses = {
|
|
|
1819
1820
|
};
|
|
1820
1821
|
type WebhookCreateResponse = WebhookCreateResponses[keyof WebhookCreateResponses];
|
|
1821
1822
|
|
|
1822
|
-
type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = Options$1<TData, ThrowOnError> & {
|
|
1823
|
+
type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options$1<TData, ThrowOnError, TResponse> & {
|
|
1823
1824
|
/**
|
|
1824
1825
|
* You can provide a client instance returned by `createClient()` instead of
|
|
1825
1826
|
* individual options. This might be also useful if you want to implement a
|
|
@@ -1859,7 +1860,7 @@ declare const userCardsPinPartialUpdate: <ThrowOnError extends boolean = false>(
|
|
|
1859
1860
|
declare const userCardsPinUpdate: <ThrowOnError extends boolean = false>(options: Options<UserCardsPinUpdateData, ThrowOnError>) => RequestResult<UserCardsPinUpdateResponses, unknown, ThrowOnError, "data">;
|
|
1860
1861
|
declare const webhookCreate: <ThrowOnError extends boolean = false>(options: Options<WebhookCreateData, ThrowOnError>) => RequestResult<WebhookCreateResponses, unknown, ThrowOnError, "data">;
|
|
1861
1862
|
|
|
1862
|
-
type sdk_Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = Options<TData, ThrowOnError>;
|
|
1863
|
+
type sdk_Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options<TData, ThrowOnError, TResponse>;
|
|
1863
1864
|
declare const sdk_activateCreate: typeof activateCreate;
|
|
1864
1865
|
declare const sdk_adminCardsList: typeof adminCardsList;
|
|
1865
1866
|
declare const sdk_adminCardsRetrieve: typeof adminCardsRetrieve;
|
package/dist/extensions/rain.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkGR5TETAUjs = require('../chunk-GR5TETAU.js');var _chunkOEIQFP6Tjs = require('../chunk-OEIQFP6T.js');var K={};_chunkOEIQFP6Tjs.a.call(void 0, K,{activateCreate:()=>me,adminCardsList:()=>Oe,adminCardsRetrieve:()=>Re,adminCompanyPartialUpdate:()=>
|
|
2
|
-
`).
|
|
3
|
-
`);let W=E.split(`
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkGR5TETAUjs = require('../chunk-GR5TETAU.js');var _chunkOEIQFP6Tjs = require('../chunk-OEIQFP6T.js');var K={};_chunkOEIQFP6Tjs.a.call(void 0, K,{activateCreate:()=>me,adminCardsList:()=>Oe,adminCardsRetrieve:()=>Re,adminCompanyPartialUpdate:()=>be,adminCompanyRetrieve:()=>we,adminCompanyUpdate:()=>ge,adminCurrenciesList:()=>Ce,adminCurrenciesPartialUpdate:()=>Se,adminCurrenciesRetrieve:()=>xe,adminCurrenciesUpdate:()=>Te,deactivateCreate:()=>Ae,rainWebhookCreate:()=>Ee,userApplicationsCreate:()=>Pe,userApplicationsList:()=>De,userApplicationsRetrieve:()=>qe,userCardsCreate:()=>ve,userCardsDataRetrieve:()=>Be,userCardsList:()=>je,userCardsPinPartialUpdate:()=>$e,userCardsPinRetrieve:()=>Le,userCardsPinUpdate:()=>Ke,userCardsRetrieve:()=>Ie,userPartialUpdate:()=>Ue,userRetrieve:()=>ke,userUpdate:()=>ze,webhookCreate:()=>Ne});var I={bodySerializer:e=>JSON.stringify(e,(r,t)=>typeof t=="bigint"?t.toString():t)};var ae={$body_:"body",$headers_:"headers",$path_:"path",$query_:"query"},Ve=Object.entries(ae);function Q({onRequest:e,onSseError:r,onSseEvent:t,responseTransformer:o,responseValidator:s,sseDefaultRetryDelay:d,sseMaxRetryAttempts:i,sseMaxRetryDelay:a,sseSleepFn:p,url:m,...u}){let n,O=_nullishCoalesce(p, () => ((g=>new Promise(c=>setTimeout(c,g)))));return{stream:async function*(){let g=_nullishCoalesce(d, () => (3e3)),c=0,R=_nullishCoalesce(u.signal, () => (new AbortController().signal));for(;!R.aborted;){c++;let k=u.headers instanceof Headers?u.headers:new Headers(u.headers);n!==void 0&&k.set("Last-Event-ID",n);try{let C={redirect:"follow",...u,body:u.serializedBody,headers:k,signal:R},x=new Request(m,C);e&&(x=await e(m,C));let f=await(_nullishCoalesce(u.fetch, () => (globalThis.fetch)))(x);if(!f.ok)throw new Error(`SSE failed: ${f.status} ${f.statusText}`);if(!f.body)throw new Error("No body in SSE response");let h=f.body.pipeThrough(new TextDecoderStream).getReader(),y="",N=()=>{try{h.cancel()}catch (e2){}};R.addEventListener("abort",N);try{for(;;){let{done:re,value:te}=await h.read();if(re)break;y+=te,y=y.replace(/\r\n?/g,`
|
|
2
|
+
`);let W=y.split(`
|
|
4
3
|
|
|
5
|
-
`);
|
|
6
|
-
`),P=[],H;for(let
|
|
7
|
-
`);try{x=JSON.parse(g),V=!0}catch (e3){x=g}}V&&(s&&await s(x),a&&(x=await a(x))),_optionalChain([t, 'optionalCall', _2 => _2({data:x,event:H,id:h,retry:l})]),P.length&&(yield x)}}}finally{b.removeEventListener("abort",N),m.releaseLock()}break}catch(C){if(_optionalChain([r, 'optionalCall', _3 => _3(C)]),i!==void 0&&O>=i)break;let w=Math.min(l*2**(O-1),_nullishCoalesce(o, () => (3e4)));await T(w)}}}()}};var ie=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},pe=e=>{switch(e){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},de=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},q=({allowReserved:e,explode:r,name:t,style:a,value:s})=>{if(!r){let o=(e?s:s.map(p=>encodeURIComponent(p))).join(pe(a));switch(a){case"label":return`.${o}`;case"matrix":return`;${t}=${o}`;case"simple":return o;default:return`${t}=${o}`}}let d=ie(a),i=s.map(o=>a==="label"||a==="simple"?e?o:encodeURIComponent(o):S({allowReserved:e,name:t,value:o})).join(d);return a==="label"||a==="matrix"?d+i:i},S=({allowReserved:e,name:r,value:t})=>{if(t==null)return"";if(typeof t=="object")throw new Error("Deeply-nested arrays/objects aren\u2019t supported. Provide your own `querySerializer()` to handle these.");return`${r}=${e?t:encodeURIComponent(t)}`},j=({allowReserved:e,explode:r,name:t,style:a,value:s,valueOnly:d})=>{if(s instanceof Date)return d?s.toISOString():`${t}=${s.toISOString()}`;if(a!=="deepObject"&&!r){let p=[];Object.entries(s).forEach(([n,h])=>{p=[...p,n,e?h:encodeURIComponent(h)]});let u=p.join(",");switch(a){case"form":return`${t}=${u}`;case"label":return`.${u}`;case"matrix":return`;${t}=${u}`;default:return u}}let i=de(a),o=Object.entries(s).map(([p,u])=>S({allowReserved:e,name:a==="deepObject"?`${t}[${p}]`:p,value:u})).join(i);return a==="label"||a==="matrix"?i+o:o};var ce=/\{[^{}]+\}/g,le=({path:e,url:r})=>{let t=r,a=r.match(ce);if(a)for(let s of a){let d=!1,i=s.substring(1,s.length-1),o="simple";i.endsWith("*")&&(d=!0,i=i.substring(0,i.length-1)),i.startsWith(".")?(i=i.substring(1),o="label"):i.startsWith(";")&&(i=i.substring(1),o="matrix");let p=e[i];if(p==null)continue;if(Array.isArray(p)){t=t.replace(s,q({explode:d,name:i,style:o,value:p}));continue}if(typeof p=="object"){t=t.replace(s,j({explode:d,name:i,style:o,value:p,valueOnly:!0}));continue}if(o==="matrix"){t=t.replace(s,`;${S({name:i,value:p})}`);continue}let u=encodeURIComponent(o==="label"?`.${p}`:p);t=t.replace(s,u)}return t},_=({baseUrl:e,path:r,query:t,querySerializer:a,url:s})=>{let d=s.startsWith("/")?s:`/${s}`,i=(_nullishCoalesce(e, () => ("")))+d;r&&(i=le({path:r,url:i}));let o=t?a(t):"";return o.startsWith("?")&&(o=o.substring(1)),o&&(i+=`?${o}`),i};function B(e){let r=e.body!==void 0;if(r&&e.bodySerializer)return"serializedBody"in e?e.serializedBody!==void 0&&e.serializedBody!==""?e.serializedBody:null:e.body!==""?e.body:null;if(r)return e.body}var G=async(e,r)=>{let t=typeof r=="function"?await r(e):r;if(t)return e.scheme==="bearer"?`Bearer ${t}`:e.scheme==="basic"?`Basic ${btoa(t)}`:t};var X=({parameters:e={},...r}={})=>a=>{let s=[];if(a&&typeof a=="object")for(let d in a){let i=a[d];if(i==null)continue;let o=e[d]||r;if(Array.isArray(i)){let p=q({allowReserved:o.allowReserved,explode:!0,name:d,style:"form",value:i,...o.array});p&&s.push(p)}else if(typeof i=="object"){let p=j({allowReserved:o.allowReserved,explode:!0,name:d,style:"deepObject",value:i,...o.object});p&&s.push(p)}else{let p=S({allowReserved:o.allowReserved,name:d,value:i});p&&s.push(p)}}return s.join("&")},Y=e=>{if(!e)return"stream";let r=_optionalChain([e, 'access', _4 => _4.split, 'call', _5 => _5(";"), 'access', _6 => _6[0], 'optionalAccess', _7 => _7.trim, 'call', _8 => _8()]);if(r){if(r.startsWith("application/json")||r.endsWith("+json"))return"json";if(r==="multipart/form-data")return"formData";if(["application/","audio/","image/","video/"].some(t=>r.startsWith(t)))return"blob";if(r.startsWith("text/"))return"text"}},ue=(e,r)=>r?!!(e.headers.has(r)||_optionalChain([e, 'access', _9 => _9.query, 'optionalAccess', _10 => _10[r]])||_optionalChain([e, 'access', _11 => _11.headers, 'access', _12 => _12.get, 'call', _13 => _13("Cookie"), 'optionalAccess', _14 => _14.includes, 'call', _15 => _15(`${r}=`)])):!1,Z=async({security:e,...r})=>{for(let t of e){if(ue(r,t.name))continue;let a=await G(t,r.auth);if(!a)continue;let s=_nullishCoalesce(t.name, () => ("Authorization"));switch(t.in){case"query":r.query||(r.query={}),r.query[s]=a;break;case"cookie":r.headers.append("Cookie",`${s}=${a}`);break;case"header":default:r.headers.set(s,a);break}}},L=e=>_({baseUrl:e.baseUrl,path:e.path,query:e.query,querySerializer:typeof e.querySerializer=="function"?e.querySerializer:X(e.querySerializer),url:e.url}),$=(e,r)=>{let t={...e,...r};return _optionalChain([t, 'access', _16 => _16.baseUrl, 'optionalAccess', _17 => _17.endsWith, 'call', _18 => _18("/")])&&(t.baseUrl=t.baseUrl.substring(0,t.baseUrl.length-1)),t.headers=v(e.headers,r.headers),t},fe=e=>{let r=[];return e.forEach((t,a)=>{r.push([a,t])}),r},v=(...e)=>{let r=new Headers;for(let t of e){if(!t)continue;let a=t instanceof Headers?fe(t):Object.entries(t);for(let[s,d]of a)if(d===null)r.delete(s);else if(Array.isArray(d))for(let i of d)r.append(s,i);else d!==void 0&&r.set(s,typeof d=="object"?JSON.stringify(d):d)}return r},k=class{constructor(){this.fns=[]}clear(){this.fns=[]}eject(r){let t=this.getInterceptorIndex(r);this.fns[t]&&(this.fns[t]=null)}exists(r){let t=this.getInterceptorIndex(r);return!!this.fns[t]}getInterceptorIndex(r){return typeof r=="number"?this.fns[r]?r:-1:this.fns.indexOf(r)}update(r,t){let a=this.getInterceptorIndex(r);return this.fns[a]?(this.fns[a]=t,r):!1}use(r){return this.fns.push(r),this.fns.length-1}},ee=()=>({error:new k,request:new k,response:new k}),ye=X({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),he={"Content-Type":"application/json"},U=(e={})=>({...I,headers:he,parseAs:"auto",querySerializer:ye,...e});var z=(e={})=>{let r=$(U(),e),t=()=>({...r}),a=u=>(r=$(r,u),t()),s=ee(),d=async u=>{let n={...r,...u,fetch:_nullishCoalesce(_nullishCoalesce(u.fetch, () => (r.fetch)), () => (globalThis.fetch)),headers:v(r.headers,u.headers),serializedBody:void 0};n.security&&await Z({...n,security:n.security}),n.requestValidator&&await n.requestValidator(n),n.body!==void 0&&n.bodySerializer&&(n.serializedBody=n.bodySerializer(n.body)),(n.body===void 0||n.serializedBody==="")&&n.headers.delete("Content-Type");let h=L(n);return{opts:n,url:h}},i=async u=>{let{opts:n,url:h}=await d(u),T={redirect:"follow",...n,body:B(n)},R=new Request(h,T);for(let y of s.request.fns)y&&(R=await y(R,n));let D=n.fetch,l;try{l=await D(R)}catch(y){let f=y;for(let m of s.error.fns)m&&(f=await m(y,void 0,R,n));if(f=f||{},n.throwOnError)throw f;return n.responseStyle==="data"?void 0:{error:f,request:R,response:void 0}}for(let y of s.response.fns)y&&(l=await y(l,R,n));let O={request:R,response:l};if(l.ok){let y=_nullishCoalesce((n.parseAs==="auto"?Y(l.headers.get("Content-Type")):n.parseAs), () => ("json"));if(l.status===204||l.headers.get("Content-Length")==="0"){let m;switch(y){case"arrayBuffer":case"blob":case"text":m=await l[y]();break;case"formData":m=new FormData;break;case"stream":m=l.body;break;case"json":default:m={};break}return n.responseStyle==="data"?m:{data:m,...O}}let f;switch(y){case"arrayBuffer":case"blob":case"formData":case"text":f=await l[y]();break;case"json":{let m=await l.text();f=m?JSON.parse(m):{};break}case"stream":return n.responseStyle==="data"?l.body:{data:l.body,...O}}return y==="json"&&(n.responseValidator&&await n.responseValidator(f),n.responseTransformer&&(f=await n.responseTransformer(f))),n.responseStyle==="data"?f:{data:f,...O}}let b=await l.text(),A;try{A=JSON.parse(b)}catch (e4){}let C=_nullishCoalesce(A, () => (b)),w=C;for(let y of s.error.fns)y&&(w=await y(C,l,R,n));if(w=w||{},n.throwOnError)throw w;return n.responseStyle==="data"?void 0:{error:w,...O}},o=u=>n=>i({...n,method:u}),p=u=>async n=>{let{opts:h,url:T}=await d(n);return Q({...h,body:h.body,headers:h.headers,method:u,onRequest:async(R,D)=>{let l=new Request(R,D);for(let O of s.request.fns)O&&(l=await O(l,h));return l},serializedBody:B(h),url:T})};return{buildUrl:L,connect:o("CONNECT"),delete:o("DELETE"),get:o("GET"),getConfig:t,head:o("HEAD"),interceptors:s,options:o("OPTIONS"),patch:o("PATCH"),post:o("POST"),put:o("PUT"),request:i,setConfig:a,sse:{connect:p("CONNECT"),delete:p("DELETE"),get:p("GET"),head:p("HEAD"),options:p("OPTIONS"),patch:p("PATCH"),post:p("POST"),put:p("PUT"),trace:p("TRACE")},trace:o("TRACE")}};var c=z(U({baseUrl:"https://rain.services.rehive.com/api/"}));var me=e=>(_nullishCoalesce(e.client, () => (c))).post({url:"/activate/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Oe=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _19 => _19.client]), () => (c))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/cards/",...e}),Re=e=>(_nullishCoalesce(e.client, () => (c))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/cards/{identifier}/",...e}),ge=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _20 => _20.client]), () => (c))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/company/",...e}),we=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _21 => _21.client]), () => (c))).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/company/",...e,headers:{"Content-Type":"application/json",..._optionalChain([e, 'optionalAccess', _22 => _22.headers])}}),be=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _23 => _23.client]), () => (c))).put({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/company/",...e,headers:{"Content-Type":"application/json",..._optionalChain([e, 'optionalAccess', _24 => _24.headers])}}),Ce=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _25 => _25.client]), () => (c))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/currencies/",...e}),xe=e=>(_nullishCoalesce(e.client, () => (c))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/currencies/{code}/",...e}),Se=e=>(_nullishCoalesce(e.client, () => (c))).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/currencies/{code}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Te=e=>(_nullishCoalesce(e.client, () => (c))).put({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/currencies/{code}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ae=e=>(_nullishCoalesce(e.client, () => (c))).post({url:"/deactivate/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ee=e=>(_nullishCoalesce(e.client, () => (c))).post({url:"/rain/webhook/{company_id}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),ke=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _26 => _26.client]), () => (c))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/user/",...e}),Ue=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _27 => _27.client]), () => (c))).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/user/",...e,headers:{"Content-Type":"application/json",..._optionalChain([e, 'optionalAccess', _28 => _28.headers])}}),ze=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _29 => _29.client]), () => (c))).put({security:[{name:"Authorization",type:"apiKey"}],url:"/user/",...e,headers:{"Content-Type":"application/json",..._optionalChain([e, 'optionalAccess', _30 => _30.headers])}}),De=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _31 => _31.client]), () => (c))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/user/applications/",...e}),Pe=e=>(_nullishCoalesce(e.client, () => (c))).post({security:[{name:"Authorization",type:"apiKey"}],url:"/user/applications/",...e,headers:{"Content-Type":"application/json",...e.headers}}),qe=e=>(_nullishCoalesce(e.client, () => (c))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/user/applications/{identifier}/",...e}),je=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _32 => _32.client]), () => (c))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/user/cards/",...e}),ve=e=>(_nullishCoalesce(e.client, () => (c))).post({security:[{name:"Authorization",type:"apiKey"}],url:"/user/cards/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ie=e=>(_nullishCoalesce(e.client, () => (c))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/user/cards/{identifier}/",...e}),Be=e=>(_nullishCoalesce(e.client, () => (c))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/user/cards/{identifier}/data/",...e}),Le=e=>(_nullishCoalesce(e.client, () => (c))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/user/cards/{identifier}/pin/",...e}),$e=e=>(_nullishCoalesce(e.client, () => (c))).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/user/cards/{identifier}/pin/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ke=e=>(_nullishCoalesce(e.client, () => (c))).put({security:[{name:"Authorization",type:"apiKey"}],url:"/user/cards/{identifier}/pin/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ne=e=>(_nullishCoalesce(e.client, () => (c))).post({url:"/webhook/",...e,headers:{"Content-Type":"application/json",...e.headers}});function We(e){let r=z(_chunkGR5TETAUjs.c.call(void 0, e,"https://rain.services.rehive.com/api/"));return _chunkGR5TETAUjs.a.call(void 0, K,r)}exports.createRainApi = We;
|
|
4
|
+
`);y=_nullishCoalesce(W.pop(), () => (""));for(let ne of W){let se=ne.split(`
|
|
5
|
+
`),P=[],H;for(let b of se)if(b.startsWith("data:"))P.push(b.replace(/^data:\s*/,""));else if(b.startsWith("event:"))H=b.replace(/^event:\s*/,"");else if(b.startsWith("id:"))n=b.replace(/^id:\s*/,"");else if(b.startsWith("retry:")){let F=Number.parseInt(b.replace(/^retry:\s*/,""),10);Number.isNaN(F)||(g=F)}let S,V=!1;if(P.length){let b=P.join(`
|
|
6
|
+
`);try{S=JSON.parse(b),V=!0}catch (e3){S=b}}V&&(s&&await s(S),o&&(S=await o(S))),_optionalChain([t, 'optionalCall', _2 => _2({data:S,event:H,id:n,retry:g})]),P.length&&(yield S)}}}finally{R.removeEventListener("abort",N),h.releaseLock()}break}catch(C){if(_optionalChain([r, 'optionalCall', _3 => _3(C)]),i!==void 0&&c>=i)break;let x=Math.min(g*2**(c-1),_nullishCoalesce(a, () => (3e4)));await O(x)}}}()}}var ie=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},pe=e=>{switch(e){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},de=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},q=({allowReserved:e,explode:r,name:t,style:o,value:s})=>{if(!r){let a=(e?s:s.map(p=>encodeURIComponent(p))).join(pe(o));switch(o){case"label":return`.${a}`;case"matrix":return`;${t}=${a}`;case"simple":return a;default:return`${t}=${a}`}}let d=ie(o),i=s.map(a=>o==="label"||o==="simple"?e?a:encodeURIComponent(a):E({allowReserved:e,name:t,value:a})).join(d);return o==="label"||o==="matrix"?d+i:i},E=({allowReserved:e,name:r,value:t})=>{if(t==null)return"";if(typeof t=="object")throw new Error("Deeply-nested arrays/objects aren\u2019t supported. Provide your own `querySerializer()` to handle these.");return`${r}=${e?t:encodeURIComponent(t)}`},j=({allowReserved:e,explode:r,name:t,style:o,value:s,valueOnly:d})=>{if(s instanceof Date)return d?s.toISOString():`${t}=${s.toISOString()}`;if(o!=="deepObject"&&!r){let p=[];Object.entries(s).forEach(([u,n])=>{p=[...p,u,e?n:encodeURIComponent(n)]});let m=p.join(",");switch(o){case"form":return`${t}=${m}`;case"label":return`.${m}`;case"matrix":return`;${t}=${m}`;default:return m}}let i=de(o),a=Object.entries(s).map(([p,m])=>E({allowReserved:e,name:o==="deepObject"?`${t}[${p}]`:p,value:m})).join(i);return o==="label"||o==="matrix"?i+a:a};var le=/\{[^{}]+\}/g,ce=({path:e,url:r})=>{let t=r,o=r.match(le);if(o)for(let s of o){let d=!1,i=s.substring(1,s.length-1),a="simple";i.endsWith("*")&&(d=!0,i=i.substring(0,i.length-1)),i.startsWith(".")?(i=i.substring(1),a="label"):i.startsWith(";")&&(i=i.substring(1),a="matrix");let p=e[i];if(p==null)continue;if(Array.isArray(p)){t=t.replace(s,q({explode:d,name:i,style:a,value:p}));continue}if(typeof p=="object"){t=t.replace(s,j({explode:d,name:i,style:a,value:p,valueOnly:!0}));continue}if(a==="matrix"){t=t.replace(s,`;${E({name:i,value:p})}`);continue}let m=encodeURIComponent(a==="label"?`.${p}`:p);t=t.replace(s,m)}return t},_=({baseUrl:e,path:r,query:t,querySerializer:o,url:s})=>{let d=s.startsWith("/")?s:`/${s}`,i=(_nullishCoalesce(e, () => ("")))+d;r&&(i=ce({path:r,url:i}));let a=t?o(t):"";return a.startsWith("?")&&(a=a.substring(1)),a&&(i+=`?${a}`),i};function B(e){let r=e.body!==void 0;if(r&&e.bodySerializer)return"serializedBody"in e?e.serializedBody!==void 0&&e.serializedBody!==""?e.serializedBody:null:e.body!==""?e.body:null;if(r)return e.body}var G=async(e,r)=>{let t=typeof r=="function"?await r(e):r;if(t)return e.scheme==="bearer"?`Bearer ${t}`:e.scheme==="basic"?`Basic ${btoa(t)}`:t};var X=({parameters:e={},...r}={})=>o=>{let s=[];if(o&&typeof o=="object")for(let d in o){let i=o[d];if(i==null)continue;let a=e[d]||r;if(Array.isArray(i)){let p=q({allowReserved:a.allowReserved,explode:!0,name:d,style:"form",value:i,...a.array});p&&s.push(p)}else if(typeof i=="object"){let p=j({allowReserved:a.allowReserved,explode:!0,name:d,style:"deepObject",value:i,...a.object});p&&s.push(p)}else{let p=E({allowReserved:a.allowReserved,name:d,value:i});p&&s.push(p)}}return s.join("&")},Y=e=>{if(!e)return"stream";let r=_optionalChain([e, 'access', _4 => _4.split, 'call', _5 => _5(";"), 'access', _6 => _6[0], 'optionalAccess', _7 => _7.trim, 'call', _8 => _8()]);if(r){if(r.startsWith("application/json")||r.endsWith("+json"))return"json";if(r==="multipart/form-data")return"formData";if(["application/","audio/","image/","video/"].some(t=>r.startsWith(t)))return"blob";if(r.startsWith("text/"))return"text"}},ue=(e,r)=>r?!!(e.headers.has(r)||_optionalChain([e, 'access', _9 => _9.query, 'optionalAccess', _10 => _10[r]])||_optionalChain([e, 'access', _11 => _11.headers, 'access', _12 => _12.get, 'call', _13 => _13("Cookie"), 'optionalAccess', _14 => _14.includes, 'call', _15 => _15(`${r}=`)])):!1,Z=async({security:e,...r})=>{for(let t of e){if(ue(r,t.name))continue;let o=await G(t,r.auth);if(!o)continue;let s=_nullishCoalesce(t.name, () => ("Authorization"));switch(t.in){case"query":r.query||(r.query={}),r.query[s]=o;break;case"cookie":r.headers.append("Cookie",`${s}=${o}`);break;case"header":default:r.headers.set(s,o);break}}},L=e=>_({baseUrl:e.baseUrl,path:e.path,query:e.query,querySerializer:typeof e.querySerializer=="function"?e.querySerializer:X(e.querySerializer),url:e.url}),$=(e,r)=>{let t={...e,...r};return _optionalChain([t, 'access', _16 => _16.baseUrl, 'optionalAccess', _17 => _17.endsWith, 'call', _18 => _18("/")])&&(t.baseUrl=t.baseUrl.substring(0,t.baseUrl.length-1)),t.headers=v(e.headers,r.headers),t},fe=e=>{let r=[];return e.forEach((t,o)=>{r.push([o,t])}),r},v=(...e)=>{let r=new Headers;for(let t of e){if(!t)continue;let o=t instanceof Headers?fe(t):Object.entries(t);for(let[s,d]of o)if(d===null)r.delete(s);else if(Array.isArray(d))for(let i of d)r.append(s,i);else d!==void 0&&r.set(s,typeof d=="object"?JSON.stringify(d):d)}return r},U=class{constructor(){this.fns=[]}clear(){this.fns=[]}eject(r){let t=this.getInterceptorIndex(r);this.fns[t]&&(this.fns[t]=null)}exists(r){let t=this.getInterceptorIndex(r);return!!this.fns[t]}getInterceptorIndex(r){return typeof r=="number"?this.fns[r]?r:-1:this.fns.indexOf(r)}update(r,t){let o=this.getInterceptorIndex(r);return this.fns[o]?(this.fns[o]=t,r):!1}use(r){return this.fns.push(r),this.fns.length-1}},ee=()=>({error:new U,request:new U,response:new U}),ye=X({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),he={"Content-Type":"application/json"},z=(e={})=>({...I,headers:he,parseAs:"auto",querySerializer:ye,...e});var D=(e={})=>{let r=$(z(),e),t=()=>({...r}),o=u=>(r=$(r,u),t()),s=ee(),d=async u=>{let n={...r,...u,fetch:_nullishCoalesce(_nullishCoalesce(u.fetch, () => (r.fetch)), () => (globalThis.fetch)),headers:v(r.headers,u.headers),serializedBody:void 0};n.security&&await Z({...n,security:n.security}),n.requestValidator&&await n.requestValidator(n),n.body!==void 0&&n.bodySerializer&&(n.serializedBody=n.bodySerializer(n.body)),(n.body===void 0||n.serializedBody==="")&&n.headers.delete("Content-Type");let O=n,T=L(O);return{opts:O,url:T}},i=async u=>{let{opts:n,url:O}=await d(u),T={redirect:"follow",...n,body:B(n)},w=new Request(O,T);for(let f of s.request.fns)f&&(w=await f(w,n));let g=n.fetch,c;try{c=await g(w)}catch(f){let h=f;for(let y of s.error.fns)y&&(h=await y(f,void 0,w,n));if(h=h||{},n.throwOnError)throw h;return n.responseStyle==="data"?void 0:{error:h,request:w,response:void 0}}for(let f of s.response.fns)f&&(c=await f(c,w,n));let R={request:w,response:c};if(c.ok){let f=_nullishCoalesce((n.parseAs==="auto"?Y(c.headers.get("Content-Type")):n.parseAs), () => ("json"));if(c.status===204||c.headers.get("Content-Length")==="0"){let y;switch(f){case"arrayBuffer":case"blob":case"text":y=await c[f]();break;case"formData":y=new FormData;break;case"stream":y=c.body;break;case"json":default:y={};break}return n.responseStyle==="data"?y:{data:y,...R}}let h;switch(f){case"arrayBuffer":case"blob":case"formData":case"text":h=await c[f]();break;case"json":{let y=await c.text();h=y?JSON.parse(y):{};break}case"stream":return n.responseStyle==="data"?c.body:{data:c.body,...R}}return f==="json"&&(n.responseValidator&&await n.responseValidator(h),n.responseTransformer&&(h=await n.responseTransformer(h))),n.responseStyle==="data"?h:{data:h,...R}}let k=await c.text(),C;try{C=JSON.parse(k)}catch (e4){}let x=_nullishCoalesce(C, () => (k)),A=x;for(let f of s.error.fns)f&&(A=await f(x,c,w,n));if(A=A||{},n.throwOnError)throw A;return n.responseStyle==="data"?void 0:{error:A,...R}},a=u=>n=>i({...n,method:u}),p=u=>async n=>{let{opts:O,url:T}=await d(n);return Q({...O,body:O.body,headers:O.headers,method:u,onRequest:async(w,g)=>{let c=new Request(w,g);for(let R of s.request.fns)R&&(c=await R(c,O));return c},serializedBody:B(O),url:T})};return{buildUrl:u=>L({...r,...u}),connect:a("CONNECT"),delete:a("DELETE"),get:a("GET"),getConfig:t,head:a("HEAD"),interceptors:s,options:a("OPTIONS"),patch:a("PATCH"),post:a("POST"),put:a("PUT"),request:i,setConfig:o,sse:{connect:p("CONNECT"),delete:p("DELETE"),get:p("GET"),head:p("HEAD"),options:p("OPTIONS"),patch:p("PATCH"),post:p("POST"),put:p("PUT"),trace:p("TRACE")},trace:a("TRACE")}};var l=D(z({baseUrl:"https://rain.services.rehive.com/api/"}));var me=e=>(_nullishCoalesce(e.client, () => (l))).post({url:"/activate/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Oe=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _19 => _19.client]), () => (l))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/cards/",...e}),Re=e=>(_nullishCoalesce(e.client, () => (l))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/cards/{identifier}/",...e}),we=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _20 => _20.client]), () => (l))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/company/",...e}),be=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _21 => _21.client]), () => (l))).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/company/",...e,headers:{"Content-Type":"application/json",..._optionalChain([e, 'optionalAccess', _22 => _22.headers])}}),ge=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _23 => _23.client]), () => (l))).put({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/company/",...e,headers:{"Content-Type":"application/json",..._optionalChain([e, 'optionalAccess', _24 => _24.headers])}}),Ce=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _25 => _25.client]), () => (l))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/currencies/",...e}),xe=e=>(_nullishCoalesce(e.client, () => (l))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/currencies/{code}/",...e}),Se=e=>(_nullishCoalesce(e.client, () => (l))).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/currencies/{code}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Te=e=>(_nullishCoalesce(e.client, () => (l))).put({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/currencies/{code}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ae=e=>(_nullishCoalesce(e.client, () => (l))).post({url:"/deactivate/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ee=e=>(_nullishCoalesce(e.client, () => (l))).post({url:"/rain/webhook/{company_id}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),ke=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _26 => _26.client]), () => (l))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/user/",...e}),Ue=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _27 => _27.client]), () => (l))).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/user/",...e,headers:{"Content-Type":"application/json",..._optionalChain([e, 'optionalAccess', _28 => _28.headers])}}),ze=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _29 => _29.client]), () => (l))).put({security:[{name:"Authorization",type:"apiKey"}],url:"/user/",...e,headers:{"Content-Type":"application/json",..._optionalChain([e, 'optionalAccess', _30 => _30.headers])}}),De=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _31 => _31.client]), () => (l))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/user/applications/",...e}),Pe=e=>(_nullishCoalesce(e.client, () => (l))).post({security:[{name:"Authorization",type:"apiKey"}],url:"/user/applications/",...e,headers:{"Content-Type":"application/json",...e.headers}}),qe=e=>(_nullishCoalesce(e.client, () => (l))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/user/applications/{identifier}/",...e}),je=e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _32 => _32.client]), () => (l))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/user/cards/",...e}),ve=e=>(_nullishCoalesce(e.client, () => (l))).post({security:[{name:"Authorization",type:"apiKey"}],url:"/user/cards/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ie=e=>(_nullishCoalesce(e.client, () => (l))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/user/cards/{identifier}/",...e}),Be=e=>(_nullishCoalesce(e.client, () => (l))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/user/cards/{identifier}/data/",...e}),Le=e=>(_nullishCoalesce(e.client, () => (l))).get({security:[{name:"Authorization",type:"apiKey"}],url:"/user/cards/{identifier}/pin/",...e}),$e=e=>(_nullishCoalesce(e.client, () => (l))).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/user/cards/{identifier}/pin/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ke=e=>(_nullishCoalesce(e.client, () => (l))).put({security:[{name:"Authorization",type:"apiKey"}],url:"/user/cards/{identifier}/pin/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ne=e=>(_nullishCoalesce(e.client, () => (l))).post({url:"/webhook/",...e,headers:{"Content-Type":"application/json",...e.headers}});function We(e){let r=D(_chunkGR5TETAUjs.c.call(void 0, e,"https://rain.services.rehive.com/api/"));return _chunkGR5TETAUjs.a.call(void 0, K,r)}exports.createRainApi = We;
|
package/dist/extensions/rain.mjs
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import{a as J,c as M}from"../chunk-S5UXBHRU.mjs";import{a as
|
|
2
|
-
`).
|
|
3
|
-
`);let W=E.split(`
|
|
1
|
+
import{a as J,c as M}from"../chunk-S5UXBHRU.mjs";import{a as oe}from"../chunk-S4QKN5WW.mjs";var K={};oe(K,{activateCreate:()=>me,adminCardsList:()=>Oe,adminCardsRetrieve:()=>Re,adminCompanyPartialUpdate:()=>be,adminCompanyRetrieve:()=>we,adminCompanyUpdate:()=>ge,adminCurrenciesList:()=>Ce,adminCurrenciesPartialUpdate:()=>Se,adminCurrenciesRetrieve:()=>xe,adminCurrenciesUpdate:()=>Te,deactivateCreate:()=>Ae,rainWebhookCreate:()=>Ee,userApplicationsCreate:()=>Pe,userApplicationsList:()=>De,userApplicationsRetrieve:()=>qe,userCardsCreate:()=>ve,userCardsDataRetrieve:()=>Be,userCardsList:()=>je,userCardsPinPartialUpdate:()=>$e,userCardsPinRetrieve:()=>Le,userCardsPinUpdate:()=>Ke,userCardsRetrieve:()=>Ie,userPartialUpdate:()=>Ue,userRetrieve:()=>ke,userUpdate:()=>ze,webhookCreate:()=>Ne});var I={bodySerializer:e=>JSON.stringify(e,(r,t)=>typeof t=="bigint"?t.toString():t)};var ae={$body_:"body",$headers_:"headers",$path_:"path",$query_:"query"},Ve=Object.entries(ae);function Q({onRequest:e,onSseError:r,onSseEvent:t,responseTransformer:o,responseValidator:s,sseDefaultRetryDelay:d,sseMaxRetryAttempts:i,sseMaxRetryDelay:a,sseSleepFn:p,url:m,...u}){let n,O=p??(g=>new Promise(c=>setTimeout(c,g)));return{stream:async function*(){let g=d??3e3,c=0,R=u.signal??new AbortController().signal;for(;!R.aborted;){c++;let k=u.headers instanceof Headers?u.headers:new Headers(u.headers);n!==void 0&&k.set("Last-Event-ID",n);try{let C={redirect:"follow",...u,body:u.serializedBody,headers:k,signal:R},x=new Request(m,C);e&&(x=await e(m,C));let f=await(u.fetch??globalThis.fetch)(x);if(!f.ok)throw new Error(`SSE failed: ${f.status} ${f.statusText}`);if(!f.body)throw new Error("No body in SSE response");let h=f.body.pipeThrough(new TextDecoderStream).getReader(),y="",N=()=>{try{h.cancel()}catch{}};R.addEventListener("abort",N);try{for(;;){let{done:re,value:te}=await h.read();if(re)break;y+=te,y=y.replace(/\r\n?/g,`
|
|
2
|
+
`);let W=y.split(`
|
|
4
3
|
|
|
5
|
-
`);
|
|
6
|
-
`),P=[],H;for(let
|
|
7
|
-
`);try{x=JSON.parse(g),V=!0}catch{x=g}}V&&(s&&await s(x),a&&(x=await a(x))),t?.({data:x,event:H,id:h,retry:l}),P.length&&(yield x)}}}finally{b.removeEventListener("abort",N),m.releaseLock()}break}catch(C){if(r?.(C),i!==void 0&&O>=i)break;let w=Math.min(l*2**(O-1),o??3e4);await T(w)}}}()}};var ie=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},pe=e=>{switch(e){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},de=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},q=({allowReserved:e,explode:r,name:t,style:a,value:s})=>{if(!r){let o=(e?s:s.map(p=>encodeURIComponent(p))).join(pe(a));switch(a){case"label":return`.${o}`;case"matrix":return`;${t}=${o}`;case"simple":return o;default:return`${t}=${o}`}}let d=ie(a),i=s.map(o=>a==="label"||a==="simple"?e?o:encodeURIComponent(o):S({allowReserved:e,name:t,value:o})).join(d);return a==="label"||a==="matrix"?d+i:i},S=({allowReserved:e,name:r,value:t})=>{if(t==null)return"";if(typeof t=="object")throw new Error("Deeply-nested arrays/objects aren\u2019t supported. Provide your own `querySerializer()` to handle these.");return`${r}=${e?t:encodeURIComponent(t)}`},j=({allowReserved:e,explode:r,name:t,style:a,value:s,valueOnly:d})=>{if(s instanceof Date)return d?s.toISOString():`${t}=${s.toISOString()}`;if(a!=="deepObject"&&!r){let p=[];Object.entries(s).forEach(([n,h])=>{p=[...p,n,e?h:encodeURIComponent(h)]});let u=p.join(",");switch(a){case"form":return`${t}=${u}`;case"label":return`.${u}`;case"matrix":return`;${t}=${u}`;default:return u}}let i=de(a),o=Object.entries(s).map(([p,u])=>S({allowReserved:e,name:a==="deepObject"?`${t}[${p}]`:p,value:u})).join(i);return a==="label"||a==="matrix"?i+o:o};var ce=/\{[^{}]+\}/g,le=({path:e,url:r})=>{let t=r,a=r.match(ce);if(a)for(let s of a){let d=!1,i=s.substring(1,s.length-1),o="simple";i.endsWith("*")&&(d=!0,i=i.substring(0,i.length-1)),i.startsWith(".")?(i=i.substring(1),o="label"):i.startsWith(";")&&(i=i.substring(1),o="matrix");let p=e[i];if(p==null)continue;if(Array.isArray(p)){t=t.replace(s,q({explode:d,name:i,style:o,value:p}));continue}if(typeof p=="object"){t=t.replace(s,j({explode:d,name:i,style:o,value:p,valueOnly:!0}));continue}if(o==="matrix"){t=t.replace(s,`;${S({name:i,value:p})}`);continue}let u=encodeURIComponent(o==="label"?`.${p}`:p);t=t.replace(s,u)}return t},_=({baseUrl:e,path:r,query:t,querySerializer:a,url:s})=>{let d=s.startsWith("/")?s:`/${s}`,i=(e??"")+d;r&&(i=le({path:r,url:i}));let o=t?a(t):"";return o.startsWith("?")&&(o=o.substring(1)),o&&(i+=`?${o}`),i};function B(e){let r=e.body!==void 0;if(r&&e.bodySerializer)return"serializedBody"in e?e.serializedBody!==void 0&&e.serializedBody!==""?e.serializedBody:null:e.body!==""?e.body:null;if(r)return e.body}var G=async(e,r)=>{let t=typeof r=="function"?await r(e):r;if(t)return e.scheme==="bearer"?`Bearer ${t}`:e.scheme==="basic"?`Basic ${btoa(t)}`:t};var X=({parameters:e={},...r}={})=>a=>{let s=[];if(a&&typeof a=="object")for(let d in a){let i=a[d];if(i==null)continue;let o=e[d]||r;if(Array.isArray(i)){let p=q({allowReserved:o.allowReserved,explode:!0,name:d,style:"form",value:i,...o.array});p&&s.push(p)}else if(typeof i=="object"){let p=j({allowReserved:o.allowReserved,explode:!0,name:d,style:"deepObject",value:i,...o.object});p&&s.push(p)}else{let p=S({allowReserved:o.allowReserved,name:d,value:i});p&&s.push(p)}}return s.join("&")},Y=e=>{if(!e)return"stream";let r=e.split(";")[0]?.trim();if(r){if(r.startsWith("application/json")||r.endsWith("+json"))return"json";if(r==="multipart/form-data")return"formData";if(["application/","audio/","image/","video/"].some(t=>r.startsWith(t)))return"blob";if(r.startsWith("text/"))return"text"}},ue=(e,r)=>r?!!(e.headers.has(r)||e.query?.[r]||e.headers.get("Cookie")?.includes(`${r}=`)):!1,Z=async({security:e,...r})=>{for(let t of e){if(ue(r,t.name))continue;let a=await G(t,r.auth);if(!a)continue;let s=t.name??"Authorization";switch(t.in){case"query":r.query||(r.query={}),r.query[s]=a;break;case"cookie":r.headers.append("Cookie",`${s}=${a}`);break;case"header":default:r.headers.set(s,a);break}}},L=e=>_({baseUrl:e.baseUrl,path:e.path,query:e.query,querySerializer:typeof e.querySerializer=="function"?e.querySerializer:X(e.querySerializer),url:e.url}),$=(e,r)=>{let t={...e,...r};return t.baseUrl?.endsWith("/")&&(t.baseUrl=t.baseUrl.substring(0,t.baseUrl.length-1)),t.headers=v(e.headers,r.headers),t},fe=e=>{let r=[];return e.forEach((t,a)=>{r.push([a,t])}),r},v=(...e)=>{let r=new Headers;for(let t of e){if(!t)continue;let a=t instanceof Headers?fe(t):Object.entries(t);for(let[s,d]of a)if(d===null)r.delete(s);else if(Array.isArray(d))for(let i of d)r.append(s,i);else d!==void 0&&r.set(s,typeof d=="object"?JSON.stringify(d):d)}return r},k=class{constructor(){this.fns=[]}clear(){this.fns=[]}eject(r){let t=this.getInterceptorIndex(r);this.fns[t]&&(this.fns[t]=null)}exists(r){let t=this.getInterceptorIndex(r);return!!this.fns[t]}getInterceptorIndex(r){return typeof r=="number"?this.fns[r]?r:-1:this.fns.indexOf(r)}update(r,t){let a=this.getInterceptorIndex(r);return this.fns[a]?(this.fns[a]=t,r):!1}use(r){return this.fns.push(r),this.fns.length-1}},ee=()=>({error:new k,request:new k,response:new k}),ye=X({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),he={"Content-Type":"application/json"},U=(e={})=>({...I,headers:he,parseAs:"auto",querySerializer:ye,...e});var z=(e={})=>{let r=$(U(),e),t=()=>({...r}),a=u=>(r=$(r,u),t()),s=ee(),d=async u=>{let n={...r,...u,fetch:u.fetch??r.fetch??globalThis.fetch,headers:v(r.headers,u.headers),serializedBody:void 0};n.security&&await Z({...n,security:n.security}),n.requestValidator&&await n.requestValidator(n),n.body!==void 0&&n.bodySerializer&&(n.serializedBody=n.bodySerializer(n.body)),(n.body===void 0||n.serializedBody==="")&&n.headers.delete("Content-Type");let h=L(n);return{opts:n,url:h}},i=async u=>{let{opts:n,url:h}=await d(u),T={redirect:"follow",...n,body:B(n)},R=new Request(h,T);for(let y of s.request.fns)y&&(R=await y(R,n));let D=n.fetch,l;try{l=await D(R)}catch(y){let f=y;for(let m of s.error.fns)m&&(f=await m(y,void 0,R,n));if(f=f||{},n.throwOnError)throw f;return n.responseStyle==="data"?void 0:{error:f,request:R,response:void 0}}for(let y of s.response.fns)y&&(l=await y(l,R,n));let O={request:R,response:l};if(l.ok){let y=(n.parseAs==="auto"?Y(l.headers.get("Content-Type")):n.parseAs)??"json";if(l.status===204||l.headers.get("Content-Length")==="0"){let m;switch(y){case"arrayBuffer":case"blob":case"text":m=await l[y]();break;case"formData":m=new FormData;break;case"stream":m=l.body;break;case"json":default:m={};break}return n.responseStyle==="data"?m:{data:m,...O}}let f;switch(y){case"arrayBuffer":case"blob":case"formData":case"text":f=await l[y]();break;case"json":{let m=await l.text();f=m?JSON.parse(m):{};break}case"stream":return n.responseStyle==="data"?l.body:{data:l.body,...O}}return y==="json"&&(n.responseValidator&&await n.responseValidator(f),n.responseTransformer&&(f=await n.responseTransformer(f))),n.responseStyle==="data"?f:{data:f,...O}}let b=await l.text(),A;try{A=JSON.parse(b)}catch{}let C=A??b,w=C;for(let y of s.error.fns)y&&(w=await y(C,l,R,n));if(w=w||{},n.throwOnError)throw w;return n.responseStyle==="data"?void 0:{error:w,...O}},o=u=>n=>i({...n,method:u}),p=u=>async n=>{let{opts:h,url:T}=await d(n);return Q({...h,body:h.body,headers:h.headers,method:u,onRequest:async(R,D)=>{let l=new Request(R,D);for(let O of s.request.fns)O&&(l=await O(l,h));return l},serializedBody:B(h),url:T})};return{buildUrl:L,connect:o("CONNECT"),delete:o("DELETE"),get:o("GET"),getConfig:t,head:o("HEAD"),interceptors:s,options:o("OPTIONS"),patch:o("PATCH"),post:o("POST"),put:o("PUT"),request:i,setConfig:a,sse:{connect:p("CONNECT"),delete:p("DELETE"),get:p("GET"),head:p("HEAD"),options:p("OPTIONS"),patch:p("PATCH"),post:p("POST"),put:p("PUT"),trace:p("TRACE")},trace:o("TRACE")}};var c=z(U({baseUrl:"https://rain.services.rehive.com/api/"}));var me=e=>(e.client??c).post({url:"/activate/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Oe=e=>(e?.client??c).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/cards/",...e}),Re=e=>(e.client??c).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/cards/{identifier}/",...e}),ge=e=>(e?.client??c).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/company/",...e}),we=e=>(e?.client??c).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/company/",...e,headers:{"Content-Type":"application/json",...e?.headers}}),be=e=>(e?.client??c).put({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/company/",...e,headers:{"Content-Type":"application/json",...e?.headers}}),Ce=e=>(e?.client??c).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/currencies/",...e}),xe=e=>(e.client??c).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/currencies/{code}/",...e}),Se=e=>(e.client??c).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/currencies/{code}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Te=e=>(e.client??c).put({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/currencies/{code}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ae=e=>(e.client??c).post({url:"/deactivate/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ee=e=>(e.client??c).post({url:"/rain/webhook/{company_id}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),ke=e=>(e?.client??c).get({security:[{name:"Authorization",type:"apiKey"}],url:"/user/",...e}),Ue=e=>(e?.client??c).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/user/",...e,headers:{"Content-Type":"application/json",...e?.headers}}),ze=e=>(e?.client??c).put({security:[{name:"Authorization",type:"apiKey"}],url:"/user/",...e,headers:{"Content-Type":"application/json",...e?.headers}}),De=e=>(e?.client??c).get({security:[{name:"Authorization",type:"apiKey"}],url:"/user/applications/",...e}),Pe=e=>(e.client??c).post({security:[{name:"Authorization",type:"apiKey"}],url:"/user/applications/",...e,headers:{"Content-Type":"application/json",...e.headers}}),qe=e=>(e.client??c).get({security:[{name:"Authorization",type:"apiKey"}],url:"/user/applications/{identifier}/",...e}),je=e=>(e?.client??c).get({security:[{name:"Authorization",type:"apiKey"}],url:"/user/cards/",...e}),ve=e=>(e.client??c).post({security:[{name:"Authorization",type:"apiKey"}],url:"/user/cards/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ie=e=>(e.client??c).get({security:[{name:"Authorization",type:"apiKey"}],url:"/user/cards/{identifier}/",...e}),Be=e=>(e.client??c).get({security:[{name:"Authorization",type:"apiKey"}],url:"/user/cards/{identifier}/data/",...e}),Le=e=>(e.client??c).get({security:[{name:"Authorization",type:"apiKey"}],url:"/user/cards/{identifier}/pin/",...e}),$e=e=>(e.client??c).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/user/cards/{identifier}/pin/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ke=e=>(e.client??c).put({security:[{name:"Authorization",type:"apiKey"}],url:"/user/cards/{identifier}/pin/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ne=e=>(e.client??c).post({url:"/webhook/",...e,headers:{"Content-Type":"application/json",...e.headers}});function We(e){let r=z(M(e,"https://rain.services.rehive.com/api/"));return J(K,r)}export{We as createRainApi};
|
|
4
|
+
`);y=W.pop()??"";for(let ne of W){let se=ne.split(`
|
|
5
|
+
`),P=[],H;for(let b of se)if(b.startsWith("data:"))P.push(b.replace(/^data:\s*/,""));else if(b.startsWith("event:"))H=b.replace(/^event:\s*/,"");else if(b.startsWith("id:"))n=b.replace(/^id:\s*/,"");else if(b.startsWith("retry:")){let F=Number.parseInt(b.replace(/^retry:\s*/,""),10);Number.isNaN(F)||(g=F)}let S,V=!1;if(P.length){let b=P.join(`
|
|
6
|
+
`);try{S=JSON.parse(b),V=!0}catch{S=b}}V&&(s&&await s(S),o&&(S=await o(S))),t?.({data:S,event:H,id:n,retry:g}),P.length&&(yield S)}}}finally{R.removeEventListener("abort",N),h.releaseLock()}break}catch(C){if(r?.(C),i!==void 0&&c>=i)break;let x=Math.min(g*2**(c-1),a??3e4);await O(x)}}}()}}var ie=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},pe=e=>{switch(e){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},de=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},q=({allowReserved:e,explode:r,name:t,style:o,value:s})=>{if(!r){let a=(e?s:s.map(p=>encodeURIComponent(p))).join(pe(o));switch(o){case"label":return`.${a}`;case"matrix":return`;${t}=${a}`;case"simple":return a;default:return`${t}=${a}`}}let d=ie(o),i=s.map(a=>o==="label"||o==="simple"?e?a:encodeURIComponent(a):E({allowReserved:e,name:t,value:a})).join(d);return o==="label"||o==="matrix"?d+i:i},E=({allowReserved:e,name:r,value:t})=>{if(t==null)return"";if(typeof t=="object")throw new Error("Deeply-nested arrays/objects aren\u2019t supported. Provide your own `querySerializer()` to handle these.");return`${r}=${e?t:encodeURIComponent(t)}`},j=({allowReserved:e,explode:r,name:t,style:o,value:s,valueOnly:d})=>{if(s instanceof Date)return d?s.toISOString():`${t}=${s.toISOString()}`;if(o!=="deepObject"&&!r){let p=[];Object.entries(s).forEach(([u,n])=>{p=[...p,u,e?n:encodeURIComponent(n)]});let m=p.join(",");switch(o){case"form":return`${t}=${m}`;case"label":return`.${m}`;case"matrix":return`;${t}=${m}`;default:return m}}let i=de(o),a=Object.entries(s).map(([p,m])=>E({allowReserved:e,name:o==="deepObject"?`${t}[${p}]`:p,value:m})).join(i);return o==="label"||o==="matrix"?i+a:a};var le=/\{[^{}]+\}/g,ce=({path:e,url:r})=>{let t=r,o=r.match(le);if(o)for(let s of o){let d=!1,i=s.substring(1,s.length-1),a="simple";i.endsWith("*")&&(d=!0,i=i.substring(0,i.length-1)),i.startsWith(".")?(i=i.substring(1),a="label"):i.startsWith(";")&&(i=i.substring(1),a="matrix");let p=e[i];if(p==null)continue;if(Array.isArray(p)){t=t.replace(s,q({explode:d,name:i,style:a,value:p}));continue}if(typeof p=="object"){t=t.replace(s,j({explode:d,name:i,style:a,value:p,valueOnly:!0}));continue}if(a==="matrix"){t=t.replace(s,`;${E({name:i,value:p})}`);continue}let m=encodeURIComponent(a==="label"?`.${p}`:p);t=t.replace(s,m)}return t},_=({baseUrl:e,path:r,query:t,querySerializer:o,url:s})=>{let d=s.startsWith("/")?s:`/${s}`,i=(e??"")+d;r&&(i=ce({path:r,url:i}));let a=t?o(t):"";return a.startsWith("?")&&(a=a.substring(1)),a&&(i+=`?${a}`),i};function B(e){let r=e.body!==void 0;if(r&&e.bodySerializer)return"serializedBody"in e?e.serializedBody!==void 0&&e.serializedBody!==""?e.serializedBody:null:e.body!==""?e.body:null;if(r)return e.body}var G=async(e,r)=>{let t=typeof r=="function"?await r(e):r;if(t)return e.scheme==="bearer"?`Bearer ${t}`:e.scheme==="basic"?`Basic ${btoa(t)}`:t};var X=({parameters:e={},...r}={})=>o=>{let s=[];if(o&&typeof o=="object")for(let d in o){let i=o[d];if(i==null)continue;let a=e[d]||r;if(Array.isArray(i)){let p=q({allowReserved:a.allowReserved,explode:!0,name:d,style:"form",value:i,...a.array});p&&s.push(p)}else if(typeof i=="object"){let p=j({allowReserved:a.allowReserved,explode:!0,name:d,style:"deepObject",value:i,...a.object});p&&s.push(p)}else{let p=E({allowReserved:a.allowReserved,name:d,value:i});p&&s.push(p)}}return s.join("&")},Y=e=>{if(!e)return"stream";let r=e.split(";")[0]?.trim();if(r){if(r.startsWith("application/json")||r.endsWith("+json"))return"json";if(r==="multipart/form-data")return"formData";if(["application/","audio/","image/","video/"].some(t=>r.startsWith(t)))return"blob";if(r.startsWith("text/"))return"text"}},ue=(e,r)=>r?!!(e.headers.has(r)||e.query?.[r]||e.headers.get("Cookie")?.includes(`${r}=`)):!1,Z=async({security:e,...r})=>{for(let t of e){if(ue(r,t.name))continue;let o=await G(t,r.auth);if(!o)continue;let s=t.name??"Authorization";switch(t.in){case"query":r.query||(r.query={}),r.query[s]=o;break;case"cookie":r.headers.append("Cookie",`${s}=${o}`);break;case"header":default:r.headers.set(s,o);break}}},L=e=>_({baseUrl:e.baseUrl,path:e.path,query:e.query,querySerializer:typeof e.querySerializer=="function"?e.querySerializer:X(e.querySerializer),url:e.url}),$=(e,r)=>{let t={...e,...r};return t.baseUrl?.endsWith("/")&&(t.baseUrl=t.baseUrl.substring(0,t.baseUrl.length-1)),t.headers=v(e.headers,r.headers),t},fe=e=>{let r=[];return e.forEach((t,o)=>{r.push([o,t])}),r},v=(...e)=>{let r=new Headers;for(let t of e){if(!t)continue;let o=t instanceof Headers?fe(t):Object.entries(t);for(let[s,d]of o)if(d===null)r.delete(s);else if(Array.isArray(d))for(let i of d)r.append(s,i);else d!==void 0&&r.set(s,typeof d=="object"?JSON.stringify(d):d)}return r},U=class{constructor(){this.fns=[]}clear(){this.fns=[]}eject(r){let t=this.getInterceptorIndex(r);this.fns[t]&&(this.fns[t]=null)}exists(r){let t=this.getInterceptorIndex(r);return!!this.fns[t]}getInterceptorIndex(r){return typeof r=="number"?this.fns[r]?r:-1:this.fns.indexOf(r)}update(r,t){let o=this.getInterceptorIndex(r);return this.fns[o]?(this.fns[o]=t,r):!1}use(r){return this.fns.push(r),this.fns.length-1}},ee=()=>({error:new U,request:new U,response:new U}),ye=X({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),he={"Content-Type":"application/json"},z=(e={})=>({...I,headers:he,parseAs:"auto",querySerializer:ye,...e});var D=(e={})=>{let r=$(z(),e),t=()=>({...r}),o=u=>(r=$(r,u),t()),s=ee(),d=async u=>{let n={...r,...u,fetch:u.fetch??r.fetch??globalThis.fetch,headers:v(r.headers,u.headers),serializedBody:void 0};n.security&&await Z({...n,security:n.security}),n.requestValidator&&await n.requestValidator(n),n.body!==void 0&&n.bodySerializer&&(n.serializedBody=n.bodySerializer(n.body)),(n.body===void 0||n.serializedBody==="")&&n.headers.delete("Content-Type");let O=n,T=L(O);return{opts:O,url:T}},i=async u=>{let{opts:n,url:O}=await d(u),T={redirect:"follow",...n,body:B(n)},w=new Request(O,T);for(let f of s.request.fns)f&&(w=await f(w,n));let g=n.fetch,c;try{c=await g(w)}catch(f){let h=f;for(let y of s.error.fns)y&&(h=await y(f,void 0,w,n));if(h=h||{},n.throwOnError)throw h;return n.responseStyle==="data"?void 0:{error:h,request:w,response:void 0}}for(let f of s.response.fns)f&&(c=await f(c,w,n));let R={request:w,response:c};if(c.ok){let f=(n.parseAs==="auto"?Y(c.headers.get("Content-Type")):n.parseAs)??"json";if(c.status===204||c.headers.get("Content-Length")==="0"){let y;switch(f){case"arrayBuffer":case"blob":case"text":y=await c[f]();break;case"formData":y=new FormData;break;case"stream":y=c.body;break;case"json":default:y={};break}return n.responseStyle==="data"?y:{data:y,...R}}let h;switch(f){case"arrayBuffer":case"blob":case"formData":case"text":h=await c[f]();break;case"json":{let y=await c.text();h=y?JSON.parse(y):{};break}case"stream":return n.responseStyle==="data"?c.body:{data:c.body,...R}}return f==="json"&&(n.responseValidator&&await n.responseValidator(h),n.responseTransformer&&(h=await n.responseTransformer(h))),n.responseStyle==="data"?h:{data:h,...R}}let k=await c.text(),C;try{C=JSON.parse(k)}catch{}let x=C??k,A=x;for(let f of s.error.fns)f&&(A=await f(x,c,w,n));if(A=A||{},n.throwOnError)throw A;return n.responseStyle==="data"?void 0:{error:A,...R}},a=u=>n=>i({...n,method:u}),p=u=>async n=>{let{opts:O,url:T}=await d(n);return Q({...O,body:O.body,headers:O.headers,method:u,onRequest:async(w,g)=>{let c=new Request(w,g);for(let R of s.request.fns)R&&(c=await R(c,O));return c},serializedBody:B(O),url:T})};return{buildUrl:u=>L({...r,...u}),connect:a("CONNECT"),delete:a("DELETE"),get:a("GET"),getConfig:t,head:a("HEAD"),interceptors:s,options:a("OPTIONS"),patch:a("PATCH"),post:a("POST"),put:a("PUT"),request:i,setConfig:o,sse:{connect:p("CONNECT"),delete:p("DELETE"),get:p("GET"),head:p("HEAD"),options:p("OPTIONS"),patch:p("PATCH"),post:p("POST"),put:p("PUT"),trace:p("TRACE")},trace:a("TRACE")}};var l=D(z({baseUrl:"https://rain.services.rehive.com/api/"}));var me=e=>(e.client??l).post({url:"/activate/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Oe=e=>(e?.client??l).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/cards/",...e}),Re=e=>(e.client??l).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/cards/{identifier}/",...e}),we=e=>(e?.client??l).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/company/",...e}),be=e=>(e?.client??l).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/company/",...e,headers:{"Content-Type":"application/json",...e?.headers}}),ge=e=>(e?.client??l).put({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/company/",...e,headers:{"Content-Type":"application/json",...e?.headers}}),Ce=e=>(e?.client??l).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/currencies/",...e}),xe=e=>(e.client??l).get({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/currencies/{code}/",...e}),Se=e=>(e.client??l).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/currencies/{code}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Te=e=>(e.client??l).put({security:[{name:"Authorization",type:"apiKey"}],url:"/admin/currencies/{code}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ae=e=>(e.client??l).post({url:"/deactivate/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ee=e=>(e.client??l).post({url:"/rain/webhook/{company_id}/",...e,headers:{"Content-Type":"application/json",...e.headers}}),ke=e=>(e?.client??l).get({security:[{name:"Authorization",type:"apiKey"}],url:"/user/",...e}),Ue=e=>(e?.client??l).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/user/",...e,headers:{"Content-Type":"application/json",...e?.headers}}),ze=e=>(e?.client??l).put({security:[{name:"Authorization",type:"apiKey"}],url:"/user/",...e,headers:{"Content-Type":"application/json",...e?.headers}}),De=e=>(e?.client??l).get({security:[{name:"Authorization",type:"apiKey"}],url:"/user/applications/",...e}),Pe=e=>(e.client??l).post({security:[{name:"Authorization",type:"apiKey"}],url:"/user/applications/",...e,headers:{"Content-Type":"application/json",...e.headers}}),qe=e=>(e.client??l).get({security:[{name:"Authorization",type:"apiKey"}],url:"/user/applications/{identifier}/",...e}),je=e=>(e?.client??l).get({security:[{name:"Authorization",type:"apiKey"}],url:"/user/cards/",...e}),ve=e=>(e.client??l).post({security:[{name:"Authorization",type:"apiKey"}],url:"/user/cards/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ie=e=>(e.client??l).get({security:[{name:"Authorization",type:"apiKey"}],url:"/user/cards/{identifier}/",...e}),Be=e=>(e.client??l).get({security:[{name:"Authorization",type:"apiKey"}],url:"/user/cards/{identifier}/data/",...e}),Le=e=>(e.client??l).get({security:[{name:"Authorization",type:"apiKey"}],url:"/user/cards/{identifier}/pin/",...e}),$e=e=>(e.client??l).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/user/cards/{identifier}/pin/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ke=e=>(e.client??l).put({security:[{name:"Authorization",type:"apiKey"}],url:"/user/cards/{identifier}/pin/",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ne=e=>(e.client??l).post({url:"/webhook/",...e,headers:{"Content-Type":"application/json",...e.headers}});function We(e){let r=D(M(e,"https://rain.services.rehive.com/api/"));return J(K,r)}export{We as createRainApi};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as ApiFactoryConfig, B as BoundSdk } from '../create-api-client-
|
|
2
|
-
import '../create-auth-
|
|
1
|
+
import { A as ApiFactoryConfig, B as BoundSdk } from '../create-api-client-Bkkri-AM.mjs';
|
|
2
|
+
import '../create-auth-ChOASbvo.mjs';
|
|
3
3
|
|
|
4
4
|
type AuthToken = string | undefined;
|
|
5
5
|
interface Auth {
|
|
@@ -30,7 +30,7 @@ type ArrayStyle = 'form' | 'spaceDelimited' | 'pipeDelimited';
|
|
|
30
30
|
type ObjectStyle = 'form' | 'deepObject';
|
|
31
31
|
|
|
32
32
|
type QuerySerializer = (query: Record<string, unknown>) => string;
|
|
33
|
-
type BodySerializer = (body:
|
|
33
|
+
type BodySerializer = (body: unknown) => unknown;
|
|
34
34
|
type QuerySerializerOptionsObject = {
|
|
35
35
|
allowReserved?: boolean;
|
|
36
36
|
array?: Partial<SerializerOptions<ArrayStyle>>;
|
|
@@ -105,7 +105,7 @@ interface Config$1 {
|
|
|
105
105
|
requestValidator?: (data: unknown) => Promise<unknown>;
|
|
106
106
|
/**
|
|
107
107
|
* A function transforming response data before it's returned. This is useful
|
|
108
|
-
* for post-processing data, e.g
|
|
108
|
+
* for post-processing data, e.g., converting ISO strings into Date objects.
|
|
109
109
|
*/
|
|
110
110
|
responseTransformer?: (data: unknown) => Promise<unknown>;
|
|
111
111
|
/**
|
|
@@ -265,6 +265,7 @@ interface RequestOptions<TData = unknown, TResponseStyle extends ResponseStyle =
|
|
|
265
265
|
url: Url;
|
|
266
266
|
}
|
|
267
267
|
interface ResolvedRequestOptions<TResponseStyle extends ResponseStyle = 'data', ThrowOnError extends boolean = boolean, Url extends string = string> extends RequestOptions<unknown, TResponseStyle, ThrowOnError, Url> {
|
|
268
|
+
headers: Headers;
|
|
268
269
|
serializedBody?: string;
|
|
269
270
|
}
|
|
270
271
|
type RequestResult<TData = unknown, TError = unknown, ThrowOnError extends boolean = boolean, TResponseStyle extends ResponseStyle = 'data'> = ThrowOnError extends true ? Promise<TResponseStyle extends 'data' ? TData extends Record<string, unknown> ? TData[keyof TData] : TData : {
|
|
@@ -287,7 +288,7 @@ interface ClientOptions$1 {
|
|
|
287
288
|
throwOnError?: boolean;
|
|
288
289
|
}
|
|
289
290
|
type MethodFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = 'data'>(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, 'method'>) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
|
|
290
|
-
type SseFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = 'data'>(options: Omit<RequestOptions<
|
|
291
|
+
type SseFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = 'data'>(options: Omit<RequestOptions<never, TResponseStyle, ThrowOnError>, 'method'>) => Promise<ServerSentEventsResult<TData, TError>>;
|
|
291
292
|
type RequestFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = 'data'>(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, 'method'> & Pick<Required<RequestOptions<TData, TResponseStyle, ThrowOnError>>, 'method'>) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
|
|
292
293
|
type BuildUrlFn = <TData extends {
|
|
293
294
|
body?: unknown;
|
|
@@ -1863,7 +1864,7 @@ type WebhookCreateResponses = {
|
|
|
1863
1864
|
};
|
|
1864
1865
|
type WebhookCreateResponse = WebhookCreateResponses[keyof WebhookCreateResponses];
|
|
1865
1866
|
|
|
1866
|
-
type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = Options$1<TData, ThrowOnError> & {
|
|
1867
|
+
type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options$1<TData, ThrowOnError, TResponse> & {
|
|
1867
1868
|
/**
|
|
1868
1869
|
* You can provide a client instance returned by `createClient()` instead of
|
|
1869
1870
|
* individual options. This might be also useful if you want to implement a
|
|
@@ -1997,7 +1998,7 @@ declare const userRewardsRetrieve: <ThrowOnError extends boolean = false>(option
|
|
|
1997
1998
|
*/
|
|
1998
1999
|
declare const webhookCreate: <ThrowOnError extends boolean = false>(options: Options<WebhookCreateData, ThrowOnError>) => RequestResult<WebhookCreateResponses, unknown, ThrowOnError, "data">;
|
|
1999
2000
|
|
|
2000
|
-
type sdk_Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = Options<TData, ThrowOnError>;
|
|
2001
|
+
type sdk_Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options<TData, ThrowOnError, TResponse>;
|
|
2001
2002
|
declare const sdk_activateCreate: typeof activateCreate;
|
|
2002
2003
|
declare const sdk_adminCampaignsCreate: typeof adminCampaignsCreate;
|
|
2003
2004
|
declare const sdk_adminCampaignsDestroy: typeof adminCampaignsDestroy;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as ApiFactoryConfig, B as BoundSdk } from '../create-api-client-
|
|
2
|
-
import '../create-auth-
|
|
1
|
+
import { A as ApiFactoryConfig, B as BoundSdk } from '../create-api-client-CgvKBlQ_.js';
|
|
2
|
+
import '../create-auth-ChOASbvo.js';
|
|
3
3
|
|
|
4
4
|
type AuthToken = string | undefined;
|
|
5
5
|
interface Auth {
|
|
@@ -30,7 +30,7 @@ type ArrayStyle = 'form' | 'spaceDelimited' | 'pipeDelimited';
|
|
|
30
30
|
type ObjectStyle = 'form' | 'deepObject';
|
|
31
31
|
|
|
32
32
|
type QuerySerializer = (query: Record<string, unknown>) => string;
|
|
33
|
-
type BodySerializer = (body:
|
|
33
|
+
type BodySerializer = (body: unknown) => unknown;
|
|
34
34
|
type QuerySerializerOptionsObject = {
|
|
35
35
|
allowReserved?: boolean;
|
|
36
36
|
array?: Partial<SerializerOptions<ArrayStyle>>;
|
|
@@ -105,7 +105,7 @@ interface Config$1 {
|
|
|
105
105
|
requestValidator?: (data: unknown) => Promise<unknown>;
|
|
106
106
|
/**
|
|
107
107
|
* A function transforming response data before it's returned. This is useful
|
|
108
|
-
* for post-processing data, e.g
|
|
108
|
+
* for post-processing data, e.g., converting ISO strings into Date objects.
|
|
109
109
|
*/
|
|
110
110
|
responseTransformer?: (data: unknown) => Promise<unknown>;
|
|
111
111
|
/**
|
|
@@ -265,6 +265,7 @@ interface RequestOptions<TData = unknown, TResponseStyle extends ResponseStyle =
|
|
|
265
265
|
url: Url;
|
|
266
266
|
}
|
|
267
267
|
interface ResolvedRequestOptions<TResponseStyle extends ResponseStyle = 'data', ThrowOnError extends boolean = boolean, Url extends string = string> extends RequestOptions<unknown, TResponseStyle, ThrowOnError, Url> {
|
|
268
|
+
headers: Headers;
|
|
268
269
|
serializedBody?: string;
|
|
269
270
|
}
|
|
270
271
|
type RequestResult<TData = unknown, TError = unknown, ThrowOnError extends boolean = boolean, TResponseStyle extends ResponseStyle = 'data'> = ThrowOnError extends true ? Promise<TResponseStyle extends 'data' ? TData extends Record<string, unknown> ? TData[keyof TData] : TData : {
|
|
@@ -287,7 +288,7 @@ interface ClientOptions$1 {
|
|
|
287
288
|
throwOnError?: boolean;
|
|
288
289
|
}
|
|
289
290
|
type MethodFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = 'data'>(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, 'method'>) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
|
|
290
|
-
type SseFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = 'data'>(options: Omit<RequestOptions<
|
|
291
|
+
type SseFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = 'data'>(options: Omit<RequestOptions<never, TResponseStyle, ThrowOnError>, 'method'>) => Promise<ServerSentEventsResult<TData, TError>>;
|
|
291
292
|
type RequestFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = 'data'>(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, 'method'> & Pick<Required<RequestOptions<TData, TResponseStyle, ThrowOnError>>, 'method'>) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
|
|
292
293
|
type BuildUrlFn = <TData extends {
|
|
293
294
|
body?: unknown;
|
|
@@ -1863,7 +1864,7 @@ type WebhookCreateResponses = {
|
|
|
1863
1864
|
};
|
|
1864
1865
|
type WebhookCreateResponse = WebhookCreateResponses[keyof WebhookCreateResponses];
|
|
1865
1866
|
|
|
1866
|
-
type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = Options$1<TData, ThrowOnError> & {
|
|
1867
|
+
type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options$1<TData, ThrowOnError, TResponse> & {
|
|
1867
1868
|
/**
|
|
1868
1869
|
* You can provide a client instance returned by `createClient()` instead of
|
|
1869
1870
|
* individual options. This might be also useful if you want to implement a
|
|
@@ -1997,7 +1998,7 @@ declare const userRewardsRetrieve: <ThrowOnError extends boolean = false>(option
|
|
|
1997
1998
|
*/
|
|
1998
1999
|
declare const webhookCreate: <ThrowOnError extends boolean = false>(options: Options<WebhookCreateData, ThrowOnError>) => RequestResult<WebhookCreateResponses, unknown, ThrowOnError, "data">;
|
|
1999
2000
|
|
|
2000
|
-
type sdk_Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = Options<TData, ThrowOnError>;
|
|
2001
|
+
type sdk_Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options<TData, ThrowOnError, TResponse>;
|
|
2001
2002
|
declare const sdk_activateCreate: typeof activateCreate;
|
|
2002
2003
|
declare const sdk_adminCampaignsCreate: typeof adminCampaignsCreate;
|
|
2003
2004
|
declare const sdk_adminCampaignsDestroy: typeof adminCampaignsDestroy;
|