@notionhq/client 5.3.0 → 5.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,134 +1,11 @@
1
- type IdResponse = string;
2
- export type PersonUserObjectResponse = {
3
- type: "person";
4
- person: {
5
- email?: string;
6
- };
7
- };
8
- type EmptyObject = Record<string, never>;
9
- type IdRequest = string;
10
- export type PartialUserObjectResponse = {
11
- id: IdResponse;
12
- object: "user";
13
- };
14
- type BotInfoResponse = {
15
- owner: {
16
- type: "user";
17
- user: {
18
- id: IdResponse;
19
- object: "user";
20
- name: string | null;
21
- avatar_url: string | null;
22
- type: "person";
23
- person: {
24
- email?: string;
25
- };
26
- } | PartialUserObjectResponse;
27
- } | {
28
- type: "workspace";
29
- workspace: true;
30
- };
31
- workspace_id: string;
32
- workspace_limits: {
33
- max_file_upload_size_in_bytes: number;
34
- };
35
- workspace_name: string | null;
36
- };
37
- export type BotUserObjectResponse = {
38
- type: "bot";
39
- bot: EmptyObject | BotInfoResponse;
40
- };
41
- export type UserObjectResponse = UserObjectResponseCommon & (PersonUserObjectResponse | BotUserObjectResponse);
42
- export type GroupObjectResponse = {
43
- name: string | null;
44
- id: IdResponse;
45
- object: "group";
46
- };
47
- type DatabaseParentResponse = {
48
- type: "database_id";
49
- database_id: IdResponse;
50
- };
51
- type DataSourceParentResponse = {
52
- type: "data_source_id";
53
- data_source_id: IdResponse;
54
- database_id: IdResponse;
55
- };
56
- type PageIdParentForBlockBasedObjectResponse = {
57
- type: "page_id";
58
- page_id: IdResponse;
59
- };
60
- type BlockIdParentForBlockBasedObjectResponse = {
61
- type: "block_id";
62
- block_id: IdResponse;
63
- };
64
- type WorkspaceParentForBlockBasedObjectResponse = {
65
- type: "workspace";
66
- workspace: true;
67
- };
68
- type ParentForBlockBasedObjectResponse = DatabaseParentResponse | DataSourceParentResponse | PageIdParentForBlockBasedObjectResponse | BlockIdParentForBlockBasedObjectResponse | WorkspaceParentForBlockBasedObjectResponse;
69
- /**
70
- * One of: `default`, `gray`, `brown`, `orange`, `yellow`, `green`, `blue`, `purple`,
71
- * `pink`, `red`
72
- */
73
- type SelectColor = "default" | "gray" | "brown" | "orange" | "yellow" | "green" | "blue" | "purple" | "pink" | "red";
74
- type PartialSelectResponse = {
75
- id: string;
76
- name: string;
77
- color: SelectColor;
78
- };
79
- type TimeZoneRequest = string;
80
- type DateResponse = {
81
- start: string;
82
- end: string | null;
83
- time_zone: TimeZoneRequest | null;
84
- };
85
- type InternalFileResponse = {
86
- url: string;
87
- expiry_time: string;
88
- };
89
- type StringRequest = string;
90
- type FileInternalOrExternalFileWithNameResponse = {
91
- type: "file";
92
- file: InternalFileResponse;
93
- name: StringRequest;
94
- };
95
- type TextRequest = string;
96
- type ExternalInternalOrExternalFileWithNameResponse = {
97
- type: "external";
98
- external: {
99
- url: TextRequest;
100
- };
101
- name: StringRequest;
102
- };
103
- type InternalOrExternalFileWithNameResponse = FileInternalOrExternalFileWithNameResponse | ExternalInternalOrExternalFileWithNameResponse;
104
- type StringFormulaPropertyResponse = {
105
- type: "string";
106
- string: string | null;
107
- };
108
- type DateFormulaPropertyResponse = {
109
- type: "date";
110
- date: DateResponse | null;
111
- };
112
- type NumberFormulaPropertyResponse = {
113
- type: "number";
114
- number: number | null;
115
- };
116
- type BooleanFormulaPropertyResponse = {
117
- type: "boolean";
118
- boolean: boolean | null;
119
- };
120
- type FormulaPropertyResponse = StringFormulaPropertyResponse | DateFormulaPropertyResponse | NumberFormulaPropertyResponse | BooleanFormulaPropertyResponse;
121
- type VerificationPropertyUnverifiedResponse = {
122
- state: "unverified";
123
- date: null;
124
- verified_by: null;
125
- };
126
- type VerificationPropertyResponse = {
127
- state: "verified" | "expired";
128
- date: DateResponse | null;
129
- verified_by: PartialUserObjectResponse | null;
1
+ type AnnotationRequest = {
2
+ bold?: boolean;
3
+ italic?: boolean;
4
+ strikethrough?: boolean;
5
+ underline?: boolean;
6
+ code?: boolean;
7
+ color?: ApiColor;
130
8
  };
131
- type VerificationPropertyValueResponse = VerificationPropertyUnverifiedResponse | VerificationPropertyResponse;
132
9
  type AnnotationResponse = {
133
10
  bold: boolean;
134
11
  italic: boolean;
@@ -137,903 +14,502 @@ type AnnotationResponse = {
137
14
  code: boolean;
138
15
  color: ApiColor;
139
16
  };
140
- export type TextRichTextItemResponse = {
141
- type: "text";
142
- text: {
143
- content: string;
144
- link: {
145
- url: string;
146
- } | null;
147
- };
148
- };
149
- type LinkPreviewMentionResponse = {
150
- url: string;
151
- };
152
- type LinkMentionResponse = {
153
- href: string;
154
- title?: string;
155
- description?: string;
156
- link_author?: string;
157
- link_provider?: string;
158
- thumbnail_url?: string;
159
- icon_url?: string;
160
- iframe_url?: string;
161
- height?: number;
162
- padding?: number;
163
- padding_top?: number;
164
- };
165
- type TemplateMentionDateTemplateMentionResponse = {
166
- type: "template_mention_date";
167
- template_mention_date: "today" | "now";
168
- };
169
- type TemplateMentionUserTemplateMentionResponse = {
170
- type: "template_mention_user";
171
- template_mention_user: "me";
172
- };
173
- type TemplateMentionResponse = TemplateMentionDateTemplateMentionResponse | TemplateMentionUserTemplateMentionResponse;
174
- type CustomEmojiResponse = {
175
- id: IdResponse;
176
- name: string;
177
- url: string;
178
- };
179
- export type MentionRichTextItemResponse = {
180
- type: "mention";
181
- mention: {
182
- type: "user";
183
- user: UserValueResponse;
184
- } | {
185
- type: "date";
186
- date: DateResponse;
187
- } | {
188
- type: "link_preview";
189
- link_preview: LinkPreviewMentionResponse;
190
- } | {
191
- type: "link_mention";
192
- link_mention: LinkMentionResponse;
193
- } | {
194
- type: "page";
195
- page: {
196
- id: IdResponse;
197
- };
198
- } | {
199
- type: "database";
200
- database: {
201
- id: IdResponse;
202
- };
203
- } | {
204
- type: "template_mention";
205
- template_mention: TemplateMentionResponse;
206
- } | {
207
- type: "custom_emoji";
208
- custom_emoji: CustomEmojiResponse;
209
- };
210
- };
211
- export type EquationRichTextItemResponse = {
212
- type: "equation";
213
- equation: {
214
- expression: string;
215
- };
216
- };
217
- export type RichTextItemResponse = RichTextItemResponseCommon & (TextRichTextItemResponse | MentionRichTextItemResponse | EquationRichTextItemResponse);
218
- type RollupFunction = "count" | "count_values" | "empty" | "not_empty" | "unique" | "show_unique" | "percent_empty" | "percent_not_empty" | "sum" | "average" | "median" | "min" | "max" | "range" | "earliest_date" | "latest_date" | "date_range" | "checked" | "unchecked" | "percent_checked" | "percent_unchecked" | "count_per_group" | "percent_per_group" | "show_original";
219
- type EmojiRequest = string;
220
- type EmojiPageIconResponse = {
221
- type: "emoji";
222
- emoji: EmojiRequest;
17
+ /**
18
+ * One of: `default`, `gray`, `brown`, `orange`, `yellow`, `green`, `blue`, `purple`,
19
+ * `pink`, `red`, `default_background`, `gray_background`, `brown_background`,
20
+ * `orange_background`, `yellow_background`, `green_background`, `blue_background`,
21
+ * `purple_background`, `pink_background`, `red_background`
22
+ */
23
+ type ApiColor = "default" | "gray" | "brown" | "orange" | "yellow" | "green" | "blue" | "purple" | "pink" | "red" | "default_background" | "gray_background" | "brown_background" | "orange_background" | "yellow_background" | "green_background" | "blue_background" | "purple_background" | "pink_background" | "red_background";
24
+ type ArrayBasedPropertyValueResponse = TitleArrayBasedPropertyValueResponse | RichTextArrayBasedPropertyValueResponse | PeopleArrayBasedPropertyValueResponse | RelationArrayBasedPropertyValueResponse;
25
+ type ArrayPartialRollupValueResponse = {
26
+ type: "array";
27
+ array: Array<SimpleOrArrayPropertyValueResponse>;
223
28
  };
224
- type ExternalPageIconResponse = {
225
- type: "external";
226
- external: {
227
- url: string;
228
- };
29
+ export type AudioBlockObjectResponse = {
30
+ type: "audio";
31
+ audio: MediaContentWithFileAndCaptionResponse;
32
+ parent: ParentForBlockBasedObjectResponse;
33
+ object: "block";
34
+ id: string;
35
+ created_time: string;
36
+ created_by: PartialUserObjectResponse;
37
+ last_edited_time: string;
38
+ last_edited_by: PartialUserObjectResponse;
39
+ has_children: boolean;
40
+ archived: boolean;
41
+ in_trash: boolean;
229
42
  };
230
- type FilePageIconResponse = {
231
- type: "file";
232
- file: InternalFileResponse;
43
+ type BlockIdCommentParentResponse = {
44
+ type: "block_id";
45
+ block_id: IdResponse;
233
46
  };
234
- type CustomEmojiPageIconResponse = {
235
- type: "custom_emoji";
236
- custom_emoji: CustomEmojiResponse;
47
+ type BlockIdParentForBlockBasedObjectResponse = {
48
+ type: "block_id";
49
+ block_id: IdResponse;
237
50
  };
238
- type PageIconResponse = EmojiPageIconResponse | FilePageIconResponse | ExternalPageIconResponse | CustomEmojiPageIconResponse;
239
- type ExternalPageCoverResponse = {
240
- type: "external";
241
- external: {
242
- url: string;
51
+ export type BlockObjectRequest = {
52
+ embed: MediaContentWithUrlAndCaptionRequest;
53
+ type?: "embed";
54
+ object?: "block";
55
+ } | {
56
+ bookmark: MediaContentWithUrlAndCaptionRequest;
57
+ type?: "bookmark";
58
+ object?: "block";
59
+ } | {
60
+ image: MediaContentWithFileAndCaptionRequest;
61
+ type?: "image";
62
+ object?: "block";
63
+ } | {
64
+ video: MediaContentWithFileAndCaptionRequest;
65
+ type?: "video";
66
+ object?: "block";
67
+ } | {
68
+ pdf: MediaContentWithFileAndCaptionRequest;
69
+ type?: "pdf";
70
+ object?: "block";
71
+ } | {
72
+ file: MediaContentWithFileNameAndCaptionRequest;
73
+ type?: "file";
74
+ object?: "block";
75
+ } | {
76
+ audio: MediaContentWithFileAndCaptionRequest;
77
+ type?: "audio";
78
+ object?: "block";
79
+ } | {
80
+ code: {
81
+ rich_text: Array<RichTextItemRequest>;
82
+ language: LanguageRequest;
83
+ caption?: Array<RichTextItemRequest>;
243
84
  };
244
- };
245
- type FilePageCoverResponse = {
246
- type: "file";
247
- file: InternalFileResponse;
248
- };
249
- type PageCoverResponse = FilePageCoverResponse | ExternalPageCoverResponse;
250
- export type PageObjectResponse = {
251
- parent: ParentForBlockBasedObjectResponse;
252
- properties: Record<string, {
253
- type: "number";
254
- number: number | null;
255
- id: string;
256
- } | {
257
- type: "url";
258
- url: string | null;
259
- id: string;
260
- } | {
261
- type: "select";
262
- select: PartialSelectResponse | null;
263
- id: string;
264
- } | {
265
- type: "multi_select";
266
- multi_select: Array<PartialSelectResponse>;
267
- id: string;
268
- } | {
269
- type: "status";
270
- status: PartialSelectResponse | null;
271
- id: string;
272
- } | {
273
- type: "date";
274
- date: DateResponse | null;
275
- id: string;
276
- } | {
277
- type: "email";
278
- email: string | null;
279
- id: string;
280
- } | {
281
- type: "phone_number";
282
- phone_number: string | null;
283
- id: string;
284
- } | {
285
- type: "checkbox";
286
- checkbox: boolean;
287
- id: string;
288
- } | {
289
- type: "files";
290
- files: Array<InternalOrExternalFileWithNameResponse>;
291
- id: string;
292
- } | {
293
- type: "created_by";
294
- created_by: PartialUserObjectResponse | UserObjectResponse;
295
- id: string;
296
- } | {
297
- type: "created_time";
298
- created_time: string;
299
- id: string;
300
- } | {
301
- type: "last_edited_by";
302
- last_edited_by: PartialUserObjectResponse | UserObjectResponse;
303
- id: string;
304
- } | {
305
- type: "last_edited_time";
306
- last_edited_time: string;
307
- id: string;
308
- } | {
309
- type: "formula";
310
- formula: FormulaPropertyResponse;
311
- id: string;
312
- } | {
313
- type: "button";
314
- button: EmptyObject;
315
- id: string;
316
- } | {
317
- type: "unique_id";
318
- unique_id: {
319
- prefix: string | null;
320
- number: number | null;
321
- };
322
- id: string;
323
- } | {
324
- type: "verification";
325
- verification: VerificationPropertyValueResponse | null;
326
- id: string;
327
- } | {
328
- type: "title";
329
- title: Array<RichTextItemResponse>;
330
- id: string;
331
- } | {
332
- type: "rich_text";
333
- rich_text: Array<RichTextItemResponse>;
334
- id: string;
335
- } | {
336
- type: "people";
337
- people: Array<PartialUserObjectResponse | UserObjectResponse | GroupObjectResponse>;
338
- id: string;
85
+ type?: "code";
86
+ object?: "block";
87
+ } | {
88
+ equation: ContentWithExpressionRequest;
89
+ type?: "equation";
90
+ object?: "block";
91
+ } | {
92
+ divider: EmptyObject;
93
+ type?: "divider";
94
+ object?: "block";
95
+ } | {
96
+ breadcrumb: EmptyObject;
97
+ type?: "breadcrumb";
98
+ object?: "block";
99
+ } | {
100
+ table_of_contents: {
101
+ color?: ApiColor;
102
+ };
103
+ type?: "table_of_contents";
104
+ object?: "block";
105
+ } | {
106
+ link_to_page: {
107
+ page_id: IdRequest;
108
+ type?: "page_id";
339
109
  } | {
340
- type: "relation";
341
- relation: Array<{
342
- id: string;
343
- }>;
344
- id: string;
110
+ database_id: IdRequest;
111
+ type?: "database_id";
345
112
  } | {
346
- type: "rollup";
347
- rollup: {
348
- type: "number";
349
- number: number | null;
350
- function: RollupFunction;
351
- } | {
352
- type: "date";
353
- date: DateResponse | null;
354
- function: RollupFunction;
355
- } | {
356
- type: "array";
357
- array: Array<{
358
- type: "number";
359
- number: number | null;
360
- } | {
361
- type: "url";
362
- url: string | null;
363
- } | {
364
- type: "select";
365
- select: PartialSelectResponse | null;
366
- } | {
367
- type: "multi_select";
368
- multi_select: Array<PartialSelectResponse>;
369
- } | {
370
- type: "status";
371
- status: PartialSelectResponse | null;
372
- } | {
373
- type: "date";
374
- date: DateResponse | null;
375
- } | {
376
- type: "email";
377
- email: string | null;
378
- } | {
379
- type: "phone_number";
380
- phone_number: string | null;
381
- } | {
382
- type: "checkbox";
383
- checkbox: boolean;
384
- } | {
385
- type: "files";
386
- files: Array<InternalOrExternalFileWithNameResponse>;
387
- } | {
388
- type: "created_by";
389
- created_by: PartialUserObjectResponse | UserObjectResponse;
390
- } | {
391
- type: "created_time";
392
- created_time: string;
393
- } | {
394
- type: "last_edited_by";
395
- last_edited_by: PartialUserObjectResponse | UserObjectResponse;
396
- } | {
397
- type: "last_edited_time";
398
- last_edited_time: string;
399
- } | {
400
- type: "formula";
401
- formula: FormulaPropertyResponse;
402
- } | {
403
- type: "button";
404
- button: EmptyObject;
405
- } | {
406
- type: "unique_id";
407
- unique_id: {
408
- prefix: string | null;
409
- number: number | null;
410
- };
411
- } | {
412
- type: "verification";
413
- verification: VerificationPropertyValueResponse | null;
414
- } | {
415
- type: "title";
416
- title: Array<RichTextItemResponse>;
417
- } | {
418
- type: "rich_text";
419
- rich_text: Array<RichTextItemResponse>;
420
- } | {
421
- type: "people";
422
- people: Array<PartialUserObjectResponse | UserObjectResponse | GroupObjectResponse>;
423
- } | {
424
- type: "relation";
425
- relation: Array<{
426
- id: string;
427
- }>;
428
- }>;
429
- function: RollupFunction;
430
- };
431
- id: string;
432
- }>;
433
- icon: PageIconResponse | null;
434
- cover: PageCoverResponse | null;
435
- created_by: PartialUserObjectResponse;
436
- last_edited_by: PartialUserObjectResponse;
437
- is_locked: boolean;
438
- object: "page";
439
- id: string;
440
- created_time: string;
441
- last_edited_time: string;
442
- archived: boolean;
443
- in_trash: boolean;
444
- url: string;
445
- public_url: string | null;
446
- };
447
- export type PartialPageObjectResponse = {
448
- object: "page";
449
- id: string;
450
- };
451
- type NumberFormat = string;
452
- type PropertyDescriptionRequest = string;
453
- type NumberDatabasePropertyConfigResponse = {
454
- type: "number";
455
- number: {
456
- format: NumberFormat;
113
+ comment_id: IdRequest;
114
+ type?: "comment_id";
457
115
  };
458
- };
459
- type FormulaDatabasePropertyConfigResponse = {
460
- type: "formula";
461
- formula: {
462
- expression: string;
116
+ type?: "link_to_page";
117
+ object?: "block";
118
+ } | {
119
+ table_row: ContentWithTableRowRequest;
120
+ type?: "table_row";
121
+ object?: "block";
122
+ } | {
123
+ table: TableRequestWithTableRowChildren;
124
+ type?: "table";
125
+ object?: "block";
126
+ } | {
127
+ column_list: ColumnListRequest;
128
+ type?: "column_list";
129
+ object?: "block";
130
+ } | {
131
+ column: ColumnWithChildrenRequest;
132
+ type?: "column";
133
+ object?: "block";
134
+ } | {
135
+ heading_1: {
136
+ rich_text: Array<RichTextItemRequest>;
137
+ color?: ApiColor;
138
+ is_toggleable?: boolean;
139
+ children?: Array<BlockObjectWithSingleLevelOfChildrenRequest>;
463
140
  };
464
- };
465
- type SelectPropertyResponse = {
466
- id: string;
467
- name: string;
468
- color: SelectColor;
469
- description: string | null;
470
- };
471
- type SelectDatabasePropertyConfigResponse = {
472
- type: "select";
473
- select: {
474
- options: Array<SelectPropertyResponse>;
141
+ type?: "heading_1";
142
+ object?: "block";
143
+ } | {
144
+ heading_2: {
145
+ rich_text: Array<RichTextItemRequest>;
146
+ color?: ApiColor;
147
+ is_toggleable?: boolean;
148
+ children?: Array<BlockObjectWithSingleLevelOfChildrenRequest>;
475
149
  };
476
- };
477
- type MultiSelectDatabasePropertyConfigResponse = {
478
- type: "multi_select";
479
- multi_select: {
480
- options: Array<SelectPropertyResponse>;
150
+ type?: "heading_2";
151
+ object?: "block";
152
+ } | {
153
+ heading_3: {
154
+ rich_text: Array<RichTextItemRequest>;
155
+ color?: ApiColor;
156
+ is_toggleable?: boolean;
157
+ children?: Array<BlockObjectWithSingleLevelOfChildrenRequest>;
481
158
  };
482
- };
483
- type StatusPropertyResponse = {
484
- id: string;
485
- name: string;
486
- color: SelectColor;
487
- description: string | null;
488
- };
489
- type StatusDatabasePropertyConfigResponse = {
490
- type: "status";
491
- status: {
492
- options: Array<StatusPropertyResponse>;
493
- groups: Array<{
494
- id: string;
495
- name: string;
496
- color: SelectColor;
497
- option_ids: Array<string>;
498
- }>;
159
+ type?: "heading_3";
160
+ object?: "block";
161
+ } | {
162
+ paragraph: {
163
+ rich_text: Array<RichTextItemRequest>;
164
+ color?: ApiColor;
165
+ children?: Array<BlockObjectWithSingleLevelOfChildrenRequest>;
499
166
  };
500
- };
501
- type SinglePropertyDatabasePropertyRelationConfigResponse = {
502
- type: "single_property";
503
- single_property: EmptyObject;
504
- };
505
- type DualPropertyDatabasePropertyRelationConfigResponse = {
506
- type?: "dual_property";
507
- dual_property: {
508
- synced_property_id: string;
509
- synced_property_name: string;
167
+ type?: "paragraph";
168
+ object?: "block";
169
+ } | {
170
+ bulleted_list_item: {
171
+ rich_text: Array<RichTextItemRequest>;
172
+ color?: ApiColor;
173
+ children?: Array<BlockObjectWithSingleLevelOfChildrenRequest>;
510
174
  };
511
- };
512
- type DatabasePropertyRelationConfigResponse = DatabasePropertyRelationConfigResponseCommon & (SinglePropertyDatabasePropertyRelationConfigResponse | DualPropertyDatabasePropertyRelationConfigResponse);
513
- type RelationDatabasePropertyConfigResponse = {
514
- type: "relation";
515
- relation: DatabasePropertyRelationConfigResponse;
516
- };
517
- type RollupDatabasePropertyConfigResponse = {
518
- type: "rollup";
519
- rollup: {
520
- function: RollupFunction;
521
- rollup_property_name: string;
522
- relation_property_name: string;
523
- rollup_property_id: string;
524
- relation_property_id: string;
175
+ type?: "bulleted_list_item";
176
+ object?: "block";
177
+ } | {
178
+ numbered_list_item: {
179
+ rich_text: Array<RichTextItemRequest>;
180
+ color?: ApiColor;
181
+ children?: Array<BlockObjectWithSingleLevelOfChildrenRequest>;
525
182
  };
526
- };
527
- type UniqueIdDatabasePropertyConfigResponse = {
528
- type: "unique_id";
529
- unique_id: {
530
- prefix: string | null;
183
+ type?: "numbered_list_item";
184
+ object?: "block";
185
+ } | {
186
+ quote: {
187
+ rich_text: Array<RichTextItemRequest>;
188
+ color?: ApiColor;
189
+ children?: Array<BlockObjectWithSingleLevelOfChildrenRequest>;
531
190
  };
532
- };
533
- type TitleDatabasePropertyConfigResponse = {
534
- type: "title";
535
- title: EmptyObject;
536
- };
537
- type RichTextDatabasePropertyConfigResponse = {
538
- type: "rich_text";
539
- rich_text: EmptyObject;
540
- };
541
- type UrlDatabasePropertyConfigResponse = {
542
- type: "url";
543
- url: EmptyObject;
544
- };
545
- type PeopleDatabasePropertyConfigResponse = {
546
- type: "people";
547
- people: EmptyObject;
548
- };
549
- type FilesDatabasePropertyConfigResponse = {
550
- type: "files";
551
- files: EmptyObject;
552
- };
553
- type EmailDatabasePropertyConfigResponse = {
554
- type: "email";
555
- email: EmptyObject;
556
- };
557
- type PhoneNumberDatabasePropertyConfigResponse = {
558
- type: "phone_number";
559
- phone_number: EmptyObject;
560
- };
561
- type DateDatabasePropertyConfigResponse = {
562
- type: "date";
563
- date: EmptyObject;
564
- };
565
- type CheckboxDatabasePropertyConfigResponse = {
566
- type: "checkbox";
567
- checkbox: EmptyObject;
568
- };
569
- type CreatedByDatabasePropertyConfigResponse = {
570
- type: "created_by";
571
- created_by: EmptyObject;
572
- };
573
- type CreatedTimeDatabasePropertyConfigResponse = {
574
- type: "created_time";
575
- created_time: EmptyObject;
576
- };
577
- type LastEditedByDatabasePropertyConfigResponse = {
578
- type: "last_edited_by";
579
- last_edited_by: EmptyObject;
580
- };
581
- type LastEditedTimeDatabasePropertyConfigResponse = {
582
- type: "last_edited_time";
583
- last_edited_time: EmptyObject;
584
- };
585
- type DatabasePropertyConfigResponse = DatabasePropertyConfigResponseCommon & (NumberDatabasePropertyConfigResponse | FormulaDatabasePropertyConfigResponse | SelectDatabasePropertyConfigResponse | MultiSelectDatabasePropertyConfigResponse | StatusDatabasePropertyConfigResponse | RelationDatabasePropertyConfigResponse | RollupDatabasePropertyConfigResponse | UniqueIdDatabasePropertyConfigResponse | TitleDatabasePropertyConfigResponse | RichTextDatabasePropertyConfigResponse | UrlDatabasePropertyConfigResponse | PeopleDatabasePropertyConfigResponse | FilesDatabasePropertyConfigResponse | EmailDatabasePropertyConfigResponse | PhoneNumberDatabasePropertyConfigResponse | DateDatabasePropertyConfigResponse | CheckboxDatabasePropertyConfigResponse | CreatedByDatabasePropertyConfigResponse | CreatedTimeDatabasePropertyConfigResponse | LastEditedByDatabasePropertyConfigResponse | LastEditedTimeDatabasePropertyConfigResponse);
586
- export type PartialDataSourceObjectResponse = {
587
- object: "data_source";
588
- id: IdResponse;
589
- properties: Record<string, DatabasePropertyConfigResponse>;
590
- };
591
- /**
592
- * The parent of the data source. This is typically a database (`database_id`), but for
593
- * externally synced data sources, can be another data source (`data_source_id`).
594
- */
595
- type ParentOfDataSourceResponse = DatabaseParentResponse | DataSourceParentResponse;
596
- export type DataSourceObjectResponse = {
597
- object: "data_source";
598
- id: IdResponse;
599
- title: Array<RichTextItemResponse>;
600
- description: Array<RichTextItemResponse>;
601
- parent: ParentOfDataSourceResponse;
602
- database_parent: ParentOfDatabaseResponse;
603
- is_inline: boolean;
604
- archived: boolean;
605
- in_trash: boolean;
606
- created_time: string;
607
- last_edited_time: string;
608
- created_by: PartialUserObjectResponse;
609
- last_edited_by: PartialUserObjectResponse;
610
- properties: Record<string, DatabasePropertyConfigResponse>;
611
- icon: PageIconResponse | null;
612
- cover: PageCoverResponse | null;
613
- url: string;
614
- public_url: string | null;
615
- };
616
- export type PartialBlockObjectResponse = {
617
- object: "block";
618
- id: string;
619
- };
620
- /**
621
- * One of: `default`, `gray`, `brown`, `orange`, `yellow`, `green`, `blue`, `purple`,
622
- * `pink`, `red`, `default_background`, `gray_background`, `brown_background`,
623
- * `orange_background`, `yellow_background`, `green_background`, `blue_background`,
624
- * `purple_background`, `pink_background`, `red_background`
625
- */
626
- type ApiColor = "default" | "gray" | "brown" | "orange" | "yellow" | "green" | "blue" | "purple" | "pink" | "red" | "default_background" | "gray_background" | "brown_background" | "orange_background" | "yellow_background" | "green_background" | "blue_background" | "purple_background" | "pink_background" | "red_background";
627
- type ContentWithRichTextAndColorResponse = {
628
- rich_text: Array<RichTextItemResponse>;
629
- color: ApiColor;
630
- };
631
- export type ParagraphBlockObjectResponse = {
632
- type: "paragraph";
633
- paragraph: ContentWithRichTextAndColorResponse;
634
- parent: ParentForBlockBasedObjectResponse;
635
- object: "block";
636
- id: string;
637
- created_time: string;
638
- created_by: PartialUserObjectResponse;
639
- last_edited_time: string;
640
- last_edited_by: PartialUserObjectResponse;
641
- has_children: boolean;
642
- archived: boolean;
643
- in_trash: boolean;
644
- };
645
- type HeaderContentWithRichTextAndColorResponse = {
646
- rich_text: Array<RichTextItemResponse>;
647
- color: ApiColor;
648
- is_toggleable: boolean;
649
- };
650
- export type Heading1BlockObjectResponse = {
651
- type: "heading_1";
652
- heading_1: HeaderContentWithRichTextAndColorResponse;
653
- parent: ParentForBlockBasedObjectResponse;
654
- object: "block";
655
- id: string;
656
- created_time: string;
657
- created_by: PartialUserObjectResponse;
658
- last_edited_time: string;
659
- last_edited_by: PartialUserObjectResponse;
660
- has_children: boolean;
661
- archived: boolean;
662
- in_trash: boolean;
663
- };
664
- export type Heading2BlockObjectResponse = {
665
- type: "heading_2";
666
- heading_2: HeaderContentWithRichTextAndColorResponse;
667
- parent: ParentForBlockBasedObjectResponse;
668
- object: "block";
669
- id: string;
670
- created_time: string;
671
- created_by: PartialUserObjectResponse;
672
- last_edited_time: string;
673
- last_edited_by: PartialUserObjectResponse;
674
- has_children: boolean;
675
- archived: boolean;
676
- in_trash: boolean;
677
- };
678
- export type Heading3BlockObjectResponse = {
679
- type: "heading_3";
680
- heading_3: HeaderContentWithRichTextAndColorResponse;
681
- parent: ParentForBlockBasedObjectResponse;
682
- object: "block";
683
- id: string;
684
- created_time: string;
685
- created_by: PartialUserObjectResponse;
686
- last_edited_time: string;
687
- last_edited_by: PartialUserObjectResponse;
688
- has_children: boolean;
689
- archived: boolean;
690
- in_trash: boolean;
691
- };
692
- export type BulletedListItemBlockObjectResponse = {
693
- type: "bulleted_list_item";
694
- bulleted_list_item: ContentWithRichTextAndColorResponse;
695
- parent: ParentForBlockBasedObjectResponse;
696
- object: "block";
697
- id: string;
698
- created_time: string;
699
- created_by: PartialUserObjectResponse;
700
- last_edited_time: string;
701
- last_edited_by: PartialUserObjectResponse;
702
- has_children: boolean;
703
- archived: boolean;
704
- in_trash: boolean;
705
- };
706
- export type NumberedListItemBlockObjectResponse = {
707
- type: "numbered_list_item";
708
- numbered_list_item: ContentWithRichTextAndColorResponse;
709
- parent: ParentForBlockBasedObjectResponse;
710
- object: "block";
711
- id: string;
712
- created_time: string;
713
- created_by: PartialUserObjectResponse;
714
- last_edited_time: string;
715
- last_edited_by: PartialUserObjectResponse;
716
- has_children: boolean;
717
- archived: boolean;
718
- in_trash: boolean;
719
- };
720
- export type QuoteBlockObjectResponse = {
721
- type: "quote";
722
- quote: ContentWithRichTextAndColorResponse;
723
- parent: ParentForBlockBasedObjectResponse;
724
- object: "block";
725
- id: string;
726
- created_time: string;
727
- created_by: PartialUserObjectResponse;
728
- last_edited_time: string;
729
- last_edited_by: PartialUserObjectResponse;
730
- has_children: boolean;
731
- archived: boolean;
732
- in_trash: boolean;
733
- };
734
- export type ToDoBlockObjectResponse = {
735
- type: "to_do";
191
+ type?: "quote";
192
+ object?: "block";
193
+ } | {
736
194
  to_do: {
737
- rich_text: Array<RichTextItemResponse>;
738
- color: ApiColor;
739
- checked: boolean;
195
+ rich_text: Array<RichTextItemRequest>;
196
+ color?: ApiColor;
197
+ children?: Array<BlockObjectWithSingleLevelOfChildrenRequest>;
198
+ checked?: boolean;
199
+ };
200
+ type?: "to_do";
201
+ object?: "block";
202
+ } | {
203
+ toggle: {
204
+ rich_text: Array<RichTextItemRequest>;
205
+ color?: ApiColor;
206
+ children?: Array<BlockObjectWithSingleLevelOfChildrenRequest>;
740
207
  };
741
- parent: ParentForBlockBasedObjectResponse;
742
- object: "block";
743
- id: string;
744
- created_time: string;
745
- created_by: PartialUserObjectResponse;
746
- last_edited_time: string;
747
- last_edited_by: PartialUserObjectResponse;
748
- has_children: boolean;
749
- archived: boolean;
750
- in_trash: boolean;
751
- };
752
- export type ToggleBlockObjectResponse = {
753
- type: "toggle";
754
- toggle: ContentWithRichTextAndColorResponse;
755
- parent: ParentForBlockBasedObjectResponse;
756
- object: "block";
757
- id: string;
758
- created_time: string;
759
- created_by: PartialUserObjectResponse;
760
- last_edited_time: string;
761
- last_edited_by: PartialUserObjectResponse;
762
- has_children: boolean;
763
- archived: boolean;
764
- in_trash: boolean;
765
- };
766
- export type TemplateBlockObjectResponse = {
767
- type: "template";
208
+ type?: "toggle";
209
+ object?: "block";
210
+ } | {
768
211
  template: {
769
- rich_text: Array<RichTextItemResponse>;
212
+ rich_text: Array<RichTextItemRequest>;
213
+ children?: Array<BlockObjectWithSingleLevelOfChildrenRequest>;
770
214
  };
771
- parent: ParentForBlockBasedObjectResponse;
772
- object: "block";
773
- id: string;
774
- created_time: string;
775
- created_by: PartialUserObjectResponse;
776
- last_edited_time: string;
777
- last_edited_by: PartialUserObjectResponse;
778
- has_children: boolean;
779
- archived: boolean;
780
- in_trash: boolean;
781
- };
782
- export type SyncedBlockBlockObjectResponse = {
783
- type: "synced_block";
215
+ type?: "template";
216
+ object?: "block";
217
+ } | {
218
+ callout: {
219
+ rich_text: Array<RichTextItemRequest>;
220
+ color?: ApiColor;
221
+ children?: Array<BlockObjectWithSingleLevelOfChildrenRequest>;
222
+ icon?: PageIconRequest;
223
+ };
224
+ type?: "callout";
225
+ object?: "block";
226
+ } | {
784
227
  synced_block: {
785
228
  synced_from: {
786
- type: "block_id";
787
229
  block_id: IdRequest;
230
+ type?: "block_id";
788
231
  } | null;
232
+ children?: Array<BlockObjectWithSingleLevelOfChildrenRequest>;
789
233
  };
790
- parent: ParentForBlockBasedObjectResponse;
791
- object: "block";
792
- id: string;
793
- created_time: string;
794
- created_by: PartialUserObjectResponse;
795
- last_edited_time: string;
796
- last_edited_by: PartialUserObjectResponse;
797
- has_children: boolean;
798
- archived: boolean;
799
- in_trash: boolean;
800
- };
801
- type TitleObjectResponse = {
802
- title: string;
803
- };
804
- export type ChildPageBlockObjectResponse = {
805
- type: "child_page";
806
- child_page: TitleObjectResponse;
807
- parent: ParentForBlockBasedObjectResponse;
808
- object: "block";
809
- id: string;
810
- created_time: string;
811
- created_by: PartialUserObjectResponse;
812
- last_edited_time: string;
813
- last_edited_by: PartialUserObjectResponse;
814
- has_children: boolean;
815
- archived: boolean;
816
- in_trash: boolean;
817
- };
818
- export type ChildDatabaseBlockObjectResponse = {
819
- type: "child_database";
820
- child_database: TitleObjectResponse;
821
- parent: ParentForBlockBasedObjectResponse;
822
- object: "block";
823
- id: string;
824
- created_time: string;
825
- created_by: PartialUserObjectResponse;
826
- last_edited_time: string;
827
- last_edited_by: PartialUserObjectResponse;
828
- has_children: boolean;
829
- archived: boolean;
830
- in_trash: boolean;
831
- };
832
- type ExpressionObjectResponse = {
833
- expression: string;
834
- };
835
- export type EquationBlockObjectResponse = {
836
- type: "equation";
837
- equation: ExpressionObjectResponse;
838
- parent: ParentForBlockBasedObjectResponse;
839
- object: "block";
840
- id: string;
841
- created_time: string;
842
- created_by: PartialUserObjectResponse;
843
- last_edited_time: string;
844
- last_edited_by: PartialUserObjectResponse;
845
- has_children: boolean;
846
- archived: boolean;
847
- in_trash: boolean;
234
+ type?: "synced_block";
235
+ object?: "block";
848
236
  };
849
- type LanguageRequest = "abap" | "abc" | "agda" | "arduino" | "ascii art" | "assembly" | "bash" | "basic" | "bnf" | "c" | "c#" | "c++" | "clojure" | "coffeescript" | "coq" | "css" | "dart" | "dhall" | "diff" | "docker" | "ebnf" | "elixir" | "elm" | "erlang" | "f#" | "flow" | "fortran" | "gherkin" | "glsl" | "go" | "graphql" | "groovy" | "haskell" | "hcl" | "html" | "idris" | "java" | "javascript" | "json" | "julia" | "kotlin" | "latex" | "less" | "lisp" | "livescript" | "llvm ir" | "lua" | "makefile" | "markdown" | "markup" | "matlab" | "mathematica" | "mermaid" | "nix" | "notion formula" | "objective-c" | "ocaml" | "pascal" | "perl" | "php" | "plain text" | "powershell" | "prolog" | "protobuf" | "purescript" | "python" | "r" | "racket" | "reason" | "ruby" | "rust" | "sass" | "scala" | "scheme" | "scss" | "shell" | "smalltalk" | "solidity" | "sql" | "swift" | "toml" | "typescript" | "vb.net" | "verilog" | "vhdl" | "visual basic" | "webassembly" | "xml" | "yaml" | "java/c/c++/c#";
850
- export type CodeBlockObjectResponse = {
851
- type: "code";
237
+ export type BlockObjectRequestWithoutChildren = {
238
+ embed: MediaContentWithUrlAndCaptionRequest;
239
+ type?: "embed";
240
+ object?: "block";
241
+ } | {
242
+ bookmark: MediaContentWithUrlAndCaptionRequest;
243
+ type?: "bookmark";
244
+ object?: "block";
245
+ } | {
246
+ image: MediaContentWithFileAndCaptionRequest;
247
+ type?: "image";
248
+ object?: "block";
249
+ } | {
250
+ video: MediaContentWithFileAndCaptionRequest;
251
+ type?: "video";
252
+ object?: "block";
253
+ } | {
254
+ pdf: MediaContentWithFileAndCaptionRequest;
255
+ type?: "pdf";
256
+ object?: "block";
257
+ } | {
258
+ file: MediaContentWithFileNameAndCaptionRequest;
259
+ type?: "file";
260
+ object?: "block";
261
+ } | {
262
+ audio: MediaContentWithFileAndCaptionRequest;
263
+ type?: "audio";
264
+ object?: "block";
265
+ } | {
852
266
  code: {
853
- rich_text: Array<RichTextItemResponse>;
854
- caption: Array<RichTextItemResponse>;
267
+ rich_text: Array<RichTextItemRequest>;
855
268
  language: LanguageRequest;
269
+ caption?: Array<RichTextItemRequest>;
856
270
  };
857
- parent: ParentForBlockBasedObjectResponse;
858
- object: "block";
859
- id: string;
860
- created_time: string;
861
- created_by: PartialUserObjectResponse;
862
- last_edited_time: string;
863
- last_edited_by: PartialUserObjectResponse;
864
- has_children: boolean;
865
- archived: boolean;
866
- in_trash: boolean;
867
- };
868
- export type CalloutBlockObjectResponse = {
869
- type: "callout";
271
+ type?: "code";
272
+ object?: "block";
273
+ } | {
274
+ equation: ContentWithExpressionRequest;
275
+ type?: "equation";
276
+ object?: "block";
277
+ } | {
278
+ divider: EmptyObject;
279
+ type?: "divider";
280
+ object?: "block";
281
+ } | {
282
+ breadcrumb: EmptyObject;
283
+ type?: "breadcrumb";
284
+ object?: "block";
285
+ } | {
286
+ table_of_contents: {
287
+ color?: ApiColor;
288
+ };
289
+ type?: "table_of_contents";
290
+ object?: "block";
291
+ } | {
292
+ link_to_page: {
293
+ page_id: IdRequest;
294
+ type?: "page_id";
295
+ } | {
296
+ database_id: IdRequest;
297
+ type?: "database_id";
298
+ } | {
299
+ comment_id: IdRequest;
300
+ type?: "comment_id";
301
+ };
302
+ type?: "link_to_page";
303
+ object?: "block";
304
+ } | {
305
+ table_row: ContentWithTableRowRequest;
306
+ type?: "table_row";
307
+ object?: "block";
308
+ } | {
309
+ heading_1: HeaderContentWithRichTextAndColorRequest;
310
+ type?: "heading_1";
311
+ object?: "block";
312
+ } | {
313
+ heading_2: HeaderContentWithRichTextAndColorRequest;
314
+ type?: "heading_2";
315
+ object?: "block";
316
+ } | {
317
+ heading_3: HeaderContentWithRichTextAndColorRequest;
318
+ type?: "heading_3";
319
+ object?: "block";
320
+ } | {
321
+ paragraph: ContentWithRichTextAndColorRequest;
322
+ type?: "paragraph";
323
+ object?: "block";
324
+ } | {
325
+ bulleted_list_item: ContentWithRichTextAndColorRequest;
326
+ type?: "bulleted_list_item";
327
+ object?: "block";
328
+ } | {
329
+ numbered_list_item: ContentWithRichTextAndColorRequest;
330
+ type?: "numbered_list_item";
331
+ object?: "block";
332
+ } | {
333
+ quote: ContentWithRichTextAndColorRequest;
334
+ type?: "quote";
335
+ object?: "block";
336
+ } | {
337
+ to_do: {
338
+ rich_text: Array<RichTextItemRequest>;
339
+ checked?: boolean;
340
+ color?: ApiColor;
341
+ };
342
+ type?: "to_do";
343
+ object?: "block";
344
+ } | {
345
+ toggle: ContentWithRichTextAndColorRequest;
346
+ type?: "toggle";
347
+ object?: "block";
348
+ } | {
349
+ template: ContentWithRichTextRequest;
350
+ type?: "template";
351
+ object?: "block";
352
+ } | {
870
353
  callout: {
871
- rich_text: Array<RichTextItemResponse>;
872
- color: ApiColor;
873
- icon: PageIconResponse | null;
354
+ rich_text: Array<RichTextItemRequest>;
355
+ icon?: PageIconRequest;
356
+ color?: ApiColor;
874
357
  };
875
- parent: ParentForBlockBasedObjectResponse;
876
- object: "block";
877
- id: string;
878
- created_time: string;
879
- created_by: PartialUserObjectResponse;
880
- last_edited_time: string;
881
- last_edited_by: PartialUserObjectResponse;
882
- has_children: boolean;
883
- archived: boolean;
884
- in_trash: boolean;
358
+ type?: "callout";
359
+ object?: "block";
360
+ } | {
361
+ synced_block: {
362
+ synced_from: {
363
+ block_id: IdRequest;
364
+ type?: "block_id";
365
+ } | null;
366
+ };
367
+ type?: "synced_block";
368
+ object?: "block";
885
369
  };
886
- export type DividerBlockObjectResponse = {
887
- type: "divider";
370
+ export type BlockObjectResponse = ParagraphBlockObjectResponse | Heading1BlockObjectResponse | Heading2BlockObjectResponse | Heading3BlockObjectResponse | BulletedListItemBlockObjectResponse | NumberedListItemBlockObjectResponse | QuoteBlockObjectResponse | ToDoBlockObjectResponse | ToggleBlockObjectResponse | TemplateBlockObjectResponse | SyncedBlockBlockObjectResponse | ChildPageBlockObjectResponse | ChildDatabaseBlockObjectResponse | EquationBlockObjectResponse | CodeBlockObjectResponse | CalloutBlockObjectResponse | DividerBlockObjectResponse | BreadcrumbBlockObjectResponse | TableOfContentsBlockObjectResponse | ColumnListBlockObjectResponse | ColumnBlockObjectResponse | LinkToPageBlockObjectResponse | TableBlockObjectResponse | TableRowBlockObjectResponse | EmbedBlockObjectResponse | BookmarkBlockObjectResponse | ImageBlockObjectResponse | VideoBlockObjectResponse | PdfBlockObjectResponse | FileBlockObjectResponse | AudioBlockObjectResponse | LinkPreviewBlockObjectResponse | UnsupportedBlockObjectResponse;
371
+ type BlockObjectWithSingleLevelOfChildrenRequest = {
372
+ embed: MediaContentWithUrlAndCaptionRequest;
373
+ type?: "embed";
374
+ object?: "block";
375
+ } | {
376
+ bookmark: MediaContentWithUrlAndCaptionRequest;
377
+ type?: "bookmark";
378
+ object?: "block";
379
+ } | {
380
+ image: MediaContentWithFileAndCaptionRequest;
381
+ type?: "image";
382
+ object?: "block";
383
+ } | {
384
+ video: MediaContentWithFileAndCaptionRequest;
385
+ type?: "video";
386
+ object?: "block";
387
+ } | {
388
+ pdf: MediaContentWithFileAndCaptionRequest;
389
+ type?: "pdf";
390
+ object?: "block";
391
+ } | {
392
+ file: MediaContentWithFileNameAndCaptionRequest;
393
+ type?: "file";
394
+ object?: "block";
395
+ } | {
396
+ audio: MediaContentWithFileAndCaptionRequest;
397
+ type?: "audio";
398
+ object?: "block";
399
+ } | {
400
+ code: {
401
+ rich_text: Array<RichTextItemRequest>;
402
+ language: LanguageRequest;
403
+ caption?: Array<RichTextItemRequest>;
404
+ };
405
+ type?: "code";
406
+ object?: "block";
407
+ } | {
408
+ equation: ContentWithExpressionRequest;
409
+ type?: "equation";
410
+ object?: "block";
411
+ } | {
888
412
  divider: EmptyObject;
889
- parent: ParentForBlockBasedObjectResponse;
890
- object: "block";
891
- id: string;
892
- created_time: string;
893
- created_by: PartialUserObjectResponse;
894
- last_edited_time: string;
895
- last_edited_by: PartialUserObjectResponse;
896
- has_children: boolean;
897
- archived: boolean;
898
- in_trash: boolean;
899
- };
900
- export type BreadcrumbBlockObjectResponse = {
901
- type: "breadcrumb";
413
+ type?: "divider";
414
+ object?: "block";
415
+ } | {
902
416
  breadcrumb: EmptyObject;
903
- parent: ParentForBlockBasedObjectResponse;
904
- object: "block";
905
- id: string;
906
- created_time: string;
907
- created_by: PartialUserObjectResponse;
908
- last_edited_time: string;
909
- last_edited_by: PartialUserObjectResponse;
910
- has_children: boolean;
911
- archived: boolean;
912
- in_trash: boolean;
913
- };
914
- export type TableOfContentsBlockObjectResponse = {
915
- type: "table_of_contents";
417
+ type?: "breadcrumb";
418
+ object?: "block";
419
+ } | {
916
420
  table_of_contents: {
917
- color: ApiColor;
421
+ color?: ApiColor;
918
422
  };
919
- parent: ParentForBlockBasedObjectResponse;
920
- object: "block";
921
- id: string;
922
- created_time: string;
923
- created_by: PartialUserObjectResponse;
924
- last_edited_time: string;
925
- last_edited_by: PartialUserObjectResponse;
926
- has_children: boolean;
927
- archived: boolean;
928
- in_trash: boolean;
929
- };
930
- export type ColumnListBlockObjectResponse = {
931
- type: "column_list";
932
- column_list: EmptyObject;
933
- parent: ParentForBlockBasedObjectResponse;
934
- object: "block";
935
- id: string;
936
- created_time: string;
937
- created_by: PartialUserObjectResponse;
938
- last_edited_time: string;
939
- last_edited_by: PartialUserObjectResponse;
940
- has_children: boolean;
941
- archived: boolean;
942
- in_trash: boolean;
943
- };
944
- type ColumnResponse = {
945
- width_ratio?: number;
946
- };
947
- export type ColumnBlockObjectResponse = {
948
- type: "column";
949
- column: ColumnResponse;
950
- parent: ParentForBlockBasedObjectResponse;
951
- object: "block";
952
- id: string;
953
- created_time: string;
954
- created_by: PartialUserObjectResponse;
955
- last_edited_time: string;
956
- last_edited_by: PartialUserObjectResponse;
957
- has_children: boolean;
958
- archived: boolean;
959
- in_trash: boolean;
960
- };
961
- export type LinkToPageBlockObjectResponse = {
962
- type: "link_to_page";
423
+ type?: "table_of_contents";
424
+ object?: "block";
425
+ } | {
963
426
  link_to_page: {
964
- type: "page_id";
965
427
  page_id: IdRequest;
428
+ type?: "page_id";
966
429
  } | {
967
- type: "database_id";
968
430
  database_id: IdRequest;
431
+ type?: "database_id";
969
432
  } | {
970
- type: "comment_id";
971
433
  comment_id: IdRequest;
434
+ type?: "comment_id";
972
435
  };
973
- parent: ParentForBlockBasedObjectResponse;
974
- object: "block";
975
- id: string;
976
- created_time: string;
977
- created_by: PartialUserObjectResponse;
978
- last_edited_time: string;
979
- last_edited_by: PartialUserObjectResponse;
980
- has_children: boolean;
981
- archived: boolean;
982
- in_trash: boolean;
983
- };
984
- type ContentWithTableResponse = {
985
- has_column_header: boolean;
986
- has_row_header: boolean;
987
- table_width: number;
988
- };
989
- export type TableBlockObjectResponse = {
990
- type: "table";
991
- table: ContentWithTableResponse;
992
- parent: ParentForBlockBasedObjectResponse;
993
- object: "block";
994
- id: string;
995
- created_time: string;
996
- created_by: PartialUserObjectResponse;
997
- last_edited_time: string;
998
- last_edited_by: PartialUserObjectResponse;
999
- has_children: boolean;
1000
- archived: boolean;
1001
- in_trash: boolean;
1002
- };
1003
- type ContentWithTableRowResponse = {
1004
- cells: Array<Array<RichTextItemResponse>>;
1005
- };
1006
- export type TableRowBlockObjectResponse = {
1007
- type: "table_row";
1008
- table_row: ContentWithTableRowResponse;
1009
- parent: ParentForBlockBasedObjectResponse;
1010
- object: "block";
1011
- id: string;
1012
- created_time: string;
1013
- created_by: PartialUserObjectResponse;
1014
- last_edited_time: string;
1015
- last_edited_by: PartialUserObjectResponse;
1016
- has_children: boolean;
1017
- archived: boolean;
1018
- in_trash: boolean;
1019
- };
1020
- type MediaContentWithUrlAndCaptionResponse = {
1021
- url: string;
1022
- caption: Array<RichTextItemResponse>;
1023
- };
1024
- export type EmbedBlockObjectResponse = {
1025
- type: "embed";
1026
- embed: MediaContentWithUrlAndCaptionResponse;
1027
- parent: ParentForBlockBasedObjectResponse;
1028
- object: "block";
1029
- id: string;
1030
- created_time: string;
1031
- created_by: PartialUserObjectResponse;
1032
- last_edited_time: string;
1033
- last_edited_by: PartialUserObjectResponse;
1034
- has_children: boolean;
1035
- archived: boolean;
1036
- in_trash: boolean;
436
+ type?: "link_to_page";
437
+ object?: "block";
438
+ } | {
439
+ table_row: ContentWithTableRowRequest;
440
+ type?: "table_row";
441
+ object?: "block";
442
+ } | {
443
+ heading_1: HeaderContentWithSingleLevelOfChildrenRequest;
444
+ type?: "heading_1";
445
+ object?: "block";
446
+ } | {
447
+ heading_2: HeaderContentWithSingleLevelOfChildrenRequest;
448
+ type?: "heading_2";
449
+ object?: "block";
450
+ } | {
451
+ heading_3: HeaderContentWithSingleLevelOfChildrenRequest;
452
+ type?: "heading_3";
453
+ object?: "block";
454
+ } | {
455
+ paragraph: ContentWithSingleLevelOfChildrenRequest;
456
+ type?: "paragraph";
457
+ object?: "block";
458
+ } | {
459
+ bulleted_list_item: ContentWithSingleLevelOfChildrenRequest;
460
+ type?: "bulleted_list_item";
461
+ object?: "block";
462
+ } | {
463
+ numbered_list_item: ContentWithSingleLevelOfChildrenRequest;
464
+ type?: "numbered_list_item";
465
+ object?: "block";
466
+ } | {
467
+ quote: ContentWithSingleLevelOfChildrenRequest;
468
+ type?: "quote";
469
+ object?: "block";
470
+ } | {
471
+ table: TableRequestWithTableRowChildren;
472
+ type?: "table";
473
+ object?: "block";
474
+ } | {
475
+ to_do: {
476
+ rich_text: Array<RichTextItemRequest>;
477
+ color?: ApiColor;
478
+ children?: Array<BlockObjectRequestWithoutChildren>;
479
+ checked?: boolean;
480
+ };
481
+ type?: "to_do";
482
+ object?: "block";
483
+ } | {
484
+ toggle: ContentWithSingleLevelOfChildrenRequest;
485
+ type?: "toggle";
486
+ object?: "block";
487
+ } | {
488
+ template: {
489
+ rich_text: Array<RichTextItemRequest>;
490
+ children?: Array<BlockObjectRequestWithoutChildren>;
491
+ };
492
+ type?: "template";
493
+ object?: "block";
494
+ } | {
495
+ callout: {
496
+ rich_text: Array<RichTextItemRequest>;
497
+ color?: ApiColor;
498
+ children?: Array<BlockObjectRequestWithoutChildren>;
499
+ icon?: PageIconRequest;
500
+ };
501
+ type?: "callout";
502
+ object?: "block";
503
+ } | {
504
+ synced_block: {
505
+ synced_from: {
506
+ block_id: IdRequest;
507
+ type?: "block_id";
508
+ } | null;
509
+ children?: Array<BlockObjectRequestWithoutChildren>;
510
+ };
511
+ type?: "synced_block";
512
+ object?: "block";
1037
513
  };
1038
514
  export type BookmarkBlockObjectResponse = {
1039
515
  type: "bookmark";
@@ -1049,22 +525,44 @@ export type BookmarkBlockObjectResponse = {
1049
525
  archived: boolean;
1050
526
  in_trash: boolean;
1051
527
  };
1052
- type ExternalMediaContentWithFileAndCaptionResponse = {
1053
- type: "external";
1054
- external: {
1055
- url: TextRequest;
528
+ type BooleanFormulaPropertyResponse = {
529
+ type: "boolean";
530
+ boolean: boolean | null;
531
+ };
532
+ type BooleanFormulaPropertyValueResponse = {
533
+ type: "boolean";
534
+ boolean: boolean | null;
535
+ };
536
+ type BotInfoResponse = {
537
+ owner: {
538
+ type: "user";
539
+ user: {
540
+ id: IdResponse;
541
+ object: "user";
542
+ name: string | null;
543
+ avatar_url: string | null;
544
+ type: "person";
545
+ person: {
546
+ email?: string;
547
+ };
548
+ } | PartialUserObjectResponse;
549
+ } | {
550
+ type: "workspace";
551
+ workspace: true;
1056
552
  };
1057
- caption: Array<RichTextItemResponse>;
553
+ workspace_id: string;
554
+ workspace_limits: {
555
+ max_file_upload_size_in_bytes: number;
556
+ };
557
+ workspace_name: string | null;
1058
558
  };
1059
- type FileMediaContentWithFileAndCaptionResponse = {
1060
- type: "file";
1061
- file: InternalFileResponse;
1062
- caption: Array<RichTextItemResponse>;
559
+ export type BotUserObjectResponse = {
560
+ type: "bot";
561
+ bot: EmptyObject | BotInfoResponse;
1063
562
  };
1064
- type MediaContentWithFileAndCaptionResponse = ExternalMediaContentWithFileAndCaptionResponse | FileMediaContentWithFileAndCaptionResponse;
1065
- export type ImageBlockObjectResponse = {
1066
- type: "image";
1067
- image: MediaContentWithFileAndCaptionResponse;
563
+ export type BreadcrumbBlockObjectResponse = {
564
+ type: "breadcrumb";
565
+ breadcrumb: EmptyObject;
1068
566
  parent: ParentForBlockBasedObjectResponse;
1069
567
  object: "block";
1070
568
  id: string;
@@ -1076,9 +574,9 @@ export type ImageBlockObjectResponse = {
1076
574
  archived: boolean;
1077
575
  in_trash: boolean;
1078
576
  };
1079
- export type VideoBlockObjectResponse = {
1080
- type: "video";
1081
- video: MediaContentWithFileAndCaptionResponse;
577
+ export type BulletedListItemBlockObjectResponse = {
578
+ type: "bulleted_list_item";
579
+ bulleted_list_item: ContentWithRichTextAndColorResponse;
1082
580
  parent: ParentForBlockBasedObjectResponse;
1083
581
  object: "block";
1084
582
  id: string;
@@ -1090,38 +588,27 @@ export type VideoBlockObjectResponse = {
1090
588
  archived: boolean;
1091
589
  in_trash: boolean;
1092
590
  };
1093
- export type PdfBlockObjectResponse = {
1094
- type: "pdf";
1095
- pdf: MediaContentWithFileAndCaptionResponse;
1096
- parent: ParentForBlockBasedObjectResponse;
1097
- object: "block";
1098
- id: string;
1099
- created_time: string;
1100
- created_by: PartialUserObjectResponse;
1101
- last_edited_time: string;
1102
- last_edited_by: PartialUserObjectResponse;
1103
- has_children: boolean;
1104
- archived: boolean;
1105
- in_trash: boolean;
591
+ type ButtonPropertyConfigurationRequest = {
592
+ type?: "button";
593
+ button: EmptyObject;
1106
594
  };
1107
- type ExternalMediaContentWithFileNameAndCaptionResponse = {
1108
- type: "external";
1109
- external: {
1110
- url: TextRequest;
1111
- };
1112
- caption: Array<RichTextItemResponse>;
1113
- name: string;
595
+ export type ButtonPropertyItemObjectResponse = {
596
+ type: "button";
597
+ button: EmptyObject;
598
+ object: "property_item";
599
+ id: string;
1114
600
  };
1115
- type FileMediaContentWithFileNameAndCaptionResponse = {
1116
- type: "file";
1117
- file: InternalFileResponse;
1118
- caption: Array<RichTextItemResponse>;
1119
- name: string;
601
+ type ButtonSimplePropertyValueResponse = {
602
+ type: "button";
603
+ button: EmptyObject;
1120
604
  };
1121
- type MediaContentWithFileNameAndCaptionResponse = ExternalMediaContentWithFileNameAndCaptionResponse | FileMediaContentWithFileNameAndCaptionResponse;
1122
- export type FileBlockObjectResponse = {
1123
- type: "file";
1124
- file: MediaContentWithFileNameAndCaptionResponse;
605
+ export type CalloutBlockObjectResponse = {
606
+ type: "callout";
607
+ callout: {
608
+ rich_text: Array<RichTextItemResponse>;
609
+ color: ApiColor;
610
+ icon: PageIconResponse | null;
611
+ };
1125
612
  parent: ParentForBlockBasedObjectResponse;
1126
613
  object: "block";
1127
614
  id: string;
@@ -1133,40 +620,32 @@ export type FileBlockObjectResponse = {
1133
620
  archived: boolean;
1134
621
  in_trash: boolean;
1135
622
  };
1136
- export type AudioBlockObjectResponse = {
1137
- type: "audio";
1138
- audio: MediaContentWithFileAndCaptionResponse;
1139
- parent: ParentForBlockBasedObjectResponse;
1140
- object: "block";
1141
- id: string;
1142
- created_time: string;
1143
- created_by: PartialUserObjectResponse;
1144
- last_edited_time: string;
1145
- last_edited_by: PartialUserObjectResponse;
1146
- has_children: boolean;
1147
- archived: boolean;
1148
- in_trash: boolean;
623
+ type CheckboxDatabasePropertyConfigResponse = {
624
+ type: "checkbox";
625
+ checkbox: EmptyObject;
1149
626
  };
1150
- type MediaContentWithUrlResponse = {
1151
- url: TextRequest;
627
+ type CheckboxPropertyConfigurationRequest = {
628
+ type?: "checkbox";
629
+ checkbox: EmptyObject;
1152
630
  };
1153
- export type LinkPreviewBlockObjectResponse = {
1154
- type: "link_preview";
1155
- link_preview: MediaContentWithUrlResponse;
1156
- parent: ParentForBlockBasedObjectResponse;
1157
- object: "block";
631
+ type CheckboxPropertyFilter = {
632
+ equals: boolean;
633
+ } | {
634
+ does_not_equal: boolean;
635
+ };
636
+ export type CheckboxPropertyItemObjectResponse = {
637
+ type: "checkbox";
638
+ checkbox: boolean;
639
+ object: "property_item";
1158
640
  id: string;
1159
- created_time: string;
1160
- created_by: PartialUserObjectResponse;
1161
- last_edited_time: string;
1162
- last_edited_by: PartialUserObjectResponse;
1163
- has_children: boolean;
1164
- archived: boolean;
1165
- in_trash: boolean;
1166
641
  };
1167
- export type UnsupportedBlockObjectResponse = {
1168
- type: "unsupported";
1169
- unsupported: EmptyObject;
642
+ type CheckboxSimplePropertyValueResponse = {
643
+ type: "checkbox";
644
+ checkbox: boolean;
645
+ };
646
+ export type ChildDatabaseBlockObjectResponse = {
647
+ type: "child_database";
648
+ child_database: TitleObjectResponse;
1170
649
  parent: ParentForBlockBasedObjectResponse;
1171
650
  object: "block";
1172
651
  id: string;
@@ -1178,318 +657,207 @@ export type UnsupportedBlockObjectResponse = {
1178
657
  archived: boolean;
1179
658
  in_trash: boolean;
1180
659
  };
1181
- export type BlockObjectResponse = ParagraphBlockObjectResponse | Heading1BlockObjectResponse | Heading2BlockObjectResponse | Heading3BlockObjectResponse | BulletedListItemBlockObjectResponse | NumberedListItemBlockObjectResponse | QuoteBlockObjectResponse | ToDoBlockObjectResponse | ToggleBlockObjectResponse | TemplateBlockObjectResponse | SyncedBlockBlockObjectResponse | ChildPageBlockObjectResponse | ChildDatabaseBlockObjectResponse | EquationBlockObjectResponse | CodeBlockObjectResponse | CalloutBlockObjectResponse | DividerBlockObjectResponse | BreadcrumbBlockObjectResponse | TableOfContentsBlockObjectResponse | ColumnListBlockObjectResponse | ColumnBlockObjectResponse | LinkToPageBlockObjectResponse | TableBlockObjectResponse | TableRowBlockObjectResponse | EmbedBlockObjectResponse | BookmarkBlockObjectResponse | ImageBlockObjectResponse | VideoBlockObjectResponse | PdfBlockObjectResponse | FileBlockObjectResponse | AudioBlockObjectResponse | LinkPreviewBlockObjectResponse | UnsupportedBlockObjectResponse;
1182
- export type NumberPropertyItemObjectResponse = {
1183
- type: "number";
1184
- number: number | null;
1185
- object: "property_item";
1186
- id: string;
1187
- };
1188
- export type UrlPropertyItemObjectResponse = {
1189
- type: "url";
1190
- url: string | null;
1191
- object: "property_item";
1192
- id: string;
1193
- };
1194
- export type SelectPropertyItemObjectResponse = {
1195
- type: "select";
1196
- select: PartialSelectResponse | null;
1197
- object: "property_item";
1198
- id: string;
1199
- };
1200
- export type MultiSelectPropertyItemObjectResponse = {
1201
- type: "multi_select";
1202
- multi_select: Array<PartialSelectResponse>;
1203
- object: "property_item";
1204
- id: string;
1205
- };
1206
- export type StatusPropertyItemObjectResponse = {
1207
- type: "status";
1208
- status: PartialSelectResponse | null;
1209
- object: "property_item";
1210
- id: string;
1211
- };
1212
- export type DatePropertyItemObjectResponse = {
1213
- type: "date";
1214
- date: DateResponse | null;
1215
- object: "property_item";
1216
- id: string;
1217
- };
1218
- export type EmailPropertyItemObjectResponse = {
1219
- type: "email";
1220
- email: string | null;
1221
- object: "property_item";
1222
- id: string;
1223
- };
1224
- export type PhoneNumberPropertyItemObjectResponse = {
1225
- type: "phone_number";
1226
- phone_number: string | null;
1227
- object: "property_item";
1228
- id: string;
1229
- };
1230
- export type CheckboxPropertyItemObjectResponse = {
1231
- type: "checkbox";
1232
- checkbox: boolean;
1233
- object: "property_item";
1234
- id: string;
1235
- };
1236
- export type FilesPropertyItemObjectResponse = {
1237
- type: "files";
1238
- files: Array<InternalOrExternalFileWithNameResponse>;
1239
- object: "property_item";
660
+ export type ChildPageBlockObjectResponse = {
661
+ type: "child_page";
662
+ child_page: TitleObjectResponse;
663
+ parent: ParentForBlockBasedObjectResponse;
664
+ object: "block";
1240
665
  id: string;
666
+ created_time: string;
667
+ created_by: PartialUserObjectResponse;
668
+ last_edited_time: string;
669
+ last_edited_by: PartialUserObjectResponse;
670
+ has_children: boolean;
671
+ archived: boolean;
672
+ in_trash: boolean;
1241
673
  };
1242
- export type CreatedByPropertyItemObjectResponse = {
1243
- type: "created_by";
1244
- created_by: PartialUserObjectResponse | UserObjectResponse;
1245
- object: "property_item";
674
+ export type CodeBlockObjectResponse = {
675
+ type: "code";
676
+ code: {
677
+ rich_text: Array<RichTextItemResponse>;
678
+ caption: Array<RichTextItemResponse>;
679
+ language: LanguageRequest;
680
+ };
681
+ parent: ParentForBlockBasedObjectResponse;
682
+ object: "block";
1246
683
  id: string;
1247
- };
1248
- export type CreatedTimePropertyItemObjectResponse = {
1249
- type: "created_time";
1250
684
  created_time: string;
1251
- object: "property_item";
1252
- id: string;
685
+ created_by: PartialUserObjectResponse;
686
+ last_edited_time: string;
687
+ last_edited_by: PartialUserObjectResponse;
688
+ has_children: boolean;
689
+ archived: boolean;
690
+ in_trash: boolean;
1253
691
  };
1254
- export type LastEditedByPropertyItemObjectResponse = {
1255
- type: "last_edited_by";
1256
- last_edited_by: PartialUserObjectResponse | UserObjectResponse;
1257
- object: "property_item";
692
+ export type ColumnBlockObjectResponse = {
693
+ type: "column";
694
+ column: ColumnResponse;
695
+ parent: ParentForBlockBasedObjectResponse;
696
+ object: "block";
1258
697
  id: string;
1259
- };
1260
- export type LastEditedTimePropertyItemObjectResponse = {
1261
- type: "last_edited_time";
698
+ created_time: string;
699
+ created_by: PartialUserObjectResponse;
1262
700
  last_edited_time: string;
1263
- object: "property_item";
1264
- id: string;
701
+ last_edited_by: PartialUserObjectResponse;
702
+ has_children: boolean;
703
+ archived: boolean;
704
+ in_trash: boolean;
1265
705
  };
1266
- export type FormulaPropertyItemObjectResponse = {
1267
- type: "formula";
1268
- formula: FormulaPropertyResponse;
1269
- object: "property_item";
1270
- id: string;
706
+ type ColumnBlockWithChildrenRequest = {
707
+ column: ColumnWithChildrenRequest;
708
+ type?: "column";
709
+ object?: "block";
1271
710
  };
1272
- export type ButtonPropertyItemObjectResponse = {
1273
- type: "button";
1274
- button: EmptyObject;
1275
- object: "property_item";
711
+ export type ColumnListBlockObjectResponse = {
712
+ type: "column_list";
713
+ column_list: EmptyObject;
714
+ parent: ParentForBlockBasedObjectResponse;
715
+ object: "block";
1276
716
  id: string;
717
+ created_time: string;
718
+ created_by: PartialUserObjectResponse;
719
+ last_edited_time: string;
720
+ last_edited_by: PartialUserObjectResponse;
721
+ has_children: boolean;
722
+ archived: boolean;
723
+ in_trash: boolean;
1277
724
  };
1278
- export type UniqueIdPropertyItemObjectResponse = {
1279
- type: "unique_id";
1280
- unique_id: {
1281
- prefix: string | null;
1282
- number: number | null;
725
+ type ColumnListRequest = {
726
+ children: Array<ColumnBlockWithChildrenRequest>;
727
+ };
728
+ type ColumnResponse = {
729
+ width_ratio?: number;
730
+ };
731
+ type ColumnWithChildrenRequest = {
732
+ children: Array<BlockObjectWithSingleLevelOfChildrenRequest>;
733
+ width_ratio?: number;
734
+ };
735
+ export type CommentObjectResponse = {
736
+ object: "comment";
737
+ id: IdResponse;
738
+ parent: CommentParentResponse;
739
+ discussion_id: IdResponse;
740
+ created_time: string;
741
+ last_edited_time: string;
742
+ created_by: PartialUserObjectResponse;
743
+ rich_text: Array<RichTextItemResponse>;
744
+ display_name: {
745
+ type: "custom" | "user" | "integration";
746
+ resolved_name: string | null;
1283
747
  };
1284
- object: "property_item";
1285
- id: string;
748
+ attachments?: Array<{
749
+ category: "audio" | "image" | "pdf" | "productivity" | "video";
750
+ file: InternalFileResponse;
751
+ }>;
1286
752
  };
1287
- export type VerificationPropertyItemObjectResponse = {
1288
- type: "verification";
1289
- verification: VerificationPropertyValueResponse | null;
1290
- object: "property_item";
1291
- id: string;
753
+ type CommentParentResponse = PageIdCommentParentResponse | BlockIdCommentParentResponse;
754
+ type ContentWithExpressionRequest = {
755
+ expression: string;
1292
756
  };
1293
- export type TitlePropertyItemObjectResponse = {
1294
- type: "title";
1295
- title: RichTextItemResponse;
1296
- object: "property_item";
1297
- id: string;
757
+ type ContentWithRichTextAndColorRequest = {
758
+ rich_text: Array<RichTextItemRequest>;
759
+ color?: ApiColor;
1298
760
  };
1299
- export type RichTextPropertyItemObjectResponse = {
1300
- type: "rich_text";
1301
- rich_text: RichTextItemResponse;
1302
- object: "property_item";
1303
- id: string;
761
+ type ContentWithRichTextAndColorResponse = {
762
+ rich_text: Array<RichTextItemResponse>;
763
+ color: ApiColor;
1304
764
  };
1305
- export type PeoplePropertyItemObjectResponse = {
1306
- type: "people";
1307
- people: PartialUserObjectResponse | UserObjectResponse;
1308
- object: "property_item";
1309
- id: string;
765
+ type ContentWithRichTextRequest = {
766
+ rich_text: Array<RichTextItemRequest>;
1310
767
  };
1311
- export type RelationPropertyItemObjectResponse = {
1312
- type: "relation";
1313
- relation: {
1314
- id: string;
1315
- };
1316
- object: "property_item";
1317
- id: string;
768
+ type ContentWithSingleLevelOfChildrenRequest = {
769
+ rich_text: Array<RichTextItemRequest>;
770
+ color?: ApiColor;
771
+ children?: Array<BlockObjectRequestWithoutChildren>;
1318
772
  };
1319
- export type RollupPropertyItemObjectResponse = {
1320
- type: "rollup";
1321
- rollup: {
1322
- type: "number";
1323
- number: number | null;
1324
- function: RollupFunction;
1325
- } | {
1326
- type: "date";
1327
- date: DateResponse | null;
1328
- function: RollupFunction;
1329
- } | {
1330
- type: "array";
1331
- array: Array<EmptyObject>;
1332
- function: RollupFunction;
1333
- } | {
1334
- type: "unsupported";
1335
- unsupported: EmptyObject;
1336
- function: RollupFunction;
1337
- } | {
1338
- type: "incomplete";
1339
- incomplete: EmptyObject;
1340
- function: RollupFunction;
1341
- };
1342
- object: "property_item";
1343
- id: string;
773
+ type ContentWithTableResponse = {
774
+ has_column_header: boolean;
775
+ has_row_header: boolean;
776
+ table_width: number;
1344
777
  };
1345
- export type PropertyItemObjectResponse = NumberPropertyItemObjectResponse | UrlPropertyItemObjectResponse | SelectPropertyItemObjectResponse | MultiSelectPropertyItemObjectResponse | StatusPropertyItemObjectResponse | DatePropertyItemObjectResponse | EmailPropertyItemObjectResponse | PhoneNumberPropertyItemObjectResponse | CheckboxPropertyItemObjectResponse | FilesPropertyItemObjectResponse | CreatedByPropertyItemObjectResponse | CreatedTimePropertyItemObjectResponse | LastEditedByPropertyItemObjectResponse | LastEditedTimePropertyItemObjectResponse | FormulaPropertyItemObjectResponse | ButtonPropertyItemObjectResponse | UniqueIdPropertyItemObjectResponse | VerificationPropertyItemObjectResponse | TitlePropertyItemObjectResponse | RichTextPropertyItemObjectResponse | PeoplePropertyItemObjectResponse | RelationPropertyItemObjectResponse | RollupPropertyItemObjectResponse;
1346
- type PropertyItemPropertyItemListResponse = {
1347
- type: "property_item";
1348
- property_item: {
1349
- type: "title";
1350
- title: EmptyObject;
1351
- next_url: string | null;
1352
- id: string;
1353
- } | {
1354
- type: "rich_text";
1355
- rich_text: EmptyObject;
1356
- next_url: string | null;
1357
- id: string;
1358
- } | {
1359
- type: "people";
1360
- people: EmptyObject;
1361
- next_url: string | null;
1362
- id: string;
1363
- } | {
1364
- type: "relation";
1365
- relation: EmptyObject;
1366
- next_url: string | null;
1367
- id: string;
1368
- } | {
1369
- type: "rollup";
1370
- rollup: {
1371
- type: "number";
1372
- number: number | null;
1373
- function: RollupFunction;
1374
- } | {
1375
- type: "date";
1376
- date: DateResponse | null;
1377
- function: RollupFunction;
1378
- } | {
1379
- type: "array";
1380
- array: Array<EmptyObject>;
1381
- function: RollupFunction;
1382
- } | {
1383
- type: "unsupported";
1384
- unsupported: EmptyObject;
1385
- function: RollupFunction;
1386
- } | {
1387
- type: "incomplete";
1388
- incomplete: EmptyObject;
1389
- function: RollupFunction;
1390
- };
1391
- next_url: string | null;
1392
- id: string;
1393
- };
1394
- object: "list";
1395
- next_cursor: string | null;
1396
- has_more: boolean;
1397
- results: Array<PropertyItemObjectResponse>;
778
+ type ContentWithTableRowRequest = {
779
+ cells: Array<Array<RichTextItemRequest>>;
1398
780
  };
1399
- export type PropertyItemListResponse = PropertyItemPropertyItemListResponse;
1400
- type DatabasePropertyRelationConfigResponseCommon = {
1401
- database_id: IdResponse;
1402
- data_source_id: IdResponse;
781
+ type ContentWithTableRowResponse = {
782
+ cells: Array<Array<RichTextItemResponse>>;
1403
783
  };
1404
- type DatabasePropertyConfigResponseCommon = {
1405
- id: string;
1406
- name: string;
1407
- description: PropertyDescriptionRequest | null;
784
+ type CreatedByDatabasePropertyConfigResponse = {
785
+ type: "created_by";
786
+ created_by: EmptyObject;
1408
787
  };
1409
- export type UserObjectResponseCommon = {
1410
- id: IdResponse;
1411
- object: "user";
1412
- name: string | null;
1413
- avatar_url: string | null;
788
+ type CreatedByPropertyConfigurationRequest = {
789
+ type?: "created_by";
790
+ created_by: EmptyObject;
1414
791
  };
1415
- type UserValueResponse = PartialUserObjectResponse | UserObjectResponse;
1416
- export type RichTextItemResponseCommon = {
1417
- plain_text: string;
1418
- href: string | null;
1419
- annotations: AnnotationResponse;
792
+ export type CreatedByPropertyItemObjectResponse = {
793
+ type: "created_by";
794
+ created_by: PartialUserObjectResponse | UserObjectResponse;
795
+ object: "property_item";
796
+ id: string;
1420
797
  };
1421
- type ParentOfDatabaseResponse = PageIdParentForBlockBasedObjectResponse | WorkspaceParentForBlockBasedObjectResponse | DatabaseParentResponse | BlockIdParentForBlockBasedObjectResponse;
1422
- export type PartialCommentObjectResponse = {
1423
- object: "comment";
1424
- id: IdResponse;
798
+ type CreatedBySimplePropertyValueResponse = {
799
+ type: "created_by";
800
+ created_by: UserValueResponse;
1425
801
  };
1426
- type PageIdCommentParentResponse = {
1427
- type: "page_id";
1428
- page_id: IdResponse;
802
+ type CreatedTimeDatabasePropertyConfigResponse = {
803
+ type: "created_time";
804
+ created_time: EmptyObject;
1429
805
  };
1430
- type BlockIdCommentParentResponse = {
1431
- type: "block_id";
1432
- block_id: IdResponse;
806
+ type CreatedTimePropertyConfigurationRequest = {
807
+ type?: "created_time";
808
+ created_time: EmptyObject;
1433
809
  };
1434
- type CommentParentResponse = PageIdCommentParentResponse | BlockIdCommentParentResponse;
1435
- export type CommentObjectResponse = {
1436
- object: "comment";
1437
- id: IdResponse;
1438
- parent: CommentParentResponse;
1439
- discussion_id: IdResponse;
810
+ export type CreatedTimePropertyItemObjectResponse = {
811
+ type: "created_time";
1440
812
  created_time: string;
1441
- last_edited_time: string;
1442
- created_by: PartialUserObjectResponse;
1443
- rich_text: Array<RichTextItemResponse>;
1444
- display_name: {
1445
- type: "custom" | "user" | "integration";
1446
- resolved_name: string | null;
813
+ object: "property_item";
814
+ id: string;
815
+ };
816
+ type CreatedTimeSimplePropertyValueResponse = {
817
+ type: "created_time";
818
+ created_time: string;
819
+ };
820
+ type CustomEmojiPageIconRequest = {
821
+ type?: "custom_emoji";
822
+ custom_emoji: {
823
+ id: IdRequest;
824
+ name?: string;
825
+ url?: string;
1447
826
  };
1448
- attachments?: Array<{
1449
- category: "audio" | "image" | "pdf" | "productivity" | "video";
1450
- file: InternalFileResponse;
1451
- }>;
1452
827
  };
1453
- export type FileUploadObjectResponse = {
1454
- object: "file_upload";
828
+ type CustomEmojiPageIconResponse = {
829
+ type: "custom_emoji";
830
+ custom_emoji: CustomEmojiResponse;
831
+ };
832
+ type CustomEmojiResponse = {
1455
833
  id: IdResponse;
834
+ name: string;
835
+ url: string;
836
+ };
837
+ export type DataSourceObjectResponse = {
838
+ object: "data_source";
839
+ id: IdResponse;
840
+ title: Array<RichTextItemResponse>;
841
+ description: Array<RichTextItemResponse>;
842
+ parent: ParentOfDataSourceResponse;
843
+ database_parent: ParentOfDatabaseResponse;
844
+ is_inline: boolean;
845
+ archived: boolean;
846
+ in_trash: boolean;
1456
847
  created_time: string;
1457
- created_by: {
1458
- id: IdResponse;
1459
- type: "person" | "bot" | "agent";
1460
- };
1461
848
  last_edited_time: string;
1462
- archived: boolean;
1463
- expiry_time: string | null;
1464
- status: "pending" | "uploaded" | "expired" | "failed";
1465
- filename: string | null;
1466
- content_type: string | null;
1467
- content_length: number | null;
1468
- upload_url?: string;
1469
- complete_url?: string;
1470
- file_import_result?: {
1471
- imported_time: string;
1472
- } & ({
1473
- type: "success";
1474
- success: EmptyObject;
1475
- } | {
1476
- type: "error";
1477
- error: {
1478
- type: "validation_error" | "internal_system_error" | "download_error" | "upload_error";
1479
- code: string;
1480
- message: string;
1481
- parameter: string | null;
1482
- status_code: number | null;
1483
- };
1484
- });
1485
- number_of_parts?: {
1486
- total: number;
1487
- sent: number;
1488
- };
849
+ created_by: PartialUserObjectResponse;
850
+ last_edited_by: PartialUserObjectResponse;
851
+ properties: Record<string, DatabasePropertyConfigResponse>;
852
+ icon: PageIconResponse | null;
853
+ cover: PageCoverResponse | null;
854
+ url: string;
855
+ public_url: string | null;
1489
856
  };
1490
- export type PartialDatabaseObjectResponse = {
1491
- object: "database";
1492
- id: IdResponse;
857
+ type DataSourceParentResponse = {
858
+ type: "data_source_id";
859
+ data_source_id: IdResponse;
860
+ database_id: IdResponse;
1493
861
  };
1494
862
  type DataSourceReferenceResponse = {
1495
863
  id: IdResponse;
@@ -1512,630 +880,741 @@ export type DatabaseObjectResponse = {
1512
880
  url: string;
1513
881
  public_url: string | null;
1514
882
  };
1515
- type AnnotationRequest = {
1516
- bold?: boolean;
1517
- italic?: boolean;
1518
- strikethrough?: boolean;
1519
- underline?: boolean;
1520
- code?: boolean;
1521
- color?: ApiColor;
883
+ type DatabaseParentResponse = {
884
+ type: "database_id";
885
+ database_id: IdResponse;
1522
886
  };
1523
- type PartialUserObjectRequest = {
1524
- id: IdRequest;
1525
- object?: "user";
887
+ type DatabasePropertyConfigResponse = DatabasePropertyConfigResponseCommon & (NumberDatabasePropertyConfigResponse | FormulaDatabasePropertyConfigResponse | SelectDatabasePropertyConfigResponse | MultiSelectDatabasePropertyConfigResponse | StatusDatabasePropertyConfigResponse | RelationDatabasePropertyConfigResponse | RollupDatabasePropertyConfigResponse | UniqueIdDatabasePropertyConfigResponse | TitleDatabasePropertyConfigResponse | RichTextDatabasePropertyConfigResponse | UrlDatabasePropertyConfigResponse | PeopleDatabasePropertyConfigResponse | FilesDatabasePropertyConfigResponse | EmailDatabasePropertyConfigResponse | PhoneNumberDatabasePropertyConfigResponse | DateDatabasePropertyConfigResponse | CheckboxDatabasePropertyConfigResponse | CreatedByDatabasePropertyConfigResponse | CreatedTimeDatabasePropertyConfigResponse | LastEditedByDatabasePropertyConfigResponse | LastEditedTimeDatabasePropertyConfigResponse);
888
+ type DatabasePropertyConfigResponseCommon = {
889
+ id: string;
890
+ name: string;
891
+ description: PropertyDescriptionRequest | null;
892
+ };
893
+ type DatabasePropertyRelationConfigResponse = DatabasePropertyRelationConfigResponseCommon & (SinglePropertyDatabasePropertyRelationConfigResponse | DualPropertyDatabasePropertyRelationConfigResponse);
894
+ type DatabasePropertyRelationConfigResponseCommon = {
895
+ database_id: IdResponse;
896
+ data_source_id: IdResponse;
897
+ };
898
+ type DateDatabasePropertyConfigResponse = {
899
+ type: "date";
900
+ date: EmptyObject;
901
+ };
902
+ type DateFormulaPropertyResponse = {
903
+ type: "date";
904
+ date: DateResponse | null;
905
+ };
906
+ type DateFormulaPropertyValueResponse = {
907
+ type: "date";
908
+ date: DateResponse | null;
909
+ };
910
+ type DatePartialRollupValueResponse = {
911
+ type: "date";
912
+ date: DateResponse | null;
913
+ };
914
+ type DatePropertyConfigurationRequest = {
915
+ type?: "date";
916
+ date: EmptyObject;
917
+ };
918
+ type DatePropertyFilter = {
919
+ equals: string;
920
+ } | {
921
+ before: string;
922
+ } | {
923
+ after: string;
924
+ } | {
925
+ on_or_before: string;
926
+ } | {
927
+ on_or_after: string;
928
+ } | {
929
+ this_week: EmptyObject;
930
+ } | {
931
+ past_week: EmptyObject;
932
+ } | {
933
+ past_month: EmptyObject;
934
+ } | {
935
+ past_year: EmptyObject;
936
+ } | {
937
+ next_week: EmptyObject;
938
+ } | {
939
+ next_month: EmptyObject;
940
+ } | {
941
+ next_year: EmptyObject;
942
+ } | ExistencePropertyFilter;
943
+ export type DatePropertyItemObjectResponse = {
944
+ type: "date";
945
+ date: DateResponse | null;
946
+ object: "property_item";
947
+ id: string;
1526
948
  };
1527
949
  type DateRequest = {
1528
950
  start: string;
1529
951
  end?: string | null;
1530
952
  time_zone?: TimeZoneRequest | null;
1531
953
  };
1532
- type TemplateMentionRequest = TemplateMentionDateTemplateMentionRequest | TemplateMentionUserTemplateMentionRequest;
1533
- type RichTextItemRequest = RichTextItemRequestCommon & (TextRichTextItemRequest | MentionRichTextItemRequest | EquationRichTextItemRequest);
1534
- type GroupObjectRequest = {
1535
- id: IdRequest;
1536
- name?: string | null;
1537
- object?: "group";
954
+ type DateResponse = {
955
+ start: string;
956
+ end: string | null;
957
+ time_zone: TimeZoneRequest | null;
1538
958
  };
1539
- type RelationItemPropertyValueResponse = {
1540
- id: IdRequest;
959
+ type DateSimplePropertyValueResponse = {
960
+ type: "date";
961
+ date: DateResponse | null;
1541
962
  };
1542
- type InternalFileRequest = {
1543
- url: string;
1544
- expiry_time?: string;
963
+ export type DividerBlockObjectResponse = {
964
+ type: "divider";
965
+ divider: EmptyObject;
966
+ parent: ParentForBlockBasedObjectResponse;
967
+ object: "block";
968
+ id: string;
969
+ created_time: string;
970
+ created_by: PartialUserObjectResponse;
971
+ last_edited_time: string;
972
+ last_edited_by: PartialUserObjectResponse;
973
+ has_children: boolean;
974
+ archived: boolean;
975
+ in_trash: boolean;
1545
976
  };
1546
- type ExternalFileRequest = {
1547
- url: TextRequest;
977
+ type DualPropertyDatabasePropertyRelationConfigResponse = {
978
+ type?: "dual_property";
979
+ dual_property: {
980
+ synced_property_id: string;
981
+ synced_property_name: string;
982
+ };
1548
983
  };
1549
- type InternalOrExternalFileWithNameRequest = {
1550
- file: InternalFileRequest;
1551
- name: StringRequest;
1552
- type?: "file";
1553
- } | {
1554
- external: ExternalFileRequest;
1555
- name: StringRequest;
1556
- type?: "external";
984
+ type EmailDatabasePropertyConfigResponse = {
985
+ type: "email";
986
+ email: EmptyObject;
1557
987
  };
1558
- type FileUploadIdRequest = {
1559
- id: IdRequest;
988
+ type EmailPropertyConfigurationRequest = {
989
+ type?: "email";
990
+ email: EmptyObject;
1560
991
  };
1561
- type FileUploadWithOptionalNameRequest = {
1562
- file_upload: FileUploadIdRequest;
1563
- type?: "file_upload";
1564
- name?: StringRequest;
992
+ export type EmailPropertyItemObjectResponse = {
993
+ type: "email";
994
+ email: string | null;
995
+ object: "property_item";
996
+ id: string;
1565
997
  };
1566
- type PageIconRequest = FileUploadPageIconRequest | EmojiPageIconRequest | ExternalPageIconRequest | CustomEmojiPageIconRequest;
1567
- type PageCoverRequest = FileUploadPageCoverRequest | ExternalPageCoverRequest;
1568
- type MediaContentWithUrlAndCaptionRequest = {
1569
- url: string;
1570
- caption?: Array<RichTextItemRequest>;
998
+ type EmailSimplePropertyValueResponse = {
999
+ type: "email";
1000
+ email: string | null;
1571
1001
  };
1572
- type MediaContentWithFileAndCaptionRequest = {
1573
- external: ExternalFileRequest;
1574
- type?: "external";
1575
- caption?: Array<RichTextItemRequest>;
1576
- } | {
1577
- file_upload: FileUploadIdRequest;
1578
- type?: "file_upload";
1579
- caption?: Array<RichTextItemRequest>;
1002
+ export type EmbedBlockObjectResponse = {
1003
+ type: "embed";
1004
+ embed: MediaContentWithUrlAndCaptionResponse;
1005
+ parent: ParentForBlockBasedObjectResponse;
1006
+ object: "block";
1007
+ id: string;
1008
+ created_time: string;
1009
+ created_by: PartialUserObjectResponse;
1010
+ last_edited_time: string;
1011
+ last_edited_by: PartialUserObjectResponse;
1012
+ has_children: boolean;
1013
+ archived: boolean;
1014
+ in_trash: boolean;
1580
1015
  };
1581
- type MediaContentWithFileNameAndCaptionRequest = {
1582
- external: ExternalFileRequest;
1583
- type?: "external";
1584
- caption?: Array<RichTextItemRequest>;
1585
- name?: StringRequest;
1586
- } | {
1587
- file_upload: FileUploadIdRequest;
1588
- type?: "file_upload";
1589
- caption?: Array<RichTextItemRequest>;
1590
- name?: StringRequest;
1016
+ type EmojiPageIconRequest = {
1017
+ type?: "emoji";
1018
+ emoji: EmojiRequest;
1591
1019
  };
1592
- type ContentWithExpressionRequest = {
1593
- expression: string;
1020
+ type EmojiPageIconResponse = {
1021
+ type: "emoji";
1022
+ emoji: EmojiRequest;
1594
1023
  };
1595
- type ContentWithTableRowRequest = {
1596
- cells: Array<Array<RichTextItemRequest>>;
1024
+ type EmojiRequest = string;
1025
+ type EmptyObject = Record<string, never>;
1026
+ export type EquationBlockObjectResponse = {
1027
+ type: "equation";
1028
+ equation: ExpressionObjectResponse;
1029
+ parent: ParentForBlockBasedObjectResponse;
1030
+ object: "block";
1031
+ id: string;
1032
+ created_time: string;
1033
+ created_by: PartialUserObjectResponse;
1034
+ last_edited_time: string;
1035
+ last_edited_by: PartialUserObjectResponse;
1036
+ has_children: boolean;
1037
+ archived: boolean;
1038
+ in_trash: boolean;
1597
1039
  };
1598
- type TableRowRequest = {
1599
- table_row: ContentWithTableRowRequest;
1600
- type?: "table_row";
1601
- object?: "block";
1040
+ type EquationRichTextItemRequest = {
1041
+ type?: "equation";
1042
+ equation: {
1043
+ expression: string;
1044
+ };
1602
1045
  };
1603
- type TableRequestWithTableRowChildren = {
1604
- table_width: number;
1605
- children: Array<TableRowRequest>;
1606
- has_column_header?: boolean;
1607
- has_row_header?: boolean;
1046
+ export type EquationRichTextItemResponse = {
1047
+ type: "equation";
1048
+ equation: {
1049
+ expression: string;
1050
+ };
1608
1051
  };
1609
- type HeaderContentWithRichTextAndColorRequest = {
1610
- rich_text: Array<RichTextItemRequest>;
1611
- color?: ApiColor;
1612
- is_toggleable?: boolean;
1052
+ type ExistencePropertyFilter = {
1053
+ is_empty: true;
1054
+ } | {
1055
+ is_not_empty: true;
1613
1056
  };
1614
- type ContentWithRichTextAndColorRequest = {
1615
- rich_text: Array<RichTextItemRequest>;
1616
- color?: ApiColor;
1057
+ type ExpressionObjectResponse = {
1058
+ expression: string;
1617
1059
  };
1618
- type ContentWithRichTextRequest = {
1619
- rich_text: Array<RichTextItemRequest>;
1060
+ type ExternalFileRequest = {
1061
+ url: TextRequest;
1620
1062
  };
1621
- export type BlockObjectRequestWithoutChildren = {
1622
- embed: MediaContentWithUrlAndCaptionRequest;
1623
- type?: "embed";
1624
- object?: "block";
1625
- } | {
1626
- bookmark: MediaContentWithUrlAndCaptionRequest;
1627
- type?: "bookmark";
1628
- object?: "block";
1629
- } | {
1630
- image: MediaContentWithFileAndCaptionRequest;
1631
- type?: "image";
1632
- object?: "block";
1633
- } | {
1634
- video: MediaContentWithFileAndCaptionRequest;
1635
- type?: "video";
1636
- object?: "block";
1637
- } | {
1638
- pdf: MediaContentWithFileAndCaptionRequest;
1639
- type?: "pdf";
1640
- object?: "block";
1641
- } | {
1642
- file: MediaContentWithFileNameAndCaptionRequest;
1643
- type?: "file";
1644
- object?: "block";
1645
- } | {
1646
- audio: MediaContentWithFileAndCaptionRequest;
1647
- type?: "audio";
1648
- object?: "block";
1649
- } | {
1650
- code: {
1651
- rich_text: Array<RichTextItemRequest>;
1652
- language: LanguageRequest;
1653
- caption?: Array<RichTextItemRequest>;
1063
+ type ExternalInternalOrExternalFileWithNameResponse = {
1064
+ type: "external";
1065
+ external: {
1066
+ url: string;
1654
1067
  };
1655
- type?: "code";
1656
- object?: "block";
1657
- } | {
1658
- equation: ContentWithExpressionRequest;
1659
- type?: "equation";
1660
- object?: "block";
1661
- } | {
1662
- divider: EmptyObject;
1663
- type?: "divider";
1664
- object?: "block";
1665
- } | {
1666
- breadcrumb: EmptyObject;
1667
- type?: "breadcrumb";
1668
- object?: "block";
1669
- } | {
1670
- table_of_contents: {
1671
- color?: ApiColor;
1068
+ };
1069
+ type ExternalMediaContentWithFileAndCaptionResponse = {
1070
+ type: "external";
1071
+ external: {
1072
+ url: TextRequest;
1672
1073
  };
1673
- type?: "table_of_contents";
1674
- object?: "block";
1675
- } | {
1676
- link_to_page: {
1677
- page_id: IdRequest;
1678
- type?: "page_id";
1679
- } | {
1680
- database_id: IdRequest;
1681
- type?: "database_id";
1682
- } | {
1683
- comment_id: IdRequest;
1684
- type?: "comment_id";
1074
+ caption: Array<RichTextItemResponse>;
1075
+ };
1076
+ type ExternalMediaContentWithFileNameAndCaptionResponse = {
1077
+ type: "external";
1078
+ external: {
1079
+ url: TextRequest;
1685
1080
  };
1686
- type?: "link_to_page";
1687
- object?: "block";
1688
- } | {
1689
- table_row: ContentWithTableRowRequest;
1690
- type?: "table_row";
1691
- object?: "block";
1692
- } | {
1693
- heading_1: HeaderContentWithRichTextAndColorRequest;
1694
- type?: "heading_1";
1695
- object?: "block";
1696
- } | {
1697
- heading_2: HeaderContentWithRichTextAndColorRequest;
1698
- type?: "heading_2";
1699
- object?: "block";
1700
- } | {
1701
- heading_3: HeaderContentWithRichTextAndColorRequest;
1702
- type?: "heading_3";
1703
- object?: "block";
1704
- } | {
1705
- paragraph: ContentWithRichTextAndColorRequest;
1706
- type?: "paragraph";
1707
- object?: "block";
1708
- } | {
1709
- bulleted_list_item: ContentWithRichTextAndColorRequest;
1710
- type?: "bulleted_list_item";
1711
- object?: "block";
1712
- } | {
1713
- numbered_list_item: ContentWithRichTextAndColorRequest;
1714
- type?: "numbered_list_item";
1715
- object?: "block";
1716
- } | {
1717
- quote: ContentWithRichTextAndColorRequest;
1718
- type?: "quote";
1719
- object?: "block";
1720
- } | {
1721
- to_do: {
1722
- rich_text: Array<RichTextItemRequest>;
1723
- checked?: boolean;
1724
- color?: ApiColor;
1081
+ caption: Array<RichTextItemResponse>;
1082
+ name: string;
1083
+ };
1084
+ type ExternalPageCoverRequest = {
1085
+ type?: "external";
1086
+ external: {
1087
+ url: string;
1725
1088
  };
1726
- type?: "to_do";
1727
- object?: "block";
1728
- } | {
1729
- toggle: ContentWithRichTextAndColorRequest;
1730
- type?: "toggle";
1731
- object?: "block";
1732
- } | {
1733
- template: ContentWithRichTextRequest;
1734
- type?: "template";
1735
- object?: "block";
1736
- } | {
1737
- callout: {
1738
- rich_text: Array<RichTextItemRequest>;
1739
- icon?: PageIconRequest;
1740
- color?: ApiColor;
1089
+ };
1090
+ type ExternalPageCoverResponse = {
1091
+ type: "external";
1092
+ external: {
1093
+ url: string;
1741
1094
  };
1742
- type?: "callout";
1743
- object?: "block";
1744
- } | {
1745
- synced_block: {
1746
- synced_from: {
1747
- block_id: IdRequest;
1748
- type?: "block_id";
1749
- } | null;
1095
+ };
1096
+ type ExternalPageIconRequest = {
1097
+ type?: "external";
1098
+ external: {
1099
+ url: string;
1750
1100
  };
1751
- type?: "synced_block";
1752
- object?: "block";
1753
1101
  };
1754
- type HeaderContentWithSingleLevelOfChildrenRequest = {
1755
- rich_text: Array<RichTextItemRequest>;
1756
- color?: ApiColor;
1757
- is_toggleable?: boolean;
1758
- children?: Array<BlockObjectRequestWithoutChildren>;
1102
+ type ExternalPageIconResponse = {
1103
+ type: "external";
1104
+ external: {
1105
+ url: string;
1106
+ };
1759
1107
  };
1760
- type ContentWithSingleLevelOfChildrenRequest = {
1761
- rich_text: Array<RichTextItemRequest>;
1762
- color?: ApiColor;
1763
- children?: Array<BlockObjectRequestWithoutChildren>;
1108
+ export type FileBlockObjectResponse = {
1109
+ type: "file";
1110
+ file: MediaContentWithFileNameAndCaptionResponse;
1111
+ parent: ParentForBlockBasedObjectResponse;
1112
+ object: "block";
1113
+ id: string;
1114
+ created_time: string;
1115
+ created_by: PartialUserObjectResponse;
1116
+ last_edited_time: string;
1117
+ last_edited_by: PartialUserObjectResponse;
1118
+ has_children: boolean;
1119
+ archived: boolean;
1120
+ in_trash: boolean;
1764
1121
  };
1765
- type BlockObjectWithSingleLevelOfChildrenRequest = {
1766
- embed: MediaContentWithUrlAndCaptionRequest;
1767
- type?: "embed";
1768
- object?: "block";
1769
- } | {
1770
- bookmark: MediaContentWithUrlAndCaptionRequest;
1771
- type?: "bookmark";
1772
- object?: "block";
1773
- } | {
1774
- image: MediaContentWithFileAndCaptionRequest;
1775
- type?: "image";
1776
- object?: "block";
1777
- } | {
1778
- video: MediaContentWithFileAndCaptionRequest;
1779
- type?: "video";
1780
- object?: "block";
1781
- } | {
1782
- pdf: MediaContentWithFileAndCaptionRequest;
1783
- type?: "pdf";
1784
- object?: "block";
1785
- } | {
1786
- file: MediaContentWithFileNameAndCaptionRequest;
1787
- type?: "file";
1788
- object?: "block";
1789
- } | {
1790
- audio: MediaContentWithFileAndCaptionRequest;
1791
- type?: "audio";
1792
- object?: "block";
1793
- } | {
1794
- code: {
1795
- rich_text: Array<RichTextItemRequest>;
1796
- language: LanguageRequest;
1797
- caption?: Array<RichTextItemRequest>;
1798
- };
1799
- type?: "code";
1800
- object?: "block";
1801
- } | {
1802
- equation: ContentWithExpressionRequest;
1803
- type?: "equation";
1804
- object?: "block";
1805
- } | {
1806
- divider: EmptyObject;
1807
- type?: "divider";
1808
- object?: "block";
1809
- } | {
1810
- breadcrumb: EmptyObject;
1811
- type?: "breadcrumb";
1812
- object?: "block";
1813
- } | {
1814
- table_of_contents: {
1815
- color?: ApiColor;
1122
+ type FileInternalOrExternalFileWithNameResponse = {
1123
+ type: "file";
1124
+ file: InternalFileResponse;
1125
+ };
1126
+ type FileMediaContentWithFileAndCaptionResponse = {
1127
+ type: "file";
1128
+ file: InternalFileResponse;
1129
+ caption: Array<RichTextItemResponse>;
1130
+ };
1131
+ type FileMediaContentWithFileNameAndCaptionResponse = {
1132
+ type: "file";
1133
+ file: InternalFileResponse;
1134
+ caption: Array<RichTextItemResponse>;
1135
+ name: string;
1136
+ };
1137
+ type FilePageCoverResponse = {
1138
+ type: "file";
1139
+ file: InternalFileResponse;
1140
+ };
1141
+ type FilePageIconResponse = {
1142
+ type: "file";
1143
+ file: InternalFileResponse;
1144
+ };
1145
+ type FileUploadIdRequest = {
1146
+ id: IdRequest;
1147
+ };
1148
+ export type FileUploadObjectResponse = {
1149
+ object: "file_upload";
1150
+ id: IdResponse;
1151
+ created_time: string;
1152
+ created_by: {
1153
+ id: IdResponse;
1154
+ type: "person" | "bot" | "agent";
1816
1155
  };
1817
- type?: "table_of_contents";
1818
- object?: "block";
1819
- } | {
1820
- link_to_page: {
1821
- page_id: IdRequest;
1822
- type?: "page_id";
1823
- } | {
1824
- database_id: IdRequest;
1825
- type?: "database_id";
1156
+ last_edited_time: string;
1157
+ archived: boolean;
1158
+ expiry_time: string | null;
1159
+ status: "pending" | "uploaded" | "expired" | "failed";
1160
+ filename: string | null;
1161
+ content_type: string | null;
1162
+ content_length: number | null;
1163
+ upload_url?: string;
1164
+ complete_url?: string;
1165
+ file_import_result?: {
1166
+ imported_time: string;
1167
+ } & ({
1168
+ type: "success";
1169
+ success: EmptyObject;
1826
1170
  } | {
1827
- comment_id: IdRequest;
1828
- type?: "comment_id";
1829
- };
1830
- type?: "link_to_page";
1831
- object?: "block";
1832
- } | {
1833
- table_row: ContentWithTableRowRequest;
1834
- type?: "table_row";
1835
- object?: "block";
1836
- } | {
1837
- heading_1: HeaderContentWithSingleLevelOfChildrenRequest;
1838
- type?: "heading_1";
1839
- object?: "block";
1840
- } | {
1841
- heading_2: HeaderContentWithSingleLevelOfChildrenRequest;
1842
- type?: "heading_2";
1843
- object?: "block";
1844
- } | {
1845
- heading_3: HeaderContentWithSingleLevelOfChildrenRequest;
1846
- type?: "heading_3";
1847
- object?: "block";
1848
- } | {
1849
- paragraph: ContentWithSingleLevelOfChildrenRequest;
1850
- type?: "paragraph";
1851
- object?: "block";
1852
- } | {
1853
- bulleted_list_item: ContentWithSingleLevelOfChildrenRequest;
1854
- type?: "bulleted_list_item";
1855
- object?: "block";
1856
- } | {
1857
- numbered_list_item: ContentWithSingleLevelOfChildrenRequest;
1858
- type?: "numbered_list_item";
1859
- object?: "block";
1860
- } | {
1861
- quote: ContentWithSingleLevelOfChildrenRequest;
1862
- type?: "quote";
1863
- object?: "block";
1864
- } | {
1865
- table: TableRequestWithTableRowChildren;
1866
- type?: "table";
1867
- object?: "block";
1868
- } | {
1869
- to_do: {
1870
- rich_text: Array<RichTextItemRequest>;
1871
- color?: ApiColor;
1872
- children?: Array<BlockObjectRequestWithoutChildren>;
1873
- checked?: boolean;
1874
- };
1875
- type?: "to_do";
1876
- object?: "block";
1877
- } | {
1878
- toggle: ContentWithSingleLevelOfChildrenRequest;
1879
- type?: "toggle";
1880
- object?: "block";
1881
- } | {
1882
- template: {
1883
- rich_text: Array<RichTextItemRequest>;
1884
- children?: Array<BlockObjectRequestWithoutChildren>;
1171
+ type: "error";
1172
+ error: {
1173
+ type: "validation_error" | "internal_system_error" | "download_error" | "upload_error";
1174
+ code: string;
1175
+ message: string;
1176
+ parameter: string | null;
1177
+ status_code: number | null;
1178
+ };
1179
+ });
1180
+ number_of_parts?: {
1181
+ total: number;
1182
+ sent: number;
1885
1183
  };
1886
- type?: "template";
1887
- object?: "block";
1888
- } | {
1889
- callout: {
1890
- rich_text: Array<RichTextItemRequest>;
1891
- color?: ApiColor;
1892
- children?: Array<BlockObjectRequestWithoutChildren>;
1893
- icon?: PageIconRequest;
1184
+ };
1185
+ type FileUploadPageCoverRequest = {
1186
+ type?: "file_upload";
1187
+ file_upload: {
1188
+ id: string;
1894
1189
  };
1895
- type?: "callout";
1896
- object?: "block";
1897
- } | {
1898
- synced_block: {
1899
- synced_from: {
1900
- block_id: IdRequest;
1901
- type?: "block_id";
1902
- } | null;
1903
- children?: Array<BlockObjectRequestWithoutChildren>;
1190
+ };
1191
+ type FileUploadPageIconRequest = {
1192
+ type?: "file_upload";
1193
+ file_upload: {
1194
+ id: string;
1904
1195
  };
1905
- type?: "synced_block";
1906
- object?: "block";
1907
1196
  };
1908
- type ColumnWithChildrenRequest = {
1909
- children: Array<BlockObjectWithSingleLevelOfChildrenRequest>;
1910
- width_ratio?: number;
1197
+ type FileUploadWithOptionalNameRequest = {
1198
+ file_upload: FileUploadIdRequest;
1199
+ type?: "file_upload";
1200
+ name?: StringRequest;
1201
+ };
1202
+ type FilesDatabasePropertyConfigResponse = {
1203
+ type: "files";
1204
+ files: EmptyObject;
1205
+ };
1206
+ type FilesPropertyConfigurationRequest = {
1207
+ type?: "files";
1208
+ files: EmptyObject;
1209
+ };
1210
+ export type FilesPropertyItemObjectResponse = {
1211
+ type: "files";
1212
+ files: Array<InternalOrExternalFileWithNameResponse>;
1213
+ object: "property_item";
1214
+ id: string;
1911
1215
  };
1912
- type ColumnBlockWithChildrenRequest = {
1913
- column: ColumnWithChildrenRequest;
1914
- type?: "column";
1915
- object?: "block";
1216
+ type FilesSimplePropertyValueResponse = {
1217
+ type: "files";
1218
+ files: Array<InternalOrExternalFileWithNameResponse>;
1916
1219
  };
1917
- type ColumnListRequest = {
1918
- children: Array<ColumnBlockWithChildrenRequest>;
1220
+ type FormulaDatabasePropertyConfigResponse = {
1221
+ type: "formula";
1222
+ formula: {
1223
+ expression: string;
1224
+ };
1919
1225
  };
1920
- export type BlockObjectRequest = {
1921
- embed: MediaContentWithUrlAndCaptionRequest;
1922
- type?: "embed";
1923
- object?: "block";
1924
- } | {
1925
- bookmark: MediaContentWithUrlAndCaptionRequest;
1926
- type?: "bookmark";
1927
- object?: "block";
1928
- } | {
1929
- image: MediaContentWithFileAndCaptionRequest;
1930
- type?: "image";
1931
- object?: "block";
1932
- } | {
1933
- video: MediaContentWithFileAndCaptionRequest;
1934
- type?: "video";
1935
- object?: "block";
1936
- } | {
1937
- pdf: MediaContentWithFileAndCaptionRequest;
1938
- type?: "pdf";
1939
- object?: "block";
1940
- } | {
1941
- file: MediaContentWithFileNameAndCaptionRequest;
1942
- type?: "file";
1943
- object?: "block";
1944
- } | {
1945
- audio: MediaContentWithFileAndCaptionRequest;
1946
- type?: "audio";
1947
- object?: "block";
1948
- } | {
1949
- code: {
1950
- rich_text: Array<RichTextItemRequest>;
1951
- language: LanguageRequest;
1952
- caption?: Array<RichTextItemRequest>;
1226
+ type FormulaPropertyConfigurationRequest = {
1227
+ type?: "formula";
1228
+ formula: {
1229
+ expression?: string;
1953
1230
  };
1954
- type?: "code";
1955
- object?: "block";
1231
+ };
1232
+ type FormulaPropertyFilter = {
1233
+ string: TextPropertyFilter;
1956
1234
  } | {
1957
- equation: ContentWithExpressionRequest;
1958
- type?: "equation";
1959
- object?: "block";
1235
+ checkbox: CheckboxPropertyFilter;
1960
1236
  } | {
1961
- divider: EmptyObject;
1962
- type?: "divider";
1963
- object?: "block";
1237
+ number: NumberPropertyFilter;
1964
1238
  } | {
1965
- breadcrumb: EmptyObject;
1966
- type?: "breadcrumb";
1967
- object?: "block";
1239
+ date: DatePropertyFilter;
1240
+ };
1241
+ export type FormulaPropertyItemObjectResponse = {
1242
+ type: "formula";
1243
+ formula: FormulaPropertyResponse;
1244
+ object: "property_item";
1245
+ id: string;
1246
+ };
1247
+ type FormulaPropertyResponse = StringFormulaPropertyResponse | DateFormulaPropertyResponse | NumberFormulaPropertyResponse | BooleanFormulaPropertyResponse;
1248
+ type FormulaPropertyValueResponse = BooleanFormulaPropertyValueResponse | DateFormulaPropertyValueResponse | NumberFormulaPropertyValueResponse | StringFormulaPropertyValueResponse;
1249
+ type FormulaSimplePropertyValueResponse = {
1250
+ type: "formula";
1251
+ formula: FormulaPropertyValueResponse;
1252
+ };
1253
+ type GroupFilterOperatorArray = Array<PropertyOrTimestampFilter | {
1254
+ or: PropertyOrTimestampFilterArray;
1968
1255
  } | {
1969
- table_of_contents: {
1970
- color?: ApiColor;
1971
- };
1972
- type?: "table_of_contents";
1973
- object?: "block";
1256
+ and: PropertyOrTimestampFilterArray;
1257
+ }>;
1258
+ type GroupObjectRequest = {
1259
+ id: IdRequest;
1260
+ name?: string | null;
1261
+ object?: "group";
1262
+ };
1263
+ export type GroupObjectResponse = {
1264
+ id: IdResponse;
1265
+ object: "group";
1266
+ name: string | null;
1267
+ };
1268
+ type HeaderContentWithRichTextAndColorRequest = {
1269
+ rich_text: Array<RichTextItemRequest>;
1270
+ color?: ApiColor;
1271
+ is_toggleable?: boolean;
1272
+ };
1273
+ type HeaderContentWithRichTextAndColorResponse = {
1274
+ rich_text: Array<RichTextItemResponse>;
1275
+ color: ApiColor;
1276
+ is_toggleable: boolean;
1277
+ };
1278
+ type HeaderContentWithSingleLevelOfChildrenRequest = {
1279
+ rich_text: Array<RichTextItemRequest>;
1280
+ color?: ApiColor;
1281
+ is_toggleable?: boolean;
1282
+ children?: Array<BlockObjectRequestWithoutChildren>;
1283
+ };
1284
+ export type Heading1BlockObjectResponse = {
1285
+ type: "heading_1";
1286
+ heading_1: HeaderContentWithRichTextAndColorResponse;
1287
+ parent: ParentForBlockBasedObjectResponse;
1288
+ object: "block";
1289
+ id: string;
1290
+ created_time: string;
1291
+ created_by: PartialUserObjectResponse;
1292
+ last_edited_time: string;
1293
+ last_edited_by: PartialUserObjectResponse;
1294
+ has_children: boolean;
1295
+ archived: boolean;
1296
+ in_trash: boolean;
1297
+ };
1298
+ export type Heading2BlockObjectResponse = {
1299
+ type: "heading_2";
1300
+ heading_2: HeaderContentWithRichTextAndColorResponse;
1301
+ parent: ParentForBlockBasedObjectResponse;
1302
+ object: "block";
1303
+ id: string;
1304
+ created_time: string;
1305
+ created_by: PartialUserObjectResponse;
1306
+ last_edited_time: string;
1307
+ last_edited_by: PartialUserObjectResponse;
1308
+ has_children: boolean;
1309
+ archived: boolean;
1310
+ in_trash: boolean;
1311
+ };
1312
+ export type Heading3BlockObjectResponse = {
1313
+ type: "heading_3";
1314
+ heading_3: HeaderContentWithRichTextAndColorResponse;
1315
+ parent: ParentForBlockBasedObjectResponse;
1316
+ object: "block";
1317
+ id: string;
1318
+ created_time: string;
1319
+ created_by: PartialUserObjectResponse;
1320
+ last_edited_time: string;
1321
+ last_edited_by: PartialUserObjectResponse;
1322
+ has_children: boolean;
1323
+ archived: boolean;
1324
+ in_trash: boolean;
1325
+ };
1326
+ type IdObjectResponse = {
1327
+ id: string;
1328
+ };
1329
+ type IdRequest = string;
1330
+ type IdResponse = string;
1331
+ export type ImageBlockObjectResponse = {
1332
+ type: "image";
1333
+ image: MediaContentWithFileAndCaptionResponse;
1334
+ parent: ParentForBlockBasedObjectResponse;
1335
+ object: "block";
1336
+ id: string;
1337
+ created_time: string;
1338
+ created_by: PartialUserObjectResponse;
1339
+ last_edited_time: string;
1340
+ last_edited_by: PartialUserObjectResponse;
1341
+ has_children: boolean;
1342
+ archived: boolean;
1343
+ in_trash: boolean;
1344
+ };
1345
+ type InitialDataSourceRequest = {
1346
+ properties?: Record<string, PropertyConfigurationRequest>;
1347
+ };
1348
+ type InternalFileRequest = {
1349
+ url: string;
1350
+ expiry_time?: string;
1351
+ };
1352
+ type InternalFileResponse = {
1353
+ url: string;
1354
+ expiry_time: string;
1355
+ };
1356
+ type InternalOrExternalFileWithNameRequest = {
1357
+ file: InternalFileRequest;
1358
+ name: StringRequest;
1359
+ type?: "file";
1974
1360
  } | {
1361
+ external: ExternalFileRequest;
1362
+ name: StringRequest;
1363
+ type?: "external";
1364
+ };
1365
+ type InternalOrExternalFileWithNameResponse = InternalOrExternalFileWithNameResponseCommon & (FileInternalOrExternalFileWithNameResponse | ExternalInternalOrExternalFileWithNameResponse);
1366
+ type InternalOrExternalFileWithNameResponseCommon = {
1367
+ name: string;
1368
+ };
1369
+ type LanguageRequest = "abap" | "abc" | "agda" | "arduino" | "ascii art" | "assembly" | "bash" | "basic" | "bnf" | "c" | "c#" | "c++" | "clojure" | "coffeescript" | "coq" | "css" | "dart" | "dhall" | "diff" | "docker" | "ebnf" | "elixir" | "elm" | "erlang" | "f#" | "flow" | "fortran" | "gherkin" | "glsl" | "go" | "graphql" | "groovy" | "haskell" | "hcl" | "html" | "idris" | "java" | "javascript" | "json" | "julia" | "kotlin" | "latex" | "less" | "lisp" | "livescript" | "llvm ir" | "lua" | "makefile" | "markdown" | "markup" | "matlab" | "mathematica" | "mermaid" | "nix" | "notion formula" | "objective-c" | "ocaml" | "pascal" | "perl" | "php" | "plain text" | "powershell" | "prolog" | "protobuf" | "purescript" | "python" | "r" | "racket" | "reason" | "ruby" | "rust" | "sass" | "scala" | "scheme" | "scss" | "shell" | "smalltalk" | "solidity" | "sql" | "swift" | "toml" | "typescript" | "vb.net" | "verilog" | "vhdl" | "visual basic" | "webassembly" | "xml" | "yaml" | "java/c/c++/c#";
1370
+ type LastEditedByDatabasePropertyConfigResponse = {
1371
+ type: "last_edited_by";
1372
+ last_edited_by: EmptyObject;
1373
+ };
1374
+ type LastEditedByPropertyConfigurationRequest = {
1375
+ type?: "last_edited_by";
1376
+ last_edited_by: EmptyObject;
1377
+ };
1378
+ export type LastEditedByPropertyItemObjectResponse = {
1379
+ type: "last_edited_by";
1380
+ last_edited_by: PartialUserObjectResponse | UserObjectResponse;
1381
+ object: "property_item";
1382
+ id: string;
1383
+ };
1384
+ type LastEditedBySimplePropertyValueResponse = {
1385
+ type: "last_edited_by";
1386
+ last_edited_by: UserValueResponse;
1387
+ };
1388
+ type LastEditedTimeDatabasePropertyConfigResponse = {
1389
+ type: "last_edited_time";
1390
+ last_edited_time: EmptyObject;
1391
+ };
1392
+ type LastEditedTimePropertyConfigurationRequest = {
1393
+ type?: "last_edited_time";
1394
+ last_edited_time: EmptyObject;
1395
+ };
1396
+ export type LastEditedTimePropertyItemObjectResponse = {
1397
+ type: "last_edited_time";
1398
+ last_edited_time: string;
1399
+ object: "property_item";
1400
+ id: string;
1401
+ };
1402
+ type LastEditedTimeSimplePropertyValueResponse = {
1403
+ type: "last_edited_time";
1404
+ last_edited_time: string;
1405
+ };
1406
+ type LastVisitedTimePropertyConfigurationRequest = {
1407
+ type?: "last_visited_time";
1408
+ last_visited_time: EmptyObject;
1409
+ };
1410
+ type LinkMentionResponse = {
1411
+ href: string;
1412
+ title?: string;
1413
+ description?: string;
1414
+ link_author?: string;
1415
+ link_provider?: string;
1416
+ thumbnail_url?: string;
1417
+ icon_url?: string;
1418
+ iframe_url?: string;
1419
+ height?: number;
1420
+ padding?: number;
1421
+ padding_top?: number;
1422
+ };
1423
+ export type LinkPreviewBlockObjectResponse = {
1424
+ type: "link_preview";
1425
+ link_preview: MediaContentWithUrlResponse;
1426
+ parent: ParentForBlockBasedObjectResponse;
1427
+ object: "block";
1428
+ id: string;
1429
+ created_time: string;
1430
+ created_by: PartialUserObjectResponse;
1431
+ last_edited_time: string;
1432
+ last_edited_by: PartialUserObjectResponse;
1433
+ has_children: boolean;
1434
+ archived: boolean;
1435
+ in_trash: boolean;
1436
+ };
1437
+ type LinkPreviewMentionResponse = {
1438
+ url: string;
1439
+ };
1440
+ export type LinkToPageBlockObjectResponse = {
1441
+ type: "link_to_page";
1975
1442
  link_to_page: {
1443
+ type: "page_id";
1976
1444
  page_id: IdRequest;
1977
- type?: "page_id";
1978
1445
  } | {
1446
+ type: "database_id";
1979
1447
  database_id: IdRequest;
1980
- type?: "database_id";
1981
1448
  } | {
1449
+ type: "comment_id";
1982
1450
  comment_id: IdRequest;
1983
- type?: "comment_id";
1984
- };
1985
- type?: "link_to_page";
1986
- object?: "block";
1987
- } | {
1988
- table_row: ContentWithTableRowRequest;
1989
- type?: "table_row";
1990
- object?: "block";
1991
- } | {
1992
- table: TableRequestWithTableRowChildren;
1993
- type?: "table";
1994
- object?: "block";
1995
- } | {
1996
- column_list: ColumnListRequest;
1997
- type?: "column_list";
1998
- object?: "block";
1999
- } | {
2000
- column: ColumnWithChildrenRequest;
2001
- type?: "column";
2002
- object?: "block";
2003
- } | {
2004
- heading_1: {
2005
- rich_text: Array<RichTextItemRequest>;
2006
- color?: ApiColor;
2007
- is_toggleable?: boolean;
2008
- children?: Array<BlockObjectWithSingleLevelOfChildrenRequest>;
2009
- };
2010
- type?: "heading_1";
2011
- object?: "block";
2012
- } | {
2013
- heading_2: {
2014
- rich_text: Array<RichTextItemRequest>;
2015
- color?: ApiColor;
2016
- is_toggleable?: boolean;
2017
- children?: Array<BlockObjectWithSingleLevelOfChildrenRequest>;
2018
- };
2019
- type?: "heading_2";
2020
- object?: "block";
2021
- } | {
2022
- heading_3: {
2023
- rich_text: Array<RichTextItemRequest>;
2024
- color?: ApiColor;
2025
- is_toggleable?: boolean;
2026
- children?: Array<BlockObjectWithSingleLevelOfChildrenRequest>;
2027
- };
2028
- type?: "heading_3";
2029
- object?: "block";
2030
- } | {
2031
- paragraph: {
2032
- rich_text: Array<RichTextItemRequest>;
2033
- color?: ApiColor;
2034
- children?: Array<BlockObjectWithSingleLevelOfChildrenRequest>;
2035
1451
  };
2036
- type?: "paragraph";
2037
- object?: "block";
2038
- } | {
2039
- bulleted_list_item: {
2040
- rich_text: Array<RichTextItemRequest>;
2041
- color?: ApiColor;
2042
- children?: Array<BlockObjectWithSingleLevelOfChildrenRequest>;
2043
- };
2044
- type?: "bulleted_list_item";
2045
- object?: "block";
2046
- } | {
2047
- numbered_list_item: {
2048
- rich_text: Array<RichTextItemRequest>;
2049
- color?: ApiColor;
2050
- children?: Array<BlockObjectWithSingleLevelOfChildrenRequest>;
2051
- };
2052
- type?: "numbered_list_item";
2053
- object?: "block";
1452
+ parent: ParentForBlockBasedObjectResponse;
1453
+ object: "block";
1454
+ id: string;
1455
+ created_time: string;
1456
+ created_by: PartialUserObjectResponse;
1457
+ last_edited_time: string;
1458
+ last_edited_by: PartialUserObjectResponse;
1459
+ has_children: boolean;
1460
+ archived: boolean;
1461
+ in_trash: boolean;
1462
+ };
1463
+ type LocationPropertyConfigurationRequest = {
1464
+ type?: "location";
1465
+ location: EmptyObject;
1466
+ };
1467
+ type MediaContentWithFileAndCaptionRequest = {
1468
+ external: ExternalFileRequest;
1469
+ type?: "external";
1470
+ caption?: Array<RichTextItemRequest>;
2054
1471
  } | {
2055
- quote: {
2056
- rich_text: Array<RichTextItemRequest>;
2057
- color?: ApiColor;
2058
- children?: Array<BlockObjectWithSingleLevelOfChildrenRequest>;
2059
- };
2060
- type?: "quote";
2061
- object?: "block";
1472
+ file_upload: FileUploadIdRequest;
1473
+ type?: "file_upload";
1474
+ caption?: Array<RichTextItemRequest>;
1475
+ };
1476
+ type MediaContentWithFileAndCaptionResponse = ExternalMediaContentWithFileAndCaptionResponse | FileMediaContentWithFileAndCaptionResponse;
1477
+ type MediaContentWithFileNameAndCaptionRequest = {
1478
+ external: ExternalFileRequest;
1479
+ type?: "external";
1480
+ caption?: Array<RichTextItemRequest>;
1481
+ name?: StringRequest;
2062
1482
  } | {
2063
- to_do: {
2064
- rich_text: Array<RichTextItemRequest>;
2065
- color?: ApiColor;
2066
- children?: Array<BlockObjectWithSingleLevelOfChildrenRequest>;
2067
- checked?: boolean;
1483
+ file_upload: FileUploadIdRequest;
1484
+ type?: "file_upload";
1485
+ caption?: Array<RichTextItemRequest>;
1486
+ name?: StringRequest;
1487
+ };
1488
+ type MediaContentWithFileNameAndCaptionResponse = ExternalMediaContentWithFileNameAndCaptionResponse | FileMediaContentWithFileNameAndCaptionResponse;
1489
+ type MediaContentWithUrlAndCaptionRequest = {
1490
+ url: string;
1491
+ caption?: Array<RichTextItemRequest>;
1492
+ };
1493
+ type MediaContentWithUrlAndCaptionResponse = {
1494
+ url: string;
1495
+ caption: Array<RichTextItemResponse>;
1496
+ };
1497
+ type MediaContentWithUrlResponse = {
1498
+ url: TextRequest;
1499
+ };
1500
+ type MentionRichTextItemRequest = {
1501
+ type?: "mention";
1502
+ mention: {
1503
+ type?: "user";
1504
+ user: PartialUserObjectRequest;
1505
+ } | {
1506
+ type?: "date";
1507
+ date: DateRequest;
1508
+ } | {
1509
+ type?: "page";
1510
+ page: {
1511
+ id: IdRequest;
1512
+ };
1513
+ } | {
1514
+ type?: "database";
1515
+ database: {
1516
+ id: IdRequest;
1517
+ };
1518
+ } | {
1519
+ type?: "template_mention";
1520
+ template_mention: TemplateMentionRequest;
1521
+ } | {
1522
+ type?: "custom_emoji";
1523
+ custom_emoji: {
1524
+ id: IdRequest;
1525
+ name?: string;
1526
+ url?: string;
1527
+ };
2068
1528
  };
2069
- type?: "to_do";
2070
- object?: "block";
2071
- } | {
2072
- toggle: {
2073
- rich_text: Array<RichTextItemRequest>;
2074
- color?: ApiColor;
2075
- children?: Array<BlockObjectWithSingleLevelOfChildrenRequest>;
1529
+ };
1530
+ export type MentionRichTextItemResponse = {
1531
+ type: "mention";
1532
+ mention: {
1533
+ type: "user";
1534
+ user: UserValueResponse;
1535
+ } | {
1536
+ type: "date";
1537
+ date: DateResponse;
1538
+ } | {
1539
+ type: "link_preview";
1540
+ link_preview: LinkPreviewMentionResponse;
1541
+ } | {
1542
+ type: "link_mention";
1543
+ link_mention: LinkMentionResponse;
1544
+ } | {
1545
+ type: "page";
1546
+ page: {
1547
+ id: IdResponse;
1548
+ };
1549
+ } | {
1550
+ type: "database";
1551
+ database: {
1552
+ id: IdResponse;
1553
+ };
1554
+ } | {
1555
+ type: "template_mention";
1556
+ template_mention: TemplateMentionResponse;
1557
+ } | {
1558
+ type: "custom_emoji";
1559
+ custom_emoji: CustomEmojiResponse;
2076
1560
  };
2077
- type?: "toggle";
2078
- object?: "block";
2079
- } | {
2080
- template: {
2081
- rich_text: Array<RichTextItemRequest>;
2082
- children?: Array<BlockObjectWithSingleLevelOfChildrenRequest>;
1561
+ };
1562
+ type MultiSelectDatabasePropertyConfigResponse = {
1563
+ type: "multi_select";
1564
+ multi_select: {
1565
+ options: Array<SelectPropertyResponse>;
2083
1566
  };
2084
- type?: "template";
2085
- object?: "block";
2086
- } | {
2087
- callout: {
2088
- rich_text: Array<RichTextItemRequest>;
2089
- color?: ApiColor;
2090
- children?: Array<BlockObjectWithSingleLevelOfChildrenRequest>;
2091
- icon?: PageIconRequest;
1567
+ };
1568
+ type MultiSelectPropertyConfigurationRequest = {
1569
+ type?: "multi_select";
1570
+ multi_select: {
1571
+ options?: Array<{
1572
+ name: string;
1573
+ color?: SelectColor;
1574
+ description?: string | null;
1575
+ }>;
2092
1576
  };
2093
- type?: "callout";
2094
- object?: "block";
1577
+ };
1578
+ type MultiSelectPropertyFilter = {
1579
+ contains: string;
2095
1580
  } | {
2096
- synced_block: {
2097
- synced_from: {
2098
- block_id: IdRequest;
2099
- type?: "block_id";
2100
- } | null;
2101
- children?: Array<BlockObjectWithSingleLevelOfChildrenRequest>;
1581
+ does_not_contain: string;
1582
+ } | ExistencePropertyFilter;
1583
+ export type MultiSelectPropertyItemObjectResponse = {
1584
+ type: "multi_select";
1585
+ multi_select: Array<PartialSelectResponse>;
1586
+ object: "property_item";
1587
+ id: string;
1588
+ };
1589
+ type MultiSelectSimplePropertyValueResponse = {
1590
+ type: "multi_select";
1591
+ multi_select: Array<PartialSelectPropertyValueResponse>;
1592
+ };
1593
+ type NumberDatabasePropertyConfigResponse = {
1594
+ type: "number";
1595
+ number: {
1596
+ format: NumberFormat;
2102
1597
  };
2103
- type?: "synced_block";
2104
- object?: "block";
2105
1598
  };
2106
- type UpdateMediaContentWithUrlAndCaptionRequest = {
2107
- url?: string;
2108
- caption?: Array<RichTextItemRequest>;
1599
+ type NumberFormat = string;
1600
+ type NumberFormulaPropertyResponse = {
1601
+ type: "number";
1602
+ number: number | null;
2109
1603
  };
2110
- type UpdateMediaContentWithFileAndCaptionRequest = {
2111
- caption?: Array<RichTextItemRequest>;
2112
- external?: ExternalFileRequest;
2113
- file_upload?: FileUploadIdRequest;
1604
+ type NumberFormulaPropertyValueResponse = {
1605
+ type: "number";
1606
+ number: number | null;
2114
1607
  };
2115
- type UpdateMediaContentWithFileNameAndCaptionRequest = {
2116
- caption?: Array<RichTextItemRequest>;
2117
- external?: ExternalFileRequest;
2118
- file_upload?: FileUploadIdRequest;
2119
- name?: StringRequest;
1608
+ type NumberPartialRollupValueResponse = {
1609
+ type: "number";
1610
+ number: number | null;
2120
1611
  };
2121
- type ExistencePropertyFilter = {
2122
- is_empty: true;
2123
- } | {
2124
- is_not_empty: true;
1612
+ type NumberPropertyConfigurationRequest = {
1613
+ type?: "number";
1614
+ number: {
1615
+ format?: NumberFormat;
1616
+ };
2125
1617
  };
2126
- type TextPropertyFilter = {
2127
- equals: string;
2128
- } | {
2129
- does_not_equal: string;
2130
- } | {
2131
- contains: string;
2132
- } | {
2133
- does_not_contain: string;
2134
- } | {
2135
- starts_with: string;
2136
- } | {
2137
- ends_with: string;
2138
- } | ExistencePropertyFilter;
2139
1618
  type NumberPropertyFilter = {
2140
1619
  equals: number;
2141
1620
  } | {
@@ -2147,92 +1626,484 @@ type NumberPropertyFilter = {
2147
1626
  } | {
2148
1627
  greater_than_or_equal_to: number;
2149
1628
  } | {
2150
- less_than_or_equal_to: number;
2151
- } | ExistencePropertyFilter;
2152
- type CheckboxPropertyFilter = {
2153
- equals: boolean;
1629
+ less_than_or_equal_to: number;
1630
+ } | ExistencePropertyFilter;
1631
+ export type NumberPropertyItemObjectResponse = {
1632
+ type: "number";
1633
+ number: number | null;
1634
+ object: "property_item";
1635
+ id: string;
1636
+ };
1637
+ type NumberSimplePropertyValueResponse = {
1638
+ type: "number";
1639
+ number: number | null;
1640
+ };
1641
+ export type NumberedListItemBlockObjectResponse = {
1642
+ type: "numbered_list_item";
1643
+ numbered_list_item: ContentWithRichTextAndColorResponse;
1644
+ parent: ParentForBlockBasedObjectResponse;
1645
+ object: "block";
1646
+ id: string;
1647
+ created_time: string;
1648
+ created_by: PartialUserObjectResponse;
1649
+ last_edited_time: string;
1650
+ last_edited_by: PartialUserObjectResponse;
1651
+ has_children: boolean;
1652
+ archived: boolean;
1653
+ in_trash: boolean;
1654
+ };
1655
+ type PageCoverRequest = FileUploadPageCoverRequest | ExternalPageCoverRequest;
1656
+ type PageCoverResponse = FilePageCoverResponse | ExternalPageCoverResponse;
1657
+ type PageIconRequest = FileUploadPageIconRequest | EmojiPageIconRequest | ExternalPageIconRequest | CustomEmojiPageIconRequest;
1658
+ type PageIconResponse = EmojiPageIconResponse | FilePageIconResponse | ExternalPageIconResponse | CustomEmojiPageIconResponse;
1659
+ type PageIdCommentParentResponse = {
1660
+ type: "page_id";
1661
+ page_id: IdResponse;
1662
+ };
1663
+ type PageIdParentForBlockBasedObjectResponse = {
1664
+ type: "page_id";
1665
+ page_id: IdResponse;
1666
+ };
1667
+ export type PageObjectResponse = {
1668
+ object: "page";
1669
+ id: IdResponse;
1670
+ created_time: string;
1671
+ last_edited_time: string;
1672
+ archived: boolean;
1673
+ in_trash: boolean;
1674
+ is_locked: boolean;
1675
+ url: string;
1676
+ public_url: string | null;
1677
+ parent: ParentForBlockBasedObjectResponse;
1678
+ properties: Record<string, PagePropertyValueWithIdResponse>;
1679
+ icon: PageIconResponse | null;
1680
+ cover: PageCoverResponse | null;
1681
+ created_by: PartialUserObjectResponse;
1682
+ last_edited_by: PartialUserObjectResponse;
1683
+ };
1684
+ type PagePropertyValueWithIdResponse = IdObjectResponse & (SimpleOrArrayPropertyValueResponse | PartialRollupPropertyResponse);
1685
+ export type ParagraphBlockObjectResponse = {
1686
+ type: "paragraph";
1687
+ paragraph: ContentWithRichTextAndColorResponse;
1688
+ parent: ParentForBlockBasedObjectResponse;
1689
+ object: "block";
1690
+ id: string;
1691
+ created_time: string;
1692
+ created_by: PartialUserObjectResponse;
1693
+ last_edited_time: string;
1694
+ last_edited_by: PartialUserObjectResponse;
1695
+ has_children: boolean;
1696
+ archived: boolean;
1697
+ in_trash: boolean;
1698
+ };
1699
+ type ParentForBlockBasedObjectResponse = DatabaseParentResponse | DataSourceParentResponse | PageIdParentForBlockBasedObjectResponse | BlockIdParentForBlockBasedObjectResponse | WorkspaceParentForBlockBasedObjectResponse;
1700
+ type ParentOfDataSourceRequest = {
1701
+ type?: "database_id";
1702
+ database_id: IdRequest;
1703
+ };
1704
+ /**
1705
+ * The parent of the data source. This is typically a database (`database_id`), but for
1706
+ * externally synced data sources, can be another data source (`data_source_id`).
1707
+ */
1708
+ type ParentOfDataSourceResponse = DatabaseParentResponse | DataSourceParentResponse;
1709
+ type ParentOfDatabaseResponse = PageIdParentForBlockBasedObjectResponse | WorkspaceParentForBlockBasedObjectResponse | DatabaseParentResponse | BlockIdParentForBlockBasedObjectResponse;
1710
+ export type PartialBlockObjectResponse = {
1711
+ object: "block";
1712
+ id: string;
1713
+ };
1714
+ export type PartialCommentObjectResponse = {
1715
+ object: "comment";
1716
+ id: IdResponse;
1717
+ };
1718
+ export type PartialDataSourceObjectResponse = {
1719
+ object: "data_source";
1720
+ id: IdResponse;
1721
+ properties: Record<string, DatabasePropertyConfigResponse>;
1722
+ };
1723
+ export type PartialDatabaseObjectResponse = {
1724
+ object: "database";
1725
+ id: IdResponse;
1726
+ };
1727
+ export type PartialPageObjectResponse = {
1728
+ object: "page";
1729
+ id: IdResponse;
1730
+ };
1731
+ type PartialRollupPropertyResponse = {
1732
+ type: "rollup";
1733
+ rollup: PartialRollupValueResponse;
1734
+ };
1735
+ type PartialRollupValueResponse = PartialRollupValueResponseCommon & (NumberPartialRollupValueResponse | DatePartialRollupValueResponse | ArrayPartialRollupValueResponse);
1736
+ type PartialRollupValueResponseCommon = {
1737
+ function: RollupFunction;
1738
+ };
1739
+ type PartialSelectPropertyValueResponse = {
1740
+ id: string;
1741
+ name: string;
1742
+ color: "default" | "gray" | "brown" | "orange" | "yellow" | "green" | "blue" | "purple" | "pink" | "red";
1743
+ };
1744
+ type PartialSelectResponse = {
1745
+ id: string;
1746
+ name: string;
1747
+ color: SelectColor;
1748
+ };
1749
+ type PartialUserObjectRequest = {
1750
+ id: IdRequest;
1751
+ object?: "user";
1752
+ };
1753
+ export type PartialUserObjectResponse = {
1754
+ id: IdResponse;
1755
+ object: "user";
1756
+ };
1757
+ export type PdfBlockObjectResponse = {
1758
+ type: "pdf";
1759
+ pdf: MediaContentWithFileAndCaptionResponse;
1760
+ parent: ParentForBlockBasedObjectResponse;
1761
+ object: "block";
1762
+ id: string;
1763
+ created_time: string;
1764
+ created_by: PartialUserObjectResponse;
1765
+ last_edited_time: string;
1766
+ last_edited_by: PartialUserObjectResponse;
1767
+ has_children: boolean;
1768
+ archived: boolean;
1769
+ in_trash: boolean;
1770
+ };
1771
+ type PeopleArrayBasedPropertyValueResponse = {
1772
+ type: "people";
1773
+ people: Array<UserValueResponse | GroupObjectResponse>;
1774
+ };
1775
+ type PeopleDatabasePropertyConfigResponse = {
1776
+ type: "people";
1777
+ people: EmptyObject;
1778
+ };
1779
+ type PeoplePropertyConfigurationRequest = {
1780
+ type?: "people";
1781
+ people: EmptyObject;
1782
+ };
1783
+ type PeoplePropertyFilter = {
1784
+ contains: IdRequest;
1785
+ } | {
1786
+ does_not_contain: IdRequest;
1787
+ } | ExistencePropertyFilter;
1788
+ export type PeoplePropertyItemObjectResponse = {
1789
+ type: "people";
1790
+ people: PartialUserObjectResponse | UserObjectResponse;
1791
+ object: "property_item";
1792
+ id: string;
1793
+ };
1794
+ export type PersonUserObjectResponse = {
1795
+ type: "person";
1796
+ person: {
1797
+ email?: string;
1798
+ };
1799
+ };
1800
+ type PhoneNumberDatabasePropertyConfigResponse = {
1801
+ type: "phone_number";
1802
+ phone_number: EmptyObject;
1803
+ };
1804
+ type PhoneNumberPropertyConfigurationRequest = {
1805
+ type?: "phone_number";
1806
+ phone_number: EmptyObject;
1807
+ };
1808
+ export type PhoneNumberPropertyItemObjectResponse = {
1809
+ type: "phone_number";
1810
+ phone_number: string | null;
1811
+ object: "property_item";
1812
+ id: string;
1813
+ };
1814
+ type PhoneNumberSimplePropertyValueResponse = {
1815
+ type: "phone_number";
1816
+ phone_number: string | null;
1817
+ };
1818
+ type PlacePropertyConfigurationRequest = {
1819
+ type?: "place";
1820
+ place: EmptyObject;
1821
+ };
1822
+ export type PlacePropertyItemObjectResponse = {
1823
+ type: "place";
1824
+ place: {
1825
+ lat: number;
1826
+ lon: number;
1827
+ name?: string | null;
1828
+ address?: string | null;
1829
+ aws_place_id?: string | null;
1830
+ google_place_id?: string | null;
1831
+ } | null;
1832
+ object: "property_item";
1833
+ id: string;
1834
+ };
1835
+ type PlacePropertyValueResponse = {
1836
+ lat: number;
1837
+ lon: number;
1838
+ name?: string | null;
1839
+ address?: string | null;
1840
+ aws_place_id?: string | null;
1841
+ google_place_id?: string | null;
1842
+ };
1843
+ type PlaceSimplePropertyValueResponse = {
1844
+ type: "place";
1845
+ place: PlacePropertyValueResponse | null;
1846
+ };
1847
+ type PropertyConfigurationRequest = PropertyConfigurationRequestCommon & (NumberPropertyConfigurationRequest | FormulaPropertyConfigurationRequest | SelectPropertyConfigurationRequest | MultiSelectPropertyConfigurationRequest | StatusPropertyConfigurationRequest | RelationPropertyConfigurationRequest | RollupPropertyConfigurationRequest | UniqueIdPropertyConfigurationRequest | TitlePropertyConfigurationRequest | RichTextPropertyConfigurationRequest | UrlPropertyConfigurationRequest | PeoplePropertyConfigurationRequest | FilesPropertyConfigurationRequest | EmailPropertyConfigurationRequest | PhoneNumberPropertyConfigurationRequest | DatePropertyConfigurationRequest | CheckboxPropertyConfigurationRequest | CreatedByPropertyConfigurationRequest | CreatedTimePropertyConfigurationRequest | LastEditedByPropertyConfigurationRequest | LastEditedTimePropertyConfigurationRequest | ButtonPropertyConfigurationRequest | LocationPropertyConfigurationRequest | VerificationPropertyConfigurationRequest | LastVisitedTimePropertyConfigurationRequest | PlacePropertyConfigurationRequest);
1848
+ type PropertyConfigurationRequestCommon = {
1849
+ description?: PropertyDescriptionRequest | null;
1850
+ };
1851
+ type PropertyDescriptionRequest = string;
1852
+ type PropertyFilter = {
1853
+ title: TextPropertyFilter;
1854
+ property: string;
1855
+ type?: "title";
1856
+ } | {
1857
+ rich_text: TextPropertyFilter;
1858
+ property: string;
1859
+ type?: "rich_text";
1860
+ } | {
1861
+ number: NumberPropertyFilter;
1862
+ property: string;
1863
+ type?: "number";
1864
+ } | {
1865
+ checkbox: CheckboxPropertyFilter;
1866
+ property: string;
1867
+ type?: "checkbox";
1868
+ } | {
1869
+ select: SelectPropertyFilter;
1870
+ property: string;
1871
+ type?: "select";
1872
+ } | {
1873
+ multi_select: MultiSelectPropertyFilter;
1874
+ property: string;
1875
+ type?: "multi_select";
2154
1876
  } | {
2155
- does_not_equal: boolean;
2156
- };
2157
- type SelectPropertyFilter = {
2158
- equals: string;
1877
+ status: StatusPropertyFilter;
1878
+ property: string;
1879
+ type?: "status";
2159
1880
  } | {
2160
- does_not_equal: string;
2161
- } | ExistencePropertyFilter;
2162
- type MultiSelectPropertyFilter = {
2163
- contains: string;
1881
+ date: DatePropertyFilter;
1882
+ property: string;
1883
+ type?: "date";
2164
1884
  } | {
2165
- does_not_contain: string;
2166
- } | ExistencePropertyFilter;
2167
- type StatusPropertyFilter = {
2168
- equals: string;
1885
+ people: PeoplePropertyFilter;
1886
+ property: string;
1887
+ type?: "people";
2169
1888
  } | {
2170
- does_not_equal: string;
2171
- } | ExistencePropertyFilter;
2172
- type DatePropertyFilter = {
2173
- equals: string;
1889
+ files: ExistencePropertyFilter;
1890
+ property: string;
1891
+ type?: "files";
2174
1892
  } | {
2175
- before: string;
1893
+ url: TextPropertyFilter;
1894
+ property: string;
1895
+ type?: "url";
2176
1896
  } | {
2177
- after: string;
1897
+ email: TextPropertyFilter;
1898
+ property: string;
1899
+ type?: "email";
2178
1900
  } | {
2179
- on_or_before: string;
1901
+ phone_number: TextPropertyFilter;
1902
+ property: string;
1903
+ type?: "phone_number";
2180
1904
  } | {
2181
- on_or_after: string;
1905
+ relation: RelationPropertyFilter;
1906
+ property: string;
1907
+ type?: "relation";
2182
1908
  } | {
2183
- this_week: EmptyObject;
1909
+ created_by: PeoplePropertyFilter;
1910
+ property: string;
1911
+ type?: "created_by";
2184
1912
  } | {
2185
- past_week: EmptyObject;
1913
+ created_time: DatePropertyFilter;
1914
+ property: string;
1915
+ type?: "created_time";
2186
1916
  } | {
2187
- past_month: EmptyObject;
1917
+ last_edited_by: PeoplePropertyFilter;
1918
+ property: string;
1919
+ type?: "last_edited_by";
2188
1920
  } | {
2189
- past_year: EmptyObject;
1921
+ last_edited_time: DatePropertyFilter;
1922
+ property: string;
1923
+ type?: "last_edited_time";
2190
1924
  } | {
2191
- next_week: EmptyObject;
1925
+ formula: FormulaPropertyFilter;
1926
+ property: string;
1927
+ type?: "formula";
2192
1928
  } | {
2193
- next_month: EmptyObject;
1929
+ unique_id: NumberPropertyFilter;
1930
+ property: string;
1931
+ type?: "unique_id";
2194
1932
  } | {
2195
- next_year: EmptyObject;
2196
- } | ExistencePropertyFilter;
2197
- type PeoplePropertyFilter = {
2198
- contains: IdRequest;
1933
+ rollup: RollupPropertyFilter;
1934
+ property: string;
1935
+ type?: "rollup";
2199
1936
  } | {
2200
- does_not_contain: IdRequest;
2201
- } | ExistencePropertyFilter;
1937
+ verification: VerificationPropertyStatusFilter;
1938
+ property: string;
1939
+ type?: "verification";
1940
+ };
1941
+ export type PropertyItemListResponse = PropertyItemPropertyItemListResponse;
1942
+ export type PropertyItemObjectResponse = NumberPropertyItemObjectResponse | UrlPropertyItemObjectResponse | SelectPropertyItemObjectResponse | MultiSelectPropertyItemObjectResponse | StatusPropertyItemObjectResponse | DatePropertyItemObjectResponse | EmailPropertyItemObjectResponse | PhoneNumberPropertyItemObjectResponse | CheckboxPropertyItemObjectResponse | FilesPropertyItemObjectResponse | CreatedByPropertyItemObjectResponse | CreatedTimePropertyItemObjectResponse | LastEditedByPropertyItemObjectResponse | LastEditedTimePropertyItemObjectResponse | FormulaPropertyItemObjectResponse | ButtonPropertyItemObjectResponse | UniqueIdPropertyItemObjectResponse | VerificationPropertyItemObjectResponse | PlacePropertyItemObjectResponse | TitlePropertyItemObjectResponse | RichTextPropertyItemObjectResponse | PeoplePropertyItemObjectResponse | RelationPropertyItemObjectResponse | RollupPropertyItemObjectResponse;
1943
+ type PropertyItemPropertyItemListResponse = {
1944
+ type: "property_item";
1945
+ property_item: {
1946
+ type: "title";
1947
+ title: EmptyObject;
1948
+ next_url: string | null;
1949
+ id: string;
1950
+ } | {
1951
+ type: "rich_text";
1952
+ rich_text: EmptyObject;
1953
+ next_url: string | null;
1954
+ id: string;
1955
+ } | {
1956
+ type: "people";
1957
+ people: EmptyObject;
1958
+ next_url: string | null;
1959
+ id: string;
1960
+ } | {
1961
+ type: "relation";
1962
+ relation: EmptyObject;
1963
+ next_url: string | null;
1964
+ id: string;
1965
+ } | {
1966
+ type: "rollup";
1967
+ rollup: {
1968
+ type: "number";
1969
+ number: number | null;
1970
+ function: RollupFunction;
1971
+ } | {
1972
+ type: "date";
1973
+ date: DateResponse | null;
1974
+ function: RollupFunction;
1975
+ } | {
1976
+ type: "array";
1977
+ array: Array<EmptyObject>;
1978
+ function: RollupFunction;
1979
+ } | {
1980
+ type: "unsupported";
1981
+ unsupported: EmptyObject;
1982
+ function: RollupFunction;
1983
+ } | {
1984
+ type: "incomplete";
1985
+ incomplete: EmptyObject;
1986
+ function: RollupFunction;
1987
+ };
1988
+ next_url: string | null;
1989
+ id: string;
1990
+ };
1991
+ object: "list";
1992
+ next_cursor: string | null;
1993
+ has_more: boolean;
1994
+ results: Array<PropertyItemObjectResponse>;
1995
+ };
1996
+ type PropertyOrTimestampFilter = PropertyFilter | TimestampFilter;
1997
+ type PropertyOrTimestampFilterArray = Array<PropertyOrTimestampFilter>;
1998
+ export type QuoteBlockObjectResponse = {
1999
+ type: "quote";
2000
+ quote: ContentWithRichTextAndColorResponse;
2001
+ parent: ParentForBlockBasedObjectResponse;
2002
+ object: "block";
2003
+ id: string;
2004
+ created_time: string;
2005
+ created_by: PartialUserObjectResponse;
2006
+ last_edited_time: string;
2007
+ last_edited_by: PartialUserObjectResponse;
2008
+ has_children: boolean;
2009
+ archived: boolean;
2010
+ in_trash: boolean;
2011
+ };
2012
+ type RelationArrayBasedPropertyValueResponse = {
2013
+ type: "relation";
2014
+ relation: Array<RelationItemPropertyValueResponse>;
2015
+ };
2016
+ type RelationDatabasePropertyConfigResponse = {
2017
+ type: "relation";
2018
+ relation: DatabasePropertyRelationConfigResponse;
2019
+ };
2020
+ type RelationItemPropertyValueResponse = {
2021
+ id: IdRequest;
2022
+ };
2023
+ type RelationPropertyConfigurationRequest = {
2024
+ type?: "relation";
2025
+ relation: {
2026
+ data_source_id: IdRequest;
2027
+ } & ({
2028
+ type?: "single_property";
2029
+ single_property: EmptyObject;
2030
+ } | {
2031
+ type?: "dual_property";
2032
+ dual_property: {
2033
+ synced_property_id?: string;
2034
+ synced_property_name?: string;
2035
+ };
2036
+ });
2037
+ };
2202
2038
  type RelationPropertyFilter = {
2203
2039
  contains: IdRequest;
2204
2040
  } | {
2205
2041
  does_not_contain: IdRequest;
2206
2042
  } | ExistencePropertyFilter;
2207
- type FormulaPropertyFilter = {
2208
- string: TextPropertyFilter;
2209
- } | {
2210
- checkbox: CheckboxPropertyFilter;
2211
- } | {
2212
- number: NumberPropertyFilter;
2213
- } | {
2214
- date: DatePropertyFilter;
2043
+ export type RelationPropertyItemObjectResponse = {
2044
+ type: "relation";
2045
+ relation: {
2046
+ id: string;
2047
+ };
2048
+ object: "property_item";
2049
+ id: string;
2215
2050
  };
2216
- type RollupSubfilterPropertyFilter = {
2217
- rich_text: TextPropertyFilter;
2218
- } | {
2219
- number: NumberPropertyFilter;
2220
- } | {
2221
- checkbox: CheckboxPropertyFilter;
2222
- } | {
2223
- select: SelectPropertyFilter;
2224
- } | {
2225
- multi_select: MultiSelectPropertyFilter;
2226
- } | {
2227
- relation: RelationPropertyFilter;
2228
- } | {
2229
- date: DatePropertyFilter;
2230
- } | {
2231
- people: PeoplePropertyFilter;
2232
- } | {
2233
- files: ExistencePropertyFilter;
2234
- } | {
2235
- status: StatusPropertyFilter;
2051
+ type RichTextArrayBasedPropertyValueResponse = {
2052
+ type: "rich_text";
2053
+ rich_text: Array<RichTextItemResponse>;
2054
+ };
2055
+ type RichTextDatabasePropertyConfigResponse = {
2056
+ type: "rich_text";
2057
+ rich_text: EmptyObject;
2058
+ };
2059
+ type RichTextItemRequest = RichTextItemRequestCommon & (TextRichTextItemRequest | MentionRichTextItemRequest | EquationRichTextItemRequest);
2060
+ type RichTextItemRequestCommon = {
2061
+ annotations?: AnnotationRequest;
2062
+ };
2063
+ export type RichTextItemResponse = RichTextItemResponseCommon & (TextRichTextItemResponse | MentionRichTextItemResponse | EquationRichTextItemResponse);
2064
+ export type RichTextItemResponseCommon = {
2065
+ plain_text: string;
2066
+ href: string | null;
2067
+ annotations: AnnotationResponse;
2068
+ };
2069
+ type RichTextPropertyConfigurationRequest = {
2070
+ type?: "rich_text";
2071
+ rich_text: EmptyObject;
2072
+ };
2073
+ export type RichTextPropertyItemObjectResponse = {
2074
+ type: "rich_text";
2075
+ rich_text: RichTextItemResponse;
2076
+ object: "property_item";
2077
+ id: string;
2078
+ };
2079
+ type RollupDatabasePropertyConfigResponse = {
2080
+ type: "rollup";
2081
+ rollup: {
2082
+ function: RollupFunction;
2083
+ rollup_property_name: string;
2084
+ relation_property_name: string;
2085
+ rollup_property_id: string;
2086
+ relation_property_id: string;
2087
+ };
2088
+ };
2089
+ type RollupFunction = "count" | "count_values" | "empty" | "not_empty" | "unique" | "show_unique" | "percent_empty" | "percent_not_empty" | "sum" | "average" | "median" | "min" | "max" | "range" | "earliest_date" | "latest_date" | "date_range" | "checked" | "unchecked" | "percent_checked" | "percent_unchecked" | "count_per_group" | "percent_per_group" | "show_original";
2090
+ type RollupPropertyConfigurationRequest = {
2091
+ type?: "rollup";
2092
+ rollup: {
2093
+ function: RollupFunction;
2094
+ } & ({
2095
+ relation_property_name: string;
2096
+ rollup_property_name: string;
2097
+ } | {
2098
+ relation_property_id: string;
2099
+ rollup_property_name: string;
2100
+ } | {
2101
+ relation_property_name: string;
2102
+ rollup_property_id: string;
2103
+ } | {
2104
+ relation_property_id: string;
2105
+ rollup_property_id: string;
2106
+ });
2236
2107
  };
2237
2108
  type RollupPropertyFilter = {
2238
2109
  any: RollupSubfilterPropertyFilter;
@@ -2245,188 +2116,357 @@ type RollupPropertyFilter = {
2245
2116
  } | {
2246
2117
  number: NumberPropertyFilter;
2247
2118
  };
2248
- type VerificationPropertyStatusFilter = {
2249
- status: "verified" | "expired" | "none";
2119
+ export type RollupPropertyItemObjectResponse = {
2120
+ type: "rollup";
2121
+ rollup: {
2122
+ type: "number";
2123
+ number: number | null;
2124
+ function: RollupFunction;
2125
+ } | {
2126
+ type: "date";
2127
+ date: DateResponse | null;
2128
+ function: RollupFunction;
2129
+ } | {
2130
+ type: "array";
2131
+ array: Array<EmptyObject>;
2132
+ function: RollupFunction;
2133
+ } | {
2134
+ type: "unsupported";
2135
+ unsupported: EmptyObject;
2136
+ function: RollupFunction;
2137
+ } | {
2138
+ type: "incomplete";
2139
+ incomplete: EmptyObject;
2140
+ function: RollupFunction;
2141
+ };
2142
+ object: "property_item";
2143
+ id: string;
2250
2144
  };
2251
- type PropertyFilter = {
2252
- title: TextPropertyFilter;
2253
- property: string;
2254
- type?: "title";
2255
- } | {
2145
+ type RollupSubfilterPropertyFilter = {
2256
2146
  rich_text: TextPropertyFilter;
2257
- property: string;
2258
- type?: "rich_text";
2259
2147
  } | {
2260
2148
  number: NumberPropertyFilter;
2261
- property: string;
2262
- type?: "number";
2263
2149
  } | {
2264
2150
  checkbox: CheckboxPropertyFilter;
2265
- property: string;
2266
- type?: "checkbox";
2267
2151
  } | {
2268
2152
  select: SelectPropertyFilter;
2269
- property: string;
2270
- type?: "select";
2271
2153
  } | {
2272
2154
  multi_select: MultiSelectPropertyFilter;
2273
- property: string;
2274
- type?: "multi_select";
2275
2155
  } | {
2276
- status: StatusPropertyFilter;
2277
- property: string;
2278
- type?: "status";
2156
+ relation: RelationPropertyFilter;
2279
2157
  } | {
2280
2158
  date: DatePropertyFilter;
2281
- property: string;
2282
- type?: "date";
2283
2159
  } | {
2284
2160
  people: PeoplePropertyFilter;
2285
- property: string;
2286
- type?: "people";
2287
2161
  } | {
2288
2162
  files: ExistencePropertyFilter;
2289
- property: string;
2290
- type?: "files";
2291
- } | {
2292
- url: TextPropertyFilter;
2293
- property: string;
2294
- type?: "url";
2295
- } | {
2296
- email: TextPropertyFilter;
2297
- property: string;
2298
- type?: "email";
2299
2163
  } | {
2300
- phone_number: TextPropertyFilter;
2301
- property: string;
2302
- type?: "phone_number";
2303
- } | {
2304
- relation: RelationPropertyFilter;
2305
- property: string;
2306
- type?: "relation";
2307
- } | {
2308
- created_by: PeoplePropertyFilter;
2309
- property: string;
2310
- type?: "created_by";
2164
+ status: StatusPropertyFilter;
2165
+ };
2166
+ /**
2167
+ * One of: `default`, `gray`, `brown`, `orange`, `yellow`, `green`, `blue`, `purple`,
2168
+ * `pink`, `red`
2169
+ */
2170
+ type SelectColor = "default" | "gray" | "brown" | "orange" | "yellow" | "green" | "blue" | "purple" | "pink" | "red";
2171
+ type SelectDatabasePropertyConfigResponse = {
2172
+ type: "select";
2173
+ select: {
2174
+ options: Array<SelectPropertyResponse>;
2175
+ };
2176
+ };
2177
+ type SelectPropertyConfigurationRequest = {
2178
+ type?: "select";
2179
+ select: {
2180
+ options?: Array<{
2181
+ name: string;
2182
+ color?: SelectColor;
2183
+ description?: string | null;
2184
+ }>;
2185
+ };
2186
+ };
2187
+ type SelectPropertyFilter = {
2188
+ equals: string;
2311
2189
  } | {
2312
- created_time: DatePropertyFilter;
2313
- property: string;
2314
- type?: "created_time";
2190
+ does_not_equal: string;
2191
+ } | ExistencePropertyFilter;
2192
+ export type SelectPropertyItemObjectResponse = {
2193
+ type: "select";
2194
+ select: PartialSelectResponse | null;
2195
+ object: "property_item";
2196
+ id: string;
2197
+ };
2198
+ type SelectPropertyResponse = {
2199
+ id: string;
2200
+ name: string;
2201
+ color: SelectColor;
2202
+ description: string | null;
2203
+ };
2204
+ type SelectSimplePropertyValueResponse = {
2205
+ type: "select";
2206
+ select: PartialSelectPropertyValueResponse | null;
2207
+ };
2208
+ type SimpleOrArrayPropertyValueResponse = SimplePropertyValueResponse | ArrayBasedPropertyValueResponse;
2209
+ type SimplePropertyValueResponse = NumberSimplePropertyValueResponse | UrlSimplePropertyValueResponse | SelectSimplePropertyValueResponse | MultiSelectSimplePropertyValueResponse | StatusSimplePropertyValueResponse | DateSimplePropertyValueResponse | EmailSimplePropertyValueResponse | PhoneNumberSimplePropertyValueResponse | CheckboxSimplePropertyValueResponse | FilesSimplePropertyValueResponse | CreatedBySimplePropertyValueResponse | CreatedTimeSimplePropertyValueResponse | LastEditedBySimplePropertyValueResponse | LastEditedTimeSimplePropertyValueResponse | FormulaSimplePropertyValueResponse | ButtonSimplePropertyValueResponse | UniqueIdSimplePropertyValueResponse | VerificationSimplePropertyValueResponse | PlaceSimplePropertyValueResponse;
2210
+ type SinglePropertyDatabasePropertyRelationConfigResponse = {
2211
+ type: "single_property";
2212
+ single_property: EmptyObject;
2213
+ };
2214
+ type StatusDatabasePropertyConfigResponse = {
2215
+ type: "status";
2216
+ status: {
2217
+ options: Array<StatusPropertyResponse>;
2218
+ groups: Array<{
2219
+ id: string;
2220
+ name: string;
2221
+ color: SelectColor;
2222
+ option_ids: Array<string>;
2223
+ }>;
2224
+ };
2225
+ };
2226
+ type StatusPropertyConfigurationRequest = {
2227
+ type?: "status";
2228
+ status: EmptyObject;
2229
+ };
2230
+ type StatusPropertyFilter = {
2231
+ equals: string;
2315
2232
  } | {
2316
- last_edited_by: PeoplePropertyFilter;
2317
- property: string;
2318
- type?: "last_edited_by";
2233
+ does_not_equal: string;
2234
+ } | ExistencePropertyFilter;
2235
+ export type StatusPropertyItemObjectResponse = {
2236
+ type: "status";
2237
+ status: PartialSelectResponse | null;
2238
+ object: "property_item";
2239
+ id: string;
2240
+ };
2241
+ type StatusPropertyResponse = {
2242
+ id: string;
2243
+ name: string;
2244
+ color: SelectColor;
2245
+ description: string | null;
2246
+ };
2247
+ type StatusSimplePropertyValueResponse = {
2248
+ type: "status";
2249
+ status: PartialSelectPropertyValueResponse | null;
2250
+ };
2251
+ type StringFormulaPropertyResponse = {
2252
+ type: "string";
2253
+ string: string | null;
2254
+ };
2255
+ type StringFormulaPropertyValueResponse = {
2256
+ type: "string";
2257
+ string: string | null;
2258
+ };
2259
+ type StringRequest = string;
2260
+ export type SyncedBlockBlockObjectResponse = {
2261
+ type: "synced_block";
2262
+ synced_block: {
2263
+ synced_from: {
2264
+ type: "block_id";
2265
+ block_id: IdRequest;
2266
+ } | null;
2267
+ };
2268
+ parent: ParentForBlockBasedObjectResponse;
2269
+ object: "block";
2270
+ id: string;
2271
+ created_time: string;
2272
+ created_by: PartialUserObjectResponse;
2273
+ last_edited_time: string;
2274
+ last_edited_by: PartialUserObjectResponse;
2275
+ has_children: boolean;
2276
+ archived: boolean;
2277
+ in_trash: boolean;
2278
+ };
2279
+ export type TableBlockObjectResponse = {
2280
+ type: "table";
2281
+ table: ContentWithTableResponse;
2282
+ parent: ParentForBlockBasedObjectResponse;
2283
+ object: "block";
2284
+ id: string;
2285
+ created_time: string;
2286
+ created_by: PartialUserObjectResponse;
2287
+ last_edited_time: string;
2288
+ last_edited_by: PartialUserObjectResponse;
2289
+ has_children: boolean;
2290
+ archived: boolean;
2291
+ in_trash: boolean;
2292
+ };
2293
+ export type TableOfContentsBlockObjectResponse = {
2294
+ type: "table_of_contents";
2295
+ table_of_contents: {
2296
+ color: ApiColor;
2297
+ };
2298
+ parent: ParentForBlockBasedObjectResponse;
2299
+ object: "block";
2300
+ id: string;
2301
+ created_time: string;
2302
+ created_by: PartialUserObjectResponse;
2303
+ last_edited_time: string;
2304
+ last_edited_by: PartialUserObjectResponse;
2305
+ has_children: boolean;
2306
+ archived: boolean;
2307
+ in_trash: boolean;
2308
+ };
2309
+ type TableRequestWithTableRowChildren = {
2310
+ table_width: number;
2311
+ children: Array<TableRowRequest>;
2312
+ has_column_header?: boolean;
2313
+ has_row_header?: boolean;
2314
+ };
2315
+ export type TableRowBlockObjectResponse = {
2316
+ type: "table_row";
2317
+ table_row: ContentWithTableRowResponse;
2318
+ parent: ParentForBlockBasedObjectResponse;
2319
+ object: "block";
2320
+ id: string;
2321
+ created_time: string;
2322
+ created_by: PartialUserObjectResponse;
2323
+ last_edited_time: string;
2324
+ last_edited_by: PartialUserObjectResponse;
2325
+ has_children: boolean;
2326
+ archived: boolean;
2327
+ in_trash: boolean;
2328
+ };
2329
+ type TableRowRequest = {
2330
+ table_row: ContentWithTableRowRequest;
2331
+ type?: "table_row";
2332
+ object?: "block";
2333
+ };
2334
+ export type TemplateBlockObjectResponse = {
2335
+ type: "template";
2336
+ template: {
2337
+ rich_text: Array<RichTextItemResponse>;
2338
+ };
2339
+ parent: ParentForBlockBasedObjectResponse;
2340
+ object: "block";
2341
+ id: string;
2342
+ created_time: string;
2343
+ created_by: PartialUserObjectResponse;
2344
+ last_edited_time: string;
2345
+ last_edited_by: PartialUserObjectResponse;
2346
+ has_children: boolean;
2347
+ archived: boolean;
2348
+ in_trash: boolean;
2349
+ };
2350
+ type TemplateMentionDateTemplateMentionRequest = {
2351
+ type?: "template_mention_date";
2352
+ template_mention_date: "today" | "now";
2353
+ };
2354
+ type TemplateMentionDateTemplateMentionResponse = {
2355
+ type: "template_mention_date";
2356
+ template_mention_date: "today" | "now";
2357
+ };
2358
+ type TemplateMentionRequest = TemplateMentionDateTemplateMentionRequest | TemplateMentionUserTemplateMentionRequest;
2359
+ type TemplateMentionResponse = TemplateMentionDateTemplateMentionResponse | TemplateMentionUserTemplateMentionResponse;
2360
+ type TemplateMentionUserTemplateMentionRequest = {
2361
+ type?: "template_mention_user";
2362
+ template_mention_user: "me";
2363
+ };
2364
+ type TemplateMentionUserTemplateMentionResponse = {
2365
+ type: "template_mention_user";
2366
+ template_mention_user: "me";
2367
+ };
2368
+ type TextPropertyFilter = {
2369
+ equals: string;
2319
2370
  } | {
2320
- last_edited_time: DatePropertyFilter;
2321
- property: string;
2322
- type?: "last_edited_time";
2371
+ does_not_equal: string;
2323
2372
  } | {
2324
- formula: FormulaPropertyFilter;
2325
- property: string;
2326
- type?: "formula";
2373
+ contains: string;
2327
2374
  } | {
2328
- unique_id: NumberPropertyFilter;
2329
- property: string;
2330
- type?: "unique_id";
2375
+ does_not_contain: string;
2331
2376
  } | {
2332
- rollup: RollupPropertyFilter;
2333
- property: string;
2334
- type?: "rollup";
2377
+ starts_with: string;
2335
2378
  } | {
2336
- verification: VerificationPropertyStatusFilter;
2337
- property: string;
2338
- type?: "verification";
2379
+ ends_with: string;
2380
+ } | ExistencePropertyFilter;
2381
+ type TextRequest = string;
2382
+ type TextRichTextItemRequest = {
2383
+ type?: "text";
2384
+ text: {
2385
+ content: string;
2386
+ link?: {
2387
+ url: string;
2388
+ } | null;
2389
+ };
2390
+ };
2391
+ export type TextRichTextItemResponse = {
2392
+ type: "text";
2393
+ text: {
2394
+ content: string;
2395
+ link: {
2396
+ url: string;
2397
+ } | null;
2398
+ };
2339
2399
  };
2400
+ type TimeZoneRequest = string;
2340
2401
  type TimestampCreatedTimeFilter = {
2341
2402
  created_time: DatePropertyFilter;
2342
2403
  timestamp: "created_time";
2343
2404
  type?: "created_time";
2344
2405
  };
2406
+ type TimestampFilter = TimestampCreatedTimeFilter | TimestampLastEditedTimeFilter;
2345
2407
  type TimestampLastEditedTimeFilter = {
2346
2408
  last_edited_time: DatePropertyFilter;
2347
2409
  timestamp: "last_edited_time";
2348
2410
  type?: "last_edited_time";
2349
2411
  };
2350
- type TimestampFilter = TimestampCreatedTimeFilter | TimestampLastEditedTimeFilter;
2351
- type PropertyOrTimestampFilter = PropertyFilter | TimestampFilter;
2352
- type PropertyOrTimestampFilterArray = Array<PropertyOrTimestampFilter>;
2353
- type GroupFilterOperatorArray = Array<PropertyOrTimestampFilter | {
2354
- or: PropertyOrTimestampFilterArray;
2355
- } | {
2356
- and: PropertyOrTimestampFilterArray;
2357
- }>;
2358
- type ParentOfDataSourceRequest = {
2359
- type?: "database_id";
2360
- database_id: IdRequest;
2412
+ type TitleArrayBasedPropertyValueResponse = {
2413
+ type: "title";
2414
+ title: Array<RichTextItemResponse>;
2361
2415
  };
2362
- type NumberPropertyConfigurationRequest = {
2363
- type?: "number";
2364
- number: {
2365
- format?: NumberFormat;
2366
- };
2416
+ type TitleDatabasePropertyConfigResponse = {
2417
+ type: "title";
2418
+ title: EmptyObject;
2367
2419
  };
2368
- type FormulaPropertyConfigurationRequest = {
2369
- type?: "formula";
2370
- formula: {
2371
- expression?: string;
2372
- };
2420
+ type TitleObjectResponse = {
2421
+ title: string;
2373
2422
  };
2374
- type SelectPropertyConfigurationRequest = {
2375
- type?: "select";
2376
- select: {
2377
- options?: Array<{
2378
- name: string;
2379
- color?: SelectColor;
2380
- description?: string | null;
2381
- }>;
2382
- };
2423
+ type TitlePropertyConfigurationRequest = {
2424
+ type?: "title";
2425
+ title: EmptyObject;
2383
2426
  };
2384
- type MultiSelectPropertyConfigurationRequest = {
2385
- type?: "multi_select";
2386
- multi_select: {
2387
- options?: Array<{
2388
- name: string;
2389
- color?: SelectColor;
2390
- description?: string | null;
2391
- }>;
2392
- };
2427
+ export type TitlePropertyItemObjectResponse = {
2428
+ type: "title";
2429
+ title: RichTextItemResponse;
2430
+ object: "property_item";
2431
+ id: string;
2393
2432
  };
2394
- type StatusPropertyConfigurationRequest = {
2395
- type?: "status";
2396
- status: EmptyObject;
2433
+ export type ToDoBlockObjectResponse = {
2434
+ type: "to_do";
2435
+ to_do: {
2436
+ rich_text: Array<RichTextItemResponse>;
2437
+ color: ApiColor;
2438
+ checked: boolean;
2439
+ };
2440
+ parent: ParentForBlockBasedObjectResponse;
2441
+ object: "block";
2442
+ id: string;
2443
+ created_time: string;
2444
+ created_by: PartialUserObjectResponse;
2445
+ last_edited_time: string;
2446
+ last_edited_by: PartialUserObjectResponse;
2447
+ has_children: boolean;
2448
+ archived: boolean;
2449
+ in_trash: boolean;
2397
2450
  };
2398
- type RelationPropertyConfigurationRequest = {
2399
- type?: "relation";
2400
- relation: {
2401
- data_source_id: IdRequest;
2402
- } & ({
2403
- type?: "single_property";
2404
- single_property: EmptyObject;
2405
- } | {
2406
- type?: "dual_property";
2407
- dual_property: {
2408
- synced_property_id?: string;
2409
- synced_property_name?: string;
2410
- };
2411
- });
2451
+ export type ToggleBlockObjectResponse = {
2452
+ type: "toggle";
2453
+ toggle: ContentWithRichTextAndColorResponse;
2454
+ parent: ParentForBlockBasedObjectResponse;
2455
+ object: "block";
2456
+ id: string;
2457
+ created_time: string;
2458
+ created_by: PartialUserObjectResponse;
2459
+ last_edited_time: string;
2460
+ last_edited_by: PartialUserObjectResponse;
2461
+ has_children: boolean;
2462
+ archived: boolean;
2463
+ in_trash: boolean;
2412
2464
  };
2413
- type RollupPropertyConfigurationRequest = {
2414
- type?: "rollup";
2415
- rollup: {
2416
- function: RollupFunction;
2417
- } & ({
2418
- relation_property_name: string;
2419
- rollup_property_name: string;
2420
- } | {
2421
- relation_property_id: string;
2422
- rollup_property_name: string;
2423
- } | {
2424
- relation_property_name: string;
2425
- rollup_property_id: string;
2426
- } | {
2427
- relation_property_id: string;
2428
- rollup_property_id: string;
2429
- });
2465
+ type UniqueIdDatabasePropertyConfigResponse = {
2466
+ type: "unique_id";
2467
+ unique_id: {
2468
+ prefix: string | null;
2469
+ };
2430
2470
  };
2431
2471
  type UniqueIdPropertyConfigurationRequest = {
2432
2472
  type?: "unique_id";
@@ -2434,176 +2474,123 @@ type UniqueIdPropertyConfigurationRequest = {
2434
2474
  prefix?: string | null;
2435
2475
  };
2436
2476
  };
2437
- type TitlePropertyConfigurationRequest = {
2438
- type?: "title";
2439
- title: EmptyObject;
2440
- };
2441
- type RichTextPropertyConfigurationRequest = {
2442
- type?: "rich_text";
2443
- rich_text: EmptyObject;
2444
- };
2445
- type UrlPropertyConfigurationRequest = {
2446
- type?: "url";
2447
- url: EmptyObject;
2448
- };
2449
- type PeoplePropertyConfigurationRequest = {
2450
- type?: "people";
2451
- people: EmptyObject;
2452
- };
2453
- type FilesPropertyConfigurationRequest = {
2454
- type?: "files";
2455
- files: EmptyObject;
2456
- };
2457
- type EmailPropertyConfigurationRequest = {
2458
- type?: "email";
2459
- email: EmptyObject;
2460
- };
2461
- type PhoneNumberPropertyConfigurationRequest = {
2462
- type?: "phone_number";
2463
- phone_number: EmptyObject;
2464
- };
2465
- type DatePropertyConfigurationRequest = {
2466
- type?: "date";
2467
- date: EmptyObject;
2468
- };
2469
- type CheckboxPropertyConfigurationRequest = {
2470
- type?: "checkbox";
2471
- checkbox: EmptyObject;
2472
- };
2473
- type CreatedByPropertyConfigurationRequest = {
2474
- type?: "created_by";
2475
- created_by: EmptyObject;
2476
- };
2477
- type CreatedTimePropertyConfigurationRequest = {
2478
- type?: "created_time";
2479
- created_time: EmptyObject;
2480
- };
2481
- type LastEditedByPropertyConfigurationRequest = {
2482
- type?: "last_edited_by";
2483
- last_edited_by: EmptyObject;
2484
- };
2485
- type LastEditedTimePropertyConfigurationRequest = {
2486
- type?: "last_edited_time";
2487
- last_edited_time: EmptyObject;
2477
+ export type UniqueIdPropertyItemObjectResponse = {
2478
+ type: "unique_id";
2479
+ unique_id: {
2480
+ prefix: string | null;
2481
+ number: number | null;
2482
+ };
2483
+ object: "property_item";
2484
+ id: string;
2488
2485
  };
2489
- type ButtonPropertyConfigurationRequest = {
2490
- type?: "button";
2491
- button: EmptyObject;
2486
+ type UniqueIdPropertyValueResponse = {
2487
+ prefix: string | null;
2488
+ number: number | null;
2492
2489
  };
2493
- type LocationPropertyConfigurationRequest = {
2494
- type?: "location";
2495
- location: EmptyObject;
2490
+ type UniqueIdSimplePropertyValueResponse = {
2491
+ type: "unique_id";
2492
+ unique_id: UniqueIdPropertyValueResponse;
2496
2493
  };
2497
- type VerificationPropertyConfigurationRequest = {
2498
- type?: "verification";
2499
- verification: EmptyObject;
2494
+ export type UnsupportedBlockObjectResponse = {
2495
+ type: "unsupported";
2496
+ unsupported: EmptyObject;
2497
+ parent: ParentForBlockBasedObjectResponse;
2498
+ object: "block";
2499
+ id: string;
2500
+ created_time: string;
2501
+ created_by: PartialUserObjectResponse;
2502
+ last_edited_time: string;
2503
+ last_edited_by: PartialUserObjectResponse;
2504
+ has_children: boolean;
2505
+ archived: boolean;
2506
+ in_trash: boolean;
2500
2507
  };
2501
- type LastVisitedTimePropertyConfigurationRequest = {
2502
- type?: "last_visited_time";
2503
- last_visited_time: EmptyObject;
2508
+ type UpdateMediaContentWithFileAndCaptionRequest = {
2509
+ caption?: Array<RichTextItemRequest>;
2510
+ external?: ExternalFileRequest;
2511
+ file_upload?: FileUploadIdRequest;
2504
2512
  };
2505
- type PlacePropertyConfigurationRequest = {
2506
- type?: "place";
2507
- place: EmptyObject;
2513
+ type UpdateMediaContentWithFileNameAndCaptionRequest = {
2514
+ caption?: Array<RichTextItemRequest>;
2515
+ external?: ExternalFileRequest;
2516
+ file_upload?: FileUploadIdRequest;
2517
+ name?: StringRequest;
2508
2518
  };
2509
- type PropertyConfigurationRequestCommon = {
2510
- description?: PropertyDescriptionRequest | null;
2519
+ type UpdateMediaContentWithUrlAndCaptionRequest = {
2520
+ url?: string;
2521
+ caption?: Array<RichTextItemRequest>;
2511
2522
  };
2512
- type PropertyConfigurationRequest = PropertyConfigurationRequestCommon & (NumberPropertyConfigurationRequest | FormulaPropertyConfigurationRequest | SelectPropertyConfigurationRequest | MultiSelectPropertyConfigurationRequest | StatusPropertyConfigurationRequest | RelationPropertyConfigurationRequest | RollupPropertyConfigurationRequest | UniqueIdPropertyConfigurationRequest | TitlePropertyConfigurationRequest | RichTextPropertyConfigurationRequest | UrlPropertyConfigurationRequest | PeoplePropertyConfigurationRequest | FilesPropertyConfigurationRequest | EmailPropertyConfigurationRequest | PhoneNumberPropertyConfigurationRequest | DatePropertyConfigurationRequest | CheckboxPropertyConfigurationRequest | CreatedByPropertyConfigurationRequest | CreatedTimePropertyConfigurationRequest | LastEditedByPropertyConfigurationRequest | LastEditedTimePropertyConfigurationRequest | ButtonPropertyConfigurationRequest | LocationPropertyConfigurationRequest | VerificationPropertyConfigurationRequest | LastVisitedTimePropertyConfigurationRequest | PlacePropertyConfigurationRequest);
2513
- type TemplateMentionDateTemplateMentionRequest = {
2514
- type?: "template_mention_date";
2515
- template_mention_date: "today" | "now";
2523
+ type UrlDatabasePropertyConfigResponse = {
2524
+ type: "url";
2525
+ url: EmptyObject;
2516
2526
  };
2517
- type TemplateMentionUserTemplateMentionRequest = {
2518
- type?: "template_mention_user";
2519
- template_mention_user: "me";
2527
+ type UrlPropertyConfigurationRequest = {
2528
+ type?: "url";
2529
+ url: EmptyObject;
2520
2530
  };
2521
- type TextRichTextItemRequest = {
2522
- type?: "text";
2523
- text: {
2524
- content: string;
2525
- link?: {
2526
- url: string;
2527
- } | null;
2528
- };
2531
+ export type UrlPropertyItemObjectResponse = {
2532
+ type: "url";
2533
+ url: string | null;
2534
+ object: "property_item";
2535
+ id: string;
2529
2536
  };
2530
- type MentionRichTextItemRequest = {
2531
- type?: "mention";
2532
- mention: {
2533
- type?: "user";
2534
- user: PartialUserObjectRequest;
2535
- } | {
2536
- type?: "date";
2537
- date: DateRequest;
2538
- } | {
2539
- type?: "page";
2540
- page: {
2541
- id: IdRequest;
2542
- };
2543
- } | {
2544
- type?: "database";
2545
- database: {
2546
- id: IdRequest;
2547
- };
2548
- } | {
2549
- type?: "template_mention";
2550
- template_mention: TemplateMentionRequest;
2551
- } | {
2552
- type?: "custom_emoji";
2553
- custom_emoji: {
2554
- id: IdRequest;
2555
- name?: string;
2556
- url?: string;
2557
- };
2558
- };
2537
+ type UrlSimplePropertyValueResponse = {
2538
+ type: "url";
2539
+ url: string | null;
2559
2540
  };
2560
- type EquationRichTextItemRequest = {
2561
- type?: "equation";
2562
- equation: {
2563
- expression: string;
2564
- };
2541
+ export type UserObjectResponse = UserObjectResponseCommon & (PersonUserObjectResponse | BotUserObjectResponse);
2542
+ export type UserObjectResponseCommon = {
2543
+ id: IdResponse;
2544
+ object: "user";
2545
+ name: string | null;
2546
+ avatar_url: string | null;
2565
2547
  };
2566
- type RichTextItemRequestCommon = {
2567
- annotations?: AnnotationRequest;
2548
+ type UserValueResponse = PartialUserObjectResponse | UserObjectResponse;
2549
+ type VerificationPropertyConfigurationRequest = {
2550
+ type?: "verification";
2551
+ verification: EmptyObject;
2568
2552
  };
2569
- type FileUploadPageIconRequest = {
2570
- type?: "file_upload";
2571
- file_upload: {
2572
- id: string;
2573
- };
2553
+ export type VerificationPropertyItemObjectResponse = {
2554
+ type: "verification";
2555
+ verification: VerificationPropertyValueResponse | null;
2556
+ object: "property_item";
2557
+ id: string;
2574
2558
  };
2575
- type EmojiPageIconRequest = {
2576
- type?: "emoji";
2577
- emoji: EmojiRequest;
2559
+ type VerificationPropertyResponse = {
2560
+ state: "verified" | "expired";
2561
+ date: DateResponse | null;
2562
+ verified_by: PartialUserObjectResponse | null;
2578
2563
  };
2579
- type ExternalPageIconRequest = {
2580
- type?: "external";
2581
- external: {
2582
- url: string;
2583
- };
2564
+ type VerificationPropertyStatusFilter = {
2565
+ status: "verified" | "expired" | "none";
2584
2566
  };
2585
- type CustomEmojiPageIconRequest = {
2586
- type?: "custom_emoji";
2587
- custom_emoji: {
2588
- id: IdRequest;
2589
- name?: string;
2590
- url?: string;
2591
- };
2567
+ type VerificationPropertyUnverifiedResponse = {
2568
+ state: "unverified";
2569
+ date: null;
2570
+ verified_by: null;
2592
2571
  };
2593
- type InitialDataSourceRequest = {
2594
- properties?: Record<string, PropertyConfigurationRequest>;
2572
+ type VerificationPropertyValueResponse = VerificationPropertyUnverifiedResponse | VerificationPropertyResponse;
2573
+ type VerificationSimplePropertyValueResponse = {
2574
+ type: "verification";
2575
+ verification: VerificationPropertyValueResponse | null;
2595
2576
  };
2596
- type FileUploadPageCoverRequest = {
2597
- type?: "file_upload";
2598
- file_upload: {
2599
- id: string;
2600
- };
2577
+ export type VideoBlockObjectResponse = {
2578
+ type: "video";
2579
+ video: MediaContentWithFileAndCaptionResponse;
2580
+ parent: ParentForBlockBasedObjectResponse;
2581
+ object: "block";
2582
+ id: string;
2583
+ created_time: string;
2584
+ created_by: PartialUserObjectResponse;
2585
+ last_edited_time: string;
2586
+ last_edited_by: PartialUserObjectResponse;
2587
+ has_children: boolean;
2588
+ archived: boolean;
2589
+ in_trash: boolean;
2601
2590
  };
2602
- type ExternalPageCoverRequest = {
2603
- type?: "external";
2604
- external: {
2605
- url: string;
2606
- };
2591
+ type WorkspaceParentForBlockBasedObjectResponse = {
2592
+ type: "workspace";
2593
+ workspace: true;
2607
2594
  };
2608
2595
  export type GetSelfParameters = Record<string, never>;
2609
2596
  export type GetSelfResponse = UserObjectResponse;
@@ -2741,6 +2728,16 @@ type CreatePageBodyParameters = {
2741
2728
  description?: TextRequest | null;
2742
2729
  } | null;
2743
2730
  type?: "status";
2731
+ } | {
2732
+ place: {
2733
+ lat: number;
2734
+ lon: number;
2735
+ name?: string | null;
2736
+ address?: string | null;
2737
+ aws_place_id?: string | null;
2738
+ google_place_id?: string | null;
2739
+ } | null;
2740
+ type?: "place";
2744
2741
  }>;
2745
2742
  icon?: PageIconRequest | null;
2746
2743
  cover?: PageCoverRequest | null;
@@ -2774,7 +2771,7 @@ type GetPageQueryParameters = {
2774
2771
  filter_properties?: Array<string>;
2775
2772
  };
2776
2773
  export type GetPageParameters = GetPagePathParameters & GetPageQueryParameters;
2777
- export type GetPageResponse = PageObjectResponse | PartialPageObjectResponse;
2774
+ export type GetPageResponse = PartialPageObjectResponse | PageObjectResponse;
2778
2775
  /**
2779
2776
  * Retrieve a page
2780
2777
  */
@@ -2861,6 +2858,16 @@ type UpdatePageBodyParameters = {
2861
2858
  description?: TextRequest | null;
2862
2859
  } | null;
2863
2860
  type?: "status";
2861
+ } | {
2862
+ place: {
2863
+ lat: number;
2864
+ lon: number;
2865
+ name?: string | null;
2866
+ address?: string | null;
2867
+ aws_place_id?: string | null;
2868
+ google_place_id?: string | null;
2869
+ } | null;
2870
+ type?: "place";
2864
2871
  }>;
2865
2872
  icon?: PageIconRequest | null;
2866
2873
  cover?: PageCoverRequest | null;
@@ -3321,6 +3328,9 @@ type UpdateDataSourceBodyParameters = {
3321
3328
  } | {
3322
3329
  type?: "last_edited_time";
3323
3330
  last_edited_time: EmptyObject;
3331
+ } | {
3332
+ type?: "place";
3333
+ place: EmptyObject;
3324
3334
  })) | {
3325
3335
  name: string;
3326
3336
  } | null>;
@@ -3402,6 +3412,34 @@ export declare const createDataSource: {
3402
3412
  readonly bodyParams: readonly ["parent", "properties", "title", "icon"];
3403
3413
  readonly path: () => string;
3404
3414
  };
3415
+ type ListDataSourceTemplatesPathParameters = {
3416
+ data_source_id: IdRequest;
3417
+ };
3418
+ type ListDataSourceTemplatesQueryParameters = {
3419
+ name?: string;
3420
+ start_cursor?: string;
3421
+ page_size?: number;
3422
+ };
3423
+ export type ListDataSourceTemplatesParameters = ListDataSourceTemplatesPathParameters & ListDataSourceTemplatesQueryParameters;
3424
+ export type ListDataSourceTemplatesResponse = {
3425
+ templates: Array<{
3426
+ id: IdResponse;
3427
+ name: string;
3428
+ is_default: boolean;
3429
+ }>;
3430
+ has_more: boolean;
3431
+ next_cursor: IdResponse | null;
3432
+ };
3433
+ /**
3434
+ * List templates in a data source
3435
+ */
3436
+ export declare const listDataSourceTemplates: {
3437
+ readonly method: "get";
3438
+ readonly pathParams: readonly ["data_source_id"];
3439
+ readonly queryParams: readonly ["name", "start_cursor", "page_size"];
3440
+ readonly bodyParams: readonly [];
3441
+ readonly path: (p: ListDataSourceTemplatesPathParameters) => string;
3442
+ };
3405
3443
  type GetDatabasePathParameters = {
3406
3444
  database_id: IdRequest;
3407
3445
  };
@@ -3772,33 +3810,29 @@ export declare const oauthIntrospect: {
3772
3810
  readonly bodyParams: readonly ["token"];
3773
3811
  readonly path: () => string;
3774
3812
  };
3775
- type ListDataSourceTemplatesPathParameters = {
3776
- data_source_id: IdRequest;
3777
- };
3778
- type ListDataSourceTemplatesQueryParameters = {
3779
- name?: string;
3780
- start_cursor?: string;
3781
- page_size?: number;
3813
+ type MovePagePathParameters = {
3814
+ page_id: IdRequest;
3782
3815
  };
3783
- export type ListDataSourceTemplatesParameters = ListDataSourceTemplatesPathParameters & ListDataSourceTemplatesQueryParameters;
3784
- export type ListDataSourceTemplatesResponse = {
3785
- templates: Array<{
3786
- id: IdResponse;
3787
- name: string;
3788
- is_default: boolean;
3789
- }>;
3790
- has_more: boolean;
3791
- next_cursor: IdResponse | null;
3816
+ type MovePageBodyParameters = {
3817
+ parent: {
3818
+ page_id: IdRequest;
3819
+ type?: "page_id";
3820
+ } | {
3821
+ data_source_id: IdRequest;
3822
+ type?: "data_source_id";
3823
+ };
3792
3824
  };
3825
+ export type MovePageParameters = MovePagePathParameters & MovePageBodyParameters;
3826
+ export type MovePageResponse = PartialPageObjectResponse | PageObjectResponse;
3793
3827
  /**
3794
- * List templates in a data source
3828
+ * Move a page
3795
3829
  */
3796
- export declare const listDataSourceTemplates: {
3797
- readonly method: "get";
3798
- readonly pathParams: readonly ["data_source_id"];
3799
- readonly queryParams: readonly ["name", "start_cursor", "page_size"];
3800
- readonly bodyParams: readonly [];
3801
- readonly path: (p: ListDataSourceTemplatesPathParameters) => string;
3830
+ export declare const movePage: {
3831
+ readonly method: "post";
3832
+ readonly pathParams: readonly ["page_id"];
3833
+ readonly queryParams: readonly [];
3834
+ readonly bodyParams: readonly ["parent"];
3835
+ readonly path: (p: MovePagePathParameters) => string;
3802
3836
  };
3803
3837
  export {};
3804
3838
  //# sourceMappingURL=api-endpoints.d.ts.map