pixelarraythirdparty 1.3.2__tar.gz → 1.3.4__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.
- {pixelarraythirdparty-1.3.2 → pixelarraythirdparty-1.3.4}/PKG-INFO +1 -1
- {pixelarraythirdparty-1.3.2 → pixelarraythirdparty-1.3.4}/pixelarraythirdparty/__init__.py +2 -2
- {pixelarraythirdparty-1.3.2 → pixelarraythirdparty-1.3.4}/pixelarraythirdparty/custom_events/custom_events.py +96 -0
- {pixelarraythirdparty-1.3.2 → pixelarraythirdparty-1.3.4}/pixelarraythirdparty/project/project.py +19 -0
- {pixelarraythirdparty-1.3.2 → pixelarraythirdparty-1.3.4}/pixelarraythirdparty/project_dashboard/project_dashboard.py +4 -0
- {pixelarraythirdparty-1.3.2 → pixelarraythirdparty-1.3.4}/pixelarraythirdparty.egg-info/PKG-INFO +1 -1
- {pixelarraythirdparty-1.3.2 → pixelarraythirdparty-1.3.4}/pyproject.toml +1 -1
- {pixelarraythirdparty-1.3.2 → pixelarraythirdparty-1.3.4}/LICENSE +0 -0
- {pixelarraythirdparty-1.3.2 → pixelarraythirdparty-1.3.4}/MANIFEST.in +0 -0
- {pixelarraythirdparty-1.3.2 → pixelarraythirdparty-1.3.4}/pixelarraythirdparty/client.py +0 -0
- {pixelarraythirdparty-1.3.2 → pixelarraythirdparty-1.3.4}/pixelarraythirdparty/cron/__init__.py +0 -0
- {pixelarraythirdparty-1.3.2 → pixelarraythirdparty-1.3.4}/pixelarraythirdparty/cron/cron.py +0 -0
- {pixelarraythirdparty-1.3.2 → pixelarraythirdparty-1.3.4}/pixelarraythirdparty/custom_events/__init__.py +0 -0
- {pixelarraythirdparty-1.3.2 → pixelarraythirdparty-1.3.4}/pixelarraythirdparty/feedback/__init__.py +0 -0
- {pixelarraythirdparty-1.3.2 → pixelarraythirdparty-1.3.4}/pixelarraythirdparty/feedback/feedback.py +0 -0
- {pixelarraythirdparty-1.3.2 → pixelarraythirdparty-1.3.4}/pixelarraythirdparty/order/__init__.py +0 -0
- {pixelarraythirdparty-1.3.2 → pixelarraythirdparty-1.3.4}/pixelarraythirdparty/order/order.py +0 -0
- {pixelarraythirdparty-1.3.2 → pixelarraythirdparty-1.3.4}/pixelarraythirdparty/product/__init__.py +0 -0
- {pixelarraythirdparty-1.3.2 → pixelarraythirdparty-1.3.4}/pixelarraythirdparty/product/product.py +0 -0
- {pixelarraythirdparty-1.3.2 → pixelarraythirdparty-1.3.4}/pixelarraythirdparty/project/__init__.py +0 -0
- {pixelarraythirdparty-1.3.2 → pixelarraythirdparty-1.3.4}/pixelarraythirdparty/project_dashboard/__init__.py +0 -0
- {pixelarraythirdparty-1.3.2 → pixelarraythirdparty-1.3.4}/pixelarraythirdparty/support_chat/__init__.py +0 -0
- {pixelarraythirdparty-1.3.2 → pixelarraythirdparty-1.3.4}/pixelarraythirdparty/support_chat/support_chat.py +0 -0
- {pixelarraythirdparty-1.3.2 → pixelarraythirdparty-1.3.4}/pixelarraythirdparty/unified_login/__init__.py +0 -0
- {pixelarraythirdparty-1.3.2 → pixelarraythirdparty-1.3.4}/pixelarraythirdparty/unified_login/unified_login.py +0 -0
- {pixelarraythirdparty-1.3.2 → pixelarraythirdparty-1.3.4}/pixelarraythirdparty/user/__init__.py +0 -0
- {pixelarraythirdparty-1.3.2 → pixelarraythirdparty-1.3.4}/pixelarraythirdparty/user/user.py +0 -0
- {pixelarraythirdparty-1.3.2 → pixelarraythirdparty-1.3.4}/pixelarraythirdparty.egg-info/SOURCES.txt +0 -0
- {pixelarraythirdparty-1.3.2 → pixelarraythirdparty-1.3.4}/pixelarraythirdparty.egg-info/dependency_links.txt +0 -0
- {pixelarraythirdparty-1.3.2 → pixelarraythirdparty-1.3.4}/pixelarraythirdparty.egg-info/requires.txt +0 -0
- {pixelarraythirdparty-1.3.2 → pixelarraythirdparty-1.3.4}/pixelarraythirdparty.egg-info/top_level.txt +0 -0
- {pixelarraythirdparty-1.3.2 → pixelarraythirdparty-1.3.4}/setup.cfg +0 -0
|
@@ -12,7 +12,7 @@ PixelArray 第三方微服务客户端
|
|
|
12
12
|
- feedback: 客户反馈模块
|
|
13
13
|
- project: 项目管理模块
|
|
14
14
|
- support_chat: 在线客服(临时会话链接)
|
|
15
|
-
- custom_events:
|
|
15
|
+
- custom_events: 自定义事件(新建定义、上报与报表查询)
|
|
16
16
|
- project_dashboard: 项目看板(按 scope 查询 DNU/DAU/留存)
|
|
17
17
|
"""
|
|
18
18
|
|
|
@@ -20,7 +20,7 @@ from .support_chat.support_chat import SupportChatManagerAsync
|
|
|
20
20
|
from .custom_events.custom_events import CustomEventsManagerAsync
|
|
21
21
|
from .project_dashboard.project_dashboard import ProjectDashboardManagerAsync
|
|
22
22
|
|
|
23
|
-
__version__ = "1.3.
|
|
23
|
+
__version__ = "1.3.4"
|
|
24
24
|
__author__ = "Lu qi"
|
|
25
25
|
__email__ = "qi.lu@pixelarrayai.com"
|
|
26
26
|
|
|
@@ -5,6 +5,23 @@ from typing import Any, Dict, List, Optional, Tuple
|
|
|
5
5
|
class CustomEventsManagerAsync(AsyncClient):
|
|
6
6
|
"""自定义事件:新建定义与上报(上报前须存在对应事件定义与字段 schema)。"""
|
|
7
7
|
|
|
8
|
+
def _dashboard_params(
|
|
9
|
+
self,
|
|
10
|
+
project_name: str,
|
|
11
|
+
*,
|
|
12
|
+
start_date: Optional[str] = None,
|
|
13
|
+
end_date: Optional[str] = None,
|
|
14
|
+
top_events_limit: Optional[int] = None,
|
|
15
|
+
) -> Dict[str, Any]:
|
|
16
|
+
p: Dict[str, Any] = {"project_name": project_name}
|
|
17
|
+
if start_date is not None:
|
|
18
|
+
p["start_date"] = start_date
|
|
19
|
+
if end_date is not None:
|
|
20
|
+
p["end_date"] = end_date
|
|
21
|
+
if top_events_limit is not None:
|
|
22
|
+
p["top_events_limit"] = top_events_limit
|
|
23
|
+
return p
|
|
24
|
+
|
|
8
25
|
async def create_custom_event_definition(
|
|
9
26
|
self,
|
|
10
27
|
project_name: str,
|
|
@@ -90,3 +107,82 @@ class CustomEventsManagerAsync(AsyncClient):
|
|
|
90
107
|
"""
|
|
91
108
|
body = {"project_name": project_name, "items": items}
|
|
92
109
|
return await self._request("POST", "/api/custom-events/report/batch", json=body)
|
|
110
|
+
|
|
111
|
+
async def get_custom_events_dashboard_summary(
|
|
112
|
+
self,
|
|
113
|
+
project_name: str,
|
|
114
|
+
*,
|
|
115
|
+
start_date: Optional[str] = None,
|
|
116
|
+
end_date: Optional[str] = None,
|
|
117
|
+
) -> Tuple[Dict[str, Any], bool]:
|
|
118
|
+
"""GET /api/custom-events/dashboard/summary:KPI 摘要(需 API Key 或 JWT)。"""
|
|
119
|
+
params = self._dashboard_params(
|
|
120
|
+
project_name, start_date=start_date, end_date=end_date
|
|
121
|
+
)
|
|
122
|
+
return await self._request(
|
|
123
|
+
"GET", "/api/custom-events/dashboard/summary", params=params
|
|
124
|
+
)
|
|
125
|
+
|
|
126
|
+
async def get_custom_events_dashboard_daily(
|
|
127
|
+
self,
|
|
128
|
+
project_name: str,
|
|
129
|
+
*,
|
|
130
|
+
start_date: Optional[str] = None,
|
|
131
|
+
end_date: Optional[str] = None,
|
|
132
|
+
) -> Tuple[Dict[str, Any], bool]:
|
|
133
|
+
"""GET /api/custom-events/dashboard/daily:按日事件量(UTC)。"""
|
|
134
|
+
params = self._dashboard_params(
|
|
135
|
+
project_name, start_date=start_date, end_date=end_date
|
|
136
|
+
)
|
|
137
|
+
return await self._request(
|
|
138
|
+
"GET", "/api/custom-events/dashboard/daily", params=params
|
|
139
|
+
)
|
|
140
|
+
|
|
141
|
+
async def get_custom_events_dashboard_top_events(
|
|
142
|
+
self,
|
|
143
|
+
project_name: str,
|
|
144
|
+
*,
|
|
145
|
+
start_date: Optional[str] = None,
|
|
146
|
+
end_date: Optional[str] = None,
|
|
147
|
+
top_events_limit: Optional[int] = None,
|
|
148
|
+
) -> Tuple[Dict[str, Any], bool]:
|
|
149
|
+
"""GET /api/custom-events/dashboard/top-events:事件量 TOP N。"""
|
|
150
|
+
params = self._dashboard_params(
|
|
151
|
+
project_name,
|
|
152
|
+
start_date=start_date,
|
|
153
|
+
end_date=end_date,
|
|
154
|
+
top_events_limit=top_events_limit,
|
|
155
|
+
)
|
|
156
|
+
return await self._request(
|
|
157
|
+
"GET", "/api/custom-events/dashboard/top-events", params=params
|
|
158
|
+
)
|
|
159
|
+
|
|
160
|
+
async def get_custom_events_dashboard_by_category(
|
|
161
|
+
self,
|
|
162
|
+
project_name: str,
|
|
163
|
+
*,
|
|
164
|
+
start_date: Optional[str] = None,
|
|
165
|
+
end_date: Optional[str] = None,
|
|
166
|
+
) -> Tuple[Dict[str, Any], bool]:
|
|
167
|
+
"""GET /api/custom-events/dashboard/by-category:按分类分布。"""
|
|
168
|
+
params = self._dashboard_params(
|
|
169
|
+
project_name, start_date=start_date, end_date=end_date
|
|
170
|
+
)
|
|
171
|
+
return await self._request(
|
|
172
|
+
"GET", "/api/custom-events/dashboard/by-category", params=params
|
|
173
|
+
)
|
|
174
|
+
|
|
175
|
+
async def get_custom_events_dashboard_by_hour(
|
|
176
|
+
self,
|
|
177
|
+
project_name: str,
|
|
178
|
+
*,
|
|
179
|
+
start_date: Optional[str] = None,
|
|
180
|
+
end_date: Optional[str] = None,
|
|
181
|
+
) -> Tuple[Dict[str, Any], bool]:
|
|
182
|
+
"""GET /api/custom-events/dashboard/by-hour:按 UTC 小时分布。"""
|
|
183
|
+
params = self._dashboard_params(
|
|
184
|
+
project_name, start_date=start_date, end_date=end_date
|
|
185
|
+
)
|
|
186
|
+
return await self._request(
|
|
187
|
+
"GET", "/api/custom-events/dashboard/by-hour", params=params
|
|
188
|
+
)
|
{pixelarraythirdparty-1.3.2 → pixelarraythirdparty-1.3.4}/pixelarraythirdparty/project/project.py
RENAMED
|
@@ -61,6 +61,25 @@ class ProjectManagerAsync(AsyncClient):
|
|
|
61
61
|
return data, False
|
|
62
62
|
return data, True
|
|
63
63
|
|
|
64
|
+
async def rename_project(self, project_id: int, name: str):
|
|
65
|
+
"""
|
|
66
|
+
description:
|
|
67
|
+
重命名项目;同步更新 external_users 中与旧项目名一致的 project_name。
|
|
68
|
+
parameters:
|
|
69
|
+
project_id(int): 项目ID
|
|
70
|
+
name(str): 新项目名称
|
|
71
|
+
return:
|
|
72
|
+
data(dict): 更新后的项目信息(含 id、name、bound_domains、created_at)
|
|
73
|
+
success(bool): 操作是否成功
|
|
74
|
+
"""
|
|
75
|
+
data = {"name": name}
|
|
76
|
+
data, success = await self._request(
|
|
77
|
+
"PATCH", f"/api/projects/{project_id}/name", json=data
|
|
78
|
+
)
|
|
79
|
+
if not success:
|
|
80
|
+
return data, False
|
|
81
|
+
return data, True
|
|
82
|
+
|
|
64
83
|
async def delete_project(self, project_id: int):
|
|
65
84
|
"""
|
|
66
85
|
description:
|
|
@@ -24,6 +24,7 @@ class ProjectDashboardManagerAsync(AsyncClient):
|
|
|
24
24
|
scope: str,
|
|
25
25
|
start_date: Optional[str] = None,
|
|
26
26
|
end_date: Optional[str] = None,
|
|
27
|
+
retention_days: Optional[str] = None,
|
|
27
28
|
) -> Tuple[Dict[str, Any], bool]:
|
|
28
29
|
"""
|
|
29
30
|
description:
|
|
@@ -33,6 +34,7 @@ class ProjectDashboardManagerAsync(AsyncClient):
|
|
|
33
34
|
scope(str): DNU | DAU | RETENTION | 留存
|
|
34
35
|
start_date(str, optional): 开始日期 YYYY-MM-DD;不传则服务端默认 T-7
|
|
35
36
|
end_date(str, optional): 结束日期 YYYY-MM-DD;不传则服务端默认 T-0
|
|
37
|
+
retention_days(str, optional): 仅 scope 为留存时有效;逗号分隔天数,如 2,7,14,20;不传则服务端默认
|
|
36
38
|
return:
|
|
37
39
|
data(dict): 成功时为 DauData / DnuData / RetentionData 结构(见接口文档)
|
|
38
40
|
success(bool): 是否成功
|
|
@@ -48,4 +50,6 @@ class ProjectDashboardManagerAsync(AsyncClient):
|
|
|
48
50
|
params["start_date"] = start_date
|
|
49
51
|
if end_date:
|
|
50
52
|
params["end_date"] = end_date
|
|
53
|
+
if retention_days:
|
|
54
|
+
params["retention_days"] = retention_days
|
|
51
55
|
return await self._request("GET", path, params=params)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pixelarraythirdparty-1.3.2 → pixelarraythirdparty-1.3.4}/pixelarraythirdparty/cron/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pixelarraythirdparty-1.3.2 → pixelarraythirdparty-1.3.4}/pixelarraythirdparty/feedback/__init__.py
RENAMED
|
File without changes
|
{pixelarraythirdparty-1.3.2 → pixelarraythirdparty-1.3.4}/pixelarraythirdparty/feedback/feedback.py
RENAMED
|
File without changes
|
{pixelarraythirdparty-1.3.2 → pixelarraythirdparty-1.3.4}/pixelarraythirdparty/order/__init__.py
RENAMED
|
File without changes
|
{pixelarraythirdparty-1.3.2 → pixelarraythirdparty-1.3.4}/pixelarraythirdparty/order/order.py
RENAMED
|
File without changes
|
{pixelarraythirdparty-1.3.2 → pixelarraythirdparty-1.3.4}/pixelarraythirdparty/product/__init__.py
RENAMED
|
File without changes
|
{pixelarraythirdparty-1.3.2 → pixelarraythirdparty-1.3.4}/pixelarraythirdparty/product/product.py
RENAMED
|
File without changes
|
{pixelarraythirdparty-1.3.2 → pixelarraythirdparty-1.3.4}/pixelarraythirdparty/project/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pixelarraythirdparty-1.3.2 → pixelarraythirdparty-1.3.4}/pixelarraythirdparty/user/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{pixelarraythirdparty-1.3.2 → pixelarraythirdparty-1.3.4}/pixelarraythirdparty.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{pixelarraythirdparty-1.3.2 → pixelarraythirdparty-1.3.4}/pixelarraythirdparty.egg-info/requires.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|