@visus-io/notion-sdk-ts 3.0.2 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/README.md +7 -6
  2. package/dist/api/asyncTasks.api.d.ts +70 -0
  3. package/dist/api/asyncTasks.api.js +68 -0
  4. package/dist/api/base.api.js +1 -0
  5. package/dist/api/blocks.api.d.ts +433 -73
  6. package/dist/api/blocks.api.js +39 -0
  7. package/dist/api/comments.api.d.ts +40 -5
  8. package/dist/api/comments.api.js +43 -1
  9. package/dist/api/customEmojis.api.d.ts +36 -0
  10. package/dist/api/customEmojis.api.js +36 -0
  11. package/dist/api/dataSources.api.d.ts +62 -11
  12. package/dist/api/dataSources.api.js +22 -0
  13. package/dist/api/databases.api.d.ts +40 -6
  14. package/dist/api/fileUploads.api.d.ts +1 -1
  15. package/dist/api/index.d.ts +3 -0
  16. package/dist/api/index.js +7 -1
  17. package/dist/api/pages.api.d.ts +142 -10
  18. package/dist/api/pages.api.js +64 -0
  19. package/dist/api/search.api.d.ts +10 -2
  20. package/dist/api/users.api.d.ts +1 -0
  21. package/dist/api/views.api.d.ts +284 -0
  22. package/dist/api/views.api.js +169 -0
  23. package/dist/client.js +3 -3
  24. package/dist/errors.d.ts +5 -1
  25. package/dist/errors.js +6 -0
  26. package/dist/helpers/block.helpers.d.ts +38 -1
  27. package/dist/helpers/block.helpers.js +45 -3
  28. package/dist/helpers/file.helpers.d.ts +36 -1
  29. package/dist/helpers/file.helpers.js +26 -4
  30. package/dist/helpers/filter.helpers.d.ts +6 -6
  31. package/dist/helpers/index.d.ts +3 -2
  32. package/dist/helpers/index.js +5 -1
  33. package/dist/helpers/pagination.helpers.d.ts +56 -0
  34. package/dist/helpers/pagination.helpers.js +86 -0
  35. package/dist/helpers/property.helpers.d.ts +29 -0
  36. package/dist/helpers/property.helpers.js +27 -0
  37. package/dist/helpers/webhook.helpers.d.ts +52 -0
  38. package/dist/helpers/webhook.helpers.js +81 -0
  39. package/dist/models/asyncTask.model.d.ts +59 -0
  40. package/dist/models/asyncTask.model.js +89 -0
  41. package/dist/models/block.model.js +4 -1
  42. package/dist/models/customEmoji.model.d.ts +28 -0
  43. package/dist/models/customEmoji.model.js +42 -0
  44. package/dist/models/dataSource.model.d.ts +3 -3
  45. package/dist/models/dataSource.model.js +1 -1
  46. package/dist/models/database.model.d.ts +7 -3
  47. package/dist/models/database.model.js +7 -1
  48. package/dist/models/index.d.ts +3 -0
  49. package/dist/models/index.js +7 -1
  50. package/dist/models/page.model.d.ts +2 -0
  51. package/dist/models/page.model.js +6 -0
  52. package/dist/models/view.model.d.ts +79 -0
  53. package/dist/models/view.model.js +119 -0
  54. package/dist/notion.d.ts +26 -7
  55. package/dist/notion.js +19 -3
  56. package/dist/schemas/asyncTask.schema.d.ts +42 -0
  57. package/dist/schemas/asyncTask.schema.js +83 -0
  58. package/dist/schemas/block.schema.d.ts +378 -72
  59. package/dist/schemas/block.schema.js +33 -7
  60. package/dist/schemas/comment.schema.d.ts +8 -3
  61. package/dist/schemas/customEmoji.schema.d.ts +13 -0
  62. package/dist/schemas/customEmoji.schema.js +48 -0
  63. package/dist/schemas/dataSource.schema.d.ts +68 -10
  64. package/dist/schemas/dataSource.schema.js +22 -4
  65. package/dist/schemas/database.schema.d.ts +38 -6
  66. package/dist/schemas/database.schema.js +3 -2
  67. package/dist/schemas/fileUpload.schema.d.ts +1 -1
  68. package/dist/schemas/icon.schema.d.ts +92 -0
  69. package/dist/schemas/icon.schema.js +88 -0
  70. package/dist/schemas/index.d.ts +6 -0
  71. package/dist/schemas/index.js +6 -0
  72. package/dist/schemas/meetingNotesQuery.schema.d.ts +4187 -0
  73. package/dist/schemas/meetingNotesQuery.schema.js +62 -0
  74. package/dist/schemas/page.schema.d.ts +46 -9
  75. package/dist/schemas/page.schema.js +4 -2
  76. package/dist/schemas/pageMarkdown.schema.d.ts +59 -0
  77. package/dist/schemas/pageMarkdown.schema.js +65 -0
  78. package/dist/schemas/pageProperties.schema.d.ts +30 -18
  79. package/dist/schemas/pageProperties.schema.js +2 -3
  80. package/dist/schemas/pagination.schema.d.ts +30 -3
  81. package/dist/schemas/pagination.schema.js +18 -1
  82. package/dist/schemas/parent.schema.d.ts +10 -1
  83. package/dist/schemas/parent.schema.js +9 -3
  84. package/dist/schemas/propertyObjects.schema.d.ts +12 -12
  85. package/dist/schemas/richText.schema.d.ts +8 -6
  86. package/dist/schemas/richText.schema.js +1 -1
  87. package/dist/schemas/user.schema.d.ts +2 -0
  88. package/dist/schemas/user.schema.js +2 -1
  89. package/dist/schemas/view.schema.d.ts +1077 -0
  90. package/dist/schemas/view.schema.js +115 -0
  91. package/package.json +2 -2
@@ -37,8 +37,8 @@ exports.blockSchema = exports.blockPositionSchema = void 0;
37
37
  const z = __importStar(require("zod"));
38
38
  const codeLanguages_1 = require("./codeLanguages");
39
39
  const colors_1 = require("./colors");
40
- const emoji_schema_1 = require("./emoji.schema");
41
40
  const file_schema_1 = require("./file.schema");
41
+ const icon_schema_1 = require("./icon.schema");
42
42
  const parent_schema_1 = require("./parent.schema");
43
43
  const richText_schema_1 = require("./richText.schema");
44
44
  const shared_schema_1 = require("./shared.schema");
@@ -95,6 +95,7 @@ exports.blockSchema = z.object({
95
95
  'heading_1',
96
96
  'heading_2',
97
97
  'heading_3',
98
+ 'heading_4',
98
99
  'image',
99
100
  'link_preview',
100
101
  'numbered_list_item',
@@ -102,6 +103,7 @@ exports.blockSchema = z.object({
102
103
  'pdf',
103
104
  'quote',
104
105
  'synced_block',
106
+ 'tab',
105
107
  'table',
106
108
  'table_of_contents',
107
109
  'table_row',
@@ -139,7 +141,7 @@ exports.blockSchema = z.object({
139
141
  callout: z
140
142
  .object({
141
143
  rich_text: richText_schema_1.richTextSchema,
142
- icon: z.union([emoji_schema_1.emojiSchema, file_schema_1.fileSchema]),
144
+ icon: icon_schema_1.iconSchema,
143
145
  color: z.enum(colors_1.NOTION_COLORS),
144
146
  get children() {
145
147
  return getChildrenSchema();
@@ -163,7 +165,13 @@ exports.blockSchema = z.object({
163
165
  language: z.enum(codeLanguages_1.CODE_BLOCK_LANGUAGES),
164
166
  })
165
167
  .optional(),
166
- column_list: z.object({}).optional(),
168
+ column_list: z
169
+ .object({
170
+ get children() {
171
+ return getChildrenSchema();
172
+ },
173
+ })
174
+ .optional(),
167
175
  column: z
168
176
  .object({
169
177
  width_ratio: z.number().min(0).max(1).optional(),
@@ -197,6 +205,7 @@ exports.blockSchema = z.object({
197
205
  heading_1: headingsObjectSchema.optional(),
198
206
  heading_2: headingsObjectSchema.optional(),
199
207
  heading_3: headingsObjectSchema.optional(),
208
+ heading_4: headingsObjectSchema.optional(),
200
209
  image: file_schema_1.fileSchema.optional(),
201
210
  link_preview: z.object({ url: z.url() }).optional(),
202
211
  numbered_list_item: z
@@ -214,6 +223,7 @@ exports.blockSchema = z.object({
214
223
  .object({
215
224
  rich_text: richText_schema_1.richTextSchema,
216
225
  color: z.enum(colors_1.NOTION_COLORS),
226
+ icon: icon_schema_1.iconSchema.optional(),
217
227
  get children() {
218
228
  return getChildrenSchema();
219
229
  },
@@ -251,6 +261,13 @@ exports.blockSchema = z.object({
251
261
  },
252
262
  })
253
263
  .optional(),
264
+ tab: z
265
+ .object({
266
+ get children() {
267
+ return getChildrenSchema();
268
+ },
269
+ })
270
+ .optional(),
254
271
  table: z
255
272
  .object({
256
273
  table_width: z.int(),
@@ -295,12 +312,21 @@ exports.blockSchema = z.object({
295
312
  },
296
313
  })
297
314
  .optional(),
315
+ // Meeting-notes blocks are server-managed: title/status/child-block-ids are populated
316
+ // by Notion, not hand-constructed by clients. Exact `status` enum values weren't
317
+ // confirmed against a live response, so it's kept permissive (a trimmed string)
318
+ // rather than a guessed closed enum, to avoid rejecting valid live responses.
298
319
  meeting_notes: z
299
320
  .object({
300
- rich_text: richText_schema_1.richTextSchema,
301
- get children() {
302
- return getChildrenSchema();
303
- },
321
+ title: richText_schema_1.richTextSchema,
322
+ status: z.string().trim(),
323
+ children: z.object({
324
+ summary_block_id: z.uuid().nullish(),
325
+ notes_block_id: z.uuid().nullish(),
326
+ transcript_block_id: z.uuid().nullish(),
327
+ }),
328
+ calendar_event: z.unknown().nullish(),
329
+ recording: z.unknown().nullish(),
304
330
  })
305
331
  .optional(),
306
332
  unsupported: z.object({}).optional(),
@@ -42,6 +42,9 @@ export declare const commentSchema: z.ZodObject<{
42
42
  }, z.core.$strip>, z.ZodObject<{
43
43
  type: z.ZodLiteral<"block_id">;
44
44
  block_id: z.ZodUUID;
45
+ }, z.core.$strip>, z.ZodObject<{
46
+ type: z.ZodLiteral<"agent_id">;
47
+ agent_id: z.ZodUUID;
45
48
  }, z.core.$strip>], "type">;
46
49
  discussion_id: z.ZodUUID;
47
50
  created_time: z.ZodUnion<readonly [z.ZodISODateTime, z.ZodISODate]>;
@@ -53,6 +56,7 @@ export declare const commentSchema: z.ZodObject<{
53
56
  avatar_url: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodNull]>>;
54
57
  person: z.ZodObject<{
55
58
  email: z.ZodEmail;
59
+ email_verified: z.ZodOptional<z.ZodBoolean>;
56
60
  }, z.core.$strip>;
57
61
  }, z.core.$strip>, z.ZodObject<{
58
62
  object: z.ZodLiteral<"user">;
@@ -93,11 +97,11 @@ export declare const commentSchema: z.ZodObject<{
93
97
  underline: z.ZodBoolean;
94
98
  code: z.ZodBoolean;
95
99
  color: z.ZodEnum<{
100
+ default: "default";
96
101
  blue: "blue";
97
102
  blue_background: "blue_background";
98
103
  brown: "brown";
99
104
  brown_background: "brown_background";
100
- default: "default";
101
105
  gray: "gray";
102
106
  gray_background: "gray_background";
103
107
  green: "green";
@@ -162,6 +166,7 @@ export declare const commentSchema: z.ZodObject<{
162
166
  avatar_url: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodNull]>>;
163
167
  person: z.ZodObject<{
164
168
  email: z.ZodEmail;
169
+ email_verified: z.ZodOptional<z.ZodBoolean>;
165
170
  }, z.core.$strip>;
166
171
  }, z.core.$strip>, z.ZodObject<{
167
172
  object: z.ZodLiteral<"user">;
@@ -194,11 +199,11 @@ export declare const commentSchema: z.ZodObject<{
194
199
  underline: z.ZodBoolean;
195
200
  code: z.ZodBoolean;
196
201
  color: z.ZodEnum<{
202
+ default: "default";
197
203
  blue: "blue";
198
204
  blue_background: "blue_background";
199
205
  brown: "brown";
200
206
  brown_background: "brown_background";
201
- default: "default";
202
207
  gray: "gray";
203
208
  gray_background: "gray_background";
204
209
  green: "green";
@@ -229,11 +234,11 @@ export declare const commentSchema: z.ZodObject<{
229
234
  underline: z.ZodBoolean;
230
235
  code: z.ZodBoolean;
231
236
  color: z.ZodEnum<{
237
+ default: "default";
232
238
  blue: "blue";
233
239
  blue_background: "blue_background";
234
240
  brown: "brown";
235
241
  brown_background: "brown_background";
236
- default: "default";
237
242
  gray: "gray";
238
243
  gray_background: "gray_background";
239
244
  green: "green";
@@ -0,0 +1,13 @@
1
+ import * as z from 'zod';
2
+ /**
3
+ * Custom emoji object schema.
4
+ *
5
+ * Notion API reference:
6
+ * https://developers.notion.com/reference/list-custom-emojis
7
+ */
8
+ export declare const customEmojiSchema: z.ZodObject<{
9
+ id: z.ZodUUID;
10
+ name: z.ZodString;
11
+ url: z.ZodURL;
12
+ }, z.core.$strip>;
13
+ export type NotionCustomEmoji = z.infer<typeof customEmojiSchema>;
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.customEmojiSchema = void 0;
37
+ const z = __importStar(require("zod"));
38
+ /**
39
+ * Custom emoji object schema.
40
+ *
41
+ * Notion API reference:
42
+ * https://developers.notion.com/reference/list-custom-emojis
43
+ */
44
+ exports.customEmojiSchema = z.object({
45
+ id: z.uuid(),
46
+ name: z.string().trim(),
47
+ url: z.url(),
48
+ });
@@ -77,9 +77,9 @@ export declare const dataSourceSchema: z.ZodObject<{
77
77
  id: z.ZodString;
78
78
  name: z.ZodString;
79
79
  color: z.ZodEnum<{
80
+ default: "default";
80
81
  blue: "blue";
81
82
  brown: "brown";
82
- default: "default";
83
83
  gray: "gray";
84
84
  green: "green";
85
85
  orange: "orange";
@@ -221,9 +221,9 @@ export declare const dataSourceSchema: z.ZodObject<{
221
221
  id: z.ZodString;
222
222
  name: z.ZodString;
223
223
  color: z.ZodEnum<{
224
+ default: "default";
224
225
  blue: "blue";
225
226
  brown: "brown";
226
- default: "default";
227
227
  gray: "gray";
228
228
  green: "green";
229
229
  orange: "orange";
@@ -244,9 +244,9 @@ export declare const dataSourceSchema: z.ZodObject<{
244
244
  id: z.ZodString;
245
245
  name: z.ZodString;
246
246
  color: z.ZodEnum<{
247
+ default: "default";
247
248
  blue: "blue";
248
249
  brown: "brown";
249
- default: "default";
250
250
  gray: "gray";
251
251
  green: "green";
252
252
  orange: "orange";
@@ -260,9 +260,9 @@ export declare const dataSourceSchema: z.ZodObject<{
260
260
  id: z.ZodString;
261
261
  name: z.ZodString;
262
262
  color: z.ZodEnum<{
263
+ default: "default";
263
264
  blue: "blue";
264
265
  brown: "brown";
265
- default: "default";
266
266
  gray: "gray";
267
267
  green: "green";
268
268
  orange: "orange";
@@ -311,6 +311,9 @@ export declare const dataSourceSchema: z.ZodObject<{
311
311
  }, z.core.$strip>, z.ZodObject<{
312
312
  type: z.ZodLiteral<"block_id">;
313
313
  block_id: z.ZodUUID;
314
+ }, z.core.$strip>, z.ZodObject<{
315
+ type: z.ZodLiteral<"agent_id">;
316
+ agent_id: z.ZodUUID;
314
317
  }, z.core.$strip>], "type">;
315
318
  database_parent: z.ZodDiscriminatedUnion<[z.ZodObject<{
316
319
  type: z.ZodLiteral<"database_id">;
@@ -328,6 +331,9 @@ export declare const dataSourceSchema: z.ZodObject<{
328
331
  }, z.core.$strip>, z.ZodObject<{
329
332
  type: z.ZodLiteral<"block_id">;
330
333
  block_id: z.ZodUUID;
334
+ }, z.core.$strip>, z.ZodObject<{
335
+ type: z.ZodLiteral<"agent_id">;
336
+ agent_id: z.ZodUUID;
331
337
  }, z.core.$strip>], "type">;
332
338
  created_time: z.ZodUnion<readonly [z.ZodISODateTime, z.ZodISODate]>;
333
339
  created_by: z.ZodUnion<readonly [z.ZodObject<{
@@ -338,6 +344,7 @@ export declare const dataSourceSchema: z.ZodObject<{
338
344
  avatar_url: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodNull]>>;
339
345
  person: z.ZodObject<{
340
346
  email: z.ZodEmail;
347
+ email_verified: z.ZodOptional<z.ZodBoolean>;
341
348
  }, z.core.$strip>;
342
349
  }, z.core.$strip>, z.ZodObject<{
343
350
  object: z.ZodLiteral<"user">;
@@ -371,6 +378,7 @@ export declare const dataSourceSchema: z.ZodObject<{
371
378
  avatar_url: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodNull]>>;
372
379
  person: z.ZodObject<{
373
380
  email: z.ZodEmail;
381
+ email_verified: z.ZodOptional<z.ZodBoolean>;
374
382
  }, z.core.$strip>;
375
383
  }, z.core.$strip>, z.ZodObject<{
376
384
  object: z.ZodLiteral<"user">;
@@ -410,11 +418,11 @@ export declare const dataSourceSchema: z.ZodObject<{
410
418
  underline: z.ZodBoolean;
411
419
  code: z.ZodBoolean;
412
420
  color: z.ZodEnum<{
421
+ default: "default";
413
422
  blue: "blue";
414
423
  blue_background: "blue_background";
415
424
  brown: "brown";
416
425
  brown_background: "brown_background";
417
- default: "default";
418
426
  gray: "gray";
419
427
  gray_background: "gray_background";
420
428
  green: "green";
@@ -479,6 +487,7 @@ export declare const dataSourceSchema: z.ZodObject<{
479
487
  avatar_url: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodNull]>>;
480
488
  person: z.ZodObject<{
481
489
  email: z.ZodEmail;
490
+ email_verified: z.ZodOptional<z.ZodBoolean>;
482
491
  }, z.core.$strip>;
483
492
  }, z.core.$strip>, z.ZodObject<{
484
493
  object: z.ZodLiteral<"user">;
@@ -511,11 +520,11 @@ export declare const dataSourceSchema: z.ZodObject<{
511
520
  underline: z.ZodBoolean;
512
521
  code: z.ZodBoolean;
513
522
  color: z.ZodEnum<{
523
+ default: "default";
514
524
  blue: "blue";
515
525
  blue_background: "blue_background";
516
526
  brown: "brown";
517
527
  brown_background: "brown_background";
518
- default: "default";
519
528
  gray: "gray";
520
529
  gray_background: "gray_background";
521
530
  green: "green";
@@ -546,11 +555,11 @@ export declare const dataSourceSchema: z.ZodObject<{
546
555
  underline: z.ZodBoolean;
547
556
  code: z.ZodBoolean;
548
557
  color: z.ZodEnum<{
558
+ default: "default";
549
559
  blue: "blue";
550
560
  blue_background: "blue_background";
551
561
  brown: "brown";
552
562
  brown_background: "brown_background";
553
- default: "default";
554
563
  gray: "gray";
555
564
  gray_background: "gray_background";
556
565
  green: "green";
@@ -585,11 +594,11 @@ export declare const dataSourceSchema: z.ZodObject<{
585
594
  underline: z.ZodBoolean;
586
595
  code: z.ZodBoolean;
587
596
  color: z.ZodEnum<{
597
+ default: "default";
588
598
  blue: "blue";
589
599
  blue_background: "blue_background";
590
600
  brown: "brown";
591
601
  brown_background: "brown_background";
592
- default: "default";
593
602
  gray: "gray";
594
603
  gray_background: "gray_background";
595
604
  green: "green";
@@ -654,6 +663,7 @@ export declare const dataSourceSchema: z.ZodObject<{
654
663
  avatar_url: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodNull]>>;
655
664
  person: z.ZodObject<{
656
665
  email: z.ZodEmail;
666
+ email_verified: z.ZodOptional<z.ZodBoolean>;
657
667
  }, z.core.$strip>;
658
668
  }, z.core.$strip>, z.ZodObject<{
659
669
  object: z.ZodLiteral<"user">;
@@ -686,11 +696,11 @@ export declare const dataSourceSchema: z.ZodObject<{
686
696
  underline: z.ZodBoolean;
687
697
  code: z.ZodBoolean;
688
698
  color: z.ZodEnum<{
699
+ default: "default";
689
700
  blue: "blue";
690
701
  blue_background: "blue_background";
691
702
  brown: "brown";
692
703
  brown_background: "brown_background";
693
- default: "default";
694
704
  gray: "gray";
695
705
  gray_background: "gray_background";
696
706
  green: "green";
@@ -721,11 +731,11 @@ export declare const dataSourceSchema: z.ZodObject<{
721
731
  underline: z.ZodBoolean;
722
732
  code: z.ZodBoolean;
723
733
  color: z.ZodEnum<{
734
+ default: "default";
724
735
  blue: "blue";
725
736
  blue_background: "blue_background";
726
737
  brown: "brown";
727
738
  brown_background: "brown_background";
728
- default: "default";
729
739
  gray: "gray";
730
740
  gray_background: "gray_background";
731
741
  green: "green";
@@ -764,6 +774,30 @@ export declare const dataSourceSchema: z.ZodObject<{
764
774
  }, z.core.$strip>], "type">, z.ZodObject<{
765
775
  type: z.ZodLiteral<"emoji">;
766
776
  emoji: z.ZodString;
777
+ }, z.core.$strip>, z.ZodObject<{
778
+ type: z.ZodLiteral<"icon">;
779
+ icon: z.ZodObject<{
780
+ name: z.ZodString;
781
+ color: z.ZodOptional<z.ZodEnum<{
782
+ blue: "blue";
783
+ brown: "brown";
784
+ gray: "gray";
785
+ green: "green";
786
+ orange: "orange";
787
+ pink: "pink";
788
+ purple: "purple";
789
+ red: "red";
790
+ yellow: "yellow";
791
+ lightgray: "lightgray";
792
+ }>>;
793
+ }, z.core.$strip>;
794
+ }, z.core.$strip>, z.ZodObject<{
795
+ type: z.ZodLiteral<"custom_emoji">;
796
+ custom_emoji: z.ZodObject<{
797
+ id: z.ZodUUID;
798
+ name: z.ZodOptional<z.ZodString>;
799
+ url: z.ZodOptional<z.ZodURL>;
800
+ }, z.core.$strip>;
767
801
  }, z.core.$strip>]>>;
768
802
  cover: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
769
803
  type: z.ZodLiteral<"file">;
@@ -788,3 +822,27 @@ export declare const dataSourceSchema: z.ZodObject<{
788
822
  in_trash: z.ZodBoolean;
789
823
  }, z.core.$strip>;
790
824
  export type NotionDataSource = z.infer<typeof dataSourceSchema>;
825
+ /**
826
+ * A single data source template reference, as returned by the
827
+ * List data source templates endpoint.
828
+ *
829
+ * Notion API reference:
830
+ * https://developers.notion.com/reference/list-data-source-templates
831
+ */
832
+ export declare const dataSourceTemplateSchema: z.ZodObject<{
833
+ id: z.ZodUUID;
834
+ name: z.ZodString;
835
+ is_default: z.ZodBoolean;
836
+ }, z.core.$strip>;
837
+ export type DataSourceTemplate = z.infer<typeof dataSourceTemplateSchema>;
838
+ /** Response shape of the List data source templates endpoint. */
839
+ export declare const dataSourceTemplateListSchema: z.ZodObject<{
840
+ templates: z.ZodArray<z.ZodObject<{
841
+ id: z.ZodUUID;
842
+ name: z.ZodString;
843
+ is_default: z.ZodBoolean;
844
+ }, z.core.$strip>>;
845
+ has_more: z.ZodBoolean;
846
+ next_cursor: z.ZodNullable<z.ZodString>;
847
+ }, z.core.$strip>;
848
+ export type DataSourceTemplateList = z.infer<typeof dataSourceTemplateListSchema>;
@@ -33,10 +33,10 @@ var __importStar = (this && this.__importStar) || (function () {
33
33
  };
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.dataSourceSchema = void 0;
36
+ exports.dataSourceTemplateListSchema = exports.dataSourceTemplateSchema = exports.dataSourceSchema = void 0;
37
37
  const z = __importStar(require("zod"));
38
- const emoji_schema_1 = require("./emoji.schema");
39
38
  const file_schema_1 = require("./file.schema");
39
+ const icon_schema_1 = require("./icon.schema");
40
40
  const parent_schema_1 = require("./parent.schema");
41
41
  const richText_schema_1 = require("./richText.schema");
42
42
  const shared_schema_1 = require("./shared.schema");
@@ -74,8 +74,8 @@ exports.dataSourceSchema = z.object({
74
74
  title: richText_schema_1.richTextSchema,
75
75
  /** Description of the data source as it appears in Notion */
76
76
  description: richText_schema_1.richTextSchema,
77
- /** Data source icon (File or Emoji object) */
78
- icon: z.union([file_schema_1.fileSchema, emoji_schema_1.emojiSchema]).nullable(),
77
+ /** Data source icon (File, Emoji, Native Icon, or Custom Emoji object) */
78
+ icon: icon_schema_1.iconSchema.nullable(),
79
79
  /** Data source cover image */
80
80
  cover: file_schema_1.fileSchema.nullable(),
81
81
  /** The Notion URL of the data source */
@@ -87,3 +87,21 @@ exports.dataSourceSchema = z.object({
87
87
  /** Whether the data source is in the trash */
88
88
  in_trash: z.boolean(),
89
89
  });
90
+ /**
91
+ * A single data source template reference, as returned by the
92
+ * List data source templates endpoint.
93
+ *
94
+ * Notion API reference:
95
+ * https://developers.notion.com/reference/list-data-source-templates
96
+ */
97
+ exports.dataSourceTemplateSchema = z.object({
98
+ id: z.uuid(),
99
+ name: z.string().trim(),
100
+ is_default: z.boolean(),
101
+ });
102
+ /** Response shape of the List data source templates endpoint. */
103
+ exports.dataSourceTemplateListSchema = z.object({
104
+ templates: z.array(exports.dataSourceTemplateSchema),
105
+ has_more: z.boolean(),
106
+ next_cursor: z.string().trim().nullable(),
107
+ });
@@ -30,6 +30,7 @@ export declare const databaseSchema: z.ZodObject<{
30
30
  avatar_url: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodNull]>>;
31
31
  person: z.ZodObject<{
32
32
  email: z.ZodEmail;
33
+ email_verified: z.ZodOptional<z.ZodBoolean>;
33
34
  }, z.core.$strip>;
34
35
  }, z.core.$strip>, z.ZodObject<{
35
36
  object: z.ZodLiteral<"user">;
@@ -63,6 +64,7 @@ export declare const databaseSchema: z.ZodObject<{
63
64
  avatar_url: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodNull]>>;
64
65
  person: z.ZodObject<{
65
66
  email: z.ZodEmail;
67
+ email_verified: z.ZodOptional<z.ZodBoolean>;
66
68
  }, z.core.$strip>;
67
69
  }, z.core.$strip>, z.ZodObject<{
68
70
  object: z.ZodLiteral<"user">;
@@ -102,11 +104,11 @@ export declare const databaseSchema: z.ZodObject<{
102
104
  underline: z.ZodBoolean;
103
105
  code: z.ZodBoolean;
104
106
  color: z.ZodEnum<{
107
+ default: "default";
105
108
  blue: "blue";
106
109
  blue_background: "blue_background";
107
110
  brown: "brown";
108
111
  brown_background: "brown_background";
109
- default: "default";
110
112
  gray: "gray";
111
113
  gray_background: "gray_background";
112
114
  green: "green";
@@ -171,6 +173,7 @@ export declare const databaseSchema: z.ZodObject<{
171
173
  avatar_url: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodNull]>>;
172
174
  person: z.ZodObject<{
173
175
  email: z.ZodEmail;
176
+ email_verified: z.ZodOptional<z.ZodBoolean>;
174
177
  }, z.core.$strip>;
175
178
  }, z.core.$strip>, z.ZodObject<{
176
179
  object: z.ZodLiteral<"user">;
@@ -203,11 +206,11 @@ export declare const databaseSchema: z.ZodObject<{
203
206
  underline: z.ZodBoolean;
204
207
  code: z.ZodBoolean;
205
208
  color: z.ZodEnum<{
209
+ default: "default";
206
210
  blue: "blue";
207
211
  blue_background: "blue_background";
208
212
  brown: "brown";
209
213
  brown_background: "brown_background";
210
- default: "default";
211
214
  gray: "gray";
212
215
  gray_background: "gray_background";
213
216
  green: "green";
@@ -238,11 +241,11 @@ export declare const databaseSchema: z.ZodObject<{
238
241
  underline: z.ZodBoolean;
239
242
  code: z.ZodBoolean;
240
243
  color: z.ZodEnum<{
244
+ default: "default";
241
245
  blue: "blue";
242
246
  blue_background: "blue_background";
243
247
  brown: "brown";
244
248
  brown_background: "brown_background";
245
- default: "default";
246
249
  gray: "gray";
247
250
  gray_background: "gray_background";
248
251
  green: "green";
@@ -277,11 +280,11 @@ export declare const databaseSchema: z.ZodObject<{
277
280
  underline: z.ZodBoolean;
278
281
  code: z.ZodBoolean;
279
282
  color: z.ZodEnum<{
283
+ default: "default";
280
284
  blue: "blue";
281
285
  blue_background: "blue_background";
282
286
  brown: "brown";
283
287
  brown_background: "brown_background";
284
- default: "default";
285
288
  gray: "gray";
286
289
  gray_background: "gray_background";
287
290
  green: "green";
@@ -346,6 +349,7 @@ export declare const databaseSchema: z.ZodObject<{
346
349
  avatar_url: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodNull]>>;
347
350
  person: z.ZodObject<{
348
351
  email: z.ZodEmail;
352
+ email_verified: z.ZodOptional<z.ZodBoolean>;
349
353
  }, z.core.$strip>;
350
354
  }, z.core.$strip>, z.ZodObject<{
351
355
  object: z.ZodLiteral<"user">;
@@ -378,11 +382,11 @@ export declare const databaseSchema: z.ZodObject<{
378
382
  underline: z.ZodBoolean;
379
383
  code: z.ZodBoolean;
380
384
  color: z.ZodEnum<{
385
+ default: "default";
381
386
  blue: "blue";
382
387
  blue_background: "blue_background";
383
388
  brown: "brown";
384
389
  brown_background: "brown_background";
385
- default: "default";
386
390
  gray: "gray";
387
391
  gray_background: "gray_background";
388
392
  green: "green";
@@ -413,11 +417,11 @@ export declare const databaseSchema: z.ZodObject<{
413
417
  underline: z.ZodBoolean;
414
418
  code: z.ZodBoolean;
415
419
  color: z.ZodEnum<{
420
+ default: "default";
416
421
  blue: "blue";
417
422
  blue_background: "blue_background";
418
423
  brown: "brown";
419
424
  brown_background: "brown_background";
420
- default: "default";
421
425
  gray: "gray";
422
426
  gray_background: "gray_background";
423
427
  green: "green";
@@ -456,6 +460,30 @@ export declare const databaseSchema: z.ZodObject<{
456
460
  }, z.core.$strip>], "type">, z.ZodObject<{
457
461
  type: z.ZodLiteral<"emoji">;
458
462
  emoji: z.ZodString;
463
+ }, z.core.$strip>, z.ZodObject<{
464
+ type: z.ZodLiteral<"icon">;
465
+ icon: z.ZodObject<{
466
+ name: z.ZodString;
467
+ color: z.ZodOptional<z.ZodEnum<{
468
+ blue: "blue";
469
+ brown: "brown";
470
+ gray: "gray";
471
+ green: "green";
472
+ orange: "orange";
473
+ pink: "pink";
474
+ purple: "purple";
475
+ red: "red";
476
+ yellow: "yellow";
477
+ lightgray: "lightgray";
478
+ }>>;
479
+ }, z.core.$strip>;
480
+ }, z.core.$strip>, z.ZodObject<{
481
+ type: z.ZodLiteral<"custom_emoji">;
482
+ custom_emoji: z.ZodObject<{
483
+ id: z.ZodUUID;
484
+ name: z.ZodOptional<z.ZodString>;
485
+ url: z.ZodOptional<z.ZodURL>;
486
+ }, z.core.$strip>;
459
487
  }, z.core.$strip>]>>;
460
488
  cover: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
461
489
  type: z.ZodLiteral<"file">;
@@ -490,10 +518,14 @@ export declare const databaseSchema: z.ZodObject<{
490
518
  }, z.core.$strip>, z.ZodObject<{
491
519
  type: z.ZodLiteral<"block_id">;
492
520
  block_id: z.ZodUUID;
521
+ }, z.core.$strip>, z.ZodObject<{
522
+ type: z.ZodLiteral<"agent_id">;
523
+ agent_id: z.ZodUUID;
493
524
  }, z.core.$strip>], "type">;
494
525
  url: z.ZodURL;
495
526
  in_trash: z.ZodBoolean;
496
527
  is_inline: z.ZodBoolean;
528
+ is_locked: z.ZodOptional<z.ZodBoolean>;
497
529
  public_url: z.ZodNullable<z.ZodURL>;
498
530
  }, z.core.$strip>;
499
531
  export type NotionDatabase = z.infer<typeof databaseSchema>;
@@ -35,8 +35,8 @@ var __importStar = (this && this.__importStar) || (function () {
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.databaseSchema = exports.dataSourceRefSchema = void 0;
37
37
  const z = __importStar(require("zod"));
38
- const emoji_schema_1 = require("./emoji.schema");
39
38
  const file_schema_1 = require("./file.schema");
39
+ const icon_schema_1 = require("./icon.schema");
40
40
  const parent_schema_1 = require("./parent.schema");
41
41
  const richText_schema_1 = require("./richText.schema");
42
42
  const shared_schema_1 = require("./shared.schema");
@@ -65,11 +65,12 @@ exports.databaseSchema = z.object({
65
65
  last_edited_by: user_schema_1.userSchema,
66
66
  title: richText_schema_1.richTextSchema,
67
67
  description: richText_schema_1.richTextSchema,
68
- icon: z.nullable(z.union([file_schema_1.fileSchema, emoji_schema_1.emojiSchema])),
68
+ icon: z.nullable(icon_schema_1.iconSchema),
69
69
  cover: z.nullable(file_schema_1.fileSchema),
70
70
  parent: parent_schema_1.parentSchema,
71
71
  url: z.url(),
72
72
  in_trash: z.boolean(),
73
73
  is_inline: z.boolean(),
74
+ is_locked: z.boolean().optional(),
74
75
  public_url: z.nullable(z.url()),
75
76
  });