@otterlabs/blocx 0.1.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -5
- package/dist/index.cjs +442 -539
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +553 -54
- package/dist/index.d.ts +553 -54
- package/dist/index.js +439 -538
- package/dist/index.js.map +1 -1
- package/package.json +4 -7
package/dist/index.d.ts
CHANGED
|
@@ -27,12 +27,19 @@ type ArrayStyle = "form" | "spaceDelimited" | "pipeDelimited";
|
|
|
27
27
|
type ObjectStyle = "form" | "deepObject";
|
|
28
28
|
|
|
29
29
|
type QuerySerializer = (query: Record<string, unknown>) => string;
|
|
30
|
-
type BodySerializer = (body:
|
|
31
|
-
|
|
30
|
+
type BodySerializer = (body: unknown) => unknown;
|
|
31
|
+
type QuerySerializerOptionsObject = {
|
|
32
32
|
allowReserved?: boolean;
|
|
33
|
-
array?: SerializerOptions<ArrayStyle
|
|
34
|
-
object?: SerializerOptions<ObjectStyle
|
|
35
|
-
}
|
|
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
|
+
};
|
|
36
43
|
|
|
37
44
|
type HttpMethod = "connect" | "delete" | "get" | "head" | "options" | "patch" | "post" | "put" | "trace";
|
|
38
45
|
type Client$1<RequestFn = never, Config = unknown, MethodFn = never, BuildUrlFn = never, SseFn = never> = {
|
|
@@ -95,7 +102,7 @@ interface Config$1 {
|
|
|
95
102
|
requestValidator?: (data: unknown) => Promise<unknown>;
|
|
96
103
|
/**
|
|
97
104
|
* A function transforming response data before it's returned. This is useful
|
|
98
|
-
* for post-processing data, e.g
|
|
105
|
+
* for post-processing data, e.g., converting ISO strings into Date objects.
|
|
99
106
|
*/
|
|
100
107
|
responseTransformer?: (data: unknown) => Promise<unknown>;
|
|
101
108
|
/**
|
|
@@ -176,7 +183,11 @@ type ServerSentEventsResult<TData = unknown, TReturn = void, TNext = unknown> =
|
|
|
176
183
|
stream: AsyncGenerator<TData extends Record<string, unknown> ? TData[keyof TData] : TData, TReturn, TNext>;
|
|
177
184
|
};
|
|
178
185
|
|
|
179
|
-
type ErrInterceptor<Err, Res, Req, Options> = (error: Err,
|
|
186
|
+
type ErrInterceptor<Err, Res, Req, Options> = (error: Err,
|
|
187
|
+
/** response may be undefined due to a network error where no response object is produced */
|
|
188
|
+
response: Res | undefined,
|
|
189
|
+
/** request may be undefined, because error may be from building the request object itself */
|
|
190
|
+
request: Req | undefined, options: Options) => Err | Promise<Err>;
|
|
180
191
|
type ReqInterceptor<Req, Options> = (request: Req, options: Options) => Req | Promise<Req>;
|
|
181
192
|
type ResInterceptor<Res, Req, Options> = (response: Res, request: Req, options: Options) => Res | Promise<Res>;
|
|
182
193
|
declare class Interceptors<Interceptor> {
|
|
@@ -239,7 +250,7 @@ interface Config<T extends ClientOptions$1 = ClientOptions$1> extends Omit<Reque
|
|
|
239
250
|
interface RequestOptions<TData = unknown, TResponseStyle extends ResponseStyle = "fields", ThrowOnError extends boolean = boolean, Url extends string = string> extends Config<{
|
|
240
251
|
responseStyle: TResponseStyle;
|
|
241
252
|
throwOnError: ThrowOnError;
|
|
242
|
-
}>, Pick<ServerSentEventsOptions<TData>, "onSseError" | "onSseEvent" | "sseDefaultRetryDelay" | "sseMaxRetryAttempts" | "sseMaxRetryDelay"> {
|
|
253
|
+
}>, Pick<ServerSentEventsOptions<TData>, "onRequest" | "onSseError" | "onSseEvent" | "sseDefaultRetryDelay" | "sseMaxRetryAttempts" | "sseMaxRetryDelay"> {
|
|
243
254
|
/**
|
|
244
255
|
* Any body that you want to add to your request.
|
|
245
256
|
*
|
|
@@ -255,6 +266,7 @@ interface RequestOptions<TData = unknown, TResponseStyle extends ResponseStyle =
|
|
|
255
266
|
url: Url;
|
|
256
267
|
}
|
|
257
268
|
interface ResolvedRequestOptions<TResponseStyle extends ResponseStyle = "fields", ThrowOnError extends boolean = boolean, Url extends string = string> extends RequestOptions<unknown, TResponseStyle, ThrowOnError, Url> {
|
|
269
|
+
headers: Headers;
|
|
258
270
|
serializedBody?: string;
|
|
259
271
|
}
|
|
260
272
|
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,8 +280,10 @@ type RequestResult<TData = unknown, TError = unknown, ThrowOnError extends boole
|
|
|
268
280
|
data: undefined;
|
|
269
281
|
error: TError extends Record<string, unknown> ? TError[keyof TError] : TError;
|
|
270
282
|
}) & {
|
|
271
|
-
request
|
|
272
|
-
|
|
283
|
+
/** request may be undefined, because error may be from building the request object itself */
|
|
284
|
+
request?: Request;
|
|
285
|
+
/** response may be undefined, because error may be from building the request object itself or from a network error */
|
|
286
|
+
response?: Response;
|
|
273
287
|
}>;
|
|
274
288
|
interface ClientOptions$1 {
|
|
275
289
|
baseUrl?: string;
|
|
@@ -277,14 +291,14 @@ interface ClientOptions$1 {
|
|
|
277
291
|
throwOnError?: boolean;
|
|
278
292
|
}
|
|
279
293
|
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>;
|
|
280
|
-
type SseFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = "fields">(options: Omit<RequestOptions<
|
|
294
|
+
type SseFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = "fields">(options: Omit<RequestOptions<never, TResponseStyle, ThrowOnError>, "method">) => Promise<ServerSentEventsResult<TData, TError>>;
|
|
281
295
|
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>;
|
|
282
296
|
type BuildUrlFn = <TData extends {
|
|
283
297
|
body?: unknown;
|
|
284
298
|
path?: Record<string, unknown>;
|
|
285
299
|
query?: Record<string, unknown>;
|
|
286
300
|
url: string;
|
|
287
|
-
}>(options:
|
|
301
|
+
}>(options: TData & Options$1<TData>) => string;
|
|
288
302
|
type Client = Client$1<RequestFn, Config, MethodFn, BuildUrlFn, SseFn> & {
|
|
289
303
|
interceptors: Middleware<Request, Response, unknown, ResolvedRequestOptions>;
|
|
290
304
|
};
|
|
@@ -296,7 +310,7 @@ interface TDataShape {
|
|
|
296
310
|
url: string;
|
|
297
311
|
}
|
|
298
312
|
type OmitKeys<T, K> = Pick<T, Exclude<keyof T, K>>;
|
|
299
|
-
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"> & Omit<TData, "url"
|
|
313
|
+
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">);
|
|
300
314
|
|
|
301
315
|
type ClientOptions = {
|
|
302
316
|
baseUrl: `${string}://${string}` | (string & {});
|
|
@@ -341,7 +355,7 @@ type BrandDetail = Brand & {
|
|
|
341
355
|
* Derived stage for UI display. Computed from status, sharingStatus, dcaCompletedAt, and mnoStatus.
|
|
342
356
|
*/
|
|
343
357
|
type ProvisioningStage = "REGISTERING" | "REGISTRATION_FAILED" | "PENDING_SHARE" | "SHARE_REJECTED" | "SHARED" | "DCA_COMPLETE" | "LIVE" | "PARTIAL" | "SUSPENDED" | "EXPIRED";
|
|
344
|
-
type
|
|
358
|
+
type Error = {
|
|
345
359
|
/**
|
|
346
360
|
* Human-readable error message
|
|
347
361
|
*/
|
|
@@ -485,6 +499,85 @@ type SentEmail = {
|
|
|
485
499
|
domain: string;
|
|
486
500
|
sentAt: string;
|
|
487
501
|
};
|
|
502
|
+
type Mailbox = {
|
|
503
|
+
id: number;
|
|
504
|
+
/**
|
|
505
|
+
* Full inbound address
|
|
506
|
+
*/
|
|
507
|
+
address: string;
|
|
508
|
+
/**
|
|
509
|
+
* Optional human-readable label
|
|
510
|
+
*/
|
|
511
|
+
label: string | null;
|
|
512
|
+
createdAt: string;
|
|
513
|
+
updatedAt: string;
|
|
514
|
+
};
|
|
515
|
+
type InboundEmailSummary = {
|
|
516
|
+
messageId: string;
|
|
517
|
+
receivedAt: string;
|
|
518
|
+
from: Array<{
|
|
519
|
+
name: string | null;
|
|
520
|
+
address: string;
|
|
521
|
+
}>;
|
|
522
|
+
to: Array<{
|
|
523
|
+
name: string | null;
|
|
524
|
+
address: string;
|
|
525
|
+
}>;
|
|
526
|
+
cc: Array<{
|
|
527
|
+
name: string | null;
|
|
528
|
+
address: string;
|
|
529
|
+
}>;
|
|
530
|
+
subject: string | null;
|
|
531
|
+
spam: boolean;
|
|
532
|
+
attachments: Array<{
|
|
533
|
+
filename: string;
|
|
534
|
+
contentType: string;
|
|
535
|
+
size: number;
|
|
536
|
+
}>;
|
|
537
|
+
};
|
|
538
|
+
type InboundEmailDetail = {
|
|
539
|
+
messageId: string;
|
|
540
|
+
receivedAt: string;
|
|
541
|
+
subject: string | null;
|
|
542
|
+
from: Array<{
|
|
543
|
+
name: string | null;
|
|
544
|
+
address: string;
|
|
545
|
+
}>;
|
|
546
|
+
to: Array<{
|
|
547
|
+
name: string | null;
|
|
548
|
+
address: string;
|
|
549
|
+
}>;
|
|
550
|
+
cc: Array<{
|
|
551
|
+
name: string | null;
|
|
552
|
+
address: string;
|
|
553
|
+
}>;
|
|
554
|
+
bcc: Array<{
|
|
555
|
+
name: string | null;
|
|
556
|
+
address: string;
|
|
557
|
+
}>;
|
|
558
|
+
replyTo: Array<{
|
|
559
|
+
name: string | null;
|
|
560
|
+
address: string;
|
|
561
|
+
}>;
|
|
562
|
+
/**
|
|
563
|
+
* Date header from the message itself
|
|
564
|
+
*/
|
|
565
|
+
date: string | null;
|
|
566
|
+
text: string | null;
|
|
567
|
+
html: string | null;
|
|
568
|
+
headers: Array<{
|
|
569
|
+
key: string;
|
|
570
|
+
line: string;
|
|
571
|
+
}>;
|
|
572
|
+
spam: boolean;
|
|
573
|
+
attachments: Array<{
|
|
574
|
+
index: number;
|
|
575
|
+
filename: string | null;
|
|
576
|
+
contentType: string;
|
|
577
|
+
size: number;
|
|
578
|
+
contentId: string | null;
|
|
579
|
+
}>;
|
|
580
|
+
};
|
|
488
581
|
type Verification = {
|
|
489
582
|
verificationId: string;
|
|
490
583
|
status: "pending" | "approved" | "expired" | "failed";
|
|
@@ -603,6 +696,25 @@ type PhoneOrder = {
|
|
|
603
696
|
capabilities: Array<string>;
|
|
604
697
|
}>;
|
|
605
698
|
};
|
|
699
|
+
type Webhook = {
|
|
700
|
+
id: number;
|
|
701
|
+
/**
|
|
702
|
+
* Stable, URL-safe identifier (use this in API paths)
|
|
703
|
+
*/
|
|
704
|
+
publicId: string;
|
|
705
|
+
url: string;
|
|
706
|
+
description: string | null;
|
|
707
|
+
eventTypes: Array<"message.sent" | "message.delivered" | "message.failed" | "message.received" | "email.delivered" | "email.bounced" | "email.complained" | "email.opened" | "email.clicked" | "email.received">;
|
|
708
|
+
enabled: boolean;
|
|
709
|
+
createdAt: string;
|
|
710
|
+
updatedAt: string;
|
|
711
|
+
};
|
|
712
|
+
type WebhookWithSecret = Webhook & {
|
|
713
|
+
/**
|
|
714
|
+
* HMAC-SHA256 signing secret. Returned ONLY at creation time — store it securely.
|
|
715
|
+
*/
|
|
716
|
+
signingSecret: string;
|
|
717
|
+
};
|
|
606
718
|
type ListBrandsData = {
|
|
607
719
|
body?: never;
|
|
608
720
|
path?: never;
|
|
@@ -674,7 +786,7 @@ type GetBrandErrors = {
|
|
|
674
786
|
/**
|
|
675
787
|
* Not found
|
|
676
788
|
*/
|
|
677
|
-
404:
|
|
789
|
+
404: Error;
|
|
678
790
|
};
|
|
679
791
|
type GetBrandError = GetBrandErrors[keyof GetBrandErrors];
|
|
680
792
|
type GetBrandResponses = {
|
|
@@ -699,7 +811,7 @@ type GetBrandFeedbackErrors = {
|
|
|
699
811
|
/**
|
|
700
812
|
* Not found
|
|
701
813
|
*/
|
|
702
|
-
404:
|
|
814
|
+
404: Error;
|
|
703
815
|
};
|
|
704
816
|
type GetBrandFeedbackError = GetBrandFeedbackErrors[keyof GetBrandFeedbackErrors];
|
|
705
817
|
type GetBrandFeedbackResponses = {
|
|
@@ -781,7 +893,7 @@ type GetCampaignErrors = {
|
|
|
781
893
|
/**
|
|
782
894
|
* Not found
|
|
783
895
|
*/
|
|
784
|
-
404:
|
|
896
|
+
404: Error;
|
|
785
897
|
};
|
|
786
898
|
type GetCampaignError = GetCampaignErrors[keyof GetCampaignErrors];
|
|
787
899
|
type GetCampaignResponses = {
|
|
@@ -905,7 +1017,7 @@ type GetComplianceEventErrors = {
|
|
|
905
1017
|
/**
|
|
906
1018
|
* Not found
|
|
907
1019
|
*/
|
|
908
|
-
404:
|
|
1020
|
+
404: Error;
|
|
909
1021
|
};
|
|
910
1022
|
type GetComplianceEventError = GetComplianceEventErrors[keyof GetComplianceEventErrors];
|
|
911
1023
|
type GetComplianceEventResponses = {
|
|
@@ -974,15 +1086,15 @@ type CreateEmailIdentityErrors = {
|
|
|
974
1086
|
/**
|
|
975
1087
|
* Plan does not allow multiple domains
|
|
976
1088
|
*/
|
|
977
|
-
402:
|
|
1089
|
+
402: Error;
|
|
978
1090
|
/**
|
|
979
1091
|
* Already exists
|
|
980
1092
|
*/
|
|
981
|
-
409:
|
|
1093
|
+
409: Error;
|
|
982
1094
|
/**
|
|
983
1095
|
* Email not enabled
|
|
984
1096
|
*/
|
|
985
|
-
412:
|
|
1097
|
+
412: Error;
|
|
986
1098
|
};
|
|
987
1099
|
type CreateEmailIdentityError = CreateEmailIdentityErrors[keyof CreateEmailIdentityErrors];
|
|
988
1100
|
type CreateEmailIdentityResponses = {
|
|
@@ -1007,7 +1119,7 @@ type DeleteEmailIdentityErrors = {
|
|
|
1007
1119
|
/**
|
|
1008
1120
|
* Not found
|
|
1009
1121
|
*/
|
|
1010
|
-
404:
|
|
1122
|
+
404: Error;
|
|
1011
1123
|
};
|
|
1012
1124
|
type DeleteEmailIdentityError = DeleteEmailIdentityErrors[keyof DeleteEmailIdentityErrors];
|
|
1013
1125
|
type DeleteEmailIdentityResponses = {
|
|
@@ -1034,7 +1146,7 @@ type GetEmailIdentityErrors = {
|
|
|
1034
1146
|
/**
|
|
1035
1147
|
* Not found
|
|
1036
1148
|
*/
|
|
1037
|
-
404:
|
|
1149
|
+
404: Error;
|
|
1038
1150
|
};
|
|
1039
1151
|
type GetEmailIdentityError = GetEmailIdentityErrors[keyof GetEmailIdentityErrors];
|
|
1040
1152
|
type GetEmailIdentityResponses = {
|
|
@@ -1079,7 +1191,7 @@ type SendEmailIdentityTestErrors = {
|
|
|
1079
1191
|
/**
|
|
1080
1192
|
* Domain not verified
|
|
1081
1193
|
*/
|
|
1082
|
-
412:
|
|
1194
|
+
412: Error;
|
|
1083
1195
|
};
|
|
1084
1196
|
type SendEmailIdentityTestError = SendEmailIdentityTestErrors[keyof SendEmailIdentityTestErrors];
|
|
1085
1197
|
type SendEmailIdentityTestResponses = {
|
|
@@ -1120,6 +1232,199 @@ type GetEmailHistoryResponses = {
|
|
|
1120
1232
|
};
|
|
1121
1233
|
};
|
|
1122
1234
|
type GetEmailHistoryResponse = GetEmailHistoryResponses[keyof GetEmailHistoryResponses];
|
|
1235
|
+
type ListMailboxesData = {
|
|
1236
|
+
body?: never;
|
|
1237
|
+
path?: never;
|
|
1238
|
+
query?: never;
|
|
1239
|
+
url: "/mailboxes";
|
|
1240
|
+
};
|
|
1241
|
+
type ListMailboxesResponses = {
|
|
1242
|
+
/**
|
|
1243
|
+
* Mailboxes
|
|
1244
|
+
*/
|
|
1245
|
+
200: {
|
|
1246
|
+
mailboxes: Array<Mailbox>;
|
|
1247
|
+
};
|
|
1248
|
+
};
|
|
1249
|
+
type ListMailboxesResponse = ListMailboxesResponses[keyof ListMailboxesResponses];
|
|
1250
|
+
type CreateMailboxData = {
|
|
1251
|
+
body?: {
|
|
1252
|
+
/**
|
|
1253
|
+
* Optional label, up to 120 chars
|
|
1254
|
+
*/
|
|
1255
|
+
label?: string | null;
|
|
1256
|
+
};
|
|
1257
|
+
path?: never;
|
|
1258
|
+
query?: never;
|
|
1259
|
+
url: "/mailboxes";
|
|
1260
|
+
};
|
|
1261
|
+
type CreateMailboxResponses = {
|
|
1262
|
+
/**
|
|
1263
|
+
* Created
|
|
1264
|
+
*/
|
|
1265
|
+
201: Mailbox;
|
|
1266
|
+
};
|
|
1267
|
+
type CreateMailboxResponse = CreateMailboxResponses[keyof CreateMailboxResponses];
|
|
1268
|
+
type DeleteMailboxData = {
|
|
1269
|
+
body?: never;
|
|
1270
|
+
path?: {
|
|
1271
|
+
/**
|
|
1272
|
+
* Resource ID
|
|
1273
|
+
*/
|
|
1274
|
+
id?: number | null;
|
|
1275
|
+
};
|
|
1276
|
+
query?: never;
|
|
1277
|
+
url: "/mailboxes/{id}";
|
|
1278
|
+
};
|
|
1279
|
+
type DeleteMailboxErrors = {
|
|
1280
|
+
/**
|
|
1281
|
+
* Not found
|
|
1282
|
+
*/
|
|
1283
|
+
404: Error;
|
|
1284
|
+
};
|
|
1285
|
+
type DeleteMailboxError = DeleteMailboxErrors[keyof DeleteMailboxErrors];
|
|
1286
|
+
type DeleteMailboxResponses = {
|
|
1287
|
+
/**
|
|
1288
|
+
* Deleted
|
|
1289
|
+
*/
|
|
1290
|
+
200: {
|
|
1291
|
+
success: true;
|
|
1292
|
+
};
|
|
1293
|
+
};
|
|
1294
|
+
type DeleteMailboxResponse = DeleteMailboxResponses[keyof DeleteMailboxResponses];
|
|
1295
|
+
type UpdateMailboxData = {
|
|
1296
|
+
body?: {
|
|
1297
|
+
/**
|
|
1298
|
+
* Optional label, up to 120 chars
|
|
1299
|
+
*/
|
|
1300
|
+
label?: string | null;
|
|
1301
|
+
};
|
|
1302
|
+
path?: {
|
|
1303
|
+
/**
|
|
1304
|
+
* Resource ID
|
|
1305
|
+
*/
|
|
1306
|
+
id?: number | null;
|
|
1307
|
+
};
|
|
1308
|
+
query?: never;
|
|
1309
|
+
url: "/mailboxes/{id}";
|
|
1310
|
+
};
|
|
1311
|
+
type UpdateMailboxErrors = {
|
|
1312
|
+
/**
|
|
1313
|
+
* Not found
|
|
1314
|
+
*/
|
|
1315
|
+
404: Error;
|
|
1316
|
+
};
|
|
1317
|
+
type UpdateMailboxError = UpdateMailboxErrors[keyof UpdateMailboxErrors];
|
|
1318
|
+
type UpdateMailboxResponses = {
|
|
1319
|
+
/**
|
|
1320
|
+
* Updated
|
|
1321
|
+
*/
|
|
1322
|
+
200: Mailbox;
|
|
1323
|
+
};
|
|
1324
|
+
type UpdateMailboxResponse = UpdateMailboxResponses[keyof UpdateMailboxResponses];
|
|
1325
|
+
type ListMailboxMessagesData = {
|
|
1326
|
+
body?: never;
|
|
1327
|
+
path?: {
|
|
1328
|
+
/**
|
|
1329
|
+
* Resource ID
|
|
1330
|
+
*/
|
|
1331
|
+
id?: number | null;
|
|
1332
|
+
};
|
|
1333
|
+
query?: {
|
|
1334
|
+
/**
|
|
1335
|
+
* Max results (default 50, max 100)
|
|
1336
|
+
*/
|
|
1337
|
+
limit?: number;
|
|
1338
|
+
/**
|
|
1339
|
+
* Cursor for next page
|
|
1340
|
+
*/
|
|
1341
|
+
nextToken?: string;
|
|
1342
|
+
/**
|
|
1343
|
+
* Filter: receivedAt >= start
|
|
1344
|
+
*/
|
|
1345
|
+
start?: string;
|
|
1346
|
+
/**
|
|
1347
|
+
* Filter: receivedAt <= end
|
|
1348
|
+
*/
|
|
1349
|
+
end?: string;
|
|
1350
|
+
};
|
|
1351
|
+
url: "/mailboxes/{id}/messages";
|
|
1352
|
+
};
|
|
1353
|
+
type ListMailboxMessagesErrors = {
|
|
1354
|
+
/**
|
|
1355
|
+
* Mailbox not found
|
|
1356
|
+
*/
|
|
1357
|
+
404: Error;
|
|
1358
|
+
};
|
|
1359
|
+
type ListMailboxMessagesError = ListMailboxMessagesErrors[keyof ListMailboxMessagesErrors];
|
|
1360
|
+
type ListMailboxMessagesResponses = {
|
|
1361
|
+
/**
|
|
1362
|
+
* Messages
|
|
1363
|
+
*/
|
|
1364
|
+
200: {
|
|
1365
|
+
emails: Array<InboundEmailSummary>;
|
|
1366
|
+
nextToken?: string;
|
|
1367
|
+
};
|
|
1368
|
+
};
|
|
1369
|
+
type ListMailboxMessagesResponse = ListMailboxMessagesResponses[keyof ListMailboxMessagesResponses];
|
|
1370
|
+
type GetMailboxMessageData = {
|
|
1371
|
+
body?: never;
|
|
1372
|
+
path: {
|
|
1373
|
+
/**
|
|
1374
|
+
* Mailbox ID
|
|
1375
|
+
*/
|
|
1376
|
+
id: number;
|
|
1377
|
+
/**
|
|
1378
|
+
* Inbound message ID
|
|
1379
|
+
*/
|
|
1380
|
+
messageId: string;
|
|
1381
|
+
};
|
|
1382
|
+
query?: never;
|
|
1383
|
+
url: "/mailboxes/{id}/messages/{messageId}";
|
|
1384
|
+
};
|
|
1385
|
+
type GetMailboxMessageErrors = {
|
|
1386
|
+
/**
|
|
1387
|
+
* Mailbox or message not found
|
|
1388
|
+
*/
|
|
1389
|
+
404: Error;
|
|
1390
|
+
};
|
|
1391
|
+
type GetMailboxMessageError = GetMailboxMessageErrors[keyof GetMailboxMessageErrors];
|
|
1392
|
+
type GetMailboxMessageResponses = {
|
|
1393
|
+
/**
|
|
1394
|
+
* Parsed message
|
|
1395
|
+
*/
|
|
1396
|
+
200: InboundEmailDetail;
|
|
1397
|
+
};
|
|
1398
|
+
type GetMailboxMessageResponse = GetMailboxMessageResponses[keyof GetMailboxMessageResponses];
|
|
1399
|
+
type GetMailboxMessageRawData = {
|
|
1400
|
+
body?: never;
|
|
1401
|
+
path: {
|
|
1402
|
+
/**
|
|
1403
|
+
* Mailbox ID
|
|
1404
|
+
*/
|
|
1405
|
+
id: number;
|
|
1406
|
+
/**
|
|
1407
|
+
* Inbound message ID
|
|
1408
|
+
*/
|
|
1409
|
+
messageId: string;
|
|
1410
|
+
};
|
|
1411
|
+
query?: never;
|
|
1412
|
+
url: "/mailboxes/{id}/messages/{messageId}/raw";
|
|
1413
|
+
};
|
|
1414
|
+
type GetMailboxMessageRawErrors = {
|
|
1415
|
+
/**
|
|
1416
|
+
* Mailbox or message not found
|
|
1417
|
+
*/
|
|
1418
|
+
404: Error;
|
|
1419
|
+
};
|
|
1420
|
+
type GetMailboxMessageRawError = GetMailboxMessageRawErrors[keyof GetMailboxMessageRawErrors];
|
|
1421
|
+
type GetMailboxMessageRawResponses = {
|
|
1422
|
+
/**
|
|
1423
|
+
* Raw MIME
|
|
1424
|
+
*/
|
|
1425
|
+
200: Blob | File;
|
|
1426
|
+
};
|
|
1427
|
+
type GetMailboxMessageRawResponse = GetMailboxMessageRawResponses[keyof GetMailboxMessageRawResponses];
|
|
1123
1428
|
type GetBalanceData = {
|
|
1124
1429
|
body?: never;
|
|
1125
1430
|
path?: never;
|
|
@@ -1221,7 +1526,7 @@ type SendMessageErrors = {
|
|
|
1221
1526
|
/**
|
|
1222
1527
|
* Rate limited
|
|
1223
1528
|
*/
|
|
1224
|
-
429:
|
|
1529
|
+
429: Error;
|
|
1225
1530
|
};
|
|
1226
1531
|
type SendMessageError = SendMessageErrors[keyof SendMessageErrors];
|
|
1227
1532
|
type SendMessageResponses = {
|
|
@@ -1265,11 +1570,11 @@ type SendEmailErrors = {
|
|
|
1265
1570
|
/**
|
|
1266
1571
|
* Domain not verified
|
|
1267
1572
|
*/
|
|
1268
|
-
403:
|
|
1573
|
+
403: Error;
|
|
1269
1574
|
/**
|
|
1270
1575
|
* Rate limited
|
|
1271
1576
|
*/
|
|
1272
|
-
429:
|
|
1577
|
+
429: Error;
|
|
1273
1578
|
};
|
|
1274
1579
|
type SendEmailError = SendEmailErrors[keyof SendEmailErrors];
|
|
1275
1580
|
type SendEmailResponses = {
|
|
@@ -1319,15 +1624,15 @@ type CreateVerificationErrors = {
|
|
|
1319
1624
|
/**
|
|
1320
1625
|
* Template not found
|
|
1321
1626
|
*/
|
|
1322
|
-
404:
|
|
1627
|
+
404: Error;
|
|
1323
1628
|
/**
|
|
1324
1629
|
* Template not approved
|
|
1325
1630
|
*/
|
|
1326
|
-
422:
|
|
1631
|
+
422: Error;
|
|
1327
1632
|
/**
|
|
1328
1633
|
* Rate limited
|
|
1329
1634
|
*/
|
|
1330
|
-
429:
|
|
1635
|
+
429: Error;
|
|
1331
1636
|
};
|
|
1332
1637
|
type CreateVerificationError = CreateVerificationErrors[keyof CreateVerificationErrors];
|
|
1333
1638
|
type CreateVerificationResponses = {
|
|
@@ -1357,11 +1662,11 @@ type CheckVerificationErrors = {
|
|
|
1357
1662
|
/**
|
|
1358
1663
|
* Verification not found
|
|
1359
1664
|
*/
|
|
1360
|
-
404:
|
|
1665
|
+
404: Error;
|
|
1361
1666
|
/**
|
|
1362
1667
|
* Rate limited
|
|
1363
1668
|
*/
|
|
1364
|
-
429:
|
|
1669
|
+
429: Error;
|
|
1365
1670
|
};
|
|
1366
1671
|
type CheckVerificationError = CheckVerificationErrors[keyof CheckVerificationErrors];
|
|
1367
1672
|
type CheckVerificationResponses = {
|
|
@@ -1424,11 +1729,11 @@ type DeleteTwofaTemplateErrors = {
|
|
|
1424
1729
|
/**
|
|
1425
1730
|
* Not found
|
|
1426
1731
|
*/
|
|
1427
|
-
404:
|
|
1732
|
+
404: Error;
|
|
1428
1733
|
/**
|
|
1429
1734
|
* Template under review
|
|
1430
1735
|
*/
|
|
1431
|
-
409:
|
|
1736
|
+
409: Error;
|
|
1432
1737
|
};
|
|
1433
1738
|
type DeleteTwofaTemplateError = DeleteTwofaTemplateErrors[keyof DeleteTwofaTemplateErrors];
|
|
1434
1739
|
type DeleteTwofaTemplateResponses = {
|
|
@@ -1455,7 +1760,7 @@ type GetTwofaTemplateErrors = {
|
|
|
1455
1760
|
/**
|
|
1456
1761
|
* Not found
|
|
1457
1762
|
*/
|
|
1458
|
-
404:
|
|
1763
|
+
404: Error;
|
|
1459
1764
|
};
|
|
1460
1765
|
type GetTwofaTemplateError = GetTwofaTemplateErrors[keyof GetTwofaTemplateErrors];
|
|
1461
1766
|
type GetTwofaTemplateResponses = {
|
|
@@ -1490,11 +1795,11 @@ type UpdateTwofaTemplateErrors = {
|
|
|
1490
1795
|
/**
|
|
1491
1796
|
* Not found
|
|
1492
1797
|
*/
|
|
1493
|
-
404:
|
|
1798
|
+
404: Error;
|
|
1494
1799
|
/**
|
|
1495
1800
|
* Template under review
|
|
1496
1801
|
*/
|
|
1497
|
-
409:
|
|
1802
|
+
409: Error;
|
|
1498
1803
|
};
|
|
1499
1804
|
type UpdateTwofaTemplateError = UpdateTwofaTemplateErrors[keyof UpdateTwofaTemplateErrors];
|
|
1500
1805
|
type UpdateTwofaTemplateResponses = {
|
|
@@ -1519,7 +1824,7 @@ type SubmitTwofaTemplateErrors = {
|
|
|
1519
1824
|
/**
|
|
1520
1825
|
* Invalid status transition
|
|
1521
1826
|
*/
|
|
1522
|
-
409:
|
|
1827
|
+
409: Error;
|
|
1523
1828
|
};
|
|
1524
1829
|
type SubmitTwofaTemplateError = SubmitTwofaTemplateErrors[keyof SubmitTwofaTemplateErrors];
|
|
1525
1830
|
type SubmitTwofaTemplateResponses = {
|
|
@@ -1575,11 +1880,11 @@ type CreateQuotaIncreaseRequestErrors = {
|
|
|
1575
1880
|
/**
|
|
1576
1881
|
* Requested limit not greater than current
|
|
1577
1882
|
*/
|
|
1578
|
-
400:
|
|
1883
|
+
400: Error;
|
|
1579
1884
|
/**
|
|
1580
1885
|
* Pending request already exists
|
|
1581
1886
|
*/
|
|
1582
|
-
409:
|
|
1887
|
+
409: Error;
|
|
1583
1888
|
};
|
|
1584
1889
|
type CreateQuotaIncreaseRequestError = CreateQuotaIncreaseRequestErrors[keyof CreateQuotaIncreaseRequestErrors];
|
|
1585
1890
|
type CreateQuotaIncreaseRequestResponses = {
|
|
@@ -1604,7 +1909,7 @@ type GetQuotaIncreaseRequestErrors = {
|
|
|
1604
1909
|
/**
|
|
1605
1910
|
* Not found
|
|
1606
1911
|
*/
|
|
1607
|
-
404:
|
|
1912
|
+
404: Error;
|
|
1608
1913
|
};
|
|
1609
1914
|
type GetQuotaIncreaseRequestError = GetQuotaIncreaseRequestErrors[keyof GetQuotaIncreaseRequestErrors];
|
|
1610
1915
|
type GetQuotaIncreaseRequestResponses = {
|
|
@@ -1671,11 +1976,11 @@ type DeleteMessagingProfileErrors = {
|
|
|
1671
1976
|
/**
|
|
1672
1977
|
* Not found
|
|
1673
1978
|
*/
|
|
1674
|
-
404:
|
|
1979
|
+
404: Error;
|
|
1675
1980
|
/**
|
|
1676
1981
|
* Numbers still assigned
|
|
1677
1982
|
*/
|
|
1678
|
-
409:
|
|
1983
|
+
409: Error;
|
|
1679
1984
|
};
|
|
1680
1985
|
type DeleteMessagingProfileError = DeleteMessagingProfileErrors[keyof DeleteMessagingProfileErrors];
|
|
1681
1986
|
type DeleteMessagingProfileResponses = {
|
|
@@ -1702,7 +2007,7 @@ type GetMessagingProfileErrors = {
|
|
|
1702
2007
|
/**
|
|
1703
2008
|
* Not found
|
|
1704
2009
|
*/
|
|
1705
|
-
404:
|
|
2010
|
+
404: Error;
|
|
1706
2011
|
};
|
|
1707
2012
|
type GetMessagingProfileError = GetMessagingProfileErrors[keyof GetMessagingProfileErrors];
|
|
1708
2013
|
type GetMessagingProfileResponses = {
|
|
@@ -1738,7 +2043,7 @@ type UpdateMessagingProfileErrors = {
|
|
|
1738
2043
|
/**
|
|
1739
2044
|
* Not found
|
|
1740
2045
|
*/
|
|
1741
|
-
404:
|
|
2046
|
+
404: Error;
|
|
1742
2047
|
};
|
|
1743
2048
|
type UpdateMessagingProfileError = UpdateMessagingProfileErrors[keyof UpdateMessagingProfileErrors];
|
|
1744
2049
|
type UpdateMessagingProfileResponses = {
|
|
@@ -1812,7 +2117,7 @@ type SearchPhoneNumbersErrors = {
|
|
|
1812
2117
|
/**
|
|
1813
2118
|
* Rate limited
|
|
1814
2119
|
*/
|
|
1815
|
-
429:
|
|
2120
|
+
429: Error;
|
|
1816
2121
|
};
|
|
1817
2122
|
type SearchPhoneNumbersError = SearchPhoneNumbersErrors[keyof SearchPhoneNumbersErrors];
|
|
1818
2123
|
type SearchPhoneNumbersResponses = {
|
|
@@ -1884,7 +2189,7 @@ type GetPhoneNumberErrors = {
|
|
|
1884
2189
|
/**
|
|
1885
2190
|
* Not found
|
|
1886
2191
|
*/
|
|
1887
|
-
404:
|
|
2192
|
+
404: Error;
|
|
1888
2193
|
};
|
|
1889
2194
|
type GetPhoneNumberError = GetPhoneNumberErrors[keyof GetPhoneNumberErrors];
|
|
1890
2195
|
type GetPhoneNumberResponses = {
|
|
@@ -1915,7 +2220,7 @@ type UpdatePhoneNumberErrors = {
|
|
|
1915
2220
|
/**
|
|
1916
2221
|
* Not found
|
|
1917
2222
|
*/
|
|
1918
|
-
404:
|
|
2223
|
+
404: Error;
|
|
1919
2224
|
};
|
|
1920
2225
|
type UpdatePhoneNumberError = UpdatePhoneNumberErrors[keyof UpdatePhoneNumberErrors];
|
|
1921
2226
|
type UpdatePhoneNumberResponses = {
|
|
@@ -2014,7 +2319,7 @@ type CreatePhoneOrderErrors = {
|
|
|
2014
2319
|
/**
|
|
2015
2320
|
* Validation error or insufficient balance
|
|
2016
2321
|
*/
|
|
2017
|
-
400:
|
|
2322
|
+
400: Error;
|
|
2018
2323
|
};
|
|
2019
2324
|
type CreatePhoneOrderError = CreatePhoneOrderErrors[keyof CreatePhoneOrderErrors];
|
|
2020
2325
|
type CreatePhoneOrderResponses = {
|
|
@@ -2039,7 +2344,7 @@ type GetPhoneOrderErrors = {
|
|
|
2039
2344
|
/**
|
|
2040
2345
|
* Not found
|
|
2041
2346
|
*/
|
|
2042
|
-
404:
|
|
2347
|
+
404: Error;
|
|
2043
2348
|
};
|
|
2044
2349
|
type GetPhoneOrderError = GetPhoneOrderErrors[keyof GetPhoneOrderErrors];
|
|
2045
2350
|
type GetPhoneOrderResponses = {
|
|
@@ -2049,8 +2354,106 @@ type GetPhoneOrderResponses = {
|
|
|
2049
2354
|
200: PhoneOrder;
|
|
2050
2355
|
};
|
|
2051
2356
|
type GetPhoneOrderResponse = GetPhoneOrderResponses[keyof GetPhoneOrderResponses];
|
|
2357
|
+
type ListWebhooksData = {
|
|
2358
|
+
body?: never;
|
|
2359
|
+
path?: never;
|
|
2360
|
+
query?: never;
|
|
2361
|
+
url: "/webhooks";
|
|
2362
|
+
};
|
|
2363
|
+
type ListWebhooksResponses = {
|
|
2364
|
+
/**
|
|
2365
|
+
* Webhook endpoints
|
|
2366
|
+
*/
|
|
2367
|
+
200: {
|
|
2368
|
+
webhooks: Array<Webhook>;
|
|
2369
|
+
};
|
|
2370
|
+
};
|
|
2371
|
+
type ListWebhooksResponse = ListWebhooksResponses[keyof ListWebhooksResponses];
|
|
2372
|
+
type CreateWebhookData = {
|
|
2373
|
+
body?: {
|
|
2374
|
+
url: string;
|
|
2375
|
+
description?: string | null;
|
|
2376
|
+
eventTypes: Array<"message.sent" | "message.delivered" | "message.failed" | "message.received" | "email.delivered" | "email.bounced" | "email.complained" | "email.opened" | "email.clicked" | "email.received">;
|
|
2377
|
+
enabled?: boolean;
|
|
2378
|
+
};
|
|
2379
|
+
path?: never;
|
|
2380
|
+
query?: never;
|
|
2381
|
+
url: "/webhooks";
|
|
2382
|
+
};
|
|
2383
|
+
type CreateWebhookErrors = {
|
|
2384
|
+
/**
|
|
2385
|
+
* Validation error or URL blocked by SSRF policy
|
|
2386
|
+
*/
|
|
2387
|
+
400: Error;
|
|
2388
|
+
};
|
|
2389
|
+
type CreateWebhookError = CreateWebhookErrors[keyof CreateWebhookErrors];
|
|
2390
|
+
type CreateWebhookResponses = {
|
|
2391
|
+
/**
|
|
2392
|
+
* Endpoint created — save the signing secret
|
|
2393
|
+
*/
|
|
2394
|
+
201: WebhookWithSecret;
|
|
2395
|
+
};
|
|
2396
|
+
type CreateWebhookResponse = CreateWebhookResponses[keyof CreateWebhookResponses];
|
|
2397
|
+
type DeleteWebhookData = {
|
|
2398
|
+
body?: never;
|
|
2399
|
+
path: {
|
|
2400
|
+
publicId: string;
|
|
2401
|
+
};
|
|
2402
|
+
query?: never;
|
|
2403
|
+
url: "/webhooks/{publicId}";
|
|
2404
|
+
};
|
|
2405
|
+
type DeleteWebhookErrors = {
|
|
2406
|
+
/**
|
|
2407
|
+
* Not found
|
|
2408
|
+
*/
|
|
2409
|
+
404: Error;
|
|
2410
|
+
};
|
|
2411
|
+
type DeleteWebhookError = DeleteWebhookErrors[keyof DeleteWebhookErrors];
|
|
2412
|
+
type DeleteWebhookResponses = {
|
|
2413
|
+
/**
|
|
2414
|
+
* Deleted
|
|
2415
|
+
*/
|
|
2416
|
+
200: {
|
|
2417
|
+
success: true;
|
|
2418
|
+
};
|
|
2419
|
+
};
|
|
2420
|
+
type DeleteWebhookResponse = DeleteWebhookResponses[keyof DeleteWebhookResponses];
|
|
2421
|
+
type UpdateWebhookData = {
|
|
2422
|
+
body?: {
|
|
2423
|
+
url?: string;
|
|
2424
|
+
description?: string | null;
|
|
2425
|
+
eventTypes?: Array<"message.sent" | "message.delivered" | "message.failed" | "message.received" | "email.delivered" | "email.bounced" | "email.complained" | "email.opened" | "email.clicked" | "email.received">;
|
|
2426
|
+
enabled?: boolean;
|
|
2427
|
+
};
|
|
2428
|
+
path: {
|
|
2429
|
+
/**
|
|
2430
|
+
* Webhook public ID
|
|
2431
|
+
*/
|
|
2432
|
+
publicId: string;
|
|
2433
|
+
};
|
|
2434
|
+
query?: never;
|
|
2435
|
+
url: "/webhooks/{publicId}";
|
|
2436
|
+
};
|
|
2437
|
+
type UpdateWebhookErrors = {
|
|
2438
|
+
/**
|
|
2439
|
+
* Validation error or URL blocked by SSRF policy
|
|
2440
|
+
*/
|
|
2441
|
+
400: Error;
|
|
2442
|
+
/**
|
|
2443
|
+
* Not found
|
|
2444
|
+
*/
|
|
2445
|
+
404: Error;
|
|
2446
|
+
};
|
|
2447
|
+
type UpdateWebhookError = UpdateWebhookErrors[keyof UpdateWebhookErrors];
|
|
2448
|
+
type UpdateWebhookResponses = {
|
|
2449
|
+
/**
|
|
2450
|
+
* Updated
|
|
2451
|
+
*/
|
|
2452
|
+
200: Webhook;
|
|
2453
|
+
};
|
|
2454
|
+
type UpdateWebhookResponse = UpdateWebhookResponses[keyof UpdateWebhookResponses];
|
|
2052
2455
|
|
|
2053
|
-
type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = Options$1<TData, ThrowOnError> & {
|
|
2456
|
+
type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options$1<TData, ThrowOnError, TResponse> & {
|
|
2054
2457
|
/**
|
|
2055
2458
|
* You can provide a client instance returned by `createClient()` instead of
|
|
2056
2459
|
* individual options. This might be also useful if you want to implement a
|
|
@@ -2237,6 +2640,64 @@ declare class Email {
|
|
|
2237
2640
|
*/
|
|
2238
2641
|
static sendEmail<ThrowOnError extends boolean = false>(options?: Options<SendEmailData, ThrowOnError>): RequestResult<SendEmailResponses, SendEmailErrors, ThrowOnError, "fields">;
|
|
2239
2642
|
}
|
|
2643
|
+
declare class Mailboxes {
|
|
2644
|
+
/**
|
|
2645
|
+
* List mailboxes
|
|
2646
|
+
*
|
|
2647
|
+
* List inbound mailboxes for the tenant. Each mailbox has a unique random local-part on the inbound domain.
|
|
2648
|
+
*
|
|
2649
|
+
* Requires permission: `mailboxes.read`.
|
|
2650
|
+
*/
|
|
2651
|
+
static listMailboxes<ThrowOnError extends boolean = false>(options?: Options<ListMailboxesData, ThrowOnError>): RequestResult<ListMailboxesResponses, unknown, ThrowOnError, "fields">;
|
|
2652
|
+
/**
|
|
2653
|
+
* Create mailbox
|
|
2654
|
+
*
|
|
2655
|
+
* Allocate a new inbound mailbox. The address is auto-generated. The first monthly fee is charged immediately; subsequent cycles are billed by the recurring-fees cron.
|
|
2656
|
+
*
|
|
2657
|
+
* Requires permission: `mailboxes.write`.
|
|
2658
|
+
*/
|
|
2659
|
+
static createMailbox<ThrowOnError extends boolean = false>(options?: Options<CreateMailboxData, ThrowOnError>): RequestResult<CreateMailboxResponses, unknown, ThrowOnError, "fields">;
|
|
2660
|
+
/**
|
|
2661
|
+
* Delete mailbox
|
|
2662
|
+
*
|
|
2663
|
+
* Permanently delete a mailbox. Inbound messages already received are retained but can no longer receive new mail. Recurring fees stop on the next cycle.
|
|
2664
|
+
*
|
|
2665
|
+
* Requires permission: `mailboxes.write`.
|
|
2666
|
+
*/
|
|
2667
|
+
static deleteMailbox<ThrowOnError extends boolean = false>(options?: Options<DeleteMailboxData, ThrowOnError>): RequestResult<DeleteMailboxResponses, DeleteMailboxErrors, ThrowOnError, "fields">;
|
|
2668
|
+
/**
|
|
2669
|
+
* Update mailbox
|
|
2670
|
+
*
|
|
2671
|
+
* Update the label of an existing mailbox. The address itself cannot be changed.
|
|
2672
|
+
*
|
|
2673
|
+
* Requires permission: `mailboxes.write`.
|
|
2674
|
+
*/
|
|
2675
|
+
static updateMailbox<ThrowOnError extends boolean = false>(options?: Options<UpdateMailboxData, ThrowOnError>): RequestResult<UpdateMailboxResponses, UpdateMailboxErrors, ThrowOnError, "fields">;
|
|
2676
|
+
/**
|
|
2677
|
+
* List messages
|
|
2678
|
+
*
|
|
2679
|
+
* List messages received in this mailbox, newest first. Cursor-paginated. Supports filtering by received-at window with `start` / `end` (ISO 8601). The summary excludes message bodies — fetch a specific message for the parsed body or download the raw `.eml`.
|
|
2680
|
+
*
|
|
2681
|
+
* Requires permission: `mailboxes.read`.
|
|
2682
|
+
*/
|
|
2683
|
+
static listMailboxMessages<ThrowOnError extends boolean = false>(options?: Options<ListMailboxMessagesData, ThrowOnError>): RequestResult<ListMailboxMessagesResponses, ListMailboxMessagesErrors, ThrowOnError, "fields">;
|
|
2684
|
+
/**
|
|
2685
|
+
* Get message
|
|
2686
|
+
*
|
|
2687
|
+
* Fetch a single inbound message. The raw MIME is loaded from S3 and parsed server-side; the response includes addresses, headers, the text and HTML bodies, and attachment metadata. Attachment contents are not included — use the `/raw` endpoint to download the original `.eml` and extract attachments client-side.
|
|
2688
|
+
*
|
|
2689
|
+
* Requires permission: `mailboxes.read`.
|
|
2690
|
+
*/
|
|
2691
|
+
static getMailboxMessage<ThrowOnError extends boolean = false>(options: Options<GetMailboxMessageData, ThrowOnError>): RequestResult<GetMailboxMessageResponses, GetMailboxMessageErrors, ThrowOnError, "fields">;
|
|
2692
|
+
/**
|
|
2693
|
+
* Download raw .eml
|
|
2694
|
+
*
|
|
2695
|
+
* Download the original RFC 822 MIME for the message. The response is `Content-Type: message/rfc822` with `Content-Disposition: attachment; filename="<messageId>.eml"`. Use this when you need to access attachment payloads or feed the message into a MIME parser of your choice.
|
|
2696
|
+
*
|
|
2697
|
+
* Requires permission: `mailboxes.read`.
|
|
2698
|
+
*/
|
|
2699
|
+
static getMailboxMessageRaw<ThrowOnError extends boolean = false>(options: Options<GetMailboxMessageRawData, ThrowOnError>): RequestResult<GetMailboxMessageRawResponses, GetMailboxMessageRawErrors, ThrowOnError, "fields">;
|
|
2700
|
+
}
|
|
2240
2701
|
declare class Balance {
|
|
2241
2702
|
/**
|
|
2242
2703
|
* Get balance
|
|
@@ -2267,7 +2728,7 @@ declare class Messaging {
|
|
|
2267
2728
|
*/
|
|
2268
2729
|
static sendMessage<ThrowOnError extends boolean = false>(options?: Options<SendMessageData, ThrowOnError>): RequestResult<SendMessageResponses, SendMessageErrors, ThrowOnError, "fields">;
|
|
2269
2730
|
}
|
|
2270
|
-
declare class
|
|
2731
|
+
declare class _2FaVerifications {
|
|
2271
2732
|
/**
|
|
2272
2733
|
* Send verification code
|
|
2273
2734
|
*
|
|
@@ -2297,7 +2758,7 @@ declare class FaVerifications {
|
|
|
2297
2758
|
*/
|
|
2298
2759
|
static checkVerification<ThrowOnError extends boolean = false>(options: Options<CheckVerificationData, ThrowOnError>): RequestResult<CheckVerificationResponses, CheckVerificationErrors, ThrowOnError, "fields">;
|
|
2299
2760
|
}
|
|
2300
|
-
declare class
|
|
2761
|
+
declare class _2FaTemplates {
|
|
2301
2762
|
/**
|
|
2302
2763
|
* List templates
|
|
2303
2764
|
*
|
|
@@ -2565,6 +3026,44 @@ declare class PhoneOrders {
|
|
|
2565
3026
|
*/
|
|
2566
3027
|
static getPhoneOrder<ThrowOnError extends boolean = false>(options?: Options<GetPhoneOrderData, ThrowOnError>): RequestResult<GetPhoneOrderResponses, GetPhoneOrderErrors, ThrowOnError, "fields">;
|
|
2567
3028
|
}
|
|
3029
|
+
declare class Webhooks {
|
|
3030
|
+
/**
|
|
3031
|
+
* List webhook endpoints
|
|
3032
|
+
*
|
|
3033
|
+
* List all webhook endpoints registered for your account. Signing secrets are never returned by this endpoint.
|
|
3034
|
+
*
|
|
3035
|
+
* Requires permission: `webhooks.read`.
|
|
3036
|
+
*/
|
|
3037
|
+
static listWebhooks<ThrowOnError extends boolean = false>(options?: Options<ListWebhooksData, ThrowOnError>): RequestResult<ListWebhooksResponses, unknown, ThrowOnError, "fields">;
|
|
3038
|
+
/**
|
|
3039
|
+
* Create webhook endpoint
|
|
3040
|
+
*
|
|
3041
|
+
* Register a webhook endpoint. We POST a signed JSON body to `url` whenever any event in `eventTypes` fires for your account.
|
|
3042
|
+
*
|
|
3043
|
+
* **The signing secret is shown ONCE in this response and never again.** Store it before continuing — see the `Webhooks` section in the spec description for verification details.
|
|
3044
|
+
*
|
|
3045
|
+
* URLs must be HTTPS (HTTP allowed in dev only) and resolve to a public IP. Hostnames or literal IPs that resolve to private/loopback ranges are rejected with `400 WEBHOOK_URL_BLOCKED`.
|
|
3046
|
+
*
|
|
3047
|
+
* Requires permission: `webhooks.write`.
|
|
3048
|
+
*/
|
|
3049
|
+
static createWebhook<ThrowOnError extends boolean = false>(options?: Options<CreateWebhookData, ThrowOnError>): RequestResult<CreateWebhookResponses, CreateWebhookErrors, ThrowOnError, "fields">;
|
|
3050
|
+
/**
|
|
3051
|
+
* Delete webhook endpoint
|
|
3052
|
+
*
|
|
3053
|
+
* Permanently delete the endpoint. In-flight delivery attempts for already-enqueued events still run to completion.
|
|
3054
|
+
*
|
|
3055
|
+
* Requires permission: `webhooks.write`.
|
|
3056
|
+
*/
|
|
3057
|
+
static deleteWebhook<ThrowOnError extends boolean = false>(options: Options<DeleteWebhookData, ThrowOnError>): RequestResult<DeleteWebhookResponses, DeleteWebhookErrors, ThrowOnError, "fields">;
|
|
3058
|
+
/**
|
|
3059
|
+
* Update webhook endpoint
|
|
3060
|
+
*
|
|
3061
|
+
* Update one or more fields. The signing secret is not rotated by this endpoint.
|
|
3062
|
+
*
|
|
3063
|
+
* Requires permission: `webhooks.write`.
|
|
3064
|
+
*/
|
|
3065
|
+
static updateWebhook<ThrowOnError extends boolean = false>(options: Options<UpdateWebhookData, ThrowOnError>): RequestResult<UpdateWebhookResponses, UpdateWebhookErrors, ThrowOnError, "fields">;
|
|
3066
|
+
}
|
|
2568
3067
|
|
|
2569
3068
|
interface BlocxConfig {
|
|
2570
3069
|
/** API access key ID (sent as `x-access-key-id`). */
|
|
@@ -2588,4 +3087,4 @@ declare function createBlocxClient(options: BlocxConfig): {
|
|
|
2588
3087
|
setDefault: () => Client;
|
|
2589
3088
|
};
|
|
2590
3089
|
|
|
2591
|
-
export { type AssignMessagingProfileNumbersData, type AssignMessagingProfileNumbersResponse, type AssignMessagingProfileNumbersResponses, Balance, type BlocxConfig, type Brand, type BrandDetail, type BrandFeedback, Brands, type BulkAssignPhoneNumbersData, type BulkAssignPhoneNumbersResponse, type BulkAssignPhoneNumbersResponses, type BulkUnassignPhoneNumbersData, type BulkUnassignPhoneNumbersResponse, type BulkUnassignPhoneNumbersResponses, type Campaign, type CampaignMnoStatus, type CampaignSharing, Campaigns, type CheckVerificationData, type CheckVerificationError, type CheckVerificationErrors, type CheckVerificationResponse, type CheckVerificationResponses, type ClientOptions, Compliance, type ComplianceEvent, type ComplianceEventDetail, type CreateBrandData, type CreateBrandResponse, type CreateBrandResponses, type CreateCampaignData, type CreateCampaignResponse, type CreateCampaignResponses, type CreateEmailIdentityData, type CreateEmailIdentityError, type CreateEmailIdentityErrors, type CreateEmailIdentityResponse, type CreateEmailIdentityResponses, type CreateMessagingProfileData, type CreateMessagingProfileResponse, type CreateMessagingProfileResponses, type CreatePhoneOrderData, type CreatePhoneOrderError, type CreatePhoneOrderErrors, type CreatePhoneOrderResponse, type CreatePhoneOrderResponses, type CreateQuotaIncreaseRequestData, type CreateQuotaIncreaseRequestError, type CreateQuotaIncreaseRequestErrors, type CreateQuotaIncreaseRequestResponse, type CreateQuotaIncreaseRequestResponses, type CreateTwofaTemplateData, type CreateTwofaTemplateResponse, type CreateTwofaTemplateResponses, type CreateVerificationData, type CreateVerificationError, type CreateVerificationErrors, type CreateVerificationResponse, type CreateVerificationResponses, type DeleteEmailIdentityData, type DeleteEmailIdentityError, type DeleteEmailIdentityErrors, type DeleteEmailIdentityResponse, type DeleteEmailIdentityResponses, type DeleteMessagingProfileData, type DeleteMessagingProfileError, type DeleteMessagingProfileErrors, type DeleteMessagingProfileResponse, type DeleteMessagingProfileResponses, type DeleteTwofaTemplateData, type DeleteTwofaTemplateError, type DeleteTwofaTemplateErrors, type DeleteTwofaTemplateResponse, type DeleteTwofaTemplateResponses, type DnsRecord, Email, type EmailIdentity, type EnableEmailData, type EnableEmailResponse, type EnableEmailResponses,
|
|
3090
|
+
export { type AssignMessagingProfileNumbersData, type AssignMessagingProfileNumbersResponse, type AssignMessagingProfileNumbersResponses, Balance, type BlocxConfig, type Brand, type BrandDetail, type BrandFeedback, Brands, type BulkAssignPhoneNumbersData, type BulkAssignPhoneNumbersResponse, type BulkAssignPhoneNumbersResponses, type BulkUnassignPhoneNumbersData, type BulkUnassignPhoneNumbersResponse, type BulkUnassignPhoneNumbersResponses, type Campaign, type CampaignMnoStatus, type CampaignSharing, Campaigns, type CheckVerificationData, type CheckVerificationError, type CheckVerificationErrors, type CheckVerificationResponse, type CheckVerificationResponses, type ClientOptions, Compliance, type ComplianceEvent, type ComplianceEventDetail, type CreateBrandData, type CreateBrandResponse, type CreateBrandResponses, type CreateCampaignData, type CreateCampaignResponse, type CreateCampaignResponses, type CreateEmailIdentityData, type CreateEmailIdentityError, type CreateEmailIdentityErrors, type CreateEmailIdentityResponse, type CreateEmailIdentityResponses, type CreateMailboxData, type CreateMailboxResponse, type CreateMailboxResponses, type CreateMessagingProfileData, type CreateMessagingProfileResponse, type CreateMessagingProfileResponses, type CreatePhoneOrderData, type CreatePhoneOrderError, type CreatePhoneOrderErrors, type CreatePhoneOrderResponse, type CreatePhoneOrderResponses, type CreateQuotaIncreaseRequestData, type CreateQuotaIncreaseRequestError, type CreateQuotaIncreaseRequestErrors, type CreateQuotaIncreaseRequestResponse, type CreateQuotaIncreaseRequestResponses, type CreateTwofaTemplateData, type CreateTwofaTemplateResponse, type CreateTwofaTemplateResponses, type CreateVerificationData, type CreateVerificationError, type CreateVerificationErrors, type CreateVerificationResponse, type CreateVerificationResponses, type CreateWebhookData, type CreateWebhookError, type CreateWebhookErrors, type CreateWebhookResponse, type CreateWebhookResponses, type DeleteEmailIdentityData, type DeleteEmailIdentityError, type DeleteEmailIdentityErrors, type DeleteEmailIdentityResponse, type DeleteEmailIdentityResponses, type DeleteMailboxData, type DeleteMailboxError, type DeleteMailboxErrors, type DeleteMailboxResponse, type DeleteMailboxResponses, type DeleteMessagingProfileData, type DeleteMessagingProfileError, type DeleteMessagingProfileErrors, type DeleteMessagingProfileResponse, type DeleteMessagingProfileResponses, type DeleteTwofaTemplateData, type DeleteTwofaTemplateError, type DeleteTwofaTemplateErrors, type DeleteTwofaTemplateResponse, type DeleteTwofaTemplateResponses, type DeleteWebhookData, type DeleteWebhookError, type DeleteWebhookErrors, type DeleteWebhookResponse, type DeleteWebhookResponses, type DnsRecord, Email, type EmailIdentity, type EnableEmailData, type EnableEmailResponse, type EnableEmailResponses, type Error, type GetBalanceData, type GetBalanceHistoryData, type GetBalanceHistoryResponse, type GetBalanceHistoryResponses, type GetBalanceResponse, type GetBalanceResponses, type GetBalanceUsageData, type GetBalanceUsageResponse, type GetBalanceUsageResponses, type GetBrandData, type GetBrandError, type GetBrandErrors, type GetBrandFeedbackData, type GetBrandFeedbackError, type GetBrandFeedbackErrors, type GetBrandFeedbackResponse, type GetBrandFeedbackResponses, type GetBrandResponse, type GetBrandResponses, type GetCampaignData, type GetCampaignError, type GetCampaignErrors, type GetCampaignMnoStatusData, type GetCampaignMnoStatusResponse, type GetCampaignMnoStatusResponses, type GetCampaignResponse, type GetCampaignResponses, type GetCampaignSharingData, type GetCampaignSharingResponse, type GetCampaignSharingResponses, type GetComplianceEventData, type GetComplianceEventError, type GetComplianceEventErrors, type GetComplianceEventResponse, type GetComplianceEventResponses, type GetEmailHistoryData, type GetEmailHistoryResponse, type GetEmailHistoryResponses, type GetEmailIdentityData, type GetEmailIdentityError, type GetEmailIdentityErrors, type GetEmailIdentityResponse, type GetEmailIdentityResponses, type GetEmailStatusData, type GetEmailStatusResponse, type GetEmailStatusResponses, type GetMailboxMessageData, type GetMailboxMessageError, type GetMailboxMessageErrors, type GetMailboxMessageRawData, type GetMailboxMessageRawError, type GetMailboxMessageRawErrors, type GetMailboxMessageRawResponse, type GetMailboxMessageRawResponses, type GetMailboxMessageResponse, type GetMailboxMessageResponses, type GetMessagingProfileData, type GetMessagingProfileError, type GetMessagingProfileErrors, type GetMessagingProfileResponse, type GetMessagingProfileResponses, type GetPhoneNumberData, type GetPhoneNumberError, type GetPhoneNumberErrors, type GetPhoneNumberResponse, type GetPhoneNumberResponses, type GetPhoneOrderData, type GetPhoneOrderError, type GetPhoneOrderErrors, type GetPhoneOrderResponse, type GetPhoneOrderResponses, type GetQualifiedUseCasesData, type GetQualifiedUseCasesResponse, type GetQualifiedUseCasesResponses, type GetQuotaIncreaseRequestData, type GetQuotaIncreaseRequestError, type GetQuotaIncreaseRequestErrors, type GetQuotaIncreaseRequestResponse, type GetQuotaIncreaseRequestResponses, type GetTwofaTemplateData, type GetTwofaTemplateError, type GetTwofaTemplateErrors, type GetTwofaTemplateResponse, type GetTwofaTemplateResponses, type InboundEmailDetail, type InboundEmailSummary, type ListBrandsData, type ListBrandsResponse, type ListBrandsResponses, type ListCampaignsData, type ListCampaignsResponse, type ListCampaignsResponses, type ListComplianceEventsData, type ListComplianceEventsResponse, type ListComplianceEventsResponses, type ListEmailIdentitiesData, type ListEmailIdentitiesResponse, type ListEmailIdentitiesResponses, type ListMailboxMessagesData, type ListMailboxMessagesError, type ListMailboxMessagesErrors, type ListMailboxMessagesResponse, type ListMailboxMessagesResponses, type ListMailboxesData, type ListMailboxesResponse, type ListMailboxesResponses, type ListMessagingProfilesData, type ListMessagingProfilesResponse, type ListMessagingProfilesResponses, type ListPhoneNumbersData, type ListPhoneNumbersResponse, type ListPhoneNumbersResponses, type ListPhoneOrdersData, type ListPhoneOrdersResponse, type ListPhoneOrdersResponses, type ListQuotaIncreaseRequestsData, type ListQuotaIncreaseRequestsResponse, type ListQuotaIncreaseRequestsResponses, type ListQuotasData, type ListQuotasResponse, type ListQuotasResponses, type ListTwofaTemplatesData, type ListTwofaTemplatesResponse, type ListTwofaTemplatesResponses, type ListWebhooksData, type ListWebhooksResponse, type ListWebhooksResponses, type Mailbox, Mailboxes, Messaging, type MessagingProfile, MessagingProfiles, type Options, type PhoneNumber, PhoneNumbers, type PhoneOrder, PhoneOrders, type ProvisioningStage, type Quota, type QuotaIncreaseRequest, Quotas, type SearchPhoneNumbersData, type SearchPhoneNumbersError, type SearchPhoneNumbersErrors, type SearchPhoneNumbersResponse, type SearchPhoneNumbersResponses, type SendEmailData, type SendEmailError, type SendEmailErrors, type SendEmailIdentityTestData, type SendEmailIdentityTestError, type SendEmailIdentityTestErrors, type SendEmailIdentityTestResponse, type SendEmailIdentityTestResponses, type SendEmailResponse, type SendEmailResponses, type SendMessageData, type SendMessageError, type SendMessageErrors, type SendMessageResponse, type SendMessageResponses, type SentEmail, type ShareCampaignData, type ShareCampaignResponse, type ShareCampaignResponses, type SubmitTwofaTemplateData, type SubmitTwofaTemplateError, type SubmitTwofaTemplateErrors, type SubmitTwofaTemplateResponse, type SubmitTwofaTemplateResponses, type TwoFaTemplate, type UnassignMessagingProfileNumbersData, type UnassignMessagingProfileNumbersResponse, type UnassignMessagingProfileNumbersResponses, type UpdateMailboxData, type UpdateMailboxError, type UpdateMailboxErrors, type UpdateMailboxResponse, type UpdateMailboxResponses, type UpdateMessagingProfileData, type UpdateMessagingProfileError, type UpdateMessagingProfileErrors, type UpdateMessagingProfileResponse, type UpdateMessagingProfileResponses, type UpdatePhoneNumberData, type UpdatePhoneNumberError, type UpdatePhoneNumberErrors, type UpdatePhoneNumberResponse, type UpdatePhoneNumberResponses, type UpdateTwofaTemplateData, type UpdateTwofaTemplateError, type UpdateTwofaTemplateErrors, type UpdateTwofaTemplateResponse, type UpdateTwofaTemplateResponses, type UpdateWebhookData, type UpdateWebhookError, type UpdateWebhookErrors, type UpdateWebhookResponse, type UpdateWebhookResponses, type UseCase, type Verification, type VerificationCheck, type VerifyEmailIdentityDnsData, type VerifyEmailIdentityDnsResponse, type VerifyEmailIdentityDnsResponses, type Webhook, type WebhookWithSecret, Webhooks, _2FaTemplates, _2FaVerifications, createBlocxClient };
|