@visus-io/notion-sdk-ts 2.0.1 → 3.0.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 +66 -23
- package/dist/api/base.api.d.ts +1 -1
- package/dist/api/blocks.api.d.ts +266 -87
- package/dist/api/comments.api.d.ts +7 -7
- package/dist/api/dataSources.api.d.ts +28 -31
- package/dist/api/dataSources.api.js +18 -19
- package/dist/api/databases.api.d.ts +27 -22
- package/dist/api/databases.api.js +18 -8
- package/dist/api/fileUploads.api.d.ts +2 -2
- package/dist/api/pages.api.d.ts +43 -38
- package/dist/api/pages.api.js +18 -8
- package/dist/api/users.api.d.ts +1 -1
- package/dist/client.d.ts +5 -3
- package/dist/client.js +7 -3
- package/dist/helpers/block.helpers.d.ts +4 -0
- package/dist/helpers/block.helpers.js +11 -0
- package/dist/helpers/parent.helpers.d.ts +2 -2
- package/dist/helpers/parent.helpers.js +2 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3 -1
- package/dist/models/base.model.d.ts +2 -2
- package/dist/models/block.model.d.ts +0 -1
- package/dist/models/block.model.js +0 -3
- package/dist/models/dataSource.model.d.ts +0 -4
- package/dist/models/dataSource.model.js +0 -6
- package/dist/models/database.model.d.ts +0 -4
- package/dist/models/database.model.js +0 -6
- package/dist/models/page.model.d.ts +0 -1
- package/dist/models/page.model.js +0 -3
- package/dist/schemas/block.schema.d.ts +275 -82
- package/dist/schemas/block.schema.js +165 -82
- package/dist/schemas/comment.schema.d.ts +9 -9
- package/dist/schemas/comment.schema.js +54 -20
- package/dist/schemas/dataSource.schema.d.ts +13 -14
- package/dist/schemas/dataSource.schema.js +46 -14
- package/dist/schemas/database.schema.d.ts +13 -14
- package/dist/schemas/database.schema.js +50 -17
- package/dist/schemas/emoji.schema.d.ts +1 -1
- package/dist/schemas/emoji.schema.js +37 -4
- package/dist/schemas/file.schema.d.ts +3 -3
- package/dist/schemas/file.schema.js +49 -15
- package/dist/schemas/fileUpload.schema.d.ts +3 -3
- package/dist/schemas/fileUpload.schema.js +47 -13
- package/dist/schemas/index.d.ts +1 -0
- package/dist/schemas/index.js +1 -0
- package/dist/schemas/page.schema.d.ts +30 -31
- package/dist/schemas/page.schema.js +46 -13
- package/dist/schemas/pageProperties.schema.d.ts +47 -47
- package/dist/schemas/pageProperties.schema.js +162 -128
- package/dist/schemas/pagination.schema.d.ts +1 -1
- package/dist/schemas/pagination.schema.js +40 -7
- package/dist/schemas/parent.schema.d.ts +1 -1
- package/dist/schemas/parent.schema.js +51 -18
- package/dist/schemas/propertyObjects.schema.d.ts +1 -1
- package/dist/schemas/propertyObjects.schema.js +194 -161
- package/dist/schemas/richText.schema.d.ts +7 -7
- package/dist/schemas/richText.schema.js +95 -56
- package/dist/schemas/shared.schema.d.ts +15 -0
- package/dist/schemas/shared.schema.js +54 -0
- package/dist/schemas/user.schema.d.ts +3 -3
- package/dist/schemas/user.schema.js +63 -30
- package/package.json +7 -5
package/dist/api/pages.api.d.ts
CHANGED
|
@@ -68,8 +68,6 @@ export interface UpdatePageOptions {
|
|
|
68
68
|
cover?: unknown;
|
|
69
69
|
/** Lock or unlock the page from editing */
|
|
70
70
|
is_locked?: boolean;
|
|
71
|
-
/** Archive or restore the page */
|
|
72
|
-
archived?: boolean;
|
|
73
71
|
/** Move to trash or restore from trash */
|
|
74
72
|
in_trash?: boolean;
|
|
75
73
|
/** Template to apply to the page */
|
|
@@ -91,7 +89,7 @@ export declare class PagesAPI extends BaseAPI<NotionPage, Page> {
|
|
|
91
89
|
schema: import("zod").ZodObject<{
|
|
92
90
|
object: import("zod").ZodLiteral<"page">;
|
|
93
91
|
id: import("zod").ZodUUID;
|
|
94
|
-
created_time: import("zod").ZodISODateTime
|
|
92
|
+
created_time: import("zod").ZodUnion<readonly [import("zod").ZodISODateTime, import("zod").ZodISODate]>;
|
|
95
93
|
created_by: import("zod").ZodUnion<readonly [import("zod").ZodObject<{
|
|
96
94
|
object: import("zod").ZodLiteral<"user">;
|
|
97
95
|
id: import("zod").ZodUUID;
|
|
@@ -117,14 +115,14 @@ export declare class PagesAPI extends BaseAPI<NotionPage, Page> {
|
|
|
117
115
|
workspace_name: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
118
116
|
workspace_id: import("zod").ZodOptional<import("zod").ZodString>;
|
|
119
117
|
workspace_limits: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
120
|
-
max_file_upload_size_in_bytes: import("zod").
|
|
118
|
+
max_file_upload_size_in_bytes: import("zod").ZodInt;
|
|
121
119
|
}, import("zod/v4/core").$strip>>;
|
|
122
120
|
}, import("zod/v4/core").$strip>;
|
|
123
121
|
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
124
122
|
object: import("zod").ZodLiteral<"user">;
|
|
125
123
|
id: import("zod").ZodUUID;
|
|
126
124
|
}, import("zod/v4/core").$strip>]>;
|
|
127
|
-
last_edited_time: import("zod").ZodISODateTime
|
|
125
|
+
last_edited_time: import("zod").ZodUnion<readonly [import("zod").ZodISODateTime, import("zod").ZodISODate]>;
|
|
128
126
|
last_edited_by: import("zod").ZodUnion<readonly [import("zod").ZodObject<{
|
|
129
127
|
object: import("zod").ZodLiteral<"user">;
|
|
130
128
|
id: import("zod").ZodUUID;
|
|
@@ -150,20 +148,19 @@ export declare class PagesAPI extends BaseAPI<NotionPage, Page> {
|
|
|
150
148
|
workspace_name: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
151
149
|
workspace_id: import("zod").ZodOptional<import("zod").ZodString>;
|
|
152
150
|
workspace_limits: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
153
|
-
max_file_upload_size_in_bytes: import("zod").
|
|
151
|
+
max_file_upload_size_in_bytes: import("zod").ZodInt;
|
|
154
152
|
}, import("zod/v4/core").$strip>>;
|
|
155
153
|
}, import("zod/v4/core").$strip>;
|
|
156
154
|
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
157
155
|
object: import("zod").ZodLiteral<"user">;
|
|
158
156
|
id: import("zod").ZodUUID;
|
|
159
157
|
}, import("zod/v4/core").$strip>]>;
|
|
160
|
-
archived: import("zod").ZodBoolean;
|
|
161
158
|
in_trash: import("zod").ZodBoolean;
|
|
162
159
|
icon: import("zod").ZodNullable<import("zod").ZodUnion<readonly [import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
|
|
163
160
|
type: import("zod").ZodLiteral<"file">;
|
|
164
161
|
file: import("zod").ZodObject<{
|
|
165
162
|
url: import("zod").ZodURL;
|
|
166
|
-
expiry_time: import("zod").ZodISODateTime
|
|
163
|
+
expiry_time: import("zod").ZodUnion<readonly [import("zod").ZodISODateTime, import("zod").ZodISODate]>;
|
|
167
164
|
}, import("zod/v4/core").$strip>;
|
|
168
165
|
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
169
166
|
type: import("zod").ZodLiteral<"file_upload">;
|
|
@@ -183,7 +180,7 @@ export declare class PagesAPI extends BaseAPI<NotionPage, Page> {
|
|
|
183
180
|
type: import("zod").ZodLiteral<"file">;
|
|
184
181
|
file: import("zod").ZodObject<{
|
|
185
182
|
url: import("zod").ZodURL;
|
|
186
|
-
expiry_time: import("zod").ZodISODateTime
|
|
183
|
+
expiry_time: import("zod").ZodUnion<readonly [import("zod").ZodISODateTime, import("zod").ZodISODate]>;
|
|
187
184
|
}, import("zod/v4/core").$strip>;
|
|
188
185
|
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
189
186
|
type: import("zod").ZodLiteral<"file_upload">;
|
|
@@ -228,7 +225,7 @@ export declare class PagesAPI extends BaseAPI<NotionPage, Page> {
|
|
|
228
225
|
workspace_name: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
229
226
|
workspace_id: import("zod").ZodOptional<import("zod").ZodString>;
|
|
230
227
|
workspace_limits: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
231
|
-
max_file_upload_size_in_bytes: import("zod").
|
|
228
|
+
max_file_upload_size_in_bytes: import("zod").ZodInt;
|
|
232
229
|
}, import("zod/v4/core").$strip>>;
|
|
233
230
|
}, import("zod/v4/core").$strip>;
|
|
234
231
|
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
@@ -238,13 +235,13 @@ export declare class PagesAPI extends BaseAPI<NotionPage, Page> {
|
|
|
238
235
|
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
239
236
|
id: import("zod").ZodString;
|
|
240
237
|
type: import("zod").ZodLiteral<"created_time">;
|
|
241
|
-
created_time: import("zod").ZodISODateTime
|
|
238
|
+
created_time: import("zod").ZodUnion<readonly [import("zod").ZodISODateTime, import("zod").ZodISODate]>;
|
|
242
239
|
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
243
240
|
id: import("zod").ZodString;
|
|
244
241
|
type: import("zod").ZodLiteral<"date">;
|
|
245
242
|
date: import("zod").ZodNullable<import("zod").ZodObject<{
|
|
246
|
-
start: import("zod").
|
|
247
|
-
end: import("zod").ZodNullable<import("zod").
|
|
243
|
+
start: import("zod").ZodUnion<readonly [import("zod").ZodISODateTime, import("zod").ZodISODate]>;
|
|
244
|
+
end: import("zod").ZodNullable<import("zod").ZodUnion<readonly [import("zod").ZodISODateTime, import("zod").ZodISODate]>>;
|
|
248
245
|
time_zone: import("zod").ZodNullable<import("zod").ZodString>;
|
|
249
246
|
}, import("zod/v4/core").$strip>>;
|
|
250
247
|
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
@@ -266,7 +263,7 @@ export declare class PagesAPI extends BaseAPI<NotionPage, Page> {
|
|
|
266
263
|
}, import("zod/v4/core").$strip>>;
|
|
267
264
|
file: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
268
265
|
url: import("zod").ZodURL;
|
|
269
|
-
expiry_time: import("zod").ZodISODateTime
|
|
266
|
+
expiry_time: import("zod").ZodUnion<readonly [import("zod").ZodISODateTime, import("zod").ZodISODate]>;
|
|
270
267
|
}, import("zod/v4/core").$strip>>;
|
|
271
268
|
file_upload: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
272
269
|
id: import("zod").ZodUUID;
|
|
@@ -281,8 +278,8 @@ export declare class PagesAPI extends BaseAPI<NotionPage, Page> {
|
|
|
281
278
|
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
282
279
|
type: import("zod").ZodLiteral<"date">;
|
|
283
280
|
date: import("zod").ZodObject<{
|
|
284
|
-
start: import("zod").
|
|
285
|
-
end: import("zod").ZodNullable<import("zod").
|
|
281
|
+
start: import("zod").ZodUnion<readonly [import("zod").ZodISODateTime, import("zod").ZodISODate]>;
|
|
282
|
+
end: import("zod").ZodNullable<import("zod").ZodUnion<readonly [import("zod").ZodISODateTime, import("zod").ZodISODate]>>;
|
|
286
283
|
time_zone: import("zod").ZodNullable<import("zod").ZodString>;
|
|
287
284
|
}, import("zod/v4/core").$strip>;
|
|
288
285
|
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
@@ -320,7 +317,7 @@ export declare class PagesAPI extends BaseAPI<NotionPage, Page> {
|
|
|
320
317
|
workspace_name: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
321
318
|
workspace_id: import("zod").ZodOptional<import("zod").ZodString>;
|
|
322
319
|
workspace_limits: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
323
|
-
max_file_upload_size_in_bytes: import("zod").
|
|
320
|
+
max_file_upload_size_in_bytes: import("zod").ZodInt;
|
|
324
321
|
}, import("zod/v4/core").$strip>>;
|
|
325
322
|
}, import("zod/v4/core").$strip>;
|
|
326
323
|
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
@@ -330,7 +327,7 @@ export declare class PagesAPI extends BaseAPI<NotionPage, Page> {
|
|
|
330
327
|
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
331
328
|
id: import("zod").ZodString;
|
|
332
329
|
type: import("zod").ZodLiteral<"last_edited_time">;
|
|
333
|
-
last_edited_time: import("zod").ZodISODateTime
|
|
330
|
+
last_edited_time: import("zod").ZodUnion<readonly [import("zod").ZodISODateTime, import("zod").ZodISODate]>;
|
|
334
331
|
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
335
332
|
id: import("zod").ZodString;
|
|
336
333
|
type: import("zod").ZodLiteral<"multi_select">;
|
|
@@ -391,7 +388,7 @@ export declare class PagesAPI extends BaseAPI<NotionPage, Page> {
|
|
|
391
388
|
workspace_name: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
392
389
|
workspace_id: import("zod").ZodOptional<import("zod").ZodString>;
|
|
393
390
|
workspace_limits: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
394
|
-
max_file_upload_size_in_bytes: import("zod").
|
|
391
|
+
max_file_upload_size_in_bytes: import("zod").ZodInt;
|
|
395
392
|
}, import("zod/v4/core").$strip>>;
|
|
396
393
|
}, import("zod/v4/core").$strip>;
|
|
397
394
|
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
@@ -460,8 +457,8 @@ export declare class PagesAPI extends BaseAPI<NotionPage, Page> {
|
|
|
460
457
|
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
461
458
|
type: import("zod").ZodLiteral<"date">;
|
|
462
459
|
date: import("zod").ZodObject<{
|
|
463
|
-
start: import("zod").
|
|
464
|
-
end: import("zod").ZodNullable<import("zod").
|
|
460
|
+
start: import("zod").ZodUnion<readonly [import("zod").ZodISODateTime, import("zod").ZodISODate]>;
|
|
461
|
+
end: import("zod").ZodNullable<import("zod").ZodUnion<readonly [import("zod").ZodISODateTime, import("zod").ZodISODate]>>;
|
|
465
462
|
time_zone: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
466
463
|
}, import("zod/v4/core").$strip>;
|
|
467
464
|
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
@@ -513,7 +510,7 @@ export declare class PagesAPI extends BaseAPI<NotionPage, Page> {
|
|
|
513
510
|
workspace_name: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
514
511
|
workspace_id: import("zod").ZodOptional<import("zod").ZodString>;
|
|
515
512
|
workspace_limits: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
516
|
-
max_file_upload_size_in_bytes: import("zod").
|
|
513
|
+
max_file_upload_size_in_bytes: import("zod").ZodInt;
|
|
517
514
|
}, import("zod/v4/core").$strip>>;
|
|
518
515
|
}, import("zod/v4/core").$strip>;
|
|
519
516
|
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
@@ -626,11 +623,11 @@ export declare class PagesAPI extends BaseAPI<NotionPage, Page> {
|
|
|
626
623
|
}>;
|
|
627
624
|
number: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodNumber>>;
|
|
628
625
|
date: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodObject<{
|
|
629
|
-
start: import("zod").
|
|
630
|
-
end: import("zod").ZodNullable<import("zod").
|
|
626
|
+
start: import("zod").ZodUnion<readonly [import("zod").ZodISODateTime, import("zod").ZodISODate]>;
|
|
627
|
+
end: import("zod").ZodNullable<import("zod").ZodUnion<readonly [import("zod").ZodISODateTime, import("zod").ZodISODate]>>;
|
|
631
628
|
time_zone: import("zod").ZodNullable<import("zod").ZodString>;
|
|
632
629
|
}, import("zod/v4/core").$strip>>>;
|
|
633
|
-
array: import("zod").ZodOptional<import("zod").ZodArray<import("zod").
|
|
630
|
+
array: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodUnknown>>;
|
|
634
631
|
}, import("zod/v4/core").$strip>;
|
|
635
632
|
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
636
633
|
id: import("zod").ZodString;
|
|
@@ -739,8 +736,8 @@ export declare class PagesAPI extends BaseAPI<NotionPage, Page> {
|
|
|
739
736
|
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
740
737
|
type: import("zod").ZodLiteral<"date">;
|
|
741
738
|
date: import("zod").ZodObject<{
|
|
742
|
-
start: import("zod").
|
|
743
|
-
end: import("zod").ZodNullable<import("zod").
|
|
739
|
+
start: import("zod").ZodUnion<readonly [import("zod").ZodISODateTime, import("zod").ZodISODate]>;
|
|
740
|
+
end: import("zod").ZodNullable<import("zod").ZodUnion<readonly [import("zod").ZodISODateTime, import("zod").ZodISODate]>>;
|
|
744
741
|
time_zone: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
745
742
|
}, import("zod/v4/core").$strip>;
|
|
746
743
|
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
@@ -792,7 +789,7 @@ export declare class PagesAPI extends BaseAPI<NotionPage, Page> {
|
|
|
792
789
|
workspace_name: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
793
790
|
workspace_id: import("zod").ZodOptional<import("zod").ZodString>;
|
|
794
791
|
workspace_limits: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
795
|
-
max_file_upload_size_in_bytes: import("zod").
|
|
792
|
+
max_file_upload_size_in_bytes: import("zod").ZodInt;
|
|
796
793
|
}, import("zod/v4/core").$strip>>;
|
|
797
794
|
}, import("zod/v4/core").$strip>;
|
|
798
795
|
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
@@ -874,7 +871,7 @@ export declare class PagesAPI extends BaseAPI<NotionPage, Page> {
|
|
|
874
871
|
id: import("zod").ZodString;
|
|
875
872
|
type: import("zod").ZodLiteral<"unique_id">;
|
|
876
873
|
unique_id: import("zod").ZodObject<{
|
|
877
|
-
number: import("zod").
|
|
874
|
+
number: import("zod").ZodInt;
|
|
878
875
|
prefix: import("zod").ZodNullable<import("zod").ZodString>;
|
|
879
876
|
}, import("zod/v4/core").$strip>;
|
|
880
877
|
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
@@ -910,7 +907,7 @@ export declare class PagesAPI extends BaseAPI<NotionPage, Page> {
|
|
|
910
907
|
workspace_name: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
911
908
|
workspace_id: import("zod").ZodOptional<import("zod").ZodString>;
|
|
912
909
|
workspace_limits: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
913
|
-
max_file_upload_size_in_bytes: import("zod").
|
|
910
|
+
max_file_upload_size_in_bytes: import("zod").ZodInt;
|
|
914
911
|
}, import("zod/v4/core").$strip>>;
|
|
915
912
|
}, import("zod/v4/core").$strip>;
|
|
916
913
|
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
@@ -918,8 +915,8 @@ export declare class PagesAPI extends BaseAPI<NotionPage, Page> {
|
|
|
918
915
|
id: import("zod").ZodUUID;
|
|
919
916
|
}, import("zod/v4/core").$strip>]>>;
|
|
920
917
|
date: import("zod").ZodNullable<import("zod").ZodObject<{
|
|
921
|
-
start: import("zod").
|
|
922
|
-
end: import("zod").ZodNullable<import("zod").
|
|
918
|
+
start: import("zod").ZodUnion<readonly [import("zod").ZodISODateTime, import("zod").ZodISODate]>;
|
|
919
|
+
end: import("zod").ZodNullable<import("zod").ZodUnion<readonly [import("zod").ZodISODateTime, import("zod").ZodISODate]>>;
|
|
923
920
|
time_zone: import("zod").ZodNullable<import("zod").ZodString>;
|
|
924
921
|
}, import("zod/v4/core").$strip>>;
|
|
925
922
|
}, import("zod/v4/core").$strip>>;
|
|
@@ -968,7 +965,7 @@ export declare class PagesAPI extends BaseAPI<NotionPage, Page> {
|
|
|
968
965
|
*/
|
|
969
966
|
create(options: CreatePageOptions): Promise<Page>;
|
|
970
967
|
/**
|
|
971
|
-
* Update a page's properties, icon, cover, or
|
|
968
|
+
* Update a page's properties, icon, cover, or trash status.
|
|
972
969
|
*
|
|
973
970
|
* @param pageId - The ID of the page to update
|
|
974
971
|
* @param options - Options for updating the page
|
|
@@ -978,17 +975,25 @@ export declare class PagesAPI extends BaseAPI<NotionPage, Page> {
|
|
|
978
975
|
*/
|
|
979
976
|
update(pageId: string, options: UpdatePageOptions): Promise<Page>;
|
|
980
977
|
/**
|
|
981
|
-
*
|
|
978
|
+
* Move a page to trash (convenience method).
|
|
982
979
|
*
|
|
983
|
-
* @param pageId - The ID of the page to
|
|
984
|
-
* @returns The
|
|
980
|
+
* @param pageId - The ID of the page to trash
|
|
981
|
+
* @returns The trashed page wrapped in a Page model
|
|
985
982
|
*/
|
|
986
|
-
|
|
983
|
+
trash(pageId: string): Promise<Page>;
|
|
987
984
|
/**
|
|
988
|
-
* Restore
|
|
985
|
+
* Restore a trashed page (convenience method).
|
|
989
986
|
*
|
|
990
987
|
* @param pageId - The ID of the page to restore
|
|
991
988
|
* @returns The restored page wrapped in a Page model
|
|
992
989
|
*/
|
|
993
990
|
restore(pageId: string): Promise<Page>;
|
|
991
|
+
/**
|
|
992
|
+
* Move a page to trash (convenience method).
|
|
993
|
+
*
|
|
994
|
+
* @deprecated Use {@link trash} instead.
|
|
995
|
+
* @param pageId - The ID of the page to trash
|
|
996
|
+
* @returns The trashed page wrapped in a Page model
|
|
997
|
+
*/
|
|
998
|
+
archive(pageId: string): Promise<Page>;
|
|
994
999
|
}
|
package/dist/api/pages.api.js
CHANGED
|
@@ -48,7 +48,7 @@ class PagesAPI extends base_api_1.BaseAPI {
|
|
|
48
48
|
return this.createResource('/pages', options);
|
|
49
49
|
}
|
|
50
50
|
/**
|
|
51
|
-
* Update a page's properties, icon, cover, or
|
|
51
|
+
* Update a page's properties, icon, cover, or trash status.
|
|
52
52
|
*
|
|
53
53
|
* @param pageId - The ID of the page to update
|
|
54
54
|
* @param options - Options for updating the page
|
|
@@ -60,22 +60,32 @@ class PagesAPI extends base_api_1.BaseAPI {
|
|
|
60
60
|
return this.updateResource(`/pages/${pageId}`, options);
|
|
61
61
|
}
|
|
62
62
|
/**
|
|
63
|
-
*
|
|
63
|
+
* Move a page to trash (convenience method).
|
|
64
64
|
*
|
|
65
|
-
* @param pageId - The ID of the page to
|
|
66
|
-
* @returns The
|
|
65
|
+
* @param pageId - The ID of the page to trash
|
|
66
|
+
* @returns The trashed page wrapped in a Page model
|
|
67
67
|
*/
|
|
68
|
-
async
|
|
69
|
-
return this.update(pageId, {
|
|
68
|
+
async trash(pageId) {
|
|
69
|
+
return this.update(pageId, { in_trash: true });
|
|
70
70
|
}
|
|
71
71
|
/**
|
|
72
|
-
* Restore
|
|
72
|
+
* Restore a trashed page (convenience method).
|
|
73
73
|
*
|
|
74
74
|
* @param pageId - The ID of the page to restore
|
|
75
75
|
* @returns The restored page wrapped in a Page model
|
|
76
76
|
*/
|
|
77
77
|
async restore(pageId) {
|
|
78
|
-
return this.update(pageId, {
|
|
78
|
+
return this.update(pageId, { in_trash: false });
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Move a page to trash (convenience method).
|
|
82
|
+
*
|
|
83
|
+
* @deprecated Use {@link trash} instead.
|
|
84
|
+
* @param pageId - The ID of the page to trash
|
|
85
|
+
* @returns The trashed page wrapped in a Page model
|
|
86
|
+
*/
|
|
87
|
+
async archive(pageId) {
|
|
88
|
+
return this.trash(pageId);
|
|
79
89
|
}
|
|
80
90
|
}
|
|
81
91
|
exports.PagesAPI = PagesAPI;
|
package/dist/api/users.api.d.ts
CHANGED
|
@@ -33,7 +33,7 @@ export declare class UsersAPI extends BaseAPI<NotionUser, User> {
|
|
|
33
33
|
workspace_name: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
34
34
|
workspace_id: import("zod").ZodOptional<import("zod").ZodString>;
|
|
35
35
|
workspace_limits: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
36
|
-
max_file_upload_size_in_bytes: import("zod").
|
|
36
|
+
max_file_upload_size_in_bytes: import("zod").ZodInt;
|
|
37
37
|
}, import("zod/v4/core").$strip>>;
|
|
38
38
|
}, import("zod/v4/core").$strip>;
|
|
39
39
|
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
package/dist/client.d.ts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Notion API version targeted by this SDK.
|
|
3
|
+
* All schemas, request bodies, helpers, and models are coupled to this version.
|
|
4
|
+
*/
|
|
5
|
+
export declare const NOTION_VERSION: "2026-03-11";
|
|
1
6
|
/**
|
|
2
7
|
* Configuration options for the Notion client.
|
|
3
8
|
*/
|
|
@@ -6,8 +11,6 @@ export interface NotionClientOptions {
|
|
|
6
11
|
auth: string;
|
|
7
12
|
/** Base URL for API requests (default: https://api.notion.com) */
|
|
8
13
|
baseUrl?: string;
|
|
9
|
-
/** Notion API version (default: 2025-09-03) */
|
|
10
|
-
notionVersion?: string;
|
|
11
14
|
/** Request timeout in milliseconds (default: 60000) */
|
|
12
15
|
timeoutMs?: number;
|
|
13
16
|
/** Custom fetch implementation (defaults to global fetch) */
|
|
@@ -32,7 +35,6 @@ export interface RequestOptions {
|
|
|
32
35
|
export declare class NotionClient {
|
|
33
36
|
private readonly auth;
|
|
34
37
|
private readonly baseUrl;
|
|
35
|
-
private readonly notionVersion;
|
|
36
38
|
private readonly timeoutMs;
|
|
37
39
|
private readonly fetchImpl;
|
|
38
40
|
private readonly maxRetries;
|
package/dist/client.js
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.NotionClient = void 0;
|
|
3
|
+
exports.NotionClient = exports.NOTION_VERSION = void 0;
|
|
4
4
|
const errors_1 = require("./errors");
|
|
5
|
+
/**
|
|
6
|
+
* The Notion API version targeted by this SDK.
|
|
7
|
+
* All schemas, request bodies, helpers, and models are coupled to this version.
|
|
8
|
+
*/
|
|
9
|
+
exports.NOTION_VERSION = '2026-03-11';
|
|
5
10
|
/**
|
|
6
11
|
* Base HTTP client for Notion API requests.
|
|
7
12
|
*/
|
|
@@ -9,7 +14,6 @@ class NotionClient {
|
|
|
9
14
|
constructor(options) {
|
|
10
15
|
this.auth = options.auth;
|
|
11
16
|
this.baseUrl = options.baseUrl ?? 'https://api.notion.com';
|
|
12
|
-
this.notionVersion = options.notionVersion ?? '2025-09-03';
|
|
13
17
|
this.timeoutMs = options.timeoutMs ?? 60000;
|
|
14
18
|
this.fetchImpl = options.fetch ?? fetch;
|
|
15
19
|
this.maxRetries = options.maxRetries ?? 3;
|
|
@@ -120,7 +124,7 @@ class NotionClient {
|
|
|
120
124
|
return {
|
|
121
125
|
Authorization: `Bearer ${this.auth}`,
|
|
122
126
|
'Content-Type': 'application/json',
|
|
123
|
-
'Notion-Version':
|
|
127
|
+
'Notion-Version': exports.NOTION_VERSION,
|
|
124
128
|
};
|
|
125
129
|
}
|
|
126
130
|
/**
|
|
@@ -65,6 +65,9 @@ declare function callout(text: RichTextInput, options?: CalloutOptions): BlockOb
|
|
|
65
65
|
declare function template(text: RichTextInput, options?: {
|
|
66
66
|
children?: unknown[];
|
|
67
67
|
}): BlockObject;
|
|
68
|
+
declare function meetingNotes(text: RichTextInput, options?: {
|
|
69
|
+
children?: unknown[];
|
|
70
|
+
}): BlockObject;
|
|
68
71
|
/** Options for code blocks. */
|
|
69
72
|
interface CodeOptions {
|
|
70
73
|
caption?: RichTextInput;
|
|
@@ -164,6 +167,7 @@ export declare const block: {
|
|
|
164
167
|
quote: typeof quote;
|
|
165
168
|
callout: typeof callout;
|
|
166
169
|
template: typeof template;
|
|
170
|
+
meetingNotes: typeof meetingNotes;
|
|
167
171
|
code: typeof code;
|
|
168
172
|
equation: typeof equation;
|
|
169
173
|
image: typeof image;
|
|
@@ -170,6 +170,16 @@ function template(text, options) {
|
|
|
170
170
|
},
|
|
171
171
|
};
|
|
172
172
|
}
|
|
173
|
+
function meetingNotes(text, options) {
|
|
174
|
+
return {
|
|
175
|
+
object: 'block',
|
|
176
|
+
type: 'meeting_notes',
|
|
177
|
+
meeting_notes: {
|
|
178
|
+
rich_text: resolveRichText(text),
|
|
179
|
+
...(options?.children ? { children: options.children } : {}),
|
|
180
|
+
},
|
|
181
|
+
};
|
|
182
|
+
}
|
|
173
183
|
function code(content, language, options) {
|
|
174
184
|
return {
|
|
175
185
|
object: 'block',
|
|
@@ -403,6 +413,7 @@ exports.block = {
|
|
|
403
413
|
quote,
|
|
404
414
|
callout,
|
|
405
415
|
template,
|
|
416
|
+
meetingNotes,
|
|
406
417
|
// Code & equation
|
|
407
418
|
code,
|
|
408
419
|
equation,
|
|
@@ -22,8 +22,8 @@ declare function database(databaseId: string): {
|
|
|
22
22
|
};
|
|
23
23
|
/**
|
|
24
24
|
* Create a data source parent object.
|
|
25
|
-
*
|
|
26
|
-
*
|
|
25
|
+
* Both data_source_id and database_id are required when creating a page
|
|
26
|
+
* with a data source parent.
|
|
27
27
|
*
|
|
28
28
|
* @example
|
|
29
29
|
* ```ts
|
|
@@ -28,8 +28,8 @@ function database(databaseId) {
|
|
|
28
28
|
}
|
|
29
29
|
/**
|
|
30
30
|
* Create a data source parent object.
|
|
31
|
-
*
|
|
32
|
-
*
|
|
31
|
+
* Both data_source_id and database_id are required when creating a page
|
|
32
|
+
* with a data source parent.
|
|
33
33
|
*
|
|
34
34
|
* @example
|
|
35
35
|
* ```ts
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -14,10 +14,12 @@ 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
|
-
exports.Notion = void 0;
|
|
17
|
+
exports.NOTION_VERSION = exports.Notion = void 0;
|
|
18
18
|
// Export main SDK class
|
|
19
19
|
var notion_1 = require("./notion");
|
|
20
20
|
Object.defineProperty(exports, "Notion", { enumerable: true, get: function () { return notion_1.Notion; } });
|
|
21
|
+
var client_1 = require("./client");
|
|
22
|
+
Object.defineProperty(exports, "NOTION_VERSION", { enumerable: true, get: function () { return client_1.NOTION_VERSION; } });
|
|
21
23
|
// Export API namespaces
|
|
22
24
|
__exportStar(require("./api"), exports);
|
|
23
25
|
// Export error classes
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import type * as z from 'zod';
|
|
2
2
|
/**
|
|
3
3
|
* Base model class providing common functionality for all Notion models.
|
|
4
4
|
* Models wrap validated data from schemas with methods and business logic.
|
|
5
5
|
*/
|
|
6
6
|
export declare abstract class BaseModel<T> {
|
|
7
7
|
protected readonly data: T;
|
|
8
|
-
protected constructor(data: T, schema: ZodType<T>);
|
|
8
|
+
protected constructor(data: T, schema: z.ZodType<T>);
|
|
9
9
|
/**
|
|
10
10
|
* Returns the raw validated data as a plain object.
|
|
11
11
|
*/
|
|
@@ -71,10 +71,6 @@ export declare class DataSource extends BaseModel<NotionDataSource> {
|
|
|
71
71
|
* Returns whether the data source is inline.
|
|
72
72
|
*/
|
|
73
73
|
get isInline(): boolean;
|
|
74
|
-
/**
|
|
75
|
-
* Returns the archived status.
|
|
76
|
-
*/
|
|
77
|
-
get archived(): boolean;
|
|
78
74
|
/**
|
|
79
75
|
* Returns whether the data source is in trash.
|
|
80
76
|
*/
|
|
@@ -108,12 +108,6 @@ class DataSource extends base_model_1.BaseModel {
|
|
|
108
108
|
get isInline() {
|
|
109
109
|
return this.data.is_inline;
|
|
110
110
|
}
|
|
111
|
-
/**
|
|
112
|
-
* Returns the archived status.
|
|
113
|
-
*/
|
|
114
|
-
get archived() {
|
|
115
|
-
return this.data.archived;
|
|
116
|
-
}
|
|
117
111
|
/**
|
|
118
112
|
* Returns whether the data source is in trash.
|
|
119
113
|
*/
|
|
@@ -57,10 +57,6 @@ export declare class Database extends BaseModel<NotionDatabase> {
|
|
|
57
57
|
* Returns the Notion URL of the database.
|
|
58
58
|
*/
|
|
59
59
|
get url(): string;
|
|
60
|
-
/**
|
|
61
|
-
* Returns the archived status.
|
|
62
|
-
*/
|
|
63
|
-
get archived(): boolean;
|
|
64
60
|
/**
|
|
65
61
|
* Returns whether the database is in trash.
|
|
66
62
|
*/
|
|
@@ -88,12 +88,6 @@ class Database extends base_model_1.BaseModel {
|
|
|
88
88
|
get url() {
|
|
89
89
|
return this.data.url;
|
|
90
90
|
}
|
|
91
|
-
/**
|
|
92
|
-
* Returns the archived status.
|
|
93
|
-
*/
|
|
94
|
-
get archived() {
|
|
95
|
-
return this.data.archived;
|
|
96
|
-
}
|
|
97
91
|
/**
|
|
98
92
|
* Returns whether the database is in trash.
|
|
99
93
|
*/
|