@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
@@ -0,0 +1,920 @@
1
+ import type Client from "./Client";
2
+ import * as endpoints from "./api-endpoints";
3
+ import { type EndpointDefinition } from "./utils";
4
+ type WithoutIndexSignatures<P> = P extends unknown ? {
5
+ [K in keyof P as string extends K ? never : number extends K ? never : K]: P[K];
6
+ } : never;
7
+ type WithAuth<P> = P & {
8
+ auth?: string;
9
+ };
10
+ type OptionalWithAuth<P> = WithoutIndexSignatures<P> & {
11
+ auth?: string;
12
+ };
13
+ type EndpointClient = Pick<Client, "request"> & {
14
+ warnUnknownParams(args: Record<string, unknown>, endpoint: EndpointDefinition): void;
15
+ };
16
+ export declare function createEndpointMethods(client: EndpointClient): {
17
+ users: {
18
+ /** Retrieve your token's bot user */
19
+ me: (args?: OptionalWithAuth<endpoints.GetSelfParameters> | undefined) => Promise<endpoints.UserObjectResponse>;
20
+ /** Retrieve a user */
21
+ retrieve: (args: WithAuth<{
22
+ user_id: endpoints.IdRequest;
23
+ }>) => Promise<endpoints.UserObjectResponse>;
24
+ /** List all users */
25
+ list: (args?: OptionalWithAuth<{
26
+ start_cursor?: string | null;
27
+ page_size?: number;
28
+ }> | undefined) => Promise<endpoints.ListUsersResponse>;
29
+ };
30
+ pages: {
31
+ /** Create a page */
32
+ create: (args: WithAuth<endpoints.CreatePageParameters>) => Promise<endpoints.CreatePageResponse>;
33
+ /** Retrieve a page */
34
+ retrieve: (args: WithAuth<endpoints.GetPageParameters>) => Promise<endpoints.GetPageResponse>;
35
+ /** Update page */
36
+ update: (args: WithAuth<endpoints.UpdatePageParameters>) => Promise<endpoints.UpdatePageResponse>;
37
+ /** Move a page */
38
+ move: (args: WithAuth<endpoints.MovePageParameters>) => Promise<endpoints.MovePageResponse>;
39
+ properties: {
40
+ /** Retrieve a page property item */
41
+ retrieve: (args: WithAuth<endpoints.GetPagePropertyParameters>) => Promise<endpoints.GetPagePropertyResponse>;
42
+ };
43
+ };
44
+ asyncTasks: {
45
+ /** Retrieve an async task */
46
+ retrieve: (args: WithAuth<{
47
+ task_id: string;
48
+ }>) => Promise<endpoints.GetAsyncTaskResponse>;
49
+ };
50
+ blocks: {
51
+ /** Retrieve a block */
52
+ retrieve: (args: WithAuth<{
53
+ block_id: endpoints.IdRequest;
54
+ }>) => Promise<endpoints.GetBlockResponse>;
55
+ /** Update a block */
56
+ update: (args: WithAuth<endpoints.UpdateBlockParameters>) => Promise<endpoints.UpdateBlockResponse>;
57
+ /** Delete a block */
58
+ delete: (args: WithAuth<{
59
+ block_id: endpoints.IdRequest;
60
+ }>) => Promise<endpoints.DeleteBlockResponse>;
61
+ children: {
62
+ /** Retrieve block children */
63
+ list: (args: WithAuth<endpoints.ListBlockChildrenParameters>) => Promise<endpoints.ListBlockChildrenResponse>;
64
+ /** Append block children */
65
+ append: (args: WithAuth<endpoints.AppendBlockChildrenParameters>) => Promise<endpoints.AppendBlockChildrenResponse>;
66
+ };
67
+ meetingNotes: {
68
+ /** Create a meeting note */
69
+ create: (args: WithAuth<{
70
+ title?: string;
71
+ 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";
72
+ options?: {
73
+ kickoff_summary?: boolean;
74
+ };
75
+ } & ({
76
+ source: {
77
+ type: "file_upload";
78
+ file_upload_id: endpoints.IdRequest;
79
+ };
80
+ parent: {
81
+ type: "page_id";
82
+ page_id: endpoints.IdRequest;
83
+ };
84
+ } | {
85
+ source: {
86
+ type: "block";
87
+ block_id: endpoints.IdRequest;
88
+ };
89
+ parent?: never;
90
+ })>) => Promise<endpoints.CreateMeetingNoteResponse>;
91
+ };
92
+ };
93
+ dataSources: {
94
+ /** Retrieve a data source */
95
+ retrieve: (args: WithAuth<{
96
+ data_source_id: endpoints.IdRequest;
97
+ }>) => Promise<endpoints.GetDataSourceResponse>;
98
+ /** Update a data source */
99
+ update: (args: WithAuth<endpoints.UpdateDataSourceParameters>) => Promise<endpoints.UpdateDataSourceResponse>;
100
+ /** Query a data source */
101
+ query: (args: WithAuth<endpoints.QueryDataSourceParameters>) => Promise<endpoints.QueryDataSourceResponse>;
102
+ /** Create a data source */
103
+ create: (args: WithAuth<{
104
+ parent: endpoints.ParentOfDataSourceRequest;
105
+ properties: Record<string, endpoints.PropertyConfigurationRequest>;
106
+ title?: Array<endpoints.RichTextItemRequest>;
107
+ icon?: endpoints.PageIconRequest | null;
108
+ }>) => Promise<endpoints.CreateDataSourceResponse>;
109
+ /** List templates in a data source */
110
+ listTemplates: (args: WithAuth<endpoints.ListDataSourceTemplatesParameters>) => Promise<endpoints.ListDataSourceTemplatesResponse>;
111
+ };
112
+ databases: {
113
+ /** Retrieve a database */
114
+ retrieve: (args: WithAuth<{
115
+ database_id: endpoints.IdRequest;
116
+ }>) => Promise<endpoints.GetDatabaseResponse>;
117
+ /** Update a database */
118
+ update: (args: WithAuth<endpoints.UpdateDatabaseParameters>) => Promise<endpoints.UpdateDatabaseResponse>;
119
+ /** Create a database */
120
+ create: (args: WithAuth<{
121
+ parent: {
122
+ type: "page_id" | "workspace";
123
+ } & ({
124
+ type: "page_id";
125
+ page_id: endpoints.IdRequest;
126
+ } | {
127
+ type: "workspace";
128
+ workspace: true;
129
+ });
130
+ title?: Array<endpoints.RichTextItemRequest>;
131
+ description?: Array<endpoints.RichTextItemRequest>;
132
+ is_inline?: boolean;
133
+ initial_data_source?: endpoints.InitialDataSourceRequest;
134
+ database_type?: "tasks" | "projects" | "skills";
135
+ icon?: endpoints.PageIconRequest;
136
+ cover?: endpoints.PageCoverRequest;
137
+ }>) => Promise<endpoints.CreateDatabaseResponse>;
138
+ };
139
+ /** Search by title */
140
+ search: (args?: OptionalWithAuth<{
141
+ sort?: {
142
+ timestamp: "last_edited_time";
143
+ direction: "ascending" | "descending";
144
+ } | {
145
+ property: "relevance";
146
+ };
147
+ query?: string;
148
+ start_cursor?: string | null;
149
+ page_size?: number;
150
+ filter?: {
151
+ property: "object";
152
+ value: "page" | "data_source";
153
+ in_trash?: boolean;
154
+ } | {
155
+ in_trash: boolean;
156
+ };
157
+ }> | undefined) => Promise<endpoints.SearchResponse>;
158
+ comments: {
159
+ /** Create a comment */
160
+ create: (args: WithAuth<{
161
+ attachments?: Array<{
162
+ file_upload_id: string;
163
+ type?: "file_upload";
164
+ }>;
165
+ display_name?: {
166
+ type: "integration";
167
+ } | {
168
+ type: "user";
169
+ } | {
170
+ type: "custom";
171
+ custom: {
172
+ name: string;
173
+ };
174
+ };
175
+ } & ({
176
+ parent: {
177
+ page_id: endpoints.IdRequest;
178
+ type?: "page_id";
179
+ } | {
180
+ block_id: endpoints.IdRequest;
181
+ type?: "block_id";
182
+ };
183
+ rich_text: Array<endpoints.RichTextItemRequest>;
184
+ } | {
185
+ parent: {
186
+ page_id: endpoints.IdRequest;
187
+ type?: "page_id";
188
+ } | {
189
+ block_id: endpoints.IdRequest;
190
+ type?: "block_id";
191
+ };
192
+ markdown: string;
193
+ } | {
194
+ discussion_id: endpoints.IdRequest;
195
+ rich_text: Array<endpoints.RichTextItemRequest>;
196
+ } | {
197
+ discussion_id: endpoints.IdRequest;
198
+ markdown: string;
199
+ })>) => Promise<endpoints.CreateCommentResponse>;
200
+ /** List comments */
201
+ list: (args: WithAuth<{
202
+ block_id: endpoints.IdRequest;
203
+ start_cursor?: string | null;
204
+ page_size?: number;
205
+ }>) => Promise<endpoints.ListCommentsResponse>;
206
+ /** Retrieve a comment */
207
+ retrieve: (args: WithAuth<{
208
+ comment_id: endpoints.IdRequest;
209
+ }>) => Promise<endpoints.GetCommentResponse>;
210
+ /** Update a comment */
211
+ update: (args: WithAuth<endpoints.UpdateCommentParameters>) => Promise<endpoints.UpdateCommentResponse>;
212
+ /** Delete a comment */
213
+ delete: (args: WithAuth<{
214
+ comment_id: endpoints.IdRequest;
215
+ }>) => Promise<endpoints.DeleteCommentResponse>;
216
+ };
217
+ fileUploads: {
218
+ /** Create a file upload */
219
+ create: (args?: OptionalWithAuth<{
220
+ mode?: "single_part" | "multi_part" | "external_url";
221
+ filename?: string;
222
+ content_type?: string;
223
+ number_of_parts?: number;
224
+ external_url?: string;
225
+ }> | undefined) => Promise<endpoints.FileUploadObjectResponse>;
226
+ };
227
+ views: {
228
+ /** List views */
229
+ list: (args?: OptionalWithAuth<{
230
+ database_id?: endpoints.IdRequest;
231
+ data_source_id?: endpoints.IdRequest;
232
+ start_cursor?: string | null;
233
+ page_size?: number;
234
+ }> | undefined) => Promise<endpoints.ListDatabaseViewsResponse>;
235
+ /** Retrieve a view */
236
+ retrieve: (args: WithAuth<{
237
+ view_id: endpoints.IdRequest;
238
+ }>) => Promise<endpoints.GetViewResponse>;
239
+ /** Delete a view */
240
+ delete: (args: WithAuth<{
241
+ view_id: endpoints.IdRequest;
242
+ }>) => Promise<endpoints.PartialDataSourceViewObjectResponse>;
243
+ queries: {
244
+ /** Get view query results */
245
+ results: (args: WithAuth<endpoints.GetViewQueryResultsParameters>) => Promise<endpoints.GetViewQueryResultsResponse>;
246
+ /** Delete a view query */
247
+ delete: (args: WithAuth<{
248
+ view_id: endpoints.IdRequest;
249
+ query_id: endpoints.IdRequest;
250
+ }>) => Promise<endpoints.DeletedViewQueryResponse>;
251
+ };
252
+ };
253
+ agents: {
254
+ /** Query agents */
255
+ query: (args?: OptionalWithAuth<{
256
+ query?: string;
257
+ filter?: {
258
+ property: "id";
259
+ id: {
260
+ equals: string;
261
+ };
262
+ } | {
263
+ property: "agent_type";
264
+ string: {
265
+ equals: "notion_ai" | "custom_agent" | "autofill_custom_agent";
266
+ };
267
+ } | {
268
+ property: "created_by";
269
+ people: {
270
+ contains: string;
271
+ };
272
+ } | {
273
+ property: "created_time";
274
+ date: {
275
+ after?: string;
276
+ before?: string;
277
+ };
278
+ } | {
279
+ property: "favorited";
280
+ checkbox: {
281
+ equals: boolean;
282
+ };
283
+ } | {
284
+ property: "connections";
285
+ mcp_server: {
286
+ contains: string;
287
+ };
288
+ } | {
289
+ property: "status";
290
+ status: {
291
+ in: Array<"active" | "disabled" | "deleted">;
292
+ };
293
+ } | {
294
+ property: "model_mode";
295
+ select: {
296
+ equals: "auto" | "pinned";
297
+ };
298
+ } | {
299
+ property: "agent_version";
300
+ number: {
301
+ equals: number;
302
+ };
303
+ } | {
304
+ property: "last_run_at";
305
+ date: {
306
+ after?: string;
307
+ before?: string;
308
+ };
309
+ } | {
310
+ and: Array<{
311
+ property: "id";
312
+ id: {
313
+ equals: string;
314
+ };
315
+ } | {
316
+ property: "agent_type";
317
+ string: {
318
+ equals: "notion_ai" | "custom_agent" | "autofill_custom_agent";
319
+ };
320
+ } | {
321
+ property: "created_by";
322
+ people: {
323
+ contains: string;
324
+ };
325
+ } | {
326
+ property: "created_time";
327
+ date: {
328
+ after?: string;
329
+ before?: string;
330
+ };
331
+ } | {
332
+ property: "favorited";
333
+ checkbox: {
334
+ equals: boolean;
335
+ };
336
+ } | {
337
+ property: "connections";
338
+ mcp_server: {
339
+ contains: string;
340
+ };
341
+ } | {
342
+ property: "status";
343
+ status: {
344
+ in: Array<"active" | "disabled" | "deleted">;
345
+ };
346
+ } | {
347
+ property: "model_mode";
348
+ select: {
349
+ equals: "auto" | "pinned";
350
+ };
351
+ } | {
352
+ property: "agent_version";
353
+ number: {
354
+ equals: number;
355
+ };
356
+ } | {
357
+ property: "last_run_at";
358
+ date: {
359
+ after?: string;
360
+ before?: string;
361
+ };
362
+ } | {
363
+ and: Array<{
364
+ property: "id";
365
+ id: {
366
+ equals: string;
367
+ };
368
+ } | {
369
+ property: "agent_type";
370
+ string: {
371
+ equals: "notion_ai" | "custom_agent" | "autofill_custom_agent";
372
+ };
373
+ } | {
374
+ property: "created_by";
375
+ people: {
376
+ contains: string;
377
+ };
378
+ } | {
379
+ property: "created_time";
380
+ date: {
381
+ after?: string;
382
+ before?: string;
383
+ };
384
+ } | {
385
+ property: "favorited";
386
+ checkbox: {
387
+ equals: boolean;
388
+ };
389
+ } | {
390
+ property: "connections";
391
+ mcp_server: {
392
+ contains: string;
393
+ };
394
+ } | {
395
+ property: "status";
396
+ status: {
397
+ in: Array<"active" | "disabled" | "deleted">;
398
+ };
399
+ } | {
400
+ property: "model_mode";
401
+ select: {
402
+ equals: "auto" | "pinned";
403
+ };
404
+ } | {
405
+ property: "agent_version";
406
+ number: {
407
+ equals: number;
408
+ };
409
+ } | {
410
+ property: "last_run_at";
411
+ date: {
412
+ after?: string;
413
+ before?: string;
414
+ };
415
+ }>;
416
+ } | {
417
+ or: Array<{
418
+ property: "id";
419
+ id: {
420
+ equals: string;
421
+ };
422
+ } | {
423
+ property: "agent_type";
424
+ string: {
425
+ equals: "notion_ai" | "custom_agent" | "autofill_custom_agent";
426
+ };
427
+ } | {
428
+ property: "created_by";
429
+ people: {
430
+ contains: string;
431
+ };
432
+ } | {
433
+ property: "created_time";
434
+ date: {
435
+ after?: string;
436
+ before?: string;
437
+ };
438
+ } | {
439
+ property: "favorited";
440
+ checkbox: {
441
+ equals: boolean;
442
+ };
443
+ } | {
444
+ property: "connections";
445
+ mcp_server: {
446
+ contains: string;
447
+ };
448
+ } | {
449
+ property: "status";
450
+ status: {
451
+ in: Array<"active" | "disabled" | "deleted">;
452
+ };
453
+ } | {
454
+ property: "model_mode";
455
+ select: {
456
+ equals: "auto" | "pinned";
457
+ };
458
+ } | {
459
+ property: "agent_version";
460
+ number: {
461
+ equals: number;
462
+ };
463
+ } | {
464
+ property: "last_run_at";
465
+ date: {
466
+ after?: string;
467
+ before?: string;
468
+ };
469
+ }>;
470
+ }>;
471
+ } | {
472
+ or: Array<{
473
+ property: "id";
474
+ id: {
475
+ equals: string;
476
+ };
477
+ } | {
478
+ property: "agent_type";
479
+ string: {
480
+ equals: "notion_ai" | "custom_agent" | "autofill_custom_agent";
481
+ };
482
+ } | {
483
+ property: "created_by";
484
+ people: {
485
+ contains: string;
486
+ };
487
+ } | {
488
+ property: "created_time";
489
+ date: {
490
+ after?: string;
491
+ before?: string;
492
+ };
493
+ } | {
494
+ property: "favorited";
495
+ checkbox: {
496
+ equals: boolean;
497
+ };
498
+ } | {
499
+ property: "connections";
500
+ mcp_server: {
501
+ contains: string;
502
+ };
503
+ } | {
504
+ property: "status";
505
+ status: {
506
+ in: Array<"active" | "disabled" | "deleted">;
507
+ };
508
+ } | {
509
+ property: "model_mode";
510
+ select: {
511
+ equals: "auto" | "pinned";
512
+ };
513
+ } | {
514
+ property: "agent_version";
515
+ number: {
516
+ equals: number;
517
+ };
518
+ } | {
519
+ property: "last_run_at";
520
+ date: {
521
+ after?: string;
522
+ before?: string;
523
+ };
524
+ } | {
525
+ and: Array<{
526
+ property: "id";
527
+ id: {
528
+ equals: string;
529
+ };
530
+ } | {
531
+ property: "agent_type";
532
+ string: {
533
+ equals: "notion_ai" | "custom_agent" | "autofill_custom_agent";
534
+ };
535
+ } | {
536
+ property: "created_by";
537
+ people: {
538
+ contains: string;
539
+ };
540
+ } | {
541
+ property: "created_time";
542
+ date: {
543
+ after?: string;
544
+ before?: string;
545
+ };
546
+ } | {
547
+ property: "favorited";
548
+ checkbox: {
549
+ equals: boolean;
550
+ };
551
+ } | {
552
+ property: "connections";
553
+ mcp_server: {
554
+ contains: string;
555
+ };
556
+ } | {
557
+ property: "status";
558
+ status: {
559
+ in: Array<"active" | "disabled" | "deleted">;
560
+ };
561
+ } | {
562
+ property: "model_mode";
563
+ select: {
564
+ equals: "auto" | "pinned";
565
+ };
566
+ } | {
567
+ property: "agent_version";
568
+ number: {
569
+ equals: number;
570
+ };
571
+ } | {
572
+ property: "last_run_at";
573
+ date: {
574
+ after?: string;
575
+ before?: string;
576
+ };
577
+ }>;
578
+ } | {
579
+ or: Array<{
580
+ property: "id";
581
+ id: {
582
+ equals: string;
583
+ };
584
+ } | {
585
+ property: "agent_type";
586
+ string: {
587
+ equals: "notion_ai" | "custom_agent" | "autofill_custom_agent";
588
+ };
589
+ } | {
590
+ property: "created_by";
591
+ people: {
592
+ contains: string;
593
+ };
594
+ } | {
595
+ property: "created_time";
596
+ date: {
597
+ after?: string;
598
+ before?: string;
599
+ };
600
+ } | {
601
+ property: "favorited";
602
+ checkbox: {
603
+ equals: boolean;
604
+ };
605
+ } | {
606
+ property: "connections";
607
+ mcp_server: {
608
+ contains: string;
609
+ };
610
+ } | {
611
+ property: "status";
612
+ status: {
613
+ in: Array<"active" | "disabled" | "deleted">;
614
+ };
615
+ } | {
616
+ property: "model_mode";
617
+ select: {
618
+ equals: "auto" | "pinned";
619
+ };
620
+ } | {
621
+ property: "agent_version";
622
+ number: {
623
+ equals: number;
624
+ };
625
+ } | {
626
+ property: "last_run_at";
627
+ date: {
628
+ after?: string;
629
+ before?: string;
630
+ };
631
+ }>;
632
+ }>;
633
+ };
634
+ sorts?: Array<{
635
+ property: "created_time" | "last_run_at";
636
+ direction: "ascending" | "descending";
637
+ }>;
638
+ start_cursor?: string | null;
639
+ page_size?: number;
640
+ verbose?: boolean;
641
+ include_deleted?: boolean;
642
+ }> | undefined) => Promise<endpoints.QueryAgentsResponse>;
643
+ /** Get agent */
644
+ retrieve: (args: WithAuth<endpoints.GetAgentParameters>) => Promise<endpoints.GetAgentResponse>;
645
+ /** Delete agent */
646
+ delete: (args: WithAuth<{
647
+ agent_id: endpoints.IdRequest | "notion_ai" | "33333333-3333-3333-3333-333333333333";
648
+ }>) => Promise<endpoints.DeleteAgentResponse>;
649
+ /** Get agent insights */
650
+ retrieveInsights: (args: WithAuth<endpoints.GetInsightsParameters>) => Promise<endpoints.GetInsightsResponse>;
651
+ /** Update agent status */
652
+ updateStatus: (args: WithAuth<endpoints.UpdateAgentStatusParameters>) => Promise<endpoints.UpdateAgentStatusResponse>;
653
+ /** Update agent credit limit */
654
+ updateCreditLimit: (args: WithAuth<endpoints.UpdateAgentCreditLimitParameters>) => Promise<endpoints.UpdateAgentCreditLimitResponse>;
655
+ /** Apply many agent operations */
656
+ batch: (args: WithAuth<{
657
+ operations: Array<{
658
+ action: "update_status";
659
+ agent_id: endpoints.IdRequest | "notion_ai" | "33333333-3333-3333-3333-333333333333";
660
+ fields: {
661
+ status: "active" | "disabled";
662
+ };
663
+ } | {
664
+ action: "update_credit_limit";
665
+ agent_id: endpoints.IdRequest | "notion_ai" | "33333333-3333-3333-3333-333333333333";
666
+ fields: {
667
+ credit_limit: number | null;
668
+ };
669
+ } | {
670
+ action: "delete";
671
+ agent_id: endpoints.IdRequest | "notion_ai" | "33333333-3333-3333-3333-333333333333";
672
+ }>;
673
+ }>) => Promise<endpoints.AgentBatchResponse>;
674
+ };
675
+ plugins: {
676
+ /** List skills plugins */
677
+ list: (args?: OptionalWithAuth<{
678
+ page_size?: number;
679
+ start_cursor?: string | null;
680
+ }> | undefined) => Promise<endpoints.ListSkillsPluginsResponse>;
681
+ /** Get a plugin directory */
682
+ retrieve: (args: WithAuth<{
683
+ id: string;
684
+ }>) => Promise<endpoints.GetPluginDirectoryResponse>;
685
+ };
686
+ skills: {
687
+ /** Get a skill directory */
688
+ retrieve: (args: WithAuth<{
689
+ id: endpoints.IdRequest;
690
+ }>) => Promise<endpoints.GetSkillDirectoryResponse>;
691
+ };
692
+ sessions: {
693
+ /** Update a session */
694
+ update: (args: WithAuth<{
695
+ message: string;
696
+ agent_id?: endpoints.IdRequest | "notion_ai" | "33333333-3333-3333-3333-333333333333";
697
+ session_id?: endpoints.IdRequest;
698
+ attachments?: Array<{
699
+ file_upload: {
700
+ id: string;
701
+ };
702
+ type?: "file_upload";
703
+ name?: string;
704
+ }>;
705
+ metadata?: Record<string, string>;
706
+ prompt_context?: string;
707
+ } | {
708
+ session_id: endpoints.IdRequest;
709
+ actions: Array<{
710
+ action_id: endpoints.IdRequest;
711
+ option_id: "approve" | "reject";
712
+ }>;
713
+ metadata?: Record<string, string>;
714
+ } | {
715
+ session_id: endpoints.IdRequest;
716
+ continue_from: string;
717
+ }>) => Promise<endpoints.UpdateSessionResponse>;
718
+ /** Retrieve a session */
719
+ retrieve: (args: WithAuth<{
720
+ session_id: endpoints.IdRequest;
721
+ }>) => Promise<endpoints.RetrieveSessionResponse>;
722
+ /** Query sessions */
723
+ query: (args?: OptionalWithAuth<{
724
+ query?: string;
725
+ filter?: {
726
+ property: "id";
727
+ string: {
728
+ equals: string;
729
+ };
730
+ } | {
731
+ property: "agent_id";
732
+ string: {
733
+ equals: string;
734
+ };
735
+ } | {
736
+ property: "status";
737
+ status: {
738
+ equals?: "queued" | "in_progress" | "requires_action" | "completed" | "failed" | "canceled" | "terminated";
739
+ in?: Array<"queued" | "in_progress" | "requires_action" | "completed" | "failed" | "canceled" | "terminated">;
740
+ };
741
+ } | {
742
+ property: "created_at" | "updated_at";
743
+ timestamp: {
744
+ before?: string;
745
+ after?: string;
746
+ on_or_before?: string;
747
+ on_or_after?: string;
748
+ };
749
+ } | {
750
+ and: Array<{
751
+ property: "id";
752
+ string: {
753
+ equals: string;
754
+ };
755
+ } | {
756
+ property: "agent_id";
757
+ string: {
758
+ equals: string;
759
+ };
760
+ } | {
761
+ property: "status";
762
+ status: {
763
+ equals?: "queued" | "in_progress" | "requires_action" | "completed" | "failed" | "canceled" | "terminated";
764
+ in?: Array<"queued" | "in_progress" | "requires_action" | "completed" | "failed" | "canceled" | "terminated">;
765
+ };
766
+ } | {
767
+ property: "created_at" | "updated_at";
768
+ timestamp: {
769
+ before?: string;
770
+ after?: string;
771
+ on_or_before?: string;
772
+ on_or_after?: string;
773
+ };
774
+ } | {
775
+ and: Array<{
776
+ property: "id";
777
+ string: {
778
+ equals: string;
779
+ };
780
+ } | {
781
+ property: "agent_id";
782
+ string: {
783
+ equals: string;
784
+ };
785
+ } | {
786
+ property: "status";
787
+ status: {
788
+ equals?: "queued" | "in_progress" | "requires_action" | "completed" | "failed" | "canceled" | "terminated";
789
+ in?: Array<"queued" | "in_progress" | "requires_action" | "completed" | "failed" | "canceled" | "terminated">;
790
+ };
791
+ } | {
792
+ property: "created_at" | "updated_at";
793
+ timestamp: {
794
+ before?: string;
795
+ after?: string;
796
+ on_or_before?: string;
797
+ on_or_after?: string;
798
+ };
799
+ }>;
800
+ } | {
801
+ or: Array<{
802
+ property: "id";
803
+ string: {
804
+ equals: string;
805
+ };
806
+ } | {
807
+ property: "agent_id";
808
+ string: {
809
+ equals: string;
810
+ };
811
+ } | {
812
+ property: "status";
813
+ status: {
814
+ equals?: "queued" | "in_progress" | "requires_action" | "completed" | "failed" | "canceled" | "terminated";
815
+ in?: Array<"queued" | "in_progress" | "requires_action" | "completed" | "failed" | "canceled" | "terminated">;
816
+ };
817
+ } | {
818
+ property: "created_at" | "updated_at";
819
+ timestamp: {
820
+ before?: string;
821
+ after?: string;
822
+ on_or_before?: string;
823
+ on_or_after?: string;
824
+ };
825
+ }>;
826
+ }>;
827
+ } | {
828
+ or: Array<{
829
+ property: "id";
830
+ string: {
831
+ equals: string;
832
+ };
833
+ } | {
834
+ property: "agent_id";
835
+ string: {
836
+ equals: string;
837
+ };
838
+ } | {
839
+ property: "status";
840
+ status: {
841
+ equals?: "queued" | "in_progress" | "requires_action" | "completed" | "failed" | "canceled" | "terminated";
842
+ in?: Array<"queued" | "in_progress" | "requires_action" | "completed" | "failed" | "canceled" | "terminated">;
843
+ };
844
+ } | {
845
+ property: "created_at" | "updated_at";
846
+ timestamp: {
847
+ before?: string;
848
+ after?: string;
849
+ on_or_before?: string;
850
+ on_or_after?: string;
851
+ };
852
+ } | {
853
+ and: Array<{
854
+ property: "id";
855
+ string: {
856
+ equals: string;
857
+ };
858
+ } | {
859
+ property: "agent_id";
860
+ string: {
861
+ equals: string;
862
+ };
863
+ } | {
864
+ property: "status";
865
+ status: {
866
+ equals?: "queued" | "in_progress" | "requires_action" | "completed" | "failed" | "canceled" | "terminated";
867
+ in?: Array<"queued" | "in_progress" | "requires_action" | "completed" | "failed" | "canceled" | "terminated">;
868
+ };
869
+ } | {
870
+ property: "created_at" | "updated_at";
871
+ timestamp: {
872
+ before?: string;
873
+ after?: string;
874
+ on_or_before?: string;
875
+ on_or_after?: string;
876
+ };
877
+ }>;
878
+ } | {
879
+ or: Array<{
880
+ property: "id";
881
+ string: {
882
+ equals: string;
883
+ };
884
+ } | {
885
+ property: "agent_id";
886
+ string: {
887
+ equals: string;
888
+ };
889
+ } | {
890
+ property: "status";
891
+ status: {
892
+ equals?: "queued" | "in_progress" | "requires_action" | "completed" | "failed" | "canceled" | "terminated";
893
+ in?: Array<"queued" | "in_progress" | "requires_action" | "completed" | "failed" | "canceled" | "terminated">;
894
+ };
895
+ } | {
896
+ property: "created_at" | "updated_at";
897
+ timestamp: {
898
+ before?: string;
899
+ after?: string;
900
+ on_or_before?: string;
901
+ on_or_after?: string;
902
+ };
903
+ }>;
904
+ }>;
905
+ };
906
+ sorts?: Array<{
907
+ property: "created_at" | "updated_at";
908
+ direction: "ascending" | "descending";
909
+ }>;
910
+ start_cursor?: string | null;
911
+ page_size?: number;
912
+ }> | undefined) => Promise<endpoints.QuerySessionsResponse>;
913
+ /** Query session events */
914
+ queryEvents: (args: WithAuth<endpoints.QuerySessionEventsParameters>) => Promise<endpoints.QuerySessionEventsResponse>;
915
+ /** Cancel a session */
916
+ cancel: (args: WithAuth<endpoints.CancelSessionParameters>) => Promise<endpoints.CancelSessionResponse>;
917
+ };
918
+ };
919
+ export {};
920
+ //# sourceMappingURL=api-endpoint-methods.d.ts.map