@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.
Files changed (50) hide show
  1. package/README.md +3 -3
  2. package/dist/api/blocks.api.d.ts +1083 -224
  3. package/dist/api/blocks.api.js +4 -0
  4. package/dist/api/comments.api.d.ts +19 -1
  5. package/dist/api/comments.api.js +1 -1
  6. package/dist/api/dataSources.api.d.ts +41 -0
  7. package/dist/api/databases.api.d.ts +52 -5
  8. package/dist/api/databases.api.js +5 -3
  9. package/dist/api/fileUploads.api.d.ts +17 -7
  10. package/dist/api/fileUploads.api.js +30 -16
  11. package/dist/api/pages.api.d.ts +49 -0
  12. package/dist/client.d.ts +33 -2
  13. package/dist/client.js +88 -21
  14. package/dist/errors.d.ts +7 -0
  15. package/dist/errors.js +7 -0
  16. package/dist/helpers/filter.helpers.d.ts +11 -4
  17. package/dist/helpers/filter.helpers.js +73 -30
  18. package/dist/helpers/pagination.helpers.d.ts +7 -2
  19. package/dist/helpers/pagination.helpers.js +26 -5
  20. package/dist/models/dataSource.model.d.ts +6 -1
  21. package/dist/models/dataSource.model.js +7 -0
  22. package/dist/models/database.model.d.ts +5 -1
  23. package/dist/models/database.model.js +6 -0
  24. package/dist/models/page.model.d.ts +20 -1
  25. package/dist/models/page.model.js +33 -2
  26. package/dist/models/user.model.d.ts +5 -0
  27. package/dist/models/user.model.js +10 -0
  28. package/dist/schemas/block.schema.d.ts +1082 -224
  29. package/dist/schemas/block.schema.js +40 -25
  30. package/dist/schemas/comment.schema.d.ts +18 -0
  31. package/dist/schemas/dataSource.schema.d.ts +41 -0
  32. package/dist/schemas/dataSource.schema.js +3 -0
  33. package/dist/schemas/database.schema.d.ts +54 -0
  34. package/dist/schemas/database.schema.js +11 -1
  35. package/dist/schemas/meetingNotesQuery.schema.d.ts +1082 -224
  36. package/dist/schemas/page.schema.d.ts +49 -0
  37. package/dist/schemas/page.schema.js +2 -1
  38. package/dist/schemas/pageMarkdown.schema.js +1 -1
  39. package/dist/schemas/pageProperties.schema.d.ts +105 -1
  40. package/dist/schemas/pageProperties.schema.js +17 -1
  41. package/dist/schemas/pagination.schema.d.ts +1 -1
  42. package/dist/schemas/propertyObjects.schema.js +2 -1
  43. package/dist/schemas/richText.schema.d.ts +36 -0
  44. package/dist/schemas/richText.schema.js +21 -0
  45. package/dist/schemas/shared.schema.d.ts +3 -7
  46. package/dist/schemas/shared.schema.js +5 -9
  47. package/dist/schemas/view.schema.d.ts +49 -0
  48. package/dist/validation.d.ts +8 -0
  49. package/dist/validation.js +16 -0
  50. package/package.json +16 -15
@@ -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.1.1",
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.6"
66
+ "zod": "^4.4.3"
67
67
  },
68
68
  "devDependencies": {
69
- "@commitlint/cli": "^21.0.0",
70
- "@commitlint/config-conventional": "^21.0.0",
71
- "@types/node": "^25.2.1",
72
- "@vitest/coverage-v8": "^4.0.18",
73
- "eslint": "^10.0.0",
74
- "eslint-plugin-zod": "4.9.0",
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.2.7",
77
+ "lint-staged": "^16.4.0",
77
78
  "msw": "2.15.0",
78
- "prettier": "^3.8.1",
79
- "prettier-plugin-packagejson": "^3.0.0",
79
+ "prettier": "^3.9.6",
80
+ "prettier-plugin-packagejson": "^3.0.2",
80
81
  "typescript": "^6.0.3",
81
- "typescript-eslint": "^8.54.0",
82
- "vitest": "^4.0.18"
82
+ "typescript-eslint": "^8.67.0",
83
+ "vitest": "^4.1.11"
83
84
  },
84
85
  "engines": {
85
- "bun": ">=1.3.10",
86
- "node": ">=18.0.0"
86
+ "bun": ">=1.4.0",
87
+ "node": ">=22.0.0"
87
88
  }
88
89
  }