devrev-Python-SDK 2.8.1__py3-none-any.whl → 2.9.0__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.
- devrev/services/articles.py +37 -2
- devrev_mcp/tools/articles.py +9 -0
- {devrev_python_sdk-2.8.1.dist-info → devrev_python_sdk-2.9.0.dist-info}/METADATA +8 -1
- {devrev_python_sdk-2.8.1.dist-info → devrev_python_sdk-2.9.0.dist-info}/RECORD +6 -6
- {devrev_python_sdk-2.8.1.dist-info → devrev_python_sdk-2.9.0.dist-info}/WHEEL +0 -0
- {devrev_python_sdk-2.8.1.dist-info → devrev_python_sdk-2.9.0.dist-info}/entry_points.txt +0 -0
devrev/services/articles.py
CHANGED
|
@@ -21,6 +21,7 @@ from devrev.models.articles import (
|
|
|
21
21
|
ArticlesListResponse,
|
|
22
22
|
ArticleStatus,
|
|
23
23
|
ArticlesUpdateRequest,
|
|
24
|
+
ArticlesUpdateRequestAppliesToParts,
|
|
24
25
|
ArticlesUpdateResponse,
|
|
25
26
|
ArticleType,
|
|
26
27
|
ArticleWithContent,
|
|
@@ -437,6 +438,7 @@ class ArticlesService(BaseService):
|
|
|
437
438
|
content: str | None = None,
|
|
438
439
|
description: str | None = None,
|
|
439
440
|
status: ArticleStatus | None = None,
|
|
441
|
+
applies_to_parts: builtins.list[str] | None = None,
|
|
440
442
|
) -> Article:
|
|
441
443
|
"""Update article metadata and/or content.
|
|
442
444
|
|
|
@@ -451,6 +453,7 @@ class ArticlesService(BaseService):
|
|
|
451
453
|
content: Optional new article body content
|
|
452
454
|
description: Optional new metadata description
|
|
453
455
|
status: Optional new status
|
|
456
|
+
applies_to_parts: Optional list of part IDs to associate with
|
|
454
457
|
|
|
455
458
|
Returns:
|
|
456
459
|
Updated article
|
|
@@ -478,6 +481,12 @@ class ArticlesService(BaseService):
|
|
|
478
481
|
... title="New Title",
|
|
479
482
|
... content="<html>New content...</html>"
|
|
480
483
|
... )
|
|
484
|
+
>>>
|
|
485
|
+
>>> # Update applies_to_parts
|
|
486
|
+
>>> article = client.articles.update_with_content(
|
|
487
|
+
... "ART-123",
|
|
488
|
+
... applies_to_parts=["don:core:...:capability/6"]
|
|
489
|
+
... )
|
|
481
490
|
"""
|
|
482
491
|
if not self._parent_client:
|
|
483
492
|
raise DevRevError(
|
|
@@ -489,13 +498,25 @@ class ArticlesService(BaseService):
|
|
|
489
498
|
if content is not None:
|
|
490
499
|
self.update_content(id, content)
|
|
491
500
|
|
|
501
|
+
# Build applies_to_parts wrapper if provided
|
|
502
|
+
applies_to_parts_req = None
|
|
503
|
+
if applies_to_parts is not None:
|
|
504
|
+
applies_to_parts_req = ArticlesUpdateRequestAppliesToParts(set=applies_to_parts)
|
|
505
|
+
|
|
492
506
|
# Update metadata if any metadata fields provided
|
|
493
|
-
|
|
507
|
+
has_metadata = (
|
|
508
|
+
title is not None
|
|
509
|
+
or description is not None
|
|
510
|
+
or status is not None
|
|
511
|
+
or applies_to_parts is not None
|
|
512
|
+
)
|
|
513
|
+
if has_metadata:
|
|
494
514
|
update_req = ArticlesUpdateRequest(
|
|
495
515
|
id=id,
|
|
496
516
|
title=title,
|
|
497
517
|
description=description,
|
|
498
518
|
status=status,
|
|
519
|
+
applies_to_parts=applies_to_parts_req,
|
|
499
520
|
)
|
|
500
521
|
return self.update(update_req)
|
|
501
522
|
|
|
@@ -822,6 +843,7 @@ class AsyncArticlesService(AsyncBaseService):
|
|
|
822
843
|
content: str | None = None,
|
|
823
844
|
description: str | None = None,
|
|
824
845
|
status: ArticleStatus | None = None,
|
|
846
|
+
applies_to_parts: builtins.list[str] | None = None,
|
|
825
847
|
) -> Article:
|
|
826
848
|
"""Update article metadata and/or content (async).
|
|
827
849
|
|
|
@@ -836,6 +858,7 @@ class AsyncArticlesService(AsyncBaseService):
|
|
|
836
858
|
content: Optional new article body content
|
|
837
859
|
description: Optional new metadata description
|
|
838
860
|
status: Optional new status
|
|
861
|
+
applies_to_parts: Optional list of part IDs to associate with
|
|
839
862
|
|
|
840
863
|
Returns:
|
|
841
864
|
Updated article
|
|
@@ -853,13 +876,25 @@ class AsyncArticlesService(AsyncBaseService):
|
|
|
853
876
|
if content is not None:
|
|
854
877
|
await self.update_content(id, content)
|
|
855
878
|
|
|
879
|
+
# Build applies_to_parts wrapper if provided
|
|
880
|
+
applies_to_parts_req = None
|
|
881
|
+
if applies_to_parts is not None:
|
|
882
|
+
applies_to_parts_req = ArticlesUpdateRequestAppliesToParts(set=applies_to_parts)
|
|
883
|
+
|
|
856
884
|
# Update metadata if any metadata fields provided
|
|
857
|
-
|
|
885
|
+
has_metadata = (
|
|
886
|
+
title is not None
|
|
887
|
+
or description is not None
|
|
888
|
+
or status is not None
|
|
889
|
+
or applies_to_parts is not None
|
|
890
|
+
)
|
|
891
|
+
if has_metadata:
|
|
858
892
|
update_req = ArticlesUpdateRequest(
|
|
859
893
|
id=id,
|
|
860
894
|
title=title,
|
|
861
895
|
description=description,
|
|
862
896
|
status=status,
|
|
897
|
+
applies_to_parts=applies_to_parts_req,
|
|
863
898
|
)
|
|
864
899
|
return await self.update(update_req)
|
|
865
900
|
|
devrev_mcp/tools/articles.py
CHANGED
|
@@ -102,6 +102,7 @@ if _config.enable_destructive_tools:
|
|
|
102
102
|
description: str | None = None,
|
|
103
103
|
status: str | None = None,
|
|
104
104
|
content_format: str = "text/html",
|
|
105
|
+
applies_to_parts: list[str] | None = None,
|
|
105
106
|
) -> dict[str, Any]:
|
|
106
107
|
"""Create a new article with content.
|
|
107
108
|
|
|
@@ -113,6 +114,8 @@ if _config.enable_destructive_tools:
|
|
|
113
114
|
description: Optional short metadata description (NOT the article body).
|
|
114
115
|
status: Optional article status (draft, published, archived).
|
|
115
116
|
content_format: Content MIME type (default: text/html).
|
|
117
|
+
applies_to_parts: Optional list of part IDs (products, capabilities,
|
|
118
|
+
features, enhancements) to associate the article with.
|
|
116
119
|
|
|
117
120
|
Returns:
|
|
118
121
|
Dictionary containing the created article details.
|
|
@@ -139,6 +142,7 @@ if _config.enable_destructive_tools:
|
|
|
139
142
|
description=description,
|
|
140
143
|
status=article_status,
|
|
141
144
|
content_format=content_format,
|
|
145
|
+
applies_to_parts=applies_to_parts,
|
|
142
146
|
)
|
|
143
147
|
return serialize_model(article)
|
|
144
148
|
except DevRevError as e:
|
|
@@ -152,6 +156,7 @@ if _config.enable_destructive_tools:
|
|
|
152
156
|
content: str | None = None,
|
|
153
157
|
description: str | None = None,
|
|
154
158
|
status: str | None = None,
|
|
159
|
+
applies_to_parts: list[str] | None = None,
|
|
155
160
|
) -> dict[str, Any]:
|
|
156
161
|
"""Update an existing article in DevRev.
|
|
157
162
|
|
|
@@ -162,6 +167,9 @@ if _config.enable_destructive_tools:
|
|
|
162
167
|
content: Optional new article body content.
|
|
163
168
|
description: Optional new metadata description (NOT the article body).
|
|
164
169
|
status: Optional new status (draft, published, archived).
|
|
170
|
+
applies_to_parts: Optional list of part IDs (products, capabilities,
|
|
171
|
+
features, enhancements) to associate the article with.
|
|
172
|
+
Pass an empty list to remove all associations.
|
|
165
173
|
|
|
166
174
|
Returns:
|
|
167
175
|
Dictionary containing the updated article details.
|
|
@@ -187,6 +195,7 @@ if _config.enable_destructive_tools:
|
|
|
187
195
|
content=content,
|
|
188
196
|
description=description,
|
|
189
197
|
status=article_status,
|
|
198
|
+
applies_to_parts=applies_to_parts,
|
|
190
199
|
)
|
|
191
200
|
return serialize_model(article)
|
|
192
201
|
except DevRevError as e:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: devrev-Python-SDK
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.9.0
|
|
4
4
|
Summary: A modern, type-safe Python SDK for the DevRev API
|
|
5
5
|
Project-URL: Homepage, https://github.com/mgmonteleone/py-dev-rev
|
|
6
6
|
Project-URL: Documentation, https://github.com/mgmonteleone/py-dev-rev
|
|
@@ -517,6 +517,7 @@ article = client.articles.create_with_content(
|
|
|
517
517
|
owned_by=["don:identity:dvrv-us-1:devo/1:devu/1"],
|
|
518
518
|
description="Quick start guide for new users", # Optional metadata
|
|
519
519
|
status=ArticleStatus.PUBLISHED,
|
|
520
|
+
applies_to_parts=["don:core:dvrv-us-1:devo/1:part/123"], # Optional: associate with parts
|
|
520
521
|
)
|
|
521
522
|
|
|
522
523
|
# Get article with content
|
|
@@ -538,6 +539,12 @@ client.articles.update_with_content(
|
|
|
538
539
|
status=ArticleStatus.ARCHIVED,
|
|
539
540
|
)
|
|
540
541
|
|
|
542
|
+
# Update with part associations
|
|
543
|
+
client.articles.update_with_content(
|
|
544
|
+
id=article.id,
|
|
545
|
+
applies_to_parts=["don:core:dvrv-us-1:devo/1:part/123", "don:core:dvrv-us-1:devo/1:part/456"],
|
|
546
|
+
)
|
|
547
|
+
|
|
541
548
|
# List published articles (metadata only)
|
|
542
549
|
published = client.articles.list(limit=20)
|
|
543
550
|
for article in published:
|
|
@@ -36,7 +36,7 @@ devrev/models/widgets.py,sha256=7WWN17_ySqnu1pjYSIS5B8J5dEaqkoB8X8GWzvI0ZYc,4577
|
|
|
36
36
|
devrev/models/works.py,sha256=0PypJjDA5T3d-mmuvo5tl6_EUoz22YREmTWdFHx5jCc,10924
|
|
37
37
|
devrev/services/__init__.py,sha256=eH_sj5qTjuNhCayawlZKZRmhKhv2mSSnbi_Qh3DnMaI,3838
|
|
38
38
|
devrev/services/accounts.py,sha256=X7FgcODex0XKLiV_VvXKDl2Jm8XsNpn9qp40oRjZqME,9704
|
|
39
|
-
devrev/services/articles.py,sha256=
|
|
39
|
+
devrev/services/articles.py,sha256=3HbGVb6-51C_3l-3VV3dZUJajEHliP01KcxEoNbBRlQ,33817
|
|
40
40
|
devrev/services/artifacts.py,sha256=SJzIi5M4np0ENoOTTGEAcoqoRFMVd8pe-BCo9vvhYzk,14124
|
|
41
41
|
devrev/services/base.py,sha256=g55dfhd2-uAhgXuguiBacSP4yOAa03Q7hzKDG2vbZ8U,7100
|
|
42
42
|
devrev/services/brands.py,sha256=W6FB9XXTtEzGOfm9IBI6dqY8WXrMeH6urwjiZKrDVgI,5679
|
|
@@ -92,7 +92,7 @@ devrev_mcp/resources/ticket.py,sha256=D-S8Unsae8iV5dvPmCYQT4xcOEgX9E7Kcc8lg6Pxe8
|
|
|
92
92
|
devrev_mcp/resources/user.py,sha256=0Paq2w_nbj_dCQ8R0S81zlgjUhDAUzvn1_NmshadqM8,1553
|
|
93
93
|
devrev_mcp/tools/__init__.py,sha256=wiou4HHy6HeOQY0El3KYqy_S7c2IC4hjsYHjMm7aH-w,54
|
|
94
94
|
devrev_mcp/tools/accounts.py,sha256=AzRkJkKaYLYRaGL71KsoMEHUPBJ4IXgUs121tMjae-k,5777
|
|
95
|
-
devrev_mcp/tools/articles.py,sha256=
|
|
95
|
+
devrev_mcp/tools/articles.py,sha256=ojHBFTtjMPMiZvB6HaVd7IA5Az56h41bYC7O3jqag4A,8467
|
|
96
96
|
devrev_mcp/tools/conversations.py,sha256=koslrPsYf558NR_sw-FNrmBgjtqDZ23iHJ1nTgC4B0w,5615
|
|
97
97
|
devrev_mcp/tools/engagements.py,sha256=0net7c_MogSJ9khOcI98c54env_5f6t6eKobovVAc8Q,8670
|
|
98
98
|
devrev_mcp/tools/groups.py,sha256=HoqlSScIOeWE4Qr1UwIUrHLuJ5Hi5yrnnKTCyMxOBhQ,8289
|
|
@@ -111,7 +111,7 @@ devrev_mcp/utils/__init__.py,sha256=2_5b1KC5kjoUqFY1ZSdB2Tefd2ekjbZ-eHyFWBKI-0A,
|
|
|
111
111
|
devrev_mcp/utils/errors.py,sha256=5mRAo76rJvvEVi6b1ZokPxDtX5JKkptaqmiYDLCkwBE,2110
|
|
112
112
|
devrev_mcp/utils/formatting.py,sha256=6JssG5x1BxjdgSiQ8Ou3H-9Wo3wgWTWmejsrGez4wKc,2431
|
|
113
113
|
devrev_mcp/utils/pagination.py,sha256=EOUgL-ZdSToM1Q-ydXmjhibsef5K1u1g3CaS9K8I2fY,1286
|
|
114
|
-
devrev_python_sdk-2.
|
|
115
|
-
devrev_python_sdk-2.
|
|
116
|
-
devrev_python_sdk-2.
|
|
117
|
-
devrev_python_sdk-2.
|
|
114
|
+
devrev_python_sdk-2.9.0.dist-info/METADATA,sha256=Tt39MSyNwvy1N47xkUX4cwVvsa50RCrMuHMp5CIexNE,40561
|
|
115
|
+
devrev_python_sdk-2.9.0.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
|
|
116
|
+
devrev_python_sdk-2.9.0.dist-info/entry_points.txt,sha256=XiV4J_yy0yzVZVxg7T66YERVIlqdPNp3O-NHTHkllqQ,63
|
|
117
|
+
devrev_python_sdk-2.9.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|