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

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 (130) hide show
  1. package/README.md +20 -87
  2. package/dist/api/asyncTasks.api.d.ts +72 -0
  3. package/dist/api/asyncTasks.api.js +70 -0
  4. package/dist/api/base.api.d.ts +15 -4
  5. package/dist/api/base.api.js +20 -8
  6. package/dist/api/blocks.api.d.ts +435 -73
  7. package/dist/api/blocks.api.js +43 -1
  8. package/dist/api/comments.api.d.ts +42 -5
  9. package/dist/api/comments.api.js +45 -1
  10. package/dist/api/customEmojis.api.d.ts +38 -0
  11. package/dist/api/customEmojis.api.js +38 -0
  12. package/dist/api/dataSources.api.d.ts +67 -14
  13. package/dist/api/dataSources.api.js +26 -1
  14. package/dist/api/databases.api.d.ts +47 -11
  15. package/dist/api/databases.api.js +4 -1
  16. package/dist/api/fileUploads.api.d.ts +8 -5
  17. package/dist/api/fileUploads.api.js +11 -7
  18. package/dist/api/index.d.ts +3 -0
  19. package/dist/api/index.js +7 -1
  20. package/dist/api/pages.api.d.ts +144 -10
  21. package/dist/api/pages.api.js +66 -0
  22. package/dist/api/search.api.d.ts +12 -2
  23. package/dist/api/search.api.js +5 -2
  24. package/dist/api/users.api.d.ts +3 -0
  25. package/dist/api/users.api.js +2 -0
  26. package/dist/api/views.api.d.ts +286 -0
  27. package/dist/api/views.api.js +172 -0
  28. package/dist/client.d.ts +17 -17
  29. package/dist/client.js +25 -30
  30. package/dist/errors.d.ts +19 -5
  31. package/dist/errors.js +16 -4
  32. package/dist/helpers/block.helpers.d.ts +49 -5
  33. package/dist/helpers/block.helpers.js +50 -6
  34. package/dist/helpers/file.helpers.d.ts +46 -5
  35. package/dist/helpers/file.helpers.js +36 -8
  36. package/dist/helpers/filter.helpers.d.ts +8 -6
  37. package/dist/helpers/filter.helpers.js +2 -0
  38. package/dist/helpers/index.d.ts +3 -2
  39. package/dist/helpers/index.js +5 -1
  40. package/dist/helpers/pagination.helpers.d.ts +85 -13
  41. package/dist/helpers/pagination.helpers.js +114 -8
  42. package/dist/helpers/parent.helpers.d.ts +5 -3
  43. package/dist/helpers/parent.helpers.js +5 -3
  44. package/dist/helpers/property.helpers.d.ts +31 -0
  45. package/dist/helpers/property.helpers.js +30 -1
  46. package/dist/helpers/richText.helpers.d.ts +10 -5
  47. package/dist/helpers/richText.helpers.js +11 -6
  48. package/dist/helpers/sort.helpers.d.ts +2 -0
  49. package/dist/helpers/sort.helpers.js +2 -0
  50. package/dist/helpers/webhook.helpers.d.ts +54 -0
  51. package/dist/helpers/webhook.helpers.js +83 -0
  52. package/dist/models/asyncTask.model.d.ts +61 -0
  53. package/dist/models/asyncTask.model.js +91 -0
  54. package/dist/models/base.model.d.ts +16 -4
  55. package/dist/models/base.model.js +17 -5
  56. package/dist/models/block.model.d.ts +6 -2
  57. package/dist/models/block.model.js +48 -33
  58. package/dist/models/comment.model.d.ts +4 -2
  59. package/dist/models/comment.model.js +4 -2
  60. package/dist/models/customEmoji.model.d.ts +30 -0
  61. package/dist/models/customEmoji.model.js +44 -0
  62. package/dist/models/dataSource.model.d.ts +7 -5
  63. package/dist/models/dataSource.model.js +5 -3
  64. package/dist/models/database.model.d.ts +13 -5
  65. package/dist/models/database.model.js +15 -5
  66. package/dist/models/fileUpload.model.d.ts +6 -4
  67. package/dist/models/fileUpload.model.js +6 -4
  68. package/dist/models/index.d.ts +3 -0
  69. package/dist/models/index.js +7 -1
  70. package/dist/models/page.model.d.ts +8 -2
  71. package/dist/models/page.model.js +14 -4
  72. package/dist/models/richText.model.d.ts +3 -1
  73. package/dist/models/richText.model.js +3 -1
  74. package/dist/models/user.model.d.ts +4 -2
  75. package/dist/models/user.model.js +4 -2
  76. package/dist/models/view.model.d.ts +81 -0
  77. package/dist/models/view.model.js +121 -0
  78. package/dist/notion.d.ts +32 -8
  79. package/dist/notion.js +25 -4
  80. package/dist/schemas/asyncTask.schema.d.ts +53 -0
  81. package/dist/schemas/asyncTask.schema.js +88 -0
  82. package/dist/schemas/block.schema.d.ts +390 -73
  83. package/dist/schemas/block.schema.js +39 -8
  84. package/dist/schemas/codeLanguages.d.ts +7 -1
  85. package/dist/schemas/codeLanguages.js +4 -1
  86. package/dist/schemas/colors.d.ts +7 -1
  87. package/dist/schemas/colors.js +4 -1
  88. package/dist/schemas/comment.schema.d.ts +28 -5
  89. package/dist/schemas/comment.schema.js +11 -2
  90. package/dist/schemas/customEmoji.schema.d.ts +18 -0
  91. package/dist/schemas/customEmoji.schema.js +50 -0
  92. package/dist/schemas/dataSource.schema.d.ts +84 -10
  93. package/dist/schemas/dataSource.schema.js +31 -6
  94. package/dist/schemas/database.schema.d.ts +51 -7
  95. package/dist/schemas/database.schema.js +10 -3
  96. package/dist/schemas/emoji.schema.d.ts +7 -2
  97. package/dist/schemas/emoji.schema.js +4 -2
  98. package/dist/schemas/file.schema.d.ts +18 -2
  99. package/dist/schemas/file.schema.js +6 -2
  100. package/dist/schemas/fileUpload.schema.d.ts +9 -3
  101. package/dist/schemas/fileUpload.schema.js +5 -2
  102. package/dist/schemas/icon.schema.d.ts +116 -0
  103. package/dist/schemas/icon.schema.js +100 -0
  104. package/dist/schemas/index.d.ts +6 -0
  105. package/dist/schemas/index.js +6 -0
  106. package/dist/schemas/meetingNotesQuery.schema.d.ts +4198 -0
  107. package/dist/schemas/meetingNotesQuery.schema.js +67 -0
  108. package/dist/schemas/page.schema.d.ts +51 -9
  109. package/dist/schemas/page.schema.js +6 -2
  110. package/dist/schemas/pageMarkdown.schema.d.ts +70 -0
  111. package/dist/schemas/pageMarkdown.schema.js +70 -0
  112. package/dist/schemas/pageProperties.schema.d.ts +105 -21
  113. package/dist/schemas/pageProperties.schema.js +8 -6
  114. package/dist/schemas/pagination.schema.d.ts +57 -7
  115. package/dist/schemas/pagination.schema.js +25 -1
  116. package/dist/schemas/parent.schema.d.ts +39 -3
  117. package/dist/schemas/parent.schema.js +17 -5
  118. package/dist/schemas/propertyObjects.schema.d.ts +93 -15
  119. package/dist/schemas/propertyObjects.schema.js +11 -5
  120. package/dist/schemas/richText.schema.d.ts +23 -6
  121. package/dist/schemas/richText.schema.js +7 -4
  122. package/dist/schemas/shared.schema.d.ts +6 -3
  123. package/dist/schemas/shared.schema.js +6 -3
  124. package/dist/schemas/user.schema.d.ts +17 -0
  125. package/dist/schemas/user.schema.js +7 -3
  126. package/dist/schemas/view.schema.d.ts +1111 -0
  127. package/dist/schemas/view.schema.js +134 -0
  128. package/dist/validation.d.ts +11 -4
  129. package/dist/validation.js +11 -4
  130. package/package.json +6 -3
@@ -2,9 +2,9 @@ import * as z from 'zod';
2
2
  /**
3
3
  * Page property value schemas.
4
4
  *
5
- * These define the actual data values stored in page properties (database columns).
6
- * Different from property objects which define the schema/configuration.
7
- * Supports 23 property types including title, rich text, number, select, etc.
5
+ * These schemas define the data values in page properties (database columns).
6
+ * Property objects define the schema and configuration instead.
7
+ * This file supports 22 property types, including title, rich text, number, and select.
8
8
  *
9
9
  * Notion API reference:
10
10
  * https://developers.notion.com/reference/page-property-values
@@ -27,6 +27,7 @@ declare const createdByPropertySchema: z.ZodObject<{
27
27
  avatar_url: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodNull]>>;
28
28
  person: z.ZodObject<{
29
29
  email: z.ZodEmail;
30
+ email_verified: z.ZodOptional<z.ZodBoolean>;
30
31
  }, z.core.$strip>;
31
32
  }, z.core.$strip>, z.ZodObject<{
32
33
  object: z.ZodLiteral<"user">;
@@ -131,6 +132,7 @@ declare const lastEditedByPropertySchema: z.ZodObject<{
131
132
  avatar_url: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodNull]>>;
132
133
  person: z.ZodObject<{
133
134
  email: z.ZodEmail;
135
+ email_verified: z.ZodOptional<z.ZodBoolean>;
134
136
  }, z.core.$strip>;
135
137
  }, z.core.$strip>, z.ZodObject<{
136
138
  object: z.ZodLiteral<"user">;
@@ -170,11 +172,11 @@ declare const multiSelectPropertySchema: z.ZodObject<{
170
172
  id: z.ZodString;
171
173
  name: z.ZodString;
172
174
  color: z.ZodEnum<{
175
+ default: "default";
173
176
  blue: "blue";
174
177
  blue_background: "blue_background";
175
178
  brown: "brown";
176
179
  brown_background: "brown_background";
177
- default: "default";
178
180
  gray: "gray";
179
181
  gray_background: "gray_background";
180
182
  green: "green";
@@ -210,6 +212,7 @@ declare const peoplePropertySchema: z.ZodObject<{
210
212
  avatar_url: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodNull]>>;
211
213
  person: z.ZodObject<{
212
214
  email: z.ZodEmail;
215
+ email_verified: z.ZodOptional<z.ZodBoolean>;
213
216
  }, z.core.$strip>;
214
217
  }, z.core.$strip>, z.ZodObject<{
215
218
  object: z.ZodLiteral<"user">;
@@ -269,11 +272,11 @@ declare const richTextPropertySchema: z.ZodObject<{
269
272
  underline: z.ZodBoolean;
270
273
  code: z.ZodBoolean;
271
274
  color: z.ZodEnum<{
275
+ default: "default";
272
276
  blue: "blue";
273
277
  blue_background: "blue_background";
274
278
  brown: "brown";
275
279
  brown_background: "brown_background";
276
- default: "default";
277
280
  gray: "gray";
278
281
  gray_background: "gray_background";
279
282
  green: "green";
@@ -338,6 +341,7 @@ declare const richTextPropertySchema: z.ZodObject<{
338
341
  avatar_url: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodNull]>>;
339
342
  person: z.ZodObject<{
340
343
  email: z.ZodEmail;
344
+ email_verified: z.ZodOptional<z.ZodBoolean>;
341
345
  }, z.core.$strip>;
342
346
  }, z.core.$strip>, z.ZodObject<{
343
347
  object: z.ZodLiteral<"user">;
@@ -370,11 +374,11 @@ declare const richTextPropertySchema: z.ZodObject<{
370
374
  underline: z.ZodBoolean;
371
375
  code: z.ZodBoolean;
372
376
  color: z.ZodEnum<{
377
+ default: "default";
373
378
  blue: "blue";
374
379
  blue_background: "blue_background";
375
380
  brown: "brown";
376
381
  brown_background: "brown_background";
377
- default: "default";
378
382
  gray: "gray";
379
383
  gray_background: "gray_background";
380
384
  green: "green";
@@ -405,11 +409,11 @@ declare const richTextPropertySchema: z.ZodObject<{
405
409
  underline: z.ZodBoolean;
406
410
  code: z.ZodBoolean;
407
411
  color: z.ZodEnum<{
412
+ default: "default";
408
413
  blue: "blue";
409
414
  blue_background: "blue_background";
410
415
  brown: "brown";
411
416
  brown_background: "brown_background";
412
- default: "default";
413
417
  gray: "gray";
414
418
  gray_background: "gray_background";
415
419
  green: "green";
@@ -485,11 +489,11 @@ declare const selectPropertySchema: z.ZodObject<{
485
489
  id: z.ZodString;
486
490
  name: z.ZodString;
487
491
  color: z.ZodEnum<{
492
+ default: "default";
488
493
  blue: "blue";
489
494
  blue_background: "blue_background";
490
495
  brown: "brown";
491
496
  brown_background: "brown_background";
492
- default: "default";
493
497
  gray: "gray";
494
498
  gray_background: "gray_background";
495
499
  green: "green";
@@ -515,11 +519,11 @@ declare const statusPropertySchema: z.ZodObject<{
515
519
  id: z.ZodString;
516
520
  name: z.ZodString;
517
521
  color: z.ZodEnum<{
522
+ default: "default";
518
523
  blue: "blue";
519
524
  blue_background: "blue_background";
520
525
  brown: "brown";
521
526
  brown_background: "brown_background";
522
- default: "default";
523
527
  gray: "gray";
524
528
  gray_background: "gray_background";
525
529
  green: "green";
@@ -556,11 +560,11 @@ declare const titlePropertySchema: z.ZodObject<{
556
560
  underline: z.ZodBoolean;
557
561
  code: z.ZodBoolean;
558
562
  color: z.ZodEnum<{
563
+ default: "default";
559
564
  blue: "blue";
560
565
  blue_background: "blue_background";
561
566
  brown: "brown";
562
567
  brown_background: "brown_background";
563
- default: "default";
564
568
  gray: "gray";
565
569
  gray_background: "gray_background";
566
570
  green: "green";
@@ -625,6 +629,7 @@ declare const titlePropertySchema: z.ZodObject<{
625
629
  avatar_url: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodNull]>>;
626
630
  person: z.ZodObject<{
627
631
  email: z.ZodEmail;
632
+ email_verified: z.ZodOptional<z.ZodBoolean>;
628
633
  }, z.core.$strip>;
629
634
  }, z.core.$strip>, z.ZodObject<{
630
635
  object: z.ZodLiteral<"user">;
@@ -657,11 +662,11 @@ declare const titlePropertySchema: z.ZodObject<{
657
662
  underline: z.ZodBoolean;
658
663
  code: z.ZodBoolean;
659
664
  color: z.ZodEnum<{
665
+ default: "default";
660
666
  blue: "blue";
661
667
  blue_background: "blue_background";
662
668
  brown: "brown";
663
669
  brown_background: "brown_background";
664
- default: "default";
665
670
  gray: "gray";
666
671
  gray_background: "gray_background";
667
672
  green: "green";
@@ -692,11 +697,11 @@ declare const titlePropertySchema: z.ZodObject<{
692
697
  underline: z.ZodBoolean;
693
698
  code: z.ZodBoolean;
694
699
  color: z.ZodEnum<{
700
+ default: "default";
695
701
  blue: "blue";
696
702
  blue_background: "blue_background";
697
703
  brown: "brown";
698
704
  brown_background: "brown_background";
699
- default: "default";
700
705
  gray: "gray";
701
706
  gray_background: "gray_background";
702
707
  green: "green";
@@ -749,6 +754,7 @@ declare const verificationPropertySchema: z.ZodObject<{
749
754
  avatar_url: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodNull]>>;
750
755
  person: z.ZodObject<{
751
756
  email: z.ZodEmail;
757
+ email_verified: z.ZodOptional<z.ZodBoolean>;
752
758
  }, z.core.$strip>;
753
759
  }, z.core.$strip>, z.ZodObject<{
754
760
  object: z.ZodLiteral<"user">;
@@ -780,6 +786,9 @@ declare const verificationPropertySchema: z.ZodObject<{
780
786
  }, z.core.$strip>>;
781
787
  }, z.core.$strip>>;
782
788
  }, z.core.$strip>;
789
+ /**
790
+ * @category Page Properties
791
+ */
783
792
  export declare const pagePropertiesSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
784
793
  id: z.ZodString;
785
794
  type: z.ZodLiteral<"checkbox">;
@@ -795,6 +804,7 @@ export declare const pagePropertiesSchema: z.ZodDiscriminatedUnion<[z.ZodObject<
795
804
  avatar_url: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodNull]>>;
796
805
  person: z.ZodObject<{
797
806
  email: z.ZodEmail;
807
+ email_verified: z.ZodOptional<z.ZodBoolean>;
798
808
  }, z.core.$strip>;
799
809
  }, z.core.$strip>, z.ZodObject<{
800
810
  object: z.ZodLiteral<"user">;
@@ -887,6 +897,7 @@ export declare const pagePropertiesSchema: z.ZodDiscriminatedUnion<[z.ZodObject<
887
897
  avatar_url: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodNull]>>;
888
898
  person: z.ZodObject<{
889
899
  email: z.ZodEmail;
900
+ email_verified: z.ZodOptional<z.ZodBoolean>;
890
901
  }, z.core.$strip>;
891
902
  }, z.core.$strip>, z.ZodObject<{
892
903
  object: z.ZodLiteral<"user">;
@@ -922,11 +933,11 @@ export declare const pagePropertiesSchema: z.ZodDiscriminatedUnion<[z.ZodObject<
922
933
  id: z.ZodString;
923
934
  name: z.ZodString;
924
935
  color: z.ZodEnum<{
936
+ default: "default";
925
937
  blue: "blue";
926
938
  blue_background: "blue_background";
927
939
  brown: "brown";
928
940
  brown_background: "brown_background";
929
- default: "default";
930
941
  gray: "gray";
931
942
  gray_background: "gray_background";
932
943
  green: "green";
@@ -958,6 +969,7 @@ export declare const pagePropertiesSchema: z.ZodDiscriminatedUnion<[z.ZodObject<
958
969
  avatar_url: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodNull]>>;
959
970
  person: z.ZodObject<{
960
971
  email: z.ZodEmail;
972
+ email_verified: z.ZodOptional<z.ZodBoolean>;
961
973
  }, z.core.$strip>;
962
974
  }, z.core.$strip>, z.ZodObject<{
963
975
  object: z.ZodLiteral<"user">;
@@ -1011,11 +1023,11 @@ export declare const pagePropertiesSchema: z.ZodDiscriminatedUnion<[z.ZodObject<
1011
1023
  underline: z.ZodBoolean;
1012
1024
  code: z.ZodBoolean;
1013
1025
  color: z.ZodEnum<{
1026
+ default: "default";
1014
1027
  blue: "blue";
1015
1028
  blue_background: "blue_background";
1016
1029
  brown: "brown";
1017
1030
  brown_background: "brown_background";
1018
- default: "default";
1019
1031
  gray: "gray";
1020
1032
  gray_background: "gray_background";
1021
1033
  green: "green";
@@ -1080,6 +1092,7 @@ export declare const pagePropertiesSchema: z.ZodDiscriminatedUnion<[z.ZodObject<
1080
1092
  avatar_url: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodNull]>>;
1081
1093
  person: z.ZodObject<{
1082
1094
  email: z.ZodEmail;
1095
+ email_verified: z.ZodOptional<z.ZodBoolean>;
1083
1096
  }, z.core.$strip>;
1084
1097
  }, z.core.$strip>, z.ZodObject<{
1085
1098
  object: z.ZodLiteral<"user">;
@@ -1112,11 +1125,11 @@ export declare const pagePropertiesSchema: z.ZodDiscriminatedUnion<[z.ZodObject<
1112
1125
  underline: z.ZodBoolean;
1113
1126
  code: z.ZodBoolean;
1114
1127
  color: z.ZodEnum<{
1128
+ default: "default";
1115
1129
  blue: "blue";
1116
1130
  blue_background: "blue_background";
1117
1131
  brown: "brown";
1118
1132
  brown_background: "brown_background";
1119
- default: "default";
1120
1133
  gray: "gray";
1121
1134
  gray_background: "gray_background";
1122
1135
  green: "green";
@@ -1147,11 +1160,11 @@ export declare const pagePropertiesSchema: z.ZodDiscriminatedUnion<[z.ZodObject<
1147
1160
  underline: z.ZodBoolean;
1148
1161
  code: z.ZodBoolean;
1149
1162
  color: z.ZodEnum<{
1163
+ default: "default";
1150
1164
  blue: "blue";
1151
1165
  blue_background: "blue_background";
1152
1166
  brown: "brown";
1153
1167
  brown_background: "brown_background";
1154
- default: "default";
1155
1168
  gray: "gray";
1156
1169
  gray_background: "gray_background";
1157
1170
  green: "green";
@@ -1223,11 +1236,11 @@ export declare const pagePropertiesSchema: z.ZodDiscriminatedUnion<[z.ZodObject<
1223
1236
  id: z.ZodString;
1224
1237
  name: z.ZodString;
1225
1238
  color: z.ZodEnum<{
1239
+ default: "default";
1226
1240
  blue: "blue";
1227
1241
  blue_background: "blue_background";
1228
1242
  brown: "brown";
1229
1243
  brown_background: "brown_background";
1230
- default: "default";
1231
1244
  gray: "gray";
1232
1245
  gray_background: "gray_background";
1233
1246
  green: "green";
@@ -1251,11 +1264,11 @@ export declare const pagePropertiesSchema: z.ZodDiscriminatedUnion<[z.ZodObject<
1251
1264
  id: z.ZodString;
1252
1265
  name: z.ZodString;
1253
1266
  color: z.ZodEnum<{
1267
+ default: "default";
1254
1268
  blue: "blue";
1255
1269
  blue_background: "blue_background";
1256
1270
  brown: "brown";
1257
1271
  brown_background: "brown_background";
1258
- default: "default";
1259
1272
  gray: "gray";
1260
1273
  gray_background: "gray_background";
1261
1274
  green: "green";
@@ -1290,11 +1303,11 @@ export declare const pagePropertiesSchema: z.ZodDiscriminatedUnion<[z.ZodObject<
1290
1303
  underline: z.ZodBoolean;
1291
1304
  code: z.ZodBoolean;
1292
1305
  color: z.ZodEnum<{
1306
+ default: "default";
1293
1307
  blue: "blue";
1294
1308
  blue_background: "blue_background";
1295
1309
  brown: "brown";
1296
1310
  brown_background: "brown_background";
1297
- default: "default";
1298
1311
  gray: "gray";
1299
1312
  gray_background: "gray_background";
1300
1313
  green: "green";
@@ -1359,6 +1372,7 @@ export declare const pagePropertiesSchema: z.ZodDiscriminatedUnion<[z.ZodObject<
1359
1372
  avatar_url: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodNull]>>;
1360
1373
  person: z.ZodObject<{
1361
1374
  email: z.ZodEmail;
1375
+ email_verified: z.ZodOptional<z.ZodBoolean>;
1362
1376
  }, z.core.$strip>;
1363
1377
  }, z.core.$strip>, z.ZodObject<{
1364
1378
  object: z.ZodLiteral<"user">;
@@ -1391,11 +1405,11 @@ export declare const pagePropertiesSchema: z.ZodDiscriminatedUnion<[z.ZodObject<
1391
1405
  underline: z.ZodBoolean;
1392
1406
  code: z.ZodBoolean;
1393
1407
  color: z.ZodEnum<{
1408
+ default: "default";
1394
1409
  blue: "blue";
1395
1410
  blue_background: "blue_background";
1396
1411
  brown: "brown";
1397
1412
  brown_background: "brown_background";
1398
- default: "default";
1399
1413
  gray: "gray";
1400
1414
  gray_background: "gray_background";
1401
1415
  green: "green";
@@ -1426,11 +1440,11 @@ export declare const pagePropertiesSchema: z.ZodDiscriminatedUnion<[z.ZodObject<
1426
1440
  underline: z.ZodBoolean;
1427
1441
  code: z.ZodBoolean;
1428
1442
  color: z.ZodEnum<{
1443
+ default: "default";
1429
1444
  blue: "blue";
1430
1445
  blue_background: "blue_background";
1431
1446
  brown: "brown";
1432
1447
  brown_background: "brown_background";
1433
- default: "default";
1434
1448
  gray: "gray";
1435
1449
  gray_background: "gray_background";
1436
1450
  green: "green";
@@ -1477,6 +1491,7 @@ export declare const pagePropertiesSchema: z.ZodDiscriminatedUnion<[z.ZodObject<
1477
1491
  avatar_url: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodNull]>>;
1478
1492
  person: z.ZodObject<{
1479
1493
  email: z.ZodEmail;
1494
+ email_verified: z.ZodOptional<z.ZodBoolean>;
1480
1495
  }, z.core.$strip>;
1481
1496
  }, z.core.$strip>, z.ZodObject<{
1482
1497
  object: z.ZodLiteral<"user">;
@@ -1508,27 +1523,96 @@ export declare const pagePropertiesSchema: z.ZodDiscriminatedUnion<[z.ZodObject<
1508
1523
  }, z.core.$strip>>;
1509
1524
  }, z.core.$strip>>;
1510
1525
  }, z.core.$strip>], "type">;
1526
+ /**
1527
+ * @category Page Properties
1528
+ */
1511
1529
  export type NotionPageProperties = z.infer<typeof pagePropertiesSchema>;
1530
+ /**
1531
+ * @category Page Properties
1532
+ */
1512
1533
  export type CheckboxProperty = z.infer<typeof checkboxPropertySchema>;
1534
+ /**
1535
+ * @category Page Properties
1536
+ */
1513
1537
  export type CreatedByProperty = z.infer<typeof createdByPropertySchema>;
1538
+ /**
1539
+ * @category Page Properties
1540
+ */
1514
1541
  export type CreatedTimeProperty = z.infer<typeof createdTimePropertySchema>;
1542
+ /**
1543
+ * @category Page Properties
1544
+ */
1515
1545
  export type DateProperty = z.infer<typeof datePropertySchema>;
1546
+ /**
1547
+ * @category Page Properties
1548
+ */
1516
1549
  export type EmailProperty = z.infer<typeof emailPropertySchema>;
1550
+ /**
1551
+ * @category Page Properties
1552
+ */
1517
1553
  export type FilesProperty = z.infer<typeof filesPropertySchema>;
1554
+ /**
1555
+ * @category Page Properties
1556
+ */
1518
1557
  export type FormulaProperty = z.infer<typeof formulaPropertySchema>;
1558
+ /**
1559
+ * @category Page Properties
1560
+ */
1519
1561
  export type LastEditedByProperty = z.infer<typeof lastEditedByPropertySchema>;
1562
+ /**
1563
+ * @category Page Properties
1564
+ */
1520
1565
  export type LastEditedTimeProperty = z.infer<typeof lastEditedTimePropertySchema>;
1566
+ /**
1567
+ * @category Page Properties
1568
+ */
1521
1569
  export type MultiSelectProperty = z.infer<typeof multiSelectPropertySchema>;
1570
+ /**
1571
+ * @category Page Properties
1572
+ */
1522
1573
  export type NumberProperty = z.infer<typeof numberPropertySchema>;
1574
+ /**
1575
+ * @category Page Properties
1576
+ */
1523
1577
  export type PeopleProperty = z.infer<typeof peoplePropertySchema>;
1578
+ /**
1579
+ * @category Page Properties
1580
+ */
1524
1581
  export type PhoneNumberProperty = z.infer<typeof phoneNumberPropertySchema>;
1582
+ /**
1583
+ * @category Page Properties
1584
+ */
1525
1585
  export type RelationProperty = z.infer<typeof relationPropertySchema>;
1586
+ /**
1587
+ * @category Page Properties
1588
+ */
1526
1589
  export type RichTextProperty = z.infer<typeof richTextPropertySchema>;
1590
+ /**
1591
+ * @category Page Properties
1592
+ */
1527
1593
  export type RollupProperty = z.infer<typeof rollupPropertySchema>;
1594
+ /**
1595
+ * @category Page Properties
1596
+ */
1528
1597
  export type SelectProperty = z.infer<typeof selectPropertySchema>;
1598
+ /**
1599
+ * @category Page Properties
1600
+ */
1529
1601
  export type StatusProperty = z.infer<typeof statusPropertySchema>;
1602
+ /**
1603
+ * @category Page Properties
1604
+ */
1530
1605
  export type TitleProperty = z.infer<typeof titlePropertySchema>;
1606
+ /**
1607
+ * @category Page Properties
1608
+ */
1531
1609
  export type UrlProperty = z.infer<typeof urlPropertySchema>;
1610
+ /**
1611
+ * @category Page Properties
1612
+ */
1532
1613
  export type UniqueIdProperty = z.infer<typeof uniqueIdPropertySchema>;
1614
+ /**
1615
+ * @category Page Properties
1616
+ */
1533
1617
  export type VerificationProperty = z.infer<typeof verificationPropertySchema>;
1534
1618
  export {};
@@ -42,9 +42,9 @@ const user_schema_1 = require("./user.schema");
42
42
  /**
43
43
  * Page property value schemas.
44
44
  *
45
- * These define the actual data values stored in page properties (database columns).
46
- * Different from property objects which define the schema/configuration.
47
- * Supports 23 property types including title, rich text, number, select, etc.
45
+ * These schemas define the data values in page properties (database columns).
46
+ * Property objects define the schema and configuration instead.
47
+ * This file supports 22 property types, including title, rich text, number, and select.
48
48
  *
49
49
  * Notion API reference:
50
50
  * https://developers.notion.com/reference/page-property-values
@@ -200,15 +200,14 @@ const rollupPropertySchema = z.object({
200
200
  'unchecked',
201
201
  'unique',
202
202
  ]),
203
- number: z.number().nullable().optional(),
203
+ number: z.number().nullish(),
204
204
  date: z
205
205
  .object({
206
206
  start: shared_schema_1.notionDateStringSchema,
207
207
  end: shared_schema_1.notionDateStringSchema.nullable(),
208
208
  time_zone: z.string().trim().nullable(),
209
209
  })
210
- .nullable()
211
- .optional(),
210
+ .nullish(),
212
211
  array: z.array(z.unknown()).optional(),
213
212
  }),
214
213
  });
@@ -275,6 +274,9 @@ const verificationPropertySchema = z.object({
275
274
  })
276
275
  .nullable(),
277
276
  });
277
+ /**
278
+ * @category Page Properties
279
+ */
278
280
  exports.pagePropertiesSchema = z.discriminatedUnion('type', [
279
281
  checkboxPropertySchema,
280
282
  createdByPropertySchema,
@@ -3,20 +3,53 @@ import * as z from 'zod';
3
3
  * Pagination schemas and utilities.
4
4
  *
5
5
  * The Notion API uses cursor-based pagination for list endpoints. Responses include
6
- * results, a next_cursor, and has_more flag. This file provides reusable schemas
7
- * and types for working with paginated responses.
6
+ * results, a next_cursor, and a has_more flag. This file provides reusable schemas
7
+ * and types to work with paginated responses.
8
8
  *
9
9
  * Notion API reference:
10
10
  * https://developers.notion.com/reference/intro#pagination
11
11
  */
12
12
  /**
13
13
  * Paginated list response type.
14
- * As of API version 2025-09-03, 'data_source' and 'page_or_data_source' are used
15
- * instead of 'database' and 'page_or_database' in search results.
14
+ * As of API version 2025-09-03, search results use 'data_source' and
15
+ * 'page_or_data_source' instead of 'database' and 'page_or_database'.
16
+ *
17
+ * @category Pagination
18
+ */
19
+ export type PaginatedListType = 'block' | 'comment' | 'custom_emoji' | 'database' | 'data_source' | 'page' | 'page_or_database' | 'page_or_data_source' | 'property_item' | 'user' | 'view';
20
+ /**
21
+ * Reasons why a query result can be incomplete even when `has_more` is `false`.
22
+ * This happens only when a query hits the 10,000-result pagination depth cap.
23
+ *
24
+ * @category Pagination
25
+ */
26
+ export declare const REQUEST_STATUS_INCOMPLETE_REASONS: readonly ["query_result_limit_reached"];
27
+ /**
28
+ * @category Pagination
29
+ */
30
+ export type RequestStatusIncompleteReason = (typeof REQUEST_STATUS_INCOMPLETE_REASONS)[number];
31
+ /**
32
+ * This schema flags a truncated query even though `has_more` is `false`. For example,
33
+ * data source, view, and meeting-notes queries cap at 10,000 results. Callers that need
34
+ * every row must detect this. Then they must re-query with a narrower filter (see the
35
+ * pagination helpers).
36
+ *
37
+ * @category Pagination
38
+ */
39
+ export declare const requestStatusSchema: z.ZodObject<{
40
+ type: z.ZodLiteral<"incomplete">;
41
+ incomplete_reason: z.ZodEnum<{
42
+ query_result_limit_reached: "query_result_limit_reached";
43
+ }>;
44
+ }, z.core.$strip>;
45
+ /**
46
+ * @category Pagination
16
47
  */
17
- export type PaginatedListType = 'block' | 'comment' | 'database' | 'data_source' | 'page' | 'page_or_database' | 'page_or_data_source' | 'property_item' | 'user';
48
+ export type RequestStatus = z.infer<typeof requestStatusSchema>;
18
49
  /**
19
50
  * Base paginated list response schema.
51
+ *
52
+ * @category Pagination
20
53
  */
21
54
  export declare const paginatedListSchema: <T extends z.ZodTypeAny>(resultSchema: T) => z.ZodObject<{
22
55
  object: z.ZodLiteral<"list">;
@@ -24,6 +57,7 @@ export declare const paginatedListSchema: <T extends z.ZodTypeAny>(resultSchema:
24
57
  next_cursor: z.ZodNullable<z.ZodString>;
25
58
  has_more: z.ZodBoolean;
26
59
  type: z.ZodEnum<{
60
+ custom_emoji: "custom_emoji";
27
61
  user: "user";
28
62
  database: "database";
29
63
  page: "page";
@@ -33,19 +67,34 @@ export declare const paginatedListSchema: <T extends z.ZodTypeAny>(resultSchema:
33
67
  page_or_database: "page_or_database";
34
68
  page_or_data_source: "page_or_data_source";
35
69
  property_item: "property_item";
70
+ view: "view";
36
71
  }>;
72
+ request_status: z.ZodOptional<z.ZodObject<{
73
+ type: z.ZodLiteral<"incomplete">;
74
+ incomplete_reason: z.ZodEnum<{
75
+ query_result_limit_reached: "query_result_limit_reached";
76
+ }>;
77
+ }, z.core.$strip>>;
37
78
  }, z.core.$strip>;
38
79
  /**
39
80
  * Pagination parameters for requests.
81
+ *
82
+ * @category Pagination
40
83
  */
41
84
  export interface PaginationParameters {
42
85
  /** The number of items to return (default: 100, max: 100) */
43
86
  page_size?: number;
44
- /** The cursor value from a previous response to continue pagination */
45
- start_cursor?: string;
87
+ /**
88
+ * The cursor value from a previous response.
89
+ * Pass it to continue pagination.
90
+ * The SDK treats `null` the same as omitted.
91
+ */
92
+ start_cursor?: string | null;
46
93
  }
47
94
  /**
48
95
  * Helper to create paginated response type.
96
+ *
97
+ * @category Pagination
49
98
  */
50
99
  export type PaginatedList<T> = {
51
100
  object: 'list';
@@ -53,4 +102,5 @@ export type PaginatedList<T> = {
53
102
  next_cursor: string | null;
54
103
  has_more: boolean;
55
104
  type: PaginatedListType;
105
+ request_status?: RequestStatus;
56
106
  };
@@ -33,10 +33,31 @@ var __importStar = (this && this.__importStar) || (function () {
33
33
  };
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.paginatedListSchema = void 0;
36
+ exports.paginatedListSchema = exports.requestStatusSchema = exports.REQUEST_STATUS_INCOMPLETE_REASONS = void 0;
37
37
  const z = __importStar(require("zod"));
38
+ /**
39
+ * Reasons why a query result can be incomplete even when `has_more` is `false`.
40
+ * This happens only when a query hits the 10,000-result pagination depth cap.
41
+ *
42
+ * @category Pagination
43
+ */
44
+ exports.REQUEST_STATUS_INCOMPLETE_REASONS = ['query_result_limit_reached'];
45
+ /**
46
+ * This schema flags a truncated query even though `has_more` is `false`. For example,
47
+ * data source, view, and meeting-notes queries cap at 10,000 results. Callers that need
48
+ * every row must detect this. Then they must re-query with a narrower filter (see the
49
+ * pagination helpers).
50
+ *
51
+ * @category Pagination
52
+ */
53
+ exports.requestStatusSchema = z.object({
54
+ type: z.literal('incomplete'),
55
+ incomplete_reason: z.enum(exports.REQUEST_STATUS_INCOMPLETE_REASONS),
56
+ });
38
57
  /**
39
58
  * Base paginated list response schema.
59
+ *
60
+ * @category Pagination
40
61
  */
41
62
  // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
42
63
  const paginatedListSchema = (resultSchema) => {
@@ -48,6 +69,7 @@ const paginatedListSchema = (resultSchema) => {
48
69
  type: z.enum([
49
70
  'block',
50
71
  'comment',
72
+ 'custom_emoji',
51
73
  'database',
52
74
  'data_source',
53
75
  'page',
@@ -55,7 +77,9 @@ const paginatedListSchema = (resultSchema) => {
55
77
  'page_or_data_source',
56
78
  'property_item',
57
79
  'user',
80
+ 'view',
58
81
  ]),
82
+ request_status: exports.requestStatusSchema.optional(),
59
83
  });
60
84
  };
61
85
  exports.paginatedListSchema = paginatedListSchema;