@visus-io/notion-sdk-ts 3.1.0 → 3.2.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 (122) hide show
  1. package/README.md +20 -88
  2. package/dist/api/asyncTasks.api.d.ts +5 -3
  3. package/dist/api/asyncTasks.api.js +5 -3
  4. package/dist/api/base.api.d.ts +15 -4
  5. package/dist/api/base.api.js +19 -8
  6. package/dist/api/blocks.api.d.ts +2 -0
  7. package/dist/api/blocks.api.js +5 -2
  8. package/dist/api/comments.api.d.ts +2 -0
  9. package/dist/api/comments.api.js +2 -0
  10. package/dist/api/customEmojis.api.d.ts +2 -0
  11. package/dist/api/customEmojis.api.js +2 -0
  12. package/dist/api/dataSources.api.d.ts +10 -3
  13. package/dist/api/dataSources.api.js +4 -1
  14. package/dist/api/databases.api.d.ts +21 -8
  15. package/dist/api/databases.api.js +8 -4
  16. package/dist/api/fileUploads.api.d.ts +7 -4
  17. package/dist/api/fileUploads.api.js +11 -7
  18. package/dist/api/pages.api.d.ts +8 -3
  19. package/dist/api/pages.api.js +5 -3
  20. package/dist/api/search.api.d.ts +4 -2
  21. package/dist/api/search.api.js +5 -2
  22. package/dist/api/users.api.d.ts +2 -0
  23. package/dist/api/users.api.js +2 -0
  24. package/dist/api/views.api.d.ts +15 -13
  25. package/dist/api/views.api.js +10 -7
  26. package/dist/client.d.ts +17 -17
  27. package/dist/client.js +22 -27
  28. package/dist/errors.d.ts +21 -4
  29. package/dist/errors.js +17 -4
  30. package/dist/helpers/block.helpers.d.ts +22 -15
  31. package/dist/helpers/block.helpers.js +14 -12
  32. package/dist/helpers/file.helpers.d.ts +12 -6
  33. package/dist/helpers/file.helpers.js +12 -6
  34. package/dist/helpers/filter.helpers.d.ts +2 -0
  35. package/dist/helpers/filter.helpers.js +2 -0
  36. package/dist/helpers/pagination.helpers.d.ts +52 -36
  37. package/dist/helpers/pagination.helpers.js +49 -29
  38. package/dist/helpers/parent.helpers.d.ts +5 -3
  39. package/dist/helpers/parent.helpers.js +5 -3
  40. package/dist/helpers/property.helpers.d.ts +2 -0
  41. package/dist/helpers/property.helpers.js +3 -1
  42. package/dist/helpers/richText.helpers.d.ts +10 -5
  43. package/dist/helpers/richText.helpers.js +11 -6
  44. package/dist/helpers/sort.helpers.d.ts +2 -0
  45. package/dist/helpers/sort.helpers.js +2 -0
  46. package/dist/helpers/webhook.helpers.d.ts +14 -12
  47. package/dist/helpers/webhook.helpers.js +17 -15
  48. package/dist/models/asyncTask.model.d.ts +8 -6
  49. package/dist/models/asyncTask.model.js +8 -6
  50. package/dist/models/base.model.d.ts +16 -4
  51. package/dist/models/base.model.js +17 -5
  52. package/dist/models/block.model.d.ts +6 -2
  53. package/dist/models/block.model.js +48 -36
  54. package/dist/models/comment.model.d.ts +4 -2
  55. package/dist/models/comment.model.js +4 -2
  56. package/dist/models/customEmoji.model.d.ts +7 -5
  57. package/dist/models/customEmoji.model.js +7 -5
  58. package/dist/models/dataSource.model.d.ts +10 -3
  59. package/dist/models/dataSource.model.js +11 -2
  60. package/dist/models/database.model.d.ts +11 -3
  61. package/dist/models/database.model.js +14 -4
  62. package/dist/models/fileUpload.model.d.ts +6 -4
  63. package/dist/models/fileUpload.model.js +6 -4
  64. package/dist/models/page.model.d.ts +6 -2
  65. package/dist/models/page.model.js +8 -4
  66. package/dist/models/richText.model.d.ts +3 -1
  67. package/dist/models/richText.model.js +3 -1
  68. package/dist/models/user.model.d.ts +9 -2
  69. package/dist/models/user.model.js +14 -2
  70. package/dist/models/view.model.d.ts +9 -7
  71. package/dist/models/view.model.js +9 -7
  72. package/dist/notion.d.ts +6 -1
  73. package/dist/notion.js +6 -1
  74. package/dist/schemas/asyncTask.schema.d.ts +11 -0
  75. package/dist/schemas/asyncTask.schema.js +5 -0
  76. package/dist/schemas/block.schema.d.ts +12 -1
  77. package/dist/schemas/block.schema.js +6 -1
  78. package/dist/schemas/codeLanguages.d.ts +7 -1
  79. package/dist/schemas/codeLanguages.js +4 -1
  80. package/dist/schemas/colors.d.ts +7 -1
  81. package/dist/schemas/colors.js +4 -1
  82. package/dist/schemas/comment.schema.d.ts +20 -2
  83. package/dist/schemas/comment.schema.js +11 -2
  84. package/dist/schemas/customEmoji.schema.d.ts +5 -0
  85. package/dist/schemas/customEmoji.schema.js +2 -0
  86. package/dist/schemas/dataSource.schema.d.ts +24 -3
  87. package/dist/schemas/dataSource.schema.js +15 -5
  88. package/dist/schemas/database.schema.d.ts +31 -1
  89. package/dist/schemas/database.schema.js +18 -2
  90. package/dist/schemas/emoji.schema.d.ts +7 -2
  91. package/dist/schemas/emoji.schema.js +4 -2
  92. package/dist/schemas/file.schema.d.ts +18 -2
  93. package/dist/schemas/file.schema.js +6 -2
  94. package/dist/schemas/fileUpload.schema.d.ts +8 -2
  95. package/dist/schemas/fileUpload.schema.js +5 -2
  96. package/dist/schemas/icon.schema.d.ts +28 -4
  97. package/dist/schemas/icon.schema.js +16 -4
  98. package/dist/schemas/meetingNotesQuery.schema.d.ts +13 -2
  99. package/dist/schemas/meetingNotesQuery.schema.js +7 -2
  100. package/dist/schemas/page.schema.d.ts +8 -0
  101. package/dist/schemas/page.schema.js +2 -0
  102. package/dist/schemas/pageMarkdown.schema.d.ts +15 -4
  103. package/dist/schemas/pageMarkdown.schema.js +9 -4
  104. package/dist/schemas/pageProperties.schema.d.ts +81 -3
  105. package/dist/schemas/pageProperties.schema.js +7 -3
  106. package/dist/schemas/pagination.schema.d.ts +33 -10
  107. package/dist/schemas/pagination.schema.js +12 -5
  108. package/dist/schemas/parent.schema.d.ts +29 -2
  109. package/dist/schemas/parent.schema.js +8 -2
  110. package/dist/schemas/propertyObjects.schema.d.ts +81 -3
  111. package/dist/schemas/propertyObjects.schema.js +11 -5
  112. package/dist/schemas/richText.schema.d.ts +15 -0
  113. package/dist/schemas/richText.schema.js +6 -3
  114. package/dist/schemas/shared.schema.d.ts +6 -3
  115. package/dist/schemas/shared.schema.js +6 -3
  116. package/dist/schemas/user.schema.d.ts +15 -0
  117. package/dist/schemas/user.schema.js +5 -2
  118. package/dist/schemas/view.schema.d.ts +46 -9
  119. package/dist/schemas/view.schema.js +28 -9
  120. package/dist/validation.d.ts +11 -4
  121. package/dist/validation.js +11 -4
  122. package/package.json +20 -16
@@ -53,12 +53,18 @@ const commentAttachmentFileSchema = z.object({
53
53
  url: z.url(),
54
54
  expiry_time: shared_schema_1.notionDateStringSchema,
55
55
  });
56
- /** Comment attachment schema. */
56
+ /** Comment attachment schema.
57
+ *
58
+ * @category Comments
59
+ */
57
60
  exports.commentAttachmentSchema = z.object({
58
61
  category: z.enum(['image', 'video', 'file', 'audio', 'pdf']),
59
62
  file: commentAttachmentFileSchema,
60
63
  });
61
- /** Comment display name schema (user or custom). */
64
+ /** Comment display name schema (user or custom).
65
+ *
66
+ * @category Comments
67
+ */
62
68
  exports.commentDisplayNameSchema = z.union([
63
69
  z.object({
64
70
  type: z.literal('user'),
@@ -69,6 +75,9 @@ exports.commentDisplayNameSchema = z.union([
69
75
  resolved_name: z.string().trim(),
70
76
  }),
71
77
  ]);
78
+ /**
79
+ * @category Comments
80
+ */
72
81
  exports.commentSchema = z.object({
73
82
  object: z.literal('comment'),
74
83
  id: z.uuid(),
@@ -4,10 +4,15 @@ import * as z from 'zod';
4
4
  *
5
5
  * Notion API reference:
6
6
  * https://developers.notion.com/reference/list-custom-emojis
7
+ *
8
+ * @category Custom Emoji & Icons
7
9
  */
8
10
  export declare const customEmojiSchema: z.ZodObject<{
9
11
  id: z.ZodUUID;
10
12
  name: z.ZodString;
11
13
  url: z.ZodURL;
12
14
  }, z.core.$strip>;
15
+ /**
16
+ * @category Custom Emoji & Icons
17
+ */
13
18
  export type NotionCustomEmoji = z.infer<typeof customEmojiSchema>;
@@ -40,6 +40,8 @@ const z = __importStar(require("zod"));
40
40
  *
41
41
  * Notion API reference:
42
42
  * https://developers.notion.com/reference/list-custom-emojis
43
+ *
44
+ * @category Custom Emoji & Icons
43
45
  */
44
46
  exports.customEmojiSchema = z.object({
45
47
  id: z.uuid(),
@@ -7,6 +7,8 @@ import * as z from 'zod';
7
7
  *
8
8
  * Notion API reference:
9
9
  * https://developers.notion.com/reference/data-source
10
+ *
11
+ * @category Databases & Data Sources
10
12
  */
11
13
  export declare const dataSourceSchema: z.ZodObject<{
12
14
  object: z.ZodLiteral<"data_source">;
@@ -820,22 +822,38 @@ export declare const dataSourceSchema: z.ZodObject<{
820
822
  public_url: z.ZodUnion<readonly [z.ZodURL, z.ZodNull]>;
821
823
  is_inline: z.ZodBoolean;
822
824
  in_trash: z.ZodBoolean;
825
+ database_type: z.ZodOptional<z.ZodEnum<{
826
+ tasks: "tasks";
827
+ projects: "projects";
828
+ skills: "skills";
829
+ }>>;
823
830
  }, z.core.$strip>;
831
+ /**
832
+ * @category Databases & Data Sources
833
+ */
824
834
  export type NotionDataSource = z.infer<typeof dataSourceSchema>;
825
835
  /**
826
- * A single data source template reference, as returned by the
827
- * List data source templates endpoint.
836
+ * A single data source template reference. The List data source templates endpoint
837
+ * returns an array of these.
828
838
  *
829
839
  * Notion API reference:
830
840
  * https://developers.notion.com/reference/list-data-source-templates
841
+ *
842
+ * @category Databases & Data Sources
831
843
  */
832
844
  export declare const dataSourceTemplateSchema: z.ZodObject<{
833
845
  id: z.ZodUUID;
834
846
  name: z.ZodString;
835
847
  is_default: z.ZodBoolean;
836
848
  }, z.core.$strip>;
849
+ /**
850
+ * @category Databases & Data Sources
851
+ */
837
852
  export type DataSourceTemplate = z.infer<typeof dataSourceTemplateSchema>;
838
- /** Response shape of the List data source templates endpoint. */
853
+ /** Response shape of the List data source templates endpoint.
854
+ *
855
+ * @category Databases & Data Sources
856
+ */
839
857
  export declare const dataSourceTemplateListSchema: z.ZodObject<{
840
858
  templates: z.ZodArray<z.ZodObject<{
841
859
  id: z.ZodUUID;
@@ -845,4 +863,7 @@ export declare const dataSourceTemplateListSchema: z.ZodObject<{
845
863
  has_more: z.ZodBoolean;
846
864
  next_cursor: z.ZodNullable<z.ZodString>;
847
865
  }, z.core.$strip>;
866
+ /**
867
+ * @category Databases & Data Sources
868
+ */
848
869
  export type DataSourceTemplateList = z.infer<typeof dataSourceTemplateListSchema>;
@@ -42,6 +42,7 @@ const richText_schema_1 = require("./richText.schema");
42
42
  const shared_schema_1 = require("./shared.schema");
43
43
  const user_schema_1 = require("./user.schema");
44
44
  const propertyObjects_schema_1 = require("./propertyObjects.schema");
45
+ const database_schema_1 = require("./database.schema");
45
46
  /**
46
47
  * Notion data source object schema.
47
48
  *
@@ -50,6 +51,8 @@ const propertyObjects_schema_1 = require("./propertyObjects.schema");
50
51
  *
51
52
  * Notion API reference:
52
53
  * https://developers.notion.com/reference/data-source
54
+ *
55
+ * @category Databases & Data Sources
53
56
  */
54
57
  exports.dataSourceSchema = z.object({
55
58
  /** Always "data_source" */
@@ -62,11 +65,11 @@ exports.dataSourceSchema = z.object({
62
65
  parent: parent_schema_1.parentSchema,
63
66
  /** Information about the database's parent (the data source's grandparent) */
64
67
  database_parent: parent_schema_1.parentSchema,
65
- /** Date and time when this data source was created (ISO 8601) */
68
+ /** Creation date and time for this data source, in ISO 8601 format */
66
69
  created_time: shared_schema_1.notionDateStringSchema,
67
70
  /** User who created the data source */
68
71
  created_by: user_schema_1.userSchema,
69
- /** Date and time when this data source was updated (ISO 8601) */
72
+ /** Last edited date and time for this data source, in ISO 8601 format */
70
73
  last_edited_time: shared_schema_1.notionDateStringSchema,
71
74
  /** User who last edited the data source */
72
75
  last_edited_by: user_schema_1.userSchema,
@@ -86,20 +89,27 @@ exports.dataSourceSchema = z.object({
86
89
  is_inline: z.boolean(),
87
90
  /** Whether the data source is in the trash */
88
91
  in_trash: z.boolean(),
92
+ /** Canonical database type this data source's parent database was built from, if any */
93
+ database_type: z.enum(database_schema_1.DATABASE_TYPES).optional(),
89
94
  });
90
95
  /**
91
- * A single data source template reference, as returned by the
92
- * List data source templates endpoint.
96
+ * A single data source template reference. The List data source templates endpoint
97
+ * returns an array of these.
93
98
  *
94
99
  * Notion API reference:
95
100
  * https://developers.notion.com/reference/list-data-source-templates
101
+ *
102
+ * @category Databases & Data Sources
96
103
  */
97
104
  exports.dataSourceTemplateSchema = z.object({
98
105
  id: z.uuid(),
99
106
  name: z.string().trim(),
100
107
  is_default: z.boolean(),
101
108
  });
102
- /** Response shape of the List data source templates endpoint. */
109
+ /** Response shape of the List data source templates endpoint.
110
+ *
111
+ * @category Databases & Data Sources
112
+ */
103
113
  exports.dataSourceTemplateListSchema = z.object({
104
114
  templates: z.array(exports.dataSourceTemplateSchema),
105
115
  has_more: z.boolean(),
@@ -8,12 +8,34 @@ import * as z from 'zod';
8
8
  * Notion API reference:
9
9
  * https://developers.notion.com/reference/database
10
10
  */
11
- /** Data source reference with id and name. */
11
+ /** Data source reference with id and name.
12
+ *
13
+ * @category Databases & Data Sources
14
+ */
12
15
  export declare const dataSourceRefSchema: z.ZodObject<{
13
16
  id: z.ZodUUID;
14
17
  name: z.ZodString;
15
18
  }, z.core.$strip>;
19
+ /**
20
+ * @category Databases & Data Sources
21
+ */
16
22
  export type DataSourceRef = z.infer<typeof dataSourceRefSchema>;
23
+ /**
24
+ * A canonical database type.
25
+ *
26
+ * Pass one of these values as `database_type` when you create a database. Notion builds the
27
+ * database from its schema for that type, not a custom schema.
28
+ *
29
+ * @category Databases & Data Sources
30
+ */
31
+ export declare const DATABASE_TYPES: readonly ["tasks", "projects", "skills"];
32
+ /**
33
+ * @category Databases & Data Sources
34
+ */
35
+ export type DatabaseType = (typeof DATABASE_TYPES)[number];
36
+ /**
37
+ * @category Databases & Data Sources
38
+ */
17
39
  export declare const databaseSchema: z.ZodObject<{
18
40
  object: z.ZodLiteral<"database">;
19
41
  id: z.ZodUUID;
@@ -527,5 +549,13 @@ export declare const databaseSchema: z.ZodObject<{
527
549
  is_inline: z.ZodBoolean;
528
550
  is_locked: z.ZodOptional<z.ZodBoolean>;
529
551
  public_url: z.ZodNullable<z.ZodURL>;
552
+ database_type: z.ZodOptional<z.ZodEnum<{
553
+ tasks: "tasks";
554
+ projects: "projects";
555
+ skills: "skills";
556
+ }>>;
530
557
  }, z.core.$strip>;
558
+ /**
559
+ * @category Databases & Data Sources
560
+ */
531
561
  export type NotionDatabase = z.infer<typeof databaseSchema>;
@@ -33,7 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
33
33
  };
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.databaseSchema = exports.dataSourceRefSchema = void 0;
36
+ exports.databaseSchema = exports.DATABASE_TYPES = exports.dataSourceRefSchema = void 0;
37
37
  const z = __importStar(require("zod"));
38
38
  const file_schema_1 = require("./file.schema");
39
39
  const icon_schema_1 = require("./icon.schema");
@@ -50,11 +50,26 @@ const user_schema_1 = require("./user.schema");
50
50
  * Notion API reference:
51
51
  * https://developers.notion.com/reference/database
52
52
  */
53
- /** Data source reference with id and name. */
53
+ /** Data source reference with id and name.
54
+ *
55
+ * @category Databases & Data Sources
56
+ */
54
57
  exports.dataSourceRefSchema = z.object({
55
58
  id: z.uuid(),
56
59
  name: z.string().trim(),
57
60
  });
61
+ /**
62
+ * A canonical database type.
63
+ *
64
+ * Pass one of these values as `database_type` when you create a database. Notion builds the
65
+ * database from its schema for that type, not a custom schema.
66
+ *
67
+ * @category Databases & Data Sources
68
+ */
69
+ exports.DATABASE_TYPES = ['tasks', 'projects', 'skills'];
70
+ /**
71
+ * @category Databases & Data Sources
72
+ */
58
73
  exports.databaseSchema = z.object({
59
74
  object: z.literal('database'),
60
75
  id: z.uuid(),
@@ -73,4 +88,5 @@ exports.databaseSchema = z.object({
73
88
  is_inline: z.boolean(),
74
89
  is_locked: z.boolean().optional(),
75
90
  public_url: z.nullable(z.url()),
91
+ database_type: z.enum(exports.DATABASE_TYPES).optional(),
76
92
  });
@@ -2,14 +2,19 @@ import * as z from 'zod';
2
2
  /**
3
3
  * Notion emoji object schema.
4
4
  *
5
- * Emojis can be used as icons for pages, databases, and other objects.
6
- * Contains the emoji character as a string.
5
+ * You can use emojis as icons for pages, databases, and other objects.
6
+ * This schema stores the emoji character as a string.
7
7
  *
8
8
  * Notion API reference:
9
9
  * https://developers.notion.com/reference/emoji-object
10
+ *
11
+ * @category Custom Emoji & Icons
10
12
  */
11
13
  export declare const emojiSchema: z.ZodObject<{
12
14
  type: z.ZodLiteral<"emoji">;
13
15
  emoji: z.ZodString;
14
16
  }, z.core.$strip>;
17
+ /**
18
+ * @category Custom Emoji & Icons
19
+ */
15
20
  export type NotionEmoji = z.infer<typeof emojiSchema>;
@@ -38,11 +38,13 @@ const z = __importStar(require("zod"));
38
38
  /**
39
39
  * Notion emoji object schema.
40
40
  *
41
- * Emojis can be used as icons for pages, databases, and other objects.
42
- * Contains the emoji character as a string.
41
+ * You can use emojis as icons for pages, databases, and other objects.
42
+ * This schema stores the emoji character as a string.
43
43
  *
44
44
  * Notion API reference:
45
45
  * https://developers.notion.com/reference/emoji-object
46
+ *
47
+ * @category Custom Emoji & Icons
46
48
  */
47
49
  exports.emojiSchema = z.object({
48
50
  type: z.literal('emoji'),
@@ -2,8 +2,9 @@ import * as z from 'zod';
2
2
  /**
3
3
  * Notion file object schemas.
4
4
  *
5
- * Files can be Notion-hosted (uploaded through the UI), API-uploaded (via file upload API),
6
- * or externally hosted (with a URL). Used for page/block icons, covers, and file attachments.
5
+ * Files can be Notion-hosted (uploaded through the UI), API-uploaded (via the file upload
6
+ * API), or externally hosted (with a URL). This schema applies to page and block icons,
7
+ * covers, and file attachments.
7
8
  *
8
9
  * Notion API reference:
9
10
  * https://developers.notion.com/reference/file-object
@@ -30,6 +31,9 @@ declare const externalFileSchema: z.ZodObject<{
30
31
  url: z.ZodURL;
31
32
  }, z.core.$strip>;
32
33
  }, z.core.$strip>;
34
+ /**
35
+ * @category File Uploads
36
+ */
33
37
  export declare const fileSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
34
38
  type: z.ZodLiteral<"file">;
35
39
  file: z.ZodObject<{
@@ -47,8 +51,20 @@ export declare const fileSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
47
51
  url: z.ZodURL;
48
52
  }, z.core.$strip>;
49
53
  }, z.core.$strip>], "type">;
54
+ /**
55
+ * @category File Uploads
56
+ */
50
57
  export type NotionFile = z.infer<typeof fileSchema>;
58
+ /**
59
+ * @category File Uploads
60
+ */
51
61
  export type NotionHostedFile = z.infer<typeof notionFileSchema>;
62
+ /**
63
+ * @category File Uploads
64
+ */
52
65
  export type UploadedFile = z.infer<typeof fileUploadSchema>;
66
+ /**
67
+ * @category File Uploads
68
+ */
53
69
  export type ExternalFile = z.infer<typeof externalFileSchema>;
54
70
  export {};
@@ -39,8 +39,9 @@ const shared_schema_1 = require("./shared.schema");
39
39
  /**
40
40
  * Notion file object schemas.
41
41
  *
42
- * Files can be Notion-hosted (uploaded through the UI), API-uploaded (via file upload API),
43
- * or externally hosted (with a URL). Used for page/block icons, covers, and file attachments.
42
+ * Files can be Notion-hosted (uploaded through the UI), API-uploaded (via the file upload
43
+ * API), or externally hosted (with a URL). This schema applies to page and block icons,
44
+ * covers, and file attachments.
44
45
  *
45
46
  * Notion API reference:
46
47
  * https://developers.notion.com/reference/file-object
@@ -67,6 +68,9 @@ const externalFileSchema = z.object({
67
68
  url: z.url(),
68
69
  }),
69
70
  });
71
+ /**
72
+ * @category File Uploads
73
+ */
70
74
  exports.fileSchema = z.discriminatedUnion('type', [
71
75
  notionFileSchema,
72
76
  fileUploadSchema,
@@ -2,11 +2,14 @@ import * as z from 'zod';
2
2
  /**
3
3
  * Notion file upload object schema.
4
4
  *
5
- * File uploads represent files uploaded to Notion via the API. They have a temporary
6
- * upload URL and can be in various states (pending, uploaded, expired, failed).
5
+ * File uploads represent files uploaded to Notion through the API. Each file upload has
6
+ * a temporary upload URL. Each file upload has one of these states: pending, uploaded,
7
+ * expired, or failed.
7
8
  *
8
9
  * Notion API reference:
9
10
  * https://developers.notion.com/reference/file-upload-object
11
+ *
12
+ * @category File Uploads
10
13
  */
11
14
  export declare const fileUploadSchema: z.ZodObject<{
12
15
  object: z.ZodLiteral<"file_upload">;
@@ -26,4 +29,7 @@ export declare const fileUploadSchema: z.ZodObject<{
26
29
  complete_url: z.ZodString;
27
30
  file_import_result: z.ZodString;
28
31
  }, z.core.$strip>;
32
+ /**
33
+ * @category File Uploads
34
+ */
29
35
  export type NotionFileUpload = z.infer<typeof fileUploadSchema>;
@@ -39,11 +39,14 @@ const shared_schema_1 = require("./shared.schema");
39
39
  /**
40
40
  * Notion file upload object schema.
41
41
  *
42
- * File uploads represent files uploaded to Notion via the API. They have a temporary
43
- * upload URL and can be in various states (pending, uploaded, expired, failed).
42
+ * File uploads represent files uploaded to Notion through the API. Each file upload has
43
+ * a temporary upload URL. Each file upload has one of these states: pending, uploaded,
44
+ * expired, or failed.
44
45
  *
45
46
  * Notion API reference:
46
47
  * https://developers.notion.com/reference/file-upload-object
48
+ *
49
+ * @category File Uploads
47
50
  */
48
51
  exports.fileUploadSchema = z.object({
49
52
  object: z.literal('file_upload'),
@@ -11,10 +11,19 @@ import * as z from 'zod';
11
11
  * Notion API reference:
12
12
  * https://developers.notion.com/reference/emoji-object
13
13
  */
14
- /** Colors available for native (icon-picker) icons. */
14
+ /** Colors available for native (icon-picker) icons.
15
+ *
16
+ * @category Custom Emoji & Icons
17
+ */
15
18
  export declare const NATIVE_ICON_COLORS: readonly ["gray", "lightgray", "brown", "yellow", "orange", "green", "blue", "purple", "pink", "red"];
19
+ /**
20
+ * @category Custom Emoji & Icons
21
+ */
16
22
  export type NativeIconColor = (typeof NATIVE_ICON_COLORS)[number];
17
- /** Native (icon-picker) icon. */
23
+ /** Native (icon-picker) icon.
24
+ *
25
+ * @category Custom Emoji & Icons
26
+ */
18
27
  export declare const nativeIconSchema: z.ZodObject<{
19
28
  type: z.ZodLiteral<"icon">;
20
29
  icon: z.ZodObject<{
@@ -33,8 +42,14 @@ export declare const nativeIconSchema: z.ZodObject<{
33
42
  }>>;
34
43
  }, z.core.$strip>;
35
44
  }, z.core.$strip>;
45
+ /**
46
+ * @category Custom Emoji & Icons
47
+ */
36
48
  export type NativeIcon = z.infer<typeof nativeIconSchema>;
37
- /** Custom emoji icon. */
49
+ /** Custom emoji icon.
50
+ *
51
+ * @category Custom Emoji & Icons
52
+ */
38
53
  export declare const customEmojiIconSchema: z.ZodObject<{
39
54
  type: z.ZodLiteral<"custom_emoji">;
40
55
  custom_emoji: z.ZodObject<{
@@ -43,8 +58,14 @@ export declare const customEmojiIconSchema: z.ZodObject<{
43
58
  url: z.ZodOptional<z.ZodURL>;
44
59
  }, z.core.$strip>;
45
60
  }, z.core.$strip>;
61
+ /**
62
+ * @category Custom Emoji & Icons
63
+ */
46
64
  export type CustomEmojiIcon = z.infer<typeof customEmojiIconSchema>;
47
- /** Shared icon schema covering all icon object variants. */
65
+ /** Shared icon schema covering all icon object variants.
66
+ *
67
+ * @category Custom Emoji & Icons
68
+ */
48
69
  export declare const iconSchema: z.ZodUnion<readonly [z.ZodDiscriminatedUnion<[z.ZodObject<{
49
70
  type: z.ZodLiteral<"file">;
50
71
  file: z.ZodObject<{
@@ -89,4 +110,7 @@ export declare const iconSchema: z.ZodUnion<readonly [z.ZodDiscriminatedUnion<[z
89
110
  url: z.ZodOptional<z.ZodURL>;
90
111
  }, z.core.$strip>;
91
112
  }, z.core.$strip>]>;
113
+ /**
114
+ * @category Custom Emoji & Icons
115
+ */
92
116
  export type NotionIcon = z.infer<typeof iconSchema>;
@@ -49,7 +49,10 @@ const file_schema_1 = require("./file.schema");
49
49
  * Notion API reference:
50
50
  * https://developers.notion.com/reference/emoji-object
51
51
  */
52
- /** Colors available for native (icon-picker) icons. */
52
+ /** Colors available for native (icon-picker) icons.
53
+ *
54
+ * @category Custom Emoji & Icons
55
+ */
53
56
  exports.NATIVE_ICON_COLORS = [
54
57
  'gray',
55
58
  'lightgray',
@@ -62,7 +65,10 @@ exports.NATIVE_ICON_COLORS = [
62
65
  'pink',
63
66
  'red',
64
67
  ];
65
- /** Native (icon-picker) icon. */
68
+ /** Native (icon-picker) icon.
69
+ *
70
+ * @category Custom Emoji & Icons
71
+ */
66
72
  exports.nativeIconSchema = z.object({
67
73
  type: z.literal('icon'),
68
74
  icon: z.object({
@@ -70,7 +76,10 @@ exports.nativeIconSchema = z.object({
70
76
  color: z.enum(exports.NATIVE_ICON_COLORS).optional(),
71
77
  }),
72
78
  });
73
- /** Custom emoji icon. */
79
+ /** Custom emoji icon.
80
+ *
81
+ * @category Custom Emoji & Icons
82
+ */
74
83
  exports.customEmojiIconSchema = z.object({
75
84
  type: z.literal('custom_emoji'),
76
85
  custom_emoji: z.object({
@@ -79,7 +88,10 @@ exports.customEmojiIconSchema = z.object({
79
88
  url: z.url().optional(),
80
89
  }),
81
90
  });
82
- /** Shared icon schema covering all icon object variants. */
91
+ /** Shared icon schema covering all icon object variants.
92
+ *
93
+ * @category Custom Emoji & Icons
94
+ */
83
95
  exports.iconSchema = z.union([
84
96
  file_schema_1.fileSchema,
85
97
  emoji_schema_1.emojiSchema,
@@ -4,12 +4,20 @@ import * as z from 'zod';
4
4
  *
5
5
  * Notion API reference:
6
6
  * https://developers.notion.com/reference/query-meeting-notes
7
+ *
8
+ * @category Pages
7
9
  */
8
10
  export declare const MEETING_NOTES_QUERY_PROPERTIES: readonly ["title", "attendees", "created_time", "created_by", "last_edited_time", "last_edited_by"];
11
+ /**
12
+ * @category Pages
13
+ */
9
14
  export type MeetingNotesQueryProperty = (typeof MEETING_NOTES_QUERY_PROPERTIES)[number];
10
15
  /**
11
- * Response shape is genuinely non-standard: no `object` field, no `next_cursor` at
12
- * all -- pagination is controlled purely by `limit` (max 50 per request, no cursor).
16
+ * This response shape is non-standard. It has no `object` field and no `next_cursor`
17
+ * field. The `limit` parameter alone controls pagination, up to 50 results per request,
18
+ * with no cursor.
19
+ *
20
+ * @category Pages
13
21
  */
14
22
  export declare const meetingNotesQueryResponseSchema: z.ZodObject<{
15
23
  results: z.ZodArray<z.ZodObject<{
@@ -4184,4 +4192,7 @@ export declare const meetingNotesQueryResponseSchema: z.ZodObject<{
4184
4192
  }>;
4185
4193
  }, z.core.$strip>>;
4186
4194
  }, z.core.$strip>;
4195
+ /**
4196
+ * @category Pages
4197
+ */
4187
4198
  export type MeetingNotesQueryResponse = z.infer<typeof meetingNotesQueryResponseSchema>;
@@ -42,6 +42,8 @@ const pagination_schema_1 = require("./pagination.schema");
42
42
  *
43
43
  * Notion API reference:
44
44
  * https://developers.notion.com/reference/query-meeting-notes
45
+ *
46
+ * @category Pages
45
47
  */
46
48
  exports.MEETING_NOTES_QUERY_PROPERTIES = [
47
49
  'title',
@@ -52,8 +54,11 @@ exports.MEETING_NOTES_QUERY_PROPERTIES = [
52
54
  'last_edited_by',
53
55
  ];
54
56
  /**
55
- * Response shape is genuinely non-standard: no `object` field, no `next_cursor` at
56
- * all -- pagination is controlled purely by `limit` (max 50 per request, no cursor).
57
+ * This response shape is non-standard. It has no `object` field and no `next_cursor`
58
+ * field. The `limit` parameter alone controls pagination, up to 50 results per request,
59
+ * with no cursor.
60
+ *
61
+ * @category Pages
57
62
  */
58
63
  exports.meetingNotesQueryResponseSchema = z.object({
59
64
  results: z.array(block_schema_1.blockSchema),
@@ -7,6 +7,8 @@ import * as z from 'zod';
7
7
  *
8
8
  * Notion API reference:
9
9
  * https://developers.notion.com/reference/page
10
+ *
11
+ * @category Pages
10
12
  */
11
13
  export declare const pageSchema: z.ZodObject<{
12
14
  object: z.ZodLiteral<"page">;
@@ -239,6 +241,9 @@ export declare const pageSchema: z.ZodObject<{
239
241
  }, z.core.$strip>, z.ZodObject<{
240
242
  type: z.ZodLiteral<"string">;
241
243
  string: z.ZodNullable<z.ZodString>;
244
+ }, z.core.$strip>, z.ZodObject<{
245
+ type: z.ZodLiteral<"unsupported">;
246
+ unsupported: z.ZodObject<{}, z.core.$strip>;
242
247
  }, z.core.$strip>], "type">;
243
248
  }, z.core.$strip>, z.ZodObject<{
244
249
  id: z.ZodString;
@@ -900,4 +905,7 @@ export declare const pageSchema: z.ZodObject<{
900
905
  url: z.ZodURL;
901
906
  public_url: z.ZodNullable<z.ZodURL>;
902
907
  }, z.core.$strip>;
908
+ /**
909
+ * @category Pages
910
+ */
903
911
  export type NotionPage = z.infer<typeof pageSchema>;
@@ -49,6 +49,8 @@ const user_schema_1 = require("./user.schema");
49
49
  *
50
50
  * Notion API reference:
51
51
  * https://developers.notion.com/reference/page
52
+ *
53
+ * @category Pages
52
54
  */
53
55
  exports.pageSchema = z.object({
54
56
  object: z.literal('page'),
@@ -7,6 +7,8 @@ import * as z from 'zod';
7
7
  *
8
8
  * Notion API reference:
9
9
  * https://developers.notion.com/guides/data-apis/working-with-markdown-content
10
+ *
11
+ * @category Pages
10
12
  */
11
13
  export declare const pageMarkdownSchema: z.ZodObject<{
12
14
  object: z.ZodLiteral<"page_markdown">;
@@ -15,12 +17,18 @@ export declare const pageMarkdownSchema: z.ZodObject<{
15
17
  truncated: z.ZodBoolean;
16
18
  unknown_block_ids: z.ZodArray<z.ZodUUID>;
17
19
  }, z.core.$strip>;
20
+ /**
21
+ * @category Pages
22
+ */
18
23
  export type PageMarkdown = z.infer<typeof pageMarkdownSchema>;
19
24
  /**
20
- * `PATCH /v1/pages/{page_id}/markdown` returns `pageMarkdownSchema` synchronously, or
21
- * (when `allow_async: true` triggers async processing) an `async_task` handle to poll
22
- * via {@link AsyncTasksAPI}. Both response bodies carry a literal `object` field, so
23
- * they discriminate cleanly without needing the HTTP status code.
25
+ * `PATCH /v1/pages/{page_id}/markdown` returns `pageMarkdownSchema` synchronously. If
26
+ * `allow_async: true` triggers async processing, it returns an `async_task` handle
27
+ * instead. Poll the handle through {@link AsyncTasksAPI}. Both response bodies carry a
28
+ * literal `object` field, so you can discriminate between them without checking the
29
+ * HTTP status code.
30
+ *
31
+ * @category Pages
24
32
  */
25
33
  export declare const markdownContentResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
26
34
  object: z.ZodLiteral<"page_markdown">;
@@ -56,4 +64,7 @@ export declare const markdownContentResponseSchema: z.ZodDiscriminatedUnion<[z.Z
56
64
  message: z.ZodString;
57
65
  }, z.core.$strip>>;
58
66
  }, z.core.$strip>], "object">;
67
+ /**
68
+ * @category Pages
69
+ */
59
70
  export type MarkdownContentResponse = z.infer<typeof markdownContentResponseSchema>;