@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.
- package/README.md +20 -87
- package/dist/api/asyncTasks.api.d.ts +72 -0
- package/dist/api/asyncTasks.api.js +70 -0
- package/dist/api/base.api.d.ts +15 -4
- package/dist/api/base.api.js +20 -8
- package/dist/api/blocks.api.d.ts +435 -73
- package/dist/api/blocks.api.js +43 -1
- package/dist/api/comments.api.d.ts +42 -5
- package/dist/api/comments.api.js +45 -1
- package/dist/api/customEmojis.api.d.ts +38 -0
- package/dist/api/customEmojis.api.js +38 -0
- package/dist/api/dataSources.api.d.ts +67 -14
- package/dist/api/dataSources.api.js +26 -1
- package/dist/api/databases.api.d.ts +47 -11
- package/dist/api/databases.api.js +4 -1
- package/dist/api/fileUploads.api.d.ts +8 -5
- package/dist/api/fileUploads.api.js +11 -7
- package/dist/api/index.d.ts +3 -0
- package/dist/api/index.js +7 -1
- package/dist/api/pages.api.d.ts +144 -10
- package/dist/api/pages.api.js +66 -0
- package/dist/api/search.api.d.ts +12 -2
- package/dist/api/search.api.js +5 -2
- package/dist/api/users.api.d.ts +3 -0
- package/dist/api/users.api.js +2 -0
- package/dist/api/views.api.d.ts +286 -0
- package/dist/api/views.api.js +172 -0
- package/dist/client.d.ts +17 -17
- package/dist/client.js +25 -30
- package/dist/errors.d.ts +19 -5
- package/dist/errors.js +16 -4
- package/dist/helpers/block.helpers.d.ts +49 -5
- package/dist/helpers/block.helpers.js +50 -6
- package/dist/helpers/file.helpers.d.ts +46 -5
- package/dist/helpers/file.helpers.js +36 -8
- package/dist/helpers/filter.helpers.d.ts +8 -6
- package/dist/helpers/filter.helpers.js +2 -0
- package/dist/helpers/index.d.ts +3 -2
- package/dist/helpers/index.js +5 -1
- package/dist/helpers/pagination.helpers.d.ts +85 -13
- package/dist/helpers/pagination.helpers.js +114 -8
- package/dist/helpers/parent.helpers.d.ts +5 -3
- package/dist/helpers/parent.helpers.js +5 -3
- package/dist/helpers/property.helpers.d.ts +31 -0
- package/dist/helpers/property.helpers.js +30 -1
- package/dist/helpers/richText.helpers.d.ts +10 -5
- package/dist/helpers/richText.helpers.js +11 -6
- package/dist/helpers/sort.helpers.d.ts +2 -0
- package/dist/helpers/sort.helpers.js +2 -0
- package/dist/helpers/webhook.helpers.d.ts +54 -0
- package/dist/helpers/webhook.helpers.js +83 -0
- package/dist/models/asyncTask.model.d.ts +61 -0
- package/dist/models/asyncTask.model.js +91 -0
- package/dist/models/base.model.d.ts +16 -4
- package/dist/models/base.model.js +17 -5
- package/dist/models/block.model.d.ts +6 -2
- package/dist/models/block.model.js +48 -33
- package/dist/models/comment.model.d.ts +4 -2
- package/dist/models/comment.model.js +4 -2
- package/dist/models/customEmoji.model.d.ts +30 -0
- package/dist/models/customEmoji.model.js +44 -0
- package/dist/models/dataSource.model.d.ts +7 -5
- package/dist/models/dataSource.model.js +5 -3
- package/dist/models/database.model.d.ts +13 -5
- package/dist/models/database.model.js +15 -5
- package/dist/models/fileUpload.model.d.ts +6 -4
- package/dist/models/fileUpload.model.js +6 -4
- package/dist/models/index.d.ts +3 -0
- package/dist/models/index.js +7 -1
- package/dist/models/page.model.d.ts +8 -2
- package/dist/models/page.model.js +14 -4
- package/dist/models/richText.model.d.ts +3 -1
- package/dist/models/richText.model.js +3 -1
- package/dist/models/user.model.d.ts +4 -2
- package/dist/models/user.model.js +4 -2
- package/dist/models/view.model.d.ts +81 -0
- package/dist/models/view.model.js +121 -0
- package/dist/notion.d.ts +32 -8
- package/dist/notion.js +25 -4
- package/dist/schemas/asyncTask.schema.d.ts +53 -0
- package/dist/schemas/asyncTask.schema.js +88 -0
- package/dist/schemas/block.schema.d.ts +390 -73
- package/dist/schemas/block.schema.js +39 -8
- package/dist/schemas/codeLanguages.d.ts +7 -1
- package/dist/schemas/codeLanguages.js +4 -1
- package/dist/schemas/colors.d.ts +7 -1
- package/dist/schemas/colors.js +4 -1
- package/dist/schemas/comment.schema.d.ts +28 -5
- package/dist/schemas/comment.schema.js +11 -2
- package/dist/schemas/customEmoji.schema.d.ts +18 -0
- package/dist/schemas/customEmoji.schema.js +50 -0
- package/dist/schemas/dataSource.schema.d.ts +84 -10
- package/dist/schemas/dataSource.schema.js +31 -6
- package/dist/schemas/database.schema.d.ts +51 -7
- package/dist/schemas/database.schema.js +10 -3
- package/dist/schemas/emoji.schema.d.ts +7 -2
- package/dist/schemas/emoji.schema.js +4 -2
- package/dist/schemas/file.schema.d.ts +18 -2
- package/dist/schemas/file.schema.js +6 -2
- package/dist/schemas/fileUpload.schema.d.ts +9 -3
- package/dist/schemas/fileUpload.schema.js +5 -2
- package/dist/schemas/icon.schema.d.ts +116 -0
- package/dist/schemas/icon.schema.js +100 -0
- package/dist/schemas/index.d.ts +6 -0
- package/dist/schemas/index.js +6 -0
- package/dist/schemas/meetingNotesQuery.schema.d.ts +4198 -0
- package/dist/schemas/meetingNotesQuery.schema.js +67 -0
- package/dist/schemas/page.schema.d.ts +51 -9
- package/dist/schemas/page.schema.js +6 -2
- package/dist/schemas/pageMarkdown.schema.d.ts +70 -0
- package/dist/schemas/pageMarkdown.schema.js +70 -0
- package/dist/schemas/pageProperties.schema.d.ts +105 -21
- package/dist/schemas/pageProperties.schema.js +8 -6
- package/dist/schemas/pagination.schema.d.ts +57 -7
- package/dist/schemas/pagination.schema.js +25 -1
- package/dist/schemas/parent.schema.d.ts +39 -3
- package/dist/schemas/parent.schema.js +17 -5
- package/dist/schemas/propertyObjects.schema.d.ts +93 -15
- package/dist/schemas/propertyObjects.schema.js +11 -5
- package/dist/schemas/richText.schema.d.ts +23 -6
- package/dist/schemas/richText.schema.js +7 -4
- package/dist/schemas/shared.schema.d.ts +6 -3
- package/dist/schemas/shared.schema.js +6 -3
- package/dist/schemas/user.schema.d.ts +17 -0
- package/dist/schemas/user.schema.js +7 -3
- package/dist/schemas/view.schema.d.ts +1111 -0
- package/dist/schemas/view.schema.js +134 -0
- package/dist/validation.d.ts +11 -4
- package/dist/validation.js +11 -4
- package/package.json +6 -3
|
@@ -38,8 +38,8 @@ const z = __importStar(require("zod"));
|
|
|
38
38
|
/**
|
|
39
39
|
* Notion user object schemas.
|
|
40
40
|
*
|
|
41
|
-
* Users can be people, bots, or partial user objects (
|
|
42
|
-
*
|
|
41
|
+
* Users can be people, bots, or partial user objects (only id and object type).
|
|
42
|
+
* The created_by and last_edited_by fields use this schema throughout the API.
|
|
43
43
|
*
|
|
44
44
|
* Notion API reference:
|
|
45
45
|
* https://developers.notion.com/reference/user
|
|
@@ -63,6 +63,7 @@ const personUserSchema = z.object({
|
|
|
63
63
|
avatar_url: z.union([z.url(), z.null()]).optional(),
|
|
64
64
|
person: z.object({
|
|
65
65
|
email: z.email(),
|
|
66
|
+
email_verified: z.boolean().optional(),
|
|
66
67
|
}),
|
|
67
68
|
});
|
|
68
69
|
/** Bot user with owner and workspace information. */
|
|
@@ -74,7 +75,7 @@ const botUserSchema = z.object({
|
|
|
74
75
|
avatar_url: z.union([z.url(), z.null()]).optional(),
|
|
75
76
|
bot: z.object({
|
|
76
77
|
owner: botOwnerSchema,
|
|
77
|
-
workspace_name: z.string().trim().
|
|
78
|
+
workspace_name: z.string().trim().nullish(),
|
|
78
79
|
workspace_id: z.string().trim().optional(),
|
|
79
80
|
workspace_limits: z
|
|
80
81
|
.object({
|
|
@@ -88,4 +89,7 @@ const partialUserSchema = z.object({
|
|
|
88
89
|
object: z.literal('user'),
|
|
89
90
|
id: z.uuid(),
|
|
90
91
|
});
|
|
92
|
+
/**
|
|
93
|
+
* @category Users
|
|
94
|
+
*/
|
|
91
95
|
exports.userSchema = z.union([personUserSchema, botUserSchema, partialUserSchema]);
|