@mailmeteor/ts-sdk 0.0.1 → 0.0.3
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 +54 -0
- package/dist/generated-sdk/client/client.gen.d.ts +3 -0
- package/dist/generated-sdk/client/client.gen.d.ts.map +1 -0
- package/dist/generated-sdk/client/index.d.ts +9 -0
- package/dist/generated-sdk/client/index.d.ts.map +1 -0
- package/dist/generated-sdk/client/types.gen.d.ts +118 -0
- package/dist/generated-sdk/client/types.gen.d.ts.map +1 -0
- package/dist/generated-sdk/client/utils.gen.d.ts +34 -0
- package/dist/generated-sdk/client/utils.gen.d.ts.map +1 -0
- package/{src/client.gen.ts → dist/generated-sdk/client.gen.d.ts} +3 -6
- package/dist/generated-sdk/client.gen.d.ts.map +1 -0
- package/dist/generated-sdk/core/auth.gen.d.ts +19 -0
- package/dist/generated-sdk/core/auth.gen.d.ts.map +1 -0
- package/dist/generated-sdk/core/bodySerializer.gen.d.ts +26 -0
- package/dist/generated-sdk/core/bodySerializer.gen.d.ts.map +1 -0
- package/dist/generated-sdk/core/params.gen.d.ts +44 -0
- package/dist/generated-sdk/core/params.gen.d.ts.map +1 -0
- package/dist/generated-sdk/core/pathSerializer.gen.d.ts +34 -0
- package/dist/generated-sdk/core/pathSerializer.gen.d.ts.map +1 -0
- package/dist/generated-sdk/core/queryKeySerializer.gen.d.ts +19 -0
- package/dist/generated-sdk/core/queryKeySerializer.gen.d.ts.map +1 -0
- package/dist/generated-sdk/core/serverSentEvents.gen.d.ts +72 -0
- package/dist/generated-sdk/core/serverSentEvents.gen.d.ts.map +1 -0
- package/dist/generated-sdk/core/types.gen.d.ts +79 -0
- package/dist/generated-sdk/core/types.gen.d.ts.map +1 -0
- package/dist/generated-sdk/core/utils.gen.d.ts +20 -0
- package/dist/generated-sdk/core/utils.gen.d.ts.map +1 -0
- package/dist/generated-sdk/index.d.ts +4 -0
- package/dist/generated-sdk/index.d.ts.map +1 -0
- package/dist/generated-sdk/sdk.gen.d.ts +112 -0
- package/dist/generated-sdk/sdk.gen.d.ts.map +1 -0
- package/dist/generated-sdk/types.gen.d.ts +426 -0
- package/dist/generated-sdk/types.gen.d.ts.map +1 -0
- package/dist/index.cjs +1133 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +873 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.mjs +1130 -0
- package/dist/index.mjs.map +1 -0
- package/dist/types/generated-sdk/client/client.gen.d.ts +3 -0
- package/dist/types/generated-sdk/client/client.gen.d.ts.map +1 -0
- package/dist/types/generated-sdk/client/index.d.ts +9 -0
- package/dist/types/generated-sdk/client/index.d.ts.map +1 -0
- package/dist/types/generated-sdk/client/types.gen.d.ts +118 -0
- package/dist/types/generated-sdk/client/types.gen.d.ts.map +1 -0
- package/dist/types/generated-sdk/client/utils.gen.d.ts +34 -0
- package/dist/types/generated-sdk/client/utils.gen.d.ts.map +1 -0
- package/dist/types/generated-sdk/client.gen.d.ts +13 -0
- package/dist/types/generated-sdk/client.gen.d.ts.map +1 -0
- package/dist/types/generated-sdk/core/auth.gen.d.ts +19 -0
- package/dist/types/generated-sdk/core/auth.gen.d.ts.map +1 -0
- package/dist/types/generated-sdk/core/bodySerializer.gen.d.ts +26 -0
- package/dist/types/generated-sdk/core/bodySerializer.gen.d.ts.map +1 -0
- package/dist/types/generated-sdk/core/params.gen.d.ts +44 -0
- package/dist/types/generated-sdk/core/params.gen.d.ts.map +1 -0
- package/dist/types/generated-sdk/core/pathSerializer.gen.d.ts +34 -0
- package/dist/types/generated-sdk/core/pathSerializer.gen.d.ts.map +1 -0
- package/dist/types/generated-sdk/core/queryKeySerializer.gen.d.ts +19 -0
- package/dist/types/generated-sdk/core/queryKeySerializer.gen.d.ts.map +1 -0
- package/dist/types/generated-sdk/core/serverSentEvents.gen.d.ts +72 -0
- package/dist/types/generated-sdk/core/serverSentEvents.gen.d.ts.map +1 -0
- package/dist/types/generated-sdk/core/types.gen.d.ts +79 -0
- package/dist/types/generated-sdk/core/types.gen.d.ts.map +1 -0
- package/dist/types/generated-sdk/core/utils.gen.d.ts +20 -0
- package/dist/types/generated-sdk/core/utils.gen.d.ts.map +1 -0
- package/dist/types/generated-sdk/index.d.ts +4 -0
- package/dist/types/generated-sdk/index.d.ts.map +1 -0
- package/dist/types/generated-sdk/sdk.gen.d.ts +112 -0
- package/dist/types/generated-sdk/sdk.gen.d.ts.map +1 -0
- package/dist/types/generated-sdk/types.gen.d.ts +426 -0
- package/dist/types/generated-sdk/types.gen.d.ts.map +1 -0
- package/dist/types/index.d.ts +28 -0
- package/dist/types/index.d.ts.map +1 -0
- package/package.json +33 -6
- package/src/client/client.gen.ts +0 -311
- package/src/client/index.ts +0 -25
- package/src/client/types.gen.ts +0 -241
- package/src/client/utils.gen.ts +0 -332
- package/src/core/auth.gen.ts +0 -42
- package/src/core/bodySerializer.gen.ts +0 -100
- package/src/core/params.gen.ts +0 -176
- package/src/core/pathSerializer.gen.ts +0 -181
- package/src/core/queryKeySerializer.gen.ts +0 -136
- package/src/core/serverSentEvents.gen.ts +0 -266
- package/src/core/types.gen.ts +0 -118
- package/src/core/utils.gen.ts +0 -143
- package/src/index.ts +0 -4
- package/src/sdk.gen.ts +0 -115
- package/src/types.gen.ts +0 -245
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,873 @@
|
|
|
1
|
+
type AuthToken = string | undefined;
|
|
2
|
+
interface Auth {
|
|
3
|
+
/**
|
|
4
|
+
* Which part of the request do we use to send the auth?
|
|
5
|
+
*
|
|
6
|
+
* @default 'header'
|
|
7
|
+
*/
|
|
8
|
+
in?: 'header' | 'query' | 'cookie';
|
|
9
|
+
/**
|
|
10
|
+
* Header or query parameter name.
|
|
11
|
+
*
|
|
12
|
+
* @default 'Authorization'
|
|
13
|
+
*/
|
|
14
|
+
name?: string;
|
|
15
|
+
scheme?: 'basic' | 'bearer';
|
|
16
|
+
type: 'apiKey' | 'http';
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
interface SerializerOptions<T> {
|
|
20
|
+
/**
|
|
21
|
+
* @default true
|
|
22
|
+
*/
|
|
23
|
+
explode: boolean;
|
|
24
|
+
style: T;
|
|
25
|
+
}
|
|
26
|
+
type ArrayStyle = 'form' | 'spaceDelimited' | 'pipeDelimited';
|
|
27
|
+
type ObjectStyle = 'form' | 'deepObject';
|
|
28
|
+
|
|
29
|
+
type QuerySerializer = (query: Record<string, unknown>) => string;
|
|
30
|
+
type BodySerializer = (body: any) => any;
|
|
31
|
+
type QuerySerializerOptionsObject = {
|
|
32
|
+
allowReserved?: boolean;
|
|
33
|
+
array?: Partial<SerializerOptions<ArrayStyle>>;
|
|
34
|
+
object?: Partial<SerializerOptions<ObjectStyle>>;
|
|
35
|
+
};
|
|
36
|
+
type QuerySerializerOptions = QuerySerializerOptionsObject & {
|
|
37
|
+
/**
|
|
38
|
+
* Per-parameter serialization overrides. When provided, these settings
|
|
39
|
+
* override the global array/object settings for specific parameter names.
|
|
40
|
+
*/
|
|
41
|
+
parameters?: Record<string, QuerySerializerOptionsObject>;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
type HttpMethod = 'connect' | 'delete' | 'get' | 'head' | 'options' | 'patch' | 'post' | 'put' | 'trace';
|
|
45
|
+
type Client$1<RequestFn = never, Config = unknown, MethodFn = never, BuildUrlFn = never, SseFn = never> = {
|
|
46
|
+
/**
|
|
47
|
+
* Returns the final request URL.
|
|
48
|
+
*/
|
|
49
|
+
buildUrl: BuildUrlFn;
|
|
50
|
+
getConfig: () => Config;
|
|
51
|
+
request: RequestFn;
|
|
52
|
+
setConfig: (config: Config) => Config;
|
|
53
|
+
} & {
|
|
54
|
+
[K in HttpMethod]: MethodFn;
|
|
55
|
+
} & ([SseFn] extends [never] ? {
|
|
56
|
+
sse?: never;
|
|
57
|
+
} : {
|
|
58
|
+
sse: {
|
|
59
|
+
[K in HttpMethod]: SseFn;
|
|
60
|
+
};
|
|
61
|
+
});
|
|
62
|
+
interface Config$1 {
|
|
63
|
+
/**
|
|
64
|
+
* Auth token or a function returning auth token. The resolved value will be
|
|
65
|
+
* added to the request payload as defined by its `security` array.
|
|
66
|
+
*/
|
|
67
|
+
auth?: ((auth: Auth) => Promise<AuthToken> | AuthToken) | AuthToken;
|
|
68
|
+
/**
|
|
69
|
+
* A function for serializing request body parameter. By default,
|
|
70
|
+
* {@link JSON.stringify()} will be used.
|
|
71
|
+
*/
|
|
72
|
+
bodySerializer?: BodySerializer | null;
|
|
73
|
+
/**
|
|
74
|
+
* An object containing any HTTP headers that you want to pre-populate your
|
|
75
|
+
* `Headers` object with.
|
|
76
|
+
*
|
|
77
|
+
* {@link https://developer.mozilla.org/docs/Web/API/Headers/Headers#init See more}
|
|
78
|
+
*/
|
|
79
|
+
headers?: RequestInit['headers'] | Record<string, string | number | boolean | (string | number | boolean)[] | null | undefined | unknown>;
|
|
80
|
+
/**
|
|
81
|
+
* The request method.
|
|
82
|
+
*
|
|
83
|
+
* {@link https://developer.mozilla.org/docs/Web/API/fetch#method See more}
|
|
84
|
+
*/
|
|
85
|
+
method?: Uppercase<HttpMethod>;
|
|
86
|
+
/**
|
|
87
|
+
* A function for serializing request query parameters. By default, arrays
|
|
88
|
+
* will be exploded in form style, objects will be exploded in deepObject
|
|
89
|
+
* style, and reserved characters are percent-encoded.
|
|
90
|
+
*
|
|
91
|
+
* This method will have no effect if the native `paramsSerializer()` Axios
|
|
92
|
+
* API function is used.
|
|
93
|
+
*
|
|
94
|
+
* {@link https://swagger.io/docs/specification/serialization/#query View examples}
|
|
95
|
+
*/
|
|
96
|
+
querySerializer?: QuerySerializer | QuerySerializerOptions;
|
|
97
|
+
/**
|
|
98
|
+
* A function validating request data. This is useful if you want to ensure
|
|
99
|
+
* the request conforms to the desired shape, so it can be safely sent to
|
|
100
|
+
* the server.
|
|
101
|
+
*/
|
|
102
|
+
requestValidator?: (data: unknown) => Promise<unknown>;
|
|
103
|
+
/**
|
|
104
|
+
* A function transforming response data before it's returned. This is useful
|
|
105
|
+
* for post-processing data, e.g. converting ISO strings into Date objects.
|
|
106
|
+
*/
|
|
107
|
+
responseTransformer?: (data: unknown) => Promise<unknown>;
|
|
108
|
+
/**
|
|
109
|
+
* A function validating response data. This is useful if you want to ensure
|
|
110
|
+
* the response conforms to the desired shape, so it can be safely passed to
|
|
111
|
+
* the transformers and returned to the user.
|
|
112
|
+
*/
|
|
113
|
+
responseValidator?: (data: unknown) => Promise<unknown>;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
type ServerSentEventsOptions<TData = unknown> = Omit<RequestInit, 'method'> & Pick<Config$1, 'method' | 'responseTransformer' | 'responseValidator'> & {
|
|
117
|
+
/**
|
|
118
|
+
* Fetch API implementation. You can use this option to provide a custom
|
|
119
|
+
* fetch instance.
|
|
120
|
+
*
|
|
121
|
+
* @default globalThis.fetch
|
|
122
|
+
*/
|
|
123
|
+
fetch?: typeof fetch;
|
|
124
|
+
/**
|
|
125
|
+
* Implementing clients can call request interceptors inside this hook.
|
|
126
|
+
*/
|
|
127
|
+
onRequest?: (url: string, init: RequestInit) => Promise<Request>;
|
|
128
|
+
/**
|
|
129
|
+
* Callback invoked when a network or parsing error occurs during streaming.
|
|
130
|
+
*
|
|
131
|
+
* This option applies only if the endpoint returns a stream of events.
|
|
132
|
+
*
|
|
133
|
+
* @param error The error that occurred.
|
|
134
|
+
*/
|
|
135
|
+
onSseError?: (error: unknown) => void;
|
|
136
|
+
/**
|
|
137
|
+
* Callback invoked when an event is streamed from the server.
|
|
138
|
+
*
|
|
139
|
+
* This option applies only if the endpoint returns a stream of events.
|
|
140
|
+
*
|
|
141
|
+
* @param event Event streamed from the server.
|
|
142
|
+
* @returns Nothing (void).
|
|
143
|
+
*/
|
|
144
|
+
onSseEvent?: (event: StreamEvent<TData>) => void;
|
|
145
|
+
serializedBody?: RequestInit['body'];
|
|
146
|
+
/**
|
|
147
|
+
* Default retry delay in milliseconds.
|
|
148
|
+
*
|
|
149
|
+
* This option applies only if the endpoint returns a stream of events.
|
|
150
|
+
*
|
|
151
|
+
* @default 3000
|
|
152
|
+
*/
|
|
153
|
+
sseDefaultRetryDelay?: number;
|
|
154
|
+
/**
|
|
155
|
+
* Maximum number of retry attempts before giving up.
|
|
156
|
+
*/
|
|
157
|
+
sseMaxRetryAttempts?: number;
|
|
158
|
+
/**
|
|
159
|
+
* Maximum retry delay in milliseconds.
|
|
160
|
+
*
|
|
161
|
+
* Applies only when exponential backoff is used.
|
|
162
|
+
*
|
|
163
|
+
* This option applies only if the endpoint returns a stream of events.
|
|
164
|
+
*
|
|
165
|
+
* @default 30000
|
|
166
|
+
*/
|
|
167
|
+
sseMaxRetryDelay?: number;
|
|
168
|
+
/**
|
|
169
|
+
* Optional sleep function for retry backoff.
|
|
170
|
+
*
|
|
171
|
+
* Defaults to using `setTimeout`.
|
|
172
|
+
*/
|
|
173
|
+
sseSleepFn?: (ms: number) => Promise<void>;
|
|
174
|
+
url: string;
|
|
175
|
+
};
|
|
176
|
+
interface StreamEvent<TData = unknown> {
|
|
177
|
+
data: TData;
|
|
178
|
+
event?: string;
|
|
179
|
+
id?: string;
|
|
180
|
+
retry?: number;
|
|
181
|
+
}
|
|
182
|
+
type ServerSentEventsResult<TData = unknown, TReturn = void, TNext = unknown> = {
|
|
183
|
+
stream: AsyncGenerator<TData extends Record<string, unknown> ? TData[keyof TData] : TData, TReturn, TNext>;
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
type ErrInterceptor<Err, Res, Req, Options> = (error: Err, response: Res, request: Req, options: Options) => Err | Promise<Err>;
|
|
187
|
+
type ReqInterceptor<Req, Options> = (request: Req, options: Options) => Req | Promise<Req>;
|
|
188
|
+
type ResInterceptor<Res, Req, Options> = (response: Res, request: Req, options: Options) => Res | Promise<Res>;
|
|
189
|
+
declare class Interceptors<Interceptor> {
|
|
190
|
+
fns: Array<Interceptor | null>;
|
|
191
|
+
clear(): void;
|
|
192
|
+
eject(id: number | Interceptor): void;
|
|
193
|
+
exists(id: number | Interceptor): boolean;
|
|
194
|
+
getInterceptorIndex(id: number | Interceptor): number;
|
|
195
|
+
update(id: number | Interceptor, fn: Interceptor): number | Interceptor | false;
|
|
196
|
+
use(fn: Interceptor): number;
|
|
197
|
+
}
|
|
198
|
+
interface Middleware<Req, Res, Err, Options> {
|
|
199
|
+
error: Interceptors<ErrInterceptor<Err, Res, Req, Options>>;
|
|
200
|
+
request: Interceptors<ReqInterceptor<Req, Options>>;
|
|
201
|
+
response: Interceptors<ResInterceptor<Res, Req, Options>>;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
type ResponseStyle = 'data' | 'fields';
|
|
205
|
+
interface Config<T extends ClientOptions$1 = ClientOptions$1> extends Omit<RequestInit, 'body' | 'headers' | 'method'>, Config$1 {
|
|
206
|
+
/**
|
|
207
|
+
* Base URL for all requests made by this client.
|
|
208
|
+
*/
|
|
209
|
+
baseUrl?: T['baseUrl'];
|
|
210
|
+
/**
|
|
211
|
+
* Fetch API implementation. You can use this option to provide a custom
|
|
212
|
+
* fetch instance.
|
|
213
|
+
*
|
|
214
|
+
* @default globalThis.fetch
|
|
215
|
+
*/
|
|
216
|
+
fetch?: typeof fetch;
|
|
217
|
+
/**
|
|
218
|
+
* Please don't use the Fetch client for Next.js applications. The `next`
|
|
219
|
+
* options won't have any effect.
|
|
220
|
+
*
|
|
221
|
+
* Install {@link https://www.npmjs.com/package/@hey-api/client-next `@hey-api/client-next`} instead.
|
|
222
|
+
*/
|
|
223
|
+
next?: never;
|
|
224
|
+
/**
|
|
225
|
+
* Return the response data parsed in a specified format. By default, `auto`
|
|
226
|
+
* will infer the appropriate method from the `Content-Type` response header.
|
|
227
|
+
* You can override this behavior with any of the {@link Body} methods.
|
|
228
|
+
* Select `stream` if you don't want to parse response data at all.
|
|
229
|
+
*
|
|
230
|
+
* @default 'auto'
|
|
231
|
+
*/
|
|
232
|
+
parseAs?: 'arrayBuffer' | 'auto' | 'blob' | 'formData' | 'json' | 'stream' | 'text';
|
|
233
|
+
/**
|
|
234
|
+
* Should we return only data or multiple fields (data, error, response, etc.)?
|
|
235
|
+
*
|
|
236
|
+
* @default 'fields'
|
|
237
|
+
*/
|
|
238
|
+
responseStyle?: ResponseStyle;
|
|
239
|
+
/**
|
|
240
|
+
* Throw an error instead of returning it in the response?
|
|
241
|
+
*
|
|
242
|
+
* @default false
|
|
243
|
+
*/
|
|
244
|
+
throwOnError?: T['throwOnError'];
|
|
245
|
+
}
|
|
246
|
+
interface RequestOptions<TData = unknown, TResponseStyle extends ResponseStyle = 'fields', ThrowOnError extends boolean = boolean, Url extends string = string> extends Config<{
|
|
247
|
+
responseStyle: TResponseStyle;
|
|
248
|
+
throwOnError: ThrowOnError;
|
|
249
|
+
}>, Pick<ServerSentEventsOptions<TData>, 'onSseError' | 'onSseEvent' | 'sseDefaultRetryDelay' | 'sseMaxRetryAttempts' | 'sseMaxRetryDelay'> {
|
|
250
|
+
/**
|
|
251
|
+
* Any body that you want to add to your request.
|
|
252
|
+
*
|
|
253
|
+
* {@link https://developer.mozilla.org/docs/Web/API/fetch#body}
|
|
254
|
+
*/
|
|
255
|
+
body?: unknown;
|
|
256
|
+
path?: Record<string, unknown>;
|
|
257
|
+
query?: Record<string, unknown>;
|
|
258
|
+
/**
|
|
259
|
+
* Security mechanism(s) to use for the request.
|
|
260
|
+
*/
|
|
261
|
+
security?: ReadonlyArray<Auth>;
|
|
262
|
+
url: Url;
|
|
263
|
+
}
|
|
264
|
+
interface ResolvedRequestOptions<TResponseStyle extends ResponseStyle = 'fields', ThrowOnError extends boolean = boolean, Url extends string = string> extends RequestOptions<unknown, TResponseStyle, ThrowOnError, Url> {
|
|
265
|
+
serializedBody?: string;
|
|
266
|
+
}
|
|
267
|
+
type RequestResult<TData = unknown, TError = unknown, ThrowOnError extends boolean = boolean, TResponseStyle extends ResponseStyle = 'fields'> = ThrowOnError extends true ? Promise<TResponseStyle extends 'data' ? TData extends Record<string, unknown> ? TData[keyof TData] : TData : {
|
|
268
|
+
data: TData extends Record<string, unknown> ? TData[keyof TData] : TData;
|
|
269
|
+
request: Request;
|
|
270
|
+
response: Response;
|
|
271
|
+
}> : Promise<TResponseStyle extends 'data' ? (TData extends Record<string, unknown> ? TData[keyof TData] : TData) | undefined : ({
|
|
272
|
+
data: TData extends Record<string, unknown> ? TData[keyof TData] : TData;
|
|
273
|
+
error: undefined;
|
|
274
|
+
} | {
|
|
275
|
+
data: undefined;
|
|
276
|
+
error: TError extends Record<string, unknown> ? TError[keyof TError] : TError;
|
|
277
|
+
}) & {
|
|
278
|
+
request: Request;
|
|
279
|
+
response: Response;
|
|
280
|
+
}>;
|
|
281
|
+
interface ClientOptions$1 {
|
|
282
|
+
baseUrl?: string;
|
|
283
|
+
responseStyle?: ResponseStyle;
|
|
284
|
+
throwOnError?: boolean;
|
|
285
|
+
}
|
|
286
|
+
type MethodFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = 'fields'>(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, 'method'>) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
|
|
287
|
+
type SseFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = 'fields'>(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, 'method'>) => Promise<ServerSentEventsResult<TData, TError>>;
|
|
288
|
+
type RequestFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = 'fields'>(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, 'method'> & Pick<Required<RequestOptions<TData, TResponseStyle, ThrowOnError>>, 'method'>) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
|
|
289
|
+
type BuildUrlFn = <TData extends {
|
|
290
|
+
body?: unknown;
|
|
291
|
+
path?: Record<string, unknown>;
|
|
292
|
+
query?: Record<string, unknown>;
|
|
293
|
+
url: string;
|
|
294
|
+
}>(options: TData & Options$1<TData>) => string;
|
|
295
|
+
type Client = Client$1<RequestFn, Config, MethodFn, BuildUrlFn, SseFn> & {
|
|
296
|
+
interceptors: Middleware<Request, Response, unknown, ResolvedRequestOptions>;
|
|
297
|
+
};
|
|
298
|
+
interface TDataShape {
|
|
299
|
+
body?: unknown;
|
|
300
|
+
headers?: unknown;
|
|
301
|
+
path?: unknown;
|
|
302
|
+
query?: unknown;
|
|
303
|
+
url: string;
|
|
304
|
+
}
|
|
305
|
+
type OmitKeys<T, K> = Pick<T, Exclude<keyof T, K>>;
|
|
306
|
+
type Options$1<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown, TResponseStyle extends ResponseStyle = 'fields'> = OmitKeys<RequestOptions<TResponse, TResponseStyle, ThrowOnError>, 'body' | 'path' | 'query' | 'url'> & ([TData] extends [never] ? unknown : Omit<TData, 'url'>);
|
|
307
|
+
|
|
308
|
+
type ClientOptions = {
|
|
309
|
+
baseUrl: `${string}://${string}/v1` | (string & {});
|
|
310
|
+
};
|
|
311
|
+
type ErrorResponse = {
|
|
312
|
+
error: {
|
|
313
|
+
status: number;
|
|
314
|
+
code?: 'url_invalid' | 'authentication_required' | 'rate_limit' | 'resource_missing' | 'resource_conflict' | 'resource_exhausted' | 'resource_already_exists' | 'resource_action_required' | 'account_verification_required' | 'account_unauthorized' | 'account_blocked' | 'parameter_missing' | 'parameter_invalid' | 'esp_unsupported' | 'unknown_error' | 'api_error' | 'quota_exceeded' | 'sender_missing_service' | 'sender_insufficient_permission' | 'admin_role_required' | 'TEST_ERROR';
|
|
315
|
+
message: string;
|
|
316
|
+
type?: string;
|
|
317
|
+
details?: {
|
|
318
|
+
[key: string]: unknown;
|
|
319
|
+
};
|
|
320
|
+
};
|
|
321
|
+
message: string;
|
|
322
|
+
code?: 'url_invalid' | 'authentication_required' | 'rate_limit' | 'resource_missing' | 'resource_conflict' | 'resource_exhausted' | 'resource_already_exists' | 'resource_action_required' | 'account_verification_required' | 'account_unauthorized' | 'account_blocked' | 'parameter_missing' | 'parameter_invalid' | 'esp_unsupported' | 'unknown_error' | 'api_error' | 'quota_exceeded' | 'sender_missing_service' | 'sender_insufficient_permission' | 'admin_role_required' | 'TEST_ERROR';
|
|
323
|
+
};
|
|
324
|
+
type AddonsResponse200 = {
|
|
325
|
+
senders?: {
|
|
326
|
+
included_per_seat: number;
|
|
327
|
+
included_total: number;
|
|
328
|
+
used: number;
|
|
329
|
+
extra: {
|
|
330
|
+
price_amount: number;
|
|
331
|
+
currency: string;
|
|
332
|
+
quantity_per_addon: number;
|
|
333
|
+
interval: 'day' | 'week' | 'month' | 'year';
|
|
334
|
+
subscribed: number;
|
|
335
|
+
} | null;
|
|
336
|
+
};
|
|
337
|
+
email_warmups?: {
|
|
338
|
+
included_per_seat: number;
|
|
339
|
+
included_total: number;
|
|
340
|
+
used: number;
|
|
341
|
+
extra: {
|
|
342
|
+
price_amount: number;
|
|
343
|
+
currency: string;
|
|
344
|
+
quantity_per_addon: number;
|
|
345
|
+
interval: 'day' | 'week' | 'month' | 'year';
|
|
346
|
+
subscribed: number;
|
|
347
|
+
} | null;
|
|
348
|
+
};
|
|
349
|
+
};
|
|
350
|
+
type PreviewBody = {
|
|
351
|
+
plan: 'free' | 'starter' | 'pro' | 'premium' | 'business';
|
|
352
|
+
billing_period: 'month' | 'year';
|
|
353
|
+
};
|
|
354
|
+
type PreviewParams = {
|
|
355
|
+
addon: 'senders' | 'email_warmups';
|
|
356
|
+
};
|
|
357
|
+
type PreviewResponse200 = {
|
|
358
|
+
discount_percents: Array<number>;
|
|
359
|
+
total_excluding_tax: number;
|
|
360
|
+
total: number;
|
|
361
|
+
amount_due: number;
|
|
362
|
+
added_from_balance: number;
|
|
363
|
+
consumed_balance: number;
|
|
364
|
+
credited_to_balance: number;
|
|
365
|
+
lines: Array<{
|
|
366
|
+
amount: number;
|
|
367
|
+
billing_period: 'day' | 'week' | 'month' | 'year';
|
|
368
|
+
proration: boolean;
|
|
369
|
+
plan?: 'free' | 'starter' | 'pro' | 'premium' | 'business';
|
|
370
|
+
addon?: 'senders' | 'email_warmups';
|
|
371
|
+
}>;
|
|
372
|
+
next_renewal: number;
|
|
373
|
+
total_tax_amounts: Array<{
|
|
374
|
+
amount: number;
|
|
375
|
+
}>;
|
|
376
|
+
};
|
|
377
|
+
type AddonBody = {
|
|
378
|
+
quantity: number;
|
|
379
|
+
};
|
|
380
|
+
type AddonParams = {
|
|
381
|
+
addon: 'senders' | 'email_warmups';
|
|
382
|
+
};
|
|
383
|
+
type AddonResponse200 = Array<{
|
|
384
|
+
id: string;
|
|
385
|
+
email: string;
|
|
386
|
+
usage: number;
|
|
387
|
+
}>;
|
|
388
|
+
type SubscriptionResponse200 = {
|
|
389
|
+
status: 'confirmation_required' | 'success' | 'payment_failed';
|
|
390
|
+
client_secret?: string;
|
|
391
|
+
failure_code?: string;
|
|
392
|
+
};
|
|
393
|
+
type SubscriptionBody = {
|
|
394
|
+
plan: 'free' | 'starter' | 'pro' | 'premium' | 'business';
|
|
395
|
+
billing_period: 'month' | 'year';
|
|
396
|
+
};
|
|
397
|
+
type PricesQuery = {
|
|
398
|
+
currency: string;
|
|
399
|
+
};
|
|
400
|
+
type PricesResponse200 = {
|
|
401
|
+
free?: {
|
|
402
|
+
month: number;
|
|
403
|
+
year: number;
|
|
404
|
+
};
|
|
405
|
+
starter?: {
|
|
406
|
+
month: number;
|
|
407
|
+
year: number;
|
|
408
|
+
};
|
|
409
|
+
pro?: {
|
|
410
|
+
month: number;
|
|
411
|
+
year: number;
|
|
412
|
+
};
|
|
413
|
+
premium?: {
|
|
414
|
+
month: number;
|
|
415
|
+
year: number;
|
|
416
|
+
};
|
|
417
|
+
business?: {
|
|
418
|
+
month: number;
|
|
419
|
+
year: number;
|
|
420
|
+
};
|
|
421
|
+
};
|
|
422
|
+
type OpenapiJsonResponse200 = unknown;
|
|
423
|
+
type BillingAddonsGetAddonsData = {
|
|
424
|
+
body?: never;
|
|
425
|
+
path?: never;
|
|
426
|
+
query?: never;
|
|
427
|
+
url: '/billing/addons';
|
|
428
|
+
};
|
|
429
|
+
type BillingAddonsGetAddonsErrors = {
|
|
430
|
+
/**
|
|
431
|
+
* Error response
|
|
432
|
+
*/
|
|
433
|
+
default: ErrorResponse;
|
|
434
|
+
};
|
|
435
|
+
type BillingAddonsGetAddonsError = BillingAddonsGetAddonsErrors[keyof BillingAddonsGetAddonsErrors];
|
|
436
|
+
type BillingAddonsGetAddonsResponses = {
|
|
437
|
+
/**
|
|
438
|
+
* Response
|
|
439
|
+
*/
|
|
440
|
+
200: {
|
|
441
|
+
senders?: {
|
|
442
|
+
included_per_seat: number;
|
|
443
|
+
included_total: number;
|
|
444
|
+
used: number;
|
|
445
|
+
extra: {
|
|
446
|
+
price_amount: number;
|
|
447
|
+
currency: string;
|
|
448
|
+
quantity_per_addon: number;
|
|
449
|
+
interval: 'day' | 'week' | 'month' | 'year';
|
|
450
|
+
subscribed: number;
|
|
451
|
+
} | null;
|
|
452
|
+
};
|
|
453
|
+
email_warmups?: {
|
|
454
|
+
included_per_seat: number;
|
|
455
|
+
included_total: number;
|
|
456
|
+
used: number;
|
|
457
|
+
extra: {
|
|
458
|
+
price_amount: number;
|
|
459
|
+
currency: string;
|
|
460
|
+
quantity_per_addon: number;
|
|
461
|
+
interval: 'day' | 'week' | 'month' | 'year';
|
|
462
|
+
subscribed: number;
|
|
463
|
+
} | null;
|
|
464
|
+
};
|
|
465
|
+
};
|
|
466
|
+
};
|
|
467
|
+
type BillingAddonsGetAddonsResponse = BillingAddonsGetAddonsResponses[keyof BillingAddonsGetAddonsResponses];
|
|
468
|
+
type BillingAddonsPreviewUpdateData = {
|
|
469
|
+
body?: {
|
|
470
|
+
quantity: number;
|
|
471
|
+
};
|
|
472
|
+
path: {
|
|
473
|
+
addon: 'senders' | 'email_warmups';
|
|
474
|
+
};
|
|
475
|
+
query?: never;
|
|
476
|
+
url: '/billing/addons/{addon}/preview';
|
|
477
|
+
};
|
|
478
|
+
type BillingAddonsPreviewUpdateErrors = {
|
|
479
|
+
/**
|
|
480
|
+
* Error response
|
|
481
|
+
*/
|
|
482
|
+
default: ErrorResponse;
|
|
483
|
+
};
|
|
484
|
+
type BillingAddonsPreviewUpdateError = BillingAddonsPreviewUpdateErrors[keyof BillingAddonsPreviewUpdateErrors];
|
|
485
|
+
type BillingAddonsPreviewUpdateResponses = {
|
|
486
|
+
/**
|
|
487
|
+
* Response
|
|
488
|
+
*/
|
|
489
|
+
200: {
|
|
490
|
+
discount_percents: Array<number>;
|
|
491
|
+
total_excluding_tax: number;
|
|
492
|
+
total: number;
|
|
493
|
+
amount_due: number;
|
|
494
|
+
added_from_balance: number;
|
|
495
|
+
consumed_balance: number;
|
|
496
|
+
credited_to_balance: number;
|
|
497
|
+
};
|
|
498
|
+
};
|
|
499
|
+
type BillingAddonsPreviewUpdateResponse = BillingAddonsPreviewUpdateResponses[keyof BillingAddonsPreviewUpdateResponses];
|
|
500
|
+
type BillingAddonsGetAddonUsagesData = {
|
|
501
|
+
body?: never;
|
|
502
|
+
path: {
|
|
503
|
+
addon: 'senders' | 'email_warmups';
|
|
504
|
+
};
|
|
505
|
+
query?: never;
|
|
506
|
+
url: '/billing/addons/{addon}';
|
|
507
|
+
};
|
|
508
|
+
type BillingAddonsGetAddonUsagesErrors = {
|
|
509
|
+
/**
|
|
510
|
+
* Error response
|
|
511
|
+
*/
|
|
512
|
+
default: ErrorResponse;
|
|
513
|
+
};
|
|
514
|
+
type BillingAddonsGetAddonUsagesError = BillingAddonsGetAddonUsagesErrors[keyof BillingAddonsGetAddonUsagesErrors];
|
|
515
|
+
type BillingAddonsGetAddonUsagesResponses = {
|
|
516
|
+
/**
|
|
517
|
+
* Response
|
|
518
|
+
*/
|
|
519
|
+
200: Array<{
|
|
520
|
+
id: string;
|
|
521
|
+
email: string;
|
|
522
|
+
usage: number;
|
|
523
|
+
}>;
|
|
524
|
+
};
|
|
525
|
+
type BillingAddonsGetAddonUsagesResponse = BillingAddonsGetAddonUsagesResponses[keyof BillingAddonsGetAddonUsagesResponses];
|
|
526
|
+
type BillingAddonsUpdateData = {
|
|
527
|
+
body?: {
|
|
528
|
+
quantity: number;
|
|
529
|
+
};
|
|
530
|
+
path: {
|
|
531
|
+
addon: 'senders' | 'email_warmups';
|
|
532
|
+
};
|
|
533
|
+
query?: never;
|
|
534
|
+
url: '/billing/addons/{addon}';
|
|
535
|
+
};
|
|
536
|
+
type BillingAddonsUpdateErrors = {
|
|
537
|
+
/**
|
|
538
|
+
* Error response
|
|
539
|
+
*/
|
|
540
|
+
default: ErrorResponse;
|
|
541
|
+
};
|
|
542
|
+
type BillingAddonsUpdateError = BillingAddonsUpdateErrors[keyof BillingAddonsUpdateErrors];
|
|
543
|
+
type BillingAddonsUpdateResponses = {
|
|
544
|
+
/**
|
|
545
|
+
* Response
|
|
546
|
+
*/
|
|
547
|
+
200: {
|
|
548
|
+
status: 'confirmation_required' | 'success' | 'payment_failed';
|
|
549
|
+
client_secret?: string;
|
|
550
|
+
failure_code?: string;
|
|
551
|
+
};
|
|
552
|
+
};
|
|
553
|
+
type BillingAddonsUpdateResponse = BillingAddonsUpdateResponses[keyof BillingAddonsUpdateResponses];
|
|
554
|
+
type BillingSubscriptionGetData = {
|
|
555
|
+
body?: never;
|
|
556
|
+
path?: never;
|
|
557
|
+
query?: never;
|
|
558
|
+
url: '/billing/subscription';
|
|
559
|
+
};
|
|
560
|
+
type BillingSubscriptionGetErrors = {
|
|
561
|
+
/**
|
|
562
|
+
* Error response
|
|
563
|
+
*/
|
|
564
|
+
default: ErrorResponse;
|
|
565
|
+
};
|
|
566
|
+
type BillingSubscriptionGetError = BillingSubscriptionGetErrors[keyof BillingSubscriptionGetErrors];
|
|
567
|
+
type BillingSubscriptionGetResponses = {
|
|
568
|
+
/**
|
|
569
|
+
* Response
|
|
570
|
+
*/
|
|
571
|
+
200: {
|
|
572
|
+
id: string;
|
|
573
|
+
created_at: number;
|
|
574
|
+
current_period_start: number;
|
|
575
|
+
current_period_end: number;
|
|
576
|
+
quantity: number;
|
|
577
|
+
currency: string;
|
|
578
|
+
amount: number | null;
|
|
579
|
+
discount_percentage?: number | null;
|
|
580
|
+
name: string | null;
|
|
581
|
+
billing_period: 'day' | 'week' | 'month' | 'year' | null;
|
|
582
|
+
plan: 'free' | 'starter' | 'pro' | 'premium' | 'business' | null;
|
|
583
|
+
default_payment_method: {
|
|
584
|
+
type: string;
|
|
585
|
+
brand?: string | null;
|
|
586
|
+
last4: string | null;
|
|
587
|
+
exp_month: number | null;
|
|
588
|
+
exp_year: number | null;
|
|
589
|
+
bank_name?: string | null;
|
|
590
|
+
} | null;
|
|
591
|
+
addons: {
|
|
592
|
+
senders?: {
|
|
593
|
+
quantity: number;
|
|
594
|
+
};
|
|
595
|
+
email_warmups?: {
|
|
596
|
+
quantity: number;
|
|
597
|
+
};
|
|
598
|
+
};
|
|
599
|
+
} | null;
|
|
600
|
+
};
|
|
601
|
+
type BillingSubscriptionGetResponse = BillingSubscriptionGetResponses[keyof BillingSubscriptionGetResponses];
|
|
602
|
+
type BillingSubscriptionUpdateData = {
|
|
603
|
+
body?: {
|
|
604
|
+
plan: 'free' | 'starter' | 'pro' | 'premium' | 'business';
|
|
605
|
+
billing_period: 'month' | 'year';
|
|
606
|
+
};
|
|
607
|
+
path?: never;
|
|
608
|
+
query?: never;
|
|
609
|
+
url: '/billing/subscription';
|
|
610
|
+
};
|
|
611
|
+
type BillingSubscriptionUpdateErrors = {
|
|
612
|
+
/**
|
|
613
|
+
* Error response
|
|
614
|
+
*/
|
|
615
|
+
default: ErrorResponse;
|
|
616
|
+
};
|
|
617
|
+
type BillingSubscriptionUpdateError = BillingSubscriptionUpdateErrors[keyof BillingSubscriptionUpdateErrors];
|
|
618
|
+
type BillingSubscriptionUpdateResponses = {
|
|
619
|
+
/**
|
|
620
|
+
* Response
|
|
621
|
+
*/
|
|
622
|
+
200: {
|
|
623
|
+
status: 'confirmation_required' | 'success' | 'payment_failed';
|
|
624
|
+
client_secret?: string;
|
|
625
|
+
failure_code?: string;
|
|
626
|
+
};
|
|
627
|
+
};
|
|
628
|
+
type BillingSubscriptionUpdateResponse = BillingSubscriptionUpdateResponses[keyof BillingSubscriptionUpdateResponses];
|
|
629
|
+
type BillingSubscriptionPreviewUpdateData = {
|
|
630
|
+
body?: {
|
|
631
|
+
plan: 'free' | 'starter' | 'pro' | 'premium' | 'business';
|
|
632
|
+
billing_period: 'month' | 'year';
|
|
633
|
+
};
|
|
634
|
+
path?: never;
|
|
635
|
+
query?: never;
|
|
636
|
+
url: '/billing/subscription/preview';
|
|
637
|
+
};
|
|
638
|
+
type BillingSubscriptionPreviewUpdateErrors = {
|
|
639
|
+
/**
|
|
640
|
+
* Error response
|
|
641
|
+
*/
|
|
642
|
+
default: ErrorResponse;
|
|
643
|
+
};
|
|
644
|
+
type BillingSubscriptionPreviewUpdateError = BillingSubscriptionPreviewUpdateErrors[keyof BillingSubscriptionPreviewUpdateErrors];
|
|
645
|
+
type BillingSubscriptionPreviewUpdateResponses = {
|
|
646
|
+
/**
|
|
647
|
+
* Response
|
|
648
|
+
*/
|
|
649
|
+
200: {
|
|
650
|
+
discount_percents: Array<number>;
|
|
651
|
+
total_excluding_tax: number;
|
|
652
|
+
total: number;
|
|
653
|
+
amount_due: number;
|
|
654
|
+
added_from_balance: number;
|
|
655
|
+
consumed_balance: number;
|
|
656
|
+
credited_to_balance: number;
|
|
657
|
+
lines: Array<{
|
|
658
|
+
amount: number;
|
|
659
|
+
billing_period: 'day' | 'week' | 'month' | 'year';
|
|
660
|
+
proration: boolean;
|
|
661
|
+
plan?: 'free' | 'starter' | 'pro' | 'premium' | 'business';
|
|
662
|
+
addon?: 'senders' | 'email_warmups';
|
|
663
|
+
}>;
|
|
664
|
+
next_renewal: number;
|
|
665
|
+
total_tax_amounts: Array<{
|
|
666
|
+
amount: number;
|
|
667
|
+
}>;
|
|
668
|
+
};
|
|
669
|
+
};
|
|
670
|
+
type BillingSubscriptionPreviewUpdateResponse = BillingSubscriptionPreviewUpdateResponses[keyof BillingSubscriptionPreviewUpdateResponses];
|
|
671
|
+
type BillingGetPricesData = {
|
|
672
|
+
body?: never;
|
|
673
|
+
path?: never;
|
|
674
|
+
query: {
|
|
675
|
+
currency: string;
|
|
676
|
+
};
|
|
677
|
+
url: '/billing/prices';
|
|
678
|
+
};
|
|
679
|
+
type BillingGetPricesErrors = {
|
|
680
|
+
/**
|
|
681
|
+
* Error response
|
|
682
|
+
*/
|
|
683
|
+
default: ErrorResponse;
|
|
684
|
+
};
|
|
685
|
+
type BillingGetPricesError = BillingGetPricesErrors[keyof BillingGetPricesErrors];
|
|
686
|
+
type BillingGetPricesResponses = {
|
|
687
|
+
/**
|
|
688
|
+
* Response
|
|
689
|
+
*/
|
|
690
|
+
200: {
|
|
691
|
+
free?: {
|
|
692
|
+
month: number;
|
|
693
|
+
year: number;
|
|
694
|
+
};
|
|
695
|
+
starter?: {
|
|
696
|
+
month: number;
|
|
697
|
+
year: number;
|
|
698
|
+
};
|
|
699
|
+
pro?: {
|
|
700
|
+
month: number;
|
|
701
|
+
year: number;
|
|
702
|
+
};
|
|
703
|
+
premium?: {
|
|
704
|
+
month: number;
|
|
705
|
+
year: number;
|
|
706
|
+
};
|
|
707
|
+
business?: {
|
|
708
|
+
month: number;
|
|
709
|
+
year: number;
|
|
710
|
+
};
|
|
711
|
+
};
|
|
712
|
+
};
|
|
713
|
+
type BillingGetPricesResponse = BillingGetPricesResponses[keyof BillingGetPricesResponses];
|
|
714
|
+
type GetOpenapiJsonData = {
|
|
715
|
+
body?: never;
|
|
716
|
+
path?: never;
|
|
717
|
+
query?: never;
|
|
718
|
+
url: '/openapi.json';
|
|
719
|
+
};
|
|
720
|
+
type GetOpenapiJsonErrors = {
|
|
721
|
+
/**
|
|
722
|
+
* Error response
|
|
723
|
+
*/
|
|
724
|
+
default: ErrorResponse;
|
|
725
|
+
};
|
|
726
|
+
type GetOpenapiJsonError = GetOpenapiJsonErrors[keyof GetOpenapiJsonErrors];
|
|
727
|
+
type GetOpenapiJsonResponses = {
|
|
728
|
+
/**
|
|
729
|
+
* Response
|
|
730
|
+
*/
|
|
731
|
+
200: unknown;
|
|
732
|
+
};
|
|
733
|
+
|
|
734
|
+
type types_gen_d_AddonBody = AddonBody;
|
|
735
|
+
type types_gen_d_AddonParams = AddonParams;
|
|
736
|
+
type types_gen_d_AddonResponse200 = AddonResponse200;
|
|
737
|
+
type types_gen_d_AddonsResponse200 = AddonsResponse200;
|
|
738
|
+
type types_gen_d_BillingAddonsGetAddonUsagesData = BillingAddonsGetAddonUsagesData;
|
|
739
|
+
type types_gen_d_BillingAddonsGetAddonUsagesError = BillingAddonsGetAddonUsagesError;
|
|
740
|
+
type types_gen_d_BillingAddonsGetAddonUsagesErrors = BillingAddonsGetAddonUsagesErrors;
|
|
741
|
+
type types_gen_d_BillingAddonsGetAddonUsagesResponse = BillingAddonsGetAddonUsagesResponse;
|
|
742
|
+
type types_gen_d_BillingAddonsGetAddonUsagesResponses = BillingAddonsGetAddonUsagesResponses;
|
|
743
|
+
type types_gen_d_BillingAddonsGetAddonsData = BillingAddonsGetAddonsData;
|
|
744
|
+
type types_gen_d_BillingAddonsGetAddonsError = BillingAddonsGetAddonsError;
|
|
745
|
+
type types_gen_d_BillingAddonsGetAddonsErrors = BillingAddonsGetAddonsErrors;
|
|
746
|
+
type types_gen_d_BillingAddonsGetAddonsResponse = BillingAddonsGetAddonsResponse;
|
|
747
|
+
type types_gen_d_BillingAddonsGetAddonsResponses = BillingAddonsGetAddonsResponses;
|
|
748
|
+
type types_gen_d_BillingAddonsPreviewUpdateData = BillingAddonsPreviewUpdateData;
|
|
749
|
+
type types_gen_d_BillingAddonsPreviewUpdateError = BillingAddonsPreviewUpdateError;
|
|
750
|
+
type types_gen_d_BillingAddonsPreviewUpdateErrors = BillingAddonsPreviewUpdateErrors;
|
|
751
|
+
type types_gen_d_BillingAddonsPreviewUpdateResponse = BillingAddonsPreviewUpdateResponse;
|
|
752
|
+
type types_gen_d_BillingAddonsPreviewUpdateResponses = BillingAddonsPreviewUpdateResponses;
|
|
753
|
+
type types_gen_d_BillingAddonsUpdateData = BillingAddonsUpdateData;
|
|
754
|
+
type types_gen_d_BillingAddonsUpdateError = BillingAddonsUpdateError;
|
|
755
|
+
type types_gen_d_BillingAddonsUpdateErrors = BillingAddonsUpdateErrors;
|
|
756
|
+
type types_gen_d_BillingAddonsUpdateResponse = BillingAddonsUpdateResponse;
|
|
757
|
+
type types_gen_d_BillingAddonsUpdateResponses = BillingAddonsUpdateResponses;
|
|
758
|
+
type types_gen_d_BillingGetPricesData = BillingGetPricesData;
|
|
759
|
+
type types_gen_d_BillingGetPricesError = BillingGetPricesError;
|
|
760
|
+
type types_gen_d_BillingGetPricesErrors = BillingGetPricesErrors;
|
|
761
|
+
type types_gen_d_BillingGetPricesResponse = BillingGetPricesResponse;
|
|
762
|
+
type types_gen_d_BillingGetPricesResponses = BillingGetPricesResponses;
|
|
763
|
+
type types_gen_d_BillingSubscriptionGetData = BillingSubscriptionGetData;
|
|
764
|
+
type types_gen_d_BillingSubscriptionGetError = BillingSubscriptionGetError;
|
|
765
|
+
type types_gen_d_BillingSubscriptionGetErrors = BillingSubscriptionGetErrors;
|
|
766
|
+
type types_gen_d_BillingSubscriptionGetResponse = BillingSubscriptionGetResponse;
|
|
767
|
+
type types_gen_d_BillingSubscriptionGetResponses = BillingSubscriptionGetResponses;
|
|
768
|
+
type types_gen_d_BillingSubscriptionPreviewUpdateData = BillingSubscriptionPreviewUpdateData;
|
|
769
|
+
type types_gen_d_BillingSubscriptionPreviewUpdateError = BillingSubscriptionPreviewUpdateError;
|
|
770
|
+
type types_gen_d_BillingSubscriptionPreviewUpdateErrors = BillingSubscriptionPreviewUpdateErrors;
|
|
771
|
+
type types_gen_d_BillingSubscriptionPreviewUpdateResponse = BillingSubscriptionPreviewUpdateResponse;
|
|
772
|
+
type types_gen_d_BillingSubscriptionPreviewUpdateResponses = BillingSubscriptionPreviewUpdateResponses;
|
|
773
|
+
type types_gen_d_BillingSubscriptionUpdateData = BillingSubscriptionUpdateData;
|
|
774
|
+
type types_gen_d_BillingSubscriptionUpdateError = BillingSubscriptionUpdateError;
|
|
775
|
+
type types_gen_d_BillingSubscriptionUpdateErrors = BillingSubscriptionUpdateErrors;
|
|
776
|
+
type types_gen_d_BillingSubscriptionUpdateResponse = BillingSubscriptionUpdateResponse;
|
|
777
|
+
type types_gen_d_BillingSubscriptionUpdateResponses = BillingSubscriptionUpdateResponses;
|
|
778
|
+
type types_gen_d_ClientOptions = ClientOptions;
|
|
779
|
+
type types_gen_d_ErrorResponse = ErrorResponse;
|
|
780
|
+
type types_gen_d_GetOpenapiJsonData = GetOpenapiJsonData;
|
|
781
|
+
type types_gen_d_GetOpenapiJsonError = GetOpenapiJsonError;
|
|
782
|
+
type types_gen_d_GetOpenapiJsonErrors = GetOpenapiJsonErrors;
|
|
783
|
+
type types_gen_d_GetOpenapiJsonResponses = GetOpenapiJsonResponses;
|
|
784
|
+
type types_gen_d_OpenapiJsonResponse200 = OpenapiJsonResponse200;
|
|
785
|
+
type types_gen_d_PreviewBody = PreviewBody;
|
|
786
|
+
type types_gen_d_PreviewParams = PreviewParams;
|
|
787
|
+
type types_gen_d_PreviewResponse200 = PreviewResponse200;
|
|
788
|
+
type types_gen_d_PricesQuery = PricesQuery;
|
|
789
|
+
type types_gen_d_PricesResponse200 = PricesResponse200;
|
|
790
|
+
type types_gen_d_SubscriptionBody = SubscriptionBody;
|
|
791
|
+
type types_gen_d_SubscriptionResponse200 = SubscriptionResponse200;
|
|
792
|
+
declare namespace types_gen_d {
|
|
793
|
+
export type { types_gen_d_AddonBody as AddonBody, types_gen_d_AddonParams as AddonParams, types_gen_d_AddonResponse200 as AddonResponse200, types_gen_d_AddonsResponse200 as AddonsResponse200, types_gen_d_BillingAddonsGetAddonUsagesData as BillingAddonsGetAddonUsagesData, types_gen_d_BillingAddonsGetAddonUsagesError as BillingAddonsGetAddonUsagesError, types_gen_d_BillingAddonsGetAddonUsagesErrors as BillingAddonsGetAddonUsagesErrors, types_gen_d_BillingAddonsGetAddonUsagesResponse as BillingAddonsGetAddonUsagesResponse, types_gen_d_BillingAddonsGetAddonUsagesResponses as BillingAddonsGetAddonUsagesResponses, types_gen_d_BillingAddonsGetAddonsData as BillingAddonsGetAddonsData, types_gen_d_BillingAddonsGetAddonsError as BillingAddonsGetAddonsError, types_gen_d_BillingAddonsGetAddonsErrors as BillingAddonsGetAddonsErrors, types_gen_d_BillingAddonsGetAddonsResponse as BillingAddonsGetAddonsResponse, types_gen_d_BillingAddonsGetAddonsResponses as BillingAddonsGetAddonsResponses, types_gen_d_BillingAddonsPreviewUpdateData as BillingAddonsPreviewUpdateData, types_gen_d_BillingAddonsPreviewUpdateError as BillingAddonsPreviewUpdateError, types_gen_d_BillingAddonsPreviewUpdateErrors as BillingAddonsPreviewUpdateErrors, types_gen_d_BillingAddonsPreviewUpdateResponse as BillingAddonsPreviewUpdateResponse, types_gen_d_BillingAddonsPreviewUpdateResponses as BillingAddonsPreviewUpdateResponses, types_gen_d_BillingAddonsUpdateData as BillingAddonsUpdateData, types_gen_d_BillingAddonsUpdateError as BillingAddonsUpdateError, types_gen_d_BillingAddonsUpdateErrors as BillingAddonsUpdateErrors, types_gen_d_BillingAddonsUpdateResponse as BillingAddonsUpdateResponse, types_gen_d_BillingAddonsUpdateResponses as BillingAddonsUpdateResponses, types_gen_d_BillingGetPricesData as BillingGetPricesData, types_gen_d_BillingGetPricesError as BillingGetPricesError, types_gen_d_BillingGetPricesErrors as BillingGetPricesErrors, types_gen_d_BillingGetPricesResponse as BillingGetPricesResponse, types_gen_d_BillingGetPricesResponses as BillingGetPricesResponses, types_gen_d_BillingSubscriptionGetData as BillingSubscriptionGetData, types_gen_d_BillingSubscriptionGetError as BillingSubscriptionGetError, types_gen_d_BillingSubscriptionGetErrors as BillingSubscriptionGetErrors, types_gen_d_BillingSubscriptionGetResponse as BillingSubscriptionGetResponse, types_gen_d_BillingSubscriptionGetResponses as BillingSubscriptionGetResponses, types_gen_d_BillingSubscriptionPreviewUpdateData as BillingSubscriptionPreviewUpdateData, types_gen_d_BillingSubscriptionPreviewUpdateError as BillingSubscriptionPreviewUpdateError, types_gen_d_BillingSubscriptionPreviewUpdateErrors as BillingSubscriptionPreviewUpdateErrors, types_gen_d_BillingSubscriptionPreviewUpdateResponse as BillingSubscriptionPreviewUpdateResponse, types_gen_d_BillingSubscriptionPreviewUpdateResponses as BillingSubscriptionPreviewUpdateResponses, types_gen_d_BillingSubscriptionUpdateData as BillingSubscriptionUpdateData, types_gen_d_BillingSubscriptionUpdateError as BillingSubscriptionUpdateError, types_gen_d_BillingSubscriptionUpdateErrors as BillingSubscriptionUpdateErrors, types_gen_d_BillingSubscriptionUpdateResponse as BillingSubscriptionUpdateResponse, types_gen_d_BillingSubscriptionUpdateResponses as BillingSubscriptionUpdateResponses, types_gen_d_ClientOptions as ClientOptions, types_gen_d_ErrorResponse as ErrorResponse, types_gen_d_GetOpenapiJsonData as GetOpenapiJsonData, types_gen_d_GetOpenapiJsonError as GetOpenapiJsonError, types_gen_d_GetOpenapiJsonErrors as GetOpenapiJsonErrors, types_gen_d_GetOpenapiJsonResponses as GetOpenapiJsonResponses, types_gen_d_OpenapiJsonResponse200 as OpenapiJsonResponse200, types_gen_d_PreviewBody as PreviewBody, types_gen_d_PreviewParams as PreviewParams, types_gen_d_PreviewResponse200 as PreviewResponse200, types_gen_d_PricesQuery as PricesQuery, types_gen_d_PricesResponse200 as PricesResponse200, types_gen_d_SubscriptionBody as SubscriptionBody, types_gen_d_SubscriptionResponse200 as SubscriptionResponse200 };
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = Options$1<TData, ThrowOnError> & {
|
|
797
|
+
/**
|
|
798
|
+
* You can provide a client instance returned by `createClient()` instead of
|
|
799
|
+
* individual options. This might be also useful if you want to implement a
|
|
800
|
+
* custom client.
|
|
801
|
+
*/
|
|
802
|
+
client?: Client;
|
|
803
|
+
/**
|
|
804
|
+
* You can pass arbitrary values through the `meta` object. This can be
|
|
805
|
+
* used to access values that aren't defined as part of the SDK function.
|
|
806
|
+
*/
|
|
807
|
+
meta?: Record<string, unknown>;
|
|
808
|
+
};
|
|
809
|
+
declare class HeyApiClient {
|
|
810
|
+
protected client: Client;
|
|
811
|
+
constructor(args?: {
|
|
812
|
+
client?: Client;
|
|
813
|
+
});
|
|
814
|
+
}
|
|
815
|
+
declare class BillingAddons extends HeyApiClient {
|
|
816
|
+
getAddons<ThrowOnError extends boolean = false>(options?: Options<never, ThrowOnError>): RequestResult<BillingAddonsGetAddonsResponses, BillingAddonsGetAddonsErrors, ThrowOnError, "data">;
|
|
817
|
+
previewUpdate<ThrowOnError extends boolean = false>(parameters: {
|
|
818
|
+
addon: 'senders' | 'email_warmups';
|
|
819
|
+
quantity?: number;
|
|
820
|
+
}, options?: Options<never, ThrowOnError>): RequestResult<BillingAddonsPreviewUpdateResponses, BillingAddonsPreviewUpdateErrors, ThrowOnError, "data">;
|
|
821
|
+
getAddonUsages<ThrowOnError extends boolean = false>(parameters: {
|
|
822
|
+
addon: 'senders' | 'email_warmups';
|
|
823
|
+
}, options?: Options<never, ThrowOnError>): RequestResult<BillingAddonsGetAddonUsagesResponses, BillingAddonsGetAddonUsagesErrors, ThrowOnError, "data">;
|
|
824
|
+
update<ThrowOnError extends boolean = false>(parameters: {
|
|
825
|
+
addon: 'senders' | 'email_warmups';
|
|
826
|
+
quantity?: number;
|
|
827
|
+
}, options?: Options<never, ThrowOnError>): RequestResult<BillingAddonsUpdateResponses, BillingAddonsUpdateErrors, ThrowOnError, "data">;
|
|
828
|
+
}
|
|
829
|
+
declare class BillingSubscription extends HeyApiClient {
|
|
830
|
+
get<ThrowOnError extends boolean = false>(options?: Options<never, ThrowOnError>): RequestResult<BillingSubscriptionGetResponses, BillingSubscriptionGetErrors, ThrowOnError, "data">;
|
|
831
|
+
update<ThrowOnError extends boolean = false>(parameters?: {
|
|
832
|
+
plan?: 'free' | 'starter' | 'pro' | 'premium' | 'business';
|
|
833
|
+
billing_period?: 'month' | 'year';
|
|
834
|
+
}, options?: Options<never, ThrowOnError>): RequestResult<BillingSubscriptionUpdateResponses, BillingSubscriptionUpdateErrors, ThrowOnError, "data">;
|
|
835
|
+
previewUpdate<ThrowOnError extends boolean = false>(parameters?: {
|
|
836
|
+
plan?: 'free' | 'starter' | 'pro' | 'premium' | 'business';
|
|
837
|
+
billing_period?: 'month' | 'year';
|
|
838
|
+
}, options?: Options<never, ThrowOnError>): RequestResult<BillingSubscriptionPreviewUpdateResponses, BillingSubscriptionPreviewUpdateErrors, ThrowOnError, "data">;
|
|
839
|
+
}
|
|
840
|
+
declare class Billing extends HeyApiClient {
|
|
841
|
+
getPrices<ThrowOnError extends boolean = false>(parameters: {
|
|
842
|
+
currency: string;
|
|
843
|
+
}, options?: Options<never, ThrowOnError>): RequestResult<BillingGetPricesResponses, BillingGetPricesErrors, ThrowOnError, "data">;
|
|
844
|
+
}
|
|
845
|
+
|
|
846
|
+
interface MailmeteorConfig {
|
|
847
|
+
/**
|
|
848
|
+
* API key for authentication
|
|
849
|
+
*/
|
|
850
|
+
key: string;
|
|
851
|
+
/**
|
|
852
|
+
* Base URL for the API (optional)
|
|
853
|
+
* Defaults to the value from API_BASE_URL environment variable or https://api.mailmeteor.com/v1
|
|
854
|
+
*/
|
|
855
|
+
baseUrl?: string;
|
|
856
|
+
}
|
|
857
|
+
/**
|
|
858
|
+
* Main Mailmeteor SDK class
|
|
859
|
+
*/
|
|
860
|
+
declare class MailmeteorSDK {
|
|
861
|
+
private client;
|
|
862
|
+
readonly billingAddons: BillingAddons;
|
|
863
|
+
readonly billingSubscription: BillingSubscription;
|
|
864
|
+
readonly billing: Billing;
|
|
865
|
+
constructor(config: MailmeteorConfig);
|
|
866
|
+
/**
|
|
867
|
+
* Update the API key for authentication
|
|
868
|
+
*/
|
|
869
|
+
setApiKey(key: string): void;
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
export { MailmeteorSDK, types_gen_d as MailmeteorTypes };
|
|
873
|
+
export type { MailmeteorConfig };
|