better-notion 1.8.1__py3-none-any.whl → 1.8.3__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.
- better_notion/_sdk/models/page.py +12 -1
- better_notion/plugins/official/agents_sdk/models.py +154 -88
- {better_notion-1.8.1.dist-info → better_notion-1.8.3.dist-info}/METADATA +1 -1
- {better_notion-1.8.1.dist-info → better_notion-1.8.3.dist-info}/RECORD +7 -7
- {better_notion-1.8.1.dist-info → better_notion-1.8.3.dist-info}/WHEEL +0 -0
- {better_notion-1.8.1.dist-info → better_notion-1.8.3.dist-info}/entry_points.txt +0 -0
- {better_notion-1.8.1.dist-info → better_notion-1.8.3.dist-info}/licenses/LICENSE +0 -0
|
@@ -180,11 +180,22 @@ class Page(BaseEntity):
|
|
|
180
180
|
if title_prop:
|
|
181
181
|
props[title_prop] = Title(name=title_prop, content=title).to_dict()
|
|
182
182
|
|
|
183
|
+
# Merge additional kwargs into properties (except for special keys)
|
|
184
|
+
# Special keys that belong at root level: icon, cover, children
|
|
185
|
+
root_level_keys = {"icon", "cover", "children"}
|
|
186
|
+
api_kwargs = {}
|
|
187
|
+
for key, value in kwargs.items():
|
|
188
|
+
if key in root_level_keys:
|
|
189
|
+
api_kwargs[key] = value
|
|
190
|
+
else:
|
|
191
|
+
# Everything else goes into properties
|
|
192
|
+
props[key] = value
|
|
193
|
+
|
|
183
194
|
# Create page via API
|
|
184
195
|
data = await client.api.pages.create(
|
|
185
196
|
parent=parent_ref,
|
|
186
197
|
properties=props,
|
|
187
|
-
**
|
|
198
|
+
**api_kwargs
|
|
188
199
|
)
|
|
189
200
|
|
|
190
201
|
page = cls(client, data)
|
|
@@ -199,7 +199,7 @@ class Organization(BaseEntity):
|
|
|
199
199
|
|
|
200
200
|
# Build properties
|
|
201
201
|
properties: dict[str, Any] = {
|
|
202
|
-
"Name": Title(name),
|
|
202
|
+
"Name": Title(content=name),
|
|
203
203
|
}
|
|
204
204
|
|
|
205
205
|
if slug:
|
|
@@ -263,20 +263,26 @@ class Organization(BaseEntity):
|
|
|
263
263
|
properties: dict[str, Any] = {}
|
|
264
264
|
|
|
265
265
|
if name is not None:
|
|
266
|
-
properties["Name"] = Title(name)
|
|
266
|
+
properties["Name"] = Title(content=name)
|
|
267
267
|
if slug is not None:
|
|
268
|
-
properties["Slug"] = RichText(slug)
|
|
268
|
+
properties["Slug"] = RichText(name="Slug", content=slug)
|
|
269
269
|
if description is not None:
|
|
270
|
-
properties["Description"] = RichText(description)
|
|
270
|
+
properties["Description"] = RichText(name="Description", content=description)
|
|
271
271
|
if repository_url is not None:
|
|
272
|
-
properties["Repository URL"] = URL(repository_url)
|
|
272
|
+
properties["Repository URL"] = URL(name="Repository URL", url=repository_url)
|
|
273
273
|
if status is not None:
|
|
274
|
-
properties["Status"] = Select(status)
|
|
274
|
+
properties["Status"] = Select(name="Status", value=status)
|
|
275
|
+
|
|
276
|
+
# Convert Property objects to dicts for API
|
|
277
|
+
serialized_properties = {
|
|
278
|
+
key: prop.to_dict() if hasattr(prop, 'to_dict') else prop
|
|
279
|
+
for key, prop in properties.items()
|
|
280
|
+
}
|
|
275
281
|
|
|
276
282
|
# Update page
|
|
277
283
|
data = await self._client._api.pages.update(
|
|
278
284
|
page_id=self.id,
|
|
279
|
-
properties=
|
|
285
|
+
properties=serialized_properties,
|
|
280
286
|
)
|
|
281
287
|
|
|
282
288
|
# Update instance
|
|
@@ -494,7 +500,7 @@ class Project(BaseEntity):
|
|
|
494
500
|
|
|
495
501
|
# Build properties
|
|
496
502
|
properties: dict[str, Any] = {
|
|
497
|
-
"Name": Title(name),
|
|
503
|
+
"Name": Title(content=name),
|
|
498
504
|
"Organization": Relation([organization_id]),
|
|
499
505
|
"Role": Select(name="Role", value=role),
|
|
500
506
|
}
|
|
@@ -549,24 +555,30 @@ class Project(BaseEntity):
|
|
|
549
555
|
properties: dict[str, Any] = {}
|
|
550
556
|
|
|
551
557
|
if name is not None:
|
|
552
|
-
properties["Name"] = Title(name)
|
|
558
|
+
properties["Name"] = Title(content=name)
|
|
553
559
|
if slug is not None:
|
|
554
|
-
properties["Slug"] = RichText(slug)
|
|
560
|
+
properties["Slug"] = RichText(name="Slug", content=slug)
|
|
555
561
|
if description is not None:
|
|
556
|
-
properties["Description"] = RichText(description)
|
|
562
|
+
properties["Description"] = RichText(name="Description", content=description)
|
|
557
563
|
if repository is not None:
|
|
558
|
-
properties["Repository"] = URL(repository)
|
|
564
|
+
properties["Repository"] = URL(name="Repository", url=repository)
|
|
559
565
|
if status is not None:
|
|
560
|
-
properties["Status"] = Select(status)
|
|
566
|
+
properties["Status"] = Select(name="Status", value=status)
|
|
561
567
|
if tech_stack is not None:
|
|
562
|
-
properties["Tech Stack"] = MultiSelect(tech_stack)
|
|
568
|
+
properties["Tech Stack"] = MultiSelect(name="Tech Stack", values=tech_stack)
|
|
563
569
|
if role is not None:
|
|
564
|
-
properties["Role"] = Select(role)
|
|
570
|
+
properties["Role"] = Select(name="Role", value=role)
|
|
571
|
+
|
|
572
|
+
# Convert Property objects to dicts for API
|
|
573
|
+
serialized_properties = {
|
|
574
|
+
key: prop.to_dict() if hasattr(prop, 'to_dict') else prop
|
|
575
|
+
for key, prop in properties.items()
|
|
576
|
+
}
|
|
565
577
|
|
|
566
578
|
# Update page
|
|
567
579
|
data = await self._client._api.pages.update(
|
|
568
580
|
page_id=self.id,
|
|
569
|
-
properties=
|
|
581
|
+
properties=serialized_properties,
|
|
570
582
|
)
|
|
571
583
|
|
|
572
584
|
# Update instance
|
|
@@ -746,15 +758,15 @@ class Version(BaseEntity):
|
|
|
746
758
|
|
|
747
759
|
# Build properties
|
|
748
760
|
properties: dict[str, Any] = {
|
|
749
|
-
"Version": Title(name),
|
|
761
|
+
"Version": Title(content=name),
|
|
750
762
|
"Project": Relation([project_id]),
|
|
751
|
-
"Status": Select(status),
|
|
752
|
-
"Type": Select(version_type),
|
|
753
|
-
"Progress": Number(progress),
|
|
763
|
+
"Status": Select(name="Status", value=status),
|
|
764
|
+
"Type": Select(name="Type", value=version_type),
|
|
765
|
+
"Progress": Number(name="Progress", value=progress),
|
|
754
766
|
}
|
|
755
767
|
|
|
756
768
|
if branch_name:
|
|
757
|
-
properties["Branch Name"] = RichText(branch_name)
|
|
769
|
+
properties["Branch Name"] = RichText(name="Branch Name", content=branch_name)
|
|
758
770
|
|
|
759
771
|
# Create page
|
|
760
772
|
data = await client._api.pages.create(
|
|
@@ -787,20 +799,26 @@ class Version(BaseEntity):
|
|
|
787
799
|
properties: dict[str, Any] = {}
|
|
788
800
|
|
|
789
801
|
if name is not None:
|
|
790
|
-
properties["Version"] = Title(name)
|
|
802
|
+
properties["Version"] = Title(content=name)
|
|
791
803
|
if status is not None:
|
|
792
|
-
properties["Status"] = Select(status)
|
|
804
|
+
properties["Status"] = Select(name="Status", value=status)
|
|
793
805
|
if version_type is not None:
|
|
794
|
-
properties["Type"] = Select(version_type)
|
|
806
|
+
properties["Type"] = Select(name="Type", value=version_type)
|
|
795
807
|
if branch_name is not None:
|
|
796
|
-
properties["Branch Name"] = RichText(branch_name)
|
|
808
|
+
properties["Branch Name"] = RichText(name="Branch Name", content=branch_name)
|
|
797
809
|
if progress is not None:
|
|
798
|
-
properties["Progress"] = Number(progress)
|
|
810
|
+
properties["Progress"] = Number(name="Progress", value=progress)
|
|
811
|
+
|
|
812
|
+
# Convert Property objects to dicts for API
|
|
813
|
+
serialized_properties = {
|
|
814
|
+
key: prop.to_dict() if hasattr(prop, 'to_dict') else prop
|
|
815
|
+
for key, prop in properties.items()
|
|
816
|
+
}
|
|
799
817
|
|
|
800
818
|
# Update page
|
|
801
819
|
data = await self._client._api.pages.update(
|
|
802
820
|
page_id=self.id,
|
|
803
|
-
properties=
|
|
821
|
+
properties=serialized_properties,
|
|
804
822
|
)
|
|
805
823
|
|
|
806
824
|
# Update instance
|
|
@@ -1001,22 +1019,28 @@ class Task(BaseEntity):
|
|
|
1001
1019
|
|
|
1002
1020
|
# Build properties
|
|
1003
1021
|
properties: dict[str, Any] = {
|
|
1004
|
-
"Title": Title(title),
|
|
1022
|
+
"Title": Title(content=title),
|
|
1005
1023
|
"Version": Relation([version_id]),
|
|
1006
|
-
"Status": Select(status),
|
|
1007
|
-
"Type": Select(task_type),
|
|
1008
|
-
"Priority": Select(priority),
|
|
1024
|
+
"Status": Select(name="Status", value=status),
|
|
1025
|
+
"Type": Select(name="Type", value=task_type),
|
|
1026
|
+
"Priority": Select(name="Priority", value=priority),
|
|
1009
1027
|
}
|
|
1010
1028
|
|
|
1011
1029
|
if dependency_ids:
|
|
1012
1030
|
properties["Dependencies"] = Relation(dependency_ids)
|
|
1013
1031
|
if estimated_hours is not None:
|
|
1014
|
-
properties["Estimated Hours"] = Number(estimated_hours)
|
|
1032
|
+
properties["Estimated Hours"] = Number(name="Estimated Hours", value=estimated_hours)
|
|
1033
|
+
|
|
1034
|
+
# Convert Property objects to dicts for API
|
|
1035
|
+
serialized_properties = {
|
|
1036
|
+
key: prop.to_dict() if hasattr(prop, 'to_dict') else prop
|
|
1037
|
+
for key, prop in properties.items()
|
|
1038
|
+
}
|
|
1015
1039
|
|
|
1016
1040
|
# Create page
|
|
1017
1041
|
data = await client._api.pages.create(
|
|
1018
1042
|
parent={"database_id": database_id},
|
|
1019
|
-
properties=
|
|
1043
|
+
properties=serialized_properties,
|
|
1020
1044
|
)
|
|
1021
1045
|
|
|
1022
1046
|
task = cls(client, data)
|
|
@@ -1046,24 +1070,30 @@ class Task(BaseEntity):
|
|
|
1046
1070
|
properties: dict[str, Any] = {}
|
|
1047
1071
|
|
|
1048
1072
|
if title is not None:
|
|
1049
|
-
properties["Title"] = Title(title)
|
|
1073
|
+
properties["Title"] = Title(content=title)
|
|
1050
1074
|
if status is not None:
|
|
1051
|
-
properties["Status"] = Select(status)
|
|
1075
|
+
properties["Status"] = Select(name="Status", value=status)
|
|
1052
1076
|
if task_type is not None:
|
|
1053
|
-
properties["Type"] = Select(task_type)
|
|
1077
|
+
properties["Type"] = Select(name="Type", value=task_type)
|
|
1054
1078
|
if priority is not None:
|
|
1055
|
-
properties["Priority"] = Select(priority)
|
|
1079
|
+
properties["Priority"] = Select(name="Priority", value=priority)
|
|
1056
1080
|
if dependency_ids is not None:
|
|
1057
1081
|
properties["Dependencies"] = Relation(dependency_ids)
|
|
1058
1082
|
if estimated_hours is not None:
|
|
1059
|
-
properties["Estimated Hours"] = Number(estimated_hours)
|
|
1083
|
+
properties["Estimated Hours"] = Number(name="Estimated Hours", value=estimated_hours)
|
|
1060
1084
|
if actual_hours is not None:
|
|
1061
|
-
properties["Actual Hours"] = Number(actual_hours)
|
|
1085
|
+
properties["Actual Hours"] = Number(name="Actual Hours", value=actual_hours)
|
|
1086
|
+
|
|
1087
|
+
# Convert Property objects to dicts for API
|
|
1088
|
+
serialized_properties = {
|
|
1089
|
+
key: prop.to_dict() if hasattr(prop, 'to_dict') else prop
|
|
1090
|
+
for key, prop in properties.items()
|
|
1091
|
+
}
|
|
1062
1092
|
|
|
1063
1093
|
# Update page
|
|
1064
1094
|
data = await self._client._api.pages.update(
|
|
1065
1095
|
page_id=self.id,
|
|
1066
|
-
properties=
|
|
1096
|
+
properties=serialized_properties,
|
|
1067
1097
|
)
|
|
1068
1098
|
|
|
1069
1099
|
# Update instance
|
|
@@ -1336,26 +1366,32 @@ class Idea(BaseEntity):
|
|
|
1336
1366
|
from better_notion._api.properties import Title, RichText, Select, Relation
|
|
1337
1367
|
|
|
1338
1368
|
properties: dict[str, Any] = {
|
|
1339
|
-
"Title": Title(title),
|
|
1340
|
-
"Category": Select(category),
|
|
1341
|
-
"Status": Select(status),
|
|
1342
|
-
"Effort Estimate": Select(effort_estimate),
|
|
1369
|
+
"Title": Title(content=title),
|
|
1370
|
+
"Category": Select(name="Category", value=category),
|
|
1371
|
+
"Status": Select(name="Status", value=status),
|
|
1372
|
+
"Effort Estimate": Select(name="Effort Estimate", value=effort_estimate),
|
|
1343
1373
|
}
|
|
1344
1374
|
|
|
1345
1375
|
if description:
|
|
1346
|
-
properties["Description"] = RichText(description)
|
|
1376
|
+
properties["Description"] = RichText(name="Description", content=description)
|
|
1347
1377
|
if proposed_solution:
|
|
1348
|
-
properties["Proposed Solution"] = RichText(proposed_solution)
|
|
1378
|
+
properties["Proposed Solution"] = RichText(name="Proposed Solution", content=proposed_solution)
|
|
1349
1379
|
if benefits:
|
|
1350
|
-
properties["Benefits"] = RichText(benefits)
|
|
1380
|
+
properties["Benefits"] = RichText(name="Benefits", content=benefits)
|
|
1351
1381
|
if context:
|
|
1352
|
-
properties["Context"] = RichText(context)
|
|
1382
|
+
properties["Context"] = RichText(name="Context", content=context)
|
|
1353
1383
|
if project_id:
|
|
1354
1384
|
properties["Project"] = Relation([project_id])
|
|
1355
1385
|
|
|
1386
|
+
# Convert Property objects to dicts for API
|
|
1387
|
+
serialized_properties = {
|
|
1388
|
+
key: prop.to_dict() if hasattr(prop, 'to_dict') else prop
|
|
1389
|
+
for key, prop in properties.items()
|
|
1390
|
+
}
|
|
1391
|
+
|
|
1356
1392
|
data = await client._api.pages.create(
|
|
1357
1393
|
parent={"database_id": database_id},
|
|
1358
|
-
properties=
|
|
1394
|
+
properties=serialized_properties,
|
|
1359
1395
|
)
|
|
1360
1396
|
|
|
1361
1397
|
idea = cls(client, data)
|
|
@@ -1384,25 +1420,31 @@ class Idea(BaseEntity):
|
|
|
1384
1420
|
properties: dict[str, Any] = {}
|
|
1385
1421
|
|
|
1386
1422
|
if title is not None:
|
|
1387
|
-
properties["Title"] = Title(title)
|
|
1423
|
+
properties["Title"] = Title(content=title)
|
|
1388
1424
|
if category is not None:
|
|
1389
|
-
properties["Category"] = Select(category)
|
|
1425
|
+
properties["Category"] = Select(name="Category", value=category)
|
|
1390
1426
|
if status is not None:
|
|
1391
|
-
properties["Status"] = Select(status)
|
|
1427
|
+
properties["Status"] = Select(name="Status", value=status)
|
|
1392
1428
|
if description is not None:
|
|
1393
|
-
properties["Description"] = RichText(description)
|
|
1429
|
+
properties["Description"] = RichText(name="Description", content=description)
|
|
1394
1430
|
if proposed_solution is not None:
|
|
1395
|
-
properties["Proposed Solution"] = RichText(proposed_solution)
|
|
1431
|
+
properties["Proposed Solution"] = RichText(name="Proposed Solution", content=proposed_solution)
|
|
1396
1432
|
if benefits is not None:
|
|
1397
|
-
properties["Benefits"] = RichText(benefits)
|
|
1433
|
+
properties["Benefits"] = RichText(name="Benefits", content=benefits)
|
|
1398
1434
|
if effort_estimate is not None:
|
|
1399
|
-
properties["Effort Estimate"] = Select(effort_estimate)
|
|
1435
|
+
properties["Effort Estimate"] = Select(name="Effort Estimate", value=effort_estimate)
|
|
1400
1436
|
if context is not None:
|
|
1401
|
-
properties["Context"] = RichText(context)
|
|
1437
|
+
properties["Context"] = RichText(name="Context", content=context)
|
|
1438
|
+
|
|
1439
|
+
# Convert Property objects to dicts for API
|
|
1440
|
+
serialized_properties = {
|
|
1441
|
+
key: prop.to_dict() if hasattr(prop, 'to_dict') else prop
|
|
1442
|
+
for key, prop in properties.items()
|
|
1443
|
+
}
|
|
1402
1444
|
|
|
1403
1445
|
data = await self._client._api.pages.update(
|
|
1404
1446
|
page_id=self.id,
|
|
1405
|
-
properties=
|
|
1447
|
+
properties=serialized_properties,
|
|
1406
1448
|
)
|
|
1407
1449
|
|
|
1408
1450
|
self._data = data
|
|
@@ -1712,25 +1754,31 @@ class WorkIssue(BaseEntity):
|
|
|
1712
1754
|
from better_notion._api.properties import Title, RichText, Select, Relation
|
|
1713
1755
|
|
|
1714
1756
|
properties: dict[str, Any] = {
|
|
1715
|
-
"Title": Title(title),
|
|
1757
|
+
"Title": Title(content=title),
|
|
1716
1758
|
"Project": Relation([project_id]),
|
|
1717
|
-
"Type": Select(type),
|
|
1718
|
-
"Severity": Select(severity),
|
|
1719
|
-
"Status": Select(status),
|
|
1759
|
+
"Type": Select(name="Type", value=type),
|
|
1760
|
+
"Severity": Select(name="Severity", value=severity),
|
|
1761
|
+
"Status": Select(name="Status", value=status),
|
|
1720
1762
|
}
|
|
1721
1763
|
|
|
1722
1764
|
if task_id:
|
|
1723
1765
|
properties["Task"] = Relation([task_id])
|
|
1724
1766
|
if description:
|
|
1725
|
-
properties["Description"] = RichText(description)
|
|
1767
|
+
properties["Description"] = RichText(name="Description", content=description)
|
|
1726
1768
|
if context:
|
|
1727
|
-
properties["Context"] = RichText(context)
|
|
1769
|
+
properties["Context"] = RichText(name="Context", content=context)
|
|
1728
1770
|
if proposed_solution:
|
|
1729
|
-
properties["Proposed Solution"] = RichText(proposed_solution)
|
|
1771
|
+
properties["Proposed Solution"] = RichText(name="Proposed Solution", content=proposed_solution)
|
|
1772
|
+
|
|
1773
|
+
# Convert Property objects to dicts for API
|
|
1774
|
+
serialized_properties = {
|
|
1775
|
+
key: prop.to_dict() if hasattr(prop, 'to_dict') else prop
|
|
1776
|
+
for key, prop in properties.items()
|
|
1777
|
+
}
|
|
1730
1778
|
|
|
1731
1779
|
data = await client._api.pages.create(
|
|
1732
1780
|
parent={"database_id": database_id},
|
|
1733
|
-
properties=
|
|
1781
|
+
properties=serialized_properties,
|
|
1734
1782
|
)
|
|
1735
1783
|
|
|
1736
1784
|
issue = cls(client, data)
|
|
@@ -1758,23 +1806,29 @@ class WorkIssue(BaseEntity):
|
|
|
1758
1806
|
properties: dict[str, Any] = {}
|
|
1759
1807
|
|
|
1760
1808
|
if title is not None:
|
|
1761
|
-
properties["Title"] = Title(title)
|
|
1809
|
+
properties["Title"] = Title(content=title)
|
|
1762
1810
|
if type is not None:
|
|
1763
|
-
properties["Type"] = Select(type)
|
|
1811
|
+
properties["Type"] = Select(name="Type", value=type)
|
|
1764
1812
|
if severity is not None:
|
|
1765
|
-
properties["Severity"] = Select(severity)
|
|
1813
|
+
properties["Severity"] = Select(name="Severity", value=severity)
|
|
1766
1814
|
if status is not None:
|
|
1767
|
-
properties["Status"] = Select(status)
|
|
1815
|
+
properties["Status"] = Select(name="Status", value=status)
|
|
1768
1816
|
if description is not None:
|
|
1769
|
-
properties["Description"] = RichText(description)
|
|
1817
|
+
properties["Description"] = RichText(name="Description", content=description)
|
|
1770
1818
|
if context is not None:
|
|
1771
|
-
properties["Context"] = RichText(context)
|
|
1819
|
+
properties["Context"] = RichText(name="Context", content=context)
|
|
1772
1820
|
if proposed_solution is not None:
|
|
1773
|
-
properties["Proposed Solution"] = RichText(proposed_solution)
|
|
1821
|
+
properties["Proposed Solution"] = RichText(name="Proposed Solution", content=proposed_solution)
|
|
1822
|
+
|
|
1823
|
+
# Convert Property objects to dicts for API
|
|
1824
|
+
serialized_properties = {
|
|
1825
|
+
key: prop.to_dict() if hasattr(prop, 'to_dict') else prop
|
|
1826
|
+
for key, prop in properties.items()
|
|
1827
|
+
}
|
|
1774
1828
|
|
|
1775
1829
|
data = await self._client._api.pages.update(
|
|
1776
1830
|
page_id=self.id,
|
|
1777
|
-
properties=
|
|
1831
|
+
properties=serialized_properties,
|
|
1778
1832
|
)
|
|
1779
1833
|
|
|
1780
1834
|
self._data = data
|
|
@@ -2062,18 +2116,24 @@ class Incident(BaseEntity):
|
|
|
2062
2116
|
from better_notion._api.properties import Title, Date, Select, Relation
|
|
2063
2117
|
|
|
2064
2118
|
properties: dict[str, Any] = {
|
|
2065
|
-
"Title": Title(title),
|
|
2119
|
+
"Title": Title(content=title),
|
|
2066
2120
|
"Project": Relation([project_id]),
|
|
2067
2121
|
"Affected Version": Relation([affected_version_id]),
|
|
2068
|
-
"Severity": Select(severity),
|
|
2069
|
-
"Type": Select(type),
|
|
2070
|
-
"Status": Select(status),
|
|
2071
|
-
"Discovery Date": Date(discovery_date or datetime.now().isoformat()),
|
|
2122
|
+
"Severity": Select(name="Severity", value=severity),
|
|
2123
|
+
"Type": Select(name="Type", value=type),
|
|
2124
|
+
"Status": Select(name="Status", value=status),
|
|
2125
|
+
"Discovery Date": Date(name="Discovery Date", value=discovery_date or datetime.now().isoformat()),
|
|
2126
|
+
}
|
|
2127
|
+
|
|
2128
|
+
# Convert Property objects to dicts for API
|
|
2129
|
+
serialized_properties = {
|
|
2130
|
+
key: prop.to_dict() if hasattr(prop, 'to_dict') else prop
|
|
2131
|
+
for key, prop in properties.items()
|
|
2072
2132
|
}
|
|
2073
2133
|
|
|
2074
2134
|
data = await client._api.pages.create(
|
|
2075
2135
|
parent={"database_id": database_id},
|
|
2076
|
-
properties=
|
|
2136
|
+
properties=serialized_properties,
|
|
2077
2137
|
)
|
|
2078
2138
|
|
|
2079
2139
|
incident = cls(client, data)
|
|
@@ -2099,19 +2159,25 @@ class Incident(BaseEntity):
|
|
|
2099
2159
|
properties: dict[str, Any] = {}
|
|
2100
2160
|
|
|
2101
2161
|
if title is not None:
|
|
2102
|
-
properties["Title"] = Title(title)
|
|
2162
|
+
properties["Title"] = Title(content=title)
|
|
2103
2163
|
if severity is not None:
|
|
2104
|
-
properties["Severity"] = Select(severity)
|
|
2164
|
+
properties["Severity"] = Select(name="Severity", value=severity)
|
|
2105
2165
|
if status is not None:
|
|
2106
|
-
properties["Status"] = Select(status)
|
|
2166
|
+
properties["Status"] = Select(name="Status", value=status)
|
|
2107
2167
|
if root_cause is not None:
|
|
2108
|
-
properties["Root Cause"] = RichText(root_cause)
|
|
2168
|
+
properties["Root Cause"] = RichText(name="Root Cause", content=root_cause)
|
|
2109
2169
|
if resolved_date is not None:
|
|
2110
|
-
properties["Resolved Date"] = Date(resolved_date)
|
|
2170
|
+
properties["Resolved Date"] = Date(name="Resolved Date", value=resolved_date)
|
|
2171
|
+
|
|
2172
|
+
# Convert Property objects to dicts for API
|
|
2173
|
+
serialized_properties = {
|
|
2174
|
+
key: prop.to_dict() if hasattr(prop, 'to_dict') else prop
|
|
2175
|
+
for key, prop in properties.items()
|
|
2176
|
+
}
|
|
2111
2177
|
|
|
2112
2178
|
data = await self._client._api.pages.update(
|
|
2113
2179
|
page_id=self.id,
|
|
2114
|
-
properties=
|
|
2180
|
+
properties=serialized_properties,
|
|
2115
2181
|
)
|
|
2116
2182
|
|
|
2117
2183
|
self._data = data
|
|
@@ -2162,8 +2228,8 @@ class Incident(BaseEntity):
|
|
|
2162
2228
|
await self._client._api.pages.update(
|
|
2163
2229
|
page_id=self.id,
|
|
2164
2230
|
properties={
|
|
2165
|
-
"Fix Task": Relation([task_id]),
|
|
2166
|
-
"Status": Select("Fix in Progress"),
|
|
2231
|
+
"Fix Task": Relation([task_id]).to_dict(),
|
|
2232
|
+
"Status": Select(name="Status", value="Fix in Progress").to_dict(),
|
|
2167
2233
|
},
|
|
2168
2234
|
)
|
|
2169
2235
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: better-notion
|
|
3
|
-
Version: 1.8.
|
|
3
|
+
Version: 1.8.3
|
|
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
|
|
@@ -70,7 +70,7 @@ better_notion/_sdk/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJW
|
|
|
70
70
|
better_notion/_sdk/models/block.py,sha256=4Wpx46zVUy0LrwE2eEvUof37iyflmY-nL-NttC7o8tI,15163
|
|
71
71
|
better_notion/_sdk/models/comment.py,sha256=R82jfAhQODNCdvVywv8dIrmA9lfKgkI8ZSKThQFvG98,8485
|
|
72
72
|
better_notion/_sdk/models/database.py,sha256=NaplivKjbbxnpYtB19f80yY6075tHZWuvimCPA9j0h4,16746
|
|
73
|
-
better_notion/_sdk/models/page.py,sha256=
|
|
73
|
+
better_notion/_sdk/models/page.py,sha256=bKthDi2UJW2OhT5HHgMtLihTKzC6Zdcj7LQy5OjBHtE,21084
|
|
74
74
|
better_notion/_sdk/models/user.py,sha256=1yo4F7horPDf7m9Z1Xl1VGxcmgG7vCn_pEFj_oiPyVo,10261
|
|
75
75
|
better_notion/_sdk/models/blocks/__init__.py,sha256=8kykYs4cvuBlgn6R1tq7b5RMJu7ng7IcWA-0y7kww6A,1928
|
|
76
76
|
better_notion/_sdk/models/blocks/audio.py,sha256=tlP6oO9VLgs3c5k1kq8y5B56J719bsHUd4QMytR3GUU,2956
|
|
@@ -117,7 +117,7 @@ better_notion/plugins/official/agents_schema.py,sha256=NQRAJFoBAXRuxB9_9Eaf-4tVt
|
|
|
117
117
|
better_notion/plugins/official/productivity.py,sha256=_-whP4pYA4HufE1aUFbIdhrjU-O9njI7xUO_Id2M1J8,8726
|
|
118
118
|
better_notion/plugins/official/agents_sdk/__init__.py,sha256=luQBzZLsJ7fC5U0jFu8dfzMviiXj2SBZXcTohM53wkQ,725
|
|
119
119
|
better_notion/plugins/official/agents_sdk/managers.py,sha256=0zMZPu63zhdyqiudO2gKsmM3YOJh0nFAR9FrMlwkV2A,31186
|
|
120
|
-
better_notion/plugins/official/agents_sdk/models.py,sha256=
|
|
120
|
+
better_notion/plugins/official/agents_sdk/models.py,sha256=qrgu6E80wJq_lLEHh3jVJfuJ8uwmBA8aypKeLP4P4E8,80341
|
|
121
121
|
better_notion/plugins/official/agents_sdk/plugin.py,sha256=bs9O8Unv6SARGj4lBU5Gj9HGbLTUNqTacJ3RLUhdbI4,4479
|
|
122
122
|
better_notion/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
123
123
|
better_notion/utils/helpers.py,sha256=HgFuUQlG_HzBOB0z2GA9RxPLoXgwRc0DIxa9Fg6C-Jk,2337
|
|
@@ -132,8 +132,8 @@ better_notion/utils/agents/rbac.py,sha256=8ZA8Y7wbOiVZDbpjpH7iC35SZrZ0jl4fcJ3xWC
|
|
|
132
132
|
better_notion/utils/agents/schemas.py,sha256=eHfGhY90FAPXA3E8qE6gP75dgNzn-9z5Ju1FMwBKnQQ,22120
|
|
133
133
|
better_notion/utils/agents/state_machine.py,sha256=xUBEeDTbU1Xq-rsRo2sbr6AUYpYrV9DTHOtZT2cWES8,6699
|
|
134
134
|
better_notion/utils/agents/workspace.py,sha256=Uy8bqLsT_VFGYAPoiQJNuCvGdjMceaSiVGbR9saMpoU,16558
|
|
135
|
-
better_notion-1.8.
|
|
136
|
-
better_notion-1.8.
|
|
137
|
-
better_notion-1.8.
|
|
138
|
-
better_notion-1.8.
|
|
139
|
-
better_notion-1.8.
|
|
135
|
+
better_notion-1.8.3.dist-info/METADATA,sha256=KU9Yunh85byLx9y_lw6uNtP4UPmHlC6tzEOphJNQDe0,11096
|
|
136
|
+
better_notion-1.8.3.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
137
|
+
better_notion-1.8.3.dist-info/entry_points.txt,sha256=D0bUcP7Z00Zyjxw7r2p29T95UrwioDO0aGDoHe9I6fo,55
|
|
138
|
+
better_notion-1.8.3.dist-info/licenses/LICENSE,sha256=BAdN3JpgMY_y_fWqZSCFSvSbC2mTHP-BKDAzF5FXQAI,1069
|
|
139
|
+
better_notion-1.8.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|