better-notion 2.1.4__py3-none-any.whl → 2.1.5__py3-none-any.whl

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.
@@ -522,7 +522,13 @@ class WorkIssueSchema:
522
522
 
523
523
  @staticmethod
524
524
  def get_schema() -> Dict[str, Dict[str, Any]]:
525
- """Return Notion database schema for Work Issues."""
525
+ """Return Notion database schema for Work Issues.
526
+
527
+ Note: The following properties are NOT included here and will be added
528
+ after database creation via database.update():
529
+ - "Blocking Tasks": Relation to Tasks (added in post-processing)
530
+ - "Caused Incidents": Relation to Incidents (Incidents created after Work Issues)
531
+ """
526
532
  return {
527
533
  "Title": PropertyBuilder.title("Title"),
528
534
  "Project": PropertyBuilder.relation("Project"),
@@ -561,10 +567,6 @@ class WorkIssueSchema:
561
567
  "Proposed Solution": PropertyBuilder.text("Proposed Solution"),
562
568
  "Related Idea": PropertyBuilder.relation("Related Idea", dual_property=False),
563
569
  "Fix Tasks": PropertyBuilder.relation("Fix Tasks", dual_property=False),
564
- # Blocking Tasks: Tasks blocked by this work issue (will be updated after database creation)
565
- "Blocking Tasks": PropertyBuilder.relation("Blocking Tasks", dual_property=False),
566
- # Caused Incidents: Incidents caused by this work issue (will be updated after database creation)
567
- "Caused Incidents": PropertyBuilder.relation("Caused Incidents", dual_property=False),
568
570
  }
569
571
 
570
572
 
@@ -573,7 +575,11 @@ class IncidentSchema:
573
575
 
574
576
  @staticmethod
575
577
  def get_schema() -> Dict[str, Dict[str, Any]]:
576
- """Return Notion database schema for Incidents."""
578
+ """Return Notion database schema for Incidents.
579
+
580
+ Note: "Root Cause Work Issue" is NOT included here and will be added
581
+ after database creation via database.update() for consistency.
582
+ """
577
583
  return {
578
584
  "Title": PropertyBuilder.title("Title"),
579
585
  "Project": PropertyBuilder.relation("Project"),
@@ -607,8 +613,6 @@ class IncidentSchema:
607
613
  ],
608
614
  ),
609
615
  "Fix Task": PropertyBuilder.relation("Fix Task", dual_property=False),
610
- # Root Cause Work Issue: Relation to Work Issues (will be updated after database creation)
611
- "Root Cause Work Issue": PropertyBuilder.relation("Root Cause Work Issue", dual_property=False),
612
616
  "Root Cause": PropertyBuilder.text("Root Cause"),
613
617
  "Detected Date": PropertyBuilder.date("Detected Date"),
614
618
  "Resolved Date": PropertyBuilder.date("Resolved Date"),
@@ -403,11 +403,13 @@ class WorkspaceInitializer:
403
403
  async def _update_cross_database_relations(self) -> None:
404
404
  """Update cross-database relations after all databases are created.
405
405
 
406
- This updates:
407
- - Tasks: Related Work Issue -> Work Issues
408
- - Work Issues: Blocking Tasks -> Tasks
409
- - Work Issues: Caused Incidents -> Incidents
406
+ This adds:
407
+ - Tasks: Dependencies (self-referential), Related Work Issue -> Work Issues
408
+ - Work Issues: Blocking Tasks -> Tasks, Caused Incidents -> Incidents
410
409
  - Incidents: Root Cause Work Issue -> Work Issues
410
+
411
+ All these properties are added AFTER database creation because they
412
+ reference databases that may not exist yet during initial creation.
411
413
  """
412
414
  if "tasks" in self._database_ids:
413
415
  await self._update_relation(
@@ -491,6 +493,42 @@ class WorkspaceInitializer:
491
493
  }
492
494
  }
493
495
  }
496
+ elif property_name == "Blocking Tasks":
497
+ # Relation from Work Issues to Tasks
498
+ schema[property_name] = {
499
+ "relation": {
500
+ "database_id": target_database_id,
501
+ "type": "dual_property",
502
+ "dual_property": {
503
+ "synced_property_name": "Blocked By Work Issue",
504
+ "synced_property_type": "relation"
505
+ }
506
+ }
507
+ }
508
+ elif property_name == "Caused Incidents":
509
+ # Relation from Work Issues to Incidents
510
+ schema[property_name] = {
511
+ "relation": {
512
+ "database_id": target_database_id,
513
+ "type": "dual_property",
514
+ "dual_property": {
515
+ "synced_property_name": "Root Cause Work Issue",
516
+ "synced_property_type": "relation"
517
+ }
518
+ }
519
+ }
520
+ elif property_name == "Root Cause Work Issue":
521
+ # Relation from Incidents to Work Issues
522
+ schema[property_name] = {
523
+ "relation": {
524
+ "database_id": target_database_id,
525
+ "type": "dual_property",
526
+ "dual_property": {
527
+ "synced_property_name": "Caused Incidents",
528
+ "synced_property_type": "relation"
529
+ }
530
+ }
531
+ }
494
532
  else:
495
533
  # Generic relation
496
534
  schema[property_name] = {
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: better-notion
3
- Version: 2.1.4
3
+ Version: 2.1.5
4
4
  Summary: A high-level Python SDK for the Notion API with developer experience in mind.
5
5
  Project-URL: Homepage, https://github.com/nesalia-inc/better-notion
6
6
  Project-URL: Documentation, https://github.com/nesalia-inc/better-notion#readme
@@ -130,11 +130,11 @@ better_notion/utils/agents/dependency_resolver.py,sha256=PfHHDIQztGih4LwylMb0_My
130
130
  better_notion/utils/agents/metadata.py,sha256=thQSXfYx9mWgmBud8HtlNTLr5SwH6E_O1AjSNSnMFoo,6614
131
131
  better_notion/utils/agents/project_context.py,sha256=aJlzy5H2rL4sAfW2jHL_3K2VkBJ4ihUhCRVolkpuO78,7477
132
132
  better_notion/utils/agents/rbac.py,sha256=8ZA8Y7wbOiVZDbpjpH7iC35SZrZ0jl4fcJ3xWCm3SsE,11820
133
- better_notion/utils/agents/schemas.py,sha256=NVrNxiQmBbUvjF03UirGr8GZF7jl4arqL6F3JCalH1E,22873
133
+ better_notion/utils/agents/schemas.py,sha256=2QF71tL-lt_n7u-oizVDMj4nd29fl8uUbhMKTWxNzr4,22721
134
134
  better_notion/utils/agents/state_machine.py,sha256=xUBEeDTbU1Xq-rsRo2sbr6AUYpYrV9DTHOtZT2cWES8,6699
135
- better_notion/utils/agents/workspace.py,sha256=3FBoD3p1WQ0LTX0Nl1ahlAMI3ep0HxLy8qg-2E2YGNI,23182
136
- better_notion-2.1.4.dist-info/METADATA,sha256=y1wGfmPtKsfugifAJEalb4WJNEFh5mdLgonDyq7pNWE,11096
137
- better_notion-2.1.4.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
138
- better_notion-2.1.4.dist-info/entry_points.txt,sha256=D0bUcP7Z00Zyjxw7r2p29T95UrwioDO0aGDoHe9I6fo,55
139
- better_notion-2.1.4.dist-info/licenses/LICENSE,sha256=BAdN3JpgMY_y_fWqZSCFSvSbC2mTHP-BKDAzF5FXQAI,1069
140
- better_notion-2.1.4.dist-info/RECORD,,
135
+ better_notion/utils/agents/workspace.py,sha256=zmJ2BRklEBC9fzB1AudA33h-yvFYvm1iSR2huc60oE4,25007
136
+ better_notion-2.1.5.dist-info/METADATA,sha256=bF0A80PsoJc2QHKhiYMB14I89zMtUbrCz_LkzadHVGs,11096
137
+ better_notion-2.1.5.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
138
+ better_notion-2.1.5.dist-info/entry_points.txt,sha256=D0bUcP7Z00Zyjxw7r2p29T95UrwioDO0aGDoHe9I6fo,55
139
+ better_notion-2.1.5.dist-info/licenses/LICENSE,sha256=BAdN3JpgMY_y_fWqZSCFSvSbC2mTHP-BKDAzF5FXQAI,1069
140
+ better_notion-2.1.5.dist-info/RECORD,,