@anuma/sdk 6.27.3 → 6.27.5

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 CHANGED
@@ -97,3 +97,24 @@ https://docs.anuma.ai/
97
97
 
98
98
  Contributions are welcome. Please open an issue or pull request on
99
99
  [GitHub](https://github.com/anuma-ai/sdk).
100
+
101
+ Before opening a PR, run `pnpm test` and `pnpm check`.
102
+
103
+ ### Tool, app-generation and slide e2e tests
104
+
105
+ `pnpm e2e:tools` runs the live-model tests in `test/tools/` and
106
+ `test/classifier/` (`vitest.e2e.config.mts`) against a real portal. Copy
107
+ `.env.example` to `.env` and set `PORTAL_API_KEY` (and `ANUMA_API_URL` to
108
+ point at a portal other than dev). Pass a file-name filter to run a subset:
109
+
110
+ ```sh
111
+ pnpm e2e:tools # everything
112
+ pnpm e2e:tools weather # test/tools/weather.ts only
113
+ pnpm e2e:tools slide # the slide-generation tests
114
+ ```
115
+
116
+ CI runs the same suite on PRs that touch the tool, app-generation or slide code
117
+ (see the `changes` job in `.github/workflows/e2e-tools.yml` for the exact paths)
118
+ and again in the merge queue. PRs without access to the `PORTAL_API_KEY` secret
119
+ (forks, Dependabot) skip it and get their result in the queue. On a PR the result
120
+ is advisory; the queue run is the one that blocks.
@@ -25305,49 +25305,69 @@ function notionUpdatePageTool(run) {
25305
25305
  type: "function",
25306
25306
  function: {
25307
25307
  name: "notion-update-page",
25308
- description: "Update a Notion page's properties or content. Uses command-based operations: 'update_properties' to change properties, 'replace_content' to replace all content, 'replace_content_range' to replace specific text, 'insert_content_after' to insert after text.",
25308
+ description: "Update a Notion page's properties or content. Arguments are flat: page_id, command, and the parameter that command needs. 'insert_content' appends Markdown (needs content). 'update_content' does search-and-replace edits (needs content_updates). 'replace_content' replaces all content (needs new_str). 'update_properties' changes properties (needs properties). 'apply_template' applies a template page (needs template_id). 'update_verification' marks the page verified or unverified (needs verification_status, plus optional verification_expiry_days only when verified).",
25309
25309
  arguments: {
25310
25310
  type: "object",
25311
25311
  properties: {
25312
- data: {
25313
- type: "object",
25314
- description: "Update data containing page_id and a command",
25315
- properties: {
25316
- page_id: {
25317
- type: "string",
25318
- description: "The ID of the page to update (with or without dashes)"
25319
- },
25320
- command: {
25321
- type: "string",
25322
- enum: [
25323
- "update_properties",
25324
- "replace_content",
25325
- "replace_content_range",
25326
- "insert_content_after"
25327
- ],
25328
- description: "The update command to execute"
25329
- },
25312
+ page_id: {
25313
+ type: "string",
25314
+ description: "The ID of the page to update (with or without dashes)"
25315
+ },
25316
+ command: {
25317
+ type: "string",
25318
+ enum: [
25319
+ "update_properties",
25320
+ "update_content",
25321
+ "replace_content",
25322
+ "insert_content",
25323
+ "apply_template",
25324
+ "update_verification"
25325
+ ],
25326
+ description: "The update command to execute"
25327
+ },
25328
+ content: {
25329
+ type: "string",
25330
+ description: "For insert_content: the Notion-flavored Markdown to insert"
25331
+ },
25332
+ content_updates: {
25333
+ type: "array",
25334
+ description: "For update_content: search-and-replace edits. Each old_str must match existing page text.",
25335
+ items: {
25336
+ type: "object",
25330
25337
  properties: {
25331
- type: "object",
25332
- description: "For update_properties: JSON map of property names to values. Use null to remove a value."
25333
- },
25334
- new_str: {
25335
- type: "string",
25336
- description: "For replace_content/replace_content_range/insert_content_after: the new content string"
25338
+ old_str: { type: "string", description: "Existing text to replace" },
25339
+ new_str: { type: "string", description: "Replacement text" }
25337
25340
  },
25338
- selection_with_ellipsis: {
25339
- type: "string",
25340
- description: "For replace_content_range/insert_content_after: unique start and end snippet (~10 chars each with ellipsis)"
25341
- },
25342
- allow_deleting_content: {
25343
- type: "boolean",
25344
- description: "For replace_content/replace_content_range: allow deletion of child pages/databases"
25345
- }
25346
- },
25347
- required: ["page_id", "command"]
25341
+ required: ["old_str", "new_str"]
25342
+ }
25343
+ },
25344
+ new_str: {
25345
+ type: "string",
25346
+ description: "For replace_content: the new page content in Notion-flavored Markdown"
25347
+ },
25348
+ properties: {
25349
+ type: "object",
25350
+ description: "For update_properties: JSON map of property names to values. Use null to remove a value."
25351
+ },
25352
+ allow_deleting_content: {
25353
+ type: "boolean",
25354
+ description: "For replace_content/update_content: allow deletion of child pages/databases"
25355
+ },
25356
+ template_id: {
25357
+ type: "string",
25358
+ description: "For apply_template: the ID of the template page to apply"
25359
+ },
25360
+ verification_status: {
25361
+ type: "string",
25362
+ enum: ["verified", "unverified"],
25363
+ description: "For update_verification: the new verification status"
25364
+ },
25365
+ verification_expiry_days: {
25366
+ type: "number",
25367
+ description: "For update_verification: days until the verification expires. Only allowed when verification_status is 'verified'"
25348
25368
  }
25349
25369
  },
25350
- required: ["data"]
25370
+ required: ["page_id", "command"]
25351
25371
  }
25352
25372
  }
25353
25373
  });
@@ -25400,30 +25420,27 @@ function notionCreateDatabaseTool(run) {
25400
25420
  type: "function",
25401
25421
  function: {
25402
25422
  name: "notion-create-database",
25403
- description: "Create a new Notion database with a properties schema. If no title property is provided, 'Name' is auto-added. Supports property types: title, rich_text, number, select, multi_select, date, people, checkbox, url, email, phone_number, formula, relation, rollup, status, unique_id, etc.",
25423
+ description: `Create a new Notion database. Define the columns with a SQL DDL string in schema, for example 'CREATE TABLE ("Name" TITLE, "Notes" RICH_TEXT, "Done" CHECKBOX)'.`,
25404
25424
  arguments: {
25405
25425
  type: "object",
25406
25426
  properties: {
25407
- properties: {
25408
- type: "object",
25409
- description: "Property schema for the database. Each key is a property name, value defines the type."
25410
- },
25411
- parent: {
25412
- type: "object",
25413
- description: "Parent page: {type:'page_id', page_id:'...'}. Omit for private workspace-level database."
25427
+ schema: {
25428
+ type: "string",
25429
+ description: "SQL DDL CREATE TABLE statement defining the columns, with quoted column names and types such as TITLE, RICH_TEXT, CHECKBOX"
25414
25430
  },
25415
25431
  title: {
25416
- type: "array",
25417
- description: "Title of the database as rich text array (max 100)",
25418
- items: { type: "object" }
25432
+ type: "string",
25433
+ description: "Title of the database"
25419
25434
  },
25420
- description: {
25421
- type: "array",
25422
- description: "Description of the database as rich text array (max 100)",
25423
- items: { type: "object" }
25435
+ parent: {
25436
+ type: "object",
25437
+ description: "Parent page: {page_id:'...'}. Omit for private workspace-level database.",
25438
+ properties: {
25439
+ page_id: { type: "string", description: "The ID of the parent page" }
25440
+ }
25424
25441
  }
25425
25442
  },
25426
- required: ["properties"]
25443
+ required: ["schema"]
25427
25444
  }
25428
25445
  }
25429
25446
  });
@@ -25433,7 +25450,7 @@ function notionUpdateDataSourceTool(run) {
25433
25450
  type: "function",
25434
25451
  function: {
25435
25452
  name: "notion-update-data-source",
25436
- description: "Update a Notion data source's title, description, property schema, or other attributes. Use null to remove a property. Provide only 'name' to rename a property.",
25453
+ description: `Update a Notion data source's columns, title, or other attributes. Change columns with SQL DDL in statements, for example 'ADD COLUMN "Owner" RICH_TEXT' or 'ADD COLUMN "Done" CHECKBOX'.`,
25437
25454
  arguments: {
25438
25455
  type: "object",
25439
25456
  properties: {
@@ -25441,19 +25458,13 @@ function notionUpdateDataSourceTool(run) {
25441
25458
  type: "string",
25442
25459
  description: "The ID of the data source to update (UUID). Can be a data source ID or database ID."
25443
25460
  },
25444
- title: {
25445
- type: "array",
25446
- description: "New title as rich text array (max 100)",
25447
- items: { type: "object" }
25448
- },
25449
- description: {
25450
- type: "array",
25451
- description: "New description as rich text array (max 100)",
25452
- items: { type: "object" }
25461
+ statements: {
25462
+ type: "string",
25463
+ description: "SQL DDL statements that change the columns, such as ADD COLUMN"
25453
25464
  },
25454
- properties: {
25455
- type: "object",
25456
- description: "Property schema updates. Use null to remove, {name:'...'} to rename, or full definition to add/update."
25465
+ title: {
25466
+ type: "string",
25467
+ description: "New title of the data source"
25457
25468
  },
25458
25469
  is_inline: {
25459
25470
  type: "boolean",
@@ -23631,49 +23631,69 @@ function notionUpdatePageTool(run) {
23631
23631
  type: "function",
23632
23632
  function: {
23633
23633
  name: "notion-update-page",
23634
- description: "Update a Notion page's properties or content. Uses command-based operations: 'update_properties' to change properties, 'replace_content' to replace all content, 'replace_content_range' to replace specific text, 'insert_content_after' to insert after text.",
23634
+ description: "Update a Notion page's properties or content. Arguments are flat: page_id, command, and the parameter that command needs. 'insert_content' appends Markdown (needs content). 'update_content' does search-and-replace edits (needs content_updates). 'replace_content' replaces all content (needs new_str). 'update_properties' changes properties (needs properties). 'apply_template' applies a template page (needs template_id). 'update_verification' marks the page verified or unverified (needs verification_status, plus optional verification_expiry_days only when verified).",
23635
23635
  arguments: {
23636
23636
  type: "object",
23637
23637
  properties: {
23638
- data: {
23639
- type: "object",
23640
- description: "Update data containing page_id and a command",
23641
- properties: {
23642
- page_id: {
23643
- type: "string",
23644
- description: "The ID of the page to update (with or without dashes)"
23645
- },
23646
- command: {
23647
- type: "string",
23648
- enum: [
23649
- "update_properties",
23650
- "replace_content",
23651
- "replace_content_range",
23652
- "insert_content_after"
23653
- ],
23654
- description: "The update command to execute"
23655
- },
23638
+ page_id: {
23639
+ type: "string",
23640
+ description: "The ID of the page to update (with or without dashes)"
23641
+ },
23642
+ command: {
23643
+ type: "string",
23644
+ enum: [
23645
+ "update_properties",
23646
+ "update_content",
23647
+ "replace_content",
23648
+ "insert_content",
23649
+ "apply_template",
23650
+ "update_verification"
23651
+ ],
23652
+ description: "The update command to execute"
23653
+ },
23654
+ content: {
23655
+ type: "string",
23656
+ description: "For insert_content: the Notion-flavored Markdown to insert"
23657
+ },
23658
+ content_updates: {
23659
+ type: "array",
23660
+ description: "For update_content: search-and-replace edits. Each old_str must match existing page text.",
23661
+ items: {
23662
+ type: "object",
23656
23663
  properties: {
23657
- type: "object",
23658
- description: "For update_properties: JSON map of property names to values. Use null to remove a value."
23659
- },
23660
- new_str: {
23661
- type: "string",
23662
- description: "For replace_content/replace_content_range/insert_content_after: the new content string"
23664
+ old_str: { type: "string", description: "Existing text to replace" },
23665
+ new_str: { type: "string", description: "Replacement text" }
23663
23666
  },
23664
- selection_with_ellipsis: {
23665
- type: "string",
23666
- description: "For replace_content_range/insert_content_after: unique start and end snippet (~10 chars each with ellipsis)"
23667
- },
23668
- allow_deleting_content: {
23669
- type: "boolean",
23670
- description: "For replace_content/replace_content_range: allow deletion of child pages/databases"
23671
- }
23672
- },
23673
- required: ["page_id", "command"]
23667
+ required: ["old_str", "new_str"]
23668
+ }
23669
+ },
23670
+ new_str: {
23671
+ type: "string",
23672
+ description: "For replace_content: the new page content in Notion-flavored Markdown"
23673
+ },
23674
+ properties: {
23675
+ type: "object",
23676
+ description: "For update_properties: JSON map of property names to values. Use null to remove a value."
23677
+ },
23678
+ allow_deleting_content: {
23679
+ type: "boolean",
23680
+ description: "For replace_content/update_content: allow deletion of child pages/databases"
23681
+ },
23682
+ template_id: {
23683
+ type: "string",
23684
+ description: "For apply_template: the ID of the template page to apply"
23685
+ },
23686
+ verification_status: {
23687
+ type: "string",
23688
+ enum: ["verified", "unverified"],
23689
+ description: "For update_verification: the new verification status"
23690
+ },
23691
+ verification_expiry_days: {
23692
+ type: "number",
23693
+ description: "For update_verification: days until the verification expires. Only allowed when verification_status is 'verified'"
23674
23694
  }
23675
23695
  },
23676
- required: ["data"]
23696
+ required: ["page_id", "command"]
23677
23697
  }
23678
23698
  }
23679
23699
  });
@@ -23726,30 +23746,27 @@ function notionCreateDatabaseTool(run) {
23726
23746
  type: "function",
23727
23747
  function: {
23728
23748
  name: "notion-create-database",
23729
- description: "Create a new Notion database with a properties schema. If no title property is provided, 'Name' is auto-added. Supports property types: title, rich_text, number, select, multi_select, date, people, checkbox, url, email, phone_number, formula, relation, rollup, status, unique_id, etc.",
23749
+ description: `Create a new Notion database. Define the columns with a SQL DDL string in schema, for example 'CREATE TABLE ("Name" TITLE, "Notes" RICH_TEXT, "Done" CHECKBOX)'.`,
23730
23750
  arguments: {
23731
23751
  type: "object",
23732
23752
  properties: {
23733
- properties: {
23734
- type: "object",
23735
- description: "Property schema for the database. Each key is a property name, value defines the type."
23736
- },
23737
- parent: {
23738
- type: "object",
23739
- description: "Parent page: {type:'page_id', page_id:'...'}. Omit for private workspace-level database."
23753
+ schema: {
23754
+ type: "string",
23755
+ description: "SQL DDL CREATE TABLE statement defining the columns, with quoted column names and types such as TITLE, RICH_TEXT, CHECKBOX"
23740
23756
  },
23741
23757
  title: {
23742
- type: "array",
23743
- description: "Title of the database as rich text array (max 100)",
23744
- items: { type: "object" }
23758
+ type: "string",
23759
+ description: "Title of the database"
23745
23760
  },
23746
- description: {
23747
- type: "array",
23748
- description: "Description of the database as rich text array (max 100)",
23749
- items: { type: "object" }
23761
+ parent: {
23762
+ type: "object",
23763
+ description: "Parent page: {page_id:'...'}. Omit for private workspace-level database.",
23764
+ properties: {
23765
+ page_id: { type: "string", description: "The ID of the parent page" }
23766
+ }
23750
23767
  }
23751
23768
  },
23752
- required: ["properties"]
23769
+ required: ["schema"]
23753
23770
  }
23754
23771
  }
23755
23772
  });
@@ -23759,7 +23776,7 @@ function notionUpdateDataSourceTool(run) {
23759
23776
  type: "function",
23760
23777
  function: {
23761
23778
  name: "notion-update-data-source",
23762
- description: "Update a Notion data source's title, description, property schema, or other attributes. Use null to remove a property. Provide only 'name' to rename a property.",
23779
+ description: `Update a Notion data source's columns, title, or other attributes. Change columns with SQL DDL in statements, for example 'ADD COLUMN "Owner" RICH_TEXT' or 'ADD COLUMN "Done" CHECKBOX'.`,
23763
23780
  arguments: {
23764
23781
  type: "object",
23765
23782
  properties: {
@@ -23767,19 +23784,13 @@ function notionUpdateDataSourceTool(run) {
23767
23784
  type: "string",
23768
23785
  description: "The ID of the data source to update (UUID). Can be a data source ID or database ID."
23769
23786
  },
23770
- title: {
23771
- type: "array",
23772
- description: "New title as rich text array (max 100)",
23773
- items: { type: "object" }
23774
- },
23775
- description: {
23776
- type: "array",
23777
- description: "New description as rich text array (max 100)",
23778
- items: { type: "object" }
23787
+ statements: {
23788
+ type: "string",
23789
+ description: "SQL DDL statements that change the columns, such as ADD COLUMN"
23779
23790
  },
23780
- properties: {
23781
- type: "object",
23782
- description: "Property schema updates. Use null to remove, {name:'...'} to rename, or full definition to add/update."
23791
+ title: {
23792
+ type: "string",
23793
+ description: "New title of the data source"
23783
23794
  },
23784
23795
  is_inline: {
23785
23796
  type: "boolean",
@@ -2503,49 +2503,69 @@ function notionUpdatePageTool(run) {
2503
2503
  type: "function",
2504
2504
  function: {
2505
2505
  name: "notion-update-page",
2506
- description: "Update a Notion page's properties or content. Uses command-based operations: 'update_properties' to change properties, 'replace_content' to replace all content, 'replace_content_range' to replace specific text, 'insert_content_after' to insert after text.",
2506
+ description: "Update a Notion page's properties or content. Arguments are flat: page_id, command, and the parameter that command needs. 'insert_content' appends Markdown (needs content). 'update_content' does search-and-replace edits (needs content_updates). 'replace_content' replaces all content (needs new_str). 'update_properties' changes properties (needs properties). 'apply_template' applies a template page (needs template_id). 'update_verification' marks the page verified or unverified (needs verification_status, plus optional verification_expiry_days only when verified).",
2507
2507
  arguments: {
2508
2508
  type: "object",
2509
2509
  properties: {
2510
- data: {
2511
- type: "object",
2512
- description: "Update data containing page_id and a command",
2513
- properties: {
2514
- page_id: {
2515
- type: "string",
2516
- description: "The ID of the page to update (with or without dashes)"
2517
- },
2518
- command: {
2519
- type: "string",
2520
- enum: [
2521
- "update_properties",
2522
- "replace_content",
2523
- "replace_content_range",
2524
- "insert_content_after"
2525
- ],
2526
- description: "The update command to execute"
2527
- },
2510
+ page_id: {
2511
+ type: "string",
2512
+ description: "The ID of the page to update (with or without dashes)"
2513
+ },
2514
+ command: {
2515
+ type: "string",
2516
+ enum: [
2517
+ "update_properties",
2518
+ "update_content",
2519
+ "replace_content",
2520
+ "insert_content",
2521
+ "apply_template",
2522
+ "update_verification"
2523
+ ],
2524
+ description: "The update command to execute"
2525
+ },
2526
+ content: {
2527
+ type: "string",
2528
+ description: "For insert_content: the Notion-flavored Markdown to insert"
2529
+ },
2530
+ content_updates: {
2531
+ type: "array",
2532
+ description: "For update_content: search-and-replace edits. Each old_str must match existing page text.",
2533
+ items: {
2534
+ type: "object",
2528
2535
  properties: {
2529
- type: "object",
2530
- description: "For update_properties: JSON map of property names to values. Use null to remove a value."
2531
- },
2532
- new_str: {
2533
- type: "string",
2534
- description: "For replace_content/replace_content_range/insert_content_after: the new content string"
2535
- },
2536
- selection_with_ellipsis: {
2537
- type: "string",
2538
- description: "For replace_content_range/insert_content_after: unique start and end snippet (~10 chars each with ellipsis)"
2536
+ old_str: { type: "string", description: "Existing text to replace" },
2537
+ new_str: { type: "string", description: "Replacement text" }
2539
2538
  },
2540
- allow_deleting_content: {
2541
- type: "boolean",
2542
- description: "For replace_content/replace_content_range: allow deletion of child pages/databases"
2543
- }
2544
- },
2545
- required: ["page_id", "command"]
2539
+ required: ["old_str", "new_str"]
2540
+ }
2541
+ },
2542
+ new_str: {
2543
+ type: "string",
2544
+ description: "For replace_content: the new page content in Notion-flavored Markdown"
2545
+ },
2546
+ properties: {
2547
+ type: "object",
2548
+ description: "For update_properties: JSON map of property names to values. Use null to remove a value."
2549
+ },
2550
+ allow_deleting_content: {
2551
+ type: "boolean",
2552
+ description: "For replace_content/update_content: allow deletion of child pages/databases"
2553
+ },
2554
+ template_id: {
2555
+ type: "string",
2556
+ description: "For apply_template: the ID of the template page to apply"
2557
+ },
2558
+ verification_status: {
2559
+ type: "string",
2560
+ enum: ["verified", "unverified"],
2561
+ description: "For update_verification: the new verification status"
2562
+ },
2563
+ verification_expiry_days: {
2564
+ type: "number",
2565
+ description: "For update_verification: days until the verification expires. Only allowed when verification_status is 'verified'"
2546
2566
  }
2547
2567
  },
2548
- required: ["data"]
2568
+ required: ["page_id", "command"]
2549
2569
  }
2550
2570
  }
2551
2571
  });
@@ -2607,30 +2627,27 @@ function notionCreateDatabaseTool(run) {
2607
2627
  type: "function",
2608
2628
  function: {
2609
2629
  name: "notion-create-database",
2610
- description: "Create a new Notion database with a properties schema. If no title property is provided, 'Name' is auto-added. Supports property types: title, rich_text, number, select, multi_select, date, people, checkbox, url, email, phone_number, formula, relation, rollup, status, unique_id, etc.",
2630
+ description: `Create a new Notion database. Define the columns with a SQL DDL string in schema, for example 'CREATE TABLE ("Name" TITLE, "Notes" RICH_TEXT, "Done" CHECKBOX)'.`,
2611
2631
  arguments: {
2612
2632
  type: "object",
2613
2633
  properties: {
2614
- properties: {
2615
- type: "object",
2616
- description: "Property schema for the database. Each key is a property name, value defines the type."
2617
- },
2618
- parent: {
2619
- type: "object",
2620
- description: "Parent page: {type:'page_id', page_id:'...'}. Omit for private workspace-level database."
2634
+ schema: {
2635
+ type: "string",
2636
+ description: "SQL DDL CREATE TABLE statement defining the columns, with quoted column names and types such as TITLE, RICH_TEXT, CHECKBOX"
2621
2637
  },
2622
2638
  title: {
2623
- type: "array",
2624
- description: "Title of the database as rich text array (max 100)",
2625
- items: { type: "object" }
2639
+ type: "string",
2640
+ description: "Title of the database"
2626
2641
  },
2627
- description: {
2628
- type: "array",
2629
- description: "Description of the database as rich text array (max 100)",
2630
- items: { type: "object" }
2642
+ parent: {
2643
+ type: "object",
2644
+ description: "Parent page: {page_id:'...'}. Omit for private workspace-level database.",
2645
+ properties: {
2646
+ page_id: { type: "string", description: "The ID of the parent page" }
2647
+ }
2631
2648
  }
2632
2649
  },
2633
- required: ["properties"]
2650
+ required: ["schema"]
2634
2651
  }
2635
2652
  }
2636
2653
  });
@@ -2643,7 +2660,7 @@ function notionUpdateDataSourceTool(run) {
2643
2660
  type: "function",
2644
2661
  function: {
2645
2662
  name: "notion-update-data-source",
2646
- description: "Update a Notion data source's title, description, property schema, or other attributes. Use null to remove a property. Provide only 'name' to rename a property.",
2663
+ description: `Update a Notion data source's columns, title, or other attributes. Change columns with SQL DDL in statements, for example 'ADD COLUMN "Owner" RICH_TEXT' or 'ADD COLUMN "Done" CHECKBOX'.`,
2647
2664
  arguments: {
2648
2665
  type: "object",
2649
2666
  properties: {
@@ -2651,19 +2668,13 @@ function notionUpdateDataSourceTool(run) {
2651
2668
  type: "string",
2652
2669
  description: "The ID of the data source to update (UUID). Can be a data source ID or database ID."
2653
2670
  },
2654
- title: {
2655
- type: "array",
2656
- description: "New title as rich text array (max 100)",
2657
- items: { type: "object" }
2658
- },
2659
- description: {
2660
- type: "array",
2661
- description: "New description as rich text array (max 100)",
2662
- items: { type: "object" }
2671
+ statements: {
2672
+ type: "string",
2673
+ description: "SQL DDL statements that change the columns, such as ADD COLUMN"
2663
2674
  },
2664
- properties: {
2665
- type: "object",
2666
- description: "Property schema updates. Use null to remove, {name:'...'} to rename, or full definition to add/update."
2675
+ title: {
2676
+ type: "string",
2677
+ description: "New title of the data source"
2667
2678
  },
2668
2679
  is_inline: {
2669
2680
  type: "boolean",
@@ -692,14 +692,19 @@ interface NotionCreatePagesArgs {
692
692
  parent?: Record<string, unknown>;
693
693
  }
694
694
  interface NotionUpdatePageArgs {
695
- data: {
696
- page_id: string;
697
- command: string;
698
- properties?: Record<string, unknown>;
699
- new_str?: string;
700
- selection_with_ellipsis?: string;
701
- allow_deleting_content?: boolean;
702
- };
695
+ page_id: string;
696
+ command: "update_properties" | "update_content" | "replace_content" | "insert_content" | "apply_template" | "update_verification";
697
+ content?: string;
698
+ content_updates?: Array<{
699
+ old_str: string;
700
+ new_str: string;
701
+ }>;
702
+ new_str?: string;
703
+ properties?: Record<string, unknown>;
704
+ allow_deleting_content?: boolean;
705
+ template_id?: string;
706
+ verification_status?: "verified" | "unverified";
707
+ verification_expiry_days?: number;
703
708
  }
704
709
  interface NotionMovePagesArgs {
705
710
  page_or_database_ids: string[];
@@ -692,14 +692,19 @@ interface NotionCreatePagesArgs {
692
692
  parent?: Record<string, unknown>;
693
693
  }
694
694
  interface NotionUpdatePageArgs {
695
- data: {
696
- page_id: string;
697
- command: string;
698
- properties?: Record<string, unknown>;
699
- new_str?: string;
700
- selection_with_ellipsis?: string;
701
- allow_deleting_content?: boolean;
702
- };
695
+ page_id: string;
696
+ command: "update_properties" | "update_content" | "replace_content" | "insert_content" | "apply_template" | "update_verification";
697
+ content?: string;
698
+ content_updates?: Array<{
699
+ old_str: string;
700
+ new_str: string;
701
+ }>;
702
+ new_str?: string;
703
+ properties?: Record<string, unknown>;
704
+ allow_deleting_content?: boolean;
705
+ template_id?: string;
706
+ verification_status?: "verified" | "unverified";
707
+ verification_expiry_days?: number;
703
708
  }
704
709
  interface NotionMovePagesArgs {
705
710
  page_or_database_ids: string[];
@@ -2347,49 +2347,69 @@ function notionUpdatePageTool(run) {
2347
2347
  type: "function",
2348
2348
  function: {
2349
2349
  name: "notion-update-page",
2350
- description: "Update a Notion page's properties or content. Uses command-based operations: 'update_properties' to change properties, 'replace_content' to replace all content, 'replace_content_range' to replace specific text, 'insert_content_after' to insert after text.",
2350
+ description: "Update a Notion page's properties or content. Arguments are flat: page_id, command, and the parameter that command needs. 'insert_content' appends Markdown (needs content). 'update_content' does search-and-replace edits (needs content_updates). 'replace_content' replaces all content (needs new_str). 'update_properties' changes properties (needs properties). 'apply_template' applies a template page (needs template_id). 'update_verification' marks the page verified or unverified (needs verification_status, plus optional verification_expiry_days only when verified).",
2351
2351
  arguments: {
2352
2352
  type: "object",
2353
2353
  properties: {
2354
- data: {
2355
- type: "object",
2356
- description: "Update data containing page_id and a command",
2357
- properties: {
2358
- page_id: {
2359
- type: "string",
2360
- description: "The ID of the page to update (with or without dashes)"
2361
- },
2362
- command: {
2363
- type: "string",
2364
- enum: [
2365
- "update_properties",
2366
- "replace_content",
2367
- "replace_content_range",
2368
- "insert_content_after"
2369
- ],
2370
- description: "The update command to execute"
2371
- },
2354
+ page_id: {
2355
+ type: "string",
2356
+ description: "The ID of the page to update (with or without dashes)"
2357
+ },
2358
+ command: {
2359
+ type: "string",
2360
+ enum: [
2361
+ "update_properties",
2362
+ "update_content",
2363
+ "replace_content",
2364
+ "insert_content",
2365
+ "apply_template",
2366
+ "update_verification"
2367
+ ],
2368
+ description: "The update command to execute"
2369
+ },
2370
+ content: {
2371
+ type: "string",
2372
+ description: "For insert_content: the Notion-flavored Markdown to insert"
2373
+ },
2374
+ content_updates: {
2375
+ type: "array",
2376
+ description: "For update_content: search-and-replace edits. Each old_str must match existing page text.",
2377
+ items: {
2378
+ type: "object",
2372
2379
  properties: {
2373
- type: "object",
2374
- description: "For update_properties: JSON map of property names to values. Use null to remove a value."
2375
- },
2376
- new_str: {
2377
- type: "string",
2378
- description: "For replace_content/replace_content_range/insert_content_after: the new content string"
2379
- },
2380
- selection_with_ellipsis: {
2381
- type: "string",
2382
- description: "For replace_content_range/insert_content_after: unique start and end snippet (~10 chars each with ellipsis)"
2380
+ old_str: { type: "string", description: "Existing text to replace" },
2381
+ new_str: { type: "string", description: "Replacement text" }
2383
2382
  },
2384
- allow_deleting_content: {
2385
- type: "boolean",
2386
- description: "For replace_content/replace_content_range: allow deletion of child pages/databases"
2387
- }
2388
- },
2389
- required: ["page_id", "command"]
2383
+ required: ["old_str", "new_str"]
2384
+ }
2385
+ },
2386
+ new_str: {
2387
+ type: "string",
2388
+ description: "For replace_content: the new page content in Notion-flavored Markdown"
2389
+ },
2390
+ properties: {
2391
+ type: "object",
2392
+ description: "For update_properties: JSON map of property names to values. Use null to remove a value."
2393
+ },
2394
+ allow_deleting_content: {
2395
+ type: "boolean",
2396
+ description: "For replace_content/update_content: allow deletion of child pages/databases"
2397
+ },
2398
+ template_id: {
2399
+ type: "string",
2400
+ description: "For apply_template: the ID of the template page to apply"
2401
+ },
2402
+ verification_status: {
2403
+ type: "string",
2404
+ enum: ["verified", "unverified"],
2405
+ description: "For update_verification: the new verification status"
2406
+ },
2407
+ verification_expiry_days: {
2408
+ type: "number",
2409
+ description: "For update_verification: days until the verification expires. Only allowed when verification_status is 'verified'"
2390
2410
  }
2391
2411
  },
2392
- required: ["data"]
2412
+ required: ["page_id", "command"]
2393
2413
  }
2394
2414
  }
2395
2415
  });
@@ -2451,30 +2471,27 @@ function notionCreateDatabaseTool(run) {
2451
2471
  type: "function",
2452
2472
  function: {
2453
2473
  name: "notion-create-database",
2454
- description: "Create a new Notion database with a properties schema. If no title property is provided, 'Name' is auto-added. Supports property types: title, rich_text, number, select, multi_select, date, people, checkbox, url, email, phone_number, formula, relation, rollup, status, unique_id, etc.",
2474
+ description: `Create a new Notion database. Define the columns with a SQL DDL string in schema, for example 'CREATE TABLE ("Name" TITLE, "Notes" RICH_TEXT, "Done" CHECKBOX)'.`,
2455
2475
  arguments: {
2456
2476
  type: "object",
2457
2477
  properties: {
2458
- properties: {
2459
- type: "object",
2460
- description: "Property schema for the database. Each key is a property name, value defines the type."
2461
- },
2462
- parent: {
2463
- type: "object",
2464
- description: "Parent page: {type:'page_id', page_id:'...'}. Omit for private workspace-level database."
2478
+ schema: {
2479
+ type: "string",
2480
+ description: "SQL DDL CREATE TABLE statement defining the columns, with quoted column names and types such as TITLE, RICH_TEXT, CHECKBOX"
2465
2481
  },
2466
2482
  title: {
2467
- type: "array",
2468
- description: "Title of the database as rich text array (max 100)",
2469
- items: { type: "object" }
2483
+ type: "string",
2484
+ description: "Title of the database"
2470
2485
  },
2471
- description: {
2472
- type: "array",
2473
- description: "Description of the database as rich text array (max 100)",
2474
- items: { type: "object" }
2486
+ parent: {
2487
+ type: "object",
2488
+ description: "Parent page: {page_id:'...'}. Omit for private workspace-level database.",
2489
+ properties: {
2490
+ page_id: { type: "string", description: "The ID of the parent page" }
2491
+ }
2475
2492
  }
2476
2493
  },
2477
- required: ["properties"]
2494
+ required: ["schema"]
2478
2495
  }
2479
2496
  }
2480
2497
  });
@@ -2487,7 +2504,7 @@ function notionUpdateDataSourceTool(run) {
2487
2504
  type: "function",
2488
2505
  function: {
2489
2506
  name: "notion-update-data-source",
2490
- description: "Update a Notion data source's title, description, property schema, or other attributes. Use null to remove a property. Provide only 'name' to rename a property.",
2507
+ description: `Update a Notion data source's columns, title, or other attributes. Change columns with SQL DDL in statements, for example 'ADD COLUMN "Owner" RICH_TEXT' or 'ADD COLUMN "Done" CHECKBOX'.`,
2491
2508
  arguments: {
2492
2509
  type: "object",
2493
2510
  properties: {
@@ -2495,19 +2512,13 @@ function notionUpdateDataSourceTool(run) {
2495
2512
  type: "string",
2496
2513
  description: "The ID of the data source to update (UUID). Can be a data source ID or database ID."
2497
2514
  },
2498
- title: {
2499
- type: "array",
2500
- description: "New title as rich text array (max 100)",
2501
- items: { type: "object" }
2502
- },
2503
- description: {
2504
- type: "array",
2505
- description: "New description as rich text array (max 100)",
2506
- items: { type: "object" }
2515
+ statements: {
2516
+ type: "string",
2517
+ description: "SQL DDL statements that change the columns, such as ADD COLUMN"
2507
2518
  },
2508
- properties: {
2509
- type: "object",
2510
- description: "Property schema updates. Use null to remove, {name:'...'} to rename, or full definition to add/update."
2519
+ title: {
2520
+ type: "string",
2521
+ description: "New title of the data source"
2511
2522
  },
2512
2523
  is_inline: {
2513
2524
  type: "boolean",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anuma/sdk",
3
- "version": "6.27.3",
3
+ "version": "6.27.5",
4
4
  "description": "",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",
@@ -278,7 +278,8 @@
278
278
  "hono": ">=4.12.21 <5.0.0",
279
279
  "js-cookie": ">=3.0.7 <4.0.0",
280
280
  "postcss": ">=8.5.10 <9.0.0",
281
- "dompurify": ">=3.4.11 <4.0.0",
281
+ "dompurify": ">=3.4.13 <4.0.0",
282
+ "jspdf>fflate": ">=0.8.3 <0.9.0",
282
283
  "lodash": ">=4.18.0 <5.0.0",
283
284
  "minimatch@10": ">=10.2.3 <11.0.0",
284
285
  "uuid@<11.1.1": ">=11.1.1 <12.0.0",