@visus-io/notion-sdk-ts 3.1.1 → 3.2.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 +3 -3
- package/dist/api/blocks.api.d.ts +1083 -224
- package/dist/api/blocks.api.js +4 -0
- package/dist/api/comments.api.d.ts +19 -1
- package/dist/api/comments.api.js +1 -1
- package/dist/api/dataSources.api.d.ts +41 -0
- package/dist/api/databases.api.d.ts +52 -5
- package/dist/api/databases.api.js +5 -3
- package/dist/api/fileUploads.api.d.ts +17 -7
- package/dist/api/fileUploads.api.js +30 -16
- package/dist/api/pages.api.d.ts +49 -0
- package/dist/client.d.ts +33 -2
- package/dist/client.js +88 -21
- package/dist/errors.d.ts +7 -0
- package/dist/errors.js +7 -0
- package/dist/helpers/filter.helpers.d.ts +11 -4
- package/dist/helpers/filter.helpers.js +73 -30
- package/dist/helpers/pagination.helpers.d.ts +7 -2
- package/dist/helpers/pagination.helpers.js +26 -5
- package/dist/models/dataSource.model.d.ts +6 -1
- package/dist/models/dataSource.model.js +7 -0
- package/dist/models/database.model.d.ts +5 -1
- package/dist/models/database.model.js +6 -0
- package/dist/models/page.model.d.ts +20 -1
- package/dist/models/page.model.js +33 -2
- package/dist/models/user.model.d.ts +5 -0
- package/dist/models/user.model.js +10 -0
- package/dist/schemas/block.schema.d.ts +1082 -224
- package/dist/schemas/block.schema.js +40 -25
- package/dist/schemas/comment.schema.d.ts +18 -0
- package/dist/schemas/dataSource.schema.d.ts +41 -0
- package/dist/schemas/dataSource.schema.js +3 -0
- package/dist/schemas/database.schema.d.ts +54 -0
- package/dist/schemas/database.schema.js +11 -1
- package/dist/schemas/meetingNotesQuery.schema.d.ts +1082 -224
- package/dist/schemas/page.schema.d.ts +49 -0
- package/dist/schemas/page.schema.js +2 -1
- package/dist/schemas/pageMarkdown.schema.js +1 -1
- package/dist/schemas/pageProperties.schema.d.ts +105 -1
- package/dist/schemas/pageProperties.schema.js +17 -1
- package/dist/schemas/pagination.schema.d.ts +1 -1
- package/dist/schemas/propertyObjects.schema.js +2 -1
- package/dist/schemas/richText.schema.d.ts +36 -0
- package/dist/schemas/richText.schema.js +21 -0
- package/dist/schemas/shared.schema.d.ts +3 -7
- package/dist/schemas/shared.schema.js +5 -9
- package/dist/schemas/view.schema.d.ts +49 -0
- package/dist/validation.d.ts +8 -0
- package/dist/validation.js +16 -0
- package/package.json +16 -15
package/dist/validation.js
CHANGED
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.NotionValidationError = exports.LIMITS = void 0;
|
|
4
4
|
exports.validateStringLength = validateStringLength;
|
|
5
5
|
exports.validateArrayLength = validateArrayLength;
|
|
6
|
+
exports.validateNumberRange = validateNumberRange;
|
|
6
7
|
/**
|
|
7
8
|
* Maximum sizes the Notion API allows in a request.
|
|
8
9
|
*
|
|
@@ -86,3 +87,18 @@ function validateArrayLength(array, maxLength, label) {
|
|
|
86
87
|
throw new NotionValidationError(`${label} exceeds the ${maxLength}-element limit (got ${array.length})`);
|
|
87
88
|
}
|
|
88
89
|
}
|
|
90
|
+
// ---------------------------------------------------------------------------
|
|
91
|
+
// Numeric range validators
|
|
92
|
+
// ---------------------------------------------------------------------------
|
|
93
|
+
/**
|
|
94
|
+
* Assert that a number is within the inclusive range `[min, max]`.
|
|
95
|
+
*
|
|
96
|
+
* @throws {NotionValidationError}
|
|
97
|
+
*
|
|
98
|
+
* @category Client & Core
|
|
99
|
+
*/
|
|
100
|
+
function validateNumberRange(value, min, max, label) {
|
|
101
|
+
if (!Number.isFinite(value) || value < min || value > max) {
|
|
102
|
+
throw new NotionValidationError(`${label} must be between ${min} and ${max} (got ${value})`);
|
|
103
|
+
}
|
|
104
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@visus-io/notion-sdk-ts",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "TypeScript SDK for the Notion API",
|
|
6
6
|
"keywords": [
|
|
@@ -63,26 +63,27 @@
|
|
|
63
63
|
]
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
|
-
"zod": "^4.3
|
|
66
|
+
"zod": "^4.4.3"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
|
-
"@commitlint/cli": "^21.
|
|
70
|
-
"@commitlint/config-conventional": "^21.
|
|
71
|
-
"@types/
|
|
72
|
-
"@
|
|
73
|
-
"
|
|
74
|
-
"eslint
|
|
69
|
+
"@commitlint/cli": "^21.2.2",
|
|
70
|
+
"@commitlint/config-conventional": "^21.2.2",
|
|
71
|
+
"@types/bun": "^1.4.0",
|
|
72
|
+
"@types/node": "^25.9.5",
|
|
73
|
+
"@vitest/coverage-v8": "^4.1.11",
|
|
74
|
+
"eslint": "^10.9.0",
|
|
75
|
+
"eslint-plugin-zod": "4.12.0",
|
|
75
76
|
"husky": "^9.1.7",
|
|
76
|
-
"lint-staged": "^16.
|
|
77
|
+
"lint-staged": "^16.4.0",
|
|
77
78
|
"msw": "2.15.0",
|
|
78
|
-
"prettier": "^3.
|
|
79
|
-
"prettier-plugin-packagejson": "^3.0.
|
|
79
|
+
"prettier": "^3.9.6",
|
|
80
|
+
"prettier-plugin-packagejson": "^3.0.2",
|
|
80
81
|
"typescript": "^6.0.3",
|
|
81
|
-
"typescript-eslint": "^8.
|
|
82
|
-
"vitest": "^4.
|
|
82
|
+
"typescript-eslint": "^8.67.0",
|
|
83
|
+
"vitest": "^4.1.11"
|
|
83
84
|
},
|
|
84
85
|
"engines": {
|
|
85
|
-
"bun": ">=1.
|
|
86
|
-
"node": ">=
|
|
86
|
+
"bun": ">=1.4.0",
|
|
87
|
+
"node": ">=22.0.0"
|
|
87
88
|
}
|
|
88
89
|
}
|