@hellopivot/sdk 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1664 @@
1
+ interface RetryConfig {
2
+ /** Maximum number of retry attempts (default: 3) */
3
+ maxRetries: number;
4
+ /** Initial delay in milliseconds before the first retry (default: 500) */
5
+ initialDelayMs: number;
6
+ /** Maximum delay in milliseconds between retries (default: 30000) */
7
+ maxDelayMs: number;
8
+ /** Multiplier for exponential backoff (default: 2) */
9
+ backoffMultiplier: number;
10
+ /** Jitter factor (0-1) to add randomness to retry delays (default: 0.25) */
11
+ jitterFactor: number;
12
+ /** HTTP status codes that should trigger a retry */
13
+ retryableStatusCodes: number[];
14
+ }
15
+ declare const DEFAULT_RETRY_CONFIG: RetryConfig;
16
+
17
+ /**
18
+ * Configuration options for the Pivot SDK client.
19
+ */
20
+ interface PivotClientOptions {
21
+ /**
22
+ * Your Pivot API key.
23
+ * Falls back to the `PIVOT_API_KEY` environment variable if not provided.
24
+ */
25
+ apiKey?: string;
26
+ /**
27
+ * Base URL for the Pivot API.
28
+ * @default 'https://api.pivot.app'
29
+ */
30
+ baseUrl?: string;
31
+ /**
32
+ * Request timeout in milliseconds.
33
+ * @default 30000
34
+ */
35
+ timeoutMs?: number;
36
+ /**
37
+ * Retry configuration. Set to `false` to disable retries.
38
+ */
39
+ retry?: Partial<RetryConfig> | false;
40
+ /**
41
+ * Custom fetch implementation. Useful for testing or environments
42
+ * where global fetch is not available.
43
+ */
44
+ fetch?: typeof globalThis.fetch;
45
+ /**
46
+ * Additional default headers to include with every request.
47
+ */
48
+ defaultHeaders?: Record<string, string>;
49
+ }
50
+ interface RequestOptions {
51
+ body?: unknown;
52
+ query?: Record<string, unknown>;
53
+ headers?: Record<string, string>;
54
+ timeoutMs?: number;
55
+ signal?: AbortSignal;
56
+ }
57
+ /**
58
+ * Core HTTP client for the Pivot SDK.
59
+ * Handles authentication, retries, timeouts, and request/response processing.
60
+ */
61
+ declare class PivotClientCore {
62
+ private readonly apiKey;
63
+ private readonly baseUrl;
64
+ private readonly timeoutMs;
65
+ private readonly retryConfig;
66
+ private readonly fetchFn;
67
+ private readonly defaultHeaders;
68
+ constructor(options?: PivotClientOptions);
69
+ /**
70
+ * Make an authenticated HTTP request to the Pivot API.
71
+ */
72
+ request<T>(method: string, path: string, options?: RequestOptions): Promise<T>;
73
+ }
74
+
75
+ interface AddGroupToSpaceContent {
76
+ groupId: string;
77
+ roleIds: string[];
78
+ }
79
+ interface AddGroupToSpaceResponse {
80
+ success?: boolean;
81
+ }
82
+ interface Asset {
83
+ id?: string;
84
+ referencePrefix?: string;
85
+ referenceId?: string;
86
+ type?: 'ASSET_TYPE_UNSPECIFIED' | 'ASSET_TYPE_TRANSCRIPT';
87
+ transcript?: Transcript;
88
+ createdAt?: string;
89
+ }
90
+ interface Attachment {
91
+ id?: string;
92
+ fileId?: string;
93
+ fileUrl?: string;
94
+ displayName?: string;
95
+ type?: 'MESSAGE_ATTACHMENT_TYPE_UNSPECIFIED' | 'MESSAGE_ATTACHMENT_TYPE_VIDEO_MESSAGE' | 'MESSAGE_ATTACHMENT_TYPE_AUDIO_MESSAGE' | 'MESSAGE_ATTACHMENT_TYPE_ATTACHMENT' | 'MESSAGE_ATTACHMENT_TYPE_INLINE_IMAGE';
96
+ mimeType?: 'MIME_TYPE_UNSPECIFIED' | 'MIME_TYPE_AUDIO' | 'MIME_TYPE_VIDEO' | 'MIME_TYPE_IMAGE' | 'MIME_TYPE_PDF' | 'MIME_TYPE_WORD' | 'MIME_TYPE_BYTES';
97
+ createdAt?: string;
98
+ updatedAt?: string;
99
+ }
100
+ interface Block {
101
+ id?: string;
102
+ descriptionSpaceId?: string;
103
+ homeSpaceId?: string;
104
+ attachedToMessageId?: string;
105
+ parentBlockId?: string;
106
+ type?: 'BLOCK_TYPE_UNSPECIFIED' | 'BLOCK_TYPE_PAGE' | 'BLOCK_TYPE_SECTION' | 'BLOCK_TYPE_HEADING' | 'BLOCK_TYPE_TEXT' | 'BLOCK_TYPE_BULLETED_LIST_ITEM' | 'BLOCK_TYPE_NUMBERED_LIST_ITEM' | 'BLOCK_TYPE_FILE' | 'BLOCK_TYPE_IMAGE' | 'BLOCK_TYPE_CHECKBOX_LIST_ITEM' | 'BLOCK_TYPE_CALLOUT' | 'BLOCK_TYPE_QUOTE' | 'BLOCK_TYPE_DIVIDER' | 'BLOCK_TYPE_EMBED' | 'BLOCK_TYPE_LINK_PREVIEW' | 'BLOCK_TYPE_TABLE' | 'BLOCK_TYPE_BUTTON' | 'BLOCK_TYPE_CODE' | 'BLOCK_TYPE_VIDEO' | 'BLOCK_TYPE_AUDIO' | 'BLOCK_TYPE_SYNCED_BLOCK' | 'BLOCK_TYPE_TABLE_OF_CONTENTS' | 'BLOCK_TYPE_CALENDAR' | 'BLOCK_TYPE_TEMPLATE' | 'BLOCK_TYPE_WORKFLOW' | 'BLOCK_TYPE_ROOM' | 'BLOCK_TYPE_EVENT' | 'BLOCK_TYPE_POLL' | 'BLOCK_TYPE_AUDIO_MESSAGE' | 'BLOCK_TYPE_VIDEO_MESSAGE' | 'BLOCK_TYPE_CANVAS' | 'BLOCK_TYPE_CANVAS_SHAPE' | 'BLOCK_TYPE_FIND_A_TIME' | 'BLOCK_TYPE_FORM' | 'BLOCK_TYPE_GOAL' | 'BLOCK_TYPE_DATABASE' | 'BLOCK_TYPE_DATABASE_ITEM' | 'BLOCK_TYPE_CHART' | 'BLOCK_TYPE_ASSIGNMENT' | 'BLOCK_TYPE_QUIZ' | 'BLOCK_TYPE_RUBRIC' | 'BLOCK_TYPE_GRADES' | 'BLOCK_TYPE_PARAGRAPH';
107
+ richContent?: string;
108
+ icon?: string;
109
+ createdBy?: string;
110
+ updatedBy?: string;
111
+ vOrder?: number;
112
+ hOrder?: number;
113
+ hideAfter?: string;
114
+ unhideAfter?: string;
115
+ startAt?: string;
116
+ endAt?: string;
117
+ isLocked?: boolean;
118
+ allowResponsesStart?: string;
119
+ allowResponsesEnd?: string;
120
+ responsesAreEditable?: boolean;
121
+ url?: string;
122
+ defaultLayout?: 'BLOCK_DEFAULT_LAYOUT_UNSPECIFIED' | 'BLOCK_DEFAULT_LAYOUT_INLINE' | 'BLOCK_DEFAULT_LAYOUT_LINK_FROM_PARENT';
123
+ templateType?: 'BLOCK_TEMPLATE_TYPE_UNSPECIFIED' | 'BLOCK_TEMPLATE_TYPE_NOT_TEMPLATE' | 'BLOCK_TEMPLATE_TYPE_ORGANIZATION' | 'BLOCK_TEMPLATE_TYPE_PARENT_BLOCK' | 'BLOCK_TEMPLATE_TYPE_GLOBAL';
124
+ mediaThumbnailTime?: number;
125
+ programmingLanguage?: string;
126
+ overrideDisplayNumber?: boolean;
127
+ publicAllowDuplicateAsTemplate?: boolean;
128
+ publicLinkExpiresAt?: string;
129
+ publicSharingLevel?: 'BLOCK_SHARING_LEVEL_UNSPECIFIED' | 'BLOCK_SHARING_LEVEL_NOT_SHARED' | 'BLOCK_SHARING_LEVEL_VIEW' | 'BLOCK_SHARING_LEVEL_VIEW_AND_COMMENT' | 'BLOCK_SHARING_LEVEL_EDIT_CONTENT' | 'BLOCK_SHARING_LEVEL_EDIT_STRUCTURE_AND_CONTENT' | 'BLOCK_SHARING_LEVEL_FULL_CONTROL';
130
+ organizationSharingLevel?: 'BLOCK_SHARING_LEVEL_UNSPECIFIED' | 'BLOCK_SHARING_LEVEL_NOT_SHARED' | 'BLOCK_SHARING_LEVEL_VIEW' | 'BLOCK_SHARING_LEVEL_VIEW_AND_COMMENT' | 'BLOCK_SHARING_LEVEL_EDIT_CONTENT' | 'BLOCK_SHARING_LEVEL_EDIT_STRUCTURE_AND_CONTENT' | 'BLOCK_SHARING_LEVEL_FULL_CONTROL';
131
+ spaceMemberSharingLevel?: 'BLOCK_SHARING_LEVEL_UNSPECIFIED' | 'BLOCK_SHARING_LEVEL_NOT_SHARED' | 'BLOCK_SHARING_LEVEL_VIEW' | 'BLOCK_SHARING_LEVEL_VIEW_AND_COMMENT' | 'BLOCK_SHARING_LEVEL_EDIT_CONTENT' | 'BLOCK_SHARING_LEVEL_EDIT_STRUCTURE_AND_CONTENT' | 'BLOCK_SHARING_LEVEL_FULL_CONTROL';
132
+ updatedAt?: string;
133
+ createdAt?: string;
134
+ deletedAt?: string;
135
+ deletedBy?: string;
136
+ jwtToken?: string;
137
+ pilotToken?: string;
138
+ correspondingRoomId?: string;
139
+ /** Block user data */
140
+ userIsComplete?: boolean;
141
+ lastUserViewId?: string;
142
+ lastSeenInfo?: LastSeenInfo[];
143
+ content?: string;
144
+ /** ordered list of the ancestors of the block */
145
+ ancestors?: BlockAncestor[];
146
+ attachments?: BlockAttachment[];
147
+ currentUserAccessLevel?: 'BLOCK_ACCESS_LEVEL_UNSPECIFIED' | 'BLOCK_ACCESS_LEVEL_NO_ACCESS' | 'BLOCK_ACCESS_LEVEL_VIEW_ONLY' | 'BLOCK_ACCESS_LEVEL_COMMENT' | 'BLOCK_ACCESS_LEVEL_EDIT_CONTENT' | 'BLOCK_ACCESS_LEVEL_EDIT_STRUCTURE' | 'BLOCK_ACCESS_LEVEL_FULL_CONTROL';
148
+ richTextCrdtVersion?: number;
149
+ }
150
+ interface BlockAncestor {
151
+ type?: 'ANCESTOR_TYPE_UNSPECIFIED' | 'ANCESTOR_TYPE_DESCRIPTION_SPACE' | 'ANCESTOR_TYPE_HOME_SPACE' | 'ANCESTOR_TYPE_ATTACHED_TO_MESSAGE' | 'ANCESTOR_TYPE_INTERMEDIATE_BLOCK';
152
+ id?: string;
153
+ }
154
+ interface BlockAttachment {
155
+ id?: string;
156
+ fileId?: string;
157
+ fileUrl?: string;
158
+ displayName?: string;
159
+ createdAt?: string;
160
+ }
161
+ interface BlockResponse {
162
+ id?: string;
163
+ blockId?: string;
164
+ parentBlockResponseId?: string;
165
+ richContent?: RichContent;
166
+ createdAt?: string;
167
+ updatedAt?: string;
168
+ status?: 'BLOCK_RESPONSE_STATUS_UNSPECIFIED' | 'BLOCK_RESPONSE_STATUS_DRAFT' | 'BLOCK_RESPONSE_STATUS_SENT';
169
+ createdBy?: string;
170
+ attachments?: BlockResponseAttachment[];
171
+ reactions?: BlockResponseReaction[];
172
+ }
173
+ interface BlockResponseAttachment {
174
+ id?: string;
175
+ fileId?: string;
176
+ fileUrl?: string;
177
+ displayName?: string;
178
+ type?: string;
179
+ createdAt?: string;
180
+ }
181
+ interface BlockResponseReaction {
182
+ userId?: string;
183
+ emojiIds?: string[];
184
+ updatedAt?: string;
185
+ }
186
+ interface Chapter {
187
+ gist?: string;
188
+ start?: number;
189
+ end?: number;
190
+ headline?: string;
191
+ summary?: string;
192
+ }
193
+ interface CopySpaceContent {
194
+ name: string;
195
+ }
196
+ interface CopySpaceResponse {
197
+ success?: boolean;
198
+ }
199
+ interface CreateBlockResponseAttachmentContent {
200
+ fileId: string;
201
+ }
202
+ interface CreateBlockResponseAttachmentResponse {
203
+ response?: BlockResponse;
204
+ }
205
+ interface CreateGroupMembersByGroupIdContent {
206
+ userIds: string[];
207
+ }
208
+ interface CreateGroupMembersByGroupIdResponse {
209
+ users?: User[];
210
+ }
211
+ interface CreateLabelContent {
212
+ name: string;
213
+ color: string;
214
+ }
215
+ interface CreateLabelResponse {
216
+ label?: Label;
217
+ }
218
+ interface CreateResponseForBlockContent {
219
+ parentResponseId?: string;
220
+ richContent: RichContent;
221
+ }
222
+ interface CreateResponseForBlockResponse {
223
+ response?: BlockResponse;
224
+ }
225
+ interface CreateRoomMembersByRoomIdContent {
226
+ userIds: string[];
227
+ role: 'ROOM_ROLE_UNSPECIFIED' | 'ROOM_ROLE_HOST' | 'ROOM_ROLE_PARTICIPANT';
228
+ }
229
+ interface CreateRoomMembersByRoomIdResponse {
230
+ members?: RoomMember[];
231
+ }
232
+ interface CreateSpaceContent {
233
+ name: string;
234
+ type: 'SPACE_TYPE_UNSPECIFIED' | 'SPACE_TYPE_PERSONAL' | 'SPACE_TYPE_COMMUNITY' | 'SPACE_TYPE_COURSE' | 'SPACE_TYPE_PROJECT' | 'SPACE_TYPE_TEAM' | 'SPACE_TYPE_KNOWLEDGE' | 'SPACE_TYPE_OTHER';
235
+ otherTypeName?: string;
236
+ organizationSharing?: 'SPACE_SHARING_LEVEL_UNSPECIFIED' | 'SPACE_SHARING_LEVEL_DISABLED' | 'SPACE_SHARING_LEVEL_JOIN' | 'SPACE_SHARING_LEVEL_REQUEST';
237
+ linkSharing?: 'SPACE_SHARING_LEVEL_UNSPECIFIED' | 'SPACE_SHARING_LEVEL_DISABLED' | 'SPACE_SHARING_LEVEL_JOIN' | 'SPACE_SHARING_LEVEL_REQUEST';
238
+ publicSharing?: 'SPACE_SHARING_LEVEL_UNSPECIFIED' | 'SPACE_SHARING_LEVEL_DISABLED' | 'SPACE_SHARING_LEVEL_JOIN' | 'SPACE_SHARING_LEVEL_REQUEST';
239
+ tags?: string[];
240
+ templateType?: string;
241
+ iconName?: string;
242
+ enableProgressTracking?: boolean;
243
+ onlyAllowExistingOrganizationMembers?: boolean;
244
+ allowBlockSharingOrganizationMembers?: boolean;
245
+ allowBlockSharingPublic?: boolean;
246
+ allowBlockSharingUsers?: boolean;
247
+ }
248
+ interface CreateSpaceMembersBySpaceIdContent {
249
+ members: MemberInfo[];
250
+ }
251
+ interface CreateSpaceMembersBySpaceIdResponse {
252
+ members?: SpaceMember[];
253
+ }
254
+ interface CreateSpaceResponse {
255
+ space?: Space;
256
+ }
257
+ interface CreateSpaceRoleContent {
258
+ name: string;
259
+ type?: 'SPACE_ROLE_TYPE_UNSPECIFIED' | 'SPACE_ROLE_TYPE_FULL' | 'SPACE_ROLE_TYPE_GUEST';
260
+ permissions: 'SPACE_ROLE_PERMISSIONS_UNSPECIFIED' | 'SPACE_ROLE_PERMISSIONS_VIEW_SPACE_SETTINGS' | 'SPACE_ROLE_PERMISSIONS_EDIT_SETTINGS' | 'SPACE_ROLE_PERMISSIONS_VIEW_SPACE_ANALYTICS' | 'SPACE_ROLE_PERMISSIONS_VIEW_SPACE_MEMBERS' | 'SPACE_ROLE_PERMISSIONS_CHANGE_SPACE_MEMBERS' | 'SPACE_ROLE_PERMISSIONS_VIEW_ALL_BLOCKS' | 'SPACE_ROLE_PERMISSIONS_EDIT_ALL_BLOCKS_FULL_CONTROL' | 'SPACE_ROLE_PERMISSIONS_EDIT_SPACE_HOME_BLOCKS' | 'SPACE_ROLE_PERMISSIONS_ACCESS_HIDDEN_BLOCKS' | 'SPACE_ROLE_PERMISSIONS_SEND_MESSAGES_AND_COMMENT' | 'SPACE_ROLE_PERMISSIONS_EDUCATOR_ACCESS'[];
261
+ }
262
+ interface CreateSpaceRoleResponse {
263
+ role?: SpaceRole;
264
+ }
265
+ interface CreateWebhookContent {
266
+ name: string;
267
+ description?: string;
268
+ endpointUrl: string;
269
+ subscriptions: WebhookSubscriptionInput[];
270
+ }
271
+ interface CreateWebhookResponse {
272
+ /** Response message for creating a webhook */
273
+ webhook?: Webhook;
274
+ secret?: string;
275
+ }
276
+ interface CustomWebView {
277
+ id?: string;
278
+ url?: string;
279
+ displayName?: string;
280
+ icon?: string;
281
+ status?: 'CUSTOM_WEB_VIEW_STATUS_UNSPECIFIED' | 'CUSTOM_WEB_VIEW_STATUS_ACTIVE' | 'CUSTOM_WEB_VIEW_STATUS_DELETED';
282
+ openStyle?: 'CUSTOM_WEB_VIEW_OPEN_STYLE_UNSPECIFIED' | 'CUSTOM_WEB_VIEW_OPEN_STYLE_EMBEDDED' | 'CUSTOM_WEB_VIEW_OPEN_STYLE_NEW_TAB';
283
+ groupId?: string;
284
+ createdAt?: string;
285
+ updatedAt?: string;
286
+ deletedAt?: string;
287
+ }
288
+ interface DeleteBlockResponseAttachmentResponse {
289
+ success?: boolean;
290
+ }
291
+ interface DeleteGroupMembersByGroupIdResponse {
292
+ success?: boolean;
293
+ }
294
+ interface DeleteLabelResponse {
295
+ success?: boolean;
296
+ }
297
+ interface DeleteResponseForBlockResponse {
298
+ success?: boolean;
299
+ }
300
+ interface DeleteSpaceMemberResponse {
301
+ success?: boolean;
302
+ }
303
+ interface DeleteUserResponse {
304
+ success?: boolean;
305
+ }
306
+ interface DeleteVerifiedUserOrRemoveFromOrgResponse {
307
+ userDeleted?: boolean;
308
+ user?: User;
309
+ }
310
+ interface DeleteWebhookResponse {
311
+ /** Response message for deleting a webhook */
312
+ success?: boolean;
313
+ }
314
+ interface GetAssignmentBlocksBySpaceIdResponse {
315
+ assignmentBlocks?: Block[];
316
+ }
317
+ interface GetBlockByIdResponse {
318
+ block?: Block;
319
+ }
320
+ interface GetBlockResponsesByBlockIdResponse {
321
+ responses?: BlockResponse[];
322
+ }
323
+ interface GetGroupMembersByGroupIdResponse {
324
+ users?: User[];
325
+ }
326
+ interface GetGroupsByOrganizationIdResponse {
327
+ groups?: Group[];
328
+ nextOffset?: number;
329
+ }
330
+ interface GetLabelsByOrganizationIdResponse {
331
+ labels?: Label[];
332
+ }
333
+ interface GetMessageByIdResponse {
334
+ message?: Message;
335
+ }
336
+ interface GetMessagesByParentIdResponse {
337
+ messages?: Message[];
338
+ nextOffset?: number;
339
+ total?: number;
340
+ }
341
+ interface GetMessagesByRoomIdResponse {
342
+ messages?: Message[];
343
+ nextOffset?: number;
344
+ }
345
+ interface GetRoomActiveParticipantsResponse {
346
+ users?: RoomMemberStats[];
347
+ }
348
+ interface GetRoomBlocksBySpaceIdResponse {
349
+ roomBlocks?: Block[];
350
+ roomInfo?: RoomInfo[];
351
+ }
352
+ interface GetRoomByIdResponse {
353
+ room?: Room;
354
+ }
355
+ interface GetRoomMessagesResponse {
356
+ messages?: Message[];
357
+ nextCursorSentAt?: string;
358
+ nextCursorMessageId?: string;
359
+ shardHasMore?: boolean;
360
+ /** Always returned. Provides the timestamp to use as cursor_sent_at to query the next older partition.
361
+ Calculated from the room-specific partitioning algorithm. Clients should use the room's
362
+ created_at to determine when to stop querying older partitions. */
363
+ nextPartitionCursor?: string;
364
+ }
365
+ interface GetRoomRecordingByIdResponse {
366
+ roomRecording?: RoomRecording;
367
+ }
368
+ interface GetRoomRecordingsByRoomIdResponse {
369
+ roomRecordings?: RoomRecording[];
370
+ nextCursorCreatedAt?: string;
371
+ nextCursorId?: string;
372
+ hasMore?: boolean;
373
+ }
374
+ interface GetSpaceMembersResponse {
375
+ members?: SpaceMember[];
376
+ nextOffset?: number;
377
+ }
378
+ interface GetSpaceRolesResponse {
379
+ roles?: SpaceRole[];
380
+ }
381
+ interface GetSpacesByOrganizationIdResponse {
382
+ spaces?: Space[];
383
+ nextOffset?: number;
384
+ }
385
+ interface GetThreadMessagesResponse {
386
+ messages?: Message[];
387
+ /** Cursor for next page. Only populated when has_more is true.
388
+ Pass these values as cursor_sent_at and cursor_message_id in the next request. */
389
+ nextCursorSentAt?: string;
390
+ nextCursorMessageId?: string;
391
+ /** True if there are more messages available in this thread. When false, all thread messages
392
+ have been retrieved. Unlike room messages, threads exist on a single partition, so there
393
+ is no shard-awareness needed. */
394
+ hasMore?: boolean;
395
+ }
396
+ interface GetUserContextByOrganizationIdResponse {
397
+ user?: User;
398
+ spaceMemberships?: SpaceMember[];
399
+ groups?: Group[];
400
+ }
401
+ interface GetWebhookLogsResponse {
402
+ /** Response message for getting webhook logs */
403
+ logs?: WebhookLog[];
404
+ nextBeforeTime?: string;
405
+ }
406
+ interface GetWebhooksByOrganizationIdResponse {
407
+ /** Response message for getting webhooks by organization ID */
408
+ webhooks?: Webhook[];
409
+ }
410
+ interface GoogleProtobufAny {
411
+ '@type'?: string;
412
+ [key: string]: unknown;
413
+ }
414
+ interface Group {
415
+ id?: string;
416
+ name?: string;
417
+ status?: string;
418
+ organizationId?: string;
419
+ customWebViews?: CustomWebView[];
420
+ createdAt?: string;
421
+ updatedAt?: string;
422
+ createdById?: string;
423
+ updatedById?: string;
424
+ isMember?: boolean;
425
+ }
426
+ interface HideSpaceResponse {
427
+ success?: boolean;
428
+ }
429
+ interface Invite {
430
+ id?: string;
431
+ email?: string;
432
+ status?: string;
433
+ }
434
+ interface InviteToRoomByEmailsContent {
435
+ invite?: RoomInvite;
436
+ }
437
+ interface InviteToRoomByEmailsResponse {
438
+ invites?: Invite[];
439
+ }
440
+ interface InviteToSpaceByEmailsContent {
441
+ invites: SpaceInvite[];
442
+ }
443
+ interface InviteToSpaceByEmailsResponse {
444
+ invites?: Invite[];
445
+ addedUsersIds?: string[];
446
+ }
447
+ interface Label {
448
+ id?: string;
449
+ organizationId?: string;
450
+ name?: string;
451
+ color?: string;
452
+ createdAt?: string;
453
+ updatedAt?: string;
454
+ createdById?: string;
455
+ updatedById?: string;
456
+ }
457
+ interface LastSeenInfo {
458
+ userId?: string;
459
+ lastSeenAt?: string;
460
+ }
461
+ interface MemberInfo {
462
+ userId: string;
463
+ roleIds?: string[];
464
+ title?: string;
465
+ }
466
+ interface MemberPresenceInfo {
467
+ presenceId?: string;
468
+ userId?: string;
469
+ name?: string;
470
+ state?: 'MEMBER_PRESENCE_STATE_UNSPECIFIED' | 'MEMBER_PRESENCE_STATE_JOINED' | 'MEMBER_PRESENCE_STATE_DISCONNECTED' | 'MEMBER_PRESENCE_STATE_JOINING' | 'MEMBER_PRESENCE_STATE_ACTIVE';
471
+ joinedAt?: string;
472
+ }
473
+ interface MemberView {
474
+ userId?: string;
475
+ initials?: string;
476
+ profilePictureUrl?: string;
477
+ isIntegrationUser?: boolean;
478
+ }
479
+ interface Message {
480
+ id?: string;
481
+ roomId?: string;
482
+ userId?: string;
483
+ threadParentMessageId?: string;
484
+ inlineReplyMessageId?: string;
485
+ parentRecordingId?: string;
486
+ recordingPositionTimestamp?: number;
487
+ hasAttachedBlocks?: boolean;
488
+ richContent?: RichContent;
489
+ status?: 'MESSAGE_STATUS_UNSPECIFIED' | 'MESSAGE_STATUS_DRAFT' | 'MESSAGE_STATUS_DELETED' | 'MESSAGE_STATUS_SENT';
490
+ reactions?: Reaction[];
491
+ receipts?: Receipt[];
492
+ attachments?: Attachment[];
493
+ sentAt?: string;
494
+ scheduledSendAt?: string;
495
+ deletedAt?: string;
496
+ createdAt?: string;
497
+ updatedAt?: string;
498
+ threadRepliesCount?: number;
499
+ threadUsersIds?: string[];
500
+ lastThreadReplyAt?: string;
501
+ type?: 'MESSAGE_TYPE_UNSPECIFIED' | 'MESSAGE_TYPE_VIDEO_CALL' | 'MESSAGE_TYPE_AUDIO_CALL';
502
+ callEndedAt?: string;
503
+ callParticipantUserIds?: string[];
504
+ }
505
+ interface PersistedBreakoutData {
506
+ isBreakoutGroupsRunning?: boolean;
507
+ breakoutRoomIds?: string[];
508
+ }
509
+ interface Reaction {
510
+ userId?: string;
511
+ emojis?: ReactionEmoji;
512
+ updatedAt?: string;
513
+ }
514
+ interface ReactionEmoji {
515
+ emojiIds?: string[];
516
+ }
517
+ interface Receipt {
518
+ userId?: string;
519
+ readAt?: string;
520
+ }
521
+ interface RemoveLabelFromSpaceResponse {
522
+ space?: Space;
523
+ }
524
+ interface RevokeInviteByIdResponse {
525
+ success?: boolean;
526
+ revokedInvite?: Invite;
527
+ }
528
+ interface RevokeRoomInviteResponse {
529
+ success?: boolean;
530
+ revokedInvite?: Invite;
531
+ }
532
+ interface RevokeSpaceInviteResponse {
533
+ success?: boolean;
534
+ revokedInvite?: Invite;
535
+ }
536
+ interface RichContent {
537
+ children?: RichContentParagraph[];
538
+ direction?: string;
539
+ format?: string;
540
+ indent?: number;
541
+ type?: string;
542
+ version?: number;
543
+ }
544
+ interface RichContentParagraph {
545
+ children?: RichContentSegment[];
546
+ direction?: string;
547
+ format?: string;
548
+ indent?: number;
549
+ type?: string;
550
+ textFormat?: number;
551
+ textStyle?: string;
552
+ version?: number;
553
+ tag?: string;
554
+ start?: number;
555
+ listType?: string;
556
+ language?: string;
557
+ }
558
+ interface RichContentSegment {
559
+ children?: RichContentSubSegment[];
560
+ detail?: number;
561
+ format?: number;
562
+ mode?: string;
563
+ style?: string;
564
+ text?: string;
565
+ type?: string;
566
+ mentionName?: string;
567
+ isUnlinked?: boolean;
568
+ rel?: string;
569
+ target?: string;
570
+ title?: string;
571
+ url?: string;
572
+ direction?: string;
573
+ indent?: number;
574
+ version?: number;
575
+ checked?: boolean;
576
+ value?: number;
577
+ language?: string;
578
+ listType?: string;
579
+ textFormat?: number;
580
+ textStyle?: string;
581
+ mentionUserId?: string;
582
+ }
583
+ interface RichContentSubSegment {
584
+ children?: RichContentSegment[];
585
+ detail?: number;
586
+ format?: number;
587
+ mode?: string;
588
+ style?: string;
589
+ text?: string;
590
+ type?: string;
591
+ mentionName?: string;
592
+ version?: number;
593
+ direction?: string;
594
+ indent?: number;
595
+ rel?: string;
596
+ target?: string;
597
+ title?: string;
598
+ url?: string;
599
+ listType?: string;
600
+ start?: number;
601
+ tag?: string;
602
+ language?: string;
603
+ isUnlinked?: boolean;
604
+ checked?: boolean;
605
+ mentionUserId?: string;
606
+ }
607
+ interface Room {
608
+ id?: string;
609
+ name?: string;
610
+ topic?: string;
611
+ type?: 'ROOM_TYPE_UNSPECIFIED' | 'ROOM_TYPE_DIRECT' | 'ROOM_TYPE_CHAT' | 'ROOM_TYPE_POST' | 'ROOM_TYPE_AUDIO' | 'ROOM_TYPE_VIDEO' | 'ROOM_TYPE_STREAMING';
612
+ status?: 'ROOM_STATUS_UNSPECIFIED' | 'ROOM_STATUS_ACTIVE' | 'ROOM_STATUS_ARCHIVED' | 'ROOM_STATUS_DELETED';
613
+ correspondingRoomBlockId?: string;
614
+ allowJoinSecretLink?: boolean;
615
+ linkSecret?: string;
616
+ upcomingScheduledTime?: string;
617
+ createdAt?: string;
618
+ updatedAt?: string;
619
+ archivedAt?: string;
620
+ deletedAt?: string;
621
+ presenceInfo?: MemberPresenceInfo[];
622
+ createdById?: string;
623
+ updatedById?: string;
624
+ callType?: 'CALL_TYPE_UNSPECIFIED' | 'CALL_TYPE_AUDIO' | 'CALL_TYPE_VIDEO';
625
+ recordAutomatically?: boolean;
626
+ hideRecordingsByDefault?: boolean;
627
+ unreadCount?: string;
628
+ hideRecordingTranscript?: boolean;
629
+ allowRecordingDownload?: boolean;
630
+ openInvites?: RoomInvitation[];
631
+ persistedBreakoutData?: PersistedBreakoutData;
632
+ }
633
+ interface RoomInfo {
634
+ blockId?: string;
635
+ roomId?: string;
636
+ roomName?: string;
637
+ roomType?: string;
638
+ }
639
+ interface RoomInvitation {
640
+ roomId?: string;
641
+ roomRole?: string;
642
+ email?: string;
643
+ roomInviteCreatedById?: string;
644
+ roomInviteUpdatedById?: string;
645
+ roomInviteCreatedAt?: string;
646
+ roomInviteUpdatedAt?: string;
647
+ }
648
+ interface RoomInvite {
649
+ emails: string[];
650
+ role: 'ROOM_ROLE_UNSPECIFIED' | 'ROOM_ROLE_HOST' | 'ROOM_ROLE_PARTICIPANT';
651
+ }
652
+ interface RoomMember {
653
+ id?: string;
654
+ roomId?: string;
655
+ userId?: string;
656
+ status?: 'ROOM_MEMBER_STATUS_UNSPECIFIED' | 'ROOM_MEMBER_STATUS_ACTIVE' | 'ROOM_MEMBER_STATUS_REMOVED' | 'ROOM_MEMBER_STATUS_LEFT';
657
+ role?: 'ROOM_MEMBER_ROLE_UNSPECIFIED' | 'ROOM_MEMBER_ROLE_HOST' | 'ROOM_MEMBER_ROLE_PARTICIPANT' | 'ROOM_MEMBER_ROLE_VIEWER' | 'ROOM_MEMBER_ROLE_COMMENTER';
658
+ createdAt?: string;
659
+ updatedAt?: string;
660
+ createdById?: string;
661
+ updatedById?: string;
662
+ }
663
+ interface RoomMemberStats {
664
+ userId?: string;
665
+ countNonThreadMessages?: number;
666
+ countThreadReplyMessages?: number;
667
+ }
668
+ interface RoomRecording {
669
+ id?: string;
670
+ roomId?: string;
671
+ recordingUrl?: string;
672
+ title?: string;
673
+ recordingType?: 'ROOM_RECORDING_TYPE_UNSPECIFIED' | 'ROOM_RECORDING_TYPE_ORIGINAL' | 'ROOM_RECORDING_TYPE_CLIP';
674
+ viewCount?: string;
675
+ thumbnailUrl?: string;
676
+ captionsUrl?: string;
677
+ duration?: string;
678
+ directDownloadUrl?: string;
679
+ assets?: Asset[];
680
+ status?: 'RECORDING_STATUS_UNSPECIFIED' | 'RECORDING_STATUS_ACTIVE' | 'RECORDING_STATUS_HIDDEN' | 'RECORDING_STATUS_DELETED';
681
+ createdAt?: string;
682
+ updatedAt?: string;
683
+ }
684
+ interface SendResponseForBlockResponse {
685
+ response?: BlockResponse;
686
+ }
687
+ interface Sentence {
688
+ confidence?: number;
689
+ start?: number;
690
+ end?: number;
691
+ text?: string;
692
+ }
693
+ interface Space {
694
+ id?: string;
695
+ organizationId?: string;
696
+ name?: string;
697
+ type?: 'SPACE_TYPE_UNSPECIFIED' | 'SPACE_TYPE_PERSONAL' | 'SPACE_TYPE_COMMUNITY' | 'SPACE_TYPE_COURSE' | 'SPACE_TYPE_PROJECT' | 'SPACE_TYPE_TEAM' | 'SPACE_TYPE_KNOWLEDGE' | 'SPACE_TYPE_OTHER';
698
+ personalSpaceUserId?: string;
699
+ otherTypeName?: string;
700
+ organizationSharing?: 'SPACE_SHARING_LEVEL_UNSPECIFIED' | 'SPACE_SHARING_LEVEL_DISABLED' | 'SPACE_SHARING_LEVEL_JOIN' | 'SPACE_SHARING_LEVEL_REQUEST';
701
+ linkSharing?: 'SPACE_SHARING_LEVEL_UNSPECIFIED' | 'SPACE_SHARING_LEVEL_DISABLED' | 'SPACE_SHARING_LEVEL_JOIN' | 'SPACE_SHARING_LEVEL_REQUEST';
702
+ publicSharing?: 'SPACE_SHARING_LEVEL_UNSPECIFIED' | 'SPACE_SHARING_LEVEL_DISABLED' | 'SPACE_SHARING_LEVEL_JOIN' | 'SPACE_SHARING_LEVEL_REQUEST';
703
+ linkSharingSecret?: string;
704
+ tags?: string[];
705
+ status?: 'SPACE_STATUS_UNSPECIFIED' | 'SPACE_STATUS_ACTIVE' | 'SPACE_STATUS_ARCHIVED' | 'SPACE_STATUS_DELETED' | 'SPACE_STATUS_HIDDEN';
706
+ templateType?: 'SPACE_TEMPLATE_TYPE_UNSPECIFIED' | 'SPACE_TEMPLATE_TYPE_NOT_TEMPLATE' | 'SPACE_TEMPLATE_TYPE_ORGANIZATION' | 'SPACE_TEMPLATE_TYPE_GLOBAL';
707
+ coverPhotoFileId?: string;
708
+ coverPhotoXOffset?: number;
709
+ coverPhotoYOffset?: number;
710
+ iconName?: string;
711
+ defaultSpaceRoleId?: string;
712
+ descriptionBlockId?: string;
713
+ enableProgressTracking?: boolean;
714
+ onlyAllowExistingOrganizationMembers?: boolean;
715
+ allowBlockSharingOrganizationMembers?: boolean;
716
+ allowBlockSharingPublic?: boolean;
717
+ allowBlockSharingUsers?: boolean;
718
+ coverPhotoFileUrl?: string;
719
+ roles?: SpaceRole[];
720
+ memberCount?: number;
721
+ membersView?: MemberView[];
722
+ startDate?: string;
723
+ endDate?: string;
724
+ createdAt?: string;
725
+ updatedAt?: string;
726
+ deletedAt?: string;
727
+ lastActivityAt?: string;
728
+ createdById?: string;
729
+ pilotToken?: string;
730
+ labels?: Label[];
731
+ }
732
+ interface SpaceInvite {
733
+ email: string;
734
+ roleIds?: string[];
735
+ title?: string;
736
+ groupIds?: string[];
737
+ }
738
+ interface SpaceMember {
739
+ id?: string;
740
+ userId?: string;
741
+ spaceId?: string;
742
+ title?: string;
743
+ roleIds?: string[];
744
+ spaceOrgId?: string;
745
+ status?: 'SPACE_MEMBER_STATUS_UNSPECIFIED' | 'SPACE_MEMBER_STATUS_PROCESSING' | 'SPACE_MEMBER_STATUS_REQUESTED' | 'SPACE_MEMBER_STATUS_ACTIVE' | 'SPACE_MEMBER_STATUS_REMOVED' | 'SPACE_MEMBER_STATUS_LEFT' | 'SPACE_MEMBER_STATUS_DENIED' | 'SPACE_MEMBER_STATUS_DELETED';
746
+ spaceMembershipTierId?: string;
747
+ wallstreetSubscriptionId?: string;
748
+ createdAt?: string;
749
+ updatedAt?: string;
750
+ lastSeenHereAt?: string;
751
+ createdById?: string;
752
+ isIntegrationUser?: boolean;
753
+ sponsoringGroupIds?: string[];
754
+ hasBeenIndividuallyCustomized?: boolean;
755
+ }
756
+ interface SpaceRole {
757
+ id?: string;
758
+ spaceId?: string;
759
+ name?: string;
760
+ type?: 'SPACE_ROLE_TYPE_UNSPECIFIED' | 'SPACE_ROLE_TYPE_FULL' | 'SPACE_ROLE_TYPE_GUEST';
761
+ classification?: string;
762
+ permissions?: 'SPACE_ROLE_PERMISSIONS_UNSPECIFIED' | 'SPACE_ROLE_PERMISSIONS_VIEW_SPACE_SETTINGS' | 'SPACE_ROLE_PERMISSIONS_EDIT_SETTINGS' | 'SPACE_ROLE_PERMISSIONS_VIEW_SPACE_ANALYTICS' | 'SPACE_ROLE_PERMISSIONS_VIEW_SPACE_MEMBERS' | 'SPACE_ROLE_PERMISSIONS_CHANGE_SPACE_MEMBERS' | 'SPACE_ROLE_PERMISSIONS_VIEW_ALL_BLOCKS' | 'SPACE_ROLE_PERMISSIONS_EDIT_ALL_BLOCKS_FULL_CONTROL' | 'SPACE_ROLE_PERMISSIONS_EDIT_SPACE_HOME_BLOCKS' | 'SPACE_ROLE_PERMISSIONS_ACCESS_HIDDEN_BLOCKS' | 'SPACE_ROLE_PERMISSIONS_SEND_MESSAGES_AND_COMMENT' | 'SPACE_ROLE_PERMISSIONS_EDUCATOR_ACCESS'[];
763
+ createdAt?: string;
764
+ updatedAt?: string;
765
+ }
766
+ interface Status {
767
+ code?: number;
768
+ message?: string;
769
+ details?: GoogleProtobufAny[];
770
+ }
771
+ interface Transcript {
772
+ text?: string;
773
+ completedAt?: string;
774
+ duration?: number;
775
+ confidence?: number;
776
+ sentences?: Sentence[];
777
+ chapters?: Chapter[];
778
+ }
779
+ interface UpdateLabelContent {
780
+ name?: string;
781
+ color?: string;
782
+ }
783
+ interface UpdateLabelResponse {
784
+ label?: Label;
785
+ }
786
+ interface UpdateResponseForBlockContent {
787
+ richContent: RichContent;
788
+ }
789
+ interface UpdateResponseForBlockResponse {
790
+ response?: BlockResponse;
791
+ }
792
+ interface UpdateSpaceContent {
793
+ name?: string;
794
+ organizationSharing?: 'SPACE_SHARING_LEVEL_UNSPECIFIED' | 'SPACE_SHARING_LEVEL_DISABLED' | 'SPACE_SHARING_LEVEL_JOIN' | 'SPACE_SHARING_LEVEL_REQUEST';
795
+ linkSharing?: 'SPACE_SHARING_LEVEL_UNSPECIFIED' | 'SPACE_SHARING_LEVEL_DISABLED' | 'SPACE_SHARING_LEVEL_JOIN' | 'SPACE_SHARING_LEVEL_REQUEST';
796
+ publicSharing?: 'SPACE_SHARING_LEVEL_UNSPECIFIED' | 'SPACE_SHARING_LEVEL_DISABLED' | 'SPACE_SHARING_LEVEL_JOIN' | 'SPACE_SHARING_LEVEL_REQUEST';
797
+ type?: 'SPACE_TYPE_UNSPECIFIED' | 'SPACE_TYPE_PERSONAL' | 'SPACE_TYPE_COMMUNITY' | 'SPACE_TYPE_COURSE' | 'SPACE_TYPE_PROJECT' | 'SPACE_TYPE_TEAM' | 'SPACE_TYPE_KNOWLEDGE' | 'SPACE_TYPE_OTHER';
798
+ otherTypeName?: string;
799
+ tags?: string[];
800
+ templateType?: string;
801
+ iconName?: string;
802
+ enableProgressTracking?: boolean;
803
+ onlyAllowExistingOrganizationMembers?: boolean;
804
+ allowBlockSharingOrganizationMembers?: boolean;
805
+ allowBlockSharingPublic?: boolean;
806
+ allowBlockSharingUsers?: boolean;
807
+ coverPhotoXOffset?: number;
808
+ coverPhotoYOffset?: number;
809
+ defaultSpaceRoleId?: string;
810
+ }
811
+ interface UpdateSpaceLabelsContent {
812
+ labelIds: string[];
813
+ }
814
+ interface UpdateSpaceLabelsResponse {
815
+ space?: Space;
816
+ }
817
+ interface UpdateSpaceMemberContent {
818
+ roleIds?: string[];
819
+ title?: string;
820
+ status?: 'SPACE_MEMBER_STATUS_UNSPECIFIED' | 'SPACE_MEMBER_STATUS_PROCESSING' | 'SPACE_MEMBER_STATUS_REQUESTED' | 'SPACE_MEMBER_STATUS_ACTIVE' | 'SPACE_MEMBER_STATUS_REMOVED' | 'SPACE_MEMBER_STATUS_LEFT' | 'SPACE_MEMBER_STATUS_DENIED' | 'SPACE_MEMBER_STATUS_DELETED';
821
+ }
822
+ interface UpdateSpaceMemberResponse {
823
+ member?: SpaceMember;
824
+ }
825
+ interface UpdateSpaceResponse {
826
+ space?: Space;
827
+ }
828
+ interface UpdateWebhookContent {
829
+ name?: string;
830
+ description?: string;
831
+ endpointUrl?: string;
832
+ /** If provided, replaces all subscriptions. At least one subscription is required. */
833
+ subscriptions?: WebhookSubscriptionInput[];
834
+ status?: 'WEBHOOK_STATUS_UNSPECIFIED' | 'WEBHOOK_STATUS_ACTIVE' | 'WEBHOOK_STATUS_INACTIVE' | 'WEBHOOK_STATUS_PAUSED';
835
+ }
836
+ interface UpdateWebhookResponse {
837
+ /** Response message for updating a webhook */
838
+ webhook?: Webhook;
839
+ }
840
+ interface User {
841
+ id?: string;
842
+ firstName?: string;
843
+ lastName?: string;
844
+ primaryEmail?: string;
845
+ emails?: UserEmail[];
846
+ username?: string;
847
+ status?: 'USER_STATUS_UNSPECIFIED' | 'USER_STATUS_ACTIVE' | 'USER_STATUS_BANNED' | 'USER_STATUS_DELETED';
848
+ profilePhotoFileId?: string;
849
+ profilePhotoUrl?: string;
850
+ profilePronouns?: string;
851
+ profileLocation?: string;
852
+ profileAbout?: string;
853
+ timezone?: string;
854
+ integrationId?: string;
855
+ createdAt?: string;
856
+ updatedAt?: string;
857
+ bannedAt?: string;
858
+ deletedAt?: string;
859
+ presenceToken?: string;
860
+ }
861
+ interface UserEmail {
862
+ email?: string;
863
+ isPrimary?: boolean;
864
+ createdAt?: string;
865
+ updatedAt?: string;
866
+ verifiedAt?: string;
867
+ }
868
+ interface Webhook {
869
+ id?: string;
870
+ organizationId?: string;
871
+ name?: string;
872
+ description?: string;
873
+ endpointUrl?: string;
874
+ status?: 'WEBHOOK_STATUS_UNSPECIFIED' | 'WEBHOOK_STATUS_ACTIVE' | 'WEBHOOK_STATUS_INACTIVE' | 'WEBHOOK_STATUS_PAUSED';
875
+ createdById?: string;
876
+ updatedById?: string;
877
+ createdAt?: string;
878
+ updatedAt?: string;
879
+ subscriptions?: WebhookSubscription[];
880
+ }
881
+ interface WebhookFilter {
882
+ /** WebhookFilter defines filter criteria for webhook subscriptions */
883
+ /** Filter by room types (e.g., ["chat", "post", "video"])
884
+ If any room type in the array matches the event's room type, the webhook triggers.
885
+ If empty or not provided, matches all room types. */
886
+ roomTypes?: string[];
887
+ }
888
+ interface WebhookLog {
889
+ orgId?: string;
890
+ webhookId?: string;
891
+ timestamp?: string;
892
+ eventType?: string;
893
+ subject?: string;
894
+ requestPayload?: string;
895
+ responseStatus?: number;
896
+ responseBody?: string;
897
+ success?: boolean;
898
+ errorMessage?: string;
899
+ retryCount?: number;
900
+ }
901
+ interface WebhookSubscription {
902
+ /** WebhookSubscription represents a subscription for a webhook */
903
+ subjectType?: 'WEBHOOK_SUBJECT_TYPE_UNSPECIFIED' | 'WEBHOOK_SUBJECT_TYPE_ROOM' | 'WEBHOOK_SUBJECT_TYPE_SPACE';
904
+ subjectId?: string;
905
+ subscriptionType?: 'WEBHOOK_SUBSCRIPTION_TYPE_UNSPECIFIED' | 'WEBHOOK_SUBSCRIPTION_TYPE_MESSAGE_SENT' | 'WEBHOOK_SUBSCRIPTION_TYPE_ROOM_RECORDING_TRANSCRIPT_PUBLISHED' | 'WEBHOOK_SUBSCRIPTION_TYPE_MESSAGE_DELETED' | 'WEBHOOK_SUBSCRIPTION_TYPE_MESSAGE_EDITED';
906
+ filter?: WebhookFilter;
907
+ }
908
+ interface WebhookSubscriptionInput {
909
+ subjectType: 'WEBHOOK_SUBJECT_TYPE_UNSPECIFIED' | 'WEBHOOK_SUBJECT_TYPE_ROOM' | 'WEBHOOK_SUBJECT_TYPE_SPACE';
910
+ subjectId: string;
911
+ subscriptionType: 'WEBHOOK_SUBSCRIPTION_TYPE_UNSPECIFIED' | 'WEBHOOK_SUBSCRIPTION_TYPE_MESSAGE_SENT' | 'WEBHOOK_SUBSCRIPTION_TYPE_ROOM_RECORDING_TRANSCRIPT_PUBLISHED' | 'WEBHOOK_SUBSCRIPTION_TYPE_MESSAGE_DELETED' | 'WEBHOOK_SUBSCRIPTION_TYPE_MESSAGE_EDITED';
912
+ /** Optional filter criteria */
913
+ filter?: unknown;
914
+ }
915
+
916
+ declare class BlocksResource {
917
+ private client;
918
+ constructor(client: PivotClientCore);
919
+ /**
920
+ * Delete a block response attachment
921
+ *
922
+ * Deletes a file attached to a block response.
923
+ */
924
+ deleteBlockResponseAttachment(attachmentId: string): Promise<DeleteBlockResponseAttachmentResponse>;
925
+ /**
926
+ * Delete a block response
927
+ *
928
+ * Deletes a response from a block.
929
+ */
930
+ deleteResponseForBlock(responseId: string): Promise<DeleteResponseForBlockResponse>;
931
+ /**
932
+ * Update block response
933
+ *
934
+ * Updates an existing block response.
935
+ */
936
+ updateResponseForBlock(responseId: string, body: UpdateResponseForBlockContent): Promise<UpdateResponseForBlockResponse>;
937
+ /**
938
+ * Create an attachment for a block response
939
+ *
940
+ * Adds a file to a block response.
941
+ */
942
+ createBlockResponseAttachment(responseId: string, body: CreateBlockResponseAttachmentContent): Promise<CreateBlockResponseAttachmentResponse>;
943
+ /**
944
+ * Send block response
945
+ *
946
+ * Sends or marks the response as submitted.
947
+ */
948
+ sendResponseForBlock(responseId: string): Promise<SendResponseForBlockResponse>;
949
+ /**
950
+ * Get block
951
+ *
952
+ * Returns a block by ID.
953
+ */
954
+ getBlockById(blockId: string): Promise<GetBlockByIdResponse>;
955
+ /**
956
+ * List block responses
957
+ *
958
+ * Returns responses for a block.
959
+ */
960
+ getBlockResponsesByBlockId(blockId: string): Promise<GetBlockResponsesByBlockIdResponse>;
961
+ /**
962
+ * Create block response
963
+ *
964
+ * Creates a new response for a block.
965
+ */
966
+ createResponseForBlock(blockId: string, body: CreateResponseForBlockContent): Promise<CreateResponseForBlockResponse>;
967
+ }
968
+ declare class GroupsResource {
969
+ private client;
970
+ constructor(client: PivotClientCore);
971
+ /**
972
+ * List groups
973
+ *
974
+ * Returns groups in the organization.
975
+ */
976
+ getGroupsByOrganizationId(organizationId: string, offset: number): Promise<GetGroupsByOrganizationIdResponse>;
977
+ /**
978
+ * List group members
979
+ *
980
+ * Returns users in the specified group.
981
+ */
982
+ getGroupMembersByGroupId(organizationId: string, groupId: string): Promise<GetGroupMembersByGroupIdResponse>;
983
+ /**
984
+ * Add group members
985
+ *
986
+ * Adds users to the specified group.
987
+ */
988
+ createGroupMembersByGroupId(organizationId: string, groupId: string, body: CreateGroupMembersByGroupIdContent): Promise<CreateGroupMembersByGroupIdResponse>;
989
+ /**
990
+ * Remove group members
991
+ *
992
+ * Removes users from a group.
993
+ */
994
+ deleteGroupMembersByGroupId(organizationId: string, groupId: string, query?: {
995
+ userIds?: string[];
996
+ }): Promise<DeleteGroupMembersByGroupIdResponse>;
997
+ }
998
+ declare class InvitesResource {
999
+ private client;
1000
+ constructor(client: PivotClientCore);
1001
+ /**
1002
+ * Revoke invite by ID
1003
+ *
1004
+ * Revokes an invitation by its unique ID and email address.
1005
+ */
1006
+ revokeInviteById(organizationId: string, inviteId: string, email: string): Promise<RevokeInviteByIdResponse>;
1007
+ }
1008
+ declare class LabelsResource {
1009
+ private client;
1010
+ constructor(client: PivotClientCore);
1011
+ /**
1012
+ * Delete label
1013
+ *
1014
+ * Deletes a label.
1015
+ */
1016
+ deleteLabel(labelId: string): Promise<DeleteLabelResponse>;
1017
+ /**
1018
+ * Update label
1019
+ *
1020
+ * Updates an existing label.
1021
+ */
1022
+ updateLabel(labelId: string, body: UpdateLabelContent): Promise<UpdateLabelResponse>;
1023
+ /**
1024
+ * List organization labels
1025
+ *
1026
+ * Returns labels in the organization.
1027
+ */
1028
+ getLabelsByOrganizationId(organizationId: string): Promise<GetLabelsByOrganizationIdResponse>;
1029
+ /**
1030
+ * Create label
1031
+ *
1032
+ * Creates a new label in the organization.
1033
+ */
1034
+ createLabel(organizationId: string, body: CreateLabelContent): Promise<CreateLabelResponse>;
1035
+ /**
1036
+ * Update space labels
1037
+ *
1038
+ * Adds labels to a space without removing existing labels. To remove labels, use the DELETE endpoint.
1039
+ */
1040
+ updateSpaceLabels(spaceId: string, body: UpdateSpaceLabelsContent): Promise<UpdateSpaceLabelsResponse>;
1041
+ /**
1042
+ * Remove label from space
1043
+ *
1044
+ * Removes a single label from a space.
1045
+ */
1046
+ removeLabelFromSpace(spaceId: string, labelId: string): Promise<RemoveLabelFromSpaceResponse>;
1047
+ }
1048
+ declare class RoomsResource {
1049
+ private client;
1050
+ constructor(client: PivotClientCore);
1051
+ /**
1052
+ * Get room
1053
+ *
1054
+ * Returns a room by ID.
1055
+ */
1056
+ getRoomById(roomId: string): Promise<GetRoomByIdResponse>;
1057
+ /**
1058
+ * Invite to room
1059
+ *
1060
+ * Invites users to a room by email.
1061
+ */
1062
+ inviteToRoomByEmails(roomId: string, body: InviteToRoomByEmailsContent): Promise<InviteToRoomByEmailsResponse>;
1063
+ /**
1064
+ * Revoke room invite
1065
+ *
1066
+ * Revokes an invitation to a room by email address.
1067
+ */
1068
+ revokeRoomInvite(roomId: string, email: string): Promise<RevokeRoomInviteResponse>;
1069
+ /**
1070
+ * Add room members
1071
+ *
1072
+ * Adds users to a room with a role.
1073
+ */
1074
+ createRoomMembersByRoomId(roomId: string, body: CreateRoomMembersByRoomIdContent): Promise<CreateRoomMembersByRoomIdResponse>;
1075
+ /**
1076
+ * List room messages (Deprecated)
1077
+ *
1078
+ * Deprecated: Use GET /v2/rooms/{room_id}/messages instead. Returns messages in a room by offset.
1079
+ * @deprecated
1080
+ */
1081
+ getMessagesByRoomId(roomId: string, offset: number): Promise<GetMessagesByRoomIdResponse>;
1082
+ /**
1083
+ * List message replies (Deprecated)
1084
+ *
1085
+ * Deprecated: Use GET /v2/rooms/{room_id}/threads/{parent_id}/messages instead. Returns replies under a parent message.
1086
+ * @deprecated
1087
+ */
1088
+ getMessagesByParentId(roomId: string, parentId: string, query?: {
1089
+ offset?: number;
1090
+ fullTree?: boolean;
1091
+ }): Promise<GetMessagesByParentIdResponse>;
1092
+ /**
1093
+ * List room recordings
1094
+ *
1095
+ * Returns recordings for a room, including transcripts and other assets.
1096
+ */
1097
+ getRoomRecordingsByRoomId(roomId: string, query?: {
1098
+ cursorCreatedAt?: string;
1099
+ cursorId?: string;
1100
+ limit?: number;
1101
+ }): Promise<GetRoomRecordingsByRoomIdResponse>;
1102
+ /**
1103
+ * Get room recording
1104
+ *
1105
+ * Returns a specific room recording by ID, including transcripts and other assets.
1106
+ */
1107
+ getRoomRecordingById(roomId: string, recordingId: string, query: {
1108
+ createdAt: string;
1109
+ }): Promise<GetRoomRecordingByIdResponse>;
1110
+ /**
1111
+ * Get active participants in a room and their messages stats
1112
+ *
1113
+ * Returns active users in a room and their message stats.
1114
+ */
1115
+ getRoomActiveParticipants(roomId: string): Promise<GetRoomActiveParticipantsResponse>;
1116
+ /**
1117
+ * List room messages
1118
+ *
1119
+ * Returns messages in a room using cursor-based pagination (newest first). For partition navigation, backfill strategy, and examples, see https://pivot.app/docs/developers/rest-api/message-retrieval.
1120
+ */
1121
+ getRoomMessages(roomId: string, query?: {
1122
+ cursorSentAt?: string;
1123
+ cursorMessageId?: string;
1124
+ limit?: number;
1125
+ }): Promise<GetRoomMessagesResponse>;
1126
+ /**
1127
+ * Get message by ID
1128
+ *
1129
+ * Retrieves a single message by ID.
1130
+
1131
+ The `sent_at` parameter is currently optional but will become required in a future release. For thread messages, `thread_parent_message_id` will also become required. Clients should start passing these parameters now to ensure continued functionality after the migration.
1132
+ */
1133
+ getMessageById(roomId: string, messageId: string, query?: {
1134
+ sentAt?: string;
1135
+ threadParentMessageId?: string;
1136
+ }): Promise<GetMessageByIdResponse>;
1137
+ /**
1138
+ * List thread messages
1139
+ *
1140
+ * Returns messages in a thread using cursor-based pagination (oldest first). For guidance and examples, see https://pivot.app/docs/developers/rest-api/message-retrieval.
1141
+ */
1142
+ getThreadMessages(roomId: string, parentId: string, query?: {
1143
+ cursorSentAt?: string;
1144
+ cursorMessageId?: string;
1145
+ limit?: number;
1146
+ }): Promise<GetThreadMessagesResponse>;
1147
+ }
1148
+ declare class SpacesResource {
1149
+ private client;
1150
+ constructor(client: PivotClientCore);
1151
+ /**
1152
+ * Create space
1153
+ *
1154
+ * Creates a new space in the organization.
1155
+ */
1156
+ createSpace(organizationId: string, body: CreateSpaceContent): Promise<CreateSpaceResponse>;
1157
+ /**
1158
+ * List spaces
1159
+ *
1160
+ * Returns spaces in the organization. Filter by status using 'active', 'archived', 'hidden', or 'deleted'. If no status is provided, defaults to returning only active spaces. Sort results using sort_by: 'created_at_asc' (default), 'created_at_desc', 'last_activity_asc', or 'last_activity_desc'.
1161
+ */
1162
+ getSpacesByOrganizationId(organizationId: string, offset: number, query?: {
1163
+ status?: 'active' | 'archived' | 'hidden' | 'deleted';
1164
+ sortBy?: 'created_at_asc' | 'created_at_desc' | 'last_activity_asc' | 'last_activity_desc';
1165
+ }): Promise<GetSpacesByOrganizationIdResponse>;
1166
+ /**
1167
+ * Update space
1168
+ *
1169
+ * Updates space settings or metadata.
1170
+ */
1171
+ updateSpace(organizationId: string, spaceId: string, body: UpdateSpaceContent): Promise<UpdateSpaceResponse>;
1172
+ /**
1173
+ * List assignment blocks
1174
+ *
1175
+ * Returns all assignment blocks in the space.
1176
+ */
1177
+ getAssignmentBlocksBySpaceId(organizationId: string, spaceId: string): Promise<GetAssignmentBlocksBySpaceIdResponse>;
1178
+ /**
1179
+ * Copy space
1180
+ *
1181
+ * Creates a copy of an existing space with a new name.
1182
+ */
1183
+ copySpace(organizationId: string, spaceId: string, body: CopySpaceContent): Promise<CopySpaceResponse>;
1184
+ /**
1185
+ * Add group to space
1186
+ *
1187
+ * Grants a group access to a space.
1188
+ */
1189
+ addGroupToSpace(organizationId: string, spaceId: string, body: AddGroupToSpaceContent): Promise<AddGroupToSpaceResponse>;
1190
+ /**
1191
+ * Hide space
1192
+ *
1193
+ * Hides a space from view.
1194
+ */
1195
+ hideSpace(organizationId: string, spaceId: string): Promise<HideSpaceResponse>;
1196
+ /**
1197
+ * Invite to space
1198
+ *
1199
+ * Invite users by email. Existing users are added directly.
1200
+ */
1201
+ inviteToSpaceByEmails(organizationId: string, spaceId: string, body: InviteToSpaceByEmailsContent): Promise<InviteToSpaceByEmailsResponse>;
1202
+ /**
1203
+ * Revoke space invite
1204
+ *
1205
+ * Revokes an invitation to a space by email address.
1206
+ */
1207
+ revokeSpaceInvite(organizationId: string, spaceId: string, email: string): Promise<RevokeSpaceInviteResponse>;
1208
+ /**
1209
+ * Add space members
1210
+ *
1211
+ * Adds users to a space.
1212
+ */
1213
+ createSpaceMembersBySpaceId(organizationId: string, spaceId: string, body: CreateSpaceMembersBySpaceIdContent): Promise<CreateSpaceMembersBySpaceIdResponse>;
1214
+ /**
1215
+ * Remove space member
1216
+ *
1217
+ * Removes a user from a space.
1218
+ */
1219
+ deleteSpaceMember(organizationId: string, spaceId: string, memberId: string): Promise<DeleteSpaceMemberResponse>;
1220
+ /**
1221
+ * Update space member
1222
+ *
1223
+ * Updates a member’s role or title in a space.
1224
+ */
1225
+ updateSpaceMember(organizationId: string, spaceId: string, memberId: string, body: UpdateSpaceMemberContent): Promise<UpdateSpaceMemberResponse>;
1226
+ /**
1227
+ * List space members
1228
+ *
1229
+ * Returns members of a space.
1230
+ */
1231
+ getSpaceMembers(organizationId: string, spaceId: string, offset: number): Promise<GetSpaceMembersResponse>;
1232
+ /**
1233
+ * List space roles
1234
+ *
1235
+ * Returns roles available in a space.
1236
+ */
1237
+ getSpaceRoles(organizationId: string, spaceId: string): Promise<GetSpaceRolesResponse>;
1238
+ /**
1239
+ * Create space role
1240
+ *
1241
+ * Creates a custom role in a space.
1242
+ */
1243
+ createSpaceRole(organizationId: string, spaceId: string, body: CreateSpaceRoleContent): Promise<CreateSpaceRoleResponse>;
1244
+ /**
1245
+ * List room blocks
1246
+ *
1247
+ * Returns all room blocks in the space.
1248
+ */
1249
+ getRoomBlocksBySpaceId(organizationId: string, spaceId: string): Promise<GetRoomBlocksBySpaceIdResponse>;
1250
+ }
1251
+ declare class UsersResource {
1252
+ private client;
1253
+ constructor(client: PivotClientCore);
1254
+ /**
1255
+ * Get user context
1256
+ *
1257
+ * Returns user info, memberships, and groups.
1258
+ */
1259
+ getUserContextByOrganizationId(organizationId: string, identifier: string): Promise<GetUserContextByOrganizationIdResponse>;
1260
+ /**
1261
+ * Delete user
1262
+ *
1263
+ * Deletes a user if their email is verified by the org and not verified by any others. This is permanent and affects all orgs.
1264
+ */
1265
+ deleteUser(organizationId: string, identifier: string): Promise<DeleteUserResponse>;
1266
+ /**
1267
+ * Delete or remove user
1268
+ *
1269
+ * Deletes the user if verified by the org; otherwise removes org memberships.
1270
+ */
1271
+ deleteVerifiedUserOrRemoveFromOrg(organizationId: string, userId: string): Promise<DeleteVerifiedUserOrRemoveFromOrgResponse>;
1272
+ }
1273
+ declare class WebhooksResource {
1274
+ private client;
1275
+ constructor(client: PivotClientCore);
1276
+ /**
1277
+ * List webhooks
1278
+ *
1279
+ * Returns all webhooks for the organization.
1280
+ */
1281
+ getWebhooksByOrganizationId(organizationId: string): Promise<GetWebhooksByOrganizationIdResponse>;
1282
+ /**
1283
+ * Create webhook
1284
+ *
1285
+ * Creates a new webhook for the organization. Returns the webhook secret which must be stored securely.
1286
+ */
1287
+ createWebhook(organizationId: string, body: CreateWebhookContent): Promise<CreateWebhookResponse>;
1288
+ /**
1289
+ * Delete webhook
1290
+ *
1291
+ * Deletes a webhook.
1292
+ */
1293
+ deleteWebhook(organizationId: string, webhookId: string): Promise<DeleteWebhookResponse>;
1294
+ /**
1295
+ * Update webhook
1296
+ *
1297
+ * Updates an existing webhook. If subscriptions are provided, they replace all existing subscriptions.
1298
+ */
1299
+ updateWebhook(organizationId: string, webhookId: string, body: UpdateWebhookContent): Promise<UpdateWebhookResponse>;
1300
+ /**
1301
+ * Get webhook logs
1302
+ *
1303
+ * Returns delivery logs for a webhook. Logs are retained for 30 days.
1304
+ */
1305
+ getWebhookLogs(organizationId: string, webhookId: string, query?: {
1306
+ beforeTime?: string;
1307
+ limit?: number;
1308
+ }): Promise<GetWebhookLogsResponse>;
1309
+ }
1310
+
1311
+ /**
1312
+ * The official Pivot SDK client for JavaScript and TypeScript.
1313
+ *
1314
+ * @example
1315
+ * ```typescript
1316
+ * import Pivot from '@hellopivot/sdk';
1317
+ *
1318
+ * const pivot = new Pivot({ apiKey: 'your-api-key' });
1319
+ *
1320
+ * // List spaces
1321
+ * const spaces = await pivot.spaces.getSpacesByOrganizationId(orgId, 0);
1322
+ *
1323
+ * // Get a block
1324
+ * const block = await pivot.blocks.getBlockById(blockId);
1325
+ * ```
1326
+ */
1327
+ declare class Pivot {
1328
+ private readonly core;
1329
+ /** Block operations (pages, assignments, forms, etc.) */
1330
+ readonly blocks: BlocksResource;
1331
+ /** Group operations */
1332
+ readonly groups: GroupsResource;
1333
+ /** Invite operations */
1334
+ readonly invites: InvitesResource;
1335
+ /** Label operations */
1336
+ readonly labels: LabelsResource;
1337
+ /** Room operations (chat, messages, recordings) */
1338
+ readonly rooms: RoomsResource;
1339
+ /** Space operations */
1340
+ readonly spaces: SpacesResource;
1341
+ /** User operations */
1342
+ readonly users: UsersResource;
1343
+ /** Webhook operations */
1344
+ readonly webhooks: WebhooksResource;
1345
+ constructor(options?: PivotClientOptions);
1346
+ }
1347
+
1348
+ /**
1349
+ * Base error class for all Pivot SDK errors.
1350
+ */
1351
+ declare class PivotError extends Error {
1352
+ constructor(message: string);
1353
+ }
1354
+ /**
1355
+ * Error thrown when the API returns an error response.
1356
+ */
1357
+ declare class PivotAPIError extends PivotError {
1358
+ readonly status: number;
1359
+ readonly statusText: string;
1360
+ readonly body: unknown;
1361
+ readonly headers: Record<string, string>;
1362
+ constructor(status: number, statusText: string, body: unknown, headers: Record<string, string>);
1363
+ }
1364
+ /**
1365
+ * Error thrown when the request times out.
1366
+ */
1367
+ declare class PivotTimeoutError extends PivotError {
1368
+ constructor(timeoutMs: number);
1369
+ }
1370
+ /**
1371
+ * Error thrown when all retry attempts are exhausted.
1372
+ */
1373
+ declare class PivotRetryError extends PivotError {
1374
+ readonly lastError: Error;
1375
+ readonly attempts: number;
1376
+ constructor(lastError: Error, attempts: number);
1377
+ }
1378
+ /**
1379
+ * Error thrown when the API key is missing.
1380
+ */
1381
+ declare class PivotAuthenticationError extends PivotError {
1382
+ constructor();
1383
+ }
1384
+
1385
+ /**
1386
+ * Pagination utilities for the Pivot SDK.
1387
+ *
1388
+ * Supports both offset-based and cursor-based pagination patterns
1389
+ * used by the Pivot API.
1390
+ */
1391
+ /**
1392
+ * Options for auto-paginating through offset-based results.
1393
+ */
1394
+ interface OffsetPaginationOptions {
1395
+ /** Starting offset (default: 0) */
1396
+ startOffset?: number;
1397
+ /** Maximum total items to fetch (default: Infinity) */
1398
+ maxItems?: number;
1399
+ }
1400
+ /**
1401
+ * Options for auto-paginating through cursor-based results.
1402
+ */
1403
+ interface CursorPaginationOptions {
1404
+ /** Maximum total items to fetch (default: Infinity) */
1405
+ maxItems?: number;
1406
+ /** Maximum number of pages to fetch (default: Infinity) */
1407
+ maxPages?: number;
1408
+ }
1409
+ /**
1410
+ * Result from offset-based pagination containing the items and next offset.
1411
+ */
1412
+ interface OffsetPage<T> {
1413
+ items: T[];
1414
+ nextOffset?: number;
1415
+ }
1416
+ /**
1417
+ * Result from cursor-based pagination containing the items and next cursor.
1418
+ */
1419
+ interface CursorPage<T> {
1420
+ items: T[];
1421
+ hasMore: boolean;
1422
+ nextCursor?: Record<string, string | undefined>;
1423
+ }
1424
+ /**
1425
+ * Auto-paginate through all pages of an offset-based endpoint.
1426
+ *
1427
+ * @example
1428
+ * ```typescript
1429
+ * const allSpaces = await autoPageOffset(
1430
+ * (offset) => client.spaces.getSpacesByOrganizationId(orgId, offset),
1431
+ * (response) => ({
1432
+ * items: response.spaces ?? [],
1433
+ * nextOffset: response.nextOffset,
1434
+ * }),
1435
+ * );
1436
+ * ```
1437
+ */
1438
+ declare function autoPageOffset<TResponse, TItem>(fetchPage: (offset: number) => Promise<TResponse>, extractPage: (response: TResponse) => OffsetPage<TItem>, options?: OffsetPaginationOptions): Promise<TItem[]>;
1439
+ /**
1440
+ * Auto-paginate through all pages of a cursor-based endpoint.
1441
+ *
1442
+ * @example
1443
+ * ```typescript
1444
+ * const allMessages = await autoPageCursor(
1445
+ * (cursor) => client.rooms.getRoomMessages(roomId, cursor),
1446
+ * (response) => ({
1447
+ * items: response.messages ?? [],
1448
+ * hasMore: response.shardHasMore ?? false,
1449
+ * nextCursor: {
1450
+ * cursorSentAt: response.nextCursorSentAt,
1451
+ * cursorMessageId: response.nextCursorMessageId,
1452
+ * },
1453
+ * }),
1454
+ * );
1455
+ * ```
1456
+ */
1457
+ declare function autoPageCursor<TResponse, TItem>(fetchPage: (cursor?: Record<string, string | undefined>) => Promise<TResponse>, extractPage: (response: TResponse) => CursorPage<TItem>, options?: CursorPaginationOptions): Promise<TItem[]>;
1458
+
1459
+ /** Webhook Event Payloads These types define the JSON payloads delivered to webhook endpoints. They are the SINGLE SOURCE OF TRUTH for both: - Go serialization (via protojson in webhook_consumer.go) - TypeScript SDK type generation (via libs/pivot-sdk/scripts/codegen.ts) When adding a new webhook event type: 1. Add the data message and event message below 2. Run `npx buf generate` to regenerate Go types 3. Run `pnpm nx codegen pivot-sdk` to regenerate TypeScript types 4. Update the Go webhook consumer to use the new proto type WebhookEventSubject identifies the entity that triggered the event. */
1460
+ interface WebhookEventSubject {
1461
+ /** The subject type (e.g. "room"). */
1462
+ type: string;
1463
+ /** The unique identifier of the subject. */
1464
+ id: string;
1465
+ }
1466
+ /** --- Event data payloads (the "data" field in each event) --- MessageSentData is the data payload for message_sent events. */
1467
+ interface MessageSentData {
1468
+ /** The unique identifier of the message. */
1469
+ messageId: string;
1470
+ /** The room the message was sent in. */
1471
+ roomId: string;
1472
+ /** The user who sent the message. */
1473
+ userId: string;
1474
+ /** The message status (e.g. "SENT"). */
1475
+ status: string;
1476
+ /** When the message was created (ISO 8601). */
1477
+ createdAt: string;
1478
+ }
1479
+ /** MessageDeletedData is the data payload for message_deleted events. */
1480
+ interface MessageDeletedData {
1481
+ /** The unique identifier of the deleted message. */
1482
+ messageId: string;
1483
+ /** The room the message was in. */
1484
+ roomId: string;
1485
+ /** The user who deleted the message. */
1486
+ userId: string;
1487
+ /** The message status (e.g. "DELETED"). */
1488
+ status: string;
1489
+ /** When the message was deleted (ISO 8601). */
1490
+ deletedAt: string;
1491
+ }
1492
+ /** MessageEditedData is the data payload for message_edited events. */
1493
+ interface MessageEditedData {
1494
+ /** The unique identifier of the edited message. */
1495
+ messageId: string;
1496
+ /** The room the message is in. */
1497
+ roomId: string;
1498
+ /** The user who edited the message. */
1499
+ userId: string;
1500
+ /** The message status (e.g. "SENT"). */
1501
+ status: string;
1502
+ /** When the message was last updated (ISO 8601). */
1503
+ updatedAt: string;
1504
+ }
1505
+ /** RoomRecordingTranscriptPublishedData is the data payload for room_recording_transcript_published events. */
1506
+ interface RoomRecordingTranscriptPublishedData {
1507
+ /** The unique identifier of the recording. */
1508
+ recordingId: string;
1509
+ /** The room the recording belongs to. */
1510
+ roomId: string;
1511
+ /** When the recording was created (ISO 8601). */
1512
+ createdAt: string;
1513
+ }
1514
+ /** --- Full event envelopes (the complete JSON delivered to endpoints) --- MessageSentEvent is delivered when a message is sent in a subscribed room. */
1515
+ interface MessageSentEvent {
1516
+ eventType: 'message_sent';
1517
+ organizationId: string;
1518
+ spaceId: string;
1519
+ subject: WebhookEventSubject;
1520
+ timestamp: string;
1521
+ data: MessageSentData;
1522
+ }
1523
+ /** MessageDeletedEvent is delivered when a message is deleted in a subscribed room. */
1524
+ interface MessageDeletedEvent {
1525
+ eventType: 'message_deleted';
1526
+ organizationId: string;
1527
+ spaceId: string;
1528
+ subject: WebhookEventSubject;
1529
+ timestamp: string;
1530
+ data: MessageDeletedData;
1531
+ }
1532
+ /** MessageEditedEvent is delivered when a message is edited in a subscribed room. */
1533
+ interface MessageEditedEvent {
1534
+ eventType: 'message_edited';
1535
+ organizationId: string;
1536
+ spaceId: string;
1537
+ subject: WebhookEventSubject;
1538
+ timestamp: string;
1539
+ data: MessageEditedData;
1540
+ }
1541
+ /** RoomRecordingTranscriptPublishedEvent is delivered when a room recording transcript becomes available. */
1542
+ interface RoomRecordingTranscriptPublishedEvent {
1543
+ eventType: 'room_recording_transcript_published';
1544
+ organizationId: string;
1545
+ spaceId: string;
1546
+ subject: WebhookEventSubject;
1547
+ timestamp: string;
1548
+ data: RoomRecordingTranscriptPublishedData;
1549
+ }
1550
+ /** The event types that Pivot can deliver via webhooks. */
1551
+ type WebhookEventType = 'message_sent' | 'message_deleted' | 'message_edited' | 'room_recording_transcript_published';
1552
+ /**
1553
+ * A discriminated union of all Pivot webhook events.
1554
+ * Use `event.eventType` to narrow the type.
1555
+ */
1556
+ type WebhookEvent = MessageSentEvent | MessageDeletedEvent | MessageEditedEvent | RoomRecordingTranscriptPublishedEvent;
1557
+
1558
+ /**
1559
+ * Webhook utilities for the Pivot SDK.
1560
+ *
1561
+ * Provides signature verification and typed event parsing for
1562
+ * Pivot webhook deliveries.
1563
+ *
1564
+ * Types are generated from proto/rest/rest/common/v1/webhook_payloads.proto
1565
+ * — the single source of truth shared with the Go backend.
1566
+ */
1567
+
1568
+ /**
1569
+ * Security headers included with every Pivot webhook delivery.
1570
+ */
1571
+ interface WebhookHeaders {
1572
+ /** HMAC-SHA256 signature of the payload (`sha256=<hex>`). */
1573
+ 'x-pivot-signature': string;
1574
+ /** The event type (e.g. `message_sent`). */
1575
+ 'x-pivot-event': string;
1576
+ /** Unique delivery identifier (use for idempotency). */
1577
+ 'x-pivot-delivery': string;
1578
+ /** The ID of the webhook that triggered the delivery. */
1579
+ 'x-pivot-webhook-id': string;
1580
+ }
1581
+ /**
1582
+ * Verify the HMAC-SHA256 signature of a Pivot webhook payload.
1583
+ *
1584
+ * Uses constant-time comparison to prevent timing attacks.
1585
+ *
1586
+ * @param payload - The raw request body as a string.
1587
+ * @param signature - The value of the `X-Pivot-Signature` header.
1588
+ * @param secret - Your webhook secret (returned when you created the webhook).
1589
+ * @returns `true` if the signature is valid, `false` otherwise.
1590
+ *
1591
+ * @example
1592
+ * ```typescript
1593
+ * import { verifyWebhookSignature } from '@hellopivot/sdk';
1594
+ *
1595
+ * app.post('/webhook', (req, res) => {
1596
+ * const isValid = verifyWebhookSignature(
1597
+ * req.body, // raw body string
1598
+ * req.headers['x-pivot-signature'],
1599
+ * process.env.WEBHOOK_SECRET,
1600
+ * );
1601
+ *
1602
+ * if (!isValid) {
1603
+ * return res.status(401).send('Invalid signature');
1604
+ * }
1605
+ *
1606
+ * // Process the event...
1607
+ * res.status(200).send('OK');
1608
+ * });
1609
+ * ```
1610
+ */
1611
+ declare function verifyWebhookSignature(payload: string, signature: string, secret: string): boolean;
1612
+ /**
1613
+ * Construct the expected HMAC-SHA256 signature for a given payload and secret.
1614
+ *
1615
+ * Useful for testing or debugging webhook integrations.
1616
+ *
1617
+ * @param payload - The request body as a string.
1618
+ * @param secret - Your webhook secret.
1619
+ * @returns The signature string in the format `sha256=<hex>`.
1620
+ */
1621
+ declare function constructWebhookSignature(payload: string, secret: string): string;
1622
+ /**
1623
+ * Parse and verify a webhook event in one step.
1624
+ *
1625
+ * This is a convenience method that verifies the signature and then
1626
+ * parses the payload into a typed `WebhookEvent`.
1627
+ *
1628
+ * @param payload - The raw request body as a string.
1629
+ * @param signature - The value of the `X-Pivot-Signature` header.
1630
+ * @param secret - Your webhook secret.
1631
+ * @returns The parsed and typed webhook event.
1632
+ * @throws {Error} If the signature is invalid or the payload cannot be parsed.
1633
+ *
1634
+ * @example
1635
+ * ```typescript
1636
+ * import { parseWebhookEvent } from '@hellopivot/sdk';
1637
+ *
1638
+ * app.post('/webhook', (req, res) => {
1639
+ * try {
1640
+ * const event = parseWebhookEvent(
1641
+ * req.body,
1642
+ * req.headers['x-pivot-signature'],
1643
+ * process.env.WEBHOOK_SECRET,
1644
+ * );
1645
+ *
1646
+ * switch (event.eventType) {
1647
+ * case 'message_sent':
1648
+ * console.log('New message:', event.data.messageId);
1649
+ * break;
1650
+ * case 'message_deleted':
1651
+ * console.log('Deleted:', event.data.messageId);
1652
+ * break;
1653
+ * }
1654
+ *
1655
+ * res.status(200).send('OK');
1656
+ * } catch (err) {
1657
+ * res.status(401).send('Invalid webhook');
1658
+ * }
1659
+ * });
1660
+ * ```
1661
+ */
1662
+ declare function parseWebhookEvent(payload: string, signature: string, secret: string): WebhookEvent;
1663
+
1664
+ export { type AddGroupToSpaceContent, type AddGroupToSpaceResponse, type Asset, type Attachment, type Block, type BlockAncestor, type BlockAttachment, type BlockResponse, type BlockResponseAttachment, type BlockResponseReaction, BlocksResource, type Chapter, type CopySpaceContent, type CopySpaceResponse, type CreateBlockResponseAttachmentContent, type CreateBlockResponseAttachmentResponse, type CreateGroupMembersByGroupIdContent, type CreateGroupMembersByGroupIdResponse, type CreateLabelContent, type CreateLabelResponse, type CreateResponseForBlockContent, type CreateResponseForBlockResponse, type CreateRoomMembersByRoomIdContent, type CreateRoomMembersByRoomIdResponse, type CreateSpaceContent, type CreateSpaceMembersBySpaceIdContent, type CreateSpaceMembersBySpaceIdResponse, type CreateSpaceResponse, type CreateSpaceRoleContent, type CreateSpaceRoleResponse, type CreateWebhookContent, type CreateWebhookResponse, type CursorPage, type CursorPaginationOptions, type CustomWebView, DEFAULT_RETRY_CONFIG, type DeleteBlockResponseAttachmentResponse, type DeleteGroupMembersByGroupIdResponse, type DeleteLabelResponse, type DeleteResponseForBlockResponse, type DeleteSpaceMemberResponse, type DeleteUserResponse, type DeleteVerifiedUserOrRemoveFromOrgResponse, type DeleteWebhookResponse, type GetAssignmentBlocksBySpaceIdResponse, type GetBlockByIdResponse, type GetBlockResponsesByBlockIdResponse, type GetGroupMembersByGroupIdResponse, type GetGroupsByOrganizationIdResponse, type GetLabelsByOrganizationIdResponse, type GetMessageByIdResponse, type GetMessagesByParentIdResponse, type GetMessagesByRoomIdResponse, type GetRoomActiveParticipantsResponse, type GetRoomBlocksBySpaceIdResponse, type GetRoomByIdResponse, type GetRoomMessagesResponse, type GetRoomRecordingByIdResponse, type GetRoomRecordingsByRoomIdResponse, type GetSpaceMembersResponse, type GetSpaceRolesResponse, type GetSpacesByOrganizationIdResponse, type GetThreadMessagesResponse, type GetUserContextByOrganizationIdResponse, type GetWebhookLogsResponse, type GetWebhooksByOrganizationIdResponse, type GoogleProtobufAny, type Group, GroupsResource, type HideSpaceResponse, type Invite, type InviteToRoomByEmailsContent, type InviteToRoomByEmailsResponse, type InviteToSpaceByEmailsContent, type InviteToSpaceByEmailsResponse, InvitesResource, type Label, LabelsResource, type LastSeenInfo, type MemberInfo, type MemberPresenceInfo, type MemberView, type Message, type MessageDeletedData, type MessageDeletedEvent, type MessageEditedData, type MessageEditedEvent, type MessageSentData, type MessageSentEvent, type OffsetPage, type OffsetPaginationOptions, type PersistedBreakoutData, Pivot, PivotAPIError, PivotAuthenticationError, type PivotClientOptions, PivotError, PivotRetryError, PivotTimeoutError, type Reaction, type ReactionEmoji, type Receipt, type RemoveLabelFromSpaceResponse, type RetryConfig, type RevokeInviteByIdResponse, type RevokeRoomInviteResponse, type RevokeSpaceInviteResponse, type RichContent, type RichContentParagraph, type RichContentSegment, type RichContentSubSegment, type Room, type RoomInfo, type RoomInvitation, type RoomInvite, type RoomMember, type RoomMemberStats, type RoomRecording, type RoomRecordingTranscriptPublishedData, type RoomRecordingTranscriptPublishedEvent, RoomsResource, type SendResponseForBlockResponse, type Sentence, type Space, type SpaceInvite, type SpaceMember, type SpaceRole, SpacesResource, type Status, type Transcript, type UpdateLabelContent, type UpdateLabelResponse, type UpdateResponseForBlockContent, type UpdateResponseForBlockResponse, type UpdateSpaceContent, type UpdateSpaceLabelsContent, type UpdateSpaceLabelsResponse, type UpdateSpaceMemberContent, type UpdateSpaceMemberResponse, type UpdateSpaceResponse, type UpdateWebhookContent, type UpdateWebhookResponse, type User, type UserEmail, UsersResource, type Webhook, type WebhookEvent, type WebhookEventSubject, type WebhookEventType, type WebhookFilter, type WebhookHeaders, type WebhookLog, type WebhookSubscription, type WebhookSubscriptionInput, WebhooksResource, autoPageCursor, autoPageOffset, constructWebhookSignature, Pivot as default, parseWebhookEvent, verifyWebhookSignature };