python-cnb 1.23.19__tar.gz → 1.24.9__tar.gz
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.
- {python_cnb-1.23.19/python_cnb.egg-info → python_cnb-1.24.9}/PKG-INFO +1 -1
- {python_cnb-1.23.19 → python_cnb-1.24.9}/cnb/badge.py +1 -1
- {python_cnb-1.23.19 → python_cnb-1.24.9}/cnb/build.py +47 -3
- {python_cnb-1.23.19 → python_cnb-1.24.9}/cnb/cnb.py +2 -0
- {python_cnb-1.23.19 → python_cnb-1.24.9}/cnb/git.py +1 -1
- {python_cnb-1.23.19 → python_cnb-1.24.9}/cnb/gitsettings.py +2 -2
- {python_cnb-1.23.19 → python_cnb-1.24.9}/cnb/issues.py +1 -1
- {python_cnb-1.23.19 → python_cnb-1.24.9}/cnb/knowledgebase.py +2 -2
- {python_cnb-1.23.19 → python_cnb-1.24.9}/cnb/members.py +5 -5
- {python_cnb-1.23.19 → python_cnb-1.24.9}/cnb/models/api.py +1 -0
- {python_cnb-1.23.19 → python_cnb-1.24.9}/cnb/models/dto.py +134 -0
- {python_cnb-1.23.19 → python_cnb-1.24.9}/cnb/models/organization.py +1 -0
- python_cnb-1.24.9/cnb/npcobservability.py +97 -0
- {python_cnb-1.23.19 → python_cnb-1.24.9}/cnb/organizations.py +1 -1
- {python_cnb-1.23.19 → python_cnb-1.24.9}/cnb/registries.py +2 -2
- {python_cnb-1.23.19 → python_cnb-1.24.9}/cnb/releases.py +14 -0
- {python_cnb-1.23.19 → python_cnb-1.24.9}/cnb/repositories.py +2 -2
- {python_cnb-1.23.19 → python_cnb-1.24.9}/cnb/workspace.py +1 -1
- {python_cnb-1.23.19 → python_cnb-1.24.9/python_cnb.egg-info}/PKG-INFO +1 -1
- {python_cnb-1.23.19 → python_cnb-1.24.9}/python_cnb.egg-info/SOURCES.txt +1 -0
- {python_cnb-1.23.19 → python_cnb-1.24.9}/setup.py +1 -1
- {python_cnb-1.23.19 → python_cnb-1.24.9}/LICENSE +0 -0
- {python_cnb-1.23.19 → python_cnb-1.24.9}/MANIFEST.in +0 -0
- {python_cnb-1.23.19 → python_cnb-1.24.9}/README.md +0 -0
- {python_cnb-1.23.19 → python_cnb-1.24.9}/cnb/__init__.py +0 -0
- {python_cnb-1.23.19 → python_cnb-1.24.9}/cnb/activities.py +0 -0
- {python_cnb-1.23.19 → python_cnb-1.24.9}/cnb/ai.py +0 -0
- {python_cnb-1.23.19 → python_cnb-1.24.9}/cnb/ai_ext.py +0 -0
- {python_cnb-1.23.19 → python_cnb-1.24.9}/cnb/assets.py +0 -0
- {python_cnb-1.23.19 → python_cnb-1.24.9}/cnb/charge.py +0 -0
- {python_cnb-1.23.19 → python_cnb-1.24.9}/cnb/client.py +0 -0
- {python_cnb-1.23.19 → python_cnb-1.24.9}/cnb/event.py +0 -0
- {python_cnb-1.23.19 → python_cnb-1.24.9}/cnb/exceptions.py +0 -0
- {python_cnb-1.23.19 → python_cnb-1.24.9}/cnb/followers.py +0 -0
- {python_cnb-1.23.19 → python_cnb-1.24.9}/cnb/missions.py +0 -0
- {python_cnb-1.23.19 → python_cnb-1.24.9}/cnb/models/__init__.py +0 -0
- {python_cnb-1.23.19 → python_cnb-1.24.9}/cnb/models/chart.py +0 -0
- {python_cnb-1.23.19 → python_cnb-1.24.9}/cnb/models/constant.py +0 -0
- {python_cnb-1.23.19 → python_cnb-1.24.9}/cnb/models/convert.py +0 -0
- {python_cnb-1.23.19 → python_cnb-1.24.9}/cnb/models/die.py +0 -0
- {python_cnb-1.23.19 → python_cnb-1.24.9}/cnb/models/errors.py +0 -0
- {python_cnb-1.23.19 → python_cnb-1.24.9}/cnb/models/flags.py +0 -0
- {python_cnb-1.23.19 → python_cnb-1.24.9}/cnb/models/git_woa_com_cnb_monorepo_git_internal_app_git_service_bff_api.py +0 -0
- {python_cnb-1.23.19 → python_cnb-1.24.9}/cnb/models/git_woa_com_cnb_monorepo_git_internal_app_vcs_service_bff_api.py +0 -0
- {python_cnb-1.23.19 → python_cnb-1.24.9}/cnb/models/git_woa_com_cnb_monorepo_platform_service_api_internal_models_artifactory_dto.py +0 -0
- {python_cnb-1.23.19 → python_cnb-1.24.9}/cnb/models/member.py +0 -0
- {python_cnb-1.23.19 → python_cnb-1.24.9}/cnb/models/models.py +0 -0
- {python_cnb-1.23.19 → python_cnb-1.24.9}/cnb/models/openapi.py +0 -0
- {python_cnb-1.23.19 → python_cnb-1.24.9}/cnb/models/web.py +0 -0
- {python_cnb-1.23.19 → python_cnb-1.24.9}/cnb/pulls.py +0 -0
- {python_cnb-1.23.19 → python_cnb-1.24.9}/cnb/rank.py +0 -0
- {python_cnb-1.23.19 → python_cnb-1.24.9}/cnb/repocodeissue.py +0 -0
- {python_cnb-1.23.19 → python_cnb-1.24.9}/cnb/repocontributor.py +0 -0
- {python_cnb-1.23.19 → python_cnb-1.24.9}/cnb/repolabels.py +0 -0
- {python_cnb-1.23.19 → python_cnb-1.24.9}/cnb/search.py +0 -0
- {python_cnb-1.23.19 → python_cnb-1.24.9}/cnb/security.py +0 -0
- {python_cnb-1.23.19 → python_cnb-1.24.9}/cnb/starring.py +0 -0
- {python_cnb-1.23.19 → python_cnb-1.24.9}/cnb/users.py +0 -0
- {python_cnb-1.23.19 → python_cnb-1.24.9}/pyproject.toml +0 -0
- {python_cnb-1.23.19 → python_cnb-1.24.9}/python_cnb.egg-info/dependency_links.txt +0 -0
- {python_cnb-1.23.19 → python_cnb-1.24.9}/python_cnb.egg-info/requires.txt +0 -0
- {python_cnb-1.23.19 → python_cnb-1.24.9}/python_cnb.egg-info/top_level.txt +0 -0
- {python_cnb-1.23.19 → python_cnb-1.24.9}/setup.cfg +0 -0
|
@@ -33,7 +33,7 @@ class BuildService:
|
|
|
33
33
|
)
|
|
34
34
|
return dto.BuildCommonResult.safe_parse(data)
|
|
35
35
|
|
|
36
|
-
# 流水线
|
|
36
|
+
# 流水线 Runner 日志下载。Pipeline runner log download.
|
|
37
37
|
def build_runner_download_log(self,
|
|
38
38
|
repo: str,
|
|
39
39
|
pipelineId: str,
|
|
@@ -46,6 +46,50 @@ class BuildService:
|
|
|
46
46
|
)
|
|
47
47
|
return
|
|
48
48
|
|
|
49
|
+
# 查询流水线 AI 用量汇总。Get pipeline AI usage summary.
|
|
50
|
+
def get_build_ai_audit(self,
|
|
51
|
+
repo: str,
|
|
52
|
+
sn: str,
|
|
53
|
+
pipelineId: str,
|
|
54
|
+
) -> dto.BuildAiAuditResult:
|
|
55
|
+
u = "/%s/-/build/logs/ai-audit/%s/%s" % (repo, sn, pipelineId, )
|
|
56
|
+
|
|
57
|
+
data = self._client.request(
|
|
58
|
+
method="GET",
|
|
59
|
+
endpoint=u,
|
|
60
|
+
)
|
|
61
|
+
return dto.BuildAiAuditResult.safe_parse(data)
|
|
62
|
+
|
|
63
|
+
# 分页查询流水线 AI 请求明细。Paginate pipeline AI request entries.
|
|
64
|
+
def get_build_ai_request(self,
|
|
65
|
+
repo: str,
|
|
66
|
+
sn: str,
|
|
67
|
+
pipelineId: str,
|
|
68
|
+
page: str,
|
|
69
|
+
) -> dto.BuildAiRequestResult:
|
|
70
|
+
u = "/%s/-/build/logs/ai-request/%s/%s/%s" % (repo, sn, pipelineId, page, )
|
|
71
|
+
|
|
72
|
+
data = self._client.request(
|
|
73
|
+
method="GET",
|
|
74
|
+
endpoint=u,
|
|
75
|
+
)
|
|
76
|
+
return dto.BuildAiRequestResult.safe_parse(data)
|
|
77
|
+
|
|
78
|
+
# 查询单条 AI 请求详情。Get a single AI request detail.
|
|
79
|
+
def get_build_ai_request_detail(self,
|
|
80
|
+
repo: str,
|
|
81
|
+
sn: str,
|
|
82
|
+
pipelineId: str,
|
|
83
|
+
requestId: str,
|
|
84
|
+
) -> dto.BuildAiRequestDetailResult:
|
|
85
|
+
u = "/%s/-/build/logs/ai-request-detail/%s/%s/%s" % (repo, sn, pipelineId, requestId, )
|
|
86
|
+
|
|
87
|
+
data = self._client.request(
|
|
88
|
+
method="GET",
|
|
89
|
+
endpoint=u,
|
|
90
|
+
)
|
|
91
|
+
return dto.BuildAiRequestDetailResult.safe_parse(data)
|
|
92
|
+
|
|
49
93
|
# 查询流水线构建列表。List pipeline builds.
|
|
50
94
|
def get_build_logs(self,
|
|
51
95
|
repo: str,
|
|
@@ -85,7 +129,7 @@ class BuildService:
|
|
|
85
129
|
)
|
|
86
130
|
return dto.BuildLogsResult.safe_parse(data)
|
|
87
131
|
|
|
88
|
-
#
|
|
132
|
+
# 查询 Stage 详情。Get pipeline stage detail.
|
|
89
133
|
def get_build_stage(self,
|
|
90
134
|
repo: str,
|
|
91
135
|
sn: str,
|
|
@@ -127,7 +171,7 @@ class BuildService:
|
|
|
127
171
|
)
|
|
128
172
|
return dto.BuildResult.safe_parse(data)
|
|
129
173
|
|
|
130
|
-
# 停止一个构建。
|
|
174
|
+
# 停止一个构建。Stop a build.
|
|
131
175
|
def stop_build(self,
|
|
132
176
|
repo: str,
|
|
133
177
|
sn: str,
|
|
@@ -14,6 +14,7 @@ from .issues import IssuesService
|
|
|
14
14
|
from .knowledgebase import KnowledgebaseService
|
|
15
15
|
from .members import MembersService
|
|
16
16
|
from .missions import MissionsService
|
|
17
|
+
from .npcobservability import NpcobservabilityService
|
|
17
18
|
from .organizations import OrganizationsService
|
|
18
19
|
from .pulls import PullsService
|
|
19
20
|
from .rank import RankService
|
|
@@ -46,6 +47,7 @@ class CNBServices:
|
|
|
46
47
|
self.knowledgebase = KnowledgebaseService(client)
|
|
47
48
|
self.members = MembersService(client)
|
|
48
49
|
self.missions = MissionsService(client)
|
|
50
|
+
self.npcobservability = NpcobservabilityService(client)
|
|
49
51
|
self.organizations = OrganizationsService(client)
|
|
50
52
|
self.pulls = PullsService(client)
|
|
51
53
|
self.rank = RankService(client)
|
|
@@ -33,7 +33,7 @@ class GitsettingsService:
|
|
|
33
33
|
)
|
|
34
34
|
return api.BranchProtection.safe_parse(data)
|
|
35
35
|
|
|
36
|
-
# 查询云原生构建设置。Get cloud
|
|
36
|
+
# 查询云原生构建设置。Get cloud native build settings.
|
|
37
37
|
def get_pipeline_settings(self,
|
|
38
38
|
repo: str,
|
|
39
39
|
) -> api.PipelineSettings:
|
|
@@ -110,7 +110,7 @@ class GitsettingsService:
|
|
|
110
110
|
)
|
|
111
111
|
return
|
|
112
112
|
|
|
113
|
-
# 更新云原生构建设置。Update cloud
|
|
113
|
+
# 更新云原生构建设置。Update cloud native build settings.
|
|
114
114
|
def put_pipeline_settings(self,
|
|
115
115
|
repo: str,
|
|
116
116
|
body_params: api.PipelineSettings,
|
|
@@ -31,7 +31,7 @@ class KnowledgebaseService:
|
|
|
31
31
|
)
|
|
32
32
|
return dto.KnowledgeBaseInfoRes.safe_parse(data)
|
|
33
33
|
|
|
34
|
-
#
|
|
34
|
+
# 获取 Embedding 模型。List embedding models.
|
|
35
35
|
def get_models(self,
|
|
36
36
|
repo: str,
|
|
37
37
|
) -> list[dto.EmbeddingModel]:
|
|
@@ -80,7 +80,7 @@ class KnowledgebaseService:
|
|
|
80
80
|
)
|
|
81
81
|
return [dto.QueryKnowledgeBaseRes.safe_parse(item) for item in data]
|
|
82
82
|
|
|
83
|
-
#
|
|
83
|
+
# 搜索 NPC 角色。Search NPC characters.
|
|
84
84
|
def search_npc(self,
|
|
85
85
|
key: Optional[str] = None,
|
|
86
86
|
top_n: Optional[int] = None,
|
|
@@ -80,7 +80,7 @@ class MembersService:
|
|
|
80
80
|
)
|
|
81
81
|
return
|
|
82
82
|
|
|
83
|
-
#
|
|
83
|
+
# 删除仓库成员。Remove repo member.
|
|
84
84
|
def delete_members_of_repo(self,
|
|
85
85
|
repo: str,
|
|
86
86
|
username: str,
|
|
@@ -123,7 +123,7 @@ class MembersService:
|
|
|
123
123
|
)
|
|
124
124
|
return dto.MemberAccessLevelInSlugUnion.safe_parse(data)
|
|
125
125
|
|
|
126
|
-
#
|
|
126
|
+
# 获取成员访问权限。Get member access level.
|
|
127
127
|
def get_member_access_level_of_repo(self,
|
|
128
128
|
repo: str,
|
|
129
129
|
include_inherit: Optional[bool] = None,
|
|
@@ -287,7 +287,7 @@ class MembersService:
|
|
|
287
287
|
)
|
|
288
288
|
return [dto.UsersWithAccessLevelInSlug.safe_parse(item) for item in data]
|
|
289
289
|
|
|
290
|
-
#
|
|
290
|
+
# 获取外部贡献者。List external contributors.
|
|
291
291
|
def list_outside_collaborators(self,
|
|
292
292
|
slug: str,
|
|
293
293
|
page: Optional[int] = None,
|
|
@@ -310,7 +310,7 @@ class MembersService:
|
|
|
310
310
|
)
|
|
311
311
|
return [dto.OutsideCollaboratorInRepo.safe_parse(item) for item in data]
|
|
312
312
|
|
|
313
|
-
# 更新组织成员权限。Update
|
|
313
|
+
# 更新组织成员权限。Update member permission.
|
|
314
314
|
def update_members_of_group(self,
|
|
315
315
|
group: str,
|
|
316
316
|
username: str,
|
|
@@ -340,7 +340,7 @@ class MembersService:
|
|
|
340
340
|
)
|
|
341
341
|
return
|
|
342
342
|
|
|
343
|
-
# 更新外部贡献者权限。Update
|
|
343
|
+
# 更新外部贡献者权限。Update contributor permission.
|
|
344
344
|
def update_outside_collaborators(self,
|
|
345
345
|
slug: str,
|
|
346
346
|
username: str,
|
|
@@ -343,6 +343,7 @@ class PatchPullRequest(CNBBaseModel):
|
|
|
343
343
|
pass
|
|
344
344
|
class PipelineSettings(CNBBaseModel):
|
|
345
345
|
auto_trigger: Optional[bool] = Field(alias="auto_trigger", default=None)
|
|
346
|
+
auto_trigger_by_npc: Optional[bool] = Field(alias="auto_trigger_by_npc", default=None)
|
|
346
347
|
cron_auto_trigger: Optional[bool] = Field(alias="cron_auto_trigger", default=None)
|
|
347
348
|
forked_repo_auto_trigger: Optional[bool] = Field(alias="forked_repo_auto_trigger", default=None)
|
|
348
349
|
pass
|
|
@@ -107,6 +107,62 @@ class BadgeGroup(CNBBaseModel):
|
|
|
107
107
|
type: Optional[str] = Field(alias="type", default=None)
|
|
108
108
|
typeEn: Optional[str] = Field(alias="typeEn", default=None)
|
|
109
109
|
pass
|
|
110
|
+
class BuildAiAuditResult(CNBBaseModel):
|
|
111
|
+
code: Optional[int] = Field(alias="code", default=None)
|
|
112
|
+
content: Optional['BuildAiUsageSection'] = Field(alias="content", default=None)
|
|
113
|
+
request_log_page_size: Optional[int] = Field(alias="request_log_page_size", default=None)
|
|
114
|
+
request_log_pages: Optional[int] = Field(alias="request_log_pages", default=None)
|
|
115
|
+
pass
|
|
116
|
+
class BuildAiRequestDetailEntry(CNBBaseModel):
|
|
117
|
+
request_body: Optional[str] = Field(alias="request_body", default=None)
|
|
118
|
+
request_headers: Optional[str] = Field(alias="request_headers", default=None)
|
|
119
|
+
request_id: Optional[str] = Field(alias="request_id", default=None)
|
|
120
|
+
response_body: Optional[str] = Field(alias="response_body", default=None)
|
|
121
|
+
response_headers: Optional[str] = Field(alias="response_headers", default=None)
|
|
122
|
+
pass
|
|
123
|
+
class BuildAiRequestDetailResult(CNBBaseModel):
|
|
124
|
+
code: Optional[int] = Field(alias="code", default=None)
|
|
125
|
+
content: Optional['BuildAiRequestDetailEntry'] = Field(alias="content", default=None)
|
|
126
|
+
pass
|
|
127
|
+
class BuildAiRequestEntry(CNBBaseModel):
|
|
128
|
+
completion_tokens: Optional[int] = Field(alias="completion_tokens", default=None)
|
|
129
|
+
discount: Optional[float] = Field(alias="discount", default=None)
|
|
130
|
+
failure_reason: Optional[str] = Field(alias="failure_reason", default=None)
|
|
131
|
+
has_detail: Optional[bool] = Field(alias="has_detail", default=None)
|
|
132
|
+
milli_credit: Optional[int] = Field(alias="milli_credit", default=None)
|
|
133
|
+
model: Optional[str] = Field(alias="model", default=None)
|
|
134
|
+
original_milli_credit: Optional[int] = Field(alias="original_milli_credit", default=None)
|
|
135
|
+
prompt_cache_write_tokens: Optional[int] = Field(alias="prompt_cache_write_tokens", default=None)
|
|
136
|
+
prompt_cached_tokens: Optional[int] = Field(alias="prompt_cached_tokens", default=None)
|
|
137
|
+
prompt_tokens: Optional[int] = Field(alias="prompt_tokens", default=None)
|
|
138
|
+
request_id: Optional[str] = Field(alias="request_id", default=None)
|
|
139
|
+
request_path: Optional[str] = Field(alias="request_path", default=None)
|
|
140
|
+
response_end_duration_ms: Optional[int] = Field(alias="response_end_duration_ms", default=None)
|
|
141
|
+
response_start_duration_ms: Optional[int] = Field(alias="response_start_duration_ms", default=None)
|
|
142
|
+
status_code: Optional[int] = Field(alias="status_code", default=None)
|
|
143
|
+
success: Optional[bool] = Field(alias="success", default=None)
|
|
144
|
+
thinking_tokens: Optional[int] = Field(alias="thinking_tokens", default=None)
|
|
145
|
+
timestamp: Optional[str] = Field(alias="timestamp", default=None)
|
|
146
|
+
total_tokens: Optional[int] = Field(alias="total_tokens", default=None)
|
|
147
|
+
pass
|
|
148
|
+
class BuildAiRequestResult(CNBBaseModel):
|
|
149
|
+
code: Optional[int] = Field(alias="code", default=None)
|
|
150
|
+
content: Optional[list['BuildAiRequestEntry']] = Field(alias="content", default=None)
|
|
151
|
+
pass
|
|
152
|
+
class BuildAiUsageMetric(CNBBaseModel):
|
|
153
|
+
completion_tokens: Optional[int] = Field(alias="completion_tokens", default=None)
|
|
154
|
+
milli_credit: Optional[int] = Field(alias="milli_credit", default=None)
|
|
155
|
+
prompt_cache_write_tokens: Optional[int] = Field(alias="prompt_cache_write_tokens", default=None)
|
|
156
|
+
prompt_cached_tokens: Optional[int] = Field(alias="prompt_cached_tokens", default=None)
|
|
157
|
+
prompt_tokens: Optional[int] = Field(alias="prompt_tokens", default=None)
|
|
158
|
+
request_count: Optional[int] = Field(alias="request_count", default=None)
|
|
159
|
+
thinking_tokens: Optional[int] = Field(alias="thinking_tokens", default=None)
|
|
160
|
+
total_tokens: Optional[int] = Field(alias="total_tokens", default=None)
|
|
161
|
+
pass
|
|
162
|
+
class BuildAiUsageSection(CNBBaseModel):
|
|
163
|
+
models: Optional[Dict[str, 'BuildAiUsageMetric']] = Field(alias="models", default=None)
|
|
164
|
+
total: Optional['BuildAiUsageMetric'] = Field(alias="total", default=None)
|
|
165
|
+
pass
|
|
110
166
|
class BuildCommonResult(CNBBaseModel):
|
|
111
167
|
code: Optional[int] = Field(alias="code", default=None)
|
|
112
168
|
message: Optional[str] = Field(alias="message", default=None)
|
|
@@ -720,6 +776,76 @@ class Missions4User(CNBBaseModel):
|
|
|
720
776
|
updated_at: Optional[str] = Field(alias="updated_at", default=None)
|
|
721
777
|
visibility_level: Optional['constant.Visibility'] = Field(alias="visibility_level", default=None)
|
|
722
778
|
pass
|
|
779
|
+
class NpcActionListResult(CNBBaseModel):
|
|
780
|
+
items: Optional[list['NpcActionRow']] = Field(alias="items", default=None)
|
|
781
|
+
page: Optional[int] = Field(alias="page", default=None)
|
|
782
|
+
page_size: Optional[int] = Field(alias="page_size", default=None)
|
|
783
|
+
total: Optional[int] = Field(alias="total", default=None)
|
|
784
|
+
pass
|
|
785
|
+
class NpcActionRow(CNBBaseModel):
|
|
786
|
+
create_time: Optional[str] = Field(alias="create_time", default=None)
|
|
787
|
+
dispatch_error: Optional[str] = Field(alias="dispatch_error", default=None)
|
|
788
|
+
event: Optional[str] = Field(alias="event", default=None)
|
|
789
|
+
ignore_code: Optional[str] = Field(alias="ignore_code", default=None)
|
|
790
|
+
ignore_reason: Optional[str] = Field(alias="ignore_reason", default=None)
|
|
791
|
+
iid: Optional[int] = Field(alias="iid", default=None)
|
|
792
|
+
npc_avatar: Optional[str] = Field(alias="npc_avatar", default=None)
|
|
793
|
+
npc_name: Optional[str] = Field(alias="npc_name", default=None)
|
|
794
|
+
npc_sha: Optional[str] = Field(alias="npc_sha", default=None)
|
|
795
|
+
npc_slug: Optional[str] = Field(alias="npc_slug", default=None)
|
|
796
|
+
parent_npc_name: Optional[str] = Field(alias="parent_npc_name", default=None)
|
|
797
|
+
sha: Optional[str] = Field(alias="sha", default=None)
|
|
798
|
+
slug: Optional[str] = Field(alias="slug", default=None)
|
|
799
|
+
sn: Optional[str] = Field(alias="sn", default=None)
|
|
800
|
+
status: Optional[int] = Field(alias="status", default=None)
|
|
801
|
+
trigger_user_id: Optional[str] = Field(alias="trigger_user_id", default=None)
|
|
802
|
+
trigger_user_is_npc: Optional[int] = Field(alias="trigger_user_is_npc", default=None)
|
|
803
|
+
trigger_username: Optional[str] = Field(alias="trigger_username", default=None)
|
|
804
|
+
visibility: Optional[str] = Field(alias="visibility", default=None)
|
|
805
|
+
work_mode: Optional[int] = Field(alias="work_mode", default=None)
|
|
806
|
+
pass
|
|
807
|
+
class NpcCommitListResult(CNBBaseModel):
|
|
808
|
+
items: Optional[list['NpcCommitRow']] = Field(alias="items", default=None)
|
|
809
|
+
page: Optional[int] = Field(alias="page", default=None)
|
|
810
|
+
page_size: Optional[int] = Field(alias="page_size", default=None)
|
|
811
|
+
total: Optional[int] = Field(alias="total", default=None)
|
|
812
|
+
pass
|
|
813
|
+
class NpcCommitRow(CNBBaseModel):
|
|
814
|
+
before_sha: Optional[str] = Field(alias="before_sha", default=None)
|
|
815
|
+
commits_count: Optional[int] = Field(alias="commits_count", default=None)
|
|
816
|
+
create_time: Optional[str] = Field(alias="create_time", default=None)
|
|
817
|
+
npc_avatar: Optional[str] = Field(alias="npc_avatar", default=None)
|
|
818
|
+
npc_name: Optional[str] = Field(alias="npc_name", default=None)
|
|
819
|
+
npc_sha: Optional[str] = Field(alias="npc_sha", default=None)
|
|
820
|
+
npc_slug: Optional[str] = Field(alias="npc_slug", default=None)
|
|
821
|
+
pipeline_id: Optional[str] = Field(alias="pipeline_id", default=None)
|
|
822
|
+
ref: Optional[str] = Field(alias="ref", default=None)
|
|
823
|
+
sha: Optional[str] = Field(alias="sha", default=None)
|
|
824
|
+
slug: Optional[str] = Field(alias="slug", default=None)
|
|
825
|
+
sn: Optional[str] = Field(alias="sn", default=None)
|
|
826
|
+
visibility: Optional[str] = Field(alias="visibility", default=None)
|
|
827
|
+
pass
|
|
828
|
+
class NpcPrListResult(CNBBaseModel):
|
|
829
|
+
items: Optional[list['NpcPrRow']] = Field(alias="items", default=None)
|
|
830
|
+
page: Optional[int] = Field(alias="page", default=None)
|
|
831
|
+
page_size: Optional[int] = Field(alias="page_size", default=None)
|
|
832
|
+
total: Optional[int] = Field(alias="total", default=None)
|
|
833
|
+
pass
|
|
834
|
+
class NpcPrRow(CNBBaseModel):
|
|
835
|
+
create_time: Optional[str] = Field(alias="create_time", default=None)
|
|
836
|
+
iid: Optional[int] = Field(alias="iid", default=None)
|
|
837
|
+
npc_avatar: Optional[str] = Field(alias="npc_avatar", default=None)
|
|
838
|
+
npc_name: Optional[str] = Field(alias="npc_name", default=None)
|
|
839
|
+
npc_sha: Optional[str] = Field(alias="npc_sha", default=None)
|
|
840
|
+
npc_slug: Optional[str] = Field(alias="npc_slug", default=None)
|
|
841
|
+
pipeline_id: Optional[str] = Field(alias="pipeline_id", default=None)
|
|
842
|
+
sha: Optional[str] = Field(alias="sha", default=None)
|
|
843
|
+
slug: Optional[str] = Field(alias="slug", default=None)
|
|
844
|
+
sn: Optional[str] = Field(alias="sn", default=None)
|
|
845
|
+
state: Optional[str] = Field(alias="state", default=None)
|
|
846
|
+
update_time: Optional[str] = Field(alias="update_time", default=None)
|
|
847
|
+
visibility: Optional[str] = Field(alias="visibility", default=None)
|
|
848
|
+
pass
|
|
723
849
|
|
|
724
850
|
class OperatorType(Enum):
|
|
725
851
|
OperatorTypeOldEqual = "equal"
|
|
@@ -981,6 +1107,7 @@ class RankDetailWithIncr(CNBBaseModel):
|
|
|
981
1107
|
path: Optional[str] = Field(alias="path", default=None)
|
|
982
1108
|
second_languages: Optional['RepoLanguage'] = Field(alias="second_languages", default=None)
|
|
983
1109
|
site: Optional[str] = Field(alias="site", default=None)
|
|
1110
|
+
skill_scan_status: Optional[str] = Field(alias="skill_scan_status", default=None)
|
|
984
1111
|
star_count: Optional[int] = Field(alias="star_count", default=None)
|
|
985
1112
|
stared: Optional[bool] = Field(alias="stared", default=None)
|
|
986
1113
|
status: Optional['constant.RepoStatus'] = Field(alias="status", default=None)
|
|
@@ -1090,6 +1217,7 @@ class Repos4User(CNBBaseModel):
|
|
|
1090
1217
|
pinned_time: Optional[str] = Field(alias="pinned_time", default=None)
|
|
1091
1218
|
second_languages: Optional['RepoLanguage'] = Field(alias="second_languages", default=None)
|
|
1092
1219
|
site: Optional[str] = Field(alias="site", default=None)
|
|
1220
|
+
skill_scan_status: Optional[str] = Field(alias="skill_scan_status", default=None)
|
|
1093
1221
|
star_count: Optional[int] = Field(alias="star_count", default=None)
|
|
1094
1222
|
star_time: Optional[str] = Field(alias="star_time", default=None)
|
|
1095
1223
|
stared: Optional[bool] = Field(alias="stared", default=None)
|
|
@@ -1125,6 +1253,7 @@ class Repos4UserBase(CNBBaseModel):
|
|
|
1125
1253
|
path: Optional[str] = Field(alias="path", default=None)
|
|
1126
1254
|
second_languages: Optional['RepoLanguage'] = Field(alias="second_languages", default=None)
|
|
1127
1255
|
site: Optional[str] = Field(alias="site", default=None)
|
|
1256
|
+
skill_scan_status: Optional[str] = Field(alias="skill_scan_status", default=None)
|
|
1128
1257
|
star_count: Optional[int] = Field(alias="star_count", default=None)
|
|
1129
1258
|
status: Optional['constant.RepoStatus'] = Field(alias="status", default=None)
|
|
1130
1259
|
tags: Optional[list[object]] = Field(alias="tags", default=None)
|
|
@@ -1203,11 +1332,16 @@ class StarUser(CNBBaseModel):
|
|
|
1203
1332
|
verified: Optional[int] = Field(alias="verified", default=None)
|
|
1204
1333
|
verified_expire_in: Optional[str] = Field(alias="verified_expire_in", default=None)
|
|
1205
1334
|
pass
|
|
1335
|
+
class StartBuildNpc(CNBBaseModel):
|
|
1336
|
+
name: Optional[str] = Field(alias="name", default=None)
|
|
1337
|
+
workMode: Optional[bool] = Field(alias="workMode", default=None)
|
|
1338
|
+
pass
|
|
1206
1339
|
class StartBuildReq(CNBBaseModel):
|
|
1207
1340
|
branch: Optional[str] = Field(alias="branch", default=None)
|
|
1208
1341
|
config: Optional[str] = Field(alias="config", default=None)
|
|
1209
1342
|
env: Optional[Dict[str, 'str']] = Field(alias="env", default=None)
|
|
1210
1343
|
event: Optional[str] = Field(alias="event", default=None)
|
|
1344
|
+
npc: Optional['StartBuildNpc'] = Field(alias="npc", default=None)
|
|
1211
1345
|
sha: Optional[str] = Field(alias="sha", default=None)
|
|
1212
1346
|
sync: Optional[str] = Field(alias="sync", default=None)
|
|
1213
1347
|
tag: Optional[str] = Field(alias="tag", default=None)
|
|
@@ -33,3 +33,4 @@ class SettingValue(Enum):
|
|
|
33
33
|
enableChangeMemberRoleOnlyRoot = "enable_change_member_role_only_root"
|
|
34
34
|
enableOtherGroupNPCAddComment = "enable_other_group_npc_add_comment"
|
|
35
35
|
disableInviteAuthControl = "disable_invite_auth_control"
|
|
36
|
+
onlyRepoMemberCanMentionNPC = "only_repo_member_can_mention_npc"
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# Code generated by cnb.cool/cnb/sdk/cnb-sdk-generator. DO NOT EDIT.
|
|
2
|
+
# source: https://api.cnb.cool/swagger.json
|
|
3
|
+
|
|
4
|
+
from typing import Optional
|
|
5
|
+
from .models import dto
|
|
6
|
+
class NpcobservabilityService:
|
|
7
|
+
def __init__(self, client):
|
|
8
|
+
self._client = client
|
|
9
|
+
|
|
10
|
+
# 查询 NPC 调用记录。List NPC actions.
|
|
11
|
+
def npc_observability_actions(self,
|
|
12
|
+
repo: str,
|
|
13
|
+
end_time: Optional[str] = None,
|
|
14
|
+
event: Optional[str] = None,
|
|
15
|
+
npc_name: Optional[str] = None,
|
|
16
|
+
npc_slug: Optional[str] = None,
|
|
17
|
+
page: Optional[int] = None,
|
|
18
|
+
page_size: Optional[int] = None,
|
|
19
|
+
start_time: Optional[str] = None,
|
|
20
|
+
trigger_username: Optional[str] = None,
|
|
21
|
+
) -> dto.NpcActionListResult:
|
|
22
|
+
u = "/%s/-/npc-observability/actions" % (repo, )
|
|
23
|
+
|
|
24
|
+
query_params = {
|
|
25
|
+
"end_time": end_time,
|
|
26
|
+
"event": event,
|
|
27
|
+
"npc_name": npc_name,
|
|
28
|
+
"npc_slug": npc_slug,
|
|
29
|
+
"page": page,
|
|
30
|
+
"page_size": page_size,
|
|
31
|
+
"start_time": start_time,
|
|
32
|
+
"trigger_username": trigger_username,
|
|
33
|
+
}
|
|
34
|
+
data = self._client.request(
|
|
35
|
+
method="GET",
|
|
36
|
+
endpoint=u,
|
|
37
|
+
params=query_params,
|
|
38
|
+
)
|
|
39
|
+
return dto.NpcActionListResult.safe_parse(data)
|
|
40
|
+
|
|
41
|
+
# 查询 NPC push 记录。List NPC commit pushes.
|
|
42
|
+
def npc_observability_commits(self,
|
|
43
|
+
repo: str,
|
|
44
|
+
end_time: Optional[str] = None,
|
|
45
|
+
npc_name: Optional[str] = None,
|
|
46
|
+
npc_slug: Optional[str] = None,
|
|
47
|
+
page: Optional[int] = None,
|
|
48
|
+
page_size: Optional[int] = None,
|
|
49
|
+
start_time: Optional[str] = None,
|
|
50
|
+
) -> dto.NpcCommitListResult:
|
|
51
|
+
u = "/%s/-/npc-observability/commits" % (repo, )
|
|
52
|
+
|
|
53
|
+
query_params = {
|
|
54
|
+
"end_time": end_time,
|
|
55
|
+
"npc_name": npc_name,
|
|
56
|
+
"npc_slug": npc_slug,
|
|
57
|
+
"page": page,
|
|
58
|
+
"page_size": page_size,
|
|
59
|
+
"start_time": start_time,
|
|
60
|
+
}
|
|
61
|
+
data = self._client.request(
|
|
62
|
+
method="GET",
|
|
63
|
+
endpoint=u,
|
|
64
|
+
params=query_params,
|
|
65
|
+
)
|
|
66
|
+
return dto.NpcCommitListResult.safe_parse(data)
|
|
67
|
+
|
|
68
|
+
# 查询 NPC 提交的 PR。List PRs by NPC.
|
|
69
|
+
def npc_observability_prs(self,
|
|
70
|
+
repo: str,
|
|
71
|
+
end_time: Optional[str] = None,
|
|
72
|
+
npc_name: Optional[str] = None,
|
|
73
|
+
npc_slug: Optional[str] = None,
|
|
74
|
+
page: Optional[int] = None,
|
|
75
|
+
page_size: Optional[int] = None,
|
|
76
|
+
start_time: Optional[str] = None,
|
|
77
|
+
state: Optional[str] = None,
|
|
78
|
+
) -> dto.NpcPrListResult:
|
|
79
|
+
u = "/%s/-/npc-observability/prs" % (repo, )
|
|
80
|
+
|
|
81
|
+
query_params = {
|
|
82
|
+
"end_time": end_time,
|
|
83
|
+
"npc_name": npc_name,
|
|
84
|
+
"npc_slug": npc_slug,
|
|
85
|
+
"page": page,
|
|
86
|
+
"page_size": page_size,
|
|
87
|
+
"start_time": start_time,
|
|
88
|
+
"state": state,
|
|
89
|
+
}
|
|
90
|
+
data = self._client.request(
|
|
91
|
+
method="GET",
|
|
92
|
+
endpoint=u,
|
|
93
|
+
params=query_params,
|
|
94
|
+
)
|
|
95
|
+
return dto.NpcPrListResult.safe_parse(data)
|
|
96
|
+
|
|
97
|
+
|
|
@@ -22,7 +22,7 @@ class RegistriesService:
|
|
|
22
22
|
)
|
|
23
23
|
return
|
|
24
24
|
|
|
25
|
-
# 删除制品标签。Delete
|
|
25
|
+
# 删除制品标签。Delete package tag.
|
|
26
26
|
def delete_package_tag(self,
|
|
27
27
|
slug: str,
|
|
28
28
|
t: str,
|
|
@@ -131,7 +131,7 @@ class RegistriesService:
|
|
|
131
131
|
)
|
|
132
132
|
return dto.Provenance.safe_parse(data)
|
|
133
133
|
|
|
134
|
-
# 查询制品标签列表。
|
|
134
|
+
# 查询制品标签列表。List package tags.
|
|
135
135
|
def list_package_tags(self,
|
|
136
136
|
slug: str,
|
|
137
137
|
t: str,
|
|
@@ -106,6 +106,20 @@ class ReleasesService:
|
|
|
106
106
|
)
|
|
107
107
|
return
|
|
108
108
|
|
|
109
|
+
# 检查 Release 附件。Check release attachment.
|
|
110
|
+
def head_releases_asset(self,
|
|
111
|
+
repo: str,
|
|
112
|
+
tag: str,
|
|
113
|
+
filename: str,
|
|
114
|
+
):
|
|
115
|
+
u = "/%s/-/releases/download/%s/%s" % (repo, tag, filename, )
|
|
116
|
+
|
|
117
|
+
data = self._client.request(
|
|
118
|
+
method="HEAD",
|
|
119
|
+
endpoint=u,
|
|
120
|
+
)
|
|
121
|
+
return
|
|
122
|
+
|
|
109
123
|
# 查询版本列表。List releases.
|
|
110
124
|
def list_releases(self,
|
|
111
125
|
repo: str,
|
|
@@ -57,7 +57,7 @@ class RepositoriesService:
|
|
|
57
57
|
)
|
|
58
58
|
return dto.Repos4User.safe_parse(data)
|
|
59
59
|
|
|
60
|
-
# 查询组织可见仓库。List
|
|
60
|
+
# 查询组织可见仓库。List visible repos.
|
|
61
61
|
def get_group_sub_repos(self,
|
|
62
62
|
slug: str,
|
|
63
63
|
page: Optional[int] = None,
|
|
@@ -206,7 +206,7 @@ class RepositoriesService:
|
|
|
206
206
|
)
|
|
207
207
|
return dto.ListForks.safe_parse(data)
|
|
208
208
|
|
|
209
|
-
# 更新组织仓库墙。Update
|
|
209
|
+
# 更新组织仓库墙。Update pinned repos.
|
|
210
210
|
def set_pinned_repo_by_group(self,
|
|
211
211
|
slug: str,
|
|
212
212
|
body_params: list[str],
|
|
@@ -7,7 +7,7 @@ long_description = (this_directory / "README.md").read_text(encoding="utf-8")
|
|
|
7
7
|
|
|
8
8
|
setup(
|
|
9
9
|
name="python-cnb",
|
|
10
|
-
version="1.
|
|
10
|
+
version="1.24.9",
|
|
11
11
|
author="Tencent Cloud",
|
|
12
12
|
author_email="ericdduan@tencent.com",
|
|
13
13
|
description="CNB OpenAPI的Python SDK,方便与CNB平台进行交互",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|