@macro-inc/sdk 0.2.2 → 0.4.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.
Files changed (175) hide show
  1. package/README.md +177 -3
  2. package/dist/{chunk-OGE7WXJE.js → chunk-AZJUIUIV.js} +177 -23
  3. package/dist/{chunk-PRUFPW3B.js → chunk-G43PLP2U.js} +144 -0
  4. package/dist/{chunk-7LVVPVNT.js → chunk-K4G5VO4P.js} +76 -1
  5. package/dist/{chunk-PAAFJYGO.js → chunk-PPR7IWZ7.js} +77 -51
  6. package/dist/{chunk-QVBNNMQS.js → chunk-PTX2RV2N.js} +169 -20
  7. package/dist/{chunk-SUINKDXF.js → chunk-PZPTJI6F.js} +42 -0
  8. package/dist/{chunk-7YJ6Y7HJ.js → chunk-XFA7NCJ5.js} +207 -0
  9. package/dist/{chunk-ZQXOHNDB.js → chunk-ZLBDES7U.js} +789 -12
  10. package/dist/generated/agent-fold/index.d.ts +4332 -0
  11. package/dist/generated/agent-fold/index.js +0 -0
  12. package/dist/generated/agent-harness/index.d.ts +1 -1
  13. package/dist/generated/agent-harness/index.js +1 -1
  14. package/dist/generated/agent-harness/sdk.gen.d.ts +83 -9
  15. package/dist/generated/agent-harness/types.gen.d.ts +1504 -160
  16. package/dist/generated/agent-reviews/index.d.ts +893 -0
  17. package/dist/generated/agent-reviews/index.js +0 -0
  18. package/dist/generated/auth/index.d.ts +1 -1
  19. package/dist/generated/auth/index.js +1 -1
  20. package/dist/generated/auth/sdk.gen.d.ts +108 -2
  21. package/dist/generated/auth/types.gen.d.ts +799 -6
  22. package/dist/generated/calendar/index.d.ts +1 -1
  23. package/dist/generated/calendar/index.js +1 -1
  24. package/dist/generated/calendar/sdk.gen.d.ts +63 -1
  25. package/dist/generated/calendar/types.gen.d.ts +1234 -5
  26. package/dist/generated/cognition/index.d.ts +1 -1
  27. package/dist/generated/cognition/index.js +1 -1
  28. package/dist/generated/cognition/sdk.gen.d.ts +85 -20
  29. package/dist/generated/cognition/types.gen.d.ts +1040 -121
  30. package/dist/generated/connection/index.d.ts +1 -1
  31. package/dist/generated/connection/index.js +15 -0
  32. package/dist/generated/connection/sdk.gen.d.ts +6 -1
  33. package/dist/generated/connection/types.gen.d.ts +18 -1
  34. package/dist/generated/email/index.d.ts +1 -1
  35. package/dist/generated/email/index.js +1 -1
  36. package/dist/generated/email/sdk.gen.d.ts +44 -2
  37. package/dist/generated/email/types.gen.d.ts +475 -10
  38. package/dist/generated/notification/index.d.ts +1 -1
  39. package/dist/generated/notification/index.js +1 -1
  40. package/dist/generated/notification/sdk.gen.d.ts +29 -21
  41. package/dist/generated/notification/types.gen.d.ts +267 -73
  42. package/dist/generated/properties/index.d.ts +1 -1
  43. package/dist/generated/properties/types.gen.d.ts +21 -1
  44. package/dist/generated/scheduled-action/index.d.ts +1 -1
  45. package/dist/generated/scheduled-action/index.js +1 -1
  46. package/dist/generated/scheduled-action/sdk.gen.d.ts +8 -1
  47. package/dist/generated/scheduled-action/types.gen.d.ts +669 -19
  48. package/dist/generated/search/index.d.ts +1 -1
  49. package/dist/generated/search/types.gen.d.ts +87 -7
  50. package/dist/generated/static-files/types.gen.d.ts +6 -0
  51. package/dist/generated/storage/index.d.ts +1 -1
  52. package/dist/generated/storage/index.js +1 -1
  53. package/dist/generated/storage/sdk.gen.d.ts +376 -13
  54. package/dist/generated/storage/types.gen.d.ts +12038 -5562
  55. package/dist/src/entities/account-managers/grant.d.ts +39 -0
  56. package/dist/src/entities/account-managers/namespace.d.ts +17 -0
  57. package/dist/src/entities/agent-sessions/activity.d.ts +39 -0
  58. package/dist/src/entities/agent-sessions/agent-session.d.ts +148 -6
  59. package/dist/src/entities/agent-sessions/code-execution.d.ts +5 -0
  60. package/dist/src/entities/agent-sessions/namespace.d.ts +54 -4
  61. package/dist/src/entities/agent-sessions/origin.d.ts +94 -0
  62. package/dist/src/entities/agent-sessions/review.d.ts +18 -62
  63. package/dist/src/entities/agent-sessions/view.d.ts +11 -0
  64. package/dist/src/entities/agents/namespace.d.ts +11 -2
  65. package/dist/src/entities/ai/namespace.d.ts +5 -1
  66. package/dist/src/entities/api-keys/namespace.d.ts +5 -1
  67. package/dist/src/entities/bots/bot.d.ts +108 -0
  68. package/dist/src/entities/bots/namespace.d.ts +17 -4
  69. package/dist/src/entities/bots/token.d.ts +34 -0
  70. package/dist/src/entities/calendar/booking-link.d.ts +49 -0
  71. package/dist/src/entities/calendar/booking-namespace.d.ts +130 -0
  72. package/dist/src/entities/calendar/booking-namespace.test.d.ts +1 -0
  73. package/dist/src/entities/calendar/booking.d.ts +77 -0
  74. package/dist/src/entities/calendar/calendar.d.ts +11 -4
  75. package/dist/src/entities/calendar/create-confirmed.test.d.ts +1 -0
  76. package/dist/src/entities/calendar/event.d.ts +104 -3
  77. package/dist/src/entities/calendar/namespace.d.ts +151 -7
  78. package/dist/src/entities/calendar/namespace.test.d.ts +1 -0
  79. package/dist/src/entities/calls/call-record.d.ts +34 -4
  80. package/dist/src/entities/calls/connection.d.ts +53 -0
  81. package/dist/src/entities/calls/errors.d.ts +15 -0
  82. package/dist/src/entities/calls/namespace.d.ts +21 -1
  83. package/dist/src/entities/calls/participant.d.ts +22 -0
  84. package/dist/src/entities/channels/access-request.d.ts +34 -0
  85. package/dist/src/entities/channels/channel.d.ts +47 -1
  86. package/dist/src/entities/channels/namespace.d.ts +21 -5
  87. package/dist/src/entities/channels/namespace.test.d.ts +1 -0
  88. package/dist/src/entities/channels/post.d.ts +14 -3
  89. package/dist/src/entities/channels/thread.d.ts +10 -1
  90. package/dist/src/entities/chats/chat.d.ts +7 -1
  91. package/dist/src/entities/chats/namespace.d.ts +14 -1
  92. package/dist/src/entities/connected-apps/connected-app.d.ts +107 -0
  93. package/dist/src/entities/connected-apps/connector.d.ts +56 -0
  94. package/dist/src/entities/connected-apps/namespace.d.ts +74 -0
  95. package/dist/src/entities/crm/company.d.ts +7 -3
  96. package/dist/src/entities/crm/contact.d.ts +4 -4
  97. package/dist/src/entities/crm/namespace.d.ts +34 -1
  98. package/dist/src/entities/crm/pipeline.d.ts +43 -2
  99. package/dist/src/entities/databases/database.d.ts +17 -0
  100. package/dist/src/entities/databases/namespace.d.ts +56 -0
  101. package/dist/src/entities/documents/ai-edit.d.ts +52 -0
  102. package/dist/src/entities/documents/document.d.ts +244 -5
  103. package/dist/src/entities/documents/namespace.d.ts +89 -4
  104. package/dist/src/entities/documents/office-files.d.ts +47 -0
  105. package/dist/src/entities/email/draft.d.ts +36 -7
  106. package/dist/src/entities/email/message.d.ts +99 -3
  107. package/dist/src/entities/email/namespace.d.ts +47 -4
  108. package/dist/src/entities/email/namespace.test.d.ts +1 -0
  109. package/dist/src/entities/email/thread.d.ts +55 -3
  110. package/dist/src/entities/entity-mentions/namespace.d.ts +5 -1
  111. package/dist/src/entities/external-chat/chat.d.ts +105 -0
  112. package/dist/src/entities/external-chat/message.d.ts +54 -0
  113. package/dist/src/entities/external-chat/namespace.d.ts +18 -0
  114. package/dist/src/entities/external-chat/participant.d.ts +28 -0
  115. package/dist/src/entities/external-chat/send.d.ts +32 -0
  116. package/dist/src/entities/external-chat/upload.d.ts +25 -0
  117. package/dist/src/entities/favorites/namespace.d.ts +5 -1
  118. package/dist/src/entities/foreign/namespace.d.ts +3 -0
  119. package/dist/src/entities/forms/form.d.ts +17 -2
  120. package/dist/src/entities/forms/namespace.d.ts +5 -1
  121. package/dist/src/entities/github-pull-requests/namespace.d.ts +5 -1
  122. package/dist/src/entities/harnesses/harness.d.ts +9 -0
  123. package/dist/src/entities/harnesses/namespace.d.ts +5 -1
  124. package/dist/src/entities/images/image.d.ts +77 -0
  125. package/dist/src/entities/images/namespace.d.ts +48 -0
  126. package/dist/src/entities/images/namespace.test.d.ts +1 -0
  127. package/dist/src/entities/initiatives/initiative.d.ts +12 -1
  128. package/dist/src/entities/initiatives/namespace.d.ts +15 -2
  129. package/dist/src/entities/me/namespace.d.ts +43 -0
  130. package/dist/src/entities/meetings/meeting.d.ts +5 -0
  131. package/dist/src/entities/meetings/namespace.d.ts +5 -1
  132. package/dist/src/entities/messages/thread.d.ts +1 -1
  133. package/dist/src/entities/notifications/namespace.d.ts +3 -0
  134. package/dist/src/entities/pins/namespace.d.ts +5 -1
  135. package/dist/src/entities/projects/namespace.d.ts +4 -1
  136. package/dist/src/entities/projects/project.d.ts +9 -1
  137. package/dist/src/entities/properties/namespace.d.ts +2 -0
  138. package/dist/src/entities/referrals/namespace.d.ts +33 -0
  139. package/dist/src/entities/routines/namespace.d.ts +42 -2
  140. package/dist/src/entities/routines/routine.d.ts +84 -5
  141. package/dist/src/entities/search/namespace.d.ts +65 -0
  142. package/dist/src/entities/{search.d.ts → search/options.d.ts} +8 -2
  143. package/dist/src/entities/search/types.d.ts +90 -0
  144. package/dist/src/entities/sharing/access.d.ts +14 -0
  145. package/dist/src/entities/tasks/namespace.d.ts +42 -3
  146. package/dist/src/entities/tasks/task.d.ts +47 -6
  147. package/dist/src/entities/teams/invite.d.ts +30 -0
  148. package/dist/src/entities/teams/namespace.d.ts +3 -0
  149. package/dist/src/entities/teams/team.d.ts +37 -0
  150. package/dist/src/entities/unfurls/namespace.d.ts +5 -1
  151. package/dist/src/entities/users/namespace.d.ts +9 -0
  152. package/dist/src/entities/users/user.d.ts +8 -0
  153. package/dist/src/entities/web/namespace.d.ts +61 -0
  154. package/dist/src/entities/web/namespace.test.d.ts +1 -0
  155. package/dist/src/entities/webhooks/namespace.d.ts +2 -0
  156. package/dist/src/entities/whatsapp/account.d.ts +20 -0
  157. package/dist/src/entities/whatsapp/chat.d.ts +54 -0
  158. package/dist/src/entities/whatsapp/namespace.d.ts +23 -0
  159. package/dist/src/entities/workspace/items.d.ts +7 -0
  160. package/dist/src/entities/workspace/namespace.d.ts +14 -9
  161. package/dist/src/entities/workspace/query.d.ts +23 -0
  162. package/dist/src/entities/workspace/types.d.ts +6 -3
  163. package/dist/src/events/hydrate/agentSession.d.ts +1 -1
  164. package/dist/src/events/hydrate/call.d.ts +101 -0
  165. package/dist/src/events/hydrate/channel.d.ts +8 -1
  166. package/dist/src/events/hydrate/document.d.ts +1 -1
  167. package/dist/src/events/hydrate/message.d.ts +1 -1
  168. package/dist/src/events/types.d.ts +2 -1
  169. package/dist/src/macro.d.ts +73 -4
  170. package/dist/src/macro.js +8235 -3701
  171. package/dist/src/mentions.d.ts +6 -1
  172. package/dist/src/utils/activity.d.ts +23 -2
  173. package/dist/src/utils/index.d.ts +1 -1
  174. package/dist/src/utils/unwrap.d.ts +27 -2
  175. package/package.json +2 -2
@@ -161,6 +161,10 @@ export type ApiDraftInput = {
161
161
  * Existing message DB ID (for updating an existing draft).
162
162
  */
163
163
  db_id?: string | null;
164
+ /**
165
+ * Generation from the last loaded draft; legacy clients begin at zero.
166
+ */
167
+ draft_generation?: number;
164
168
  headers_json?: null | Value;
165
169
  /**
166
170
  * Per-message override for whether to include the signature on send:
@@ -221,6 +225,10 @@ export type ApiDraftOutput = {
221
225
  * Message DB ID.
222
226
  */
223
227
  db_id?: string | null;
228
+ /**
229
+ * Generation required for subsequent edits.
230
+ */
231
+ draft_generation: number;
224
232
  headers_json?: null | Value;
225
233
  /**
226
234
  * Link ID.
@@ -293,6 +301,10 @@ export type ApiMessage = {
293
301
  cc: Array<ApiContactInfo>;
294
302
  created_at: string;
295
303
  db_id: string;
304
+ /**
305
+ * Draft edit generation; changes at send and cancellation boundaries.
306
+ */
307
+ draft_generation: number;
296
308
  from?: null | ApiContactInfo;
297
309
  global_id?: string | null;
298
310
  has_attachments: boolean;
@@ -309,6 +321,7 @@ export type ApiMessage = {
309
321
  provider_id?: string | null;
310
322
  provider_thread_id?: string | null;
311
323
  replying_to_id?: string | null;
324
+ scheduled_send_status?: null | ScheduledSendStatus;
312
325
  scheduled_send_time?: string | null;
313
326
  sent_at?: string | null;
314
327
  size_estimate?: number | null;
@@ -382,6 +395,11 @@ export type ApiThread = {
382
395
  access_level: AccessLevel;
383
396
  created_at: string;
384
397
  db_id: string;
398
+ /**
399
+ * Whether any message was received rather than drafted or sent. Only
400
+ * threads with received mail can return to the inbox.
401
+ */
402
+ has_received_mail: boolean;
385
403
  inbox_visible: boolean;
386
404
  is_read: boolean;
387
405
  latest_inbound_message_ts?: string | null;
@@ -421,6 +439,20 @@ export type ApiThreadPreviewCursorInner = {
421
439
  export type ArchiveThreadRequest = {
422
440
  value: boolean;
423
441
  };
442
+ export type ArchiveThreadsRequest = {
443
+ thread_ids: Array<string>;
444
+ value: boolean;
445
+ };
446
+ export type ArchiveThreadsResponse = {
447
+ /**
448
+ * Threads left unchanged because they could not be updated.
449
+ */
450
+ failed_thread_ids: Array<string>;
451
+ /**
452
+ * Threads whose archived status now matches the request.
453
+ */
454
+ updated_thread_ids: Array<string>;
455
+ };
424
456
  /**
425
457
  * Attachments of a message, as sent to us by the provider.
426
458
  */
@@ -622,6 +654,11 @@ export type CalendarEvent = {
622
654
  * equal.
623
655
  */
624
656
  eventType?: EventType;
657
+ /**
658
+ * What the organizer lets guests do: the canonical copy's values, or
659
+ * Google's defaults for an event synced before the policy was modeled.
660
+ */
661
+ guestPolicy: GuestPolicy;
625
662
  /**
626
663
  * RFC 5545 UID used to reconcile provider and email sources.
627
664
  */
@@ -634,6 +671,12 @@ export type CalendarEvent = {
634
671
  * Whether the canonical source's calendar prohibits editing it.
635
672
  */
636
673
  isReadOnly: boolean;
674
+ /**
675
+ * Whether this is a snapshot of a meeting shared with the owner, which
676
+ * Macro added to their calendar as a private copy: the meeting's changes
677
+ * never reach it, and nothing done to it reaches the meeting.
678
+ */
679
+ isSnapshot: boolean;
637
680
  /**
638
681
  * Optional physical or virtual location label.
639
682
  */
@@ -691,6 +734,12 @@ export type CalendarEvent = {
691
734
  * Entity update time.
692
735
  */
693
736
  updatedAt: string;
737
+ /**
738
+ * What the viewing requester may do with the event. Resolved only on
739
+ * the read path, alongside each attendee's `is_self`; nothing when no
740
+ * viewer is known. Source projections never store it.
741
+ */
742
+ viewerCan: ViewerCapabilities;
694
743
  /**
695
744
  * Event visibility.
696
745
  */
@@ -793,6 +842,12 @@ export type CalendarInvitation = {
793
842
  */
794
843
  method: InvitationMethod;
795
844
  organizer?: null | InvitationParticipant;
845
+ /**
846
+ * Raw `RRULE`, `RDATE` and `EXDATE` lines, empty for a single event.
847
+ * `None` on snapshots saved before recurrence was recorded, where a
848
+ * series cannot be told apart from a single event.
849
+ */
850
+ recurrence?: Array<string> | null;
796
851
  recurrence_id?: null | InvitationDateTime;
797
852
  /**
798
853
  * Original recurrence identifier spelling and parameters.
@@ -816,6 +871,23 @@ export type CalendarInvitation = {
816
871
  */
817
872
  uid: string;
818
873
  };
874
+ /**
875
+ * HTTP error body returned by calendar mutation endpoints.
876
+ */
877
+ export type CalendarMutationApiError = {
878
+ /**
879
+ * Machine-readable failure category.
880
+ */
881
+ code: CalendarMutationErrorCode;
882
+ /**
883
+ * Human-readable failure description.
884
+ */
885
+ message: string;
886
+ };
887
+ /**
888
+ * Machine-readable failure category for calendar mutations.
889
+ */
890
+ export type CalendarMutationErrorCode = 'not_found' | 'occurrence_not_found' | 'read_only' | 'no_writable_calendar' | 'not_attendee' | 'not_organizer' | 'guests_cannot_invite' | 'guest_list_hidden' | 'guests_cannot_modify' | 'already_on_calendar' | 'join_request_open' | 'copy_refused' | 'snapshot' | 'invalid_input' | 'reauth_required' | 'provider_rejected' | 'retryable' | 'persist_failed' | 'macro_call_failed' | 'copy_choice_required' | 'confirmation_required';
819
891
  /**
820
892
  * A materialized recurrence instance optimized for range queries.
821
893
  */
@@ -875,6 +947,16 @@ export type ContactInfoLegacy = {
875
947
  export type ContactInfoWithInteraction = ContactInfoLegacy & {
876
948
  last_interaction: string;
877
949
  };
950
+ /**
951
+ * Request body adding a shared event to the requester's calendar.
952
+ */
953
+ export type CopyCalendarEventRequest = {
954
+ /**
955
+ * Google calendar to add the copy to; defaults to the requester's
956
+ * primary inbox's primary calendar.
957
+ */
958
+ calendarId?: string | null;
959
+ };
878
960
  /**
879
961
  * Request body for creating a draft.
880
962
  */
@@ -909,6 +991,7 @@ export type CreateLabelResponse = {
909
991
  */
910
992
  label: Label;
911
993
  };
994
+ export type EmlFile = Blob | File;
912
995
  /**
913
996
  * Empty response is required due to custom fetch forcing `response.json()`
914
997
  */
@@ -1005,6 +1088,64 @@ export type EventType = 'default' | 'out_of_office' | 'focus_time' | 'working_lo
1005
1088
  * Visibility of event details.
1006
1089
  */
1007
1090
  export type EventVisibility = 'default' | 'public' | 'private' | 'confidential';
1091
+ /**
1092
+ * A refused or failed forward.
1093
+ */
1094
+ export type ForwardCalendarEventError = {
1095
+ /**
1096
+ * What went wrong.
1097
+ */
1098
+ code: ForwardCalendarEventErrorCode;
1099
+ /**
1100
+ * A message fit to show the user.
1101
+ */
1102
+ message: string;
1103
+ };
1104
+ /**
1105
+ * Why a forward was not sent.
1106
+ */
1107
+ export type ForwardCalendarEventErrorCode = 'not_found' | 'invalid_recipients' | 'inbox_unavailable' | 'send_failed';
1108
+ /**
1109
+ * One person a forwarded invitation goes to.
1110
+ */
1111
+ export type ForwardCalendarEventRecipient = {
1112
+ /**
1113
+ * Their email address.
1114
+ */
1115
+ email: string;
1116
+ /**
1117
+ * Their display name.
1118
+ */
1119
+ name?: string | null;
1120
+ };
1121
+ /**
1122
+ * Who a forwarded invitation goes to, and what its email says.
1123
+ */
1124
+ export type ForwardCalendarEventRequest = {
1125
+ /**
1126
+ * A plain-text summary of the event the email opens with; the title
1127
+ * when absent. The email ends with a note saying what the recipient
1128
+ * can do with the forward.
1129
+ */
1130
+ bodyText?: string | null;
1131
+ /**
1132
+ * The people it goes to, at most 50.
1133
+ */
1134
+ to: Array<ForwardCalendarEventRecipient>;
1135
+ };
1136
+ /**
1137
+ * The email the forward queued.
1138
+ */
1139
+ export type ForwardCalendarEventResponse = {
1140
+ /**
1141
+ * The sent message.
1142
+ */
1143
+ messageId: string;
1144
+ /**
1145
+ * Its thread.
1146
+ */
1147
+ threadId: string;
1148
+ };
1008
1149
  /**
1009
1150
  * The response returned from the get backfill job endpoint
1010
1151
  */
@@ -1049,6 +1190,24 @@ export type GetScheduledResponse = {
1049
1190
  export type GetThreadResponse = {
1050
1191
  thread: ApiThread;
1051
1192
  };
1193
+ /**
1194
+ * The switches an organizer sets on an event to bound what its guests may
1195
+ * do. Google omits a switch from the payload while it holds its default.
1196
+ */
1197
+ export type GuestPolicy = {
1198
+ /**
1199
+ * Whether guests may invite others.
1200
+ */
1201
+ canInviteOthers: boolean;
1202
+ /**
1203
+ * Whether guests may change the event, including its guest list.
1204
+ */
1205
+ canModify: boolean;
1206
+ /**
1207
+ * Whether guests may see the guest list.
1208
+ */
1209
+ canSeeOtherGuests: boolean;
1210
+ };
1052
1211
  /**
1053
1212
  * Structured 400 body carrying a machine-readable code. Clients branch on
1054
1213
  * `code` instead of parsing the human message.
@@ -1390,11 +1549,36 @@ export type MessageListVisibility = 'Show' | 'Hide';
1390
1549
  export type MessageOperationResponse = {
1391
1550
  operation?: null | ApiMessageOperation;
1392
1551
  };
1552
+ /**
1553
+ * Open state of one tracked, sent message.
1554
+ */
1555
+ export type MessageReadReceipt = {
1556
+ /**
1557
+ * First counted fetch.
1558
+ */
1559
+ first_opened_at?: string | null;
1560
+ /**
1561
+ * Latest counted fetch.
1562
+ */
1563
+ last_opened_at?: string | null;
1564
+ /**
1565
+ * The tracked message.
1566
+ */
1567
+ message_id: string;
1568
+ /**
1569
+ * Counted pixel fetches.
1570
+ */
1571
+ open_count: number;
1572
+ };
1393
1573
  export type ParsedMessage = {
1394
1574
  bcc: Array<ContactInfo>;
1395
1575
  body_parsed?: string | null;
1396
1576
  cc: Array<ContactInfo>;
1397
1577
  db_id: string;
1578
+ /**
1579
+ * Draft edit generation captured with this message snapshot.
1580
+ */
1581
+ draft_generation?: number;
1398
1582
  from?: null | ContactInfo;
1399
1583
  internal_date_ts?: string | null;
1400
1584
  labels: Array<LabelInfo>;
@@ -1412,8 +1596,8 @@ export type PatchSettingsResponse = {
1412
1596
  /**
1413
1597
  * View type. Supported values include standard labels and a custom user label user:<label>
1414
1598
  */
1415
- export type PreviewView = 'inbox' | 'sent' | 'drafts' | 'starred' | 'all' | 'important' | 'other' | string;
1416
- export type PreviewViewStandardLabel = 'inbox' | 'sent' | 'drafts' | 'starred' | 'all' | 'important' | 'other';
1599
+ export type PreviewView = 'inbox' | 'sent' | 'drafts' | 'starred' | 'all' | 'spam' | 'trash' | 'important' | 'other' | string;
1600
+ export type PreviewViewStandardLabel = 'inbox' | 'sent' | 'drafts' | 'starred' | 'all' | 'spam' | 'trash' | 'important' | 'other';
1417
1601
  /**
1418
1602
  * Payload for the `refresh_email` connection gateway event: identifies the
1419
1603
  * inbox that changed and the kind of change.
@@ -1443,6 +1627,10 @@ export type RefreshEmailEvent = {
1443
1627
  link_id: string;
1444
1628
  status: BackfillStatus;
1445
1629
  total_threads: number;
1630
+ } | {
1631
+ event: 'focus_updated';
1632
+ link_id: string;
1633
+ traceparent?: string | null;
1446
1634
  };
1447
1635
  /**
1448
1636
  * Stale versions fail without altering the current operation.
@@ -1467,6 +1655,10 @@ export type ResyncResponse = {
1467
1655
  */
1468
1656
  backfill_job_id: string;
1469
1657
  };
1658
+ /**
1659
+ * The user-visible delivery state of an unsent scheduled message.
1660
+ */
1661
+ export type ScheduledSendStatus = 'pending' | 'sending' | 'failed' | 'unconfirmed';
1470
1662
  /**
1471
1663
  * Request body for sending a message (backward-compatible with `{ message: MessageToSend }`).
1472
1664
  */
@@ -1486,6 +1678,10 @@ export type SendMessageResponse = {
1486
1678
  message: ApiDraftOutput;
1487
1679
  };
1488
1680
  export type Settings = {
1681
+ /**
1682
+ * Whether messages sent from this inbox carry an open-tracking pixel.
1683
+ */
1684
+ read_receipts_enabled?: boolean | null;
1489
1685
  /**
1490
1686
  * The user's email signature content (HTML). On a patch, omit or send
1491
1687
  * `null` to leave unchanged (both deserialize to `None`); pass an empty
@@ -1559,6 +1755,12 @@ export type ThreadPreviewCursor = {
1559
1755
  updatedAt: string;
1560
1756
  viewedAt?: string | null;
1561
1757
  };
1758
+ /**
1759
+ * Open state of the caller's tracked, sent messages in one thread.
1760
+ */
1761
+ export type ThreadReadReceipts = {
1762
+ receipts: Array<MessageReadReceipt>;
1763
+ };
1562
1764
  /**
1563
1765
  * Semantic mailbox facts, independent of folder/category names.
1564
1766
  */
@@ -1571,6 +1773,10 @@ export type ThreadSummary = {
1571
1773
  */
1572
1774
  export type TransferDraftRequest = {
1573
1775
  destination_link_id: string;
1776
+ /**
1777
+ * Generation captured with the source draft.
1778
+ */
1779
+ draft_generation?: number;
1574
1780
  operation_id: string;
1575
1781
  };
1576
1782
  /**
@@ -1685,6 +1891,12 @@ export type UpsertScheduledRequest = {
1685
1891
  * The time to send the message (ISO 8601 format).
1686
1892
  */
1687
1893
  send_time: string;
1894
+ /**
1895
+ * The user's own reply approving this send, quoted verbatim. Required
1896
+ * from an agent's program, which is refused without it; ignored for a
1897
+ * person in the app, whose Send Later is their confirmation.
1898
+ */
1899
+ user_confirmation?: string | null;
1688
1900
  };
1689
1901
  export type UpsertScheduledResponse = {
1690
1902
  message_id: string;
@@ -1692,6 +1904,36 @@ export type UpsertScheduledResponse = {
1692
1904
  };
1693
1905
  export type UserProvider = 'GMAIL' | 'OUTLOOK';
1694
1906
  export type Value = unknown;
1907
+ /**
1908
+ * What the viewing requester may do with an event.
1909
+ */
1910
+ export type ViewerCapabilities = {
1911
+ /**
1912
+ * Change the event's details (title, time, description, conference).
1913
+ */
1914
+ editDetails: boolean;
1915
+ /**
1916
+ * Add guests.
1917
+ */
1918
+ inviteGuests: boolean;
1919
+ /**
1920
+ * Act as the event's organizer: replace its whole guest list and manage
1921
+ * its conferencing.
1922
+ */
1923
+ organize: boolean;
1924
+ /**
1925
+ * Remove guests.
1926
+ */
1927
+ removeGuests: boolean;
1928
+ /**
1929
+ * Answer the invitation.
1930
+ */
1931
+ rsvp: boolean;
1932
+ /**
1933
+ * Change the event's guest policy, which only Google calendars have.
1934
+ */
1935
+ setGuestPolicy: boolean;
1936
+ };
1695
1937
  export type GetAttachmentData = {
1696
1938
  body?: never;
1697
1939
  path: {
@@ -1807,6 +2049,47 @@ export type GetBackfillGmailResponses = {
1807
2049
  200: GetBackfillJobResponse;
1808
2050
  };
1809
2051
  export type GetBackfillGmailResponse = GetBackfillGmailResponses[keyof GetBackfillGmailResponses];
2052
+ export type ForwardCalendarEventData = {
2053
+ body: ForwardCalendarEventRequest;
2054
+ path: {
2055
+ /**
2056
+ * The viewer's copy of the event
2057
+ */
2058
+ event_id: string;
2059
+ };
2060
+ query?: never;
2061
+ url: '/email/calendar-events/{event_id}/forward';
2062
+ };
2063
+ export type ForwardCalendarEventErrors = {
2064
+ /**
2065
+ * No, too many, or invalid recipients
2066
+ */
2067
+ 400: ForwardCalendarEventError;
2068
+ /**
2069
+ * Authentication required
2070
+ */
2071
+ 401: unknown;
2072
+ /**
2073
+ * The inbox holding the copy cannot send for the viewer
2074
+ */
2075
+ 403: ForwardCalendarEventError;
2076
+ /**
2077
+ * No such event on one of the viewer's own inboxes
2078
+ */
2079
+ 404: ForwardCalendarEventError;
2080
+ /**
2081
+ * The email could not be sent
2082
+ */
2083
+ 502: ForwardCalendarEventError;
2084
+ };
2085
+ export type ForwardCalendarEventError2 = ForwardCalendarEventErrors[keyof ForwardCalendarEventErrors];
2086
+ export type ForwardCalendarEventResponses = {
2087
+ /**
2088
+ * The email is queued to send
2089
+ */
2090
+ 202: ForwardCalendarEventResponse;
2091
+ };
2092
+ export type ForwardCalendarEventResponse2 = ForwardCalendarEventResponses[keyof ForwardCalendarEventResponses];
1810
2093
  export type ListContactsData = {
1811
2094
  body?: never;
1812
2095
  path?: never;
@@ -1937,7 +2220,12 @@ export type UpsertScheduledMessageData = {
1937
2220
  */
1938
2221
  id: string;
1939
2222
  };
1940
- query?: never;
2223
+ query?: {
2224
+ /**
2225
+ * Generation from the last loaded draft. Legacy clients use zero.
2226
+ */
2227
+ draft_generation?: number;
2228
+ };
1941
2229
  url: '/email/drafts/scheduled/{id}';
1942
2230
  };
1943
2231
  export type UpsertScheduledMessageErrors = {
@@ -1960,7 +2248,12 @@ export type DeleteScheduledDraftData = {
1960
2248
  */
1961
2249
  message_id: string;
1962
2250
  };
1963
- query?: never;
2251
+ query?: {
2252
+ /**
2253
+ * Generation from the last loaded draft. Legacy clients use zero.
2254
+ */
2255
+ draft_generation?: number;
2256
+ };
1964
2257
  url: '/email/drafts/scheduled/{message_id}';
1965
2258
  };
1966
2259
  export type DeleteScheduledDraftErrors = {
@@ -1986,7 +2279,12 @@ export type DeleteDraftData = {
1986
2279
  */
1987
2280
  id: string;
1988
2281
  };
1989
- query?: never;
2282
+ query?: {
2283
+ /**
2284
+ * Generation from the last loaded draft. Legacy clients use zero.
2285
+ */
2286
+ draft_generation?: number;
2287
+ };
1990
2288
  url: '/email/drafts/{id}';
1991
2289
  };
1992
2290
  export type DeleteDraftErrors = {
@@ -2008,7 +2306,12 @@ export type AddDraftAttachmentData = {
2008
2306
  */
2009
2307
  id: string;
2010
2308
  };
2011
- query?: never;
2309
+ query?: {
2310
+ /**
2311
+ * Generation from the last loaded draft. Legacy clients use zero.
2312
+ */
2313
+ draft_generation?: number;
2314
+ };
2012
2315
  url: '/email/drafts/{id}/attachments';
2013
2316
  };
2014
2317
  export type AddDraftAttachmentErrors = {
@@ -2034,7 +2337,12 @@ export type RemoveDraftAttachmentData = {
2034
2337
  */
2035
2338
  attachment_id: string;
2036
2339
  };
2037
- query?: never;
2340
+ query?: {
2341
+ /**
2342
+ * Generation from the last loaded draft. Legacy clients use zero.
2343
+ */
2344
+ draft_generation?: number;
2345
+ };
2038
2346
  url: '/email/drafts/{id}/attachments/{attachment_id}';
2039
2347
  };
2040
2348
  export type RemoveDraftAttachmentErrors = {
@@ -2054,7 +2362,12 @@ export type CompleteDraftAttachmentData = {
2054
2362
  id: string;
2055
2363
  attachment_id: string;
2056
2364
  };
2057
- query?: never;
2365
+ query?: {
2366
+ /**
2367
+ * Generation from the last loaded draft. Legacy clients use zero.
2368
+ */
2369
+ draft_generation?: number;
2370
+ };
2058
2371
  url: '/email/drafts/{id}/attachments/{attachment_id}/complete';
2059
2372
  };
2060
2373
  export type CompleteDraftAttachmentErrors = {
@@ -2076,7 +2389,12 @@ export type AddForwardedAttachmentData = {
2076
2389
  */
2077
2390
  id: string;
2078
2391
  };
2079
- query?: never;
2392
+ query?: {
2393
+ /**
2394
+ * Generation from the last loaded draft. Legacy clients use zero.
2395
+ */
2396
+ draft_generation?: number;
2397
+ };
2080
2398
  url: '/email/drafts/{id}/forwarded-attachments';
2081
2399
  };
2082
2400
  export type AddForwardedAttachmentErrors = {
@@ -2100,7 +2418,12 @@ export type RemoveForwardedAttachmentData = {
2100
2418
  */
2101
2419
  attachment_id: string;
2102
2420
  };
2103
- query?: never;
2421
+ query?: {
2422
+ /**
2423
+ * Generation from the last loaded draft. Legacy clients use zero.
2424
+ */
2425
+ draft_generation?: number;
2426
+ };
2104
2427
  url: '/email/drafts/{id}/forwarded-attachments/{attachment_id}';
2105
2428
  };
2106
2429
  export type RemoveForwardedAttachmentErrors = {
@@ -2414,6 +2737,10 @@ export type SendMessageData = {
2414
2737
  };
2415
2738
  export type SendMessageErrors = {
2416
2739
  400: ErrorResponse;
2740
+ /**
2741
+ * An agent's program asked to send; it must go through a review or a confirmed send
2742
+ */
2743
+ 403: ErrorResponse;
2417
2744
  404: ErrorResponse;
2418
2745
  500: ErrorResponse;
2419
2746
  };
@@ -2478,6 +2805,30 @@ export type GetMessageResponses = {
2478
2805
  200: ParsedMessage;
2479
2806
  };
2480
2807
  export type GetMessageResponse = GetMessageResponses[keyof GetMessageResponses];
2808
+ export type GetMessageEmlData = {
2809
+ body?: never;
2810
+ path: {
2811
+ /**
2812
+ * Message ID.
2813
+ */
2814
+ id: string;
2815
+ };
2816
+ query?: never;
2817
+ url: '/email/messages/{id}/eml';
2818
+ };
2819
+ export type GetMessageEmlErrors = {
2820
+ 401: ErrorResponse;
2821
+ 403: ErrorResponse;
2822
+ 404: ErrorResponse;
2823
+ 409: ErrorResponse;
2824
+ 429: ErrorResponse;
2825
+ 503: ErrorResponse;
2826
+ };
2827
+ export type GetMessageEmlError = GetMessageEmlErrors[keyof GetMessageEmlErrors];
2828
+ export type GetMessageEmlResponses = {
2829
+ 200: EmlFile;
2830
+ };
2831
+ export type GetMessageEmlResponse = GetMessageEmlResponses[keyof GetMessageEmlResponses];
2481
2832
  export type PatchSettingsData = {
2482
2833
  body: PatchSettingsRequest;
2483
2834
  path?: never;
@@ -2507,6 +2858,12 @@ export type MailboxSettingsOperationsResponses = {
2507
2858
  export type MailboxSettingsOperationsResponse = MailboxSettingsOperationsResponses[keyof MailboxSettingsOperationsResponses];
2508
2859
  export type DisableSyncData = {
2509
2860
  body?: never;
2861
+ headers?: {
2862
+ /**
2863
+ * Inbox link ID to act on instead of the caller's primary inbox; may name a delegated inbox.
2864
+ */
2865
+ 'X-Email-Link-Id'?: string | null;
2866
+ };
2510
2867
  path?: never;
2511
2868
  query?: never;
2512
2869
  url: '/email/sync';
@@ -2514,6 +2871,9 @@ export type DisableSyncData = {
2514
2871
  export type DisableSyncErrors = {
2515
2872
  400: ErrorResponse;
2516
2873
  401: ErrorResponse;
2874
+ 403: ErrorResponse;
2875
+ 404: ErrorResponse;
2876
+ 409: ErrorResponse;
2517
2877
  500: ErrorResponse;
2518
2878
  };
2519
2879
  export type DisableSyncError = DisableSyncErrors[keyof DisableSyncErrors];
@@ -2521,6 +2881,22 @@ export type DisableSyncResponses = {
2521
2881
  204: EmptyResponse;
2522
2882
  };
2523
2883
  export type DisableSyncResponse = DisableSyncResponses[keyof DisableSyncResponses];
2884
+ export type ArchiveThreadsData = {
2885
+ body: ArchiveThreadsRequest;
2886
+ path?: never;
2887
+ query?: never;
2888
+ url: '/email/threads/archived';
2889
+ };
2890
+ export type ArchiveThreadsErrors = {
2891
+ 400: ErrorResponse;
2892
+ 401: ErrorResponse;
2893
+ 500: ErrorResponse;
2894
+ };
2895
+ export type ArchiveThreadsError = ArchiveThreadsErrors[keyof ArchiveThreadsErrors];
2896
+ export type ArchiveThreadsResponses = {
2897
+ 200: ArchiveThreadsResponse;
2898
+ };
2899
+ export type ArchiveThreadsResponse2 = ArchiveThreadsResponses[keyof ArchiveThreadsResponses];
2524
2900
  export type PreviewsInboxCursorData = {
2525
2901
  body?: never;
2526
2902
  path: {
@@ -2755,6 +3131,59 @@ export type GetThreadCalendarInvitationsResponses = {
2755
3131
  };
2756
3132
  };
2757
3133
  export type GetThreadCalendarInvitationsResponse = GetThreadCalendarInvitationsResponses[keyof GetThreadCalendarInvitationsResponses];
3134
+ export type CopyThreadCalendarInvitationData = {
3135
+ body: CopyCalendarEventRequest;
3136
+ path: {
3137
+ /**
3138
+ * Authorized email thread
3139
+ */
3140
+ thread_id: string;
3141
+ /**
3142
+ * Message carrying the event
3143
+ */
3144
+ message_id: string;
3145
+ /**
3146
+ * Saved event within the message
3147
+ */
3148
+ invitation_id: string;
3149
+ };
3150
+ query?: never;
3151
+ url: '/email/threads/{thread_id}/messages/{message_id}/calendar-invitations/{invitation_id}/copy';
3152
+ };
3153
+ export type CopyThreadCalendarInvitationErrors = {
3154
+ /**
3155
+ * The saved event cannot be added, or the calendar is not a Google calendar
3156
+ */
3157
+ 400: CalendarMutationApiError;
3158
+ /**
3159
+ * Authentication required
3160
+ */
3161
+ 401: unknown;
3162
+ /**
3163
+ * Calendar is read-only or needs reauthorization
3164
+ */
3165
+ 403: CalendarMutationApiError;
3166
+ /**
3167
+ * No such saved event in the thread
3168
+ */
3169
+ 404: CalendarMutationApiError;
3170
+ /**
3171
+ * Already on the viewer's calendar, no writable calendar, or the provider refused the copy
3172
+ */
3173
+ 409: CalendarMutationApiError;
3174
+ /**
3175
+ * Transient provider failure
3176
+ */
3177
+ 503: CalendarMutationApiError;
3178
+ };
3179
+ export type CopyThreadCalendarInvitationError = CopyThreadCalendarInvitationErrors[keyof CopyThreadCalendarInvitationErrors];
3180
+ export type CopyThreadCalendarInvitationResponses = {
3181
+ /**
3182
+ * The copy on the viewer's calendar
3183
+ */
3184
+ 201: CalendarEvent;
3185
+ };
3186
+ export type CopyThreadCalendarInvitationResponse = CopyThreadCalendarInvitationResponses[keyof CopyThreadCalendarInvitationResponses];
2758
3187
  export type UpdateThreadProjectData = {
2759
3188
  body: UpdateThreadProjectRequest;
2760
3189
  path: {
@@ -2776,6 +3205,25 @@ export type UpdateThreadProjectResponses = {
2776
3205
  200: UpdateThreadProjectResponse;
2777
3206
  };
2778
3207
  export type UpdateThreadProjectResponse2 = UpdateThreadProjectResponses[keyof UpdateThreadProjectResponses];
3208
+ export type GetThreadReadReceiptsData = {
3209
+ body?: never;
3210
+ path: {
3211
+ /**
3212
+ * Authorized email thread
3213
+ */
3214
+ thread_id: string;
3215
+ };
3216
+ query?: never;
3217
+ url: '/email/threads/{thread_id}/read-receipts';
3218
+ };
3219
+ export type GetThreadReadReceiptsErrors = {
3220
+ 401: unknown;
3221
+ 403: unknown;
3222
+ };
3223
+ export type GetThreadReadReceiptsResponses = {
3224
+ 200: ThreadReadReceipts;
3225
+ };
3226
+ export type GetThreadReadReceiptsResponse = GetThreadReadReceiptsResponses[keyof GetThreadReadReceiptsResponses];
2779
3227
  export type HealthHandlerData = {
2780
3228
  body?: never;
2781
3229
  path?: never;
@@ -2789,3 +3237,20 @@ export type HealthHandlerResponses = {
2789
3237
  200: EmptyResponse;
2790
3238
  };
2791
3239
  export type HealthHandlerResponse = HealthHandlerResponses[keyof HealthHandlerResponses];
3240
+ export type GetReadReceiptPixelData = {
3241
+ body?: never;
3242
+ path: {
3243
+ /**
3244
+ * Opaque pixel token
3245
+ */
3246
+ token: string;
3247
+ };
3248
+ query?: never;
3249
+ url: '/opens/{token}';
3250
+ };
3251
+ export type GetReadReceiptPixelResponses = {
3252
+ /**
3253
+ * Transparent pixel, for any token
3254
+ */
3255
+ 200: unknown;
3256
+ };