@workwae/sdk 0.1.0-alpha.1 → 0.1.0-alpha.2
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 +7 -7
- package/client.d.ts +1 -1
- package/contract/accounts/models.d.ts +85 -45
- package/contract/accounts/routes.d.ts +191 -29
- package/contract/ai/models.d.ts +0 -1
- package/contract/ai/routes.d.ts +9 -0
- package/contract/audit-log/models.d.ts +19 -5
- package/contract/audit-log/routes.d.ts +10 -1
- package/contract/calendar/models.d.ts +249 -74
- package/contract/calendar/routes.d.ts +574 -30
- package/contract/connect/models.d.ts +28 -16
- package/contract/connect/routes.d.ts +46 -7
- package/contract/contacts/models.d.ts +0 -10
- package/contract/contacts/routes.d.ts +14 -0
- package/contract/email-validation/models.d.ts +119 -0
- package/contract/email-validation/routes.d.ts +106 -0
- package/contract/errors.d.ts +28 -20
- package/contract/events/models.d.ts +139 -79
- package/contract/events/routes.d.ts +54 -44
- package/contract/exports/routes.d.ts +10 -0
- package/contract/identities/models.d.ts +7 -9
- package/contract/identities/routes.d.ts +79 -10
- package/contract/limits.d.ts +21 -73
- package/contract/mail/models.d.ts +91 -48
- package/contract/mail/routes.d.ts +458 -18
- package/contract/mcp-keys/models.d.ts +125 -0
- package/contract/mcp-keys/routes.d.ts +151 -0
- package/contract/meetings/models.d.ts +28 -33
- package/contract/meetings/routes.d.ts +44 -25
- package/contract/oauth-apps/models.d.ts +0 -6
- package/contract/oauth-apps/routes.d.ts +8 -0
- package/contract/org-connections/models.d.ts +83 -39
- package/contract/org-connections/routes.d.ts +320 -43
- package/contract/plans/credit-packs.d.ts +30 -0
- package/contract/plans/models.d.ts +208 -0
- package/contract/primitives.d.ts +7 -62
- package/contract/public.d.ts +6 -0
- package/contract/reasons.d.ts +532 -21
- package/contract/router.d.ts +6425 -3212
- package/contract/scheduling/models.d.ts +405 -0
- package/contract/scheduling/routes.d.ts +756 -0
- package/contract/send/models.d.ts +82 -45
- package/contract/send/routes.d.ts +281 -32
- package/contract/settings/models.d.ts +73 -13
- package/contract/settings/routes.d.ts +56 -4
- package/contract/suppressions/models.d.ts +21 -28
- package/contract/suppressions/routes.d.ts +62 -14
- package/contract/templates/models.d.ts +0 -14
- package/contract/templates/routes.d.ts +30 -6
- package/contract/threads/models.d.ts +0 -5
- package/contract/threads/routes.d.ts +40 -0
- package/contract/tracking-domain/models.d.ts +41 -0
- package/contract/tracking-domain/routes.d.ts +193 -0
- package/contract/usage/models.d.ts +98 -126
- package/contract/usage/routes.d.ts +48 -20
- package/contract/webhooks/models.d.ts +45 -30
- package/contract/webhooks/routes.d.ts +52 -9
- package/contract/webhooks/signing.d.ts +0 -16
- package/index.js +1 -4334
- package/package.json +6 -7
- package/index.js.map +0 -59
|
@@ -27,6 +27,7 @@ export declare const webhooks: {
|
|
|
27
27
|
"send.retrying": "send.retrying";
|
|
28
28
|
"send.failed": "send.failed";
|
|
29
29
|
"send.rescheduled": "send.rescheduled";
|
|
30
|
+
"send.cancelled": "send.cancelled";
|
|
30
31
|
"suppression.created": "suppression.created";
|
|
31
32
|
"calendar.initialized": "calendar.initialized";
|
|
32
33
|
"calendar.created": "calendar.created";
|
|
@@ -43,6 +44,8 @@ export declare const webhooks: {
|
|
|
43
44
|
"export.failed": "export.failed";
|
|
44
45
|
"meeting_connection.connected": "meeting_connection.connected";
|
|
45
46
|
"meeting_connection.reauth_required": "meeting_connection.reauth_required";
|
|
47
|
+
"booking.created": "booking.created";
|
|
48
|
+
"booking.cancelled": "booking.cancelled";
|
|
46
49
|
"webhook.test": "webhook.test";
|
|
47
50
|
}>>;
|
|
48
51
|
accountIds: z.ZodArray<z.ZodUUID>;
|
|
@@ -50,13 +53,13 @@ export declare const webhooks: {
|
|
|
50
53
|
mailboxIds: z.ZodArray<z.ZodUUID>;
|
|
51
54
|
mailboxRoles: z.ZodArray<z.ZodEnum<{
|
|
52
55
|
custom: "custom";
|
|
56
|
+
all: "all";
|
|
53
57
|
inbox: "inbox";
|
|
54
58
|
sent: "sent";
|
|
55
59
|
drafts: "drafts";
|
|
56
60
|
trash: "trash";
|
|
57
61
|
junk: "junk";
|
|
58
62
|
archive: "archive";
|
|
59
|
-
all: "all";
|
|
60
63
|
important: "important";
|
|
61
64
|
}>>;
|
|
62
65
|
from: z.ZodArray<z.ZodString>;
|
|
@@ -83,6 +86,8 @@ export declare const webhooks: {
|
|
|
83
86
|
readonly missing_scope: "The API key lacks the scope the operation needs.";
|
|
84
87
|
readonly role_forbidden: "The member's role does not allow the operation.";
|
|
85
88
|
readonly account_token_forbidden: "An account token called an operation account tokens cannot call.";
|
|
89
|
+
readonly account_scope_forbidden: "A credential limited to specific accounts called an operation that reaches beyond them.";
|
|
90
|
+
readonly mcp_only_key: "An MCP-only key (minted for an end user's MCP client) was used outside the MCP server.";
|
|
86
91
|
readonly rate_limited: "The tenant used up its plan's request rate; Retry-After says when the window ends.";
|
|
87
92
|
readonly too_many_requests: "The credential has too many requests in flight at once; retry after Retry-After.";
|
|
88
93
|
readonly overloaded: "The API is shedding load; retry after Retry-After.";
|
|
@@ -117,6 +122,7 @@ export declare const webhooks: {
|
|
|
117
122
|
"send.retrying": "send.retrying";
|
|
118
123
|
"send.failed": "send.failed";
|
|
119
124
|
"send.rescheduled": "send.rescheduled";
|
|
125
|
+
"send.cancelled": "send.cancelled";
|
|
120
126
|
"suppression.created": "suppression.created";
|
|
121
127
|
"calendar.initialized": "calendar.initialized";
|
|
122
128
|
"calendar.created": "calendar.created";
|
|
@@ -133,6 +139,8 @@ export declare const webhooks: {
|
|
|
133
139
|
"export.failed": "export.failed";
|
|
134
140
|
"meeting_connection.connected": "meeting_connection.connected";
|
|
135
141
|
"meeting_connection.reauth_required": "meeting_connection.reauth_required";
|
|
142
|
+
"booking.created": "booking.created";
|
|
143
|
+
"booking.cancelled": "booking.cancelled";
|
|
136
144
|
"webhook.test": "webhook.test";
|
|
137
145
|
}>>>;
|
|
138
146
|
accountIds: z.ZodOptional<z.ZodArray<z.ZodUUID>>;
|
|
@@ -140,13 +148,13 @@ export declare const webhooks: {
|
|
|
140
148
|
mailboxIds: z.ZodOptional<z.ZodArray<z.ZodUUID>>;
|
|
141
149
|
mailboxRoles: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
142
150
|
custom: "custom";
|
|
151
|
+
all: "all";
|
|
143
152
|
inbox: "inbox";
|
|
144
153
|
sent: "sent";
|
|
145
154
|
drafts: "drafts";
|
|
146
155
|
trash: "trash";
|
|
147
156
|
junk: "junk";
|
|
148
157
|
archive: "archive";
|
|
149
|
-
all: "all";
|
|
150
158
|
important: "important";
|
|
151
159
|
}>>>;
|
|
152
160
|
from: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
@@ -186,6 +194,7 @@ export declare const webhooks: {
|
|
|
186
194
|
"send.retrying": "send.retrying";
|
|
187
195
|
"send.failed": "send.failed";
|
|
188
196
|
"send.rescheduled": "send.rescheduled";
|
|
197
|
+
"send.cancelled": "send.cancelled";
|
|
189
198
|
"suppression.created": "suppression.created";
|
|
190
199
|
"calendar.initialized": "calendar.initialized";
|
|
191
200
|
"calendar.created": "calendar.created";
|
|
@@ -202,6 +211,8 @@ export declare const webhooks: {
|
|
|
202
211
|
"export.failed": "export.failed";
|
|
203
212
|
"meeting_connection.connected": "meeting_connection.connected";
|
|
204
213
|
"meeting_connection.reauth_required": "meeting_connection.reauth_required";
|
|
214
|
+
"booking.created": "booking.created";
|
|
215
|
+
"booking.cancelled": "booking.cancelled";
|
|
205
216
|
"webhook.test": "webhook.test";
|
|
206
217
|
}>>;
|
|
207
218
|
accountIds: z.ZodArray<z.ZodUUID>;
|
|
@@ -209,13 +220,13 @@ export declare const webhooks: {
|
|
|
209
220
|
mailboxIds: z.ZodArray<z.ZodUUID>;
|
|
210
221
|
mailboxRoles: z.ZodArray<z.ZodEnum<{
|
|
211
222
|
custom: "custom";
|
|
223
|
+
all: "all";
|
|
212
224
|
inbox: "inbox";
|
|
213
225
|
sent: "sent";
|
|
214
226
|
drafts: "drafts";
|
|
215
227
|
trash: "trash";
|
|
216
228
|
junk: "junk";
|
|
217
229
|
archive: "archive";
|
|
218
|
-
all: "all";
|
|
219
230
|
important: "important";
|
|
220
231
|
}>>;
|
|
221
232
|
from: z.ZodArray<z.ZodString>;
|
|
@@ -243,6 +254,8 @@ export declare const webhooks: {
|
|
|
243
254
|
readonly missing_scope: "The API key lacks the scope the operation needs.";
|
|
244
255
|
readonly role_forbidden: "The member's role does not allow the operation.";
|
|
245
256
|
readonly account_token_forbidden: "An account token called an operation account tokens cannot call.";
|
|
257
|
+
readonly account_scope_forbidden: "A credential limited to specific accounts called an operation that reaches beyond them.";
|
|
258
|
+
readonly mcp_only_key: "An MCP-only key (minted for an end user's MCP client) was used outside the MCP server.";
|
|
246
259
|
readonly rate_limited: "The tenant used up its plan's request rate; Retry-After says when the window ends.";
|
|
247
260
|
readonly too_many_requests: "The credential has too many requests in flight at once; retry after Retry-After.";
|
|
248
261
|
readonly overloaded: "The API is shedding load; retry after Retry-After.";
|
|
@@ -252,10 +265,7 @@ export declare const webhooks: {
|
|
|
252
265
|
readonly idempotency_key_reused: "POST only: the Idempotency-Key was used in the last 24 hours with another method, path or body.";
|
|
253
266
|
readonly idempotency_key_in_progress: "POST only: the request first sent with this Idempotency-Key has not been answered yet.";
|
|
254
267
|
}>>, {
|
|
255
|
-
plan_limit_webhooks:
|
|
256
|
-
status: 403;
|
|
257
|
-
message: string;
|
|
258
|
-
};
|
|
268
|
+
plan_limit_webhooks: import("../errors.js").DeclaredError<"plan_limit_webhooks">;
|
|
259
269
|
unknown_account: import("../errors.js").DeclaredError<"unknown_account">;
|
|
260
270
|
unknown_mailbox: import("../errors.js").DeclaredError<"unknown_mailbox">;
|
|
261
271
|
mailbox_outside_accounts: {
|
|
@@ -293,6 +303,7 @@ export declare const webhooks: {
|
|
|
293
303
|
"send.retrying": "send.retrying";
|
|
294
304
|
"send.failed": "send.failed";
|
|
295
305
|
"send.rescheduled": "send.rescheduled";
|
|
306
|
+
"send.cancelled": "send.cancelled";
|
|
296
307
|
"suppression.created": "suppression.created";
|
|
297
308
|
"calendar.initialized": "calendar.initialized";
|
|
298
309
|
"calendar.created": "calendar.created";
|
|
@@ -309,6 +320,8 @@ export declare const webhooks: {
|
|
|
309
320
|
"export.failed": "export.failed";
|
|
310
321
|
"meeting_connection.connected": "meeting_connection.connected";
|
|
311
322
|
"meeting_connection.reauth_required": "meeting_connection.reauth_required";
|
|
323
|
+
"booking.created": "booking.created";
|
|
324
|
+
"booking.cancelled": "booking.cancelled";
|
|
312
325
|
"webhook.test": "webhook.test";
|
|
313
326
|
}>>>;
|
|
314
327
|
accountIds: z.ZodOptional<z.ZodArray<z.ZodUUID>>;
|
|
@@ -316,13 +329,13 @@ export declare const webhooks: {
|
|
|
316
329
|
mailboxIds: z.ZodOptional<z.ZodArray<z.ZodUUID>>;
|
|
317
330
|
mailboxRoles: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
318
331
|
custom: "custom";
|
|
332
|
+
all: "all";
|
|
319
333
|
inbox: "inbox";
|
|
320
334
|
sent: "sent";
|
|
321
335
|
drafts: "drafts";
|
|
322
336
|
trash: "trash";
|
|
323
337
|
junk: "junk";
|
|
324
338
|
archive: "archive";
|
|
325
|
-
all: "all";
|
|
326
339
|
important: "important";
|
|
327
340
|
}>>>;
|
|
328
341
|
from: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
@@ -362,6 +375,7 @@ export declare const webhooks: {
|
|
|
362
375
|
"send.retrying": "send.retrying";
|
|
363
376
|
"send.failed": "send.failed";
|
|
364
377
|
"send.rescheduled": "send.rescheduled";
|
|
378
|
+
"send.cancelled": "send.cancelled";
|
|
365
379
|
"suppression.created": "suppression.created";
|
|
366
380
|
"calendar.initialized": "calendar.initialized";
|
|
367
381
|
"calendar.created": "calendar.created";
|
|
@@ -378,6 +392,8 @@ export declare const webhooks: {
|
|
|
378
392
|
"export.failed": "export.failed";
|
|
379
393
|
"meeting_connection.connected": "meeting_connection.connected";
|
|
380
394
|
"meeting_connection.reauth_required": "meeting_connection.reauth_required";
|
|
395
|
+
"booking.created": "booking.created";
|
|
396
|
+
"booking.cancelled": "booking.cancelled";
|
|
381
397
|
"webhook.test": "webhook.test";
|
|
382
398
|
}>>;
|
|
383
399
|
accountIds: z.ZodArray<z.ZodUUID>;
|
|
@@ -385,13 +401,13 @@ export declare const webhooks: {
|
|
|
385
401
|
mailboxIds: z.ZodArray<z.ZodUUID>;
|
|
386
402
|
mailboxRoles: z.ZodArray<z.ZodEnum<{
|
|
387
403
|
custom: "custom";
|
|
404
|
+
all: "all";
|
|
388
405
|
inbox: "inbox";
|
|
389
406
|
sent: "sent";
|
|
390
407
|
drafts: "drafts";
|
|
391
408
|
trash: "trash";
|
|
392
409
|
junk: "junk";
|
|
393
410
|
archive: "archive";
|
|
394
|
-
all: "all";
|
|
395
411
|
important: "important";
|
|
396
412
|
}>>;
|
|
397
413
|
from: z.ZodArray<z.ZodString>;
|
|
@@ -417,6 +433,8 @@ export declare const webhooks: {
|
|
|
417
433
|
readonly missing_scope: "The API key lacks the scope the operation needs.";
|
|
418
434
|
readonly role_forbidden: "The member's role does not allow the operation.";
|
|
419
435
|
readonly account_token_forbidden: "An account token called an operation account tokens cannot call.";
|
|
436
|
+
readonly account_scope_forbidden: "A credential limited to specific accounts called an operation that reaches beyond them.";
|
|
437
|
+
readonly mcp_only_key: "An MCP-only key (minted for an end user's MCP client) was used outside the MCP server.";
|
|
420
438
|
readonly rate_limited: "The tenant used up its plan's request rate; Retry-After says when the window ends.";
|
|
421
439
|
readonly too_many_requests: "The credential has too many requests in flight at once; retry after Retry-After.";
|
|
422
440
|
readonly overloaded: "The API is shedding load; retry after Retry-After.";
|
|
@@ -450,6 +468,8 @@ export declare const webhooks: {
|
|
|
450
468
|
readonly missing_scope: "The API key lacks the scope the operation needs.";
|
|
451
469
|
readonly role_forbidden: "The member's role does not allow the operation.";
|
|
452
470
|
readonly account_token_forbidden: "An account token called an operation account tokens cannot call.";
|
|
471
|
+
readonly account_scope_forbidden: "A credential limited to specific accounts called an operation that reaches beyond them.";
|
|
472
|
+
readonly mcp_only_key: "An MCP-only key (minted for an end user's MCP client) was used outside the MCP server.";
|
|
453
473
|
readonly rate_limited: "The tenant used up its plan's request rate; Retry-After says when the window ends.";
|
|
454
474
|
readonly too_many_requests: "The credential has too many requests in flight at once; retry after Retry-After.";
|
|
455
475
|
readonly overloaded: "The API is shedding load; retry after Retry-After.";
|
|
@@ -474,6 +494,8 @@ export declare const webhooks: {
|
|
|
474
494
|
readonly missing_scope: "The API key lacks the scope the operation needs.";
|
|
475
495
|
readonly role_forbidden: "The member's role does not allow the operation.";
|
|
476
496
|
readonly account_token_forbidden: "An account token called an operation account tokens cannot call.";
|
|
497
|
+
readonly account_scope_forbidden: "A credential limited to specific accounts called an operation that reaches beyond them.";
|
|
498
|
+
readonly mcp_only_key: "An MCP-only key (minted for an end user's MCP client) was used outside the MCP server.";
|
|
477
499
|
readonly rate_limited: "The tenant used up its plan's request rate; Retry-After says when the window ends.";
|
|
478
500
|
readonly too_many_requests: "The credential has too many requests in flight at once; retry after Retry-After.";
|
|
479
501
|
readonly overloaded: "The API is shedding load; retry after Retry-After.";
|
|
@@ -507,6 +529,7 @@ export declare const webhooks: {
|
|
|
507
529
|
"send.retrying": "send.retrying";
|
|
508
530
|
"send.failed": "send.failed";
|
|
509
531
|
"send.rescheduled": "send.rescheduled";
|
|
532
|
+
"send.cancelled": "send.cancelled";
|
|
510
533
|
"suppression.created": "suppression.created";
|
|
511
534
|
"calendar.initialized": "calendar.initialized";
|
|
512
535
|
"calendar.created": "calendar.created";
|
|
@@ -523,6 +546,8 @@ export declare const webhooks: {
|
|
|
523
546
|
"export.failed": "export.failed";
|
|
524
547
|
"meeting_connection.connected": "meeting_connection.connected";
|
|
525
548
|
"meeting_connection.reauth_required": "meeting_connection.reauth_required";
|
|
549
|
+
"booking.created": "booking.created";
|
|
550
|
+
"booking.cancelled": "booking.cancelled";
|
|
526
551
|
"webhook.test": "webhook.test";
|
|
527
552
|
}>>;
|
|
528
553
|
accountId: z.ZodOptional<z.ZodUUID>;
|
|
@@ -537,6 +562,8 @@ export declare const webhooks: {
|
|
|
537
562
|
readonly missing_scope: "The API key lacks the scope the operation needs.";
|
|
538
563
|
readonly role_forbidden: "The member's role does not allow the operation.";
|
|
539
564
|
readonly account_token_forbidden: "An account token called an operation account tokens cannot call.";
|
|
565
|
+
readonly account_scope_forbidden: "A credential limited to specific accounts called an operation that reaches beyond them.";
|
|
566
|
+
readonly mcp_only_key: "An MCP-only key (minted for an end user's MCP client) was used outside the MCP server.";
|
|
540
567
|
readonly rate_limited: "The tenant used up its plan's request rate; Retry-After says when the window ends.";
|
|
541
568
|
readonly too_many_requests: "The credential has too many requests in flight at once; retry after Retry-After.";
|
|
542
569
|
readonly overloaded: "The API is shedding load; retry after Retry-After.";
|
|
@@ -581,6 +608,7 @@ export declare const webhooks: {
|
|
|
581
608
|
"send.retrying": "send.retrying";
|
|
582
609
|
"send.failed": "send.failed";
|
|
583
610
|
"send.rescheduled": "send.rescheduled";
|
|
611
|
+
"send.cancelled": "send.cancelled";
|
|
584
612
|
"suppression.created": "suppression.created";
|
|
585
613
|
"calendar.initialized": "calendar.initialized";
|
|
586
614
|
"calendar.created": "calendar.created";
|
|
@@ -597,6 +625,8 @@ export declare const webhooks: {
|
|
|
597
625
|
"export.failed": "export.failed";
|
|
598
626
|
"meeting_connection.connected": "meeting_connection.connected";
|
|
599
627
|
"meeting_connection.reauth_required": "meeting_connection.reauth_required";
|
|
628
|
+
"booking.created": "booking.created";
|
|
629
|
+
"booking.cancelled": "booking.cancelled";
|
|
600
630
|
"webhook.test": "webhook.test";
|
|
601
631
|
}>>;
|
|
602
632
|
eventId: z.ZodOptional<z.ZodString>;
|
|
@@ -632,6 +662,7 @@ export declare const webhooks: {
|
|
|
632
662
|
"send.retrying": "send.retrying";
|
|
633
663
|
"send.failed": "send.failed";
|
|
634
664
|
"send.rescheduled": "send.rescheduled";
|
|
665
|
+
"send.cancelled": "send.cancelled";
|
|
635
666
|
"suppression.created": "suppression.created";
|
|
636
667
|
"calendar.initialized": "calendar.initialized";
|
|
637
668
|
"calendar.created": "calendar.created";
|
|
@@ -648,6 +679,8 @@ export declare const webhooks: {
|
|
|
648
679
|
"export.failed": "export.failed";
|
|
649
680
|
"meeting_connection.connected": "meeting_connection.connected";
|
|
650
681
|
"meeting_connection.reauth_required": "meeting_connection.reauth_required";
|
|
682
|
+
"booking.created": "booking.created";
|
|
683
|
+
"booking.cancelled": "booking.cancelled";
|
|
651
684
|
"webhook.test": "webhook.test";
|
|
652
685
|
}>;
|
|
653
686
|
accountId: z.ZodNullable<z.ZodUUID>;
|
|
@@ -668,6 +701,8 @@ export declare const webhooks: {
|
|
|
668
701
|
readonly missing_scope: "The API key lacks the scope the operation needs.";
|
|
669
702
|
readonly role_forbidden: "The member's role does not allow the operation.";
|
|
670
703
|
readonly account_token_forbidden: "An account token called an operation account tokens cannot call.";
|
|
704
|
+
readonly account_scope_forbidden: "A credential limited to specific accounts called an operation that reaches beyond them.";
|
|
705
|
+
readonly mcp_only_key: "An MCP-only key (minted for an end user's MCP client) was used outside the MCP server.";
|
|
671
706
|
readonly rate_limited: "The tenant used up its plan's request rate; Retry-After says when the window ends.";
|
|
672
707
|
readonly too_many_requests: "The credential has too many requests in flight at once; retry after Retry-After.";
|
|
673
708
|
readonly overloaded: "The API is shedding load; retry after Retry-After.";
|
|
@@ -704,6 +739,8 @@ export declare const webhooks: {
|
|
|
704
739
|
readonly missing_scope: "The API key lacks the scope the operation needs.";
|
|
705
740
|
readonly role_forbidden: "The member's role does not allow the operation.";
|
|
706
741
|
readonly account_token_forbidden: "An account token called an operation account tokens cannot call.";
|
|
742
|
+
readonly account_scope_forbidden: "A credential limited to specific accounts called an operation that reaches beyond them.";
|
|
743
|
+
readonly mcp_only_key: "An MCP-only key (minted for an end user's MCP client) was used outside the MCP server.";
|
|
707
744
|
readonly rate_limited: "The tenant used up its plan's request rate; Retry-After says when the window ends.";
|
|
708
745
|
readonly too_many_requests: "The credential has too many requests in flight at once; retry after Retry-After.";
|
|
709
746
|
readonly overloaded: "The API is shedding load; retry after Retry-After.";
|
|
@@ -743,6 +780,8 @@ export declare const webhooks: {
|
|
|
743
780
|
readonly missing_scope: "The API key lacks the scope the operation needs.";
|
|
744
781
|
readonly role_forbidden: "The member's role does not allow the operation.";
|
|
745
782
|
readonly account_token_forbidden: "An account token called an operation account tokens cannot call.";
|
|
783
|
+
readonly account_scope_forbidden: "A credential limited to specific accounts called an operation that reaches beyond them.";
|
|
784
|
+
readonly mcp_only_key: "An MCP-only key (minted for an end user's MCP client) was used outside the MCP server.";
|
|
746
785
|
readonly rate_limited: "The tenant used up its plan's request rate; Retry-After says when the window ends.";
|
|
747
786
|
readonly too_many_requests: "The credential has too many requests in flight at once; retry after Retry-After.";
|
|
748
787
|
readonly overloaded: "The API is shedding load; retry after Retry-After.";
|
|
@@ -778,6 +817,8 @@ export declare const webhooks: {
|
|
|
778
817
|
readonly missing_scope: "The API key lacks the scope the operation needs.";
|
|
779
818
|
readonly role_forbidden: "The member's role does not allow the operation.";
|
|
780
819
|
readonly account_token_forbidden: "An account token called an operation account tokens cannot call.";
|
|
820
|
+
readonly account_scope_forbidden: "A credential limited to specific accounts called an operation that reaches beyond them.";
|
|
821
|
+
readonly mcp_only_key: "An MCP-only key (minted for an end user's MCP client) was used outside the MCP server.";
|
|
781
822
|
readonly rate_limited: "The tenant used up its plan's request rate; Retry-After says when the window ends.";
|
|
782
823
|
readonly too_many_requests: "The credential has too many requests in flight at once; retry after Retry-After.";
|
|
783
824
|
readonly overloaded: "The API is shedding load; retry after Retry-After.";
|
|
@@ -810,6 +851,8 @@ export declare const webhooks: {
|
|
|
810
851
|
readonly missing_scope: "The API key lacks the scope the operation needs.";
|
|
811
852
|
readonly role_forbidden: "The member's role does not allow the operation.";
|
|
812
853
|
readonly account_token_forbidden: "An account token called an operation account tokens cannot call.";
|
|
854
|
+
readonly account_scope_forbidden: "A credential limited to specific accounts called an operation that reaches beyond them.";
|
|
855
|
+
readonly mcp_only_key: "An MCP-only key (minted for an end user's MCP client) was used outside the MCP server.";
|
|
813
856
|
readonly rate_limited: "The tenant used up its plan's request rate; Retry-After says when the window ends.";
|
|
814
857
|
readonly too_many_requests: "The credential has too many requests in flight at once; retry after Retry-After.";
|
|
815
858
|
readonly overloaded: "The API is shedding load; retry after Retry-After.";
|
|
@@ -1,35 +1,19 @@
|
|
|
1
|
-
/** Allowed clock skew between the platform and a receiver, per the specification. */
|
|
2
1
|
export declare const WEBHOOK_TOLERANCE_SECONDS = 300;
|
|
3
|
-
/** A fetch `Headers`, or a plain record such as Node's `req.headers` (any key case). */
|
|
4
2
|
export type WebhookHeaders = Headers | Record<string, string | string[] | undefined>;
|
|
5
3
|
export interface VerifyWebhookOptions {
|
|
6
|
-
/** Default WEBHOOK_TOLERANCE_SECONDS. */
|
|
7
4
|
toleranceSeconds?: number;
|
|
8
|
-
/** The receiver's clock; default the current time. */
|
|
9
5
|
now?: Date;
|
|
10
6
|
}
|
|
11
|
-
/** Why a delivery was refused: payload is a signed body that is not an event. */
|
|
12
7
|
export type WebhookVerificationFailure = "missing_headers" | "timestamp" | "signature" | "payload";
|
|
13
|
-
/** What each failure says, as WebhookVerificationError's message. */
|
|
14
8
|
export declare const WEBHOOK_VERIFICATION_MESSAGES: Record<WebhookVerificationFailure, string>;
|
|
15
9
|
export declare class WebhookVerificationError extends Error {
|
|
16
10
|
readonly failure: WebhookVerificationFailure;
|
|
17
11
|
constructor(failure: WebhookVerificationFailure, message?: string);
|
|
18
12
|
}
|
|
19
|
-
/** The webhook-signature header value for a delivery: `v1,<base64 HMAC>`. */
|
|
20
13
|
export declare function signWebhook(secret: string, msg: {
|
|
21
14
|
id: string;
|
|
22
15
|
timestamp: number;
|
|
23
16
|
body: string;
|
|
24
17
|
}): Promise<string>;
|
|
25
|
-
/**
|
|
26
|
-
* Why the delivery's signature does not verify, or null when it does: it is signed with `secret`
|
|
27
|
-
* and its timestamp is within the tolerance. Pass the raw request body exactly as received:
|
|
28
|
-
* re-serialized JSON does not verify. The body itself is not looked at.
|
|
29
|
-
*/
|
|
30
18
|
export declare function checkWebhookSignature(secret: string, headers: WebhookHeaders, body: string | Uint8Array | ArrayBuffer, options?: VerifyWebhookOptions): Promise<Exclude<WebhookVerificationFailure, "payload"> | null>;
|
|
31
|
-
/**
|
|
32
|
-
* True when the delivery is signed with `secret` and its timestamp is within the tolerance.
|
|
33
|
-
* Pass the raw request body exactly as received: re-serialized JSON does not verify.
|
|
34
|
-
*/
|
|
35
19
|
export declare function verifyWebhook(secret: string, headers: WebhookHeaders, body: string | Uint8Array | ArrayBuffer, options?: VerifyWebhookOptions): Promise<boolean>;
|