@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,14 +2,17 @@ import * as z from 'zod';
2
2
  /**
3
3
  * Notion parent object schemas.
4
4
  *
5
- * Parent objects define the location/container of pages and blocks within Notion.
5
+ * Parent objects identify the container of a page or block within Notion.
6
6
  * A parent can be a database, data source, page, workspace, or block.
7
7
  *
8
8
  * Notion API reference:
9
9
  * https://developers.notion.com/reference/parent-object
10
10
  */
11
- /** Database parent. */
12
- declare const databaseParentSchema: z.ZodObject<{
11
+ /** Database parent.
12
+ *
13
+ * @category Shared Types
14
+ */
15
+ export declare const databaseParentSchema: z.ZodObject<{
13
16
  type: z.ZodLiteral<"database_id">;
14
17
  database_id: z.ZodUUID;
15
18
  }, z.core.$strip>;
@@ -34,6 +37,14 @@ declare const blockParentSchema: z.ZodObject<{
34
37
  type: z.ZodLiteral<"block_id">;
35
38
  block_id: z.ZodUUID;
36
39
  }, z.core.$strip>;
40
+ /** Agent parent. */
41
+ declare const agentParentSchema: z.ZodObject<{
42
+ type: z.ZodLiteral<"agent_id">;
43
+ agent_id: z.ZodUUID;
44
+ }, z.core.$strip>;
45
+ /**
46
+ * @category Shared Types
47
+ */
37
48
  export declare const parentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
38
49
  type: z.ZodLiteral<"database_id">;
39
50
  database_id: z.ZodUUID;
@@ -50,11 +61,36 @@ export declare const parentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
50
61
  }, z.core.$strip>, z.ZodObject<{
51
62
  type: z.ZodLiteral<"block_id">;
52
63
  block_id: z.ZodUUID;
64
+ }, z.core.$strip>, z.ZodObject<{
65
+ type: z.ZodLiteral<"agent_id">;
66
+ agent_id: z.ZodUUID;
53
67
  }, z.core.$strip>], "type">;
68
+ /**
69
+ * @category Shared Types
70
+ */
54
71
  export type NotionParent = z.infer<typeof parentSchema>;
72
+ /**
73
+ * @category Shared Types
74
+ */
55
75
  export type DatabaseParent = z.infer<typeof databaseParentSchema>;
76
+ /**
77
+ * @category Shared Types
78
+ */
56
79
  export type DataSourceParent = z.infer<typeof dataSourceParentSchema>;
80
+ /**
81
+ * @category Shared Types
82
+ */
57
83
  export type PageParent = z.infer<typeof pageParentSchema>;
84
+ /**
85
+ * @category Shared Types
86
+ */
58
87
  export type WorkspaceParent = z.infer<typeof workspaceParentSchema>;
88
+ /**
89
+ * @category Shared Types
90
+ */
59
91
  export type BlockParent = z.infer<typeof blockParentSchema>;
92
+ /**
93
+ * @category Shared Types
94
+ */
95
+ export type AgentParent = z.infer<typeof agentParentSchema>;
60
96
  export {};
@@ -33,19 +33,22 @@ var __importStar = (this && this.__importStar) || (function () {
33
33
  };
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.parentSchema = void 0;
36
+ exports.parentSchema = exports.databaseParentSchema = void 0;
37
37
  const z = __importStar(require("zod"));
38
38
  /**
39
39
  * Notion parent object schemas.
40
40
  *
41
- * Parent objects define the location/container of pages and blocks within Notion.
41
+ * Parent objects identify the container of a page or block within Notion.
42
42
  * A parent can be a database, data source, page, workspace, or block.
43
43
  *
44
44
  * Notion API reference:
45
45
  * https://developers.notion.com/reference/parent-object
46
46
  */
47
- /** Database parent. */
48
- const databaseParentSchema = z.object({
47
+ /** Database parent.
48
+ *
49
+ * @category Shared Types
50
+ */
51
+ exports.databaseParentSchema = z.object({
49
52
  type: z.literal('database_id'),
50
53
  database_id: z.uuid(),
51
54
  });
@@ -70,10 +73,19 @@ const blockParentSchema = z.object({
70
73
  type: z.literal('block_id'),
71
74
  block_id: z.uuid(),
72
75
  });
76
+ /** Agent parent. */
77
+ const agentParentSchema = z.object({
78
+ type: z.literal('agent_id'),
79
+ agent_id: z.uuid(),
80
+ });
81
+ /**
82
+ * @category Shared Types
83
+ */
73
84
  exports.parentSchema = z.discriminatedUnion('type', [
74
- databaseParentSchema,
85
+ exports.databaseParentSchema,
75
86
  dataSourceParentSchema,
76
87
  pageParentSchema,
77
88
  workspaceParentSchema,
78
89
  blockParentSchema,
90
+ agentParentSchema,
79
91
  ]);
@@ -84,9 +84,9 @@ declare const multiSelectPropertySchema: z.ZodObject<{
84
84
  id: z.ZodString;
85
85
  name: z.ZodString;
86
86
  color: z.ZodEnum<{
87
+ default: "default";
87
88
  blue: "blue";
88
89
  brown: "brown";
89
- default: "default";
90
90
  gray: "gray";
91
91
  green: "green";
92
92
  orange: "orange";
@@ -244,9 +244,9 @@ declare const selectPropertySchema: 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";
@@ -269,9 +269,9 @@ declare const statusPropertySchema: z.ZodObject<{
269
269
  id: z.ZodString;
270
270
  name: z.ZodString;
271
271
  color: z.ZodEnum<{
272
+ default: "default";
272
273
  blue: "blue";
273
274
  brown: "brown";
274
- default: "default";
275
275
  gray: "gray";
276
276
  green: "green";
277
277
  orange: "orange";
@@ -285,9 +285,9 @@ declare const statusPropertySchema: z.ZodObject<{
285
285
  id: z.ZodString;
286
286
  name: z.ZodString;
287
287
  color: z.ZodEnum<{
288
+ default: "default";
288
289
  blue: "blue";
289
290
  brown: "brown";
290
- default: "default";
291
291
  gray: "gray";
292
292
  green: "green";
293
293
  orange: "orange";
@@ -300,7 +300,7 @@ declare const statusPropertySchema: z.ZodObject<{
300
300
  }, z.core.$strip>>;
301
301
  }, z.core.$strip>;
302
302
  }, z.core.$strip>;
303
- /** Title property configuration (empty object) - all data sources require exactly one */
303
+ /** Title property configuration (empty object). Every data source requires exactly one. */
304
304
  declare const titlePropertySchema: z.ZodObject<{
305
305
  type: z.ZodLiteral<"title">;
306
306
  id: z.ZodString;
@@ -328,7 +328,9 @@ declare const uniqueIdPropertySchema: z.ZodObject<{
328
328
  }, z.core.$strip>;
329
329
  /**
330
330
  * Discriminated union of all data source property object types.
331
- * These define the schema/configuration for a data source (not the values).
331
+ * Together they define the configuration for a data source, not the values.
332
+ *
333
+ * @category Page Properties
332
334
  */
333
335
  export declare const propertyObjectSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
334
336
  type: z.ZodLiteral<"checkbox">;
@@ -396,9 +398,9 @@ export declare const propertyObjectSchema: z.ZodDiscriminatedUnion<[z.ZodObject<
396
398
  id: z.ZodString;
397
399
  name: z.ZodString;
398
400
  color: z.ZodEnum<{
401
+ default: "default";
399
402
  blue: "blue";
400
403
  brown: "brown";
401
- default: "default";
402
404
  gray: "gray";
403
405
  green: "green";
404
406
  orange: "orange";
@@ -540,9 +542,9 @@ export declare const propertyObjectSchema: z.ZodDiscriminatedUnion<[z.ZodObject<
540
542
  id: z.ZodString;
541
543
  name: z.ZodString;
542
544
  color: z.ZodEnum<{
545
+ default: "default";
543
546
  blue: "blue";
544
547
  brown: "brown";
545
- default: "default";
546
548
  gray: "gray";
547
549
  green: "green";
548
550
  orange: "orange";
@@ -563,9 +565,9 @@ export declare const propertyObjectSchema: z.ZodDiscriminatedUnion<[z.ZodObject<
563
565
  id: z.ZodString;
564
566
  name: z.ZodString;
565
567
  color: z.ZodEnum<{
568
+ default: "default";
566
569
  blue: "blue";
567
570
  brown: "brown";
568
- default: "default";
569
571
  gray: "gray";
570
572
  green: "green";
571
573
  orange: "orange";
@@ -579,9 +581,9 @@ export declare const propertyObjectSchema: z.ZodDiscriminatedUnion<[z.ZodObject<
579
581
  id: z.ZodString;
580
582
  name: z.ZodString;
581
583
  color: z.ZodEnum<{
584
+ default: "default";
582
585
  blue: "blue";
583
586
  brown: "brown";
584
- default: "default";
585
587
  gray: "gray";
586
588
  green: "green";
587
589
  orange: "orange";
@@ -614,7 +616,11 @@ export declare const propertyObjectSchema: z.ZodDiscriminatedUnion<[z.ZodObject<
614
616
  prefix: z.ZodOptional<z.ZodString>;
615
617
  }, z.core.$strip>;
616
618
  }, z.core.$strip>], "type">;
617
- /** Record of property objects keyed by property name */
619
+ /**
620
+ * Record of property objects keyed by property name.
621
+ *
622
+ * @category Page Properties
623
+ */
618
624
  export declare const propertiesObjectSchema: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
619
625
  type: z.ZodLiteral<"checkbox">;
620
626
  id: z.ZodString;
@@ -681,9 +687,9 @@ export declare const propertiesObjectSchema: z.ZodRecord<z.ZodString, z.ZodDiscr
681
687
  id: z.ZodString;
682
688
  name: z.ZodString;
683
689
  color: z.ZodEnum<{
690
+ default: "default";
684
691
  blue: "blue";
685
692
  brown: "brown";
686
- default: "default";
687
693
  gray: "gray";
688
694
  green: "green";
689
695
  orange: "orange";
@@ -825,9 +831,9 @@ export declare const propertiesObjectSchema: z.ZodRecord<z.ZodString, z.ZodDiscr
825
831
  id: z.ZodString;
826
832
  name: z.ZodString;
827
833
  color: z.ZodEnum<{
834
+ default: "default";
828
835
  blue: "blue";
829
836
  brown: "brown";
830
- default: "default";
831
837
  gray: "gray";
832
838
  green: "green";
833
839
  orange: "orange";
@@ -848,9 +854,9 @@ export declare const propertiesObjectSchema: z.ZodRecord<z.ZodString, z.ZodDiscr
848
854
  id: z.ZodString;
849
855
  name: z.ZodString;
850
856
  color: z.ZodEnum<{
857
+ default: "default";
851
858
  blue: "blue";
852
859
  brown: "brown";
853
- default: "default";
854
860
  gray: "gray";
855
861
  green: "green";
856
862
  orange: "orange";
@@ -864,9 +870,9 @@ export declare const propertiesObjectSchema: z.ZodRecord<z.ZodString, z.ZodDiscr
864
870
  id: z.ZodString;
865
871
  name: z.ZodString;
866
872
  color: z.ZodEnum<{
873
+ default: "default";
867
874
  blue: "blue";
868
875
  brown: "brown";
869
- default: "default";
870
876
  gray: "gray";
871
877
  green: "green";
872
878
  orange: "orange";
@@ -899,28 +905,100 @@ export declare const propertiesObjectSchema: z.ZodRecord<z.ZodString, z.ZodDiscr
899
905
  prefix: z.ZodOptional<z.ZodString>;
900
906
  }, z.core.$strip>;
901
907
  }, z.core.$strip>], "type">>;
908
+ /**
909
+ * @category Page Properties
910
+ */
902
911
  export type NotionPropertyObject = z.infer<typeof propertyObjectSchema>;
912
+ /**
913
+ * @category Page Properties
914
+ */
903
915
  export type NotionPropertiesObject = z.infer<typeof propertiesObjectSchema>;
916
+ /**
917
+ * @category Page Properties
918
+ */
904
919
  export type CheckboxPropertyObject = z.infer<typeof checkboxPropertySchema>;
920
+ /**
921
+ * @category Page Properties
922
+ */
905
923
  export type CreatedByPropertyObject = z.infer<typeof createdByPropertySchema>;
924
+ /**
925
+ * @category Page Properties
926
+ */
906
927
  export type CreatedTimePropertyObject = z.infer<typeof createdTimePropertySchema>;
928
+ /**
929
+ * @category Page Properties
930
+ */
907
931
  export type DatePropertyObject = z.infer<typeof datePropertySchema>;
932
+ /**
933
+ * @category Page Properties
934
+ */
908
935
  export type EmailPropertyObject = z.infer<typeof emailPropertySchema>;
936
+ /**
937
+ * @category Page Properties
938
+ */
909
939
  export type FilesPropertyObject = z.infer<typeof filesPropertySchema>;
940
+ /**
941
+ * @category Page Properties
942
+ */
910
943
  export type FormulaPropertyObject = z.infer<typeof formulaPropertySchema>;
944
+ /**
945
+ * @category Page Properties
946
+ */
911
947
  export type LastEditedByPropertyObject = z.infer<typeof lastEditedByPropertySchema>;
948
+ /**
949
+ * @category Page Properties
950
+ */
912
951
  export type LastEditedTimePropertyObject = z.infer<typeof lastEditedTimePropertySchema>;
952
+ /**
953
+ * @category Page Properties
954
+ */
913
955
  export type MultiSelectPropertyObject = z.infer<typeof multiSelectPropertySchema>;
956
+ /**
957
+ * @category Page Properties
958
+ */
914
959
  export type NumberPropertyObject = z.infer<typeof numberPropertySchema>;
960
+ /**
961
+ * @category Page Properties
962
+ */
915
963
  export type PeoplePropertyObject = z.infer<typeof peoplePropertySchema>;
964
+ /**
965
+ * @category Page Properties
966
+ */
916
967
  export type PhoneNumberPropertyObject = z.infer<typeof phoneNumberPropertySchema>;
968
+ /**
969
+ * @category Page Properties
970
+ */
917
971
  export type PlacePropertyObject = z.infer<typeof placePropertySchema>;
972
+ /**
973
+ * @category Page Properties
974
+ */
918
975
  export type RelationPropertyObject = z.infer<typeof relationPropertySchema>;
976
+ /**
977
+ * @category Page Properties
978
+ */
919
979
  export type RichTextPropertyObject = z.infer<typeof richTextPropertySchema>;
980
+ /**
981
+ * @category Page Properties
982
+ */
920
983
  export type RollupPropertyObject = z.infer<typeof rollupPropertySchema>;
984
+ /**
985
+ * @category Page Properties
986
+ */
921
987
  export type SelectPropertyObject = z.infer<typeof selectPropertySchema>;
988
+ /**
989
+ * @category Page Properties
990
+ */
922
991
  export type StatusPropertyObject = z.infer<typeof statusPropertySchema>;
992
+ /**
993
+ * @category Page Properties
994
+ */
923
995
  export type TitlePropertyObject = z.infer<typeof titlePropertySchema>;
996
+ /**
997
+ * @category Page Properties
998
+ */
924
999
  export type UrlPropertyObject = z.infer<typeof urlPropertySchema>;
1000
+ /**
1001
+ * @category Page Properties
1002
+ */
925
1003
  export type UniqueIdPropertyObject = z.infer<typeof uniqueIdPropertySchema>;
926
1004
  export {};
@@ -36,8 +36,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.propertiesObjectSchema = exports.propertyObjectSchema = void 0;
37
37
  const z = __importStar(require("zod"));
38
38
  /**
39
- * Data source property objects define the schema/configuration for a data source.
40
- * These are different from page property values (which contain the actual data).
39
+ * Data source property objects define the schema and configuration for a data source.
40
+ * Page property values contain the actual data instead.
41
41
  *
42
42
  * Notion API reference:
43
43
  * https://developers.notion.com/reference/property-object
@@ -318,7 +318,7 @@ const statusPropertySchema = z.object({
318
318
  groups: z.array(statusGroupSchema),
319
319
  }),
320
320
  });
321
- /** Title property configuration (empty object) - all data sources require exactly one */
321
+ /** Title property configuration (empty object). Every data source requires exactly one. */
322
322
  const titlePropertySchema = z.object({
323
323
  type: z.literal('title'),
324
324
  id: z.string().trim(),
@@ -346,7 +346,9 @@ const uniqueIdPropertySchema = z.object({
346
346
  });
347
347
  /**
348
348
  * Discriminated union of all data source property object types.
349
- * These define the schema/configuration for a data source (not the values).
349
+ * Together they define the configuration for a data source, not the values.
350
+ *
351
+ * @category Page Properties
350
352
  */
351
353
  exports.propertyObjectSchema = z.discriminatedUnion('type', [
352
354
  checkboxPropertySchema,
@@ -372,5 +374,9 @@ exports.propertyObjectSchema = z.discriminatedUnion('type', [
372
374
  urlPropertySchema,
373
375
  uniqueIdPropertySchema,
374
376
  ]);
375
- /** Record of property objects keyed by property name */
377
+ /**
378
+ * Record of property objects keyed by property name.
379
+ *
380
+ * @category Page Properties
381
+ */
376
382
  exports.propertiesObjectSchema = z.record(z.string().trim(), exports.propertyObjectSchema);
@@ -15,11 +15,11 @@ declare const textRichTextSchema: z.ZodObject<{
15
15
  underline: z.ZodBoolean;
16
16
  code: z.ZodBoolean;
17
17
  color: z.ZodEnum<{
18
+ default: "default";
18
19
  blue: "blue";
19
20
  blue_background: "blue_background";
20
21
  brown: "brown";
21
22
  brown_background: "brown_background";
22
- default: "default";
23
23
  gray: "gray";
24
24
  gray_background: "gray_background";
25
25
  green: "green";
@@ -86,6 +86,7 @@ declare const mentionRichTextSchema: z.ZodObject<{
86
86
  avatar_url: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodNull]>>;
87
87
  person: z.ZodObject<{
88
88
  email: z.ZodEmail;
89
+ email_verified: z.ZodOptional<z.ZodBoolean>;
89
90
  }, z.core.$strip>;
90
91
  }, z.core.$strip>, z.ZodObject<{
91
92
  object: z.ZodLiteral<"user">;
@@ -118,11 +119,11 @@ declare const mentionRichTextSchema: z.ZodObject<{
118
119
  underline: z.ZodBoolean;
119
120
  code: z.ZodBoolean;
120
121
  color: z.ZodEnum<{
122
+ default: "default";
121
123
  blue: "blue";
122
124
  blue_background: "blue_background";
123
125
  brown: "brown";
124
126
  brown_background: "brown_background";
125
- default: "default";
126
127
  gray: "gray";
127
128
  gray_background: "gray_background";
128
129
  green: "green";
@@ -155,11 +156,11 @@ declare const equationRichTextSchema: z.ZodObject<{
155
156
  underline: z.ZodBoolean;
156
157
  code: z.ZodBoolean;
157
158
  color: z.ZodEnum<{
159
+ default: "default";
158
160
  blue: "blue";
159
161
  blue_background: "blue_background";
160
162
  brown: "brown";
161
163
  brown_background: "brown_background";
162
- default: "default";
163
164
  gray: "gray";
164
165
  gray_background: "gray_background";
165
166
  green: "green";
@@ -179,6 +180,9 @@ declare const equationRichTextSchema: z.ZodObject<{
179
180
  plain_text: z.ZodString;
180
181
  href: z.ZodNullable<z.ZodURL>;
181
182
  }, z.core.$strip>;
183
+ /**
184
+ * @category Rich Text
185
+ */
182
186
  export declare const richTextSchema: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
183
187
  type: z.ZodLiteral<"text">;
184
188
  text: z.ZodObject<{
@@ -194,11 +198,11 @@ export declare const richTextSchema: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodOb
194
198
  underline: z.ZodBoolean;
195
199
  code: z.ZodBoolean;
196
200
  color: z.ZodEnum<{
201
+ default: "default";
197
202
  blue: "blue";
198
203
  blue_background: "blue_background";
199
204
  brown: "brown";
200
205
  brown_background: "brown_background";
201
- default: "default";
202
206
  gray: "gray";
203
207
  gray_background: "gray_background";
204
208
  green: "green";
@@ -263,6 +267,7 @@ export declare const richTextSchema: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodOb
263
267
  avatar_url: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodNull]>>;
264
268
  person: z.ZodObject<{
265
269
  email: z.ZodEmail;
270
+ email_verified: z.ZodOptional<z.ZodBoolean>;
266
271
  }, z.core.$strip>;
267
272
  }, z.core.$strip>, z.ZodObject<{
268
273
  object: z.ZodLiteral<"user">;
@@ -295,11 +300,11 @@ export declare const richTextSchema: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodOb
295
300
  underline: z.ZodBoolean;
296
301
  code: z.ZodBoolean;
297
302
  color: z.ZodEnum<{
303
+ default: "default";
298
304
  blue: "blue";
299
305
  blue_background: "blue_background";
300
306
  brown: "brown";
301
307
  brown_background: "brown_background";
302
- default: "default";
303
308
  gray: "gray";
304
309
  gray_background: "gray_background";
305
310
  green: "green";
@@ -330,11 +335,11 @@ export declare const richTextSchema: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodOb
330
335
  underline: z.ZodBoolean;
331
336
  code: z.ZodBoolean;
332
337
  color: z.ZodEnum<{
338
+ default: "default";
333
339
  blue: "blue";
334
340
  blue_background: "blue_background";
335
341
  brown: "brown";
336
342
  brown_background: "brown_background";
337
- default: "default";
338
343
  gray: "gray";
339
344
  gray_background: "gray_background";
340
345
  green: "green";
@@ -354,8 +359,20 @@ export declare const richTextSchema: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodOb
354
359
  plain_text: z.ZodString;
355
360
  href: z.ZodNullable<z.ZodURL>;
356
361
  }, z.core.$strip>], "type">>;
362
+ /**
363
+ * @category Rich Text
364
+ */
357
365
  export type NotionRichText = z.infer<typeof richTextSchema>;
366
+ /**
367
+ * @category Rich Text
368
+ */
358
369
  export type TextRichText = z.infer<typeof textRichTextSchema>;
370
+ /**
371
+ * @category Rich Text
372
+ */
359
373
  export type MentionRichText = z.infer<typeof mentionRichTextSchema>;
374
+ /**
375
+ * @category Rich Text
376
+ */
360
377
  export type EquationRichText = z.infer<typeof equationRichTextSchema>;
361
378
  export {};
@@ -41,9 +41,9 @@ const user_schema_1 = require("./user.schema");
41
41
  /**
42
42
  * Notion rich text object schema.
43
43
  *
44
- * Rich text is used throughout the API for formatted text content. It supports
45
- * three types: text (with optional links), mentions (users, pages, dates, etc.),
46
- * and equations (LaTeX). All types support styling via annotations.
44
+ * Notion uses rich text throughout the API for formatted text content. It supports
45
+ * three types: text with optional links, mentions of users, pages, dates, and other
46
+ * objects, and equations in LaTeX. You can style all types with annotations.
47
47
  *
48
48
  * Notion API reference:
49
49
  * https://developers.notion.com/reference/rich-text
@@ -75,7 +75,7 @@ const dateMentionSchema = z.object({
75
75
  date: z.object({
76
76
  start: shared_schema_1.notionDateStringSchema,
77
77
  end: shared_schema_1.notionDateStringSchema.nullable(),
78
- time_zone: z.string().trim().nullable().optional(),
78
+ time_zone: z.string().trim().nullish(),
79
79
  }),
80
80
  });
81
81
  const linkPreviewMentionSchema = z.object({
@@ -147,4 +147,7 @@ const equationRichTextSchema = z.object({
147
147
  plain_text: z.string(),
148
148
  href: z.url().nullable(),
149
149
  });
150
+ /**
151
+ * @category Rich Text
152
+ */
150
153
  exports.richTextSchema = z.array(z.discriminatedUnion('type', [textRichTextSchema, mentionRichTextSchema, equationRichTextSchema]));
@@ -7,9 +7,12 @@ import * as z from 'zod';
7
7
  /**
8
8
  * Notion date string schema.
9
9
  *
10
- * Validates ISO 8601 date strings as returned by the Notion API.
11
- * Accepts both date-only format ("2023-02-23") and full datetime format ("2023-02-23T00:00:00.000Z").
10
+ * This schema validates ISO 8601 date strings from the Notion API.
11
+ * It accepts a date-only format ("2023-02-23") and a full date-time format
12
+ * ("2023-02-23T00:00:00.000Z").
12
13
  *
13
- * According to Notion API docs, date fields contain "A date, with an optional time".
14
+ * The Notion API docs describe date fields as "A date, with an optional time".
15
+ *
16
+ * @category Shared Types
14
17
  */
15
18
  export declare const notionDateStringSchema: z.ZodUnion<readonly [z.ZodISODateTime, z.ZodISODate]>;
@@ -43,10 +43,13 @@ const z = __importStar(require("zod"));
43
43
  /**
44
44
  * Notion date string schema.
45
45
  *
46
- * Validates ISO 8601 date strings as returned by the Notion API.
47
- * Accepts both date-only format ("2023-02-23") and full datetime format ("2023-02-23T00:00:00.000Z").
46
+ * This schema validates ISO 8601 date strings from the Notion API.
47
+ * It accepts a date-only format ("2023-02-23") and a full date-time format
48
+ * ("2023-02-23T00:00:00.000Z").
48
49
  *
49
- * According to Notion API docs, date fields contain "A date, with an optional time".
50
+ * The Notion API docs describe date fields as "A date, with an optional time".
51
+ *
52
+ * @category Shared Types
50
53
  */
51
54
  exports.notionDateStringSchema = z.union([
52
55
  z.iso.datetime(), // Full ISO 8601 datetime: "2023-02-23T00:00:00.000Z"
@@ -8,6 +8,7 @@ declare const personUserSchema: z.ZodObject<{
8
8
  avatar_url: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodNull]>>;
9
9
  person: z.ZodObject<{
10
10
  email: z.ZodEmail;
11
+ email_verified: z.ZodOptional<z.ZodBoolean>;
11
12
  }, z.core.$strip>;
12
13
  }, z.core.$strip>;
13
14
  /** Bot user with owner and workspace information. */
@@ -36,6 +37,9 @@ declare const partialUserSchema: z.ZodObject<{
36
37
  object: z.ZodLiteral<"user">;
37
38
  id: z.ZodUUID;
38
39
  }, z.core.$strip>;
40
+ /**
41
+ * @category Users
42
+ */
39
43
  export declare const userSchema: z.ZodUnion<readonly [z.ZodObject<{
40
44
  object: z.ZodLiteral<"user">;
41
45
  id: z.ZodUUID;
@@ -44,6 +48,7 @@ export declare const userSchema: z.ZodUnion<readonly [z.ZodObject<{
44
48
  avatar_url: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodNull]>>;
45
49
  person: z.ZodObject<{
46
50
  email: z.ZodEmail;
51
+ email_verified: z.ZodOptional<z.ZodBoolean>;
47
52
  }, z.core.$strip>;
48
53
  }, z.core.$strip>, z.ZodObject<{
49
54
  object: z.ZodLiteral<"user">;
@@ -68,8 +73,20 @@ export declare const userSchema: z.ZodUnion<readonly [z.ZodObject<{
68
73
  object: z.ZodLiteral<"user">;
69
74
  id: z.ZodUUID;
70
75
  }, z.core.$strip>]>;
76
+ /**
77
+ * @category Users
78
+ */
71
79
  export type NotionUser = z.infer<typeof userSchema>;
80
+ /**
81
+ * @category Users
82
+ */
72
83
  export type PersonUser = z.infer<typeof personUserSchema>;
84
+ /**
85
+ * @category Users
86
+ */
73
87
  export type BotUser = z.infer<typeof botUserSchema>;
88
+ /**
89
+ * @category Users
90
+ */
74
91
  export type PartialUser = z.infer<typeof partialUserSchema>;
75
92
  export {};