devrev-Python-SDK 2.10.0__py3-none-any.whl → 2.10.2__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/models/articles.py +70 -0
- devrev/models/parts.py +16 -1
- devrev/services/articles.py +27 -0
- devrev_mcp/tools/articles.py +36 -8
- devrev_mcp/tools/parts.py +10 -0
- {devrev_python_sdk-2.10.0.dist-info → devrev_python_sdk-2.10.2.dist-info}/METADATA +1 -1
- {devrev_python_sdk-2.10.0.dist-info → devrev_python_sdk-2.10.2.dist-info}/RECORD +9 -9
- {devrev_python_sdk-2.10.0.dist-info → devrev_python_sdk-2.10.2.dist-info}/WHEEL +0 -0
- {devrev_python_sdk-2.10.0.dist-info → devrev_python_sdk-2.10.2.dist-info}/entry_points.txt +0 -0
devrev/models/articles.py
CHANGED
|
@@ -94,6 +94,29 @@ class ArticleParentSummary(DevRevResponseModel):
|
|
|
94
94
|
display_id: str | None = Field(default=None, description="Display ID")
|
|
95
95
|
|
|
96
96
|
|
|
97
|
+
class ArtifactSummary(DevRevResponseModel):
|
|
98
|
+
"""Summary of an artifact (used for extracted_content)."""
|
|
99
|
+
|
|
100
|
+
id: str = Field(..., description="Artifact DON ID")
|
|
101
|
+
display_id: str | None = Field(default=None, description="Display ID")
|
|
102
|
+
file: dict[str, Any] | None = Field(default=None, description="File metadata")
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
class SyncMetadata(DevRevResponseModel):
|
|
106
|
+
"""Sync information for records synced into/from DevRev."""
|
|
107
|
+
|
|
108
|
+
external_reference: str | None = Field(default=None, description="External record URL")
|
|
109
|
+
origin_system: str | None = Field(
|
|
110
|
+
default=None, description="Where the record was first created"
|
|
111
|
+
)
|
|
112
|
+
last_sync_in: dict[str, Any] | None = Field(
|
|
113
|
+
default=None, description="Information about the sync to DevRev"
|
|
114
|
+
)
|
|
115
|
+
last_sync_out: dict[str, Any] | None = Field(
|
|
116
|
+
default=None, description="Information about the sync from DevRev"
|
|
117
|
+
)
|
|
118
|
+
|
|
119
|
+
|
|
97
120
|
class Article(DevRevResponseModel):
|
|
98
121
|
"""DevRev Article model.
|
|
99
122
|
|
|
@@ -106,13 +129,29 @@ class Article(DevRevResponseModel):
|
|
|
106
129
|
title: str = Field(..., description="Article title")
|
|
107
130
|
description: str | None = Field(default=None, description="Article description/body")
|
|
108
131
|
status: ArticleStatus | None = Field(default=None, description="Article status")
|
|
132
|
+
access_level: ArticleAccessLevel | None = Field(
|
|
133
|
+
default=None, description="Access level (external, internal, private, public, restricted)"
|
|
134
|
+
)
|
|
135
|
+
aliases: list[str] | None = Field(default=None, description="Aliases of the article")
|
|
109
136
|
article_type: str | None = Field(default=None, description="Article type (article, page, etc.)")
|
|
110
137
|
authored_by: list[UserSummary] | None = Field(
|
|
111
138
|
default=None, description="Authors of the article (API returns array, not single object)"
|
|
112
139
|
)
|
|
140
|
+
brand: dict[str, Any] | None = Field(
|
|
141
|
+
default=None, description="Brand associated with the article"
|
|
142
|
+
)
|
|
113
143
|
owned_by: list[UserSummary] | None = Field(default=None, description="Owners of the article")
|
|
114
144
|
created_date: datetime | None = Field(default=None, description="Creation date")
|
|
115
145
|
modified_date: datetime | None = Field(default=None, description="Last modified")
|
|
146
|
+
extracted_content: list[ArtifactSummary] | None = Field(
|
|
147
|
+
default=None, description="Extracted content artifacts"
|
|
148
|
+
)
|
|
149
|
+
num_downvotes: int | None = Field(
|
|
150
|
+
default=None, description="Number of downvotes on the article"
|
|
151
|
+
)
|
|
152
|
+
num_upvotes: int | None = Field(default=None, description="Number of upvotes on the article")
|
|
153
|
+
published_at: datetime | None = Field(default=None, description="Published date of the article")
|
|
154
|
+
rank: str | None = Field(default=None, description="Rank of the article")
|
|
116
155
|
resource: dict[str, Any] | None = Field(
|
|
117
156
|
default=None, description="Resource configuration including artifact references"
|
|
118
157
|
)
|
|
@@ -122,6 +161,9 @@ class Article(DevRevResponseModel):
|
|
|
122
161
|
scope: ArticleScope | None = Field(
|
|
123
162
|
default=None, description="Visibility scope (internal/external)"
|
|
124
163
|
)
|
|
164
|
+
sync_metadata: SyncMetadata | None = Field(
|
|
165
|
+
default=None, description="Sync information for records synced into/from DevRev"
|
|
166
|
+
)
|
|
125
167
|
tags: list[ArticleTagWithValue] | None = Field(
|
|
126
168
|
default=None, description="Tags applied to the article"
|
|
127
169
|
)
|
|
@@ -129,6 +171,7 @@ class Article(DevRevResponseModel):
|
|
|
129
171
|
default=None, description="Parent directory/collection"
|
|
130
172
|
)
|
|
131
173
|
language: str | None = Field(default=None, description="Language code (e.g., 'en')")
|
|
174
|
+
url: str | None = Field(default=None, description="URL of the external article")
|
|
132
175
|
|
|
133
176
|
|
|
134
177
|
class ArticleSummary(DevRevResponseModel):
|
|
@@ -168,6 +211,28 @@ class ArticlesCreateRequest(DevRevBaseModel):
|
|
|
168
211
|
title: str = Field(..., description="Article title")
|
|
169
212
|
description: str | None = Field(default=None, description="Article description/body")
|
|
170
213
|
status: ArticleStatus | None = Field(default=None, description="Article status")
|
|
214
|
+
access_level: ArticleAccessLevel | None = Field(
|
|
215
|
+
default=None, description="Access level (external, internal, private, public, restricted)"
|
|
216
|
+
)
|
|
217
|
+
aliases: list[str] | None = Field(default=None, description="Aliases of the article (max 5)")
|
|
218
|
+
authored_by: list[str] | None = Field(
|
|
219
|
+
default=None, description="List of user IDs who author the article"
|
|
220
|
+
)
|
|
221
|
+
brand: str | None = Field(default=None, description="Brand ID associated with the article")
|
|
222
|
+
content_format: ArticleContentFormat | None = Field(
|
|
223
|
+
default=None, description="Content format (drdfv2, rt)"
|
|
224
|
+
)
|
|
225
|
+
custom_fields: dict[str, Any] | None = Field(
|
|
226
|
+
default=None, description="Application-defined custom fields"
|
|
227
|
+
)
|
|
228
|
+
custom_schema_spec: CustomSchemaSpec | None = Field(
|
|
229
|
+
default=None, description="Custom schema spec"
|
|
230
|
+
)
|
|
231
|
+
extracted_content: list[str] | None = Field(
|
|
232
|
+
default=None, description="IDs of extracted content artifacts"
|
|
233
|
+
)
|
|
234
|
+
language: str | None = Field(default=None, description="Language of the article")
|
|
235
|
+
notify: bool | None = Field(default=None, description="Whether to notify users when published")
|
|
171
236
|
owned_by: list[str] = Field(..., description="List of dev user IDs who own the article")
|
|
172
237
|
resource: dict[str, Any] = Field(
|
|
173
238
|
default_factory=dict, description="Resource configuration for the article"
|
|
@@ -176,6 +241,9 @@ class ArticlesCreateRequest(DevRevBaseModel):
|
|
|
176
241
|
default=None, description="List of part IDs this article applies to"
|
|
177
242
|
)
|
|
178
243
|
scope: int | None = Field(default=None, description="Visibility scope: 1=internal, 2=external")
|
|
244
|
+
shared_with: list[SetSharedWithMembership] | None = Field(
|
|
245
|
+
default=None, description="Users/groups to share the article with"
|
|
246
|
+
)
|
|
179
247
|
tags: list[SetTagWithValue] | None = Field(
|
|
180
248
|
default=None, description="Tags to apply (list of {'id': 'tag_id', 'value': ...})"
|
|
181
249
|
)
|
|
@@ -183,6 +251,8 @@ class ArticlesCreateRequest(DevRevBaseModel):
|
|
|
183
251
|
article_type: str | None = Field(
|
|
184
252
|
default=None, description="Article type: 'article' (default), 'page', 'content_block'"
|
|
185
253
|
)
|
|
254
|
+
published_at: datetime | None = Field(default=None, description="Published date of the article")
|
|
255
|
+
release_notes: str | None = Field(default=None, description="Release notes for the article")
|
|
186
256
|
|
|
187
257
|
|
|
188
258
|
class ArticlesGetRequest(DevRevBaseModel):
|
devrev/models/parts.py
CHANGED
|
@@ -53,11 +53,26 @@ class PartSummary(DevRevResponseModel):
|
|
|
53
53
|
|
|
54
54
|
|
|
55
55
|
class PartsCreateRequest(DevRevBaseModel):
|
|
56
|
-
"""Request to create a part.
|
|
56
|
+
"""Request to create a part.
|
|
57
|
+
|
|
58
|
+
For non-product parts (capability, feature, enhancement), the parent_part
|
|
59
|
+
parameter is required to specify the parent part in the hierarchy.
|
|
60
|
+
"""
|
|
57
61
|
|
|
58
62
|
name: str = Field(..., description="Part name")
|
|
59
63
|
type: PartType = Field(..., description="Part type")
|
|
60
64
|
description: str | None = Field(default=None, description="Description")
|
|
65
|
+
owned_by: list[str] | None = Field(
|
|
66
|
+
default=None,
|
|
67
|
+
description="List of owner user IDs (e.g., ['DEVU-4'] or full DON IDs)",
|
|
68
|
+
)
|
|
69
|
+
parent_part: list[str] | None = Field(
|
|
70
|
+
default=None,
|
|
71
|
+
description="Parent part ID (required for capability/feature/enhancement). "
|
|
72
|
+
"Array with at most 1 element.",
|
|
73
|
+
max_length=1,
|
|
74
|
+
)
|
|
75
|
+
tags: list[str] | None = Field(default=None, description="List of tag IDs")
|
|
61
76
|
|
|
62
77
|
|
|
63
78
|
class PartsGetRequest(DevRevBaseModel):
|
devrev/services/articles.py
CHANGED
|
@@ -196,12 +196,15 @@ class ArticlesService(BaseService):
|
|
|
196
196
|
owned_by: builtins.list[str],
|
|
197
197
|
description: str | None = None,
|
|
198
198
|
status: ArticleStatus | None = None,
|
|
199
|
+
access_level: ArticleAccessLevel | None = None,
|
|
199
200
|
content_format: str = "text/plain",
|
|
200
201
|
applies_to_parts: builtins.list[str] | None = None,
|
|
201
202
|
scope: int | None = None,
|
|
202
203
|
tags: builtins.list[SetTagWithValue] | None = None,
|
|
203
204
|
parent: str | None = None,
|
|
204
205
|
article_type: str | None = None,
|
|
206
|
+
language: str | None = None,
|
|
207
|
+
authored_by: builtins.list[str] | None = None,
|
|
205
208
|
) -> Article:
|
|
206
209
|
"""Create an article with content in a single operation.
|
|
207
210
|
|
|
@@ -218,12 +221,15 @@ class ArticlesService(BaseService):
|
|
|
218
221
|
owned_by: List of dev user IDs who own the article
|
|
219
222
|
description: Optional short metadata description (NOT the article content)
|
|
220
223
|
status: Optional article status (draft, published, archived)
|
|
224
|
+
access_level: Optional access level (external, internal, private, public, restricted)
|
|
221
225
|
content_format: Content MIME type (default: text/plain)
|
|
222
226
|
applies_to_parts: Optional list of part IDs to associate with
|
|
223
227
|
scope: Optional visibility scope (1=internal, 2=external)
|
|
224
228
|
tags: Optional tags (list of SetTagWithValue)
|
|
225
229
|
parent: Optional parent directory/collection DON ID
|
|
226
230
|
article_type: Optional article type ('article', 'page', 'content_block')
|
|
231
|
+
language: Optional language code (e.g., 'en')
|
|
232
|
+
authored_by: Optional list of user IDs who author the article
|
|
227
233
|
|
|
228
234
|
Returns:
|
|
229
235
|
Created article
|
|
@@ -239,6 +245,7 @@ class ArticlesService(BaseService):
|
|
|
239
245
|
... content_format="text/html",
|
|
240
246
|
... applies_to_parts=["don:core:...:feature/30"],
|
|
241
247
|
... scope=2, # external
|
|
248
|
+
... access_level=ArticleAccessLevel.EXTERNAL,
|
|
242
249
|
... )
|
|
243
250
|
"""
|
|
244
251
|
if not self._parent_client:
|
|
@@ -275,6 +282,7 @@ class ArticlesService(BaseService):
|
|
|
275
282
|
title=title,
|
|
276
283
|
description=description,
|
|
277
284
|
status=status,
|
|
285
|
+
access_level=access_level,
|
|
278
286
|
owned_by=owned_by,
|
|
279
287
|
resource={"content_artifact": artifact_id},
|
|
280
288
|
applies_to_parts=applies_to_parts,
|
|
@@ -282,6 +290,8 @@ class ArticlesService(BaseService):
|
|
|
282
290
|
tags=tags,
|
|
283
291
|
parent=parent,
|
|
284
292
|
article_type=article_type,
|
|
293
|
+
language=language,
|
|
294
|
+
authored_by=authored_by,
|
|
285
295
|
)
|
|
286
296
|
return self.create(article_req)
|
|
287
297
|
|
|
@@ -443,6 +453,7 @@ class ArticlesService(BaseService):
|
|
|
443
453
|
applies_to_parts: builtins.list[str] | None = None,
|
|
444
454
|
access_level: ArticleAccessLevel | None = None,
|
|
445
455
|
tags: builtins.list[SetTagWithValue] | None = None,
|
|
456
|
+
language: str | None = None,
|
|
446
457
|
) -> Article:
|
|
447
458
|
"""Update article metadata and/or content.
|
|
448
459
|
|
|
@@ -460,6 +471,7 @@ class ArticlesService(BaseService):
|
|
|
460
471
|
applies_to_parts: Optional list of part IDs to associate with
|
|
461
472
|
access_level: Optional access level (internal, external, private, public)
|
|
462
473
|
tags: Optional list of tags to apply (list of SetTagWithValue objects)
|
|
474
|
+
language: Optional language code (e.g., 'en')
|
|
463
475
|
|
|
464
476
|
Returns:
|
|
465
477
|
Updated article
|
|
@@ -528,6 +540,7 @@ class ArticlesService(BaseService):
|
|
|
528
540
|
or applies_to_parts is not None
|
|
529
541
|
or access_level is not None
|
|
530
542
|
or tags is not None
|
|
543
|
+
or language is not None
|
|
531
544
|
)
|
|
532
545
|
if has_metadata:
|
|
533
546
|
update_req = ArticlesUpdateRequest(
|
|
@@ -538,6 +551,7 @@ class ArticlesService(BaseService):
|
|
|
538
551
|
applies_to_parts=applies_to_parts_req,
|
|
539
552
|
access_level=access_level,
|
|
540
553
|
tags=tags_req,
|
|
554
|
+
language=language,
|
|
541
555
|
)
|
|
542
556
|
return self.update(update_req)
|
|
543
557
|
|
|
@@ -642,12 +656,15 @@ class AsyncArticlesService(AsyncBaseService):
|
|
|
642
656
|
owned_by: builtins.list[str],
|
|
643
657
|
description: str | None = None,
|
|
644
658
|
status: ArticleStatus | None = None,
|
|
659
|
+
access_level: ArticleAccessLevel | None = None,
|
|
645
660
|
content_format: str = "text/plain",
|
|
646
661
|
applies_to_parts: builtins.list[str] | None = None,
|
|
647
662
|
scope: int | None = None,
|
|
648
663
|
tags: builtins.list[SetTagWithValue] | None = None,
|
|
649
664
|
parent: str | None = None,
|
|
650
665
|
article_type: str | None = None,
|
|
666
|
+
language: str | None = None,
|
|
667
|
+
authored_by: builtins.list[str] | None = None,
|
|
651
668
|
) -> Article:
|
|
652
669
|
"""Create an article with content in a single operation (async).
|
|
653
670
|
|
|
@@ -664,12 +681,15 @@ class AsyncArticlesService(AsyncBaseService):
|
|
|
664
681
|
owned_by: List of dev user IDs who own the article
|
|
665
682
|
description: Optional short metadata description (NOT the article content)
|
|
666
683
|
status: Optional article status (draft, published, archived)
|
|
684
|
+
access_level: Optional access level (external, internal, private, public, restricted)
|
|
667
685
|
content_format: Content MIME type (default: text/plain)
|
|
668
686
|
applies_to_parts: Optional list of part IDs to associate with
|
|
669
687
|
scope: Optional visibility scope (1=internal, 2=external)
|
|
670
688
|
tags: Optional tags (list of SetTagWithValue)
|
|
671
689
|
parent: Optional parent directory/collection DON ID
|
|
672
690
|
article_type: Optional article type ('article', 'page', 'content_block')
|
|
691
|
+
language: Optional language code (e.g., 'en')
|
|
692
|
+
authored_by: Optional list of user IDs who author the article
|
|
673
693
|
|
|
674
694
|
Returns:
|
|
675
695
|
Created article
|
|
@@ -710,6 +730,7 @@ class AsyncArticlesService(AsyncBaseService):
|
|
|
710
730
|
title=title,
|
|
711
731
|
description=description,
|
|
712
732
|
status=status,
|
|
733
|
+
access_level=access_level,
|
|
713
734
|
owned_by=owned_by,
|
|
714
735
|
resource={"content_artifact": artifact_id},
|
|
715
736
|
applies_to_parts=applies_to_parts,
|
|
@@ -717,6 +738,8 @@ class AsyncArticlesService(AsyncBaseService):
|
|
|
717
738
|
tags=tags,
|
|
718
739
|
parent=parent,
|
|
719
740
|
article_type=article_type,
|
|
741
|
+
language=language,
|
|
742
|
+
authored_by=authored_by,
|
|
720
743
|
)
|
|
721
744
|
return await self.create(article_req)
|
|
722
745
|
|
|
@@ -867,6 +890,7 @@ class AsyncArticlesService(AsyncBaseService):
|
|
|
867
890
|
applies_to_parts: builtins.list[str] | None = None,
|
|
868
891
|
access_level: ArticleAccessLevel | None = None,
|
|
869
892
|
tags: builtins.list[SetTagWithValue] | None = None,
|
|
893
|
+
language: str | None = None,
|
|
870
894
|
) -> Article:
|
|
871
895
|
"""Update article metadata and/or content (async).
|
|
872
896
|
|
|
@@ -884,6 +908,7 @@ class AsyncArticlesService(AsyncBaseService):
|
|
|
884
908
|
applies_to_parts: Optional list of part IDs to associate with
|
|
885
909
|
access_level: Optional access level (internal, external, private, public)
|
|
886
910
|
tags: Optional list of tags to apply (list of SetTagWithValue objects)
|
|
911
|
+
language: Optional language code (e.g., 'en')
|
|
887
912
|
|
|
888
913
|
Returns:
|
|
889
914
|
Updated article
|
|
@@ -919,6 +944,7 @@ class AsyncArticlesService(AsyncBaseService):
|
|
|
919
944
|
or applies_to_parts is not None
|
|
920
945
|
or access_level is not None
|
|
921
946
|
or tags is not None
|
|
947
|
+
or language is not None
|
|
922
948
|
)
|
|
923
949
|
if has_metadata:
|
|
924
950
|
update_req = ArticlesUpdateRequest(
|
|
@@ -929,6 +955,7 @@ class AsyncArticlesService(AsyncBaseService):
|
|
|
929
955
|
applies_to_parts=applies_to_parts_req,
|
|
930
956
|
access_level=access_level,
|
|
931
957
|
tags=tags_req,
|
|
958
|
+
language=language,
|
|
932
959
|
)
|
|
933
960
|
return await self.update(update_req)
|
|
934
961
|
|
devrev_mcp/tools/articles.py
CHANGED
|
@@ -22,7 +22,7 @@ from devrev.models.base import SetTagWithValue
|
|
|
22
22
|
from devrev_mcp.server import _config, mcp
|
|
23
23
|
from devrev_mcp.utils.errors import format_devrev_error
|
|
24
24
|
from devrev_mcp.utils.formatting import serialize_model, serialize_models
|
|
25
|
-
from devrev_mcp.utils.pagination import clamp_page_size
|
|
25
|
+
from devrev_mcp.utils.pagination import clamp_page_size, paginated_response
|
|
26
26
|
|
|
27
27
|
logger = logging.getLogger(__name__)
|
|
28
28
|
|
|
@@ -41,7 +41,8 @@ async def devrev_articles_list(
|
|
|
41
41
|
limit: Maximum number of articles to return.
|
|
42
42
|
|
|
43
43
|
Returns:
|
|
44
|
-
Dictionary containing count
|
|
44
|
+
Dictionary containing count, list of articles, and optional next_cursor
|
|
45
|
+
for pagination.
|
|
45
46
|
|
|
46
47
|
Raises:
|
|
47
48
|
RuntimeError: If the DevRev API call fails.
|
|
@@ -54,9 +55,9 @@ async def devrev_articles_list(
|
|
|
54
55
|
limit, default=app.config.default_page_size, maximum=app.config.max_page_size
|
|
55
56
|
),
|
|
56
57
|
)
|
|
57
|
-
|
|
58
|
-
items = serialize_models(
|
|
59
|
-
return
|
|
58
|
+
response = await app.get_client().articles.list(request)
|
|
59
|
+
items = serialize_models(response.articles)
|
|
60
|
+
return paginated_response(items, next_cursor=response.next_cursor, total_label="articles")
|
|
60
61
|
except DevRevError as e:
|
|
61
62
|
raise RuntimeError(format_devrev_error(e)) from e
|
|
62
63
|
|
|
@@ -103,10 +104,13 @@ if _config.enable_destructive_tools:
|
|
|
103
104
|
owned_by: list[str],
|
|
104
105
|
description: str | None = None,
|
|
105
106
|
status: str | None = None,
|
|
107
|
+
access_level: str | None = None,
|
|
106
108
|
content_format: str = "text/html",
|
|
107
109
|
applies_to_parts: list[str] | None = None,
|
|
108
110
|
scope: int | None = None,
|
|
109
111
|
tags: list[str] | None = None,
|
|
112
|
+
language: str | None = None,
|
|
113
|
+
authored_by: list[str] | None = None,
|
|
110
114
|
) -> dict[str, Any]:
|
|
111
115
|
"""Create a new article with content.
|
|
112
116
|
|
|
@@ -117,11 +121,14 @@ if _config.enable_destructive_tools:
|
|
|
117
121
|
owned_by: List of dev user IDs who own the article.
|
|
118
122
|
description: Optional short metadata description (NOT the article body).
|
|
119
123
|
status: Optional article status (draft, published, archived).
|
|
124
|
+
access_level: Optional access level (external, internal, private, public, restricted).
|
|
120
125
|
content_format: Content MIME type (default: text/html).
|
|
121
126
|
applies_to_parts: Optional list of part IDs (products, capabilities,
|
|
122
127
|
features, enhancements) to associate the article with.
|
|
123
128
|
scope: Optional visibility scope (1=internal, 2=external).
|
|
124
129
|
tags: Optional list of tag IDs to apply to the article.
|
|
130
|
+
language: Optional language code (e.g., 'en').
|
|
131
|
+
authored_by: Optional list of user IDs who author the article.
|
|
125
132
|
|
|
126
133
|
Returns:
|
|
127
134
|
Dictionary containing the created article details.
|
|
@@ -141,8 +148,21 @@ if _config.enable_destructive_tools:
|
|
|
141
148
|
f"Valid statuses: {', '.join(s.name for s in ArticleStatus)}"
|
|
142
149
|
) from e
|
|
143
150
|
|
|
151
|
+
# Convert access_level string to ArticleAccessLevel enum
|
|
152
|
+
article_access_level = None
|
|
153
|
+
if access_level:
|
|
154
|
+
try:
|
|
155
|
+
article_access_level = ArticleAccessLevel[access_level.upper()]
|
|
156
|
+
except KeyError as e:
|
|
157
|
+
raise RuntimeError(
|
|
158
|
+
f"Invalid access level: {e.args[0]}. "
|
|
159
|
+
f"Valid levels: {', '.join(a.name for a in ArticleAccessLevel)}"
|
|
160
|
+
) from e
|
|
161
|
+
|
|
144
162
|
# Convert tag IDs to SetTagWithValue objects
|
|
145
|
-
tags_list =
|
|
163
|
+
tags_list = (
|
|
164
|
+
[SetTagWithValue(id=tag_id) for tag_id in tags] if tags is not None else None
|
|
165
|
+
)
|
|
146
166
|
|
|
147
167
|
article = await app.get_client().articles.create_with_content(
|
|
148
168
|
title=title,
|
|
@@ -150,10 +170,13 @@ if _config.enable_destructive_tools:
|
|
|
150
170
|
owned_by=owned_by,
|
|
151
171
|
description=description,
|
|
152
172
|
status=article_status,
|
|
173
|
+
access_level=article_access_level,
|
|
153
174
|
content_format=content_format,
|
|
154
175
|
applies_to_parts=applies_to_parts,
|
|
155
176
|
scope=scope,
|
|
156
177
|
tags=tags_list,
|
|
178
|
+
language=language,
|
|
179
|
+
authored_by=authored_by,
|
|
157
180
|
)
|
|
158
181
|
return serialize_model(article)
|
|
159
182
|
except DevRevError as e:
|
|
@@ -170,6 +193,7 @@ if _config.enable_destructive_tools:
|
|
|
170
193
|
applies_to_parts: list[str] | None = None,
|
|
171
194
|
access_level: str | None = None,
|
|
172
195
|
tags: list[str] | None = None,
|
|
196
|
+
language: str | None = None,
|
|
173
197
|
) -> dict[str, Any]:
|
|
174
198
|
"""Update an existing article in DevRev.
|
|
175
199
|
|
|
@@ -183,11 +207,12 @@ if _config.enable_destructive_tools:
|
|
|
183
207
|
applies_to_parts: Optional list of part IDs (products, capabilities,
|
|
184
208
|
features, enhancements) to associate the article with.
|
|
185
209
|
Pass an empty list to remove all associations.
|
|
186
|
-
access_level: Optional access level (internal, external, private, public).
|
|
210
|
+
access_level: Optional access level (internal, external, private, public, restricted).
|
|
187
211
|
Note: For updates, use ``access_level`` (string enum). For creation,
|
|
188
212
|
use the ``scope`` parameter (integer: 1=internal, 2=external).
|
|
189
213
|
tags: Optional list of tag IDs to apply to the article.
|
|
190
214
|
Pass an empty list to remove all tags.
|
|
215
|
+
language: Optional language code (e.g., 'en').
|
|
191
216
|
|
|
192
217
|
Returns:
|
|
193
218
|
Dictionary containing the updated article details.
|
|
@@ -219,7 +244,9 @@ if _config.enable_destructive_tools:
|
|
|
219
244
|
) from e
|
|
220
245
|
|
|
221
246
|
# Convert tag IDs to SetTagWithValue objects
|
|
222
|
-
tags_list =
|
|
247
|
+
tags_list = (
|
|
248
|
+
[SetTagWithValue(id=tag_id) for tag_id in tags] if tags is not None else None
|
|
249
|
+
)
|
|
223
250
|
|
|
224
251
|
article = await app.get_client().articles.update_with_content(
|
|
225
252
|
id=id,
|
|
@@ -230,6 +257,7 @@ if _config.enable_destructive_tools:
|
|
|
230
257
|
applies_to_parts=applies_to_parts,
|
|
231
258
|
access_level=article_access_level,
|
|
232
259
|
tags=tags_list,
|
|
260
|
+
language=language,
|
|
233
261
|
)
|
|
234
262
|
return serialize_model(article)
|
|
235
263
|
except DevRevError as e:
|
devrev_mcp/tools/parts.py
CHANGED
|
@@ -87,6 +87,9 @@ if _config.enable_destructive_tools:
|
|
|
87
87
|
name: str,
|
|
88
88
|
type: str,
|
|
89
89
|
description: str | None = None,
|
|
90
|
+
owned_by: list[str] | None = None,
|
|
91
|
+
parent_part: list[str] | None = None,
|
|
92
|
+
tags: list[str] | None = None,
|
|
90
93
|
) -> dict[str, Any]:
|
|
91
94
|
"""Create a new DevRev part.
|
|
92
95
|
|
|
@@ -94,6 +97,10 @@ if _config.enable_destructive_tools:
|
|
|
94
97
|
name: The name of the part.
|
|
95
98
|
type: The type of part (PRODUCT, CAPABILITY, FEATURE, ENHANCEMENT).
|
|
96
99
|
description: Optional description of the part.
|
|
100
|
+
owned_by: List of owner user IDs (e.g., ["DEVU-4"] or full DON IDs).
|
|
101
|
+
parent_part: Parent part ID (required for capability/feature/enhancement).
|
|
102
|
+
Array with at most 1 element.
|
|
103
|
+
tags: List of tag IDs to associate with the part.
|
|
97
104
|
|
|
98
105
|
Returns:
|
|
99
106
|
Dictionary containing the created part details.
|
|
@@ -114,6 +121,9 @@ if _config.enable_destructive_tools:
|
|
|
114
121
|
name=name,
|
|
115
122
|
type=part_type,
|
|
116
123
|
description=description,
|
|
124
|
+
owned_by=owned_by,
|
|
125
|
+
parent_part=parent_part,
|
|
126
|
+
tags=tags,
|
|
117
127
|
)
|
|
118
128
|
part = await app.get_client().parts.create(request)
|
|
119
129
|
return serialize_model(part)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: devrev-Python-SDK
|
|
3
|
-
Version: 2.10.
|
|
3
|
+
Version: 2.10.2
|
|
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
|
|
@@ -5,7 +5,7 @@ devrev/exceptions.py,sha256=Bs0pYgOgG26cyI785rdJeTR72gM-rXHaCEt24HAJzEk,7540
|
|
|
5
5
|
devrev/py.typed,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
6
6
|
devrev/models/__init__.py,sha256=K7y3jmjqQl-cnuIrg4BzVwpgl2XunegnChKgiwNx4jg,23158
|
|
7
7
|
devrev/models/accounts.py,sha256=LrXAit2gIr34XyRO1T0fL6EwdXHsfJOyXwcegPnKnaE,6974
|
|
8
|
-
devrev/models/articles.py,sha256=
|
|
8
|
+
devrev/models/articles.py,sha256=9vlwKDzOQ2siLkUGvX8hDV-2Cd6Fn3yxUqT3gHuyRsY,16370
|
|
9
9
|
devrev/models/artifacts.py,sha256=3iA58RyVlX0S0U5iID3Cnoc096Y70QfGqYfKEhxfE9g,4375
|
|
10
10
|
devrev/models/base.py,sha256=qMxfptmsWimH-MMv84-qojy9Ip858ZYMe6GvTQkDAjo,4511
|
|
11
11
|
devrev/models/brands.py,sha256=6nYVGoy7s8iDYLotfXefMTPIMIJoI8978TXm4RtIswY,3021
|
|
@@ -17,7 +17,7 @@ devrev/models/groups.py,sha256=oB3eCuX14po5E8WhqkuuC-GlC1WXEPVfpqB5tn4NZ-o,4486
|
|
|
17
17
|
devrev/models/incidents.py,sha256=e8Wq7MyXeDPiYMCNvxPlZa4D939196fUaND-MYtBbcw,6305
|
|
18
18
|
devrev/models/links.py,sha256=0jtIXn90WQgGrSrnR72AgM9lMVSK6xv9fXKzq2Eki-A,2963
|
|
19
19
|
devrev/models/notifications.py,sha256=BjVGx6XR1rQbQPR1hz05j5wU-8VMqH2m02KZmMl3Z98,867
|
|
20
|
-
devrev/models/parts.py,sha256=
|
|
20
|
+
devrev/models/parts.py,sha256=A1EjliQfmGfxGeg2NlrAGOXB5Qk8MCyhus_LmmTdakA,4233
|
|
21
21
|
devrev/models/preferences.py,sha256=S98RoSJhSlBavzFotyqsx_r1LGS2WjRtmazN4yIQFwc,1806
|
|
22
22
|
devrev/models/question_answers.py,sha256=lPgE-OXzxMkrQdQE4NPz8IRV0I5P8iJq7VVdpx4iovg,3606
|
|
23
23
|
devrev/models/recommendations.py,sha256=4szM-gtm-oVN7lBqi1xtGKABJcdwTeFLF_iR1fUoImY,2727
|
|
@@ -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=MRzeGJbBu4sTI2ODN04WDDsaKZ7g3R08AamkCOrcAJ0,36669
|
|
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,13 +92,13 @@ 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=A9jMmh0gtEFuNnd6YrvbgD1qgIM27zeW8fQNwC26SHs,11477
|
|
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
|
|
99
99
|
devrev_mcp/tools/incidents.py,sha256=9jse0qn_J7lXjGW81XPAEQiLm46k0uf2tuRhxa7BSSY,7738
|
|
100
100
|
devrev_mcp/tools/links.py,sha256=m1rYxHs9C-bU7ljyax0ymfyqRLXlf_Q9B597hNPodtY,4067
|
|
101
|
-
devrev_mcp/tools/parts.py,sha256=
|
|
101
|
+
devrev_mcp/tools/parts.py,sha256=v5iITSrEC-OOjZHZuFCcHtx1eEW3jRyeROdCR27ve_E,5927
|
|
102
102
|
devrev_mcp/tools/recommendations.py,sha256=Cg1NeDYgIlWLrtFYuxGlvQLpy6uDm2HoG91yGoSRC8A,3014
|
|
103
103
|
devrev_mcp/tools/search.py,sha256=_3J-jBlvA9wpW4X4zEmf7aiudd5ylzrMhMnVmP9KbPs,9100
|
|
104
104
|
devrev_mcp/tools/server_info.py,sha256=GQbUr4jXlEwuPFrSww98QOAuH7dV-oBn9StAaVbj7z4,3848
|
|
@@ -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.10.
|
|
115
|
-
devrev_python_sdk-2.10.
|
|
116
|
-
devrev_python_sdk-2.10.
|
|
117
|
-
devrev_python_sdk-2.10.
|
|
114
|
+
devrev_python_sdk-2.10.2.dist-info/METADATA,sha256=MFSddV755umLfKi3OcDAZnG9zx5RGbH0baIcudhe998,40907
|
|
115
|
+
devrev_python_sdk-2.10.2.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
|
|
116
|
+
devrev_python_sdk-2.10.2.dist-info/entry_points.txt,sha256=XiV4J_yy0yzVZVxg7T66YERVIlqdPNp3O-NHTHkllqQ,63
|
|
117
|
+
devrev_python_sdk-2.10.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|