@visus-io/notion-sdk-ts 3.0.2 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -6
- package/dist/api/asyncTasks.api.d.ts +70 -0
- package/dist/api/asyncTasks.api.js +68 -0
- package/dist/api/base.api.js +1 -0
- package/dist/api/blocks.api.d.ts +433 -73
- package/dist/api/blocks.api.js +39 -0
- package/dist/api/comments.api.d.ts +40 -5
- package/dist/api/comments.api.js +43 -1
- package/dist/api/customEmojis.api.d.ts +36 -0
- package/dist/api/customEmojis.api.js +36 -0
- package/dist/api/dataSources.api.d.ts +62 -11
- package/dist/api/dataSources.api.js +22 -0
- package/dist/api/databases.api.d.ts +40 -6
- package/dist/api/fileUploads.api.d.ts +1 -1
- package/dist/api/index.d.ts +3 -0
- package/dist/api/index.js +7 -1
- package/dist/api/pages.api.d.ts +142 -10
- package/dist/api/pages.api.js +64 -0
- package/dist/api/search.api.d.ts +10 -2
- package/dist/api/users.api.d.ts +1 -0
- package/dist/api/views.api.d.ts +284 -0
- package/dist/api/views.api.js +169 -0
- package/dist/client.js +3 -3
- package/dist/errors.d.ts +5 -1
- package/dist/errors.js +6 -0
- package/dist/helpers/block.helpers.d.ts +38 -1
- package/dist/helpers/block.helpers.js +45 -3
- package/dist/helpers/file.helpers.d.ts +36 -1
- package/dist/helpers/file.helpers.js +26 -4
- package/dist/helpers/filter.helpers.d.ts +6 -6
- package/dist/helpers/index.d.ts +3 -2
- package/dist/helpers/index.js +5 -1
- package/dist/helpers/pagination.helpers.d.ts +56 -0
- package/dist/helpers/pagination.helpers.js +86 -0
- package/dist/helpers/property.helpers.d.ts +29 -0
- package/dist/helpers/property.helpers.js +27 -0
- package/dist/helpers/webhook.helpers.d.ts +52 -0
- package/dist/helpers/webhook.helpers.js +81 -0
- package/dist/models/asyncTask.model.d.ts +59 -0
- package/dist/models/asyncTask.model.js +89 -0
- package/dist/models/block.model.js +4 -1
- package/dist/models/customEmoji.model.d.ts +28 -0
- package/dist/models/customEmoji.model.js +42 -0
- package/dist/models/dataSource.model.d.ts +3 -3
- package/dist/models/dataSource.model.js +1 -1
- package/dist/models/database.model.d.ts +7 -3
- package/dist/models/database.model.js +7 -1
- package/dist/models/index.d.ts +3 -0
- package/dist/models/index.js +7 -1
- package/dist/models/page.model.d.ts +2 -0
- package/dist/models/page.model.js +6 -0
- package/dist/models/view.model.d.ts +79 -0
- package/dist/models/view.model.js +119 -0
- package/dist/notion.d.ts +26 -7
- package/dist/notion.js +19 -3
- package/dist/schemas/asyncTask.schema.d.ts +42 -0
- package/dist/schemas/asyncTask.schema.js +83 -0
- package/dist/schemas/block.schema.d.ts +378 -72
- package/dist/schemas/block.schema.js +33 -7
- package/dist/schemas/comment.schema.d.ts +8 -3
- package/dist/schemas/customEmoji.schema.d.ts +13 -0
- package/dist/schemas/customEmoji.schema.js +48 -0
- package/dist/schemas/dataSource.schema.d.ts +68 -10
- package/dist/schemas/dataSource.schema.js +22 -4
- package/dist/schemas/database.schema.d.ts +38 -6
- package/dist/schemas/database.schema.js +3 -2
- package/dist/schemas/fileUpload.schema.d.ts +1 -1
- package/dist/schemas/icon.schema.d.ts +92 -0
- package/dist/schemas/icon.schema.js +88 -0
- package/dist/schemas/index.d.ts +6 -0
- package/dist/schemas/index.js +6 -0
- package/dist/schemas/meetingNotesQuery.schema.d.ts +4187 -0
- package/dist/schemas/meetingNotesQuery.schema.js +62 -0
- package/dist/schemas/page.schema.d.ts +46 -9
- package/dist/schemas/page.schema.js +4 -2
- package/dist/schemas/pageMarkdown.schema.d.ts +59 -0
- package/dist/schemas/pageMarkdown.schema.js +65 -0
- package/dist/schemas/pageProperties.schema.d.ts +30 -18
- package/dist/schemas/pageProperties.schema.js +2 -3
- package/dist/schemas/pagination.schema.d.ts +30 -3
- package/dist/schemas/pagination.schema.js +18 -1
- package/dist/schemas/parent.schema.d.ts +10 -1
- package/dist/schemas/parent.schema.js +9 -3
- package/dist/schemas/propertyObjects.schema.d.ts +12 -12
- package/dist/schemas/richText.schema.d.ts +8 -6
- package/dist/schemas/richText.schema.js +1 -1
- package/dist/schemas/user.schema.d.ts +2 -0
- package/dist/schemas/user.schema.js +2 -1
- package/dist/schemas/view.schema.d.ts +1077 -0
- package/dist/schemas/view.schema.js +115 -0
- package/package.json +2 -2
|
@@ -14,10 +14,10 @@ export declare const fileUploadSchema: z.ZodObject<{
|
|
|
14
14
|
created_time: z.ZodUnion<readonly [z.ZodISODateTime, z.ZodISODate]>;
|
|
15
15
|
expiry_time: z.ZodNullable<z.ZodUnion<readonly [z.ZodISODateTime, z.ZodISODate]>>;
|
|
16
16
|
status: z.ZodEnum<{
|
|
17
|
+
failed: "failed";
|
|
17
18
|
pending: "pending";
|
|
18
19
|
uploaded: "uploaded";
|
|
19
20
|
expired: "expired";
|
|
20
|
-
failed: "failed";
|
|
21
21
|
}>;
|
|
22
22
|
filename: z.ZodString;
|
|
23
23
|
content_type: z.ZodNullable<z.ZodString>;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import * as z from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Notion native icon and custom emoji icon object schemas.
|
|
4
|
+
*
|
|
5
|
+
* Native icons reference one of Notion's built-in icon-picker icons by name.
|
|
6
|
+
* Custom emoji icons reference a workspace-managed custom emoji by id.
|
|
7
|
+
* Combined with `emojiSchema` and `fileSchema`, these make up the full set
|
|
8
|
+
* of icon object variants usable on pages, databases, data sources, and
|
|
9
|
+
* callout blocks.
|
|
10
|
+
*
|
|
11
|
+
* Notion API reference:
|
|
12
|
+
* https://developers.notion.com/reference/emoji-object
|
|
13
|
+
*/
|
|
14
|
+
/** Colors available for native (icon-picker) icons. */
|
|
15
|
+
export declare const NATIVE_ICON_COLORS: readonly ["gray", "lightgray", "brown", "yellow", "orange", "green", "blue", "purple", "pink", "red"];
|
|
16
|
+
export type NativeIconColor = (typeof NATIVE_ICON_COLORS)[number];
|
|
17
|
+
/** Native (icon-picker) icon. */
|
|
18
|
+
export declare const nativeIconSchema: z.ZodObject<{
|
|
19
|
+
type: z.ZodLiteral<"icon">;
|
|
20
|
+
icon: z.ZodObject<{
|
|
21
|
+
name: z.ZodString;
|
|
22
|
+
color: z.ZodOptional<z.ZodEnum<{
|
|
23
|
+
blue: "blue";
|
|
24
|
+
brown: "brown";
|
|
25
|
+
gray: "gray";
|
|
26
|
+
green: "green";
|
|
27
|
+
orange: "orange";
|
|
28
|
+
pink: "pink";
|
|
29
|
+
purple: "purple";
|
|
30
|
+
red: "red";
|
|
31
|
+
yellow: "yellow";
|
|
32
|
+
lightgray: "lightgray";
|
|
33
|
+
}>>;
|
|
34
|
+
}, z.core.$strip>;
|
|
35
|
+
}, z.core.$strip>;
|
|
36
|
+
export type NativeIcon = z.infer<typeof nativeIconSchema>;
|
|
37
|
+
/** Custom emoji icon. */
|
|
38
|
+
export declare const customEmojiIconSchema: z.ZodObject<{
|
|
39
|
+
type: z.ZodLiteral<"custom_emoji">;
|
|
40
|
+
custom_emoji: z.ZodObject<{
|
|
41
|
+
id: z.ZodUUID;
|
|
42
|
+
name: z.ZodOptional<z.ZodString>;
|
|
43
|
+
url: z.ZodOptional<z.ZodURL>;
|
|
44
|
+
}, z.core.$strip>;
|
|
45
|
+
}, z.core.$strip>;
|
|
46
|
+
export type CustomEmojiIcon = z.infer<typeof customEmojiIconSchema>;
|
|
47
|
+
/** Shared icon schema covering all icon object variants. */
|
|
48
|
+
export declare const iconSchema: z.ZodUnion<readonly [z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
49
|
+
type: z.ZodLiteral<"file">;
|
|
50
|
+
file: z.ZodObject<{
|
|
51
|
+
url: z.ZodURL;
|
|
52
|
+
expiry_time: z.ZodUnion<readonly [z.ZodISODateTime, z.ZodISODate]>;
|
|
53
|
+
}, z.core.$strip>;
|
|
54
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
55
|
+
type: z.ZodLiteral<"file_upload">;
|
|
56
|
+
file_upload: z.ZodObject<{
|
|
57
|
+
id: z.ZodUUID;
|
|
58
|
+
}, z.core.$strip>;
|
|
59
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
60
|
+
type: z.ZodLiteral<"external">;
|
|
61
|
+
external: z.ZodObject<{
|
|
62
|
+
url: z.ZodURL;
|
|
63
|
+
}, z.core.$strip>;
|
|
64
|
+
}, z.core.$strip>], "type">, z.ZodObject<{
|
|
65
|
+
type: z.ZodLiteral<"emoji">;
|
|
66
|
+
emoji: z.ZodString;
|
|
67
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
68
|
+
type: z.ZodLiteral<"icon">;
|
|
69
|
+
icon: z.ZodObject<{
|
|
70
|
+
name: z.ZodString;
|
|
71
|
+
color: z.ZodOptional<z.ZodEnum<{
|
|
72
|
+
blue: "blue";
|
|
73
|
+
brown: "brown";
|
|
74
|
+
gray: "gray";
|
|
75
|
+
green: "green";
|
|
76
|
+
orange: "orange";
|
|
77
|
+
pink: "pink";
|
|
78
|
+
purple: "purple";
|
|
79
|
+
red: "red";
|
|
80
|
+
yellow: "yellow";
|
|
81
|
+
lightgray: "lightgray";
|
|
82
|
+
}>>;
|
|
83
|
+
}, z.core.$strip>;
|
|
84
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
85
|
+
type: z.ZodLiteral<"custom_emoji">;
|
|
86
|
+
custom_emoji: z.ZodObject<{
|
|
87
|
+
id: z.ZodUUID;
|
|
88
|
+
name: z.ZodOptional<z.ZodString>;
|
|
89
|
+
url: z.ZodOptional<z.ZodURL>;
|
|
90
|
+
}, z.core.$strip>;
|
|
91
|
+
}, z.core.$strip>]>;
|
|
92
|
+
export type NotionIcon = z.infer<typeof iconSchema>;
|
|
@@ -0,0 +1,88 @@
|
|
|
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.iconSchema = exports.customEmojiIconSchema = exports.nativeIconSchema = exports.NATIVE_ICON_COLORS = void 0;
|
|
37
|
+
const z = __importStar(require("zod"));
|
|
38
|
+
const emoji_schema_1 = require("./emoji.schema");
|
|
39
|
+
const file_schema_1 = require("./file.schema");
|
|
40
|
+
/**
|
|
41
|
+
* Notion native icon and custom emoji icon object schemas.
|
|
42
|
+
*
|
|
43
|
+
* Native icons reference one of Notion's built-in icon-picker icons by name.
|
|
44
|
+
* Custom emoji icons reference a workspace-managed custom emoji by id.
|
|
45
|
+
* Combined with `emojiSchema` and `fileSchema`, these make up the full set
|
|
46
|
+
* of icon object variants usable on pages, databases, data sources, and
|
|
47
|
+
* callout blocks.
|
|
48
|
+
*
|
|
49
|
+
* Notion API reference:
|
|
50
|
+
* https://developers.notion.com/reference/emoji-object
|
|
51
|
+
*/
|
|
52
|
+
/** Colors available for native (icon-picker) icons. */
|
|
53
|
+
exports.NATIVE_ICON_COLORS = [
|
|
54
|
+
'gray',
|
|
55
|
+
'lightgray',
|
|
56
|
+
'brown',
|
|
57
|
+
'yellow',
|
|
58
|
+
'orange',
|
|
59
|
+
'green',
|
|
60
|
+
'blue',
|
|
61
|
+
'purple',
|
|
62
|
+
'pink',
|
|
63
|
+
'red',
|
|
64
|
+
];
|
|
65
|
+
/** Native (icon-picker) icon. */
|
|
66
|
+
exports.nativeIconSchema = z.object({
|
|
67
|
+
type: z.literal('icon'),
|
|
68
|
+
icon: z.object({
|
|
69
|
+
name: z.string().trim(),
|
|
70
|
+
color: z.enum(exports.NATIVE_ICON_COLORS).optional(),
|
|
71
|
+
}),
|
|
72
|
+
});
|
|
73
|
+
/** Custom emoji icon. */
|
|
74
|
+
exports.customEmojiIconSchema = z.object({
|
|
75
|
+
type: z.literal('custom_emoji'),
|
|
76
|
+
custom_emoji: z.object({
|
|
77
|
+
id: z.uuid(),
|
|
78
|
+
name: z.string().trim().optional(),
|
|
79
|
+
url: z.url().optional(),
|
|
80
|
+
}),
|
|
81
|
+
});
|
|
82
|
+
/** Shared icon schema covering all icon object variants. */
|
|
83
|
+
exports.iconSchema = z.union([
|
|
84
|
+
file_schema_1.fileSchema,
|
|
85
|
+
emoji_schema_1.emojiSchema,
|
|
86
|
+
exports.nativeIconSchema,
|
|
87
|
+
exports.customEmojiIconSchema,
|
|
88
|
+
]);
|
package/dist/schemas/index.d.ts
CHANGED
|
@@ -1,13 +1,18 @@
|
|
|
1
|
+
export * from './asyncTask.schema';
|
|
1
2
|
export * from './block.schema';
|
|
2
3
|
export * from './codeLanguages';
|
|
3
4
|
export * from './colors';
|
|
4
5
|
export * from './comment.schema';
|
|
6
|
+
export * from './customEmoji.schema';
|
|
5
7
|
export * from './database.schema';
|
|
6
8
|
export * from './dataSource.schema';
|
|
7
9
|
export * from './emoji.schema';
|
|
8
10
|
export * from './file.schema';
|
|
9
11
|
export * from './fileUpload.schema';
|
|
12
|
+
export * from './icon.schema';
|
|
13
|
+
export * from './meetingNotesQuery.schema';
|
|
10
14
|
export * from './page.schema';
|
|
15
|
+
export * from './pageMarkdown.schema';
|
|
11
16
|
export * from './pageProperties.schema';
|
|
12
17
|
export * from './propertyObjects.schema';
|
|
13
18
|
export * from './pagination.schema';
|
|
@@ -15,3 +20,4 @@ export * from './parent.schema';
|
|
|
15
20
|
export * from './richText.schema';
|
|
16
21
|
export * from './shared.schema';
|
|
17
22
|
export * from './user.schema';
|
|
23
|
+
export * from './view.schema';
|
package/dist/schemas/index.js
CHANGED
|
@@ -14,16 +14,21 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./asyncTask.schema"), exports);
|
|
17
18
|
__exportStar(require("./block.schema"), exports);
|
|
18
19
|
__exportStar(require("./codeLanguages"), exports);
|
|
19
20
|
__exportStar(require("./colors"), exports);
|
|
20
21
|
__exportStar(require("./comment.schema"), exports);
|
|
22
|
+
__exportStar(require("./customEmoji.schema"), exports);
|
|
21
23
|
__exportStar(require("./database.schema"), exports);
|
|
22
24
|
__exportStar(require("./dataSource.schema"), exports);
|
|
23
25
|
__exportStar(require("./emoji.schema"), exports);
|
|
24
26
|
__exportStar(require("./file.schema"), exports);
|
|
25
27
|
__exportStar(require("./fileUpload.schema"), exports);
|
|
28
|
+
__exportStar(require("./icon.schema"), exports);
|
|
29
|
+
__exportStar(require("./meetingNotesQuery.schema"), exports);
|
|
26
30
|
__exportStar(require("./page.schema"), exports);
|
|
31
|
+
__exportStar(require("./pageMarkdown.schema"), exports);
|
|
27
32
|
__exportStar(require("./pageProperties.schema"), exports);
|
|
28
33
|
__exportStar(require("./propertyObjects.schema"), exports);
|
|
29
34
|
__exportStar(require("./pagination.schema"), exports);
|
|
@@ -31,3 +36,4 @@ __exportStar(require("./parent.schema"), exports);
|
|
|
31
36
|
__exportStar(require("./richText.schema"), exports);
|
|
32
37
|
__exportStar(require("./shared.schema"), exports);
|
|
33
38
|
__exportStar(require("./user.schema"), exports);
|
|
39
|
+
__exportStar(require("./view.schema"), exports);
|