@notionhq/client 5.25.2 → 5.27.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 (54) hide show
  1. package/README.md +130 -129
  2. package/build/package.json +4 -3
  3. package/build/src/Client.d.ts +1901 -96
  4. package/build/src/Client.d.ts.map +1 -1
  5. package/build/src/Client.js +271 -427
  6. package/build/src/Client.js.map +1 -1
  7. package/build/src/api-endpoint-methods.d.ts +920 -0
  8. package/build/src/api-endpoint-methods.d.ts.map +1 -0
  9. package/build/src/api-endpoint-methods.js +171 -0
  10. package/build/src/api-endpoint-methods.js.map +1 -0
  11. package/build/src/api-endpoints/agent-skills.d.ts +68 -0
  12. package/build/src/api-endpoints/agent-skills.d.ts.map +1 -0
  13. package/build/src/api-endpoints/agent-skills.js +36 -0
  14. package/build/src/api-endpoints/agent-skills.js.map +1 -0
  15. package/build/src/api-endpoints/agents.d.ts +3268 -0
  16. package/build/src/api-endpoints/agents.d.ts.map +1 -0
  17. package/build/src/api-endpoints/agents.js +336 -0
  18. package/build/src/api-endpoints/agents.js.map +1 -0
  19. package/build/src/api-endpoints/data-sources.d.ts +1 -0
  20. package/build/src/api-endpoints/data-sources.d.ts.map +1 -1
  21. package/build/src/api-endpoints/data-sources.js.map +1 -1
  22. package/build/src/api-endpoints/databases.d.ts +3 -1
  23. package/build/src/api-endpoints/databases.d.ts.map +1 -1
  24. package/build/src/api-endpoints/databases.js +1 -0
  25. package/build/src/api-endpoints/databases.js.map +1 -1
  26. package/build/src/api-endpoints/file-uploads.d.ts.map +1 -1
  27. package/build/src/api-endpoints/file-uploads.js.map +1 -1
  28. package/build/src/api-endpoints/pages.d.ts.map +1 -1
  29. package/build/src/api-endpoints/pages.js.map +1 -1
  30. package/build/src/api-endpoints/users.d.ts.map +1 -1
  31. package/build/src/api-endpoints/users.js.map +1 -1
  32. package/build/src/api-endpoints.d.ts +2 -0
  33. package/build/src/api-endpoints.d.ts.map +1 -1
  34. package/build/src/api-endpoints.js +2 -0
  35. package/build/src/api-endpoints.js.map +1 -1
  36. package/build/src/errors.d.ts +11 -0
  37. package/build/src/errors.d.ts.map +1 -1
  38. package/build/src/errors.js +20 -1
  39. package/build/src/errors.js.map +1 -1
  40. package/build/src/fetch-types.d.ts +11 -0
  41. package/build/src/fetch-types.d.ts.map +1 -1
  42. package/build/src/fetch-types.js.map +1 -1
  43. package/build/src/helpers.d.ts +4 -4
  44. package/build/src/helpers.d.ts.map +1 -1
  45. package/build/src/helpers.js.map +1 -1
  46. package/build/src/index.d.ts +2 -2
  47. package/build/src/index.d.ts.map +1 -1
  48. package/build/src/index.js +2 -1
  49. package/build/src/index.js.map +1 -1
  50. package/build/src/webhooks.d.ts +12 -19
  51. package/build/src/webhooks.d.ts.map +1 -1
  52. package/build/src/webhooks.js +27 -35
  53. package/build/src/webhooks.js.map +1 -1
  54. package/package.json +4 -3
@@ -1,7 +1,8 @@
1
1
  import type { Agent } from "node:http";
2
+ import type { GetPluginDirectoryParameters } from "./api-endpoints";
2
3
  import { type Logger, LogLevel } from "./logging";
3
- import { type GetBlockParameters, type GetBlockResponse, type UpdateBlockParameters, type UpdateBlockResponse, type DeleteBlockParameters, type DeleteBlockResponse, type AppendBlockChildrenParameters, type AppendBlockChildrenResponse, type ListBlockChildrenParameters, type ListBlockChildrenResponse, type QueryDataSourceParameters, type QueryDataSourceResponse, type CreateDataSourceParameters, type CreateDataSourceResponse, type UpdateDataSourceParameters, type UpdateDataSourceResponse, type GetDataSourceParameters, type GetDataSourceResponse, type CreatePageParameters, type CreatePageResponse, type GetPageParameters, type GetPageResponse, type UpdatePageParameters, type UpdatePageResponse, type MovePageParameters, type MovePageResponse, type GetPageMarkdownParameters, type GetPageMarkdownResponse, type UpdatePageMarkdownParameters, type UpdatePageMarkdownResponse, type GetUserParameters, type GetUserResponse, type ListUsersParameters, type ListUsersResponse, type SearchParameters, type SearchResponse, type GetSelfParameters, type GetSelfResponse, type GetPagePropertyParameters, type GetPagePropertyResponse, type CreateCommentParameters, type CreateCommentResponse, type ListCommentsParameters, type ListCommentsResponse, type GetCommentParameters, type GetCommentResponse, type UpdateCommentParameters, type UpdateCommentResponse, type DeleteCommentParameters, type DeleteCommentResponse, type OauthTokenResponse, type OauthTokenParameters, type OauthIntrospectResponse, type OauthIntrospectParameters, type OauthRevokeResponse, type OauthRevokeParameters, type CreateFileUploadParameters, type CreateFileUploadResponse, type GetFileUploadResponse, type GetFileUploadParameters, type SendFileUploadParameters, type SendFileUploadResponse, type CompleteFileUploadParameters, type CompleteFileUploadResponse, type ListFileUploadsParameters, type ListFileUploadsResponse, GetDatabaseParameters, GetDatabaseResponse, CreateDatabaseResponse, CreateDatabaseParameters, UpdateDatabaseParameters, UpdateDatabaseResponse, ListDataSourceTemplatesResponse, ListDataSourceTemplatesParameters, type ListDatabaseViewsParameters, type ListDatabaseViewsResponse, type CreateViewParameters, type CreateViewResponse, type GetViewParameters, type GetViewResponse, type UpdateViewParameters, type UpdateViewResponse, type DeleteViewParameters, type DeleteViewResponse, type CreateViewQueryParameters, type CreateViewQueryResponse, type GetViewQueryResultsParameters, type GetViewQueryResultsResponse, type DeleteViewQueryParameters, type DeleteViewQueryResponse, type ListCustomEmojisParameters, type ListCustomEmojisResponse, type GetAsyncTaskParameters, type GetAsyncTaskResponse } from "./api-endpoints";
4
- import { type CreateMeetingNoteParameters, type CreateMeetingNoteResponse, type QueryMeetingNotesResponse } from "./api-endpoints/meeting-notes";
4
+ import { type GetPageMarkdownParameters, type GetPageMarkdownResponse, type UpdatePageMarkdownParameters, type UpdatePageMarkdownResponse, type OauthTokenResponse, type OauthTokenParameters, type OauthIntrospectResponse, type OauthIntrospectParameters, type OauthRevokeResponse, type OauthRevokeParameters, type GetFileUploadResponse, type GetFileUploadParameters, type SendFileUploadParameters, type SendFileUploadResponse, type CompleteFileUploadParameters, type CompleteFileUploadResponse, type ListFileUploadsParameters, type ListFileUploadsResponse, type CreateViewParameters, type CreateViewResponse, type UpdateViewParameters, type UpdateViewResponse, type CreateViewQueryParameters, type CreateViewQueryResponse, type ListCustomEmojisParameters, type ListCustomEmojisResponse, type UpdateSessionStreamParameters, type UpdateSessionStreamResponse } from "./api-endpoints";
5
+ import { type QueryMeetingNotesResponse } from "./api-endpoints/meeting-notes";
5
6
  import type { QueryMeetingNotesParameters } from "./meeting-notes";
6
7
  import type { SupportedFetch } from "./fetch-types";
7
8
  export type RetryOptions = {
@@ -37,6 +38,13 @@ export type ClientOptions = {
37
38
  * Set to false to disable retries entirely.
38
39
  */
39
40
  retry?: RetryOptions | false;
41
+ /**
42
+ * Allows the client to use a Notion token inside a browser page or worker.
43
+ * Without it, using a token there throws `BrowserTokenNotAllowedError`.
44
+ * Anyone who can load the page can read the token and act as your
45
+ * connection, so only set this for pages that nobody else can open.
46
+ */
47
+ dangerouslyAllowBrowser?: boolean;
40
48
  };
41
49
  type FileParam = {
42
50
  filename?: string;
@@ -67,6 +75,10 @@ export default class Client {
67
75
  * Sends a request.
68
76
  */
69
77
  request<ResponseBody extends object>(args: RequestParameters): Promise<ResponseBody>;
78
+ /**
79
+ * Opens an SSE response and yields each parsed event as it arrives.
80
+ */
81
+ private streamRequest;
70
82
  /**
71
83
  * Builds the full URL with query parameters.
72
84
  */
@@ -96,6 +108,12 @@ export default class Client {
96
108
  * Executes a single HTTP request (no retry).
97
109
  */
98
110
  private executeSingleRequest;
111
+ /**
112
+ * Opens an SSE response without consuming its body. Retry orchestration is
113
+ * shared with JSON requests so only the initial, retryable HTTP failures are
114
+ * retried; once a stream has opened, its events are never replayed.
115
+ */
116
+ private executeSingleStreamRequest;
99
117
  /**
100
118
  * Logs a request error with appropriate detail level.
101
119
  */
@@ -125,40 +143,1257 @@ export default class Client {
125
143
  */
126
144
  private parseRetryAfterHeader;
127
145
  private sleep;
128
- readonly asyncTasks: {
146
+ readonly plugins: {
147
+ list: (args?: ({
148
+ page_size?: number | undefined;
149
+ start_cursor?: string | null | undefined;
150
+ } & {
151
+ auth?: string;
152
+ }) | undefined) => Promise<import("./api-endpoints").ListSkillsPluginsResponse>;
153
+ retrieve: (args: WithAuth<GetPluginDirectoryParameters>) => Promise<import("./api-endpoints").GetPluginDirectoryResponse>;
154
+ };
155
+ readonly skills: {
156
+ retrieve: (args: {
157
+ id: import("./api-endpoints").IdRequest;
158
+ } & {
159
+ auth?: string;
160
+ }) => Promise<import("./api-endpoints").GetSkillDirectoryResponse>;
161
+ };
162
+ readonly agents: {
163
+ query: (args?: ({
164
+ query?: string | undefined;
165
+ filter?: {
166
+ property: "id";
167
+ id: {
168
+ equals: string;
169
+ };
170
+ } | {
171
+ property: "agent_type";
172
+ string: {
173
+ equals: "notion_ai" | "custom_agent" | "autofill_custom_agent";
174
+ };
175
+ } | {
176
+ property: "created_by";
177
+ people: {
178
+ contains: string;
179
+ };
180
+ } | {
181
+ property: "created_time";
182
+ date: {
183
+ after?: string;
184
+ before?: string;
185
+ };
186
+ } | {
187
+ property: "favorited";
188
+ checkbox: {
189
+ equals: boolean;
190
+ };
191
+ } | {
192
+ property: "connections";
193
+ mcp_server: {
194
+ contains: string;
195
+ };
196
+ } | {
197
+ property: "status";
198
+ status: {
199
+ in: Array<"active" | "disabled" | "deleted">;
200
+ };
201
+ } | {
202
+ property: "model_mode";
203
+ select: {
204
+ equals: "auto" | "pinned";
205
+ };
206
+ } | {
207
+ property: "agent_version";
208
+ number: {
209
+ equals: number;
210
+ };
211
+ } | {
212
+ property: "last_run_at";
213
+ date: {
214
+ after?: string;
215
+ before?: string;
216
+ };
217
+ } | {
218
+ and: Array<{
219
+ property: "id";
220
+ id: {
221
+ equals: string;
222
+ };
223
+ } | {
224
+ property: "agent_type";
225
+ string: {
226
+ equals: "notion_ai" | "custom_agent" | "autofill_custom_agent";
227
+ };
228
+ } | {
229
+ property: "created_by";
230
+ people: {
231
+ contains: string;
232
+ };
233
+ } | {
234
+ property: "created_time";
235
+ date: {
236
+ after?: string;
237
+ before?: string;
238
+ };
239
+ } | {
240
+ property: "favorited";
241
+ checkbox: {
242
+ equals: boolean;
243
+ };
244
+ } | {
245
+ property: "connections";
246
+ mcp_server: {
247
+ contains: string;
248
+ };
249
+ } | {
250
+ property: "status";
251
+ status: {
252
+ in: Array<"active" | "disabled" | "deleted">;
253
+ };
254
+ } | {
255
+ property: "model_mode";
256
+ select: {
257
+ equals: "auto" | "pinned";
258
+ };
259
+ } | {
260
+ property: "agent_version";
261
+ number: {
262
+ equals: number;
263
+ };
264
+ } | {
265
+ property: "last_run_at";
266
+ date: {
267
+ after?: string;
268
+ before?: string;
269
+ };
270
+ } | {
271
+ and: Array<{
272
+ property: "id";
273
+ id: {
274
+ equals: string;
275
+ };
276
+ } | {
277
+ property: "agent_type";
278
+ string: {
279
+ equals: "notion_ai" | "custom_agent" | "autofill_custom_agent";
280
+ };
281
+ } | {
282
+ property: "created_by";
283
+ people: {
284
+ contains: string;
285
+ };
286
+ } | {
287
+ property: "created_time";
288
+ date: {
289
+ after?: string;
290
+ before?: string;
291
+ };
292
+ } | {
293
+ property: "favorited";
294
+ checkbox: {
295
+ equals: boolean;
296
+ };
297
+ } | {
298
+ property: "connections";
299
+ mcp_server: {
300
+ contains: string;
301
+ };
302
+ } | {
303
+ property: "status";
304
+ status: {
305
+ in: Array<"active" | "disabled" | "deleted">;
306
+ };
307
+ } | {
308
+ property: "model_mode";
309
+ select: {
310
+ equals: "auto" | "pinned";
311
+ };
312
+ } | {
313
+ property: "agent_version";
314
+ number: {
315
+ equals: number;
316
+ };
317
+ } | {
318
+ property: "last_run_at";
319
+ date: {
320
+ after?: string;
321
+ before?: string;
322
+ };
323
+ }>;
324
+ } | {
325
+ or: Array<{
326
+ property: "id";
327
+ id: {
328
+ equals: string;
329
+ };
330
+ } | {
331
+ property: "agent_type";
332
+ string: {
333
+ equals: "notion_ai" | "custom_agent" | "autofill_custom_agent";
334
+ };
335
+ } | {
336
+ property: "created_by";
337
+ people: {
338
+ contains: string;
339
+ };
340
+ } | {
341
+ property: "created_time";
342
+ date: {
343
+ after?: string;
344
+ before?: string;
345
+ };
346
+ } | {
347
+ property: "favorited";
348
+ checkbox: {
349
+ equals: boolean;
350
+ };
351
+ } | {
352
+ property: "connections";
353
+ mcp_server: {
354
+ contains: string;
355
+ };
356
+ } | {
357
+ property: "status";
358
+ status: {
359
+ in: Array<"active" | "disabled" | "deleted">;
360
+ };
361
+ } | {
362
+ property: "model_mode";
363
+ select: {
364
+ equals: "auto" | "pinned";
365
+ };
366
+ } | {
367
+ property: "agent_version";
368
+ number: {
369
+ equals: number;
370
+ };
371
+ } | {
372
+ property: "last_run_at";
373
+ date: {
374
+ after?: string;
375
+ before?: string;
376
+ };
377
+ }>;
378
+ }>;
379
+ } | {
380
+ or: Array<{
381
+ property: "id";
382
+ id: {
383
+ equals: string;
384
+ };
385
+ } | {
386
+ property: "agent_type";
387
+ string: {
388
+ equals: "notion_ai" | "custom_agent" | "autofill_custom_agent";
389
+ };
390
+ } | {
391
+ property: "created_by";
392
+ people: {
393
+ contains: string;
394
+ };
395
+ } | {
396
+ property: "created_time";
397
+ date: {
398
+ after?: string;
399
+ before?: string;
400
+ };
401
+ } | {
402
+ property: "favorited";
403
+ checkbox: {
404
+ equals: boolean;
405
+ };
406
+ } | {
407
+ property: "connections";
408
+ mcp_server: {
409
+ contains: string;
410
+ };
411
+ } | {
412
+ property: "status";
413
+ status: {
414
+ in: Array<"active" | "disabled" | "deleted">;
415
+ };
416
+ } | {
417
+ property: "model_mode";
418
+ select: {
419
+ equals: "auto" | "pinned";
420
+ };
421
+ } | {
422
+ property: "agent_version";
423
+ number: {
424
+ equals: number;
425
+ };
426
+ } | {
427
+ property: "last_run_at";
428
+ date: {
429
+ after?: string;
430
+ before?: string;
431
+ };
432
+ } | {
433
+ and: Array<{
434
+ property: "id";
435
+ id: {
436
+ equals: string;
437
+ };
438
+ } | {
439
+ property: "agent_type";
440
+ string: {
441
+ equals: "notion_ai" | "custom_agent" | "autofill_custom_agent";
442
+ };
443
+ } | {
444
+ property: "created_by";
445
+ people: {
446
+ contains: string;
447
+ };
448
+ } | {
449
+ property: "created_time";
450
+ date: {
451
+ after?: string;
452
+ before?: string;
453
+ };
454
+ } | {
455
+ property: "favorited";
456
+ checkbox: {
457
+ equals: boolean;
458
+ };
459
+ } | {
460
+ property: "connections";
461
+ mcp_server: {
462
+ contains: string;
463
+ };
464
+ } | {
465
+ property: "status";
466
+ status: {
467
+ in: Array<"active" | "disabled" | "deleted">;
468
+ };
469
+ } | {
470
+ property: "model_mode";
471
+ select: {
472
+ equals: "auto" | "pinned";
473
+ };
474
+ } | {
475
+ property: "agent_version";
476
+ number: {
477
+ equals: number;
478
+ };
479
+ } | {
480
+ property: "last_run_at";
481
+ date: {
482
+ after?: string;
483
+ before?: string;
484
+ };
485
+ }>;
486
+ } | {
487
+ or: Array<{
488
+ property: "id";
489
+ id: {
490
+ equals: string;
491
+ };
492
+ } | {
493
+ property: "agent_type";
494
+ string: {
495
+ equals: "notion_ai" | "custom_agent" | "autofill_custom_agent";
496
+ };
497
+ } | {
498
+ property: "created_by";
499
+ people: {
500
+ contains: string;
501
+ };
502
+ } | {
503
+ property: "created_time";
504
+ date: {
505
+ after?: string;
506
+ before?: string;
507
+ };
508
+ } | {
509
+ property: "favorited";
510
+ checkbox: {
511
+ equals: boolean;
512
+ };
513
+ } | {
514
+ property: "connections";
515
+ mcp_server: {
516
+ contains: string;
517
+ };
518
+ } | {
519
+ property: "status";
520
+ status: {
521
+ in: Array<"active" | "disabled" | "deleted">;
522
+ };
523
+ } | {
524
+ property: "model_mode";
525
+ select: {
526
+ equals: "auto" | "pinned";
527
+ };
528
+ } | {
529
+ property: "agent_version";
530
+ number: {
531
+ equals: number;
532
+ };
533
+ } | {
534
+ property: "last_run_at";
535
+ date: {
536
+ after?: string;
537
+ before?: string;
538
+ };
539
+ }>;
540
+ }>;
541
+ } | undefined;
542
+ sorts?: Array<{
543
+ property: "created_time" | "last_run_at";
544
+ direction: "ascending" | "descending";
545
+ }> | undefined;
546
+ start_cursor?: string | null | undefined;
547
+ page_size?: number | undefined;
548
+ verbose?: boolean | undefined;
549
+ include_deleted?: boolean | undefined;
550
+ } & {
551
+ auth?: string;
552
+ }) | undefined) => Promise<import("./api-endpoints").QueryAgentsResponse>;
553
+ retrieve: (args: {
554
+ agent_id: import("./api-endpoints").IdRequest | "notion_ai" | "33333333-3333-3333-3333-333333333333";
555
+ } & {
556
+ verbose?: boolean;
557
+ } & {
558
+ auth?: string;
559
+ }) => Promise<import("./api-endpoints").GetAgentResponse>;
560
+ delete: (args: {
561
+ agent_id: import("./api-endpoints").IdRequest | "notion_ai" | "33333333-3333-3333-3333-333333333333";
562
+ } & {
563
+ auth?: string;
564
+ }) => Promise<import("./api-endpoints").DeleteAgentResponse>;
565
+ retrieveInsights: (args: {
566
+ agent_id: import("./api-endpoints").IdRequest | "notion_ai" | "33333333-3333-3333-3333-333333333333";
567
+ } & {
568
+ start_time?: number;
569
+ end_time?: number;
570
+ } & {
571
+ auth?: string;
572
+ }) => Promise<import("./api-endpoints").GetInsightsResponse>;
573
+ updateStatus: (args: {
574
+ agent_id: import("./api-endpoints").IdRequest | "notion_ai" | "33333333-3333-3333-3333-333333333333";
575
+ } & {
576
+ status: "active" | "disabled";
577
+ } & {
578
+ auth?: string;
579
+ }) => Promise<import("./api-endpoints").UpdateAgentStatusResponse>;
580
+ updateCreditLimit: (args: {
581
+ agent_id: import("./api-endpoints").IdRequest | "notion_ai" | "33333333-3333-3333-3333-333333333333";
582
+ } & {
583
+ credit_limit: number | null;
584
+ } & {
585
+ auth?: string;
586
+ }) => Promise<import("./api-endpoints").UpdateAgentCreditLimitResponse>;
587
+ batch: (args: {
588
+ operations: Array<{
589
+ action: "update_status";
590
+ agent_id: import("./api-endpoints").IdRequest | "notion_ai" | "33333333-3333-3333-3333-333333333333";
591
+ fields: {
592
+ status: "active" | "disabled";
593
+ };
594
+ } | {
595
+ action: "update_credit_limit";
596
+ agent_id: import("./api-endpoints").IdRequest | "notion_ai" | "33333333-3333-3333-3333-333333333333";
597
+ fields: {
598
+ credit_limit: number | null;
599
+ };
600
+ } | {
601
+ action: "delete";
602
+ agent_id: import("./api-endpoints").IdRequest | "notion_ai" | "33333333-3333-3333-3333-333333333333";
603
+ }>;
604
+ } & {
605
+ auth?: string;
606
+ }) => Promise<import("./api-endpoints").AgentBatchResponse>;
607
+ };
608
+ readonly sessions: {
609
+ /**
610
+ * Retrieve a session
611
+ */
612
+ retrieve: (args: {
613
+ session_id: import("./api-endpoints").IdRequest;
614
+ } & {
615
+ auth?: string;
616
+ }) => Promise<import("./api-endpoints").RetrieveSessionResponse>;
617
+ /**
618
+ * Update a session
619
+ */
620
+ update: (args: ({
621
+ message: string;
622
+ agent_id?: import("./api-endpoints").IdRequest | "notion_ai" | "33333333-3333-3333-3333-333333333333";
623
+ session_id?: import("./api-endpoints").IdRequest;
624
+ attachments?: Array<{
625
+ file_upload: {
626
+ id: string;
627
+ };
628
+ type?: "file_upload";
629
+ name?: string;
630
+ }>;
631
+ metadata?: Record<string, string>;
632
+ prompt_context?: string;
633
+ } | {
634
+ session_id: import("./api-endpoints").IdRequest;
635
+ actions: Array<{
636
+ action_id: import("./api-endpoints").IdRequest;
637
+ option_id: "approve" | "reject";
638
+ }>;
639
+ metadata?: Record<string, string>;
640
+ } | {
641
+ session_id: import("./api-endpoints").IdRequest;
642
+ continue_from: string;
643
+ }) & {
644
+ auth?: string;
645
+ }) => Promise<import("./api-endpoints").UpdateSessionResponse>;
646
+ /**
647
+ * Open a session stream
648
+ */
649
+ stream: (args: WithAuth<UpdateSessionStreamParameters>) => AsyncIterable<UpdateSessionStreamResponse>;
129
650
  /**
130
- * Retrieve an async task
651
+ * Cancel a session
131
652
  */
132
- retrieve: (args: WithAuth<GetAsyncTaskParameters>) => Promise<GetAsyncTaskResponse>;
653
+ cancel: (args: {
654
+ session_id: import("./api-endpoints").IdRequest;
655
+ } & {
656
+ event_id?: string;
657
+ } & {
658
+ auth?: string;
659
+ }) => Promise<import("./api-endpoints").CancelSessionResponse>;
660
+ /**
661
+ * Query sessions
662
+ */
663
+ query: (args?: ({
664
+ query?: string | undefined;
665
+ filter?: {
666
+ property: "id";
667
+ string: {
668
+ equals: string;
669
+ };
670
+ } | {
671
+ property: "agent_id";
672
+ string: {
673
+ equals: string;
674
+ };
675
+ } | {
676
+ property: "status";
677
+ status: {
678
+ equals?: "queued" | "in_progress" | "requires_action" | "completed" | "failed" | "canceled" | "terminated";
679
+ in?: Array<"queued" | "in_progress" | "requires_action" | "completed" | "failed" | "canceled" | "terminated">;
680
+ };
681
+ } | {
682
+ property: "created_at" | "updated_at";
683
+ timestamp: {
684
+ before?: string;
685
+ after?: string;
686
+ on_or_before?: string;
687
+ on_or_after?: string;
688
+ };
689
+ } | {
690
+ and: Array<{
691
+ property: "id";
692
+ string: {
693
+ equals: string;
694
+ };
695
+ } | {
696
+ property: "agent_id";
697
+ string: {
698
+ equals: string;
699
+ };
700
+ } | {
701
+ property: "status";
702
+ status: {
703
+ equals?: "queued" | "in_progress" | "requires_action" | "completed" | "failed" | "canceled" | "terminated";
704
+ in?: Array<"queued" | "in_progress" | "requires_action" | "completed" | "failed" | "canceled" | "terminated">;
705
+ };
706
+ } | {
707
+ property: "created_at" | "updated_at";
708
+ timestamp: {
709
+ before?: string;
710
+ after?: string;
711
+ on_or_before?: string;
712
+ on_or_after?: string;
713
+ };
714
+ } | {
715
+ and: Array<{
716
+ property: "id";
717
+ string: {
718
+ equals: string;
719
+ };
720
+ } | {
721
+ property: "agent_id";
722
+ string: {
723
+ equals: string;
724
+ };
725
+ } | {
726
+ property: "status";
727
+ status: {
728
+ equals?: "queued" | "in_progress" | "requires_action" | "completed" | "failed" | "canceled" | "terminated";
729
+ in?: Array<"queued" | "in_progress" | "requires_action" | "completed" | "failed" | "canceled" | "terminated">;
730
+ };
731
+ } | {
732
+ property: "created_at" | "updated_at";
733
+ timestamp: {
734
+ before?: string;
735
+ after?: string;
736
+ on_or_before?: string;
737
+ on_or_after?: string;
738
+ };
739
+ }>;
740
+ } | {
741
+ or: Array<{
742
+ property: "id";
743
+ string: {
744
+ equals: string;
745
+ };
746
+ } | {
747
+ property: "agent_id";
748
+ string: {
749
+ equals: string;
750
+ };
751
+ } | {
752
+ property: "status";
753
+ status: {
754
+ equals?: "queued" | "in_progress" | "requires_action" | "completed" | "failed" | "canceled" | "terminated";
755
+ in?: Array<"queued" | "in_progress" | "requires_action" | "completed" | "failed" | "canceled" | "terminated">;
756
+ };
757
+ } | {
758
+ property: "created_at" | "updated_at";
759
+ timestamp: {
760
+ before?: string;
761
+ after?: string;
762
+ on_or_before?: string;
763
+ on_or_after?: string;
764
+ };
765
+ }>;
766
+ }>;
767
+ } | {
768
+ or: Array<{
769
+ property: "id";
770
+ string: {
771
+ equals: string;
772
+ };
773
+ } | {
774
+ property: "agent_id";
775
+ string: {
776
+ equals: string;
777
+ };
778
+ } | {
779
+ property: "status";
780
+ status: {
781
+ equals?: "queued" | "in_progress" | "requires_action" | "completed" | "failed" | "canceled" | "terminated";
782
+ in?: Array<"queued" | "in_progress" | "requires_action" | "completed" | "failed" | "canceled" | "terminated">;
783
+ };
784
+ } | {
785
+ property: "created_at" | "updated_at";
786
+ timestamp: {
787
+ before?: string;
788
+ after?: string;
789
+ on_or_before?: string;
790
+ on_or_after?: string;
791
+ };
792
+ } | {
793
+ and: Array<{
794
+ property: "id";
795
+ string: {
796
+ equals: string;
797
+ };
798
+ } | {
799
+ property: "agent_id";
800
+ string: {
801
+ equals: string;
802
+ };
803
+ } | {
804
+ property: "status";
805
+ status: {
806
+ equals?: "queued" | "in_progress" | "requires_action" | "completed" | "failed" | "canceled" | "terminated";
807
+ in?: Array<"queued" | "in_progress" | "requires_action" | "completed" | "failed" | "canceled" | "terminated">;
808
+ };
809
+ } | {
810
+ property: "created_at" | "updated_at";
811
+ timestamp: {
812
+ before?: string;
813
+ after?: string;
814
+ on_or_before?: string;
815
+ on_or_after?: string;
816
+ };
817
+ }>;
818
+ } | {
819
+ or: Array<{
820
+ property: "id";
821
+ string: {
822
+ equals: string;
823
+ };
824
+ } | {
825
+ property: "agent_id";
826
+ string: {
827
+ equals: string;
828
+ };
829
+ } | {
830
+ property: "status";
831
+ status: {
832
+ equals?: "queued" | "in_progress" | "requires_action" | "completed" | "failed" | "canceled" | "terminated";
833
+ in?: Array<"queued" | "in_progress" | "requires_action" | "completed" | "failed" | "canceled" | "terminated">;
834
+ };
835
+ } | {
836
+ property: "created_at" | "updated_at";
837
+ timestamp: {
838
+ before?: string;
839
+ after?: string;
840
+ on_or_before?: string;
841
+ on_or_after?: string;
842
+ };
843
+ }>;
844
+ }>;
845
+ } | undefined;
846
+ sorts?: Array<{
847
+ property: "created_at" | "updated_at";
848
+ direction: "ascending" | "descending";
849
+ }> | undefined;
850
+ start_cursor?: string | null | undefined;
851
+ page_size?: number | undefined;
852
+ } & {
853
+ auth?: string;
854
+ }) | undefined) => Promise<import("./api-endpoints").QuerySessionsResponse>;
855
+ /**
856
+ * Query session events
857
+ */
858
+ queryEvents: (args: {
859
+ session_id: import("./api-endpoints").IdRequest;
860
+ } & {
861
+ filter?: {
862
+ property: "id";
863
+ string: {
864
+ equals: string;
865
+ };
866
+ } | {
867
+ property: "type";
868
+ event_type: {
869
+ equals?: "user.message" | "agent.message" | "agent.thinking" | "agent.tool_use" | "agent.tool_result" | "session.status";
870
+ in?: Array<"user.message" | "agent.message" | "agent.thinking" | "agent.tool_use" | "agent.tool_result" | "session.status">;
871
+ };
872
+ } | {
873
+ property: "sequence";
874
+ number: {
875
+ greater_than?: number;
876
+ greater_than_or_equal_to?: number;
877
+ less_than?: number;
878
+ less_than_or_equal_to?: number;
879
+ };
880
+ } | {
881
+ property: "created_at";
882
+ timestamp: {
883
+ equals?: string;
884
+ before?: string;
885
+ after?: string;
886
+ on_or_before?: string;
887
+ on_or_after?: string;
888
+ };
889
+ } | {
890
+ and: Array<{
891
+ property: "id";
892
+ string: {
893
+ equals: string;
894
+ };
895
+ } | {
896
+ property: "type";
897
+ event_type: {
898
+ equals?: "user.message" | "agent.message" | "agent.thinking" | "agent.tool_use" | "agent.tool_result" | "session.status";
899
+ in?: Array<"user.message" | "agent.message" | "agent.thinking" | "agent.tool_use" | "agent.tool_result" | "session.status">;
900
+ };
901
+ } | {
902
+ property: "sequence";
903
+ number: {
904
+ greater_than?: number;
905
+ greater_than_or_equal_to?: number;
906
+ less_than?: number;
907
+ less_than_or_equal_to?: number;
908
+ };
909
+ } | {
910
+ property: "created_at";
911
+ timestamp: {
912
+ equals?: string;
913
+ before?: string;
914
+ after?: string;
915
+ on_or_before?: string;
916
+ on_or_after?: string;
917
+ };
918
+ } | {
919
+ and: Array<{
920
+ property: "id";
921
+ string: {
922
+ equals: string;
923
+ };
924
+ } | {
925
+ property: "type";
926
+ event_type: {
927
+ equals?: "user.message" | "agent.message" | "agent.thinking" | "agent.tool_use" | "agent.tool_result" | "session.status";
928
+ in?: Array<"user.message" | "agent.message" | "agent.thinking" | "agent.tool_use" | "agent.tool_result" | "session.status">;
929
+ };
930
+ } | {
931
+ property: "sequence";
932
+ number: {
933
+ greater_than?: number;
934
+ greater_than_or_equal_to?: number;
935
+ less_than?: number;
936
+ less_than_or_equal_to?: number;
937
+ };
938
+ } | {
939
+ property: "created_at";
940
+ timestamp: {
941
+ equals?: string;
942
+ before?: string;
943
+ after?: string;
944
+ on_or_before?: string;
945
+ on_or_after?: string;
946
+ };
947
+ } | {
948
+ and: Array<{
949
+ property: "id";
950
+ string: {
951
+ equals: string;
952
+ };
953
+ } | {
954
+ property: "type";
955
+ event_type: {
956
+ equals?: "user.message" | "agent.message" | "agent.thinking" | "agent.tool_use" | "agent.tool_result" | "session.status";
957
+ in?: Array<"user.message" | "agent.message" | "agent.thinking" | "agent.tool_use" | "agent.tool_result" | "session.status">;
958
+ };
959
+ } | {
960
+ property: "sequence";
961
+ number: {
962
+ greater_than?: number;
963
+ greater_than_or_equal_to?: number;
964
+ less_than?: number;
965
+ less_than_or_equal_to?: number;
966
+ };
967
+ } | {
968
+ property: "created_at";
969
+ timestamp: {
970
+ equals?: string;
971
+ before?: string;
972
+ after?: string;
973
+ on_or_before?: string;
974
+ on_or_after?: string;
975
+ };
976
+ }>;
977
+ } | {
978
+ or: Array<{
979
+ property: "id";
980
+ string: {
981
+ equals: string;
982
+ };
983
+ } | {
984
+ property: "type";
985
+ event_type: {
986
+ equals?: "user.message" | "agent.message" | "agent.thinking" | "agent.tool_use" | "agent.tool_result" | "session.status";
987
+ in?: Array<"user.message" | "agent.message" | "agent.thinking" | "agent.tool_use" | "agent.tool_result" | "session.status">;
988
+ };
989
+ } | {
990
+ property: "sequence";
991
+ number: {
992
+ greater_than?: number;
993
+ greater_than_or_equal_to?: number;
994
+ less_than?: number;
995
+ less_than_or_equal_to?: number;
996
+ };
997
+ } | {
998
+ property: "created_at";
999
+ timestamp: {
1000
+ equals?: string;
1001
+ before?: string;
1002
+ after?: string;
1003
+ on_or_before?: string;
1004
+ on_or_after?: string;
1005
+ };
1006
+ }>;
1007
+ }>;
1008
+ } | {
1009
+ or: Array<{
1010
+ property: "id";
1011
+ string: {
1012
+ equals: string;
1013
+ };
1014
+ } | {
1015
+ property: "type";
1016
+ event_type: {
1017
+ equals?: "user.message" | "agent.message" | "agent.thinking" | "agent.tool_use" | "agent.tool_result" | "session.status";
1018
+ in?: Array<"user.message" | "agent.message" | "agent.thinking" | "agent.tool_use" | "agent.tool_result" | "session.status">;
1019
+ };
1020
+ } | {
1021
+ property: "sequence";
1022
+ number: {
1023
+ greater_than?: number;
1024
+ greater_than_or_equal_to?: number;
1025
+ less_than?: number;
1026
+ less_than_or_equal_to?: number;
1027
+ };
1028
+ } | {
1029
+ property: "created_at";
1030
+ timestamp: {
1031
+ equals?: string;
1032
+ before?: string;
1033
+ after?: string;
1034
+ on_or_before?: string;
1035
+ on_or_after?: string;
1036
+ };
1037
+ } | {
1038
+ and: Array<{
1039
+ property: "id";
1040
+ string: {
1041
+ equals: string;
1042
+ };
1043
+ } | {
1044
+ property: "type";
1045
+ event_type: {
1046
+ equals?: "user.message" | "agent.message" | "agent.thinking" | "agent.tool_use" | "agent.tool_result" | "session.status";
1047
+ in?: Array<"user.message" | "agent.message" | "agent.thinking" | "agent.tool_use" | "agent.tool_result" | "session.status">;
1048
+ };
1049
+ } | {
1050
+ property: "sequence";
1051
+ number: {
1052
+ greater_than?: number;
1053
+ greater_than_or_equal_to?: number;
1054
+ less_than?: number;
1055
+ less_than_or_equal_to?: number;
1056
+ };
1057
+ } | {
1058
+ property: "created_at";
1059
+ timestamp: {
1060
+ equals?: string;
1061
+ before?: string;
1062
+ after?: string;
1063
+ on_or_before?: string;
1064
+ on_or_after?: string;
1065
+ };
1066
+ }>;
1067
+ } | {
1068
+ or: Array<{
1069
+ property: "id";
1070
+ string: {
1071
+ equals: string;
1072
+ };
1073
+ } | {
1074
+ property: "type";
1075
+ event_type: {
1076
+ equals?: "user.message" | "agent.message" | "agent.thinking" | "agent.tool_use" | "agent.tool_result" | "session.status";
1077
+ in?: Array<"user.message" | "agent.message" | "agent.thinking" | "agent.tool_use" | "agent.tool_result" | "session.status">;
1078
+ };
1079
+ } | {
1080
+ property: "sequence";
1081
+ number: {
1082
+ greater_than?: number;
1083
+ greater_than_or_equal_to?: number;
1084
+ less_than?: number;
1085
+ less_than_or_equal_to?: number;
1086
+ };
1087
+ } | {
1088
+ property: "created_at";
1089
+ timestamp: {
1090
+ equals?: string;
1091
+ before?: string;
1092
+ after?: string;
1093
+ on_or_before?: string;
1094
+ on_or_after?: string;
1095
+ };
1096
+ }>;
1097
+ }>;
1098
+ }>;
1099
+ } | {
1100
+ or: Array<{
1101
+ property: "id";
1102
+ string: {
1103
+ equals: string;
1104
+ };
1105
+ } | {
1106
+ property: "type";
1107
+ event_type: {
1108
+ equals?: "user.message" | "agent.message" | "agent.thinking" | "agent.tool_use" | "agent.tool_result" | "session.status";
1109
+ in?: Array<"user.message" | "agent.message" | "agent.thinking" | "agent.tool_use" | "agent.tool_result" | "session.status">;
1110
+ };
1111
+ } | {
1112
+ property: "sequence";
1113
+ number: {
1114
+ greater_than?: number;
1115
+ greater_than_or_equal_to?: number;
1116
+ less_than?: number;
1117
+ less_than_or_equal_to?: number;
1118
+ };
1119
+ } | {
1120
+ property: "created_at";
1121
+ timestamp: {
1122
+ equals?: string;
1123
+ before?: string;
1124
+ after?: string;
1125
+ on_or_before?: string;
1126
+ on_or_after?: string;
1127
+ };
1128
+ } | {
1129
+ and: Array<{
1130
+ property: "id";
1131
+ string: {
1132
+ equals: string;
1133
+ };
1134
+ } | {
1135
+ property: "type";
1136
+ event_type: {
1137
+ equals?: "user.message" | "agent.message" | "agent.thinking" | "agent.tool_use" | "agent.tool_result" | "session.status";
1138
+ in?: Array<"user.message" | "agent.message" | "agent.thinking" | "agent.tool_use" | "agent.tool_result" | "session.status">;
1139
+ };
1140
+ } | {
1141
+ property: "sequence";
1142
+ number: {
1143
+ greater_than?: number;
1144
+ greater_than_or_equal_to?: number;
1145
+ less_than?: number;
1146
+ less_than_or_equal_to?: number;
1147
+ };
1148
+ } | {
1149
+ property: "created_at";
1150
+ timestamp: {
1151
+ equals?: string;
1152
+ before?: string;
1153
+ after?: string;
1154
+ on_or_before?: string;
1155
+ on_or_after?: string;
1156
+ };
1157
+ } | {
1158
+ and: Array<{
1159
+ property: "id";
1160
+ string: {
1161
+ equals: string;
1162
+ };
1163
+ } | {
1164
+ property: "type";
1165
+ event_type: {
1166
+ equals?: "user.message" | "agent.message" | "agent.thinking" | "agent.tool_use" | "agent.tool_result" | "session.status";
1167
+ in?: Array<"user.message" | "agent.message" | "agent.thinking" | "agent.tool_use" | "agent.tool_result" | "session.status">;
1168
+ };
1169
+ } | {
1170
+ property: "sequence";
1171
+ number: {
1172
+ greater_than?: number;
1173
+ greater_than_or_equal_to?: number;
1174
+ less_than?: number;
1175
+ less_than_or_equal_to?: number;
1176
+ };
1177
+ } | {
1178
+ property: "created_at";
1179
+ timestamp: {
1180
+ equals?: string;
1181
+ before?: string;
1182
+ after?: string;
1183
+ on_or_before?: string;
1184
+ on_or_after?: string;
1185
+ };
1186
+ }>;
1187
+ } | {
1188
+ or: Array<{
1189
+ property: "id";
1190
+ string: {
1191
+ equals: string;
1192
+ };
1193
+ } | {
1194
+ property: "type";
1195
+ event_type: {
1196
+ equals?: "user.message" | "agent.message" | "agent.thinking" | "agent.tool_use" | "agent.tool_result" | "session.status";
1197
+ in?: Array<"user.message" | "agent.message" | "agent.thinking" | "agent.tool_use" | "agent.tool_result" | "session.status">;
1198
+ };
1199
+ } | {
1200
+ property: "sequence";
1201
+ number: {
1202
+ greater_than?: number;
1203
+ greater_than_or_equal_to?: number;
1204
+ less_than?: number;
1205
+ less_than_or_equal_to?: number;
1206
+ };
1207
+ } | {
1208
+ property: "created_at";
1209
+ timestamp: {
1210
+ equals?: string;
1211
+ before?: string;
1212
+ after?: string;
1213
+ on_or_before?: string;
1214
+ on_or_after?: string;
1215
+ };
1216
+ }>;
1217
+ }>;
1218
+ } | {
1219
+ or: Array<{
1220
+ property: "id";
1221
+ string: {
1222
+ equals: string;
1223
+ };
1224
+ } | {
1225
+ property: "type";
1226
+ event_type: {
1227
+ equals?: "user.message" | "agent.message" | "agent.thinking" | "agent.tool_use" | "agent.tool_result" | "session.status";
1228
+ in?: Array<"user.message" | "agent.message" | "agent.thinking" | "agent.tool_use" | "agent.tool_result" | "session.status">;
1229
+ };
1230
+ } | {
1231
+ property: "sequence";
1232
+ number: {
1233
+ greater_than?: number;
1234
+ greater_than_or_equal_to?: number;
1235
+ less_than?: number;
1236
+ less_than_or_equal_to?: number;
1237
+ };
1238
+ } | {
1239
+ property: "created_at";
1240
+ timestamp: {
1241
+ equals?: string;
1242
+ before?: string;
1243
+ after?: string;
1244
+ on_or_before?: string;
1245
+ on_or_after?: string;
1246
+ };
1247
+ } | {
1248
+ and: Array<{
1249
+ property: "id";
1250
+ string: {
1251
+ equals: string;
1252
+ };
1253
+ } | {
1254
+ property: "type";
1255
+ event_type: {
1256
+ equals?: "user.message" | "agent.message" | "agent.thinking" | "agent.tool_use" | "agent.tool_result" | "session.status";
1257
+ in?: Array<"user.message" | "agent.message" | "agent.thinking" | "agent.tool_use" | "agent.tool_result" | "session.status">;
1258
+ };
1259
+ } | {
1260
+ property: "sequence";
1261
+ number: {
1262
+ greater_than?: number;
1263
+ greater_than_or_equal_to?: number;
1264
+ less_than?: number;
1265
+ less_than_or_equal_to?: number;
1266
+ };
1267
+ } | {
1268
+ property: "created_at";
1269
+ timestamp: {
1270
+ equals?: string;
1271
+ before?: string;
1272
+ after?: string;
1273
+ on_or_before?: string;
1274
+ on_or_after?: string;
1275
+ };
1276
+ }>;
1277
+ } | {
1278
+ or: Array<{
1279
+ property: "id";
1280
+ string: {
1281
+ equals: string;
1282
+ };
1283
+ } | {
1284
+ property: "type";
1285
+ event_type: {
1286
+ equals?: "user.message" | "agent.message" | "agent.thinking" | "agent.tool_use" | "agent.tool_result" | "session.status";
1287
+ in?: Array<"user.message" | "agent.message" | "agent.thinking" | "agent.tool_use" | "agent.tool_result" | "session.status">;
1288
+ };
1289
+ } | {
1290
+ property: "sequence";
1291
+ number: {
1292
+ greater_than?: number;
1293
+ greater_than_or_equal_to?: number;
1294
+ less_than?: number;
1295
+ less_than_or_equal_to?: number;
1296
+ };
1297
+ } | {
1298
+ property: "created_at";
1299
+ timestamp: {
1300
+ equals?: string;
1301
+ before?: string;
1302
+ after?: string;
1303
+ on_or_before?: string;
1304
+ on_or_after?: string;
1305
+ };
1306
+ }>;
1307
+ }>;
1308
+ }>;
1309
+ };
1310
+ sorts?: Array<{
1311
+ property: "sequence" | "created_at";
1312
+ direction: "ascending" | "descending";
1313
+ }>;
1314
+ start_cursor?: string | null;
1315
+ page_size?: number;
1316
+ } & {
1317
+ auth?: string;
1318
+ }) => Promise<import("./api-endpoints").QuerySessionEventsResponse>;
1319
+ };
1320
+ readonly asyncTasks: {
1321
+ retrieve: (args: {
1322
+ task_id: string;
1323
+ } & {
1324
+ auth?: string;
1325
+ }) => Promise<import("./api-endpoints").GetAsyncTaskResponse>;
133
1326
  };
134
1327
  readonly blocks: {
135
1328
  /**
136
1329
  * Retrieve block
137
1330
  */
138
- retrieve: (args: WithAuth<GetBlockParameters>) => Promise<GetBlockResponse>;
1331
+ retrieve: (args: {
1332
+ block_id: import("./api-endpoints").IdRequest;
1333
+ } & {
1334
+ auth?: string;
1335
+ }) => Promise<import("./api-endpoints").GetBlockResponse>;
139
1336
  /**
140
1337
  * Update block
141
1338
  */
142
- update: (args: WithAuth<UpdateBlockParameters>) => Promise<UpdateBlockResponse>;
1339
+ update: (args: import("./api-endpoints").UpdateBlockParameters & {
1340
+ auth?: string;
1341
+ }) => Promise<import("./api-endpoints").UpdateBlockResponse>;
143
1342
  /**
144
1343
  * Delete block
145
1344
  */
146
- delete: (args: WithAuth<DeleteBlockParameters>) => Promise<DeleteBlockResponse>;
1345
+ delete: (args: {
1346
+ block_id: import("./api-endpoints").IdRequest;
1347
+ } & {
1348
+ auth?: string;
1349
+ }) => Promise<import("./api-endpoints").DeleteBlockResponse>;
147
1350
  children: {
148
- /**
149
- * Append block children
150
- */
151
- append: (args: WithAuth<AppendBlockChildrenParameters>) => Promise<AppendBlockChildrenResponse>;
152
- /**
153
- * Retrieve block children
154
- */
155
- list: (args: WithAuth<ListBlockChildrenParameters>) => Promise<ListBlockChildrenResponse>;
1351
+ list: (args: {
1352
+ block_id: import("./api-endpoints").IdRequest;
1353
+ } & {
1354
+ start_cursor?: string | null;
1355
+ page_size?: number;
1356
+ } & {
1357
+ auth?: string;
1358
+ }) => Promise<import("./api-endpoints").ListBlockChildrenResponse>;
1359
+ append: (args: {
1360
+ block_id: import("./api-endpoints").IdRequest;
1361
+ } & {
1362
+ children: Array<import("./api-endpoints").BlockObjectRequest>;
1363
+ after?: import("./api-endpoints").IdRequest;
1364
+ position?: import("./api-endpoints").ContentPositionSchema;
1365
+ } & {
1366
+ auth?: string;
1367
+ }) => Promise<import("./api-endpoints").AppendBlockChildrenResponse>;
156
1368
  };
157
1369
  meetingNotes: {
158
1370
  /**
159
1371
  * Create a meeting note
160
1372
  */
161
- create: (args: WithAuth<CreateMeetingNoteParameters>) => Promise<CreateMeetingNoteResponse>;
1373
+ create: (args: ({
1374
+ title?: string;
1375
+ language?: "auto" | "en" | "zh-CN" | "zh-TW" | "es" | "fr" | "de" | "ja" | "ko" | "pt" | "ru" | "th" | "vi" | "id" | "da" | "fi" | "no" | "nl" | "it" | "sv" | "ar" | "he" | "pl";
1376
+ options?: {
1377
+ kickoff_summary?: boolean;
1378
+ };
1379
+ } & ({
1380
+ source: {
1381
+ type: "file_upload";
1382
+ file_upload_id: import("./api-endpoints").IdRequest;
1383
+ };
1384
+ parent: {
1385
+ type: "page_id";
1386
+ page_id: import("./api-endpoints").IdRequest;
1387
+ };
1388
+ } | {
1389
+ source: {
1390
+ type: "block";
1391
+ block_id: import("./api-endpoints").IdRequest;
1392
+ };
1393
+ parent?: never;
1394
+ })) & {
1395
+ auth?: string;
1396
+ }) => Promise<import("./api-endpoints").CreateMeetingNoteResponse>;
162
1397
  /**
163
1398
  * Query meeting notes
164
1399
  */
@@ -166,58 +1401,516 @@ export default class Client {
166
1401
  };
167
1402
  };
168
1403
  readonly databases: {
169
- /**
170
- * Retrieve a database
171
- */
172
- retrieve: (args: WithAuth<GetDatabaseParameters>) => Promise<GetDatabaseResponse>;
173
- /**
174
- * Create a database
175
- */
176
- create: (args: WithAuth<CreateDatabaseParameters>) => Promise<CreateDatabaseResponse>;
177
- /**
178
- * Update a database
179
- */
180
- update: (args: WithAuth<UpdateDatabaseParameters>) => Promise<UpdateDatabaseResponse>;
1404
+ retrieve: (args: {
1405
+ database_id: import("./api-endpoints").IdRequest;
1406
+ } & {
1407
+ auth?: string;
1408
+ }) => Promise<import("./api-endpoints").GetDatabaseResponse>;
1409
+ update: (args: {
1410
+ database_id: import("./api-endpoints").IdRequest;
1411
+ } & {
1412
+ parent?: {
1413
+ type: "page_id" | "workspace";
1414
+ } & ({
1415
+ type: "page_id";
1416
+ page_id: import("./api-endpoints").IdRequest;
1417
+ } | {
1418
+ type: "workspace";
1419
+ workspace: true;
1420
+ });
1421
+ title?: Array<import("./api-endpoints").RichTextItemRequest>;
1422
+ description?: Array<import("./api-endpoints").RichTextItemRequest>;
1423
+ is_inline?: boolean;
1424
+ icon?: import("./api-endpoints").PageIconRequest;
1425
+ cover?: import("./api-endpoints").PageCoverRequest;
1426
+ in_trash?: boolean;
1427
+ archived?: boolean;
1428
+ is_locked?: boolean;
1429
+ } & {
1430
+ auth?: string;
1431
+ }) => Promise<import("./api-endpoints").UpdateDatabaseResponse>;
1432
+ create: (args: {
1433
+ parent: {
1434
+ type: "page_id" | "workspace";
1435
+ } & ({
1436
+ type: "page_id";
1437
+ page_id: import("./api-endpoints").IdRequest;
1438
+ } | {
1439
+ type: "workspace";
1440
+ workspace: true;
1441
+ });
1442
+ title?: Array<import("./api-endpoints").RichTextItemRequest>;
1443
+ description?: Array<import("./api-endpoints").RichTextItemRequest>;
1444
+ is_inline?: boolean;
1445
+ initial_data_source?: import("./api-endpoints").InitialDataSourceRequest;
1446
+ database_type?: "tasks" | "projects" | "skills";
1447
+ icon?: import("./api-endpoints").PageIconRequest;
1448
+ cover?: import("./api-endpoints").PageCoverRequest;
1449
+ } & {
1450
+ auth?: string;
1451
+ }) => Promise<import("./api-endpoints").CreateDatabaseResponse>;
181
1452
  };
182
1453
  readonly dataSources: {
183
- /**
184
- * Retrieve a data source
185
- */
186
- retrieve: (args: WithAuth<GetDataSourceParameters>) => Promise<GetDataSourceResponse>;
187
- /**
188
- * Query a data source
189
- */
190
- query: (args: WithAuth<QueryDataSourceParameters>) => Promise<QueryDataSourceResponse>;
191
- /**
192
- * Create a data source
193
- */
194
- create: (args: WithAuth<CreateDataSourceParameters>) => Promise<CreateDataSourceResponse>;
195
- /**
196
- * Update a data source
197
- */
198
- update: (args: WithAuth<UpdateDataSourceParameters>) => Promise<UpdateDataSourceResponse>;
199
- /**
200
- * List page templates that are available for a data source
201
- */
202
- listTemplates: (args: WithAuth<ListDataSourceTemplatesParameters>) => Promise<ListDataSourceTemplatesResponse>;
1454
+ retrieve: (args: {
1455
+ data_source_id: import("./api-endpoints").IdRequest;
1456
+ } & {
1457
+ auth?: string;
1458
+ }) => Promise<import("./api-endpoints").GetDataSourceResponse>;
1459
+ update: (args: {
1460
+ data_source_id: import("./api-endpoints").IdRequest;
1461
+ } & {
1462
+ title?: Array<import("./api-endpoints").RichTextItemRequest>;
1463
+ icon?: import("./api-endpoints").PageIconRequest | null;
1464
+ properties?: Record<string, ({
1465
+ name?: string;
1466
+ description?: import("./api-endpoints").PropertyDescriptionRequest | null;
1467
+ } & ({
1468
+ type?: "number";
1469
+ number: {
1470
+ format?: import("./api-endpoints").NumberFormat;
1471
+ };
1472
+ } | {
1473
+ type?: "formula";
1474
+ formula: {
1475
+ expression?: string;
1476
+ };
1477
+ } | {
1478
+ type?: "select";
1479
+ select: {
1480
+ options?: Array<{
1481
+ color?: import("./api-endpoints").SelectColor;
1482
+ description?: string | null;
1483
+ } & ({
1484
+ name: string;
1485
+ id?: string;
1486
+ } | {
1487
+ id: string;
1488
+ name?: string;
1489
+ })>;
1490
+ };
1491
+ } | {
1492
+ type?: "multi_select";
1493
+ multi_select: {
1494
+ options?: Array<{
1495
+ color?: import("./api-endpoints").SelectColor;
1496
+ description?: string | null;
1497
+ } & ({
1498
+ name: string;
1499
+ id?: string;
1500
+ } | {
1501
+ id: string;
1502
+ name?: string;
1503
+ })>;
1504
+ };
1505
+ } | {
1506
+ type?: "status";
1507
+ status: import("./api-endpoints").StatusPropertyConfigUpdateRequest;
1508
+ } | {
1509
+ type?: "relation";
1510
+ relation: {
1511
+ data_source_id: import("./api-endpoints").IdRequest;
1512
+ } & ({
1513
+ type?: "single_property";
1514
+ single_property: import("./api-endpoints").EmptyObject;
1515
+ } | {
1516
+ type?: "dual_property";
1517
+ dual_property: {
1518
+ synced_property_id?: string;
1519
+ synced_property_name?: string;
1520
+ };
1521
+ });
1522
+ } | {
1523
+ type?: "rollup";
1524
+ rollup: {
1525
+ function: import("./api-endpoints").RollupFunction;
1526
+ } & ({
1527
+ relation_property_name: string;
1528
+ rollup_property_name: string;
1529
+ } | {
1530
+ relation_property_id: string;
1531
+ rollup_property_name: string;
1532
+ } | {
1533
+ relation_property_name: string;
1534
+ rollup_property_id: string;
1535
+ } | {
1536
+ relation_property_id: string;
1537
+ rollup_property_id: string;
1538
+ });
1539
+ } | {
1540
+ type?: "unique_id";
1541
+ unique_id: {
1542
+ prefix?: string | null;
1543
+ };
1544
+ } | {
1545
+ type?: "title";
1546
+ title: import("./api-endpoints").EmptyObject;
1547
+ } | {
1548
+ type?: "rich_text";
1549
+ rich_text: import("./api-endpoints").EmptyObject;
1550
+ } | {
1551
+ type?: "url";
1552
+ url: import("./api-endpoints").EmptyObject;
1553
+ } | {
1554
+ type?: "people";
1555
+ people: import("./api-endpoints").EmptyObject;
1556
+ } | {
1557
+ type?: "files";
1558
+ files: import("./api-endpoints").EmptyObject;
1559
+ } | {
1560
+ type?: "email";
1561
+ email: import("./api-endpoints").EmptyObject;
1562
+ } | {
1563
+ type?: "phone_number";
1564
+ phone_number: import("./api-endpoints").EmptyObject;
1565
+ } | {
1566
+ type?: "date";
1567
+ date: import("./api-endpoints").EmptyObject;
1568
+ } | {
1569
+ type?: "checkbox";
1570
+ checkbox: import("./api-endpoints").EmptyObject;
1571
+ } | {
1572
+ type?: "created_by";
1573
+ created_by: import("./api-endpoints").EmptyObject;
1574
+ } | {
1575
+ type?: "created_time";
1576
+ created_time: import("./api-endpoints").EmptyObject;
1577
+ } | {
1578
+ type?: "last_edited_by";
1579
+ last_edited_by: import("./api-endpoints").EmptyObject;
1580
+ } | {
1581
+ type?: "last_edited_time";
1582
+ last_edited_time: import("./api-endpoints").EmptyObject;
1583
+ } | {
1584
+ type?: "place";
1585
+ place: import("./api-endpoints").EmptyObject;
1586
+ })) | {
1587
+ name: string;
1588
+ } | null>;
1589
+ in_trash?: boolean;
1590
+ archived?: boolean;
1591
+ parent?: import("./api-endpoints").ParentOfDataSourceRequest;
1592
+ } & {
1593
+ auth?: string;
1594
+ }) => Promise<import("./api-endpoints").UpdateDataSourceResponse>;
1595
+ query: (args: {
1596
+ data_source_id: import("./api-endpoints").IdRequest;
1597
+ } & {
1598
+ filter_properties?: Array<string>;
1599
+ } & {
1600
+ sorts?: Array<{
1601
+ property: string;
1602
+ direction: "ascending" | "descending";
1603
+ } | {
1604
+ timestamp: "created_time" | "last_edited_time";
1605
+ direction: "ascending" | "descending";
1606
+ }>;
1607
+ filter?: {
1608
+ or: import("./api-endpoints").GroupFilterOperatorArray;
1609
+ } | {
1610
+ and: import("./api-endpoints").GroupFilterOperatorArray;
1611
+ } | import("./api-endpoints").PropertyFilter | import("./api-endpoints").TimestampFilter;
1612
+ start_cursor?: string | null;
1613
+ page_size?: number;
1614
+ in_trash?: boolean;
1615
+ archived?: boolean;
1616
+ result_type?: "page" | "data_source";
1617
+ } & {
1618
+ auth?: string;
1619
+ }) => Promise<import("./api-endpoints").QueryDataSourceResponse>;
1620
+ create: (args: {
1621
+ parent: import("./api-endpoints").ParentOfDataSourceRequest;
1622
+ properties: Record<string, import("./api-endpoints").PropertyConfigurationRequest>;
1623
+ title?: Array<import("./api-endpoints").RichTextItemRequest>;
1624
+ icon?: import("./api-endpoints").PageIconRequest | null;
1625
+ } & {
1626
+ auth?: string;
1627
+ }) => Promise<import("./api-endpoints").CreateDataSourceResponse>;
1628
+ listTemplates: (args: {
1629
+ data_source_id: import("./api-endpoints").IdRequest;
1630
+ } & {
1631
+ name?: string;
1632
+ start_cursor?: string | null;
1633
+ page_size?: number;
1634
+ } & {
1635
+ auth?: string;
1636
+ }) => Promise<import("./api-endpoints").ListDataSourceTemplatesResponse>;
203
1637
  };
204
1638
  readonly pages: {
205
1639
  /**
206
1640
  * Create a page
207
1641
  */
208
- create: (args: WithAuth<CreatePageParameters>) => Promise<CreatePageResponse>;
1642
+ create: (args: {
1643
+ filter_properties?: Array<string>;
1644
+ } & {
1645
+ parent?: {
1646
+ page_id: import("./api-endpoints").IdRequest;
1647
+ type?: "page_id";
1648
+ } | {
1649
+ database_id: import("./api-endpoints").IdRequest;
1650
+ type?: "database_id";
1651
+ } | {
1652
+ data_source_id: import("./api-endpoints").IdRequest;
1653
+ type?: "data_source_id";
1654
+ } | {
1655
+ workspace: true;
1656
+ type?: "workspace";
1657
+ };
1658
+ properties?: Record<string, {
1659
+ title: Array<import("./api-endpoints").RichTextItemRequest>;
1660
+ type?: "title";
1661
+ } | {
1662
+ rich_text: Array<import("./api-endpoints").RichTextItemRequest>;
1663
+ type?: "rich_text";
1664
+ } | {
1665
+ number: number | null;
1666
+ type?: "number";
1667
+ } | {
1668
+ url: import("./api-endpoints").TextRequest | null;
1669
+ type?: "url";
1670
+ } | {
1671
+ select: {
1672
+ id: import("./api-endpoints").StringRequest;
1673
+ name?: import("./api-endpoints").TextRequest;
1674
+ color?: import("./api-endpoints").SelectColor;
1675
+ description?: import("./api-endpoints").TextRequest | null;
1676
+ } | {
1677
+ name: import("./api-endpoints").TextRequest;
1678
+ id?: import("./api-endpoints").StringRequest;
1679
+ color?: import("./api-endpoints").SelectColor;
1680
+ description?: import("./api-endpoints").TextRequest | null;
1681
+ } | null;
1682
+ type?: "select";
1683
+ } | {
1684
+ multi_select: Array<{
1685
+ id: import("./api-endpoints").StringRequest;
1686
+ name?: import("./api-endpoints").TextRequest;
1687
+ color?: import("./api-endpoints").SelectColor;
1688
+ description?: import("./api-endpoints").TextRequest | null;
1689
+ } | {
1690
+ name: import("./api-endpoints").TextRequest;
1691
+ id?: import("./api-endpoints").StringRequest;
1692
+ color?: import("./api-endpoints").SelectColor;
1693
+ description?: import("./api-endpoints").TextRequest | null;
1694
+ }>;
1695
+ type?: "multi_select";
1696
+ } | {
1697
+ people: Array<import("./api-endpoints").PartialUserObjectRequest | import("./api-endpoints").GroupObjectRequest>;
1698
+ type?: "people";
1699
+ } | {
1700
+ email: import("./api-endpoints").StringRequest | null;
1701
+ type?: "email";
1702
+ } | {
1703
+ phone_number: import("./api-endpoints").StringRequest | null;
1704
+ type?: "phone_number";
1705
+ } | {
1706
+ date: import("./api-endpoints").DateRequest | null;
1707
+ type?: "date";
1708
+ } | {
1709
+ checkbox: boolean;
1710
+ type?: "checkbox";
1711
+ } | {
1712
+ relation: Array<import("./api-endpoints").RelationItemPropertyValueResponse>;
1713
+ type?: "relation";
1714
+ } | {
1715
+ files: Array<import("./api-endpoints").InternalOrExternalFileWithNameRequest | import("./api-endpoints").FileUploadWithOptionalNameRequest>;
1716
+ type?: "files";
1717
+ } | {
1718
+ status: {
1719
+ id: import("./api-endpoints").StringRequest;
1720
+ name?: import("./api-endpoints").TextRequest;
1721
+ color?: import("./api-endpoints").SelectColor;
1722
+ description?: import("./api-endpoints").TextRequest | null;
1723
+ } | {
1724
+ name: import("./api-endpoints").TextRequest;
1725
+ id?: import("./api-endpoints").StringRequest;
1726
+ color?: import("./api-endpoints").SelectColor;
1727
+ description?: import("./api-endpoints").TextRequest | null;
1728
+ } | null;
1729
+ type?: "status";
1730
+ } | {
1731
+ place: {
1732
+ lat: number;
1733
+ lon: number;
1734
+ name?: string | null;
1735
+ address?: string | null;
1736
+ aws_place_id?: string | null;
1737
+ google_place_id?: string | null;
1738
+ } | null;
1739
+ type?: "place";
1740
+ } | {
1741
+ verification: {
1742
+ state: "verified";
1743
+ date?: import("./api-endpoints").DateRequest;
1744
+ } | {
1745
+ state: "unverified";
1746
+ };
1747
+ type?: "verification";
1748
+ }>;
1749
+ icon?: import("./api-endpoints").PageIconRequest | null;
1750
+ cover?: import("./api-endpoints").PageCoverRequest | null;
1751
+ content?: Array<import("./api-endpoints").BlockObjectRequest>;
1752
+ children?: Array<import("./api-endpoints").BlockObjectRequest>;
1753
+ markdown?: string;
1754
+ allow_async?: boolean;
1755
+ template?: {
1756
+ type: "none";
1757
+ } | {
1758
+ type: "default";
1759
+ timezone?: import("./api-endpoints").TemplateTimezone;
1760
+ } | {
1761
+ type: "template_id";
1762
+ template_id: import("./api-endpoints").IdRequest;
1763
+ timezone?: import("./api-endpoints").TemplateTimezone;
1764
+ };
1765
+ position?: import("./api-endpoints").PagePositionSchema;
1766
+ } & {
1767
+ auth?: string;
1768
+ }) => Promise<import("./api-endpoints").CreatePageResponse>;
209
1769
  /**
210
1770
  * Retrieve a page
211
1771
  */
212
- retrieve: (args: WithAuth<GetPageParameters>) => Promise<GetPageResponse>;
1772
+ retrieve: (args: {
1773
+ page_id: import("./api-endpoints").IdRequest;
1774
+ } & {
1775
+ filter_properties?: Array<string>;
1776
+ } & {
1777
+ auth?: string;
1778
+ }) => Promise<import("./api-endpoints").GetPageResponse>;
213
1779
  /**
214
1780
  * Update page properties
215
1781
  */
216
- update: (args: WithAuth<UpdatePageParameters>) => Promise<UpdatePageResponse>;
1782
+ update: (args: {
1783
+ page_id: import("./api-endpoints").IdRequest;
1784
+ } & {
1785
+ filter_properties?: Array<string>;
1786
+ } & {
1787
+ properties?: Record<string, {
1788
+ title: Array<import("./api-endpoints").RichTextItemRequest>;
1789
+ type?: "title";
1790
+ } | {
1791
+ rich_text: Array<import("./api-endpoints").RichTextItemRequest>;
1792
+ type?: "rich_text";
1793
+ } | {
1794
+ number: number | null;
1795
+ type?: "number";
1796
+ } | {
1797
+ url: import("./api-endpoints").TextRequest | null;
1798
+ type?: "url";
1799
+ } | {
1800
+ select: {
1801
+ id: import("./api-endpoints").StringRequest;
1802
+ name? /**
1803
+ * Executes the request with retry logic.
1804
+ */: import("./api-endpoints").TextRequest;
1805
+ color?: import("./api-endpoints").SelectColor;
1806
+ description?: import("./api-endpoints").TextRequest | null;
1807
+ } | {
1808
+ name: import("./api-endpoints").TextRequest;
1809
+ id?: import("./api-endpoints").StringRequest;
1810
+ color?: import("./api-endpoints").SelectColor;
1811
+ description?: import("./api-endpoints").TextRequest | null;
1812
+ } | null;
1813
+ type?: "select";
1814
+ } | {
1815
+ multi_select: Array<{
1816
+ id: import("./api-endpoints").StringRequest;
1817
+ name?: import("./api-endpoints").TextRequest;
1818
+ color?: import("./api-endpoints").SelectColor;
1819
+ description?: import("./api-endpoints").TextRequest | null;
1820
+ } | {
1821
+ name: import("./api-endpoints").TextRequest;
1822
+ id?: import("./api-endpoints").StringRequest;
1823
+ color?: import("./api-endpoints").SelectColor;
1824
+ description?: import("./api-endpoints").TextRequest | null;
1825
+ }>;
1826
+ type?: "multi_select";
1827
+ } | {
1828
+ people: Array<import("./api-endpoints").PartialUserObjectRequest | import("./api-endpoints").GroupObjectRequest>;
1829
+ type?: "people";
1830
+ } | {
1831
+ email: import("./api-endpoints").StringRequest | null;
1832
+ type?: "email";
1833
+ } | {
1834
+ phone_number: import("./api-endpoints").StringRequest | null;
1835
+ type?: "phone_number";
1836
+ } | {
1837
+ date: import("./api-endpoints").DateRequest | null;
1838
+ type?: "date";
1839
+ } | {
1840
+ checkbox: boolean;
1841
+ type?: "checkbox";
1842
+ } | {
1843
+ relation: Array<import("./api-endpoints").RelationItemPropertyValueResponse>;
1844
+ type?: "relation";
1845
+ } | {
1846
+ files: Array<import("./api-endpoints").InternalOrExternalFileWithNameRequest | import("./api-endpoints").FileUploadWithOptionalNameRequest>;
1847
+ type?: "files";
1848
+ } | {
1849
+ status: {
1850
+ id: import("./api-endpoints").StringRequest;
1851
+ name?: import("./api-endpoints").TextRequest;
1852
+ color?: import("./api-endpoints").SelectColor;
1853
+ description?: import("./api-endpoints").TextRequest | null;
1854
+ } | {
1855
+ name: import("./api-endpoints").TextRequest;
1856
+ id?: import("./api-endpoints").StringRequest;
1857
+ color?: import("./api-endpoints").SelectColor;
1858
+ description?: import("./api-endpoints").TextRequest | null;
1859
+ } | null;
1860
+ type?: "status";
1861
+ } | {
1862
+ place: {
1863
+ lat: number;
1864
+ lon: number;
1865
+ name?: string | null;
1866
+ address?: string | null;
1867
+ aws_place_id?: string | null;
1868
+ google_place_id?: string | null;
1869
+ } | null;
1870
+ type?: "place";
1871
+ } | {
1872
+ verification: {
1873
+ state: "verified";
1874
+ date?: import("./api-endpoints").DateRequest;
1875
+ } | {
1876
+ state: "unverified";
1877
+ };
1878
+ type?: "verification";
1879
+ }>;
1880
+ icon?: import("./api-endpoints").PageIconRequest | null;
1881
+ cover?: import("./api-endpoints").PageCoverRequest | null;
1882
+ is_locked?: boolean;
1883
+ template?: {
1884
+ type: "default";
1885
+ timezone?: import("./api-endpoints").TemplateTimezone;
1886
+ } | {
1887
+ type: "template_id";
1888
+ template_id: import("./api-endpoints").IdRequest;
1889
+ timezone?: import("./api-endpoints").TemplateTimezone;
1890
+ };
1891
+ erase_content?: boolean;
1892
+ in_trash?: boolean;
1893
+ archived?: boolean;
1894
+ is_archived?: boolean;
1895
+ } & {
1896
+ auth?: string;
1897
+ }) => Promise<import("./api-endpoints").UpdatePageResponse>;
217
1898
  /**
218
1899
  * Move a page
219
1900
  */
220
- move: (args: WithAuth<MovePageParameters>) => Promise<MovePageResponse>;
1901
+ move: (args: {
1902
+ page_id: import("./api-endpoints").IdRequest;
1903
+ } & {
1904
+ parent: {
1905
+ page_id: import("./api-endpoints").IdRequest;
1906
+ type?: "page_id";
1907
+ } | {
1908
+ data_source_id: import("./api-endpoints").IdRequest;
1909
+ type?: "data_source_id";
1910
+ };
1911
+ } & {
1912
+ auth?: string;
1913
+ }) => Promise<import("./api-endpoints").MovePageResponse>;
221
1914
  /**
222
1915
  * Retrieve a page as markdown
223
1916
  */
@@ -227,25 +1920,32 @@ export default class Client {
227
1920
  */
228
1921
  updateMarkdown: (args: WithAuth<UpdatePageMarkdownParameters>) => Promise<UpdatePageMarkdownResponse>;
229
1922
  properties: {
230
- /**
231
- * Retrieve page property
232
- */
233
- retrieve: (args: WithAuth<GetPagePropertyParameters>) => Promise<GetPagePropertyResponse>;
1923
+ retrieve: (args: {
1924
+ page_id: import("./api-endpoints").IdRequest;
1925
+ property_id: string;
1926
+ } & {
1927
+ start_cursor?: string | null;
1928
+ page_size?: number;
1929
+ } & {
1930
+ auth?: string;
1931
+ }) => Promise<import("./api-endpoints").GetPagePropertyResponse>;
234
1932
  };
235
1933
  };
236
1934
  readonly users: {
237
- /**
238
- * Retrieve a user
239
- */
240
- retrieve: (args: WithAuth<GetUserParameters>) => Promise<GetUserResponse>;
241
- /**
242
- * List all users
243
- */
244
- list: (args: WithAuth<ListUsersParameters>) => Promise<ListUsersResponse>;
245
- /**
246
- * Get details about bot
247
- */
248
- me: (args: WithAuth<GetSelfParameters>) => Promise<GetSelfResponse>;
1935
+ me: (args?: ({} & {
1936
+ auth?: string;
1937
+ }) | undefined) => Promise<import("./api-endpoints").UserObjectResponse>;
1938
+ retrieve: (args: {
1939
+ user_id: import("./api-endpoints").IdRequest;
1940
+ } & {
1941
+ auth?: string;
1942
+ }) => Promise<import("./api-endpoints").UserObjectResponse>;
1943
+ list: (args?: ({
1944
+ start_cursor?: string | null | undefined;
1945
+ page_size?: number | undefined;
1946
+ } & {
1947
+ auth?: string;
1948
+ }) | undefined) => Promise<import("./api-endpoints").ListUsersResponse>;
249
1949
  };
250
1950
  readonly customEmojis: {
251
1951
  /**
@@ -254,32 +1954,82 @@ export default class Client {
254
1954
  list: (args?: WithAuth<ListCustomEmojisParameters>) => Promise<ListCustomEmojisResponse>;
255
1955
  };
256
1956
  readonly comments: {
257
- /**
258
- * Create a comment
259
- */
260
- create: (args: WithAuth<CreateCommentParameters>) => Promise<CreateCommentResponse>;
261
- /**
262
- * List comments
263
- */
264
- list: (args: WithAuth<ListCommentsParameters>) => Promise<ListCommentsResponse>;
265
- /**
266
- * Retrieve a comment
267
- */
268
- retrieve: (args: WithAuth<GetCommentParameters>) => Promise<GetCommentResponse>;
269
- /**
270
- * Update a comment
271
- */
272
- update: (args: WithAuth<UpdateCommentParameters>) => Promise<UpdateCommentResponse>;
273
- /**
274
- * Delete a comment
275
- */
276
- delete: (args: WithAuth<DeleteCommentParameters>) => Promise<DeleteCommentResponse>;
1957
+ create: (args: ({
1958
+ attachments?: Array<{
1959
+ file_upload_id: string;
1960
+ type?: "file_upload";
1961
+ }>;
1962
+ display_name?: {
1963
+ type: "integration";
1964
+ } | {
1965
+ type: "user";
1966
+ } | {
1967
+ type: "custom";
1968
+ custom: {
1969
+ name: string;
1970
+ };
1971
+ };
1972
+ } & ({
1973
+ parent: {
1974
+ page_id: import("./api-endpoints").IdRequest;
1975
+ type?: "page_id";
1976
+ } | {
1977
+ block_id: import("./api-endpoints").IdRequest;
1978
+ type?: "block_id";
1979
+ };
1980
+ rich_text: Array<import("./api-endpoints").RichTextItemRequest>;
1981
+ } | {
1982
+ parent: {
1983
+ page_id: import("./api-endpoints").IdRequest;
1984
+ type?: "page_id";
1985
+ } | {
1986
+ block_id: import("./api-endpoints").IdRequest;
1987
+ type?: "block_id";
1988
+ };
1989
+ markdown: string;
1990
+ } | {
1991
+ discussion_id: import("./api-endpoints").IdRequest;
1992
+ rich_text: Array<import("./api-endpoints").RichTextItemRequest>;
1993
+ } | {
1994
+ discussion_id: import("./api-endpoints").IdRequest;
1995
+ markdown: string;
1996
+ })) & {
1997
+ auth?: string;
1998
+ }) => Promise<import("./api-endpoints").CreateCommentResponse>;
1999
+ list: (args: {
2000
+ block_id: import("./api-endpoints").IdRequest;
2001
+ start_cursor?: string | null;
2002
+ page_size?: number;
2003
+ } & {
2004
+ auth?: string;
2005
+ }) => Promise<import("./api-endpoints").ListCommentsResponse>;
2006
+ retrieve: (args: {
2007
+ comment_id: import("./api-endpoints").IdRequest;
2008
+ } & {
2009
+ auth?: string;
2010
+ }) => Promise<import("./api-endpoints").GetCommentResponse>;
2011
+ update: (args: import("./api-endpoints").UpdateCommentParameters & {
2012
+ auth?: string;
2013
+ }) => Promise<import("./api-endpoints").UpdateCommentResponse>;
2014
+ delete: (args: {
2015
+ comment_id: import("./api-endpoints").IdRequest;
2016
+ } & {
2017
+ auth?: string;
2018
+ }) => Promise<import("./api-endpoints").DeleteCommentResponse>;
277
2019
  };
278
2020
  readonly fileUploads: {
279
2021
  /**
280
2022
  * Create a file upload
281
2023
  */
282
- create: (args: WithAuth<CreateFileUploadParameters>) => Promise<CreateFileUploadResponse>;
2024
+ create: (args?: ({
2025
+ mode?: "single_part" | "multi_part" | "external_url" | undefined;
2026
+ filename?: string | undefined;
2027
+ content_type?: string | undefined;
2028
+ number_of_parts?: number | undefined;
2029
+ external_url?: string | undefined;
2030
+ } & {
2031
+ auth?: string;
2032
+ }) | undefined) => Promise<import("./api-endpoints").FileUploadObjectResponse>;
283
2033
  /**
284
2034
  * Retrieve a file upload
285
2035
  */
@@ -316,7 +2066,11 @@ export default class Client {
316
2066
  /**
317
2067
  * Retrieve a view
318
2068
  */
319
- retrieve: (args: WithAuth<GetViewParameters>) => Promise<GetViewResponse>;
2069
+ retrieve: (args: {
2070
+ view_id: import("./api-endpoints").IdRequest;
2071
+ } & {
2072
+ auth?: string;
2073
+ }) => Promise<import("./api-endpoints").GetViewResponse>;
320
2074
  /**
321
2075
  * Update a view
322
2076
  */
@@ -324,11 +2078,22 @@ export default class Client {
324
2078
  /**
325
2079
  * Delete a view
326
2080
  */
327
- delete: (args: WithAuth<DeleteViewParameters>) => Promise<DeleteViewResponse>;
2081
+ delete: (args: {
2082
+ view_id: import("./api-endpoints").IdRequest;
2083
+ } & {
2084
+ auth?: string;
2085
+ }) => Promise<import("./api-endpoints").PartialDataSourceViewObjectResponse>;
328
2086
  /**
329
2087
  * List views for a database
330
2088
  */
331
- list: (args: WithAuth<ListDatabaseViewsParameters>) => Promise<ListDatabaseViewsResponse>;
2089
+ list: (args?: ({
2090
+ database_id?: import("./api-endpoints").IdRequest | undefined;
2091
+ data_source_id?: import("./api-endpoints").IdRequest | undefined;
2092
+ start_cursor?: string | null | undefined;
2093
+ page_size?: number | undefined;
2094
+ } & {
2095
+ auth?: string;
2096
+ }) | undefined) => Promise<import("./api-endpoints").ListDatabaseViewsResponse>;
332
2097
  queries: {
333
2098
  /**
334
2099
  * Create a view query
@@ -337,17 +2102,49 @@ export default class Client {
337
2102
  /**
338
2103
  * Get view query results
339
2104
  */
340
- results: (args: WithAuth<GetViewQueryResultsParameters>) => Promise<GetViewQueryResultsResponse>;
2105
+ results: (args: {
2106
+ view_id: import("./api-endpoints").IdRequest;
2107
+ query_id: import("./api-endpoints").IdRequest;
2108
+ } & {
2109
+ start_cursor?: string | null;
2110
+ page_size?: number;
2111
+ } & {
2112
+ auth?: string;
2113
+ }) => Promise<import("./api-endpoints").GetViewQueryResultsResponse>;
341
2114
  /**
342
2115
  * Delete a view query
343
2116
  */
344
- delete: (args: WithAuth<DeleteViewQueryParameters>) => Promise<DeleteViewQueryResponse>;
2117
+ delete: (args: {
2118
+ view_id: import("./api-endpoints").IdRequest;
2119
+ query_id: import("./api-endpoints").IdRequest;
2120
+ } & {
2121
+ auth?: string;
2122
+ }) => Promise<import("./api-endpoints").DeletedViewQueryResponse>;
345
2123
  };
346
2124
  };
347
2125
  /**
348
2126
  * Search
349
2127
  */
350
- search: (args: WithAuth<SearchParameters>) => Promise<SearchResponse>;
2128
+ search: (args?: ({
2129
+ sort?: {
2130
+ timestamp: "last_edited_time";
2131
+ direction: "ascending" | "descending";
2132
+ } | {
2133
+ property: "relevance";
2134
+ } | undefined;
2135
+ query?: string | undefined;
2136
+ start_cursor?: string | null | undefined;
2137
+ page_size?: number | undefined;
2138
+ filter?: {
2139
+ property: "object";
2140
+ value: "page" | "data_source";
2141
+ in_trash?: boolean;
2142
+ } | {
2143
+ in_trash: boolean;
2144
+ } | undefined;
2145
+ } & {
2146
+ auth?: string;
2147
+ }) | undefined) => Promise<import("./api-endpoints").SearchResponse>;
351
2148
  readonly oauth: {
352
2149
  /**
353
2150
  * Get token
@@ -385,6 +2182,14 @@ export default class Client {
385
2182
  * @param args Arguments to send to the console
386
2183
  */
387
2184
  private log;
2185
+ /**
2186
+ * Blocks a token or client secret inside a browser unless the caller opted
2187
+ * in. Covers both the constructor `auth` and per-request `auth`, since a
2188
+ * page that asks the visitor to type a token usually uses the latter. A
2189
+ * client without a token stays usable, for example behind a proxy that
2190
+ * adds the token on a server.
2191
+ */
2192
+ private assertTokenAllowedHere;
388
2193
  /**
389
2194
  * Transforms an API key or access token into a headers object suitable for an HTTP request.
390
2195
  *