@macro-inc/sdk 0.4.1 → 0.6.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 (228) hide show
  1. package/README.md +316 -21
  2. package/dist/{chunk-PTX2RV2N.js → chunk-4MI52GWV.js} +93 -1
  3. package/dist/{chunk-XFA7NCJ5.js → chunk-HO75UE4Z.js} +146 -15
  4. package/dist/{chunk-P4DTO6VD.js → chunk-MCSQNZ4E.js} +6 -0
  5. package/dist/{chunk-ZLBDES7U.js → chunk-SJ6S2GAT.js} +1271 -87
  6. package/dist/{chunk-AZJUIUIV.js → chunk-SK5CMXRV.js} +100 -14
  7. package/dist/{chunk-PZPTJI6F.js → chunk-TMTYN2UK.js} +229 -2
  8. package/dist/{chunk-PPR7IWZ7.js → chunk-ZYBAKW25.js} +2 -1
  9. package/dist/generated/agent-fold/index.d.ts +202 -14
  10. package/dist/generated/agent-harness/index.d.ts +1 -1
  11. package/dist/generated/agent-harness/index.js +1 -1
  12. package/dist/generated/agent-harness/sdk.gen.d.ts +49 -2
  13. package/dist/generated/agent-harness/types.gen.d.ts +527 -9
  14. package/dist/generated/agent-reviews/index.d.ts +11 -9
  15. package/dist/generated/auth/index.d.ts +1 -1
  16. package/dist/generated/auth/index.js +1 -1
  17. package/dist/generated/auth/sdk.gen.d.ts +82 -16
  18. package/dist/generated/auth/types.gen.d.ts +768 -18
  19. package/dist/generated/calendar/types.gen.d.ts +10 -3
  20. package/dist/generated/cognition/index.d.ts +1 -1
  21. package/dist/generated/cognition/index.js +1 -1
  22. package/dist/generated/cognition/sdk.gen.d.ts +60 -6
  23. package/dist/generated/cognition/types.gen.d.ts +663 -106
  24. package/dist/generated/connection/types.gen.d.ts +1 -1
  25. package/dist/generated/contacts/index.d.ts +1 -1
  26. package/dist/generated/contacts/index.js +1 -1
  27. package/dist/generated/contacts/sdk.gen.d.ts +5 -1
  28. package/dist/generated/contacts/types.gen.d.ts +56 -0
  29. package/dist/generated/email/types.gen.d.ts +8 -2
  30. package/dist/generated/notification/index.d.ts +1 -1
  31. package/dist/generated/notification/index.js +1 -1
  32. package/dist/generated/notification/sdk.gen.d.ts +2 -1
  33. package/dist/generated/notification/types.gen.d.ts +174 -1
  34. package/dist/generated/scheduled-action/index.d.ts +1 -1
  35. package/dist/generated/scheduled-action/index.js +1 -1
  36. package/dist/generated/scheduled-action/sdk.gen.d.ts +107 -2
  37. package/dist/generated/scheduled-action/types.gen.d.ts +2451 -479
  38. package/dist/generated/search/index.d.ts +1 -1
  39. package/dist/generated/search/types.gen.d.ts +50 -11
  40. package/dist/generated/storage/index.d.ts +1 -1
  41. package/dist/generated/storage/index.js +1 -1
  42. package/dist/generated/storage/sdk.gen.d.ts +511 -18
  43. package/dist/generated/storage/types.gen.d.ts +18528 -11395
  44. package/dist/src/entities/account-managers/grant.d.ts +28 -5
  45. package/dist/src/entities/account-managers/namespace.d.ts +15 -3
  46. package/dist/src/entities/activity/entity.d.ts +7 -0
  47. package/dist/src/entities/activity/namespace.d.ts +58 -0
  48. package/dist/src/entities/activity/namespace.test.d.ts +1 -0
  49. package/dist/src/entities/agent-sessions/activity.d.ts +12 -3
  50. package/dist/src/entities/agent-sessions/agent-session.d.ts +209 -22
  51. package/dist/src/entities/agent-sessions/code-execution.d.ts +15 -3
  52. package/dist/src/entities/agent-sessions/conversation.d.ts +46 -9
  53. package/dist/src/entities/agent-sessions/namespace.d.ts +72 -16
  54. package/dist/src/entities/agent-sessions/origin.d.ts +1 -1
  55. package/dist/src/entities/agent-sessions/queued-action.d.ts +17 -3
  56. package/dist/src/entities/agent-sessions/review.d.ts +56 -5
  57. package/dist/src/entities/agent-sessions/tool-approval.d.ts +5 -1
  58. package/dist/src/entities/agents/agent.d.ts +98 -3
  59. package/dist/src/entities/agents/namespace.d.ts +52 -8
  60. package/dist/src/entities/ai/namespace.d.ts +10 -2
  61. package/dist/src/entities/api-keys/api-key.d.ts +6 -1
  62. package/dist/src/entities/api-keys/namespace.d.ts +18 -3
  63. package/dist/src/entities/bots/bot.d.ts +44 -9
  64. package/dist/src/entities/bots/namespace.d.ts +13 -1
  65. package/dist/src/entities/bots/token.d.ts +6 -1
  66. package/dist/src/entities/calendar/booking-link.d.ts +7 -1
  67. package/dist/src/entities/calendar/booking-namespace.d.ts +14 -1
  68. package/dist/src/entities/calendar/booking.d.ts +15 -0
  69. package/dist/src/entities/calendar/calendar.d.ts +10 -3
  70. package/dist/src/entities/calendar/event.d.ts +68 -9
  71. package/dist/src/entities/calendar/namespace.d.ts +91 -12
  72. package/dist/src/entities/calendar/replacement.d.ts +19 -3
  73. package/dist/src/entities/calls/call-record.d.ts +107 -17
  74. package/dist/src/entities/calls/connection.d.ts +7 -1
  75. package/dist/src/entities/calls/message.d.ts +27 -5
  76. package/dist/src/entities/calls/namespace.d.ts +15 -3
  77. package/dist/src/entities/canvases/canvas.d.ts +329 -0
  78. package/dist/src/entities/channels/access-request.d.ts +10 -2
  79. package/dist/src/entities/channels/activity.d.ts +20 -4
  80. package/dist/src/entities/channels/channel.d.ts +154 -27
  81. package/dist/src/entities/channels/labels.d.ts +41 -7
  82. package/dist/src/entities/channels/message.d.ts +105 -8
  83. package/dist/src/entities/channels/message.test.d.ts +1 -0
  84. package/dist/src/entities/channels/namespace.d.ts +37 -7
  85. package/dist/src/entities/channels/post.d.ts +13 -7
  86. package/dist/src/entities/channels/post.test.d.ts +1 -0
  87. package/dist/src/entities/channels/share.d.ts +9 -0
  88. package/dist/src/entities/channels/share.test.d.ts +1 -0
  89. package/dist/src/entities/channels/thread.d.ts +24 -4
  90. package/dist/src/entities/chats/chat.d.ts +57 -7
  91. package/dist/src/entities/chats/generation.d.ts +11 -2
  92. package/dist/src/entities/chats/namespace.d.ts +10 -2
  93. package/dist/src/entities/connected-apps/connected-app.d.ts +16 -2
  94. package/dist/src/entities/connected-apps/connector.d.ts +3 -0
  95. package/dist/src/entities/connected-apps/namespace.d.ts +18 -0
  96. package/dist/src/entities/crm/company.d.ts +64 -16
  97. package/dist/src/entities/crm/contact.d.ts +102 -14
  98. package/dist/src/entities/crm/namespace.d.ts +113 -22
  99. package/dist/src/entities/crm/pipeline-entry.d.ts +109 -0
  100. package/dist/src/entities/crm/pipeline.d.ts +292 -29
  101. package/dist/src/entities/crm/pipelines.d.ts +69 -4
  102. package/dist/src/entities/crm-email-privacy/email-privacy.d.ts +238 -0
  103. package/dist/src/entities/crm-email-privacy/email-rule-preview.d.ts +55 -0
  104. package/dist/src/entities/crm-email-privacy/email-rule-revision.d.ts +27 -0
  105. package/dist/src/entities/crm-email-privacy/email-rules.d.ts +32 -0
  106. package/dist/src/entities/databases/column.d.ts +54 -7
  107. package/dist/src/entities/databases/database.d.ts +160 -18
  108. package/dist/src/entities/databases/namespace.d.ts +40 -8
  109. package/dist/src/entities/databases/row.d.ts +2 -0
  110. package/dist/src/entities/databases/saved-query.d.ts +151 -0
  111. package/dist/src/entities/databases/table.d.ts +73 -10
  112. package/dist/src/entities/databases/view.d.ts +37 -5
  113. package/dist/src/entities/databases/webhook.d.ts +8 -1
  114. package/dist/src/entities/documents/ai-edit.d.ts +2 -0
  115. package/dist/src/entities/documents/anchor.d.ts +12 -2
  116. package/dist/src/entities/documents/comment.d.ts +29 -5
  117. package/dist/src/entities/documents/create.test.d.ts +1 -0
  118. package/dist/src/entities/documents/document.d.ts +284 -26
  119. package/dist/src/entities/documents/markdown.d.ts +25 -0
  120. package/dist/src/entities/documents/namespace.d.ts +146 -13
  121. package/dist/src/entities/documents/skills.test.d.ts +1 -0
  122. package/dist/src/entities/documents/system-skill.d.ts +21 -1
  123. package/dist/src/entities/documents/text-comment.d.ts +41 -0
  124. package/dist/src/entities/documents/text-comment.test.d.ts +1 -0
  125. package/dist/src/entities/documents/version.d.ts +5 -1
  126. package/dist/src/entities/email/attachment.d.ts +3 -0
  127. package/dist/src/entities/email/draft.d.ts +61 -9
  128. package/dist/src/entities/email/filter.d.ts +12 -2
  129. package/dist/src/entities/email/label.d.ts +7 -1
  130. package/dist/src/entities/email/link.d.ts +5 -1
  131. package/dist/src/entities/email/message.d.ts +72 -14
  132. package/dist/src/entities/email/namespace.d.ts +134 -24
  133. package/dist/src/entities/email/thread.d.ts +124 -18
  134. package/dist/src/entities/entity-mentions/mention.d.ts +6 -1
  135. package/dist/src/entities/entity-mentions/namespace.d.ts +5 -1
  136. package/dist/src/entities/entity.d.ts +65 -6
  137. package/dist/src/entities/external-chat/chat.d.ts +80 -12
  138. package/dist/src/entities/external-chat/message.d.ts +1 -1
  139. package/dist/src/entities/external-chat/namespace.d.ts +5 -1
  140. package/dist/src/entities/external-chat/send.d.ts +10 -2
  141. package/dist/src/entities/favorites/namespace.d.ts +20 -3
  142. package/dist/src/entities/foreign/foreign-entity.d.ts +5 -1
  143. package/dist/src/entities/foreign/namespace.d.ts +5 -1
  144. package/dist/src/entities/forms/form.d.ts +91 -14
  145. package/dist/src/entities/forms/namespace.d.ts +10 -2
  146. package/dist/src/entities/forms/question.d.ts +35 -7
  147. package/dist/src/entities/forms/response.d.ts +25 -5
  148. package/dist/src/entities/forms/section.d.ts +15 -3
  149. package/dist/src/entities/github-pull-requests/namespace.d.ts +5 -1
  150. package/dist/src/entities/github-pull-requests/pull-request.d.ts +15 -3
  151. package/dist/src/entities/harnesses/harness.d.ts +51 -3
  152. package/dist/src/entities/harnesses/namespace.d.ts +54 -8
  153. package/dist/src/entities/harnesses/pairing.d.ts +13 -2
  154. package/dist/src/entities/images/image.d.ts +16 -5
  155. package/dist/src/entities/images/namespace.d.ts +8 -1
  156. package/dist/src/entities/imports/entry.d.ts +65 -0
  157. package/dist/src/entities/imports/namespace.d.ts +103 -0
  158. package/dist/src/entities/imports/namespace.test.d.ts +1 -0
  159. package/dist/src/entities/initiatives/initiative.d.ts +128 -4
  160. package/dist/src/entities/initiatives/initiative.test.d.ts +1 -0
  161. package/dist/src/entities/initiatives/namespace.d.ts +71 -7
  162. package/dist/src/entities/me/namespace.d.ts +28 -3
  163. package/dist/src/entities/meetings/meeting.d.ts +46 -8
  164. package/dist/src/entities/meetings/namespace.d.ts +20 -4
  165. package/dist/src/entities/memory/namespace.d.ts +49 -0
  166. package/dist/src/entities/memory/namespace.test.d.ts +1 -0
  167. package/dist/src/entities/messages/discussion.d.ts +84 -0
  168. package/dist/src/entities/messages/thread.d.ts +19 -5
  169. package/dist/src/entities/notifications/namespace.d.ts +41 -7
  170. package/dist/src/entities/notifications/notification.d.ts +31 -6
  171. package/dist/src/entities/passwords/item.d.ts +118 -0
  172. package/dist/src/entities/passwords/namespace.d.ts +45 -0
  173. package/dist/src/entities/pins/namespace.d.ts +23 -4
  174. package/dist/src/entities/projects/namespace.d.ts +29 -0
  175. package/dist/src/entities/projects/project.d.ts +58 -7
  176. package/dist/src/entities/properties/namespace.d.ts +67 -11
  177. package/dist/src/entities/properties/namespace.test.d.ts +1 -0
  178. package/dist/src/entities/properties/property-definition.d.ts +30 -5
  179. package/dist/src/entities/properties/property-option.d.ts +14 -2
  180. package/dist/src/entities/referrals/namespace.d.ts +8 -1
  181. package/dist/src/entities/routines/namespace.d.ts +198 -14
  182. package/dist/src/entities/routines/routine.d.ts +174 -27
  183. package/dist/src/entities/routines/suggestion.d.ts +38 -0
  184. package/dist/src/entities/saved-views/namespace.d.ts +58 -0
  185. package/dist/src/entities/saved-views/saved-view.d.ts +78 -0
  186. package/dist/src/entities/search/exclusions.d.ts +6 -0
  187. package/dist/src/entities/search/namespace.d.ts +9 -3
  188. package/dist/src/entities/search/options.d.ts +3 -2
  189. package/dist/src/entities/sharing/access.d.ts +50 -9
  190. package/dist/src/entities/spreadsheets/spreadsheet.d.ts +201 -0
  191. package/dist/src/entities/suggestions/namespace.d.ts +118 -0
  192. package/dist/src/entities/suggestions/suggestion.d.ts +172 -0
  193. package/dist/src/entities/suggestions/suggestion.test.d.ts +1 -0
  194. package/dist/src/entities/tasks/namespace.d.ts +18 -5
  195. package/dist/src/entities/tasks/task.d.ts +21 -3
  196. package/dist/src/entities/teams/invite.d.ts +3 -0
  197. package/dist/src/entities/teams/namespace.d.ts +10 -2
  198. package/dist/src/entities/teams/team.d.ts +22 -2
  199. package/dist/src/entities/ui/app-link.d.ts +24 -0
  200. package/dist/src/entities/ui/namespace.d.ts +75 -0
  201. package/dist/src/entities/unfurls/namespace.d.ts +12 -2
  202. package/dist/src/entities/users/namespace.d.ts +26 -4
  203. package/dist/src/entities/users/profile-picture.d.ts +29 -0
  204. package/dist/src/entities/users/profile-picture.test.d.ts +1 -0
  205. package/dist/src/entities/users/user.d.ts +52 -1
  206. package/dist/src/entities/web/namespace.d.ts +6 -0
  207. package/dist/src/entities/webhooks/namespace.d.ts +5 -0
  208. package/dist/src/entities/webhooks/webhook.d.ts +47 -7
  209. package/dist/src/entities/whatsapp/account.d.ts +5 -1
  210. package/dist/src/entities/whatsapp/chat.d.ts +9 -1
  211. package/dist/src/entities/whatsapp/namespace.d.ts +7 -1
  212. package/dist/src/entities/workspace/namespace.d.ts +12 -4
  213. package/dist/src/entities/workspace/query.d.ts +5 -1
  214. package/dist/src/entities/workspace/query.test.d.ts +1 -0
  215. package/dist/src/events/hydrate/document.d.ts +5 -0
  216. package/dist/src/events/hydrate/user.d.ts +14 -0
  217. package/dist/src/events/receiver.d.ts +2 -0
  218. package/dist/src/events/types.d.ts +2 -1
  219. package/dist/src/macro.d.ts +59 -6
  220. package/dist/src/macro.js +18710 -10355
  221. package/dist/src/utils/activity.d.ts +2 -0
  222. package/dist/src/utils/index.d.ts +1 -1
  223. package/dist/src/utils/lazy.d.ts +20 -1
  224. package/dist/src/utils/options.d.ts +7 -0
  225. package/dist/src/utils/pagination.d.ts +16 -0
  226. package/dist/src/utils/verbs.d.ts +3 -0
  227. package/package.json +1 -1
  228. package/dist/src/entities/crm/comment.d.ts +0 -64
@@ -13,26 +13,38 @@ export declare class BotsNamespace {
13
13
  constructor(client: MacroClient);
14
14
  /** A handle to a bot by id. */
15
15
  byId(id: string): Bot;
16
- /** The bots the user can manage: their own and their teams'. */
16
+ /**
17
+ * The bots the user can manage: their own and their teams'.
18
+ *
19
+ * @readonly
20
+ */
17
21
  list(): Promise<Bot[]>;
18
22
  /**
19
23
  * Create a bot. It can post nowhere until `bot.grantChannel(channel)`; then
20
24
  * `bot.webhooks()` and `bot.createToken()` give an integration what it needs.
25
+ *
26
+ * @write
21
27
  */
22
28
  create(options: CreateBotOptions): Promise<Bot>;
23
29
  /**
24
30
  * The authenticated bot's own record. Requires bot auth; with a user API
25
31
  * key this throws (a user token has no bot identity).
32
+ *
33
+ * @readonly
26
34
  */
27
35
  me(): Promise<BotRecord>;
28
36
  /**
29
37
  * Channels containing the authenticated bot. Requires bot auth.
38
+ *
39
+ * @readonly
30
40
  */
31
41
  channels(): Promise<BotChannel[]>;
32
42
  /**
33
43
  * The authenticated bot's canonical principal id (`bot|<uuid>`) — the form
34
44
  * used for bot mentions, senders, and webhook `ids` filters. Cached on the
35
45
  * client; see {@link MacroClient.myPrincipalId}.
46
+ *
47
+ * @readonly
36
48
  */
37
49
  myPrincipalId(): Promise<string>;
38
50
  }
@@ -24,7 +24,12 @@ export declare class BotToken extends MacroEntity<BotTokenRecord> {
24
24
  readonly revokedAt: () => Promise<string | undefined>;
25
25
  /** Creation time. */
26
26
  readonly createdAt: () => Promise<string>;
27
- /** Revoke the token; requests using it fail from now on. */
27
+ /**
28
+ * Revoke the token; requests using it fail from now on.
29
+ *
30
+ * @destructive
31
+ * @idempotent
32
+ */
28
33
  revoke(): Promise<void>;
29
34
  toJSON(): {
30
35
  id: string;
@@ -21,7 +21,11 @@ export declare class BookingLink extends MacroEntity<BookingLinkRecord> {
21
21
  readonly draft: () => Promise<BookingLinkDraft>;
22
22
  /** The profile revision this link was read at; {@link edit} saves against it. */
23
23
  readonly revision: () => Promise<number>;
24
- /** The shareable URL guests book through. */
24
+ /**
25
+ * The shareable URL guests book through.
26
+ *
27
+ * @readonly
28
+ */
25
29
  webUrl(): Promise<string>;
26
30
  /**
27
31
  * Replace this link's whole configuration, only after the user replied
@@ -32,6 +36,8 @@ export declare class BookingLink extends MacroEntity<BookingLinkRecord> {
32
36
  * against {@link revision}; when someone saved in between it is refused
33
37
  * (409): read the link again and confirm the updated proposal instead of
34
38
  * overwriting their change. Returns the saved link.
39
+ *
40
+ * @write
35
41
  */
36
42
  edit(draft: BookingLinkDraft, options: {
37
43
  userConfirmation: string;
@@ -58,6 +58,8 @@ export declare class BookingNamespace {
58
58
  *
59
59
  * `query` matches link title, slug and description; omit it for every link
60
60
  * (at most 100).
61
+ *
62
+ * @readonly
61
63
  */
62
64
  links(options?: BookingScope & {
63
65
  query?: string;
@@ -79,10 +81,13 @@ export declare class BookingNamespace {
79
81
  * real hosts: a personal link names {@link BookingLinkListing.host} with
80
82
  * mode `individual`; a team link uses `collective` or `roundRobin`.
81
83
  * `requiresConfirmation` must be false. For video set `macroCall`
82
- * (preferred) or `googleMeet`, never both. Creating sends no invitations.
84
+ * or `googleMeet`, as the user asks, never both. Creating sends no invitations.
83
85
  * Replaying an identical draft at the same slug returns the saved link; a
84
86
  * different draft at that slug conflicts (409). Share the link's
85
87
  * {@link BookingLink.webUrl} as an `<m-booking-link-mention>` chip.
88
+ *
89
+ * @write
90
+ * @idempotent
86
91
  */
87
92
  createLink(draft: BookingLinkDraft, options: BookingScope & {
88
93
  userConfirmation: string;
@@ -91,6 +96,8 @@ export declare class BookingNamespace {
91
96
  * Read every booking setting of the user (or a team): booking-page name and
92
97
  * introduction, reusable schedules, default hours and every link. Reading
93
98
  * never creates settings.
99
+ *
100
+ * @readonly
94
101
  */
95
102
  settings(options?: BookingScope): Promise<BookingSettings>;
96
103
  /**
@@ -104,6 +111,8 @@ export declare class BookingNamespace {
104
111
  * hosting, so name the affected links before changing them. Deleting a link
105
112
  * cancels none of its bookings. Saving at a stale revision is refused (409):
106
113
  * read again and reconcile instead of overwriting.
114
+ *
115
+ * @destructive
107
116
  */
108
117
  saveSettings(profile: BookingProfile, options?: BookingScope): Promise<BookingSettings>;
109
118
  /**
@@ -112,6 +121,8 @@ export declare class BookingNamespace {
112
121
  * guests, answers, attendance and reschedule history. An oversized result
113
122
  * fails rather than truncating: narrow the range. Use {@link insights} for
114
123
  * statistics.
124
+ *
125
+ * @readonly
115
126
  */
116
127
  bookings(options: BookingScope & {
117
128
  from: string;
@@ -125,6 +136,8 @@ export declare class BookingNamespace {
125
136
  * Failed and processing requests are excluded. Completed means confirmed
126
137
  * and ended without a recorded no-show, not verified attendance; minutes
127
138
  * are scheduled duration, not call length. No guest contact details.
139
+ *
140
+ * @readonly
128
141
  */
129
142
  insights(query: BookingInsightsQuery): Promise<BookingInsights>;
130
143
  }
@@ -49,28 +49,43 @@ export declare class Booking extends MacroEntity<BookingRecord> {
49
49
  * Available replacement starts on one date (`YYYY-MM-DD`, in the booking
50
50
  * schedule's time zone), for {@link reschedule}. Availability is checked
51
51
  * again when the meeting moves.
52
+ *
53
+ * @readonly
52
54
  */
53
55
  rescheduleSlots(date: string): Promise<BookingSlot[]>;
54
56
  /**
55
57
  * Move the meeting to a start returned by {@link rescheduleSlots}; only on
56
58
  * the user's go-ahead, since the guest and hosts are notified. Returns the
57
59
  * saved booking.
60
+ *
61
+ * @destructive
62
+ * @openworld
58
63
  */
59
64
  reschedule(startsAt: string): Promise<Booking>;
60
65
  /**
61
66
  * Cancel the meeting; only on the user's go-ahead, since the guest and
62
67
  * hosts are notified. The booking link stays as it is. Returns the saved
63
68
  * booking.
69
+ *
70
+ * @destructive
71
+ * @openworld
72
+ * @idempotent
64
73
  */
65
74
  cancel(): Promise<Booking>;
66
75
  /**
67
76
  * Approve a legacy pending booking and send its invitations; only on the
68
77
  * user's go-ahead. Returns the saved booking.
78
+ *
79
+ * @destructive
80
+ * @openworld
69
81
  */
70
82
  approve(): Promise<Booking>;
71
83
  /**
72
84
  * Record or clear attendance once a confirmed meeting has ended. Returns
73
85
  * the saved booking.
86
+ *
87
+ * @write
88
+ * @idempotent
74
89
  */
75
90
  setAttendance(attendance: BookingAttendance): Promise<Booking>;
76
91
  private change;
@@ -9,7 +9,13 @@ import { MacroEntity } from '../entity';
9
9
  * handle loads its detail by listing the caller's calendars and matching on id.
10
10
  */
11
11
  export declare class Calendar extends MacroEntity<VisibleCalendar> {
12
- /** Set whether this calendar contributes to the caller's availability. */
12
+ /**
13
+ * Set whether this calendar contributes to the caller's availability.
14
+ *
15
+ * @write
16
+ * @openworld
17
+ * @idempotent
18
+ */
13
19
  setContributesToAvailability(contributesToAvailability: boolean): Promise<void>;
14
20
  protected fetch(): Promise<VisibleCalendar>;
15
21
  /** A handle to a calendar by id. Detail loads on first access. */
@@ -28,8 +34,9 @@ export declare class Calendar extends MacroEntity<VisibleCalendar> {
28
34
  /** Whether the grant can create and modify events on this calendar. People
29
35
  * can hold that on someone else's calendar, so it does not mean it is theirs. */
30
36
  readonly isWritable: () => Promise<boolean>;
31
- /** Whether this calendar counts toward the caller's busy time: their
32
- * setting, by default only the primary calendars of inboxes they own. */
37
+ /** Whether this calendar counts toward the caller's busy time: their Busy
38
+ * switch in Settings → Calendar, on for every calendar until they turn it
39
+ * off. Booking links, team availability and agents all read it. */
33
40
  readonly contributesToAvailability: () => Promise<NonNullable<boolean | undefined> | undefined>;
34
41
  /** Whether this is a subscribed system calendar (holidays, birthdays). */
35
42
  readonly isSubscription: () => Promise<boolean>;
@@ -1,5 +1,6 @@
1
1
  import type { AttendeeResponseStatus, CalendarAttendeeInputBody, CalendarDeletionScopeParam, CalendarEvent as CalendarEventRecord, CalendarGuestInputBody, CalendarRsvpScopeParam, CalendarUpdateScopeParam, ConferenceChange, EventReminders, EventTime, EventTransparency, EventVisibility, GuestPolicy, OutOfOfficeProperties } from '../../../generated/calendar/types.gen';
2
2
  import type { MacroClient } from '../../utils/client';
3
+ import type { Channel } from '../channels/channel';
3
4
  import { MacroEntity } from '../entity';
4
5
  import { Calendar } from './calendar';
5
6
  import { CalendarReplacement } from './replacement';
@@ -26,6 +27,11 @@ export interface UpdateEventOptions {
26
27
  /** Provider conference change; omit to retain it. Outlook removal requires a
27
28
  * separately confirmed replacement via prepareReplacement(). */
28
29
  conference?: ConferenceChange;
30
+ /** Switch the event to a Macro call in this update: create one, write its
31
+ * join link into the description and location, and remove any Google Meet or
32
+ * other conference. An event already holding a Macro call keeps it. Cannot be
33
+ * combined with `conference`. */
34
+ macroCall?: boolean;
29
35
  /** Replacement out-of-office properties, applied only to an event that is
30
36
  * already out-of-office. */
31
37
  outOfOffice?: OutOfOfficeProperties;
@@ -140,7 +146,10 @@ export declare class CalendarEvent extends MacroEntity<CalendarEventRecord> {
140
146
  /** The calendar the canonical source belongs to, when known. */
141
147
  readonly calendar: () => Promise<Calendar | undefined>;
142
148
  /** The full synced event record. Available on a seeded handle (from create /
143
- * update / rsvp); a bare `byId` handle throws (no fetch-by-id endpoint). */
149
+ * update / rsvp); a bare `byId` handle throws (no fetch-by-id endpoint).
150
+ *
151
+ * @readonly
152
+ */
144
153
  record(): Promise<CalendarEventRecord>;
145
154
  /** Update the event and return a handle to its synced record.
146
155
  *
@@ -155,7 +164,16 @@ export declare class CalendarEvent extends MacroEntity<CalendarEventRecord> {
155
164
  * to a meeting the user organizes from one of the inboxes (add them from
156
165
  * that copy and say why). Reminders belong to one copy, so set them on one
157
166
  * copy and say which inbox you used. Without `inbox` the call is refused
158
- * with `copy_choice_required`, listing each copy and the question to ask. */
167
+ * with `copy_choice_required`, listing each copy and the question to ask.
168
+ *
169
+ * To change a meeting's link to a Macro call pass `macroCall: true`; never
170
+ * delete and recreate the event for it. The Teams meeting of an Outlook event
171
+ * cannot be removed this way: use {@link CalendarEvent.prepareReplacement}.
172
+ *
173
+ * @destructive
174
+ * @openworld
175
+ * @idempotent
176
+ */
159
177
  update(options: UpdateEventOptions): Promise<CalendarEvent>;
160
178
  /** Delete the event (or a scoped part of a recurring series) at its provider.
161
179
  *
@@ -172,16 +190,28 @@ export declare class CalendarEvent extends MacroEntity<CalendarEventRecord> {
172
190
  * Deleting a copy where they are a guest takes the meeting off that inbox's
173
191
  * calendar: on Google it also declines the invitation and tells the
174
192
  * organizer, while on Outlook the organizer is not told and still sees the
175
- * invitation unanswered. */
193
+ * invitation unanswered.
194
+ *
195
+ * @destructive
196
+ * @openworld
197
+ * @idempotent
198
+ */
176
199
  delete(options?: DeleteEventOptions): Promise<void>;
177
200
  /** Preview an organizer replacement without cancelling or sending invitations.
178
- * Review replacement.status() before explicitly calling replacement.confirm(). */
201
+ * Review replacement.status() before explicitly calling replacement.confirm().
202
+ *
203
+ * @write
204
+ */
179
205
  prepareReplacement(options: {
180
206
  removeConference: boolean;
181
207
  recurrenceId?: string;
182
208
  calendar?: Calendar;
183
209
  }): Promise<CalendarReplacement>;
184
- /** Open this calendar copy in its provider for actions unavailable through its API. */
210
+ /**
211
+ * Open this calendar copy in its provider for actions unavailable through its API.
212
+ *
213
+ * @readonly
214
+ */
185
215
  providerUrl(options?: {
186
216
  recurrenceId?: string;
187
217
  calendar?: Calendar;
@@ -199,7 +229,12 @@ export declare class CalendarEvent extends MacroEntity<CalendarEventRecord> {
199
229
  *
200
230
  * The organizer may add guests, and so may a guest the organizer lets
201
231
  * invite others (see {@link CalendarEvent.viewerCan}); Google emails the
202
- * new guests. */
232
+ * new guests.
233
+ *
234
+ * @destructive
235
+ * @openworld
236
+ * @idempotent
237
+ */
203
238
  inviteGuests(options: InviteGuestsOptions): Promise<CalendarEvent>;
204
239
  /** Add a snapshot of an event shared with one of the requester's
205
240
  * channels to one of their Google calendars, and return a handle to the
@@ -210,15 +245,39 @@ export declare class CalendarEvent extends MacroEntity<CalendarEventRecord> {
210
245
  * their calendars, whichever calendar is named, so it cannot be added to
211
246
  * another of their calendars either; with `join_request_open` while their
212
247
  * request to join it is pending or accepted (the meeting then arrives as an
213
- * invitation); and with `copy_refused` when Google will not import it. */
248
+ * invitation); and with `copy_refused` when Google will not import it.
249
+ *
250
+ * @write
251
+ * @openworld
252
+ */
214
253
  addToCalendar(options?: {
215
254
  calendar?: Calendar;
216
255
  }): Promise<CalendarEvent>;
256
+ /** Share the event with a channel's current members, as posting it in the
257
+ * channel does: they can then preview it, export it with {@link ics}, add it
258
+ * to their calendar with {@link addToCalendar} and ask to join. The caller
259
+ * must be in the channel and hold the event on their own calendar; private
260
+ * and confidential events are refused with a 403. Sharing again changes
261
+ * nothing.
262
+ *
263
+ * @write
264
+ * @idempotent
265
+ */
266
+ shareWithChannel(channel: Channel): Promise<void>;
217
267
  /** The event as an iCalendar (`.ics`) document: its series, title,
218
268
  * description, location and organizer, never its guests or join link.
219
269
  * Available for the requester's own events and ones shared with a channel
220
- * they belong to. */
270
+ * they belong to.
271
+ *
272
+ * @readonly
273
+ */
221
274
  ics(): Promise<string>;
222
- /** Record the requester's RSVP and return a handle to the synced record. */
275
+ /**
276
+ * Record the requester's RSVP and return a handle to the synced record.
277
+ *
278
+ * @destructive
279
+ * @openworld
280
+ * @idempotent
281
+ */
223
282
  rsvp(options: RsvpEventOptions): Promise<CalendarEvent>;
224
283
  }
@@ -1,6 +1,7 @@
1
1
  import type { CreateCalendarEvent_Deserialize } from '../../../generated/agent-reviews';
2
2
  import type { CalendarAttendeeInputBody, ConferenceChange, EventReminders, EventTime, EventTransparency, EventVisibility, GuestPolicy, OutOfOfficeProperties, TeamCalendarSharing } from '../../../generated/calendar/types.gen';
3
3
  import type { ListOccurrencesData, ListTeamCalendarData, ListTeamOutOfOfficeData } from '../../../generated/storage/types.gen';
4
+ import { type IterationOptions } from '../../utils';
4
5
  import type { MacroClient } from '../../utils/client';
5
6
  import type { Link } from '../email/link';
6
7
  import { User } from '../users/user';
@@ -121,20 +122,33 @@ export type CalendarEventRole = 'organizer' | 'guest';
121
122
  */
122
123
  export declare class CalendarNamespace {
123
124
  private readonly client;
124
- /** Calendar availability settings, each referring to a typed calendar. */
125
+ /**
126
+ * Calendar availability settings, each referring to a typed calendar.
127
+ *
128
+ * @readonly
129
+ */
125
130
  availabilityCalendars(): Promise<{
126
131
  calendar: Calendar;
127
132
  name: string;
128
133
  isPrimary: boolean;
129
134
  contributesToAvailability: boolean;
130
135
  }[]>;
131
- /** Current sharing preference for the team calendar. */
136
+ /**
137
+ * Current sharing preference for the team calendar.
138
+ *
139
+ * @readonly
140
+ */
132
141
  teamSharing(): Promise<TeamCalendarSharing>;
133
- /** Replace the team calendar sharing preference. */
142
+ /**
143
+ * Replace the team calendar sharing preference.
144
+ *
145
+ * @write
146
+ * @idempotent
147
+ */
134
148
  setTeamSharing(sharing: TeamCalendarSharing): Promise<TeamCalendarSharing>;
135
149
  /** Occurrences on every calendar the user can see: their schedule is only
136
150
  * `contributesToAvailability` rows and meetings they attend; call the rest
137
- * by `calendarName`. Automatically paginated within the viewport. Each names
151
+ * by `calendarName`. Automatically paginated within the viewport; `maxItems` caps the total. Each names
138
152
  * its calendar (`calendarName`), whether a calendar holding it is on the
139
153
  * user's schedule (`contributesToAvailability`), the address of the
140
154
  * connected inbox holding that copy of the event (`inbox`) and whether the
@@ -164,8 +178,11 @@ export declare class CalendarNamespace {
164
178
  * `inbox` to its `update`, `inviteGuests` or `delete`; without it the call
165
179
  * is refused with `copy_choice_required`, which names each copy's inbox and
166
180
  * event and gives the question to ask. An occurrence whose calendar is no
167
- * longer listed has no `inbox`; take it from that refusal. */
168
- occurrences(options: Omit<ListOccurrencesData['query'], 'cursor'>): AsyncGenerator<{
181
+ * longer listed has no `inbox`; take it from that refusal.
182
+ *
183
+ * @readonly
184
+ */
185
+ occurrences(options: Omit<ListOccurrencesData['query'], 'cursor'> & IterationOptions): AsyncGenerator<{
169
186
  event: CalendarEvent;
170
187
  occurrence: import("../../../generated/storage").CalendarOccurrence;
171
188
  calendarName: string | undefined;
@@ -173,7 +190,11 @@ export declare class CalendarNamespace {
173
190
  inbox: string | undefined;
174
191
  role: CalendarEventRole | undefined;
175
192
  }, any, any>;
176
- /** A page of team availability, including its roster and continuation cursor. */
193
+ /**
194
+ * A page of team availability, including its roster and continuation cursor.
195
+ *
196
+ * @readonly
197
+ */
177
198
  teamPage(options: NonNullable<ListTeamCalendarData['query']>): Promise<{
178
199
  items: ({
179
200
  owner: User;
@@ -196,7 +217,11 @@ export declare class CalendarNamespace {
196
217
  }[];
197
218
  nextCursor: string | undefined;
198
219
  }>;
199
- /** Teammates' out-of-office occurrences in a bounded viewport. Check hasMore for truncation. */
220
+ /**
221
+ * Teammates' out-of-office occurrences in a bounded viewport. Check hasMore for truncation.
222
+ *
223
+ * @readonly
224
+ */
200
225
  teamOutOfOffice(options: NonNullable<ListTeamOutOfOfficeData['query']>): Promise<{
201
226
  items: {
202
227
  event: CalendarEvent;
@@ -210,18 +235,69 @@ export declare class CalendarNamespace {
210
235
  /** Booking links, their settings, booked meetings and booking statistics. */
211
236
  readonly booking: BookingNamespace;
212
237
  constructor(client: MacroClient);
213
- /** The calendars the caller can see, some possibly not theirs, primaries and writable first. */
238
+ /**
239
+ * When the user and their teammates are busy in a bounded UTC window (a day
240
+ * or a week is best, at most 370 days); `freeWindows` is present only when
241
+ * every person's data is complete, so never infer free time from missing
242
+ * busy blocks. Always includes the user; omit `members` for the whole team,
243
+ * or pass `[]` for only the user. Busy blocks carry no event titles, and
244
+ * working hours are not applied.
245
+ *
246
+ * @readonly
247
+ */
248
+ teamAvailability(opts: {
249
+ /** Inclusive start, RFC 3339 UTC. */
250
+ start: string;
251
+ /** Exclusive end, RFC 3339 UTC; later than `start`. */
252
+ end: string;
253
+ /** At most 100 current teammates. */
254
+ members?: User[];
255
+ }): Promise<{
256
+ start: string;
257
+ end: string;
258
+ members: {
259
+ user: User;
260
+ busy: Array<import("../../../generated/storage").AvailabilityInterval>;
261
+ coverage: import("../../../generated/storage").AvailabilityCoverage;
262
+ unknownReasons: Array<import("../../../generated/storage").AvailabilityUnknownReason>;
263
+ }[];
264
+ freeWindows: import("../../../generated/storage").AvailabilityInterval[] | undefined;
265
+ /** Requested people who are not current teammates; nothing about them is disclosed. */
266
+ unknownUsers: User[];
267
+ complete: boolean;
268
+ summary: string;
269
+ }>;
270
+ /**
271
+ * The calendars the caller can see, some possibly not theirs, primaries and writable first.
272
+ *
273
+ * @readonly
274
+ */
214
275
  calendars(): Promise<Calendar[]>;
215
- /** A handle to a calendar by id. Detail loads on first access. */
276
+ /**
277
+ * A handle to a calendar by id. Detail loads on first access.
278
+ *
279
+ * @readonly
280
+ */
216
281
  calendar(id: string): Calendar;
217
- /** A handle to a calendar event by id, for driving mutations. */
282
+ /**
283
+ * A handle to a calendar event by id, for driving mutations.
284
+ *
285
+ * @readonly
286
+ */
218
287
  event(id: string): CalendarEvent;
219
- /** Recover a saved replacement, including after its original event was retired. */
288
+ /**
289
+ * Recover a saved replacement, including after its original event was retired.
290
+ *
291
+ * @readonly
292
+ */
220
293
  replacement(operationId: string): CalendarReplacement;
221
294
  /**
222
295
  * Create a calendar event and return a handle to its synced record; an
223
296
  * agent's program is refused (403) and creates through a review or
224
297
  * {@link createConfirmed} instead.
298
+ *
299
+ * @destructive
300
+ * @openworld
225
301
  */
226
302
  createEvent(options: CreateEventOptions): Promise<CalendarEvent>;
227
303
  /**
@@ -236,6 +312,9 @@ export declare class CalendarNamespace {
236
312
  * out-of-office and guest policy, and the calendar to write to. The event
237
313
  * is written to the provider at once and guests receive invitations; on an
238
314
  * error, look for the event before creating it again.
315
+ *
316
+ * @destructive
317
+ * @openworld
239
318
  */
240
319
  createConfirmed(options: ConfirmedEventOptions): Promise<CalendarEvent>;
241
320
  }
@@ -5,11 +5,27 @@ export declare class CalendarReplacement {
5
5
  private readonly client;
6
6
  readonly id: string;
7
7
  constructor(client: MacroClient, id: string);
8
- /** Read progress without initiating provider writes. */
8
+ /** A handle to a replacement by its operation id. */
9
+ static byId(client: MacroClient, id: string): CalendarReplacement;
10
+ /**
11
+ * Read progress without initiating provider writes.
12
+ *
13
+ * @readonly
14
+ */
9
15
  status(): Promise<CalendarReplacementView>;
10
16
  /** Confirm the reviewed cancellation and reinvitation, or resume that same operation.
11
- * Present the preview and obtain the organizer's confirmation before the first call. */
17
+ * Present the preview and obtain the organizer's confirmation before the first call.
18
+ *
19
+ * @destructive
20
+ * @openworld
21
+ * @idempotent
22
+ */
12
23
  confirm(): Promise<CalendarReplacementView>;
13
- /** Discard an unconfirmed preview. Confirmed operations must be recovered, not discarded. */
24
+ /**
25
+ * Discard an unconfirmed preview. Confirmed operations must be recovered, not discarded.
26
+ *
27
+ * @destructive
28
+ * @idempotent
29
+ */
14
30
  discard(): Promise<void>;
15
31
  }