@primitivedotdev/sdk 0.6.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +114 -210
- package/dist/address-parser-CfPHs3mE.js +113 -0
- package/dist/api/generated/index.js +1 -1
- package/dist/api/generated/sdk.gen.js +17 -0
- package/dist/api/index.d.ts +4 -1877
- package/dist/api/index.js +255 -0
- package/dist/api-BH8PnmHs.js +1338 -0
- package/dist/contract/index.d.ts +3 -2
- package/dist/contract/index.js +3 -1
- package/dist/{index-DLmAI4UQ.d.ts → index-CuuP1JkG.d.ts} +9 -2
- package/dist/index-D9lanVFt.d.ts +2145 -0
- package/dist/index.d.ts +12 -3
- package/dist/index.js +13 -2
- package/dist/openapi/openapi.generated.js +413 -1
- package/dist/openapi/operations.generated.js +16 -0
- package/dist/parser/address-parser.js +129 -0
- package/dist/parser/index.d.ts +105 -3
- package/dist/parser/index.js +2 -1
- package/dist/received-email-C67Z7Dha.d.ts +36 -0
- package/dist/received-email-Q6Cha3wc.js +71 -0
- package/dist/types.generated.js +7 -0
- package/dist/types.js +53 -0
- package/dist/webhook/index.d.ts +4 -3
- package/dist/webhook/index.js +4 -2
- package/dist/webhook/received-email.js +82 -0
- package/dist/{webhook-COe5N_Uj.js → webhook-2TALcBQz.js} +16 -1
- package/oclif.manifest.json +47 -1
- package/package.json +10 -3
- /package/dist/{types-CKFmgitP.d.ts → types-CIOzt1FY.d.ts} +0 -0
|
@@ -0,0 +1,2145 @@
|
|
|
1
|
+
import { __export } from "./chunk-Cl8Af3a2.js";
|
|
2
|
+
import { ReceivedEmail } from "./received-email-C67Z7Dha.js";
|
|
3
|
+
|
|
4
|
+
//#region src/api/generated/core/auth.gen.d.ts
|
|
5
|
+
type AuthToken = string | undefined;
|
|
6
|
+
interface Auth {
|
|
7
|
+
/**
|
|
8
|
+
* Which part of the request do we use to send the auth?
|
|
9
|
+
*
|
|
10
|
+
* @default 'header'
|
|
11
|
+
*/
|
|
12
|
+
in?: 'header' | 'query' | 'cookie';
|
|
13
|
+
/**
|
|
14
|
+
* Header or query parameter name.
|
|
15
|
+
*
|
|
16
|
+
* @default 'Authorization'
|
|
17
|
+
*/
|
|
18
|
+
name?: string;
|
|
19
|
+
scheme?: 'basic' | 'bearer';
|
|
20
|
+
type: 'apiKey' | 'http';
|
|
21
|
+
} //#endregion
|
|
22
|
+
//#region src/api/generated/core/pathSerializer.gen.d.ts
|
|
23
|
+
interface SerializerOptions<T> {
|
|
24
|
+
/**
|
|
25
|
+
* @default true
|
|
26
|
+
*/
|
|
27
|
+
explode: boolean;
|
|
28
|
+
style: T;
|
|
29
|
+
}
|
|
30
|
+
type ArrayStyle = 'form' | 'spaceDelimited' | 'pipeDelimited';
|
|
31
|
+
type ObjectStyle = 'form' | 'deepObject'; //#endregion
|
|
32
|
+
//#region src/api/generated/core/bodySerializer.gen.d.ts
|
|
33
|
+
type QuerySerializer = (query: Record<string, unknown>) => string;
|
|
34
|
+
type BodySerializer = (body: unknown) => unknown;
|
|
35
|
+
type QuerySerializerOptionsObject = {
|
|
36
|
+
allowReserved?: boolean;
|
|
37
|
+
array?: Partial<SerializerOptions<ArrayStyle>>;
|
|
38
|
+
object?: Partial<SerializerOptions<ObjectStyle>>;
|
|
39
|
+
};
|
|
40
|
+
type QuerySerializerOptions = QuerySerializerOptionsObject & {
|
|
41
|
+
/**
|
|
42
|
+
* Per-parameter serialization overrides. When provided, these settings
|
|
43
|
+
* override the global array/object settings for specific parameter names.
|
|
44
|
+
*/
|
|
45
|
+
parameters?: Record<string, QuerySerializerOptionsObject>;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
//#endregion
|
|
49
|
+
//#region src/api/generated/core/types.gen.d.ts
|
|
50
|
+
type HttpMethod = 'connect' | 'delete' | 'get' | 'head' | 'options' | 'patch' | 'post' | 'put' | 'trace';
|
|
51
|
+
type Client$1<RequestFn = never, Config = unknown, MethodFn = never, BuildUrlFn = never, SseFn = never> = {
|
|
52
|
+
/**
|
|
53
|
+
* Returns the final request URL.
|
|
54
|
+
*/
|
|
55
|
+
buildUrl: BuildUrlFn;
|
|
56
|
+
getConfig: () => Config$1;
|
|
57
|
+
request: RequestFn;
|
|
58
|
+
setConfig: (config: Config$1) => Config$1;
|
|
59
|
+
} & { [K in HttpMethod]: MethodFn } & ([SseFn] extends [never] ? {
|
|
60
|
+
sse?: never;
|
|
61
|
+
} : {
|
|
62
|
+
sse: { [K in HttpMethod]: SseFn };
|
|
63
|
+
});
|
|
64
|
+
interface Config$1 {
|
|
65
|
+
/**
|
|
66
|
+
* Auth token or a function returning auth token. The resolved value will be
|
|
67
|
+
* added to the request payload as defined by its `security` array.
|
|
68
|
+
*/
|
|
69
|
+
auth?: ((auth: Auth) => Promise<AuthToken> | AuthToken) | AuthToken;
|
|
70
|
+
/**
|
|
71
|
+
* A function for serializing request body parameter. By default,
|
|
72
|
+
* {@link JSON.stringify()} will be used.
|
|
73
|
+
*/
|
|
74
|
+
bodySerializer?: BodySerializer | null;
|
|
75
|
+
/**
|
|
76
|
+
* An object containing any HTTP headers that you want to pre-populate your
|
|
77
|
+
* `Headers` object with.
|
|
78
|
+
*
|
|
79
|
+
* {@link https://developer.mozilla.org/docs/Web/API/Headers/Headers#init See more}
|
|
80
|
+
*/
|
|
81
|
+
headers?: RequestInit['headers'] | Record<string, string | number | boolean | (string | number | boolean)[] | null | undefined | unknown>;
|
|
82
|
+
/**
|
|
83
|
+
* The request method.
|
|
84
|
+
*
|
|
85
|
+
* {@link https://developer.mozilla.org/docs/Web/API/fetch#method See more}
|
|
86
|
+
*/
|
|
87
|
+
method?: Uppercase<HttpMethod>;
|
|
88
|
+
/**
|
|
89
|
+
* A function for serializing request query parameters. By default, arrays
|
|
90
|
+
* will be exploded in form style, objects will be exploded in deepObject
|
|
91
|
+
* style, and reserved characters are percent-encoded.
|
|
92
|
+
*
|
|
93
|
+
* This method will have no effect if the native `paramsSerializer()` Axios
|
|
94
|
+
* API function is used.
|
|
95
|
+
*
|
|
96
|
+
* {@link https://swagger.io/docs/specification/serialization/#query View examples}
|
|
97
|
+
*/
|
|
98
|
+
querySerializer?: QuerySerializer | QuerySerializerOptions;
|
|
99
|
+
/**
|
|
100
|
+
* A function validating request data. This is useful if you want to ensure
|
|
101
|
+
* the request conforms to the desired shape, so it can be safely sent to
|
|
102
|
+
* the server.
|
|
103
|
+
*/
|
|
104
|
+
requestValidator?: (data: unknown) => Promise<unknown>;
|
|
105
|
+
/**
|
|
106
|
+
* A function transforming response data before it's returned. This is useful
|
|
107
|
+
* for post-processing data, e.g., converting ISO strings into Date objects.
|
|
108
|
+
*/
|
|
109
|
+
responseTransformer?: (data: unknown) => Promise<unknown>;
|
|
110
|
+
/**
|
|
111
|
+
* A function validating response data. This is useful if you want to ensure
|
|
112
|
+
* the response conforms to the desired shape, so it can be safely passed to
|
|
113
|
+
* the transformers and returned to the user.
|
|
114
|
+
*/
|
|
115
|
+
responseValidator?: (data: unknown) => Promise<unknown>;
|
|
116
|
+
} //#endregion
|
|
117
|
+
//#region src/api/generated/core/serverSentEvents.gen.d.ts
|
|
118
|
+
type ServerSentEventsOptions<TData = unknown> = Omit<RequestInit, 'method'> & Pick<Config$1, 'method' | 'responseTransformer' | 'responseValidator'> & {
|
|
119
|
+
/**
|
|
120
|
+
* Fetch API implementation. You can use this option to provide a custom
|
|
121
|
+
* fetch instance.
|
|
122
|
+
*
|
|
123
|
+
* @default globalThis.fetch
|
|
124
|
+
*/
|
|
125
|
+
fetch?: typeof fetch;
|
|
126
|
+
/**
|
|
127
|
+
* Implementing clients can call request interceptors inside this hook.
|
|
128
|
+
*/
|
|
129
|
+
onRequest?: (url: string, init: RequestInit) => Promise<Request>;
|
|
130
|
+
/**
|
|
131
|
+
* Callback invoked when a network or parsing error occurs during streaming.
|
|
132
|
+
*
|
|
133
|
+
* This option applies only if the endpoint returns a stream of events.
|
|
134
|
+
*
|
|
135
|
+
* @param error The error that occurred.
|
|
136
|
+
*/
|
|
137
|
+
onSseError?: (error: unknown) => void;
|
|
138
|
+
/**
|
|
139
|
+
* Callback invoked when an event is streamed from the server.
|
|
140
|
+
*
|
|
141
|
+
* This option applies only if the endpoint returns a stream of events.
|
|
142
|
+
*
|
|
143
|
+
* @param event Event streamed from the server.
|
|
144
|
+
* @returns Nothing (void).
|
|
145
|
+
*/
|
|
146
|
+
onSseEvent?: (event: StreamEvent<TData>) => void;
|
|
147
|
+
serializedBody?: RequestInit['body'];
|
|
148
|
+
/**
|
|
149
|
+
* Default retry delay in milliseconds.
|
|
150
|
+
*
|
|
151
|
+
* This option applies only if the endpoint returns a stream of events.
|
|
152
|
+
*
|
|
153
|
+
* @default 3000
|
|
154
|
+
*/
|
|
155
|
+
sseDefaultRetryDelay?: number;
|
|
156
|
+
/**
|
|
157
|
+
* Maximum number of retry attempts before giving up.
|
|
158
|
+
*/
|
|
159
|
+
sseMaxRetryAttempts?: number;
|
|
160
|
+
/**
|
|
161
|
+
* Maximum retry delay in milliseconds.
|
|
162
|
+
*
|
|
163
|
+
* Applies only when exponential backoff is used.
|
|
164
|
+
*
|
|
165
|
+
* This option applies only if the endpoint returns a stream of events.
|
|
166
|
+
*
|
|
167
|
+
* @default 30000
|
|
168
|
+
*/
|
|
169
|
+
sseMaxRetryDelay?: number;
|
|
170
|
+
/**
|
|
171
|
+
* Optional sleep function for retry backoff.
|
|
172
|
+
*
|
|
173
|
+
* Defaults to using `setTimeout`.
|
|
174
|
+
*/
|
|
175
|
+
sseSleepFn?: (ms: number) => Promise<void>;
|
|
176
|
+
url: string;
|
|
177
|
+
};
|
|
178
|
+
interface StreamEvent<TData = unknown> {
|
|
179
|
+
data: TData;
|
|
180
|
+
event?: string;
|
|
181
|
+
id?: string;
|
|
182
|
+
retry?: number;
|
|
183
|
+
}
|
|
184
|
+
type ServerSentEventsResult<TData = unknown, TReturn = void, TNext = unknown> = {
|
|
185
|
+
stream: AsyncGenerator<TData extends Record<string, unknown> ? TData[keyof TData] : TData, TReturn, TNext>;
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
//#endregion
|
|
189
|
+
//#region src/api/generated/client/utils.gen.d.ts
|
|
190
|
+
type ErrInterceptor<Err, Res, Req, Options> = (error: Err, response: Res, request: Req, options: Options) => Err | Promise<Err>;
|
|
191
|
+
type ReqInterceptor<Req, Options> = (request: Req, options: Options) => Req | Promise<Req>;
|
|
192
|
+
type ResInterceptor<Res, Req, Options> = (response: Res, request: Req, options: Options) => Res | Promise<Res>;
|
|
193
|
+
declare class Interceptors<Interceptor> {
|
|
194
|
+
fns: Array<Interceptor | null>;
|
|
195
|
+
clear(): void;
|
|
196
|
+
eject(id: number | Interceptor): void;
|
|
197
|
+
exists(id: number | Interceptor): boolean;
|
|
198
|
+
getInterceptorIndex(id: number | Interceptor): number;
|
|
199
|
+
update(id: number | Interceptor, fn: Interceptor): number | Interceptor | false;
|
|
200
|
+
use(fn: Interceptor): number;
|
|
201
|
+
}
|
|
202
|
+
interface Middleware<Req, Res, Err, Options> {
|
|
203
|
+
error: Interceptors<ErrInterceptor<Err, Res, Req, Options>>;
|
|
204
|
+
request: Interceptors<ReqInterceptor<Req, Options>>;
|
|
205
|
+
response: Interceptors<ResInterceptor<Res, Req, Options>>;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
//#endregion
|
|
209
|
+
//#region src/api/generated/client/types.gen.d.ts
|
|
210
|
+
type ResponseStyle = 'data' | 'fields';
|
|
211
|
+
interface Config<T extends ClientOptions$1 = ClientOptions$1> extends Omit<RequestInit, 'body' | 'headers' | 'method'>, Config$1 {
|
|
212
|
+
/**
|
|
213
|
+
* Base URL for all requests made by this client.
|
|
214
|
+
*/
|
|
215
|
+
baseUrl?: T['baseUrl'];
|
|
216
|
+
/**
|
|
217
|
+
* Fetch API implementation. You can use this option to provide a custom
|
|
218
|
+
* fetch instance.
|
|
219
|
+
*
|
|
220
|
+
* @default globalThis.fetch
|
|
221
|
+
*/
|
|
222
|
+
fetch?: typeof fetch;
|
|
223
|
+
/**
|
|
224
|
+
* Please don't use the Fetch client for Next.js applications. The `next`
|
|
225
|
+
* options won't have any effect.
|
|
226
|
+
*
|
|
227
|
+
* Install {@link https://www.npmjs.com/package/@hey-api/client-next `@hey-api/client-next`} instead.
|
|
228
|
+
*/
|
|
229
|
+
next?: never;
|
|
230
|
+
/**
|
|
231
|
+
* Return the response data parsed in a specified format. By default, `auto`
|
|
232
|
+
* will infer the appropriate method from the `Content-Type` response header.
|
|
233
|
+
* You can override this behavior with any of the {@link Body} methods.
|
|
234
|
+
* Select `stream` if you don't want to parse response data at all.
|
|
235
|
+
*
|
|
236
|
+
* @default 'auto'
|
|
237
|
+
*/
|
|
238
|
+
parseAs?: 'arrayBuffer' | 'auto' | 'blob' | 'formData' | 'json' | 'stream' | 'text';
|
|
239
|
+
/**
|
|
240
|
+
* Should we return only data or multiple fields (data, error, response, etc.)?
|
|
241
|
+
*
|
|
242
|
+
* @default 'fields'
|
|
243
|
+
*/
|
|
244
|
+
responseStyle?: ResponseStyle;
|
|
245
|
+
/**
|
|
246
|
+
* Throw an error instead of returning it in the response?
|
|
247
|
+
*
|
|
248
|
+
* @default false
|
|
249
|
+
*/
|
|
250
|
+
throwOnError?: T['throwOnError'];
|
|
251
|
+
}
|
|
252
|
+
interface RequestOptions<TData = unknown, TResponseStyle extends ResponseStyle = 'fields', ThrowOnError extends boolean = boolean, Url extends string = string> extends Config<{
|
|
253
|
+
responseStyle: TResponseStyle;
|
|
254
|
+
throwOnError: ThrowOnError;
|
|
255
|
+
}>, Pick<ServerSentEventsOptions<TData>, 'onRequest' | 'onSseError' | 'onSseEvent' | 'sseDefaultRetryDelay' | 'sseMaxRetryAttempts' | 'sseMaxRetryDelay'> {
|
|
256
|
+
/**
|
|
257
|
+
* Any body that you want to add to your request.
|
|
258
|
+
*
|
|
259
|
+
* {@link https://developer.mozilla.org/docs/Web/API/fetch#body}
|
|
260
|
+
*/
|
|
261
|
+
body?: unknown;
|
|
262
|
+
path?: Record<string, unknown>;
|
|
263
|
+
query?: Record<string, unknown>;
|
|
264
|
+
/**
|
|
265
|
+
* Security mechanism(s) to use for the request.
|
|
266
|
+
*/
|
|
267
|
+
security?: ReadonlyArray<Auth>;
|
|
268
|
+
url: Url;
|
|
269
|
+
}
|
|
270
|
+
interface ResolvedRequestOptions<TResponseStyle extends ResponseStyle = 'fields', ThrowOnError extends boolean = boolean, Url extends string = string> extends RequestOptions<unknown, TResponseStyle, ThrowOnError, Url> {
|
|
271
|
+
serializedBody?: string;
|
|
272
|
+
}
|
|
273
|
+
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 : {
|
|
274
|
+
data: TData extends Record<string, unknown> ? TData[keyof TData] : TData;
|
|
275
|
+
request: Request;
|
|
276
|
+
response: Response;
|
|
277
|
+
}> : Promise<TResponseStyle extends 'data' ? (TData extends Record<string, unknown> ? TData[keyof TData] : TData) | undefined : ({
|
|
278
|
+
data: TData extends Record<string, unknown> ? TData[keyof TData] : TData;
|
|
279
|
+
error: undefined;
|
|
280
|
+
} | {
|
|
281
|
+
data: undefined;
|
|
282
|
+
error: TError extends Record<string, unknown> ? TError[keyof TError] : TError;
|
|
283
|
+
}) & {
|
|
284
|
+
request: Request;
|
|
285
|
+
response: Response;
|
|
286
|
+
}>;
|
|
287
|
+
interface ClientOptions$1 {
|
|
288
|
+
baseUrl?: string;
|
|
289
|
+
responseStyle?: ResponseStyle;
|
|
290
|
+
throwOnError?: boolean;
|
|
291
|
+
}
|
|
292
|
+
type MethodFn$1 = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = 'fields'>(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, 'method'>) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
|
|
293
|
+
type SseFn$1 = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = 'fields'>(options: Omit<RequestOptions<never, TResponseStyle, ThrowOnError>, 'method'>) => Promise<ServerSentEventsResult<TData, TError>>;
|
|
294
|
+
type RequestFn$1 = <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>;
|
|
295
|
+
type BuildUrlFn$1 = <TData extends {
|
|
296
|
+
body?: unknown;
|
|
297
|
+
path?: Record<string, unknown>;
|
|
298
|
+
query?: Record<string, unknown>;
|
|
299
|
+
url: string;
|
|
300
|
+
}>(options: TData & Options$2<TData>) => string;
|
|
301
|
+
type Client = Client$1<RequestFn$1, Config, MethodFn$1, BuildUrlFn$1, SseFn$1> & {
|
|
302
|
+
interceptors: Middleware<Request, Response, unknown, ResolvedRequestOptions>;
|
|
303
|
+
};
|
|
304
|
+
/**
|
|
305
|
+
* The `createClientConfig()` function will be called on client initialization
|
|
306
|
+
* and the returned object will become the client's initial configuration.
|
|
307
|
+
*
|
|
308
|
+
* You may want to initialize your client this way instead of calling
|
|
309
|
+
* `setConfig()`. This is useful for example if you're using Next.js
|
|
310
|
+
* to ensure your client always has the correct values.
|
|
311
|
+
*/
|
|
312
|
+
type CreateClientConfig<T extends ClientOptions$1 = ClientOptions$1> = (override?: Config<ClientOptions$1 & T>) => Config<Required<ClientOptions$1> & T>;
|
|
313
|
+
interface TDataShape {
|
|
314
|
+
body?: unknown;
|
|
315
|
+
headers?: unknown;
|
|
316
|
+
path?: unknown;
|
|
317
|
+
query?: unknown;
|
|
318
|
+
url: string;
|
|
319
|
+
}
|
|
320
|
+
type OmitKeys<T, K> = Pick<T, Exclude<keyof T, K>>;
|
|
321
|
+
type Options$2<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'>);
|
|
322
|
+
|
|
323
|
+
//#endregion
|
|
324
|
+
//#region src/api/generated/types.gen.d.ts
|
|
325
|
+
type ClientOptions = {
|
|
326
|
+
baseUrl: 'https://www.primitive.dev/api/v1' | (string & {});
|
|
327
|
+
};
|
|
328
|
+
type SuccessEnvelope = {
|
|
329
|
+
success: boolean;
|
|
330
|
+
};
|
|
331
|
+
type ListEnvelope = {
|
|
332
|
+
success: boolean;
|
|
333
|
+
meta: PaginationMeta;
|
|
334
|
+
};
|
|
335
|
+
type PaginationMeta = {
|
|
336
|
+
/**
|
|
337
|
+
* Total number of matching records
|
|
338
|
+
*/
|
|
339
|
+
total: number;
|
|
340
|
+
/**
|
|
341
|
+
* Page size used for this request
|
|
342
|
+
*/
|
|
343
|
+
limit: number;
|
|
344
|
+
/**
|
|
345
|
+
* Cursor for the next page, or null if no more results
|
|
346
|
+
*/
|
|
347
|
+
cursor: string | null;
|
|
348
|
+
};
|
|
349
|
+
type ErrorResponse = {
|
|
350
|
+
success: boolean;
|
|
351
|
+
error: {
|
|
352
|
+
code: 'unauthorized' | 'forbidden' | 'not_found' | 'validation_error' | 'rate_limit_exceeded' | 'internal_error' | 'conflict' | 'mx_conflict' | 'bad_gateway' | 'outbound_disabled' | 'cannot_send_from_domain' | 'recipient_not_allowed' | 'outbound_key_missing' | 'outbound_unreachable' | 'outbound_key_invalid' | 'outbound_capacity_exhausted' | 'outbound_response_malformed' | 'outbound_relay_failed';
|
|
353
|
+
message: string;
|
|
354
|
+
/**
|
|
355
|
+
* Optional structured data that callers can inspect to recover
|
|
356
|
+
* from the error. The fields present depend on `code`. Additional
|
|
357
|
+
* keys may be added over time without a major-version bump.
|
|
358
|
+
*
|
|
359
|
+
*/
|
|
360
|
+
details?: {
|
|
361
|
+
/**
|
|
362
|
+
* Present when `code == mx_conflict`.
|
|
363
|
+
*/
|
|
364
|
+
mx_conflict?: {
|
|
365
|
+
/**
|
|
366
|
+
* Human-readable name of the detected mailbox provider (e.g. "Google Workspace").
|
|
367
|
+
*/
|
|
368
|
+
provider_name: string;
|
|
369
|
+
/**
|
|
370
|
+
* Subdomain to try instead (e.g. "mail" for `mail.example.com`).
|
|
371
|
+
*/
|
|
372
|
+
suggested_subdomain: string;
|
|
373
|
+
};
|
|
374
|
+
/**
|
|
375
|
+
* Entitlements that would allow a denied send when no recipient-scope gate was granted.
|
|
376
|
+
*/
|
|
377
|
+
required_entitlements?: Array<string>;
|
|
378
|
+
/**
|
|
379
|
+
* ID of the persisted sent-email attempt associated with the error.
|
|
380
|
+
*/
|
|
381
|
+
sent_email_id?: string;
|
|
382
|
+
/**
|
|
383
|
+
* Content hash of the original request on idempotency cache-hit errors.
|
|
384
|
+
*/
|
|
385
|
+
content_hash?: string;
|
|
386
|
+
/**
|
|
387
|
+
* Effective idempotency key associated with the original request.
|
|
388
|
+
*/
|
|
389
|
+
client_idempotency_key?: string;
|
|
390
|
+
[key: string]: unknown;
|
|
391
|
+
};
|
|
392
|
+
/**
|
|
393
|
+
* Structured per-gate denial detail for recipient-scope send-mail failures.
|
|
394
|
+
*/
|
|
395
|
+
gates?: Array<GateDenial>;
|
|
396
|
+
/**
|
|
397
|
+
* Server-issued request identifier for support and tracing.
|
|
398
|
+
*/
|
|
399
|
+
request_id?: string;
|
|
400
|
+
};
|
|
401
|
+
};
|
|
402
|
+
type GateDenial = {
|
|
403
|
+
/**
|
|
404
|
+
* Public recipient-scope gate name that denied the send.
|
|
405
|
+
*/
|
|
406
|
+
name: 'send_to_confirmed_domains' | 'send_to_known_addresses';
|
|
407
|
+
/**
|
|
408
|
+
* Stable machine-readable denial reason.
|
|
409
|
+
*/
|
|
410
|
+
reason: 'domain_not_confirmed' | 'recipient_unauthenticated' | 'recipient_not_known';
|
|
411
|
+
/**
|
|
412
|
+
* Human-readable explanation of the gate denial.
|
|
413
|
+
*/
|
|
414
|
+
message: string;
|
|
415
|
+
/**
|
|
416
|
+
* Domain or address the gate evaluated.
|
|
417
|
+
*/
|
|
418
|
+
subject: string;
|
|
419
|
+
fix?: GateFix;
|
|
420
|
+
/**
|
|
421
|
+
* Public docs URL with more context.
|
|
422
|
+
*/
|
|
423
|
+
docs_url?: string;
|
|
424
|
+
};
|
|
425
|
+
type GateFix = {
|
|
426
|
+
/**
|
|
427
|
+
* Suggested next action for the caller.
|
|
428
|
+
*/
|
|
429
|
+
action: 'confirm_domain' | 'sender_must_fix_authentication' | 'wait_for_inbound';
|
|
430
|
+
/**
|
|
431
|
+
* Entity the action applies to.
|
|
432
|
+
*/
|
|
433
|
+
subject: string;
|
|
434
|
+
};
|
|
435
|
+
type Account = {
|
|
436
|
+
id: string;
|
|
437
|
+
email: string;
|
|
438
|
+
plan: string;
|
|
439
|
+
created_at: string;
|
|
440
|
+
onboarding_completed?: boolean;
|
|
441
|
+
onboarding_step?: string | null;
|
|
442
|
+
stripe_subscription_status?: string | null;
|
|
443
|
+
subscription_current_period_end?: string | null;
|
|
444
|
+
subscription_cancel_at_period_end?: boolean | null;
|
|
445
|
+
spam_threshold?: number | null;
|
|
446
|
+
discard_content_on_webhook_confirmed: boolean;
|
|
447
|
+
webhook_secret_rotated_at?: string | null;
|
|
448
|
+
};
|
|
449
|
+
type AccountUpdated = {
|
|
450
|
+
id: string;
|
|
451
|
+
email: string;
|
|
452
|
+
plan: string;
|
|
453
|
+
spam_threshold?: number | null;
|
|
454
|
+
discard_content_on_webhook_confirmed: boolean;
|
|
455
|
+
};
|
|
456
|
+
type UpdateAccountInput = {
|
|
457
|
+
/**
|
|
458
|
+
* Global spam score threshold (0-15). Emails scoring above this are rejected. Set to null to disable.
|
|
459
|
+
*/
|
|
460
|
+
spam_threshold?: number | null;
|
|
461
|
+
/**
|
|
462
|
+
* Whether to discard email content after the webhook endpoint confirms receipt.
|
|
463
|
+
*/
|
|
464
|
+
discard_content_on_webhook_confirmed?: boolean;
|
|
465
|
+
};
|
|
466
|
+
type StorageStats = {
|
|
467
|
+
/**
|
|
468
|
+
* Total storage used in bytes
|
|
469
|
+
*/
|
|
470
|
+
used_bytes: number;
|
|
471
|
+
/**
|
|
472
|
+
* Total storage used in kilobytes (1 decimal)
|
|
473
|
+
*/
|
|
474
|
+
used_kb: number;
|
|
475
|
+
/**
|
|
476
|
+
* Total storage used in megabytes (2 decimals)
|
|
477
|
+
*/
|
|
478
|
+
used_mb: number;
|
|
479
|
+
/**
|
|
480
|
+
* Storage quota in megabytes (based on plan)
|
|
481
|
+
*/
|
|
482
|
+
quota_mb: number;
|
|
483
|
+
/**
|
|
484
|
+
* Percentage of quota used (1 decimal)
|
|
485
|
+
*/
|
|
486
|
+
percentage: number;
|
|
487
|
+
/**
|
|
488
|
+
* Number of stored emails
|
|
489
|
+
*/
|
|
490
|
+
emails_count: number;
|
|
491
|
+
};
|
|
492
|
+
type WebhookSecret = {
|
|
493
|
+
/**
|
|
494
|
+
* The webhook signing secret value
|
|
495
|
+
*/
|
|
496
|
+
secret: string;
|
|
497
|
+
};
|
|
498
|
+
/**
|
|
499
|
+
* A domain can be either verified or unverified. Verified domains have
|
|
500
|
+
* `is_active` and `spam_threshold` fields. Unverified domains have a
|
|
501
|
+
* `verification_token` for DNS verification.
|
|
502
|
+
*
|
|
503
|
+
*/
|
|
504
|
+
type Domain = VerifiedDomain | UnverifiedDomain;
|
|
505
|
+
type VerifiedDomain = {
|
|
506
|
+
id: string;
|
|
507
|
+
org_id: string;
|
|
508
|
+
domain: string;
|
|
509
|
+
verified: boolean;
|
|
510
|
+
is_active: boolean;
|
|
511
|
+
spam_threshold?: number | null;
|
|
512
|
+
verification_token?: string | null;
|
|
513
|
+
created_at: string;
|
|
514
|
+
};
|
|
515
|
+
type UnverifiedDomain = {
|
|
516
|
+
id: string;
|
|
517
|
+
org_id: string;
|
|
518
|
+
domain: string;
|
|
519
|
+
verified: boolean;
|
|
520
|
+
/**
|
|
521
|
+
* Add this value as a TXT record to verify ownership
|
|
522
|
+
*/
|
|
523
|
+
verification_token: string;
|
|
524
|
+
created_at: string;
|
|
525
|
+
};
|
|
526
|
+
type AddDomainInput = {
|
|
527
|
+
/**
|
|
528
|
+
* The domain name to claim (e.g. "example.com")
|
|
529
|
+
*/
|
|
530
|
+
domain: string;
|
|
531
|
+
};
|
|
532
|
+
type UpdateDomainInput = {
|
|
533
|
+
/**
|
|
534
|
+
* Whether the domain accepts incoming emails
|
|
535
|
+
*/
|
|
536
|
+
is_active?: boolean;
|
|
537
|
+
/**
|
|
538
|
+
* Per-domain spam threshold override (Pro plan required)
|
|
539
|
+
*/
|
|
540
|
+
spam_threshold?: number | null;
|
|
541
|
+
};
|
|
542
|
+
type DomainVerifyResult = {
|
|
543
|
+
verified: boolean;
|
|
544
|
+
} | {
|
|
545
|
+
verified: boolean;
|
|
546
|
+
/**
|
|
547
|
+
* Whether MX records point to Primitive
|
|
548
|
+
*/
|
|
549
|
+
mxFound: boolean;
|
|
550
|
+
/**
|
|
551
|
+
* Whether the TXT verification record was found
|
|
552
|
+
*/
|
|
553
|
+
txtFound: boolean;
|
|
554
|
+
/**
|
|
555
|
+
* Human-readable verification failure reason
|
|
556
|
+
*/
|
|
557
|
+
error: string;
|
|
558
|
+
};
|
|
559
|
+
type EmailSummary = {
|
|
560
|
+
id: string;
|
|
561
|
+
message_id?: string | null;
|
|
562
|
+
domain_id?: string | null;
|
|
563
|
+
org_id?: string | null;
|
|
564
|
+
status: 'pending' | 'accepted' | 'completed' | 'rejected';
|
|
565
|
+
sender: string;
|
|
566
|
+
recipient: string;
|
|
567
|
+
subject?: string | null;
|
|
568
|
+
domain: string;
|
|
569
|
+
spam_score?: number | null;
|
|
570
|
+
created_at: string;
|
|
571
|
+
received_at: string;
|
|
572
|
+
raw_size_bytes?: number | null;
|
|
573
|
+
webhook_status?: 'pending' | 'in_flight' | 'fired' | 'failed' | 'exhausted' | null;
|
|
574
|
+
webhook_attempt_count: number;
|
|
575
|
+
};
|
|
576
|
+
type EmailDetail = {
|
|
577
|
+
id: string;
|
|
578
|
+
message_id?: string | null;
|
|
579
|
+
domain_id?: string | null;
|
|
580
|
+
org_id?: string | null;
|
|
581
|
+
sender: string;
|
|
582
|
+
recipient: string;
|
|
583
|
+
subject?: string | null;
|
|
584
|
+
status: 'pending' | 'accepted' | 'completed' | 'rejected';
|
|
585
|
+
domain: string;
|
|
586
|
+
spam_score?: number | null;
|
|
587
|
+
raw_size_bytes?: number | null;
|
|
588
|
+
raw_sha256?: string | null;
|
|
589
|
+
created_at: string;
|
|
590
|
+
received_at: string;
|
|
591
|
+
rejection_reason?: string | null;
|
|
592
|
+
webhook_status?: 'pending' | 'in_flight' | 'fired' | 'failed' | 'exhausted' | null;
|
|
593
|
+
webhook_attempt_count: number;
|
|
594
|
+
webhook_last_attempt_at?: string | null;
|
|
595
|
+
webhook_last_status_code?: number | null;
|
|
596
|
+
webhook_last_error?: string | null;
|
|
597
|
+
webhook_fired_at?: string | null;
|
|
598
|
+
smtp_helo?: string | null;
|
|
599
|
+
smtp_mail_from?: string | null;
|
|
600
|
+
smtp_rcpt_to?: Array<string> | null;
|
|
601
|
+
from_header?: string | null;
|
|
602
|
+
content_discarded_at?: string | null;
|
|
603
|
+
content_discarded_by_delivery_id?: string | null;
|
|
604
|
+
/**
|
|
605
|
+
* Parsed from address (from_header or sender fallback)
|
|
606
|
+
*/
|
|
607
|
+
from_email: string;
|
|
608
|
+
/**
|
|
609
|
+
* Parsed to address (same as recipient)
|
|
610
|
+
*/
|
|
611
|
+
to_email: string;
|
|
612
|
+
};
|
|
613
|
+
type SendMailInput = {
|
|
614
|
+
/**
|
|
615
|
+
* RFC 5322 From header. The sender domain must be a verified outbound domain for your organization.
|
|
616
|
+
*/
|
|
617
|
+
from: string;
|
|
618
|
+
/**
|
|
619
|
+
* Recipient address. Recipient eligibility depends on your account's outbound entitlements.
|
|
620
|
+
*/
|
|
621
|
+
to: string;
|
|
622
|
+
/**
|
|
623
|
+
* Subject line for the outbound message
|
|
624
|
+
*/
|
|
625
|
+
subject: string;
|
|
626
|
+
/**
|
|
627
|
+
* Plain-text message body. At least one of body_text or body_html is required. The combined UTF-8 byte length of body_text and body_html must be at most 262144 bytes.
|
|
628
|
+
*/
|
|
629
|
+
body_text?: string;
|
|
630
|
+
/**
|
|
631
|
+
* HTML message body. At least one of body_text or body_html is required. The combined UTF-8 byte length of body_text and body_html must be at most 262144 bytes.
|
|
632
|
+
*/
|
|
633
|
+
body_html?: string;
|
|
634
|
+
/**
|
|
635
|
+
* Message-ID of the direct parent email when sending a threaded reply.
|
|
636
|
+
*/
|
|
637
|
+
in_reply_to?: string;
|
|
638
|
+
/**
|
|
639
|
+
* Full ordered message-id chain for the thread.
|
|
640
|
+
*/
|
|
641
|
+
references?: Array<string>;
|
|
642
|
+
/**
|
|
643
|
+
* When true, wait for the first downstream SMTP delivery outcome before returning.
|
|
644
|
+
*/
|
|
645
|
+
wait?: boolean;
|
|
646
|
+
/**
|
|
647
|
+
* Maximum time to wait for a delivery outcome when wait is true. Defaults to 30000.
|
|
648
|
+
*/
|
|
649
|
+
wait_timeout_ms?: number;
|
|
650
|
+
};
|
|
651
|
+
type SentEmailStatus = 'queued' | 'submitted_to_agent' | 'agent_failed' | 'unknown' | 'delivered' | 'bounced' | 'deferred' | 'wait_timeout';
|
|
652
|
+
type DeliveryStatus = 'delivered' | 'bounced' | 'deferred' | 'wait_timeout';
|
|
653
|
+
type SendMailResult = {
|
|
654
|
+
/**
|
|
655
|
+
* Persisted sent-email attempt ID.
|
|
656
|
+
*/
|
|
657
|
+
id: string;
|
|
658
|
+
status: SentEmailStatus;
|
|
659
|
+
/**
|
|
660
|
+
* Message identifier assigned by Primitive's outbound relay, when available.
|
|
661
|
+
*/
|
|
662
|
+
queue_id: string | null;
|
|
663
|
+
/**
|
|
664
|
+
* Recipient addresses accepted by the relay.
|
|
665
|
+
*/
|
|
666
|
+
accepted: Array<string>;
|
|
667
|
+
/**
|
|
668
|
+
* Recipient addresses rejected by the relay.
|
|
669
|
+
*/
|
|
670
|
+
rejected: Array<string>;
|
|
671
|
+
/**
|
|
672
|
+
* Effective idempotency key used for this send.
|
|
673
|
+
*/
|
|
674
|
+
client_idempotency_key: string;
|
|
675
|
+
/**
|
|
676
|
+
* Server-issued request identifier for support and tracing.
|
|
677
|
+
*/
|
|
678
|
+
request_id: string;
|
|
679
|
+
/**
|
|
680
|
+
* Stable hash of the canonical send payload.
|
|
681
|
+
*/
|
|
682
|
+
content_hash: string;
|
|
683
|
+
delivery_status?: DeliveryStatus;
|
|
684
|
+
/**
|
|
685
|
+
* SMTP response code from the first downstream delivery outcome when wait is true.
|
|
686
|
+
*/
|
|
687
|
+
smtp_response_code?: number | null;
|
|
688
|
+
/**
|
|
689
|
+
* SMTP response text from the first downstream delivery outcome when wait is true.
|
|
690
|
+
*/
|
|
691
|
+
smtp_response_text?: string;
|
|
692
|
+
};
|
|
693
|
+
type Endpoint = {
|
|
694
|
+
id: string;
|
|
695
|
+
org_id: string;
|
|
696
|
+
url?: string | null;
|
|
697
|
+
enabled: boolean;
|
|
698
|
+
/**
|
|
699
|
+
* Restrict this endpoint to emails from a specific domain
|
|
700
|
+
*/
|
|
701
|
+
domain_id?: string | null;
|
|
702
|
+
/**
|
|
703
|
+
* Endpoint-specific filtering rules
|
|
704
|
+
*/
|
|
705
|
+
rules: {
|
|
706
|
+
[key: string]: unknown;
|
|
707
|
+
};
|
|
708
|
+
created_at: string;
|
|
709
|
+
updated_at: string;
|
|
710
|
+
/**
|
|
711
|
+
* Total webhook deliveries attempted
|
|
712
|
+
*/
|
|
713
|
+
delivery_count: number;
|
|
714
|
+
/**
|
|
715
|
+
* Successful deliveries
|
|
716
|
+
*/
|
|
717
|
+
success_count: number;
|
|
718
|
+
/**
|
|
719
|
+
* Failed deliveries
|
|
720
|
+
*/
|
|
721
|
+
failure_count: number;
|
|
722
|
+
/**
|
|
723
|
+
* Current streak of consecutive failures
|
|
724
|
+
*/
|
|
725
|
+
consecutive_fails: number;
|
|
726
|
+
last_delivery_at?: string | null;
|
|
727
|
+
last_success_at?: string | null;
|
|
728
|
+
last_failure_at?: string | null;
|
|
729
|
+
deactivated_at?: string | null;
|
|
730
|
+
};
|
|
731
|
+
type CreateEndpointInput = {
|
|
732
|
+
/**
|
|
733
|
+
* The webhook URL to deliver events to
|
|
734
|
+
*/
|
|
735
|
+
url: string;
|
|
736
|
+
/**
|
|
737
|
+
* Whether the endpoint is active
|
|
738
|
+
*/
|
|
739
|
+
enabled?: boolean;
|
|
740
|
+
/**
|
|
741
|
+
* Restrict to emails from a specific domain
|
|
742
|
+
*/
|
|
743
|
+
domain_id?: string | null;
|
|
744
|
+
/**
|
|
745
|
+
* Endpoint-specific filtering rules
|
|
746
|
+
*/
|
|
747
|
+
rules?: {
|
|
748
|
+
[key: string]: unknown;
|
|
749
|
+
};
|
|
750
|
+
};
|
|
751
|
+
type UpdateEndpointInput = {
|
|
752
|
+
/**
|
|
753
|
+
* New webhook URL (triggers endpoint rotation)
|
|
754
|
+
*/
|
|
755
|
+
url?: string;
|
|
756
|
+
enabled?: boolean;
|
|
757
|
+
domain_id?: string | null;
|
|
758
|
+
rules?: {
|
|
759
|
+
[key: string]: unknown;
|
|
760
|
+
};
|
|
761
|
+
};
|
|
762
|
+
type TestResult = {
|
|
763
|
+
/**
|
|
764
|
+
* HTTP status code returned by the endpoint
|
|
765
|
+
*/
|
|
766
|
+
status: number;
|
|
767
|
+
/**
|
|
768
|
+
* Response body (truncated to 1000 characters)
|
|
769
|
+
*/
|
|
770
|
+
body: string;
|
|
771
|
+
/**
|
|
772
|
+
* The signature header value sent (if webhook secret is configured)
|
|
773
|
+
*/
|
|
774
|
+
signature?: string;
|
|
775
|
+
};
|
|
776
|
+
type Filter = {
|
|
777
|
+
id: string;
|
|
778
|
+
org_id: string;
|
|
779
|
+
/**
|
|
780
|
+
* If set, filter applies only to this domain
|
|
781
|
+
*/
|
|
782
|
+
domain_id?: string | null;
|
|
783
|
+
type: 'whitelist' | 'blocklist';
|
|
784
|
+
/**
|
|
785
|
+
* Email address or pattern to match (stored lowercase)
|
|
786
|
+
*/
|
|
787
|
+
pattern: string;
|
|
788
|
+
enabled: boolean;
|
|
789
|
+
created_at: string;
|
|
790
|
+
};
|
|
791
|
+
type CreateFilterInput = {
|
|
792
|
+
type: 'whitelist' | 'blocklist';
|
|
793
|
+
/**
|
|
794
|
+
* Email address or pattern to filter
|
|
795
|
+
*/
|
|
796
|
+
pattern: string;
|
|
797
|
+
/**
|
|
798
|
+
* Restrict filter to a specific domain (Pro plan required)
|
|
799
|
+
*/
|
|
800
|
+
domain_id?: string | null;
|
|
801
|
+
};
|
|
802
|
+
type UpdateFilterInput = {
|
|
803
|
+
enabled: boolean;
|
|
804
|
+
};
|
|
805
|
+
type DeliverySummary = {
|
|
806
|
+
/**
|
|
807
|
+
* Delivery ID (numeric string)
|
|
808
|
+
*/
|
|
809
|
+
id: string;
|
|
810
|
+
email_id: string;
|
|
811
|
+
org_id: string;
|
|
812
|
+
endpoint_id: string;
|
|
813
|
+
endpoint_url: string;
|
|
814
|
+
status: 'pending' | 'delivered' | 'header_confirmed' | 'failed';
|
|
815
|
+
attempt_count: number;
|
|
816
|
+
duration_ms?: number | null;
|
|
817
|
+
last_error?: string | null;
|
|
818
|
+
created_at: string;
|
|
819
|
+
updated_at: string;
|
|
820
|
+
email?: {
|
|
821
|
+
sender: string;
|
|
822
|
+
recipient: string;
|
|
823
|
+
subject?: string | null;
|
|
824
|
+
} | null;
|
|
825
|
+
};
|
|
826
|
+
type ReplayResult = {
|
|
827
|
+
/**
|
|
828
|
+
* Number of successful deliveries
|
|
829
|
+
*/
|
|
830
|
+
delivered: number;
|
|
831
|
+
/**
|
|
832
|
+
* Number of failed deliveries
|
|
833
|
+
*/
|
|
834
|
+
failed: number;
|
|
835
|
+
};
|
|
836
|
+
/**
|
|
837
|
+
* Resource UUID
|
|
838
|
+
*/
|
|
839
|
+
type ResourceId = string;
|
|
840
|
+
/**
|
|
841
|
+
* Pagination cursor from a previous response's `meta.cursor` field.
|
|
842
|
+
* Format: `{ISO-datetime}|{id}`
|
|
843
|
+
*
|
|
844
|
+
*/
|
|
845
|
+
type Cursor = string;
|
|
846
|
+
/**
|
|
847
|
+
* Number of results per page
|
|
848
|
+
*/
|
|
849
|
+
type Limit = number;
|
|
850
|
+
type GetAccountData = {
|
|
851
|
+
body?: never;
|
|
852
|
+
path?: never;
|
|
853
|
+
query?: never;
|
|
854
|
+
url: '/account';
|
|
855
|
+
};
|
|
856
|
+
type GetAccountErrors = {
|
|
857
|
+
/**
|
|
858
|
+
* Invalid or missing API key
|
|
859
|
+
*/
|
|
860
|
+
401: ErrorResponse;
|
|
861
|
+
/**
|
|
862
|
+
* Resource not found
|
|
863
|
+
*/
|
|
864
|
+
404: ErrorResponse;
|
|
865
|
+
};
|
|
866
|
+
type GetAccountError = GetAccountErrors[keyof GetAccountErrors];
|
|
867
|
+
type GetAccountResponses = {
|
|
868
|
+
/**
|
|
869
|
+
* Account details
|
|
870
|
+
*/
|
|
871
|
+
200: SuccessEnvelope & {
|
|
872
|
+
data?: Account;
|
|
873
|
+
};
|
|
874
|
+
};
|
|
875
|
+
type GetAccountResponse = GetAccountResponses[keyof GetAccountResponses];
|
|
876
|
+
type UpdateAccountData = {
|
|
877
|
+
body: UpdateAccountInput;
|
|
878
|
+
path?: never;
|
|
879
|
+
query?: never;
|
|
880
|
+
url: '/account';
|
|
881
|
+
};
|
|
882
|
+
type UpdateAccountErrors = {
|
|
883
|
+
/**
|
|
884
|
+
* Invalid request parameters
|
|
885
|
+
*/
|
|
886
|
+
400: ErrorResponse;
|
|
887
|
+
/**
|
|
888
|
+
* Invalid or missing API key
|
|
889
|
+
*/
|
|
890
|
+
401: ErrorResponse;
|
|
891
|
+
/**
|
|
892
|
+
* Resource not found
|
|
893
|
+
*/
|
|
894
|
+
404: ErrorResponse;
|
|
895
|
+
};
|
|
896
|
+
type UpdateAccountError = UpdateAccountErrors[keyof UpdateAccountErrors];
|
|
897
|
+
type UpdateAccountResponses = {
|
|
898
|
+
/**
|
|
899
|
+
* Updated account
|
|
900
|
+
*/
|
|
901
|
+
200: SuccessEnvelope & {
|
|
902
|
+
data?: AccountUpdated;
|
|
903
|
+
};
|
|
904
|
+
};
|
|
905
|
+
type UpdateAccountResponse = UpdateAccountResponses[keyof UpdateAccountResponses];
|
|
906
|
+
type GetStorageStatsData = {
|
|
907
|
+
body?: never;
|
|
908
|
+
path?: never;
|
|
909
|
+
query?: never;
|
|
910
|
+
url: '/account/storage';
|
|
911
|
+
};
|
|
912
|
+
type GetStorageStatsErrors = {
|
|
913
|
+
/**
|
|
914
|
+
* Invalid or missing API key
|
|
915
|
+
*/
|
|
916
|
+
401: ErrorResponse;
|
|
917
|
+
/**
|
|
918
|
+
* Resource not found
|
|
919
|
+
*/
|
|
920
|
+
404: ErrorResponse;
|
|
921
|
+
};
|
|
922
|
+
type GetStorageStatsError = GetStorageStatsErrors[keyof GetStorageStatsErrors];
|
|
923
|
+
type GetStorageStatsResponses = {
|
|
924
|
+
/**
|
|
925
|
+
* Storage statistics
|
|
926
|
+
*/
|
|
927
|
+
200: SuccessEnvelope & {
|
|
928
|
+
data?: StorageStats;
|
|
929
|
+
};
|
|
930
|
+
};
|
|
931
|
+
type GetStorageStatsResponse = GetStorageStatsResponses[keyof GetStorageStatsResponses];
|
|
932
|
+
type GetWebhookSecretData = {
|
|
933
|
+
body?: never;
|
|
934
|
+
path?: never;
|
|
935
|
+
query?: never;
|
|
936
|
+
url: '/account/webhook-secret';
|
|
937
|
+
};
|
|
938
|
+
type GetWebhookSecretErrors = {
|
|
939
|
+
/**
|
|
940
|
+
* Invalid or missing API key
|
|
941
|
+
*/
|
|
942
|
+
401: ErrorResponse;
|
|
943
|
+
/**
|
|
944
|
+
* Resource not found
|
|
945
|
+
*/
|
|
946
|
+
404: ErrorResponse;
|
|
947
|
+
};
|
|
948
|
+
type GetWebhookSecretError = GetWebhookSecretErrors[keyof GetWebhookSecretErrors];
|
|
949
|
+
type GetWebhookSecretResponses = {
|
|
950
|
+
/**
|
|
951
|
+
* Webhook secret
|
|
952
|
+
*/
|
|
953
|
+
200: SuccessEnvelope & {
|
|
954
|
+
data?: WebhookSecret;
|
|
955
|
+
};
|
|
956
|
+
};
|
|
957
|
+
type GetWebhookSecretResponse = GetWebhookSecretResponses[keyof GetWebhookSecretResponses];
|
|
958
|
+
type RotateWebhookSecretData = {
|
|
959
|
+
body?: never;
|
|
960
|
+
path?: never;
|
|
961
|
+
query?: never;
|
|
962
|
+
url: '/account/webhook-secret/rotate';
|
|
963
|
+
};
|
|
964
|
+
type RotateWebhookSecretErrors = {
|
|
965
|
+
/**
|
|
966
|
+
* Invalid request parameters
|
|
967
|
+
*/
|
|
968
|
+
400: ErrorResponse;
|
|
969
|
+
/**
|
|
970
|
+
* Invalid or missing API key
|
|
971
|
+
*/
|
|
972
|
+
401: ErrorResponse;
|
|
973
|
+
/**
|
|
974
|
+
* Resource not found
|
|
975
|
+
*/
|
|
976
|
+
404: ErrorResponse;
|
|
977
|
+
/**
|
|
978
|
+
* Rate limit exceeded
|
|
979
|
+
*/
|
|
980
|
+
429: ErrorResponse;
|
|
981
|
+
};
|
|
982
|
+
type RotateWebhookSecretError = RotateWebhookSecretErrors[keyof RotateWebhookSecretErrors];
|
|
983
|
+
type RotateWebhookSecretResponses = {
|
|
984
|
+
/**
|
|
985
|
+
* New webhook secret
|
|
986
|
+
*/
|
|
987
|
+
200: SuccessEnvelope & {
|
|
988
|
+
data?: WebhookSecret;
|
|
989
|
+
};
|
|
990
|
+
};
|
|
991
|
+
type RotateWebhookSecretResponse = RotateWebhookSecretResponses[keyof RotateWebhookSecretResponses];
|
|
992
|
+
type ListDomainsData = {
|
|
993
|
+
body?: never;
|
|
994
|
+
path?: never;
|
|
995
|
+
query?: never;
|
|
996
|
+
url: '/domains';
|
|
997
|
+
};
|
|
998
|
+
type ListDomainsErrors = {
|
|
999
|
+
/**
|
|
1000
|
+
* Invalid or missing API key
|
|
1001
|
+
*/
|
|
1002
|
+
401: ErrorResponse;
|
|
1003
|
+
};
|
|
1004
|
+
type ListDomainsError = ListDomainsErrors[keyof ListDomainsErrors];
|
|
1005
|
+
type ListDomainsResponses = {
|
|
1006
|
+
/**
|
|
1007
|
+
* List of domains
|
|
1008
|
+
*/
|
|
1009
|
+
200: SuccessEnvelope & {
|
|
1010
|
+
data?: Array<Domain>;
|
|
1011
|
+
};
|
|
1012
|
+
};
|
|
1013
|
+
type ListDomainsResponse = ListDomainsResponses[keyof ListDomainsResponses];
|
|
1014
|
+
type AddDomainData = {
|
|
1015
|
+
body: AddDomainInput;
|
|
1016
|
+
path?: never;
|
|
1017
|
+
query?: never;
|
|
1018
|
+
url: '/domains';
|
|
1019
|
+
};
|
|
1020
|
+
type AddDomainErrors = {
|
|
1021
|
+
/**
|
|
1022
|
+
* Invalid request parameters
|
|
1023
|
+
*/
|
|
1024
|
+
400: ErrorResponse;
|
|
1025
|
+
/**
|
|
1026
|
+
* Invalid or missing API key
|
|
1027
|
+
*/
|
|
1028
|
+
401: ErrorResponse;
|
|
1029
|
+
/**
|
|
1030
|
+
* Domain claim conflicts with existing state. Two error codes
|
|
1031
|
+
* are possible:
|
|
1032
|
+
* * `mx_conflict`: the domain's current MX records point at
|
|
1033
|
+
* another mailbox provider. The response includes
|
|
1034
|
+
* `error.details.mx_conflict` with the detected provider
|
|
1035
|
+
* and a suggested subdomain.
|
|
1036
|
+
* * `conflict`: the domain is already claimed by another
|
|
1037
|
+
* org, or a pending claim exists for another user.
|
|
1038
|
+
*
|
|
1039
|
+
*/
|
|
1040
|
+
409: ErrorResponse;
|
|
1041
|
+
};
|
|
1042
|
+
type AddDomainError = AddDomainErrors[keyof AddDomainErrors];
|
|
1043
|
+
type AddDomainResponses = {
|
|
1044
|
+
/**
|
|
1045
|
+
* Domain claim created
|
|
1046
|
+
*/
|
|
1047
|
+
201: SuccessEnvelope & {
|
|
1048
|
+
data?: UnverifiedDomain;
|
|
1049
|
+
};
|
|
1050
|
+
};
|
|
1051
|
+
type AddDomainResponse = AddDomainResponses[keyof AddDomainResponses];
|
|
1052
|
+
type DeleteDomainData = {
|
|
1053
|
+
body?: never;
|
|
1054
|
+
path: {
|
|
1055
|
+
/**
|
|
1056
|
+
* Resource UUID
|
|
1057
|
+
*/
|
|
1058
|
+
id: string;
|
|
1059
|
+
};
|
|
1060
|
+
query?: never;
|
|
1061
|
+
url: '/domains/{id}';
|
|
1062
|
+
};
|
|
1063
|
+
type DeleteDomainErrors = {
|
|
1064
|
+
/**
|
|
1065
|
+
* Invalid request parameters
|
|
1066
|
+
*/
|
|
1067
|
+
400: ErrorResponse;
|
|
1068
|
+
/**
|
|
1069
|
+
* Invalid or missing API key
|
|
1070
|
+
*/
|
|
1071
|
+
401: ErrorResponse;
|
|
1072
|
+
/**
|
|
1073
|
+
* Resource not found
|
|
1074
|
+
*/
|
|
1075
|
+
404: ErrorResponse;
|
|
1076
|
+
};
|
|
1077
|
+
type DeleteDomainError = DeleteDomainErrors[keyof DeleteDomainErrors];
|
|
1078
|
+
type DeleteDomainResponses = {
|
|
1079
|
+
/**
|
|
1080
|
+
* Resource deleted
|
|
1081
|
+
*/
|
|
1082
|
+
200: SuccessEnvelope & {
|
|
1083
|
+
data?: {
|
|
1084
|
+
deleted: boolean;
|
|
1085
|
+
};
|
|
1086
|
+
};
|
|
1087
|
+
};
|
|
1088
|
+
type DeleteDomainResponse = DeleteDomainResponses[keyof DeleteDomainResponses];
|
|
1089
|
+
type UpdateDomainData = {
|
|
1090
|
+
body: UpdateDomainInput;
|
|
1091
|
+
path: {
|
|
1092
|
+
/**
|
|
1093
|
+
* Resource UUID
|
|
1094
|
+
*/
|
|
1095
|
+
id: string;
|
|
1096
|
+
};
|
|
1097
|
+
query?: never;
|
|
1098
|
+
url: '/domains/{id}';
|
|
1099
|
+
};
|
|
1100
|
+
type UpdateDomainErrors = {
|
|
1101
|
+
/**
|
|
1102
|
+
* Invalid request parameters
|
|
1103
|
+
*/
|
|
1104
|
+
400: ErrorResponse;
|
|
1105
|
+
/**
|
|
1106
|
+
* Invalid or missing API key
|
|
1107
|
+
*/
|
|
1108
|
+
401: ErrorResponse;
|
|
1109
|
+
/**
|
|
1110
|
+
* Resource not found
|
|
1111
|
+
*/
|
|
1112
|
+
404: ErrorResponse;
|
|
1113
|
+
};
|
|
1114
|
+
type UpdateDomainError = UpdateDomainErrors[keyof UpdateDomainErrors];
|
|
1115
|
+
type UpdateDomainResponses = {
|
|
1116
|
+
/**
|
|
1117
|
+
* Updated domain
|
|
1118
|
+
*/
|
|
1119
|
+
200: SuccessEnvelope & {
|
|
1120
|
+
data?: VerifiedDomain;
|
|
1121
|
+
};
|
|
1122
|
+
};
|
|
1123
|
+
type UpdateDomainResponse = UpdateDomainResponses[keyof UpdateDomainResponses];
|
|
1124
|
+
type VerifyDomainData = {
|
|
1125
|
+
body?: never;
|
|
1126
|
+
path: {
|
|
1127
|
+
/**
|
|
1128
|
+
* Resource UUID
|
|
1129
|
+
*/
|
|
1130
|
+
id: string;
|
|
1131
|
+
};
|
|
1132
|
+
query?: never;
|
|
1133
|
+
url: '/domains/{id}/verify';
|
|
1134
|
+
};
|
|
1135
|
+
type VerifyDomainErrors = {
|
|
1136
|
+
/**
|
|
1137
|
+
* Invalid request parameters
|
|
1138
|
+
*/
|
|
1139
|
+
400: ErrorResponse;
|
|
1140
|
+
/**
|
|
1141
|
+
* Invalid or missing API key
|
|
1142
|
+
*/
|
|
1143
|
+
401: ErrorResponse;
|
|
1144
|
+
/**
|
|
1145
|
+
* Resource not found
|
|
1146
|
+
*/
|
|
1147
|
+
404: ErrorResponse;
|
|
1148
|
+
};
|
|
1149
|
+
type VerifyDomainError = VerifyDomainErrors[keyof VerifyDomainErrors];
|
|
1150
|
+
type VerifyDomainResponses = {
|
|
1151
|
+
/**
|
|
1152
|
+
* Verification result
|
|
1153
|
+
*/
|
|
1154
|
+
200: SuccessEnvelope & {
|
|
1155
|
+
data?: DomainVerifyResult;
|
|
1156
|
+
};
|
|
1157
|
+
};
|
|
1158
|
+
type VerifyDomainResponse = VerifyDomainResponses[keyof VerifyDomainResponses];
|
|
1159
|
+
type ListEmailsData = {
|
|
1160
|
+
body?: never;
|
|
1161
|
+
path?: never;
|
|
1162
|
+
query?: {
|
|
1163
|
+
/**
|
|
1164
|
+
* Pagination cursor from a previous response's `meta.cursor` field.
|
|
1165
|
+
* Format: `{ISO-datetime}|{id}`
|
|
1166
|
+
*
|
|
1167
|
+
*/
|
|
1168
|
+
cursor?: string;
|
|
1169
|
+
/**
|
|
1170
|
+
* Number of results per page
|
|
1171
|
+
*/
|
|
1172
|
+
limit?: number;
|
|
1173
|
+
/**
|
|
1174
|
+
* Filter by domain ID
|
|
1175
|
+
*/
|
|
1176
|
+
domain_id?: string;
|
|
1177
|
+
/**
|
|
1178
|
+
* Filter by email status
|
|
1179
|
+
*/
|
|
1180
|
+
status?: 'pending' | 'accepted' | 'completed' | 'rejected';
|
|
1181
|
+
/**
|
|
1182
|
+
* Search subject, sender, and recipient (case-insensitive)
|
|
1183
|
+
*/
|
|
1184
|
+
search?: string;
|
|
1185
|
+
/**
|
|
1186
|
+
* Filter emails created on or after this timestamp
|
|
1187
|
+
*/
|
|
1188
|
+
date_from?: string;
|
|
1189
|
+
/**
|
|
1190
|
+
* Filter emails created on or before this timestamp
|
|
1191
|
+
*/
|
|
1192
|
+
date_to?: string;
|
|
1193
|
+
};
|
|
1194
|
+
url: '/emails';
|
|
1195
|
+
};
|
|
1196
|
+
type ListEmailsErrors = {
|
|
1197
|
+
/**
|
|
1198
|
+
* Invalid request parameters
|
|
1199
|
+
*/
|
|
1200
|
+
400: ErrorResponse;
|
|
1201
|
+
/**
|
|
1202
|
+
* Invalid or missing API key
|
|
1203
|
+
*/
|
|
1204
|
+
401: ErrorResponse;
|
|
1205
|
+
};
|
|
1206
|
+
type ListEmailsError = ListEmailsErrors[keyof ListEmailsErrors];
|
|
1207
|
+
type ListEmailsResponses = {
|
|
1208
|
+
/**
|
|
1209
|
+
* Paginated list of emails
|
|
1210
|
+
*/
|
|
1211
|
+
200: ListEnvelope & {
|
|
1212
|
+
data?: Array<EmailSummary>;
|
|
1213
|
+
};
|
|
1214
|
+
};
|
|
1215
|
+
type ListEmailsResponse = ListEmailsResponses[keyof ListEmailsResponses];
|
|
1216
|
+
type DeleteEmailData = {
|
|
1217
|
+
body?: never;
|
|
1218
|
+
path: {
|
|
1219
|
+
/**
|
|
1220
|
+
* Resource UUID
|
|
1221
|
+
*/
|
|
1222
|
+
id: string;
|
|
1223
|
+
};
|
|
1224
|
+
query?: never;
|
|
1225
|
+
url: '/emails/{id}';
|
|
1226
|
+
};
|
|
1227
|
+
type DeleteEmailErrors = {
|
|
1228
|
+
/**
|
|
1229
|
+
* Invalid request parameters
|
|
1230
|
+
*/
|
|
1231
|
+
400: ErrorResponse;
|
|
1232
|
+
/**
|
|
1233
|
+
* Invalid or missing API key
|
|
1234
|
+
*/
|
|
1235
|
+
401: ErrorResponse;
|
|
1236
|
+
/**
|
|
1237
|
+
* Resource not found
|
|
1238
|
+
*/
|
|
1239
|
+
404: ErrorResponse;
|
|
1240
|
+
};
|
|
1241
|
+
type DeleteEmailError = DeleteEmailErrors[keyof DeleteEmailErrors];
|
|
1242
|
+
type DeleteEmailResponses = {
|
|
1243
|
+
/**
|
|
1244
|
+
* Resource deleted
|
|
1245
|
+
*/
|
|
1246
|
+
200: SuccessEnvelope & {
|
|
1247
|
+
data?: {
|
|
1248
|
+
deleted: boolean;
|
|
1249
|
+
};
|
|
1250
|
+
};
|
|
1251
|
+
};
|
|
1252
|
+
type DeleteEmailResponse = DeleteEmailResponses[keyof DeleteEmailResponses];
|
|
1253
|
+
type GetEmailData = {
|
|
1254
|
+
body?: never;
|
|
1255
|
+
path: {
|
|
1256
|
+
/**
|
|
1257
|
+
* Resource UUID
|
|
1258
|
+
*/
|
|
1259
|
+
id: string;
|
|
1260
|
+
};
|
|
1261
|
+
query?: never;
|
|
1262
|
+
url: '/emails/{id}';
|
|
1263
|
+
};
|
|
1264
|
+
type GetEmailErrors = {
|
|
1265
|
+
/**
|
|
1266
|
+
* Invalid request parameters
|
|
1267
|
+
*/
|
|
1268
|
+
400: ErrorResponse;
|
|
1269
|
+
/**
|
|
1270
|
+
* Invalid or missing API key
|
|
1271
|
+
*/
|
|
1272
|
+
401: ErrorResponse;
|
|
1273
|
+
/**
|
|
1274
|
+
* Resource not found
|
|
1275
|
+
*/
|
|
1276
|
+
404: ErrorResponse;
|
|
1277
|
+
};
|
|
1278
|
+
type GetEmailError = GetEmailErrors[keyof GetEmailErrors];
|
|
1279
|
+
type GetEmailResponses = {
|
|
1280
|
+
/**
|
|
1281
|
+
* Email details
|
|
1282
|
+
*/
|
|
1283
|
+
200: SuccessEnvelope & {
|
|
1284
|
+
data?: EmailDetail;
|
|
1285
|
+
};
|
|
1286
|
+
};
|
|
1287
|
+
type GetEmailResponse = GetEmailResponses[keyof GetEmailResponses];
|
|
1288
|
+
type DownloadRawEmailData = {
|
|
1289
|
+
body?: never;
|
|
1290
|
+
path: {
|
|
1291
|
+
/**
|
|
1292
|
+
* Resource UUID
|
|
1293
|
+
*/
|
|
1294
|
+
id: string;
|
|
1295
|
+
};
|
|
1296
|
+
query?: {
|
|
1297
|
+
/**
|
|
1298
|
+
* Signed download token from webhook payload
|
|
1299
|
+
*/
|
|
1300
|
+
token?: string;
|
|
1301
|
+
};
|
|
1302
|
+
url: '/emails/{id}/raw';
|
|
1303
|
+
};
|
|
1304
|
+
type DownloadRawEmailErrors = {
|
|
1305
|
+
/**
|
|
1306
|
+
* Invalid request parameters
|
|
1307
|
+
*/
|
|
1308
|
+
400: ErrorResponse;
|
|
1309
|
+
/**
|
|
1310
|
+
* Invalid or missing API key
|
|
1311
|
+
*/
|
|
1312
|
+
401: ErrorResponse;
|
|
1313
|
+
/**
|
|
1314
|
+
* Resource not found
|
|
1315
|
+
*/
|
|
1316
|
+
404: ErrorResponse;
|
|
1317
|
+
};
|
|
1318
|
+
type DownloadRawEmailError = DownloadRawEmailErrors[keyof DownloadRawEmailErrors];
|
|
1319
|
+
type DownloadRawEmailResponses = {
|
|
1320
|
+
/**
|
|
1321
|
+
* Raw email file
|
|
1322
|
+
*/
|
|
1323
|
+
200: Blob | File;
|
|
1324
|
+
};
|
|
1325
|
+
type DownloadRawEmailResponse = DownloadRawEmailResponses[keyof DownloadRawEmailResponses];
|
|
1326
|
+
type DownloadAttachmentsData = {
|
|
1327
|
+
body?: never;
|
|
1328
|
+
path: {
|
|
1329
|
+
/**
|
|
1330
|
+
* Resource UUID
|
|
1331
|
+
*/
|
|
1332
|
+
id: string;
|
|
1333
|
+
};
|
|
1334
|
+
query?: {
|
|
1335
|
+
/**
|
|
1336
|
+
* Signed download token from webhook payload
|
|
1337
|
+
*/
|
|
1338
|
+
token?: string;
|
|
1339
|
+
};
|
|
1340
|
+
url: '/emails/{id}/attachments.tar.gz';
|
|
1341
|
+
};
|
|
1342
|
+
type DownloadAttachmentsErrors = {
|
|
1343
|
+
/**
|
|
1344
|
+
* Invalid request parameters
|
|
1345
|
+
*/
|
|
1346
|
+
400: ErrorResponse;
|
|
1347
|
+
/**
|
|
1348
|
+
* Invalid or missing API key
|
|
1349
|
+
*/
|
|
1350
|
+
401: ErrorResponse;
|
|
1351
|
+
/**
|
|
1352
|
+
* Resource not found
|
|
1353
|
+
*/
|
|
1354
|
+
404: ErrorResponse;
|
|
1355
|
+
};
|
|
1356
|
+
type DownloadAttachmentsError = DownloadAttachmentsErrors[keyof DownloadAttachmentsErrors];
|
|
1357
|
+
type DownloadAttachmentsResponses = {
|
|
1358
|
+
/**
|
|
1359
|
+
* Attachments archive
|
|
1360
|
+
*/
|
|
1361
|
+
200: Blob | File;
|
|
1362
|
+
};
|
|
1363
|
+
type DownloadAttachmentsResponse = DownloadAttachmentsResponses[keyof DownloadAttachmentsResponses];
|
|
1364
|
+
type ReplayEmailWebhooksData = {
|
|
1365
|
+
body?: never;
|
|
1366
|
+
path: {
|
|
1367
|
+
/**
|
|
1368
|
+
* Resource UUID
|
|
1369
|
+
*/
|
|
1370
|
+
id: string;
|
|
1371
|
+
};
|
|
1372
|
+
query?: never;
|
|
1373
|
+
url: '/emails/{id}/replay';
|
|
1374
|
+
};
|
|
1375
|
+
type ReplayEmailWebhooksErrors = {
|
|
1376
|
+
/**
|
|
1377
|
+
* Invalid request parameters
|
|
1378
|
+
*/
|
|
1379
|
+
400: ErrorResponse;
|
|
1380
|
+
/**
|
|
1381
|
+
* Invalid or missing API key
|
|
1382
|
+
*/
|
|
1383
|
+
401: ErrorResponse;
|
|
1384
|
+
/**
|
|
1385
|
+
* Resource not found
|
|
1386
|
+
*/
|
|
1387
|
+
404: ErrorResponse;
|
|
1388
|
+
/**
|
|
1389
|
+
* Rate limit exceeded
|
|
1390
|
+
*/
|
|
1391
|
+
429: ErrorResponse;
|
|
1392
|
+
};
|
|
1393
|
+
type ReplayEmailWebhooksError = ReplayEmailWebhooksErrors[keyof ReplayEmailWebhooksErrors];
|
|
1394
|
+
type ReplayEmailWebhooksResponses = {
|
|
1395
|
+
/**
|
|
1396
|
+
* Replay result
|
|
1397
|
+
*/
|
|
1398
|
+
200: SuccessEnvelope & {
|
|
1399
|
+
data?: ReplayResult;
|
|
1400
|
+
};
|
|
1401
|
+
};
|
|
1402
|
+
type ReplayEmailWebhooksResponse = ReplayEmailWebhooksResponses[keyof ReplayEmailWebhooksResponses];
|
|
1403
|
+
type ListEndpointsData = {
|
|
1404
|
+
body?: never;
|
|
1405
|
+
path?: never;
|
|
1406
|
+
query?: never;
|
|
1407
|
+
url: '/endpoints';
|
|
1408
|
+
};
|
|
1409
|
+
type ListEndpointsErrors = {
|
|
1410
|
+
/**
|
|
1411
|
+
* Invalid or missing API key
|
|
1412
|
+
*/
|
|
1413
|
+
401: ErrorResponse;
|
|
1414
|
+
};
|
|
1415
|
+
type ListEndpointsError = ListEndpointsErrors[keyof ListEndpointsErrors];
|
|
1416
|
+
type ListEndpointsResponses = {
|
|
1417
|
+
/**
|
|
1418
|
+
* List of endpoints
|
|
1419
|
+
*/
|
|
1420
|
+
200: SuccessEnvelope & {
|
|
1421
|
+
data?: Array<Endpoint>;
|
|
1422
|
+
};
|
|
1423
|
+
};
|
|
1424
|
+
type ListEndpointsResponse = ListEndpointsResponses[keyof ListEndpointsResponses];
|
|
1425
|
+
type CreateEndpointData = {
|
|
1426
|
+
body: CreateEndpointInput;
|
|
1427
|
+
path?: never;
|
|
1428
|
+
query?: never;
|
|
1429
|
+
url: '/endpoints';
|
|
1430
|
+
};
|
|
1431
|
+
type CreateEndpointErrors = {
|
|
1432
|
+
/**
|
|
1433
|
+
* Invalid request parameters
|
|
1434
|
+
*/
|
|
1435
|
+
400: ErrorResponse;
|
|
1436
|
+
/**
|
|
1437
|
+
* Invalid or missing API key
|
|
1438
|
+
*/
|
|
1439
|
+
401: ErrorResponse;
|
|
1440
|
+
};
|
|
1441
|
+
type CreateEndpointError = CreateEndpointErrors[keyof CreateEndpointErrors];
|
|
1442
|
+
type CreateEndpointResponses = {
|
|
1443
|
+
/**
|
|
1444
|
+
* Endpoint created (or reactivated)
|
|
1445
|
+
*/
|
|
1446
|
+
201: SuccessEnvelope & {
|
|
1447
|
+
data?: Endpoint;
|
|
1448
|
+
};
|
|
1449
|
+
};
|
|
1450
|
+
type CreateEndpointResponse = CreateEndpointResponses[keyof CreateEndpointResponses];
|
|
1451
|
+
type DeleteEndpointData = {
|
|
1452
|
+
body?: never;
|
|
1453
|
+
path: {
|
|
1454
|
+
/**
|
|
1455
|
+
* Resource UUID
|
|
1456
|
+
*/
|
|
1457
|
+
id: string;
|
|
1458
|
+
};
|
|
1459
|
+
query?: never;
|
|
1460
|
+
url: '/endpoints/{id}';
|
|
1461
|
+
};
|
|
1462
|
+
type DeleteEndpointErrors = {
|
|
1463
|
+
/**
|
|
1464
|
+
* Invalid request parameters
|
|
1465
|
+
*/
|
|
1466
|
+
400: ErrorResponse;
|
|
1467
|
+
/**
|
|
1468
|
+
* Invalid or missing API key
|
|
1469
|
+
*/
|
|
1470
|
+
401: ErrorResponse;
|
|
1471
|
+
/**
|
|
1472
|
+
* Resource not found
|
|
1473
|
+
*/
|
|
1474
|
+
404: ErrorResponse;
|
|
1475
|
+
};
|
|
1476
|
+
type DeleteEndpointError = DeleteEndpointErrors[keyof DeleteEndpointErrors];
|
|
1477
|
+
type DeleteEndpointResponses = {
|
|
1478
|
+
/**
|
|
1479
|
+
* Resource deleted
|
|
1480
|
+
*/
|
|
1481
|
+
200: SuccessEnvelope & {
|
|
1482
|
+
data?: {
|
|
1483
|
+
deleted: boolean;
|
|
1484
|
+
};
|
|
1485
|
+
};
|
|
1486
|
+
};
|
|
1487
|
+
type DeleteEndpointResponse = DeleteEndpointResponses[keyof DeleteEndpointResponses];
|
|
1488
|
+
type UpdateEndpointData = {
|
|
1489
|
+
body: UpdateEndpointInput;
|
|
1490
|
+
path: {
|
|
1491
|
+
/**
|
|
1492
|
+
* Resource UUID
|
|
1493
|
+
*/
|
|
1494
|
+
id: string;
|
|
1495
|
+
};
|
|
1496
|
+
query?: never;
|
|
1497
|
+
url: '/endpoints/{id}';
|
|
1498
|
+
};
|
|
1499
|
+
type UpdateEndpointErrors = {
|
|
1500
|
+
/**
|
|
1501
|
+
* Invalid request parameters
|
|
1502
|
+
*/
|
|
1503
|
+
400: ErrorResponse;
|
|
1504
|
+
/**
|
|
1505
|
+
* Invalid or missing API key
|
|
1506
|
+
*/
|
|
1507
|
+
401: ErrorResponse;
|
|
1508
|
+
/**
|
|
1509
|
+
* Resource not found
|
|
1510
|
+
*/
|
|
1511
|
+
404: ErrorResponse;
|
|
1512
|
+
};
|
|
1513
|
+
type UpdateEndpointError = UpdateEndpointErrors[keyof UpdateEndpointErrors];
|
|
1514
|
+
type UpdateEndpointResponses = {
|
|
1515
|
+
/**
|
|
1516
|
+
* Updated endpoint
|
|
1517
|
+
*/
|
|
1518
|
+
200: SuccessEnvelope & {
|
|
1519
|
+
data?: Endpoint;
|
|
1520
|
+
};
|
|
1521
|
+
};
|
|
1522
|
+
type UpdateEndpointResponse = UpdateEndpointResponses[keyof UpdateEndpointResponses];
|
|
1523
|
+
type TestEndpointData = {
|
|
1524
|
+
body?: never;
|
|
1525
|
+
path: {
|
|
1526
|
+
/**
|
|
1527
|
+
* Resource UUID
|
|
1528
|
+
*/
|
|
1529
|
+
id: string;
|
|
1530
|
+
};
|
|
1531
|
+
query?: never;
|
|
1532
|
+
url: '/endpoints/{id}/test';
|
|
1533
|
+
};
|
|
1534
|
+
type TestEndpointErrors = {
|
|
1535
|
+
/**
|
|
1536
|
+
* Invalid request parameters
|
|
1537
|
+
*/
|
|
1538
|
+
400: ErrorResponse;
|
|
1539
|
+
/**
|
|
1540
|
+
* Invalid or missing API key
|
|
1541
|
+
*/
|
|
1542
|
+
401: ErrorResponse;
|
|
1543
|
+
/**
|
|
1544
|
+
* Resource not found
|
|
1545
|
+
*/
|
|
1546
|
+
404: ErrorResponse;
|
|
1547
|
+
/**
|
|
1548
|
+
* Rate limit exceeded
|
|
1549
|
+
*/
|
|
1550
|
+
429: ErrorResponse;
|
|
1551
|
+
};
|
|
1552
|
+
type TestEndpointError = TestEndpointErrors[keyof TestEndpointErrors];
|
|
1553
|
+
type TestEndpointResponses = {
|
|
1554
|
+
/**
|
|
1555
|
+
* Test result
|
|
1556
|
+
*/
|
|
1557
|
+
200: SuccessEnvelope & {
|
|
1558
|
+
data?: TestResult;
|
|
1559
|
+
};
|
|
1560
|
+
};
|
|
1561
|
+
type TestEndpointResponse = TestEndpointResponses[keyof TestEndpointResponses];
|
|
1562
|
+
type ListFiltersData = {
|
|
1563
|
+
body?: never;
|
|
1564
|
+
path?: never;
|
|
1565
|
+
query?: never;
|
|
1566
|
+
url: '/filters';
|
|
1567
|
+
};
|
|
1568
|
+
type ListFiltersErrors = {
|
|
1569
|
+
/**
|
|
1570
|
+
* Invalid or missing API key
|
|
1571
|
+
*/
|
|
1572
|
+
401: ErrorResponse;
|
|
1573
|
+
};
|
|
1574
|
+
type ListFiltersError = ListFiltersErrors[keyof ListFiltersErrors];
|
|
1575
|
+
type ListFiltersResponses = {
|
|
1576
|
+
/**
|
|
1577
|
+
* List of filters
|
|
1578
|
+
*/
|
|
1579
|
+
200: SuccessEnvelope & {
|
|
1580
|
+
data?: Array<Filter>;
|
|
1581
|
+
};
|
|
1582
|
+
};
|
|
1583
|
+
type ListFiltersResponse = ListFiltersResponses[keyof ListFiltersResponses];
|
|
1584
|
+
type CreateFilterData = {
|
|
1585
|
+
body: CreateFilterInput;
|
|
1586
|
+
path?: never;
|
|
1587
|
+
query?: never;
|
|
1588
|
+
url: '/filters';
|
|
1589
|
+
};
|
|
1590
|
+
type CreateFilterErrors = {
|
|
1591
|
+
/**
|
|
1592
|
+
* Invalid request parameters
|
|
1593
|
+
*/
|
|
1594
|
+
400: ErrorResponse;
|
|
1595
|
+
/**
|
|
1596
|
+
* Invalid or missing API key
|
|
1597
|
+
*/
|
|
1598
|
+
401: ErrorResponse;
|
|
1599
|
+
/**
|
|
1600
|
+
* Resource not found
|
|
1601
|
+
*/
|
|
1602
|
+
404: ErrorResponse;
|
|
1603
|
+
};
|
|
1604
|
+
type CreateFilterError = CreateFilterErrors[keyof CreateFilterErrors];
|
|
1605
|
+
type CreateFilterResponses = {
|
|
1606
|
+
/**
|
|
1607
|
+
* Filter created
|
|
1608
|
+
*/
|
|
1609
|
+
201: SuccessEnvelope & {
|
|
1610
|
+
data?: Filter;
|
|
1611
|
+
};
|
|
1612
|
+
};
|
|
1613
|
+
type CreateFilterResponse = CreateFilterResponses[keyof CreateFilterResponses];
|
|
1614
|
+
type DeleteFilterData = {
|
|
1615
|
+
body?: never;
|
|
1616
|
+
path: {
|
|
1617
|
+
/**
|
|
1618
|
+
* Resource UUID
|
|
1619
|
+
*/
|
|
1620
|
+
id: string;
|
|
1621
|
+
};
|
|
1622
|
+
query?: never;
|
|
1623
|
+
url: '/filters/{id}';
|
|
1624
|
+
};
|
|
1625
|
+
type DeleteFilterErrors = {
|
|
1626
|
+
/**
|
|
1627
|
+
* Invalid request parameters
|
|
1628
|
+
*/
|
|
1629
|
+
400: ErrorResponse;
|
|
1630
|
+
/**
|
|
1631
|
+
* Invalid or missing API key
|
|
1632
|
+
*/
|
|
1633
|
+
401: ErrorResponse;
|
|
1634
|
+
/**
|
|
1635
|
+
* Resource not found
|
|
1636
|
+
*/
|
|
1637
|
+
404: ErrorResponse;
|
|
1638
|
+
};
|
|
1639
|
+
type DeleteFilterError = DeleteFilterErrors[keyof DeleteFilterErrors];
|
|
1640
|
+
type DeleteFilterResponses = {
|
|
1641
|
+
/**
|
|
1642
|
+
* Resource deleted
|
|
1643
|
+
*/
|
|
1644
|
+
200: SuccessEnvelope & {
|
|
1645
|
+
data?: {
|
|
1646
|
+
deleted: boolean;
|
|
1647
|
+
};
|
|
1648
|
+
};
|
|
1649
|
+
};
|
|
1650
|
+
type DeleteFilterResponse = DeleteFilterResponses[keyof DeleteFilterResponses];
|
|
1651
|
+
type UpdateFilterData = {
|
|
1652
|
+
body: UpdateFilterInput;
|
|
1653
|
+
path: {
|
|
1654
|
+
/**
|
|
1655
|
+
* Resource UUID
|
|
1656
|
+
*/
|
|
1657
|
+
id: string;
|
|
1658
|
+
};
|
|
1659
|
+
query?: never;
|
|
1660
|
+
url: '/filters/{id}';
|
|
1661
|
+
};
|
|
1662
|
+
type UpdateFilterErrors = {
|
|
1663
|
+
/**
|
|
1664
|
+
* Invalid request parameters
|
|
1665
|
+
*/
|
|
1666
|
+
400: ErrorResponse;
|
|
1667
|
+
/**
|
|
1668
|
+
* Invalid or missing API key
|
|
1669
|
+
*/
|
|
1670
|
+
401: ErrorResponse;
|
|
1671
|
+
/**
|
|
1672
|
+
* Resource not found
|
|
1673
|
+
*/
|
|
1674
|
+
404: ErrorResponse;
|
|
1675
|
+
};
|
|
1676
|
+
type UpdateFilterError = UpdateFilterErrors[keyof UpdateFilterErrors];
|
|
1677
|
+
type UpdateFilterResponses = {
|
|
1678
|
+
/**
|
|
1679
|
+
* Updated filter
|
|
1680
|
+
*/
|
|
1681
|
+
200: SuccessEnvelope & {
|
|
1682
|
+
data?: Filter;
|
|
1683
|
+
};
|
|
1684
|
+
};
|
|
1685
|
+
type UpdateFilterResponse = UpdateFilterResponses[keyof UpdateFilterResponses];
|
|
1686
|
+
type ListDeliveriesData = {
|
|
1687
|
+
body?: never;
|
|
1688
|
+
path?: never;
|
|
1689
|
+
query?: {
|
|
1690
|
+
/**
|
|
1691
|
+
* Pagination cursor from a previous response's `meta.cursor` field.
|
|
1692
|
+
* Format: `{ISO-datetime}|{id}`
|
|
1693
|
+
*
|
|
1694
|
+
*/
|
|
1695
|
+
cursor?: string;
|
|
1696
|
+
/**
|
|
1697
|
+
* Number of results per page
|
|
1698
|
+
*/
|
|
1699
|
+
limit?: number;
|
|
1700
|
+
/**
|
|
1701
|
+
* Filter by email ID
|
|
1702
|
+
*/
|
|
1703
|
+
email_id?: string;
|
|
1704
|
+
/**
|
|
1705
|
+
* Filter by delivery status
|
|
1706
|
+
*/
|
|
1707
|
+
status?: 'pending' | 'delivered' | 'header_confirmed' | 'failed';
|
|
1708
|
+
/**
|
|
1709
|
+
* Filter deliveries created on or after this timestamp
|
|
1710
|
+
*/
|
|
1711
|
+
date_from?: string;
|
|
1712
|
+
/**
|
|
1713
|
+
* Filter deliveries created on or before this timestamp
|
|
1714
|
+
*/
|
|
1715
|
+
date_to?: string;
|
|
1716
|
+
};
|
|
1717
|
+
url: '/webhooks/deliveries';
|
|
1718
|
+
};
|
|
1719
|
+
type ListDeliveriesErrors = {
|
|
1720
|
+
/**
|
|
1721
|
+
* Invalid request parameters
|
|
1722
|
+
*/
|
|
1723
|
+
400: ErrorResponse;
|
|
1724
|
+
/**
|
|
1725
|
+
* Invalid or missing API key
|
|
1726
|
+
*/
|
|
1727
|
+
401: ErrorResponse;
|
|
1728
|
+
};
|
|
1729
|
+
type ListDeliveriesError = ListDeliveriesErrors[keyof ListDeliveriesErrors];
|
|
1730
|
+
type ListDeliveriesResponses = {
|
|
1731
|
+
/**
|
|
1732
|
+
* Paginated list of deliveries
|
|
1733
|
+
*/
|
|
1734
|
+
200: ListEnvelope & {
|
|
1735
|
+
data?: Array<DeliverySummary>;
|
|
1736
|
+
};
|
|
1737
|
+
};
|
|
1738
|
+
type ListDeliveriesResponse = ListDeliveriesResponses[keyof ListDeliveriesResponses];
|
|
1739
|
+
type ReplayDeliveryData = {
|
|
1740
|
+
body?: never;
|
|
1741
|
+
path: {
|
|
1742
|
+
/**
|
|
1743
|
+
* Delivery ID (numeric)
|
|
1744
|
+
*/
|
|
1745
|
+
id: string;
|
|
1746
|
+
};
|
|
1747
|
+
query?: never;
|
|
1748
|
+
url: '/webhooks/deliveries/{id}/replay';
|
|
1749
|
+
};
|
|
1750
|
+
type ReplayDeliveryErrors = {
|
|
1751
|
+
/**
|
|
1752
|
+
* Invalid request parameters
|
|
1753
|
+
*/
|
|
1754
|
+
400: ErrorResponse;
|
|
1755
|
+
/**
|
|
1756
|
+
* Invalid or missing API key
|
|
1757
|
+
*/
|
|
1758
|
+
401: ErrorResponse;
|
|
1759
|
+
/**
|
|
1760
|
+
* Resource not found
|
|
1761
|
+
*/
|
|
1762
|
+
404: ErrorResponse;
|
|
1763
|
+
/**
|
|
1764
|
+
* Rate limit exceeded
|
|
1765
|
+
*/
|
|
1766
|
+
429: ErrorResponse;
|
|
1767
|
+
};
|
|
1768
|
+
type ReplayDeliveryError = ReplayDeliveryErrors[keyof ReplayDeliveryErrors];
|
|
1769
|
+
type ReplayDeliveryResponses = {
|
|
1770
|
+
/**
|
|
1771
|
+
* Replay result
|
|
1772
|
+
*/
|
|
1773
|
+
200: SuccessEnvelope & {
|
|
1774
|
+
data?: ReplayResult;
|
|
1775
|
+
};
|
|
1776
|
+
};
|
|
1777
|
+
type ReplayDeliveryResponse = ReplayDeliveryResponses[keyof ReplayDeliveryResponses];
|
|
1778
|
+
type SendEmailData = {
|
|
1779
|
+
body: SendMailInput;
|
|
1780
|
+
headers?: {
|
|
1781
|
+
/**
|
|
1782
|
+
* Optional customer-supplied idempotency key. If omitted, Primitive
|
|
1783
|
+
* derives one from the canonical request payload and echoes the
|
|
1784
|
+
* effective value in the `Idempotency-Key` response header.
|
|
1785
|
+
*
|
|
1786
|
+
*/
|
|
1787
|
+
'Idempotency-Key'?: string;
|
|
1788
|
+
};
|
|
1789
|
+
path?: never;
|
|
1790
|
+
query?: never;
|
|
1791
|
+
url: '/send-mail';
|
|
1792
|
+
};
|
|
1793
|
+
type SendEmailErrors = {
|
|
1794
|
+
/**
|
|
1795
|
+
* Invalid request parameters
|
|
1796
|
+
*/
|
|
1797
|
+
400: ErrorResponse;
|
|
1798
|
+
/**
|
|
1799
|
+
* Invalid or missing API key
|
|
1800
|
+
*/
|
|
1801
|
+
401: ErrorResponse;
|
|
1802
|
+
/**
|
|
1803
|
+
* Authenticated caller lacks permission for the operation
|
|
1804
|
+
*/
|
|
1805
|
+
403: ErrorResponse;
|
|
1806
|
+
/**
|
|
1807
|
+
* Rate limit exceeded
|
|
1808
|
+
*/
|
|
1809
|
+
429: ErrorResponse;
|
|
1810
|
+
/**
|
|
1811
|
+
* Primitive encountered an internal error
|
|
1812
|
+
*/
|
|
1813
|
+
500: ErrorResponse;
|
|
1814
|
+
/**
|
|
1815
|
+
* Primitive could not complete the downstream SMTP request
|
|
1816
|
+
*/
|
|
1817
|
+
502: ErrorResponse;
|
|
1818
|
+
/**
|
|
1819
|
+
* Primitive is temporarily unable to process the request
|
|
1820
|
+
*/
|
|
1821
|
+
503: ErrorResponse;
|
|
1822
|
+
};
|
|
1823
|
+
type SendEmailError = SendEmailErrors[keyof SendEmailErrors];
|
|
1824
|
+
type SendEmailResponses = {
|
|
1825
|
+
/**
|
|
1826
|
+
* Outbound relay result
|
|
1827
|
+
*/
|
|
1828
|
+
200: SuccessEnvelope & {
|
|
1829
|
+
data?: SendMailResult;
|
|
1830
|
+
};
|
|
1831
|
+
};
|
|
1832
|
+
type SendEmailResponse = SendEmailResponses[keyof SendEmailResponses]; //#endregion
|
|
1833
|
+
//#region src/api/generated/sdk.gen.d.ts
|
|
1834
|
+
declare namespace sdk_gen_d_exports {
|
|
1835
|
+
export { Options$1 as Options, addDomain, createEndpoint, createFilter, deleteDomain, deleteEmail, deleteEndpoint, deleteFilter, downloadAttachments, downloadRawEmail, getAccount, getEmail, getStorageStats, getWebhookSecret, listDeliveries, listDomains, listEmails, listEndpoints, listFilters, replayDelivery, replayEmailWebhooks, rotateWebhookSecret, sendEmail, testEndpoint, updateAccount, updateDomain, updateEndpoint, updateFilter, verifyDomain };
|
|
1836
|
+
}
|
|
1837
|
+
type Options$1<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options$2<TData, ThrowOnError, TResponse> & {
|
|
1838
|
+
/**
|
|
1839
|
+
* You can provide a client instance returned by `createClient()` instead of
|
|
1840
|
+
* individual options. This might be also useful if you want to implement a
|
|
1841
|
+
* custom client.
|
|
1842
|
+
*/
|
|
1843
|
+
client?: Client;
|
|
1844
|
+
/**
|
|
1845
|
+
* You can pass arbitrary values through the `meta` object. This can be
|
|
1846
|
+
* used to access values that aren't defined as part of the SDK function.
|
|
1847
|
+
*/
|
|
1848
|
+
meta?: Record<string, unknown>;
|
|
1849
|
+
};
|
|
1850
|
+
/**
|
|
1851
|
+
* Get account info
|
|
1852
|
+
*/
|
|
1853
|
+
declare const getAccount: <ThrowOnError extends boolean = false>(options?: Options$1<GetAccountData, ThrowOnError>) => RequestResult<GetAccountResponses, GetAccountErrors, ThrowOnError, "fields">;
|
|
1854
|
+
/**
|
|
1855
|
+
* Update account settings
|
|
1856
|
+
*/
|
|
1857
|
+
declare const updateAccount: <ThrowOnError extends boolean = false>(options: Options$1<UpdateAccountData, ThrowOnError>) => RequestResult<UpdateAccountResponses, UpdateAccountErrors, ThrowOnError, "fields">;
|
|
1858
|
+
/**
|
|
1859
|
+
* Get storage usage
|
|
1860
|
+
*/
|
|
1861
|
+
declare const getStorageStats: <ThrowOnError extends boolean = false>(options?: Options$1<GetStorageStatsData, ThrowOnError>) => RequestResult<GetStorageStatsResponses, GetStorageStatsErrors, ThrowOnError, "fields">;
|
|
1862
|
+
/**
|
|
1863
|
+
* Get webhook signing secret
|
|
1864
|
+
*
|
|
1865
|
+
* Returns the webhook signing secret for your account. If no secret
|
|
1866
|
+
* exists yet, one is generated automatically on first access.
|
|
1867
|
+
*
|
|
1868
|
+
*/
|
|
1869
|
+
declare const getWebhookSecret: <ThrowOnError extends boolean = false>(options?: Options$1<GetWebhookSecretData, ThrowOnError>) => RequestResult<GetWebhookSecretResponses, GetWebhookSecretErrors, ThrowOnError, "fields">;
|
|
1870
|
+
/**
|
|
1871
|
+
* Rotate webhook signing secret
|
|
1872
|
+
*
|
|
1873
|
+
* Generates a new webhook signing secret, replacing the current one.
|
|
1874
|
+
* Rate limited to once per 60 minutes.
|
|
1875
|
+
*
|
|
1876
|
+
*/
|
|
1877
|
+
declare const rotateWebhookSecret: <ThrowOnError extends boolean = false>(options?: Options$1<RotateWebhookSecretData, ThrowOnError>) => RequestResult<RotateWebhookSecretResponses, RotateWebhookSecretErrors, ThrowOnError, "fields">;
|
|
1878
|
+
/**
|
|
1879
|
+
* List all domains
|
|
1880
|
+
*
|
|
1881
|
+
* Returns all verified and unverified domains for your organization,
|
|
1882
|
+
* sorted by creation date (newest first). Each domain includes a
|
|
1883
|
+
* `verified` boolean to distinguish between the two states.
|
|
1884
|
+
*
|
|
1885
|
+
*/
|
|
1886
|
+
declare const listDomains: <ThrowOnError extends boolean = false>(options?: Options$1<ListDomainsData, ThrowOnError>) => RequestResult<ListDomainsResponses, ListDomainsErrors, ThrowOnError, "fields">;
|
|
1887
|
+
/**
|
|
1888
|
+
* Claim a new domain
|
|
1889
|
+
*
|
|
1890
|
+
* Creates an unverified domain claim. You will receive a
|
|
1891
|
+
* `verification_token` to add as a DNS TXT record before
|
|
1892
|
+
* calling the verify endpoint.
|
|
1893
|
+
*
|
|
1894
|
+
*/
|
|
1895
|
+
declare const addDomain: <ThrowOnError extends boolean = false>(options: Options$1<AddDomainData, ThrowOnError>) => RequestResult<AddDomainResponses, AddDomainErrors, ThrowOnError, "fields">;
|
|
1896
|
+
/**
|
|
1897
|
+
* Delete a domain
|
|
1898
|
+
*
|
|
1899
|
+
* Deletes a verified or unverified domain claim.
|
|
1900
|
+
*/
|
|
1901
|
+
declare const deleteDomain: <ThrowOnError extends boolean = false>(options: Options$1<DeleteDomainData, ThrowOnError>) => RequestResult<DeleteDomainResponses, DeleteDomainErrors, ThrowOnError, "fields">;
|
|
1902
|
+
/**
|
|
1903
|
+
* Update domain settings
|
|
1904
|
+
*
|
|
1905
|
+
* Update a verified domain's settings. Only verified domains can be
|
|
1906
|
+
* updated. Per-domain spam thresholds require a Pro plan.
|
|
1907
|
+
*
|
|
1908
|
+
*/
|
|
1909
|
+
declare const updateDomain: <ThrowOnError extends boolean = false>(options: Options$1<UpdateDomainData, ThrowOnError>) => RequestResult<UpdateDomainResponses, UpdateDomainErrors, ThrowOnError, "fields">;
|
|
1910
|
+
/**
|
|
1911
|
+
* Verify domain ownership
|
|
1912
|
+
*
|
|
1913
|
+
* Checks DNS records (MX and TXT) to verify domain ownership.
|
|
1914
|
+
* On success, the domain is promoted from unverified to verified.
|
|
1915
|
+
* On failure, returns which checks passed and which failed.
|
|
1916
|
+
*
|
|
1917
|
+
*/
|
|
1918
|
+
declare const verifyDomain: <ThrowOnError extends boolean = false>(options: Options$1<VerifyDomainData, ThrowOnError>) => RequestResult<VerifyDomainResponses, VerifyDomainErrors, ThrowOnError, "fields">;
|
|
1919
|
+
/**
|
|
1920
|
+
* List emails
|
|
1921
|
+
*
|
|
1922
|
+
* Returns a paginated list of received emails. Supports filtering by
|
|
1923
|
+
* domain, status, date range, and free-text search across subject,
|
|
1924
|
+
* sender, and recipient fields.
|
|
1925
|
+
*
|
|
1926
|
+
*/
|
|
1927
|
+
declare const listEmails: <ThrowOnError extends boolean = false>(options?: Options$1<ListEmailsData, ThrowOnError>) => RequestResult<ListEmailsResponses, ListEmailsErrors, ThrowOnError, "fields">;
|
|
1928
|
+
/**
|
|
1929
|
+
* Delete an email
|
|
1930
|
+
*/
|
|
1931
|
+
declare const deleteEmail: <ThrowOnError extends boolean = false>(options: Options$1<DeleteEmailData, ThrowOnError>) => RequestResult<DeleteEmailResponses, DeleteEmailErrors, ThrowOnError, "fields">;
|
|
1932
|
+
/**
|
|
1933
|
+
* Get email details
|
|
1934
|
+
*/
|
|
1935
|
+
declare const getEmail: <ThrowOnError extends boolean = false>(options: Options$1<GetEmailData, ThrowOnError>) => RequestResult<GetEmailResponses, GetEmailErrors, ThrowOnError, "fields">;
|
|
1936
|
+
/**
|
|
1937
|
+
* Download raw email
|
|
1938
|
+
*
|
|
1939
|
+
* Downloads the raw RFC 822 email file (.eml). Authenticates via
|
|
1940
|
+
* a signed download token (provided in webhook payloads) or a
|
|
1941
|
+
* valid session.
|
|
1942
|
+
*
|
|
1943
|
+
*/
|
|
1944
|
+
declare const downloadRawEmail: <ThrowOnError extends boolean = false>(options: Options$1<DownloadRawEmailData, ThrowOnError>) => RequestResult<DownloadRawEmailResponses, DownloadRawEmailErrors, ThrowOnError, "fields">;
|
|
1945
|
+
/**
|
|
1946
|
+
* Download email attachments
|
|
1947
|
+
*
|
|
1948
|
+
* Downloads all attachments as a gzip-compressed tar archive.
|
|
1949
|
+
* Authenticates via a signed download token (provided in webhook
|
|
1950
|
+
* payloads) or a valid session.
|
|
1951
|
+
*
|
|
1952
|
+
*/
|
|
1953
|
+
declare const downloadAttachments: <ThrowOnError extends boolean = false>(options: Options$1<DownloadAttachmentsData, ThrowOnError>) => RequestResult<DownloadAttachmentsResponses, DownloadAttachmentsErrors, ThrowOnError, "fields">;
|
|
1954
|
+
/**
|
|
1955
|
+
* Replay email webhooks
|
|
1956
|
+
*
|
|
1957
|
+
* Re-delivers the webhook payload for this email to all active
|
|
1958
|
+
* endpoints matching the email's domain. Rate limited per-email
|
|
1959
|
+
* (short cooldown between successive replays of the same email)
|
|
1960
|
+
* and per-org (burst + sustained windows), sharing an org-wide
|
|
1961
|
+
* budget with delivery replays.
|
|
1962
|
+
*
|
|
1963
|
+
*/
|
|
1964
|
+
declare const replayEmailWebhooks: <ThrowOnError extends boolean = false>(options: Options$1<ReplayEmailWebhooksData, ThrowOnError>) => RequestResult<ReplayEmailWebhooksResponses, ReplayEmailWebhooksErrors, ThrowOnError, "fields">;
|
|
1965
|
+
/**
|
|
1966
|
+
* List webhook endpoints
|
|
1967
|
+
*
|
|
1968
|
+
* Returns all active (non-deleted) webhook endpoints.
|
|
1969
|
+
*/
|
|
1970
|
+
declare const listEndpoints: <ThrowOnError extends boolean = false>(options?: Options$1<ListEndpointsData, ThrowOnError>) => RequestResult<ListEndpointsResponses, ListEndpointsErrors, ThrowOnError, "fields">;
|
|
1971
|
+
/**
|
|
1972
|
+
* Create a webhook endpoint
|
|
1973
|
+
*
|
|
1974
|
+
* Creates a new webhook endpoint. If a deactivated endpoint with the
|
|
1975
|
+
* same URL and domain exists, it is reactivated instead.
|
|
1976
|
+
* Subject to plan limits on the number of active endpoints.
|
|
1977
|
+
*
|
|
1978
|
+
*/
|
|
1979
|
+
declare const createEndpoint: <ThrowOnError extends boolean = false>(options: Options$1<CreateEndpointData, ThrowOnError>) => RequestResult<CreateEndpointResponses, CreateEndpointErrors, ThrowOnError, "fields">;
|
|
1980
|
+
/**
|
|
1981
|
+
* Delete a webhook endpoint
|
|
1982
|
+
*
|
|
1983
|
+
* Soft-deletes a webhook endpoint. The endpoint will no longer
|
|
1984
|
+
* receive webhook deliveries.
|
|
1985
|
+
*
|
|
1986
|
+
*/
|
|
1987
|
+
declare const deleteEndpoint: <ThrowOnError extends boolean = false>(options: Options$1<DeleteEndpointData, ThrowOnError>) => RequestResult<DeleteEndpointResponses, DeleteEndpointErrors, ThrowOnError, "fields">;
|
|
1988
|
+
/**
|
|
1989
|
+
* Update a webhook endpoint
|
|
1990
|
+
*
|
|
1991
|
+
* Updates an active webhook endpoint. If the URL is changed, the old
|
|
1992
|
+
* endpoint is deactivated and a new one is created (or an existing
|
|
1993
|
+
* deactivated endpoint with the new URL is reactivated).
|
|
1994
|
+
*
|
|
1995
|
+
*/
|
|
1996
|
+
declare const updateEndpoint: <ThrowOnError extends boolean = false>(options: Options$1<UpdateEndpointData, ThrowOnError>) => RequestResult<UpdateEndpointResponses, UpdateEndpointErrors, ThrowOnError, "fields">;
|
|
1997
|
+
/**
|
|
1998
|
+
* Send a test webhook
|
|
1999
|
+
*
|
|
2000
|
+
* Sends a sample `email.received` event to the endpoint. The request
|
|
2001
|
+
* includes SSRF protection (private IP rejection and DNS pinning).
|
|
2002
|
+
* Rate limited to 4 per minute and 30 per hour (non-exempt).
|
|
2003
|
+
* Successful deliveries and verified-domain endpoints are exempt
|
|
2004
|
+
* from the rate limit.
|
|
2005
|
+
*
|
|
2006
|
+
*/
|
|
2007
|
+
declare const testEndpoint: <ThrowOnError extends boolean = false>(options: Options$1<TestEndpointData, ThrowOnError>) => RequestResult<TestEndpointResponses, TestEndpointErrors, ThrowOnError, "fields">;
|
|
2008
|
+
/**
|
|
2009
|
+
* List filter rules
|
|
2010
|
+
*
|
|
2011
|
+
* Returns all whitelist and blocklist filter rules.
|
|
2012
|
+
*/
|
|
2013
|
+
declare const listFilters: <ThrowOnError extends boolean = false>(options?: Options$1<ListFiltersData, ThrowOnError>) => RequestResult<ListFiltersResponses, ListFiltersErrors, ThrowOnError, "fields">;
|
|
2014
|
+
/**
|
|
2015
|
+
* Create a filter rule
|
|
2016
|
+
*
|
|
2017
|
+
* Creates a new whitelist or blocklist filter. Per-domain filters
|
|
2018
|
+
* require a Pro plan. Patterns are stored as lowercase.
|
|
2019
|
+
*
|
|
2020
|
+
*/
|
|
2021
|
+
declare const createFilter: <ThrowOnError extends boolean = false>(options: Options$1<CreateFilterData, ThrowOnError>) => RequestResult<CreateFilterResponses, CreateFilterErrors, ThrowOnError, "fields">;
|
|
2022
|
+
/**
|
|
2023
|
+
* Delete a filter rule
|
|
2024
|
+
*/
|
|
2025
|
+
declare const deleteFilter: <ThrowOnError extends boolean = false>(options: Options$1<DeleteFilterData, ThrowOnError>) => RequestResult<DeleteFilterResponses, DeleteFilterErrors, ThrowOnError, "fields">;
|
|
2026
|
+
/**
|
|
2027
|
+
* Update a filter rule
|
|
2028
|
+
*
|
|
2029
|
+
* Toggle a filter's enabled state.
|
|
2030
|
+
*/
|
|
2031
|
+
declare const updateFilter: <ThrowOnError extends boolean = false>(options: Options$1<UpdateFilterData, ThrowOnError>) => RequestResult<UpdateFilterResponses, UpdateFilterErrors, ThrowOnError, "fields">;
|
|
2032
|
+
/**
|
|
2033
|
+
* List webhook deliveries
|
|
2034
|
+
*
|
|
2035
|
+
* Returns a paginated list of webhook delivery attempts. Each delivery
|
|
2036
|
+
* includes a nested `email` object with sender, recipient, and subject.
|
|
2037
|
+
*
|
|
2038
|
+
*/
|
|
2039
|
+
declare const listDeliveries: <ThrowOnError extends boolean = false>(options?: Options$1<ListDeliveriesData, ThrowOnError>) => RequestResult<ListDeliveriesResponses, ListDeliveriesErrors, ThrowOnError, "fields">;
|
|
2040
|
+
/**
|
|
2041
|
+
* Replay a webhook delivery
|
|
2042
|
+
*
|
|
2043
|
+
* Re-sends the stored webhook payload from a previous delivery attempt.
|
|
2044
|
+
* If the original endpoint is still active, it is targeted. If the
|
|
2045
|
+
* original endpoint was deleted, the oldest active endpoint is used.
|
|
2046
|
+
* Deactivated endpoints cannot be replayed to. Rate limited per-org,
|
|
2047
|
+
* sharing an org-wide budget with email replays.
|
|
2048
|
+
*
|
|
2049
|
+
*/
|
|
2050
|
+
declare const replayDelivery: <ThrowOnError extends boolean = false>(options: Options$1<ReplayDeliveryData, ThrowOnError>) => RequestResult<ReplayDeliveryResponses, ReplayDeliveryErrors, ThrowOnError, "fields">;
|
|
2051
|
+
/**
|
|
2052
|
+
* Send outbound email
|
|
2053
|
+
*
|
|
2054
|
+
* Sends an outbound email through Primitive's outbound relay. By default
|
|
2055
|
+
* the request returns once the relay accepts the message for delivery.
|
|
2056
|
+
* Set `wait: true` to wait for the first downstream SMTP delivery outcome.
|
|
2057
|
+
*
|
|
2058
|
+
*/
|
|
2059
|
+
declare const sendEmail: <ThrowOnError extends boolean = false>(options: Options$1<SendEmailData, ThrowOnError>) => RequestResult<SendEmailResponses, SendEmailErrors, ThrowOnError, "fields">;
|
|
2060
|
+
|
|
2061
|
+
//#endregion
|
|
2062
|
+
//#region src/api/index.d.ts
|
|
2063
|
+
declare const DEFAULT_BASE_URL = "https://www.primitive.dev/api/v1";
|
|
2064
|
+
interface PrimitiveApiClientOptions extends Omit<Config, "auth" | "baseUrl"> {
|
|
2065
|
+
apiKey?: string;
|
|
2066
|
+
auth?: Config["auth"];
|
|
2067
|
+
baseUrl?: string;
|
|
2068
|
+
}
|
|
2069
|
+
interface SendThreadInput {
|
|
2070
|
+
inReplyTo?: string;
|
|
2071
|
+
references?: string[];
|
|
2072
|
+
}
|
|
2073
|
+
interface SendInput {
|
|
2074
|
+
from: string;
|
|
2075
|
+
to: string;
|
|
2076
|
+
subject: string;
|
|
2077
|
+
bodyText?: string;
|
|
2078
|
+
bodyHtml?: string;
|
|
2079
|
+
thread?: SendThreadInput;
|
|
2080
|
+
wait?: boolean;
|
|
2081
|
+
waitTimeoutMs?: number;
|
|
2082
|
+
idempotencyKey?: string;
|
|
2083
|
+
}
|
|
2084
|
+
type ReplyInput = string | {
|
|
2085
|
+
text: string;
|
|
2086
|
+
subject?: string;
|
|
2087
|
+
from?: string;
|
|
2088
|
+
};
|
|
2089
|
+
interface ForwardInput {
|
|
2090
|
+
to: string;
|
|
2091
|
+
bodyText?: string;
|
|
2092
|
+
subject?: string;
|
|
2093
|
+
from?: string;
|
|
2094
|
+
}
|
|
2095
|
+
interface SendResult {
|
|
2096
|
+
id: string;
|
|
2097
|
+
status: SendMailResult["status"];
|
|
2098
|
+
queueId: string | null;
|
|
2099
|
+
accepted: string[];
|
|
2100
|
+
rejected: string[];
|
|
2101
|
+
clientIdempotencyKey: string;
|
|
2102
|
+
requestId: string;
|
|
2103
|
+
contentHash: string;
|
|
2104
|
+
deliveryStatus?: SendMailResult["delivery_status"];
|
|
2105
|
+
smtpResponseCode?: number | null;
|
|
2106
|
+
smtpResponseText?: string;
|
|
2107
|
+
}
|
|
2108
|
+
type PrimitiveApiErrorDetails = NonNullable<ErrorResponse["error"]["details"]>;
|
|
2109
|
+
declare class PrimitiveApiError extends Error {
|
|
2110
|
+
readonly status: number | undefined;
|
|
2111
|
+
readonly code: string | undefined;
|
|
2112
|
+
readonly gates: GateDenial[] | undefined;
|
|
2113
|
+
readonly requestId: string | undefined;
|
|
2114
|
+
readonly retryAfter: number | undefined;
|
|
2115
|
+
readonly details: PrimitiveApiErrorDetails | undefined;
|
|
2116
|
+
readonly payload: unknown;
|
|
2117
|
+
constructor(message: string, options: {
|
|
2118
|
+
payload: unknown;
|
|
2119
|
+
status?: number;
|
|
2120
|
+
code?: string;
|
|
2121
|
+
gates?: GateDenial[];
|
|
2122
|
+
requestId?: string;
|
|
2123
|
+
retryAfter?: number;
|
|
2124
|
+
details?: PrimitiveApiErrorDetails;
|
|
2125
|
+
});
|
|
2126
|
+
}
|
|
2127
|
+
declare class PrimitiveApiClient {
|
|
2128
|
+
readonly client: Client;
|
|
2129
|
+
constructor(options?: PrimitiveApiClientOptions);
|
|
2130
|
+
getConfig(): Config<ClientOptions$1>;
|
|
2131
|
+
setConfig(config: Config): Config<ClientOptions$1>;
|
|
2132
|
+
}
|
|
2133
|
+
type PrimitiveClientOptions = PrimitiveApiClientOptions;
|
|
2134
|
+
declare class PrimitiveClient extends PrimitiveApiClient {
|
|
2135
|
+
send(input: SendInput): Promise<SendResult>;
|
|
2136
|
+
reply(email: ReceivedEmail, input: ReplyInput): Promise<SendResult>;
|
|
2137
|
+
forward(email: ReceivedEmail, input: ForwardInput): Promise<SendResult>;
|
|
2138
|
+
}
|
|
2139
|
+
declare function createPrimitiveApiClient(options?: PrimitiveApiClientOptions): PrimitiveApiClient;
|
|
2140
|
+
declare function createPrimitiveClient(options?: PrimitiveClientOptions): PrimitiveClient;
|
|
2141
|
+
declare function client(options?: PrimitiveClientOptions): PrimitiveClient;
|
|
2142
|
+
declare const operations: typeof sdk_gen_d_exports;
|
|
2143
|
+
|
|
2144
|
+
//#endregion
|
|
2145
|
+
export { Account, AccountUpdated, AddDomainData, AddDomainError, AddDomainErrors, AddDomainInput, AddDomainResponse, AddDomainResponses, Auth, Client, ClientOptions, ClientOptions$1, Config, CreateClientConfig, CreateEndpointData, CreateEndpointError, CreateEndpointErrors, CreateEndpointInput, CreateEndpointResponse, CreateEndpointResponses, CreateFilterData, CreateFilterError, CreateFilterErrors, CreateFilterInput, CreateFilterResponse, CreateFilterResponses, Cursor, DEFAULT_BASE_URL as DEFAULT_BASE_URL$1, DeleteDomainData, DeleteDomainError, DeleteDomainErrors, DeleteDomainResponse, DeleteDomainResponses, DeleteEmailData, DeleteEmailError, DeleteEmailErrors, DeleteEmailResponse, DeleteEmailResponses, DeleteEndpointData, DeleteEndpointError, DeleteEndpointErrors, DeleteEndpointResponse, DeleteEndpointResponses, DeleteFilterData, DeleteFilterError, DeleteFilterErrors, DeleteFilterResponse, DeleteFilterResponses, DeliveryStatus, DeliverySummary, Domain, DomainVerifyResult, DownloadAttachmentsData, DownloadAttachmentsError, DownloadAttachmentsErrors, DownloadAttachmentsResponse, DownloadAttachmentsResponses, DownloadRawEmailData, DownloadRawEmailError, DownloadRawEmailErrors, DownloadRawEmailResponse, DownloadRawEmailResponses, EmailDetail, EmailSummary, Endpoint, ErrorResponse, Filter, ForwardInput, GateDenial, GateFix, GetAccountData, GetAccountError, GetAccountErrors, GetAccountResponse, GetAccountResponses, GetEmailData, GetEmailError, GetEmailErrors, GetEmailResponse, GetEmailResponses, GetStorageStatsData, GetStorageStatsError, GetStorageStatsErrors, GetStorageStatsResponse, GetStorageStatsResponses, GetWebhookSecretData, GetWebhookSecretError, GetWebhookSecretErrors, GetWebhookSecretResponse, GetWebhookSecretResponses, Limit, ListDeliveriesData, ListDeliveriesError, ListDeliveriesErrors, ListDeliveriesResponse, ListDeliveriesResponses, ListDomainsData, ListDomainsError, ListDomainsErrors, ListDomainsResponse, ListDomainsResponses, ListEmailsData, ListEmailsError, ListEmailsErrors, ListEmailsResponse, ListEmailsResponses, ListEndpointsData, ListEndpointsError, ListEndpointsErrors, ListEndpointsResponse, ListEndpointsResponses, ListEnvelope, ListFiltersData, ListFiltersError, ListFiltersErrors, ListFiltersResponse, ListFiltersResponses, Options$1 as Options, Options$2 as Options$1, PaginationMeta, PrimitiveApiClient as PrimitiveApiClient$1, PrimitiveApiClientOptions, PrimitiveApiError as PrimitiveApiError$1, PrimitiveApiErrorDetails, PrimitiveClient as PrimitiveClient$1, PrimitiveClientOptions, ReplayDeliveryData, ReplayDeliveryError, ReplayDeliveryErrors, ReplayDeliveryResponse, ReplayDeliveryResponses, ReplayEmailWebhooksData, ReplayEmailWebhooksError, ReplayEmailWebhooksErrors, ReplayEmailWebhooksResponse, ReplayEmailWebhooksResponses, ReplayResult, ReplyInput, RequestOptions, RequestResult, ResourceId, ResponseStyle, RotateWebhookSecretData, RotateWebhookSecretError, RotateWebhookSecretErrors, RotateWebhookSecretResponse, RotateWebhookSecretResponses, SendEmailData, SendEmailError, SendEmailErrors, SendEmailResponse, SendEmailResponses, SendInput, SendMailInput, SendMailResult, SendResult, SendThreadInput, SentEmailStatus, StorageStats, SuccessEnvelope, TestEndpointData, TestEndpointError, TestEndpointErrors, TestEndpointResponse, TestEndpointResponses, TestResult, UnverifiedDomain, UpdateAccountData, UpdateAccountError, UpdateAccountErrors, UpdateAccountInput, UpdateAccountResponse, UpdateAccountResponses, UpdateDomainData, UpdateDomainError, UpdateDomainErrors, UpdateDomainInput, UpdateDomainResponse, UpdateDomainResponses, UpdateEndpointData, UpdateEndpointError, UpdateEndpointErrors, UpdateEndpointInput, UpdateEndpointResponse, UpdateEndpointResponses, UpdateFilterData, UpdateFilterError, UpdateFilterErrors, UpdateFilterInput, UpdateFilterResponse, UpdateFilterResponses, VerifiedDomain, VerifyDomainData, VerifyDomainError, VerifyDomainErrors, VerifyDomainResponse, VerifyDomainResponses, WebhookSecret, addDomain as addDomain$1, client as client$1, createEndpoint as createEndpoint$1, createFilter as createFilter$1, createPrimitiveApiClient as createPrimitiveApiClient$1, createPrimitiveClient as createPrimitiveClient$1, deleteDomain as deleteDomain$1, deleteEmail as deleteEmail$1, deleteEndpoint as deleteEndpoint$1, deleteFilter as deleteFilter$1, downloadAttachments as downloadAttachments$1, downloadRawEmail as downloadRawEmail$1, getAccount as getAccount$1, getEmail as getEmail$1, getStorageStats as getStorageStats$1, getWebhookSecret as getWebhookSecret$1, listDeliveries as listDeliveries$1, listDomains as listDomains$1, listEmails as listEmails$1, listEndpoints as listEndpoints$1, listFilters as listFilters$1, operations as operations$1, replayDelivery as replayDelivery$1, replayEmailWebhooks as replayEmailWebhooks$1, rotateWebhookSecret as rotateWebhookSecret$1, sendEmail as sendEmail$1, testEndpoint as testEndpoint$1, updateAccount as updateAccount$1, updateDomain as updateDomain$1, updateEndpoint as updateEndpoint$1, updateFilter as updateFilter$1, verifyDomain as verifyDomain$1 };
|