@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
|
@@ -37,8 +37,8 @@ exports.blockSchema = exports.blockPositionSchema = void 0;
|
|
|
37
37
|
const z = __importStar(require("zod"));
|
|
38
38
|
const codeLanguages_1 = require("./codeLanguages");
|
|
39
39
|
const colors_1 = require("./colors");
|
|
40
|
-
const emoji_schema_1 = require("./emoji.schema");
|
|
41
40
|
const file_schema_1 = require("./file.schema");
|
|
41
|
+
const icon_schema_1 = require("./icon.schema");
|
|
42
42
|
const parent_schema_1 = require("./parent.schema");
|
|
43
43
|
const richText_schema_1 = require("./richText.schema");
|
|
44
44
|
const shared_schema_1 = require("./shared.schema");
|
|
@@ -58,7 +58,9 @@ const getChildrenSchema = () => {
|
|
|
58
58
|
return childrenSchema;
|
|
59
59
|
};
|
|
60
60
|
/**
|
|
61
|
-
* Position
|
|
61
|
+
* Position to insert block children in the Append Block Children endpoint.
|
|
62
|
+
*
|
|
63
|
+
* @category Blocks
|
|
62
64
|
*/
|
|
63
65
|
exports.blockPositionSchema = z.discriminatedUnion('type', [
|
|
64
66
|
z.object({ type: z.literal('after_block'), after_block: z.object({ id: z.uuid() }) }),
|
|
@@ -73,6 +75,9 @@ const headingsObjectSchema = z.object({
|
|
|
73
75
|
return getChildrenSchema();
|
|
74
76
|
},
|
|
75
77
|
});
|
|
78
|
+
/**
|
|
79
|
+
* @category Blocks
|
|
80
|
+
*/
|
|
76
81
|
exports.blockSchema = z.object({
|
|
77
82
|
object: z.literal('block'),
|
|
78
83
|
id: z.uuid(),
|
|
@@ -95,6 +100,7 @@ exports.blockSchema = z.object({
|
|
|
95
100
|
'heading_1',
|
|
96
101
|
'heading_2',
|
|
97
102
|
'heading_3',
|
|
103
|
+
'heading_4',
|
|
98
104
|
'image',
|
|
99
105
|
'link_preview',
|
|
100
106
|
'numbered_list_item',
|
|
@@ -102,6 +108,7 @@ exports.blockSchema = z.object({
|
|
|
102
108
|
'pdf',
|
|
103
109
|
'quote',
|
|
104
110
|
'synced_block',
|
|
111
|
+
'tab',
|
|
105
112
|
'table',
|
|
106
113
|
'table_of_contents',
|
|
107
114
|
'table_row',
|
|
@@ -139,7 +146,7 @@ exports.blockSchema = z.object({
|
|
|
139
146
|
callout: z
|
|
140
147
|
.object({
|
|
141
148
|
rich_text: richText_schema_1.richTextSchema,
|
|
142
|
-
icon:
|
|
149
|
+
icon: icon_schema_1.iconSchema,
|
|
143
150
|
color: z.enum(colors_1.NOTION_COLORS),
|
|
144
151
|
get children() {
|
|
145
152
|
return getChildrenSchema();
|
|
@@ -163,7 +170,13 @@ exports.blockSchema = z.object({
|
|
|
163
170
|
language: z.enum(codeLanguages_1.CODE_BLOCK_LANGUAGES),
|
|
164
171
|
})
|
|
165
172
|
.optional(),
|
|
166
|
-
column_list: z
|
|
173
|
+
column_list: z
|
|
174
|
+
.object({
|
|
175
|
+
get children() {
|
|
176
|
+
return getChildrenSchema();
|
|
177
|
+
},
|
|
178
|
+
})
|
|
179
|
+
.optional(),
|
|
167
180
|
column: z
|
|
168
181
|
.object({
|
|
169
182
|
width_ratio: z.number().min(0).max(1).optional(),
|
|
@@ -197,6 +210,7 @@ exports.blockSchema = z.object({
|
|
|
197
210
|
heading_1: headingsObjectSchema.optional(),
|
|
198
211
|
heading_2: headingsObjectSchema.optional(),
|
|
199
212
|
heading_3: headingsObjectSchema.optional(),
|
|
213
|
+
heading_4: headingsObjectSchema.optional(),
|
|
200
214
|
image: file_schema_1.fileSchema.optional(),
|
|
201
215
|
link_preview: z.object({ url: z.url() }).optional(),
|
|
202
216
|
numbered_list_item: z
|
|
@@ -214,6 +228,7 @@ exports.blockSchema = z.object({
|
|
|
214
228
|
.object({
|
|
215
229
|
rich_text: richText_schema_1.richTextSchema,
|
|
216
230
|
color: z.enum(colors_1.NOTION_COLORS),
|
|
231
|
+
icon: icon_schema_1.iconSchema.optional(),
|
|
217
232
|
get children() {
|
|
218
233
|
return getChildrenSchema();
|
|
219
234
|
},
|
|
@@ -251,6 +266,13 @@ exports.blockSchema = z.object({
|
|
|
251
266
|
},
|
|
252
267
|
})
|
|
253
268
|
.optional(),
|
|
269
|
+
tab: z
|
|
270
|
+
.object({
|
|
271
|
+
get children() {
|
|
272
|
+
return getChildrenSchema();
|
|
273
|
+
},
|
|
274
|
+
})
|
|
275
|
+
.optional(),
|
|
254
276
|
table: z
|
|
255
277
|
.object({
|
|
256
278
|
table_width: z.int(),
|
|
@@ -295,12 +317,21 @@ exports.blockSchema = z.object({
|
|
|
295
317
|
},
|
|
296
318
|
})
|
|
297
319
|
.optional(),
|
|
320
|
+
// Meeting-notes blocks are server-managed: title/status/child-block-ids are populated
|
|
321
|
+
// by Notion, not hand-constructed by clients. Exact `status` enum values weren't
|
|
322
|
+
// confirmed against a live response, so it's kept permissive (a trimmed string)
|
|
323
|
+
// rather than a guessed closed enum, to avoid rejecting valid live responses.
|
|
298
324
|
meeting_notes: z
|
|
299
325
|
.object({
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
326
|
+
title: richText_schema_1.richTextSchema,
|
|
327
|
+
status: z.string().trim(),
|
|
328
|
+
children: z.object({
|
|
329
|
+
summary_block_id: z.uuid().nullish(),
|
|
330
|
+
notes_block_id: z.uuid().nullish(),
|
|
331
|
+
transcript_block_id: z.uuid().nullish(),
|
|
332
|
+
}),
|
|
333
|
+
calendar_event: z.unknown().nullish(),
|
|
334
|
+
recording: z.unknown().nullish(),
|
|
304
335
|
})
|
|
305
336
|
.optional(),
|
|
306
337
|
unsupported: z.object({}).optional(),
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
-
/** All programming languages supported by Notion code blocks.
|
|
1
|
+
/** All programming languages supported by Notion code blocks.
|
|
2
|
+
*
|
|
3
|
+
* @category Blocks
|
|
4
|
+
*/
|
|
2
5
|
export declare const CODE_BLOCK_LANGUAGES: readonly ["abap", "arduino", "bash", "basic", "c", "clojure", "coffeescript", "c++", "c#", "css", "dart", "diff", "docker", "elixir", "elm", "erlang", "flow", "fortran", "f#", "gherkin", "glsl", "go", "graphql", "groovy", "haskell", "html", "java", "javascript", "json", "julia", "kotlin", "latex", "less", "lisp", "livescript", "lua", "makefile", "markdown", "markup", "matlab", "mermaid", "nix", "objective-c", "ocaml", "pascal", "perl", "php", "plain text", "powershell", "prolog", "protobuf", "python", "r", "reason", "ruby", "rust", "sass", "scala", "scheme", "scss", "shell", "sql", "swift", "typescript", "vb.net", "verilog", "vhdl", "visual basic", "webassembly", "xml", "yaml", "java/c/c++/c#"];
|
|
6
|
+
/**
|
|
7
|
+
* @category Blocks
|
|
8
|
+
*/
|
|
3
9
|
export type CodeBlockLanguage = (typeof CODE_BLOCK_LANGUAGES)[number];
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CODE_BLOCK_LANGUAGES = void 0;
|
|
4
|
-
/** All programming languages supported by Notion code blocks.
|
|
4
|
+
/** All programming languages supported by Notion code blocks.
|
|
5
|
+
*
|
|
6
|
+
* @category Blocks
|
|
7
|
+
*/
|
|
5
8
|
exports.CODE_BLOCK_LANGUAGES = [
|
|
6
9
|
'abap',
|
|
7
10
|
'arduino',
|
package/dist/schemas/colors.d.ts
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
-
/** All color options supported by Notion.
|
|
1
|
+
/** All color options supported by Notion.
|
|
2
|
+
*
|
|
3
|
+
* @category Shared Types
|
|
4
|
+
*/
|
|
2
5
|
export declare const NOTION_COLORS: readonly ["blue", "blue_background", "brown", "brown_background", "default", "gray", "gray_background", "green", "green_background", "orange", "orange_background", "pink", "pink_background", "purple", "purple_background", "red", "red_background", "yellow", "yellow_background"];
|
|
6
|
+
/**
|
|
7
|
+
* @category Shared Types
|
|
8
|
+
*/
|
|
3
9
|
export type NotionColor = (typeof NOTION_COLORS)[number];
|
package/dist/schemas/colors.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.NOTION_COLORS = void 0;
|
|
4
|
-
/** All color options supported by Notion.
|
|
4
|
+
/** All color options supported by Notion.
|
|
5
|
+
*
|
|
6
|
+
* @category Shared Types
|
|
7
|
+
*/
|
|
5
8
|
exports.NOTION_COLORS = [
|
|
6
9
|
'blue',
|
|
7
10
|
'blue_background',
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import * as z from 'zod';
|
|
2
|
-
/** Comment attachment schema.
|
|
2
|
+
/** Comment attachment schema.
|
|
3
|
+
*
|
|
4
|
+
* @category Comments
|
|
5
|
+
*/
|
|
3
6
|
export declare const commentAttachmentSchema: z.ZodObject<{
|
|
4
7
|
category: z.ZodEnum<{
|
|
5
8
|
file: "file";
|
|
@@ -13,8 +16,14 @@ export declare const commentAttachmentSchema: z.ZodObject<{
|
|
|
13
16
|
expiry_time: z.ZodUnion<readonly [z.ZodISODateTime, z.ZodISODate]>;
|
|
14
17
|
}, z.core.$strip>;
|
|
15
18
|
}, z.core.$strip>;
|
|
19
|
+
/**
|
|
20
|
+
* @category Comments
|
|
21
|
+
*/
|
|
16
22
|
export type CommentAttachment = z.infer<typeof commentAttachmentSchema>;
|
|
17
|
-
/** Comment display name schema (user or custom).
|
|
23
|
+
/** Comment display name schema (user or custom).
|
|
24
|
+
*
|
|
25
|
+
* @category Comments
|
|
26
|
+
*/
|
|
18
27
|
export declare const commentDisplayNameSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
19
28
|
type: z.ZodLiteral<"user">;
|
|
20
29
|
resolved_name: z.ZodString;
|
|
@@ -22,7 +31,13 @@ export declare const commentDisplayNameSchema: z.ZodUnion<readonly [z.ZodObject<
|
|
|
22
31
|
type: z.ZodLiteral<"custom">;
|
|
23
32
|
resolved_name: z.ZodString;
|
|
24
33
|
}, z.core.$strip>]>;
|
|
34
|
+
/**
|
|
35
|
+
* @category Comments
|
|
36
|
+
*/
|
|
25
37
|
export type CommentDisplayName = z.infer<typeof commentDisplayNameSchema>;
|
|
38
|
+
/**
|
|
39
|
+
* @category Comments
|
|
40
|
+
*/
|
|
26
41
|
export declare const commentSchema: z.ZodObject<{
|
|
27
42
|
object: z.ZodLiteral<"comment">;
|
|
28
43
|
id: z.ZodUUID;
|
|
@@ -42,6 +57,9 @@ export declare const commentSchema: z.ZodObject<{
|
|
|
42
57
|
}, z.core.$strip>, z.ZodObject<{
|
|
43
58
|
type: z.ZodLiteral<"block_id">;
|
|
44
59
|
block_id: z.ZodUUID;
|
|
60
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
61
|
+
type: z.ZodLiteral<"agent_id">;
|
|
62
|
+
agent_id: z.ZodUUID;
|
|
45
63
|
}, z.core.$strip>], "type">;
|
|
46
64
|
discussion_id: z.ZodUUID;
|
|
47
65
|
created_time: z.ZodUnion<readonly [z.ZodISODateTime, z.ZodISODate]>;
|
|
@@ -53,6 +71,7 @@ export declare const commentSchema: z.ZodObject<{
|
|
|
53
71
|
avatar_url: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodNull]>>;
|
|
54
72
|
person: z.ZodObject<{
|
|
55
73
|
email: z.ZodEmail;
|
|
74
|
+
email_verified: z.ZodOptional<z.ZodBoolean>;
|
|
56
75
|
}, z.core.$strip>;
|
|
57
76
|
}, z.core.$strip>, z.ZodObject<{
|
|
58
77
|
object: z.ZodLiteral<"user">;
|
|
@@ -93,11 +112,11 @@ export declare const commentSchema: z.ZodObject<{
|
|
|
93
112
|
underline: z.ZodBoolean;
|
|
94
113
|
code: z.ZodBoolean;
|
|
95
114
|
color: z.ZodEnum<{
|
|
115
|
+
default: "default";
|
|
96
116
|
blue: "blue";
|
|
97
117
|
blue_background: "blue_background";
|
|
98
118
|
brown: "brown";
|
|
99
119
|
brown_background: "brown_background";
|
|
100
|
-
default: "default";
|
|
101
120
|
gray: "gray";
|
|
102
121
|
gray_background: "gray_background";
|
|
103
122
|
green: "green";
|
|
@@ -162,6 +181,7 @@ export declare const commentSchema: z.ZodObject<{
|
|
|
162
181
|
avatar_url: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodNull]>>;
|
|
163
182
|
person: z.ZodObject<{
|
|
164
183
|
email: z.ZodEmail;
|
|
184
|
+
email_verified: z.ZodOptional<z.ZodBoolean>;
|
|
165
185
|
}, z.core.$strip>;
|
|
166
186
|
}, z.core.$strip>, z.ZodObject<{
|
|
167
187
|
object: z.ZodLiteral<"user">;
|
|
@@ -194,11 +214,11 @@ export declare const commentSchema: z.ZodObject<{
|
|
|
194
214
|
underline: z.ZodBoolean;
|
|
195
215
|
code: z.ZodBoolean;
|
|
196
216
|
color: z.ZodEnum<{
|
|
217
|
+
default: "default";
|
|
197
218
|
blue: "blue";
|
|
198
219
|
blue_background: "blue_background";
|
|
199
220
|
brown: "brown";
|
|
200
221
|
brown_background: "brown_background";
|
|
201
|
-
default: "default";
|
|
202
222
|
gray: "gray";
|
|
203
223
|
gray_background: "gray_background";
|
|
204
224
|
green: "green";
|
|
@@ -229,11 +249,11 @@ export declare const commentSchema: z.ZodObject<{
|
|
|
229
249
|
underline: z.ZodBoolean;
|
|
230
250
|
code: z.ZodBoolean;
|
|
231
251
|
color: z.ZodEnum<{
|
|
252
|
+
default: "default";
|
|
232
253
|
blue: "blue";
|
|
233
254
|
blue_background: "blue_background";
|
|
234
255
|
brown: "brown";
|
|
235
256
|
brown_background: "brown_background";
|
|
236
|
-
default: "default";
|
|
237
257
|
gray: "gray";
|
|
238
258
|
gray_background: "gray_background";
|
|
239
259
|
green: "green";
|
|
@@ -274,4 +294,7 @@ export declare const commentSchema: z.ZodObject<{
|
|
|
274
294
|
resolved_name: z.ZodString;
|
|
275
295
|
}, z.core.$strip>]>>;
|
|
276
296
|
}, z.core.$strip>;
|
|
297
|
+
/**
|
|
298
|
+
* @category Comments
|
|
299
|
+
*/
|
|
277
300
|
export type NotionComment = z.infer<typeof commentSchema>;
|
|
@@ -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(),
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as z from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Custom emoji object schema.
|
|
4
|
+
*
|
|
5
|
+
* Notion API reference:
|
|
6
|
+
* https://developers.notion.com/reference/list-custom-emojis
|
|
7
|
+
*
|
|
8
|
+
* @category Custom Emoji & Icons
|
|
9
|
+
*/
|
|
10
|
+
export declare const customEmojiSchema: z.ZodObject<{
|
|
11
|
+
id: z.ZodUUID;
|
|
12
|
+
name: z.ZodString;
|
|
13
|
+
url: z.ZodURL;
|
|
14
|
+
}, z.core.$strip>;
|
|
15
|
+
/**
|
|
16
|
+
* @category Custom Emoji & Icons
|
|
17
|
+
*/
|
|
18
|
+
export type NotionCustomEmoji = z.infer<typeof customEmojiSchema>;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.customEmojiSchema = void 0;
|
|
37
|
+
const z = __importStar(require("zod"));
|
|
38
|
+
/**
|
|
39
|
+
* Custom emoji object schema.
|
|
40
|
+
*
|
|
41
|
+
* Notion API reference:
|
|
42
|
+
* https://developers.notion.com/reference/list-custom-emojis
|
|
43
|
+
*
|
|
44
|
+
* @category Custom Emoji & Icons
|
|
45
|
+
*/
|
|
46
|
+
exports.customEmojiSchema = z.object({
|
|
47
|
+
id: z.uuid(),
|
|
48
|
+
name: z.string().trim(),
|
|
49
|
+
url: z.url(),
|
|
50
|
+
});
|
|
@@ -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">;
|
|
@@ -77,9 +79,9 @@ export declare const dataSourceSchema: z.ZodObject<{
|
|
|
77
79
|
id: z.ZodString;
|
|
78
80
|
name: z.ZodString;
|
|
79
81
|
color: z.ZodEnum<{
|
|
82
|
+
default: "default";
|
|
80
83
|
blue: "blue";
|
|
81
84
|
brown: "brown";
|
|
82
|
-
default: "default";
|
|
83
85
|
gray: "gray";
|
|
84
86
|
green: "green";
|
|
85
87
|
orange: "orange";
|
|
@@ -221,9 +223,9 @@ export declare const dataSourceSchema: z.ZodObject<{
|
|
|
221
223
|
id: z.ZodString;
|
|
222
224
|
name: z.ZodString;
|
|
223
225
|
color: z.ZodEnum<{
|
|
226
|
+
default: "default";
|
|
224
227
|
blue: "blue";
|
|
225
228
|
brown: "brown";
|
|
226
|
-
default: "default";
|
|
227
229
|
gray: "gray";
|
|
228
230
|
green: "green";
|
|
229
231
|
orange: "orange";
|
|
@@ -244,9 +246,9 @@ export declare const dataSourceSchema: z.ZodObject<{
|
|
|
244
246
|
id: z.ZodString;
|
|
245
247
|
name: z.ZodString;
|
|
246
248
|
color: z.ZodEnum<{
|
|
249
|
+
default: "default";
|
|
247
250
|
blue: "blue";
|
|
248
251
|
brown: "brown";
|
|
249
|
-
default: "default";
|
|
250
252
|
gray: "gray";
|
|
251
253
|
green: "green";
|
|
252
254
|
orange: "orange";
|
|
@@ -260,9 +262,9 @@ export declare const dataSourceSchema: z.ZodObject<{
|
|
|
260
262
|
id: z.ZodString;
|
|
261
263
|
name: z.ZodString;
|
|
262
264
|
color: z.ZodEnum<{
|
|
265
|
+
default: "default";
|
|
263
266
|
blue: "blue";
|
|
264
267
|
brown: "brown";
|
|
265
|
-
default: "default";
|
|
266
268
|
gray: "gray";
|
|
267
269
|
green: "green";
|
|
268
270
|
orange: "orange";
|
|
@@ -311,6 +313,9 @@ export declare const dataSourceSchema: z.ZodObject<{
|
|
|
311
313
|
}, z.core.$strip>, z.ZodObject<{
|
|
312
314
|
type: z.ZodLiteral<"block_id">;
|
|
313
315
|
block_id: z.ZodUUID;
|
|
316
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
317
|
+
type: z.ZodLiteral<"agent_id">;
|
|
318
|
+
agent_id: z.ZodUUID;
|
|
314
319
|
}, z.core.$strip>], "type">;
|
|
315
320
|
database_parent: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
316
321
|
type: z.ZodLiteral<"database_id">;
|
|
@@ -328,6 +333,9 @@ export declare const dataSourceSchema: z.ZodObject<{
|
|
|
328
333
|
}, z.core.$strip>, z.ZodObject<{
|
|
329
334
|
type: z.ZodLiteral<"block_id">;
|
|
330
335
|
block_id: z.ZodUUID;
|
|
336
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
337
|
+
type: z.ZodLiteral<"agent_id">;
|
|
338
|
+
agent_id: z.ZodUUID;
|
|
331
339
|
}, z.core.$strip>], "type">;
|
|
332
340
|
created_time: z.ZodUnion<readonly [z.ZodISODateTime, z.ZodISODate]>;
|
|
333
341
|
created_by: z.ZodUnion<readonly [z.ZodObject<{
|
|
@@ -338,6 +346,7 @@ export declare const dataSourceSchema: z.ZodObject<{
|
|
|
338
346
|
avatar_url: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodNull]>>;
|
|
339
347
|
person: z.ZodObject<{
|
|
340
348
|
email: z.ZodEmail;
|
|
349
|
+
email_verified: z.ZodOptional<z.ZodBoolean>;
|
|
341
350
|
}, z.core.$strip>;
|
|
342
351
|
}, z.core.$strip>, z.ZodObject<{
|
|
343
352
|
object: z.ZodLiteral<"user">;
|
|
@@ -371,6 +380,7 @@ export declare const dataSourceSchema: z.ZodObject<{
|
|
|
371
380
|
avatar_url: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodNull]>>;
|
|
372
381
|
person: z.ZodObject<{
|
|
373
382
|
email: z.ZodEmail;
|
|
383
|
+
email_verified: z.ZodOptional<z.ZodBoolean>;
|
|
374
384
|
}, z.core.$strip>;
|
|
375
385
|
}, z.core.$strip>, z.ZodObject<{
|
|
376
386
|
object: z.ZodLiteral<"user">;
|
|
@@ -410,11 +420,11 @@ export declare const dataSourceSchema: z.ZodObject<{
|
|
|
410
420
|
underline: z.ZodBoolean;
|
|
411
421
|
code: z.ZodBoolean;
|
|
412
422
|
color: z.ZodEnum<{
|
|
423
|
+
default: "default";
|
|
413
424
|
blue: "blue";
|
|
414
425
|
blue_background: "blue_background";
|
|
415
426
|
brown: "brown";
|
|
416
427
|
brown_background: "brown_background";
|
|
417
|
-
default: "default";
|
|
418
428
|
gray: "gray";
|
|
419
429
|
gray_background: "gray_background";
|
|
420
430
|
green: "green";
|
|
@@ -479,6 +489,7 @@ export declare const dataSourceSchema: z.ZodObject<{
|
|
|
479
489
|
avatar_url: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodNull]>>;
|
|
480
490
|
person: z.ZodObject<{
|
|
481
491
|
email: z.ZodEmail;
|
|
492
|
+
email_verified: z.ZodOptional<z.ZodBoolean>;
|
|
482
493
|
}, z.core.$strip>;
|
|
483
494
|
}, z.core.$strip>, z.ZodObject<{
|
|
484
495
|
object: z.ZodLiteral<"user">;
|
|
@@ -511,11 +522,11 @@ export declare const dataSourceSchema: z.ZodObject<{
|
|
|
511
522
|
underline: z.ZodBoolean;
|
|
512
523
|
code: z.ZodBoolean;
|
|
513
524
|
color: z.ZodEnum<{
|
|
525
|
+
default: "default";
|
|
514
526
|
blue: "blue";
|
|
515
527
|
blue_background: "blue_background";
|
|
516
528
|
brown: "brown";
|
|
517
529
|
brown_background: "brown_background";
|
|
518
|
-
default: "default";
|
|
519
530
|
gray: "gray";
|
|
520
531
|
gray_background: "gray_background";
|
|
521
532
|
green: "green";
|
|
@@ -546,11 +557,11 @@ export declare const dataSourceSchema: z.ZodObject<{
|
|
|
546
557
|
underline: z.ZodBoolean;
|
|
547
558
|
code: z.ZodBoolean;
|
|
548
559
|
color: z.ZodEnum<{
|
|
560
|
+
default: "default";
|
|
549
561
|
blue: "blue";
|
|
550
562
|
blue_background: "blue_background";
|
|
551
563
|
brown: "brown";
|
|
552
564
|
brown_background: "brown_background";
|
|
553
|
-
default: "default";
|
|
554
565
|
gray: "gray";
|
|
555
566
|
gray_background: "gray_background";
|
|
556
567
|
green: "green";
|
|
@@ -585,11 +596,11 @@ export declare const dataSourceSchema: z.ZodObject<{
|
|
|
585
596
|
underline: z.ZodBoolean;
|
|
586
597
|
code: z.ZodBoolean;
|
|
587
598
|
color: z.ZodEnum<{
|
|
599
|
+
default: "default";
|
|
588
600
|
blue: "blue";
|
|
589
601
|
blue_background: "blue_background";
|
|
590
602
|
brown: "brown";
|
|
591
603
|
brown_background: "brown_background";
|
|
592
|
-
default: "default";
|
|
593
604
|
gray: "gray";
|
|
594
605
|
gray_background: "gray_background";
|
|
595
606
|
green: "green";
|
|
@@ -654,6 +665,7 @@ export declare const dataSourceSchema: z.ZodObject<{
|
|
|
654
665
|
avatar_url: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodNull]>>;
|
|
655
666
|
person: z.ZodObject<{
|
|
656
667
|
email: z.ZodEmail;
|
|
668
|
+
email_verified: z.ZodOptional<z.ZodBoolean>;
|
|
657
669
|
}, z.core.$strip>;
|
|
658
670
|
}, z.core.$strip>, z.ZodObject<{
|
|
659
671
|
object: z.ZodLiteral<"user">;
|
|
@@ -686,11 +698,11 @@ export declare const dataSourceSchema: z.ZodObject<{
|
|
|
686
698
|
underline: z.ZodBoolean;
|
|
687
699
|
code: z.ZodBoolean;
|
|
688
700
|
color: z.ZodEnum<{
|
|
701
|
+
default: "default";
|
|
689
702
|
blue: "blue";
|
|
690
703
|
blue_background: "blue_background";
|
|
691
704
|
brown: "brown";
|
|
692
705
|
brown_background: "brown_background";
|
|
693
|
-
default: "default";
|
|
694
706
|
gray: "gray";
|
|
695
707
|
gray_background: "gray_background";
|
|
696
708
|
green: "green";
|
|
@@ -721,11 +733,11 @@ export declare const dataSourceSchema: z.ZodObject<{
|
|
|
721
733
|
underline: z.ZodBoolean;
|
|
722
734
|
code: z.ZodBoolean;
|
|
723
735
|
color: z.ZodEnum<{
|
|
736
|
+
default: "default";
|
|
724
737
|
blue: "blue";
|
|
725
738
|
blue_background: "blue_background";
|
|
726
739
|
brown: "brown";
|
|
727
740
|
brown_background: "brown_background";
|
|
728
|
-
default: "default";
|
|
729
741
|
gray: "gray";
|
|
730
742
|
gray_background: "gray_background";
|
|
731
743
|
green: "green";
|
|
@@ -764,6 +776,30 @@ export declare const dataSourceSchema: z.ZodObject<{
|
|
|
764
776
|
}, z.core.$strip>], "type">, z.ZodObject<{
|
|
765
777
|
type: z.ZodLiteral<"emoji">;
|
|
766
778
|
emoji: z.ZodString;
|
|
779
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
780
|
+
type: z.ZodLiteral<"icon">;
|
|
781
|
+
icon: z.ZodObject<{
|
|
782
|
+
name: z.ZodString;
|
|
783
|
+
color: z.ZodOptional<z.ZodEnum<{
|
|
784
|
+
blue: "blue";
|
|
785
|
+
brown: "brown";
|
|
786
|
+
gray: "gray";
|
|
787
|
+
green: "green";
|
|
788
|
+
orange: "orange";
|
|
789
|
+
pink: "pink";
|
|
790
|
+
purple: "purple";
|
|
791
|
+
red: "red";
|
|
792
|
+
yellow: "yellow";
|
|
793
|
+
lightgray: "lightgray";
|
|
794
|
+
}>>;
|
|
795
|
+
}, z.core.$strip>;
|
|
796
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
797
|
+
type: z.ZodLiteral<"custom_emoji">;
|
|
798
|
+
custom_emoji: z.ZodObject<{
|
|
799
|
+
id: z.ZodUUID;
|
|
800
|
+
name: z.ZodOptional<z.ZodString>;
|
|
801
|
+
url: z.ZodOptional<z.ZodURL>;
|
|
802
|
+
}, z.core.$strip>;
|
|
767
803
|
}, z.core.$strip>]>>;
|
|
768
804
|
cover: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
769
805
|
type: z.ZodLiteral<"file">;
|
|
@@ -787,4 +823,42 @@ export declare const dataSourceSchema: z.ZodObject<{
|
|
|
787
823
|
is_inline: z.ZodBoolean;
|
|
788
824
|
in_trash: z.ZodBoolean;
|
|
789
825
|
}, z.core.$strip>;
|
|
826
|
+
/**
|
|
827
|
+
* @category Databases & Data Sources
|
|
828
|
+
*/
|
|
790
829
|
export type NotionDataSource = z.infer<typeof dataSourceSchema>;
|
|
830
|
+
/**
|
|
831
|
+
* A single data source template reference. The List data source templates endpoint
|
|
832
|
+
* returns an array of these.
|
|
833
|
+
*
|
|
834
|
+
* Notion API reference:
|
|
835
|
+
* https://developers.notion.com/reference/list-data-source-templates
|
|
836
|
+
*
|
|
837
|
+
* @category Databases & Data Sources
|
|
838
|
+
*/
|
|
839
|
+
export declare const dataSourceTemplateSchema: z.ZodObject<{
|
|
840
|
+
id: z.ZodUUID;
|
|
841
|
+
name: z.ZodString;
|
|
842
|
+
is_default: z.ZodBoolean;
|
|
843
|
+
}, z.core.$strip>;
|
|
844
|
+
/**
|
|
845
|
+
* @category Databases & Data Sources
|
|
846
|
+
*/
|
|
847
|
+
export type DataSourceTemplate = z.infer<typeof dataSourceTemplateSchema>;
|
|
848
|
+
/** Response shape of the List data source templates endpoint.
|
|
849
|
+
*
|
|
850
|
+
* @category Databases & Data Sources
|
|
851
|
+
*/
|
|
852
|
+
export declare const dataSourceTemplateListSchema: z.ZodObject<{
|
|
853
|
+
templates: z.ZodArray<z.ZodObject<{
|
|
854
|
+
id: z.ZodUUID;
|
|
855
|
+
name: z.ZodString;
|
|
856
|
+
is_default: z.ZodBoolean;
|
|
857
|
+
}, z.core.$strip>>;
|
|
858
|
+
has_more: z.ZodBoolean;
|
|
859
|
+
next_cursor: z.ZodNullable<z.ZodString>;
|
|
860
|
+
}, z.core.$strip>;
|
|
861
|
+
/**
|
|
862
|
+
* @category Databases & Data Sources
|
|
863
|
+
*/
|
|
864
|
+
export type DataSourceTemplateList = z.infer<typeof dataSourceTemplateListSchema>;
|