pixelarraythirdparty 1.2.7__tar.gz → 1.2.8__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.
Files changed (30) hide show
  1. {pixelarraythirdparty-1.2.7 → pixelarraythirdparty-1.2.8}/PKG-INFO +1 -1
  2. {pixelarraythirdparty-1.2.7 → pixelarraythirdparty-1.2.8}/pixelarraythirdparty/__init__.py +6 -3
  3. pixelarraythirdparty-1.2.8/pixelarraythirdparty/support_chat/support_chat.py +29 -0
  4. pixelarraythirdparty-1.2.8/pixelarraythirdparty/user/__init__.py +0 -0
  5. {pixelarraythirdparty-1.2.7 → pixelarraythirdparty-1.2.8}/pixelarraythirdparty.egg-info/PKG-INFO +1 -1
  6. {pixelarraythirdparty-1.2.7 → pixelarraythirdparty-1.2.8}/pixelarraythirdparty.egg-info/SOURCES.txt +2 -2
  7. {pixelarraythirdparty-1.2.7 → pixelarraythirdparty-1.2.8}/pyproject.toml +1 -1
  8. pixelarraythirdparty-1.2.7/pixelarraythirdparty/temporary_phone/__init__.py +0 -10
  9. pixelarraythirdparty-1.2.7/pixelarraythirdparty/temporary_phone/temporary_phone.py +0 -47
  10. {pixelarraythirdparty-1.2.7 → pixelarraythirdparty-1.2.8}/LICENSE +0 -0
  11. {pixelarraythirdparty-1.2.7 → pixelarraythirdparty-1.2.8}/MANIFEST.in +0 -0
  12. {pixelarraythirdparty-1.2.7 → pixelarraythirdparty-1.2.8}/pixelarraythirdparty/client.py +0 -0
  13. {pixelarraythirdparty-1.2.7 → pixelarraythirdparty-1.2.8}/pixelarraythirdparty/cron/__init__.py +0 -0
  14. {pixelarraythirdparty-1.2.7 → pixelarraythirdparty-1.2.8}/pixelarraythirdparty/cron/cron.py +0 -0
  15. {pixelarraythirdparty-1.2.7 → pixelarraythirdparty-1.2.8}/pixelarraythirdparty/feedback/__init__.py +0 -0
  16. {pixelarraythirdparty-1.2.7 → pixelarraythirdparty-1.2.8}/pixelarraythirdparty/feedback/feedback.py +0 -0
  17. {pixelarraythirdparty-1.2.7 → pixelarraythirdparty-1.2.8}/pixelarraythirdparty/order/__init__.py +0 -0
  18. {pixelarraythirdparty-1.2.7 → pixelarraythirdparty-1.2.8}/pixelarraythirdparty/order/order.py +0 -0
  19. {pixelarraythirdparty-1.2.7 → pixelarraythirdparty-1.2.8}/pixelarraythirdparty/product/__init__.py +0 -0
  20. {pixelarraythirdparty-1.2.7 → pixelarraythirdparty-1.2.8}/pixelarraythirdparty/product/product.py +0 -0
  21. {pixelarraythirdparty-1.2.7 → pixelarraythirdparty-1.2.8}/pixelarraythirdparty/project/__init__.py +0 -0
  22. {pixelarraythirdparty-1.2.7 → pixelarraythirdparty-1.2.8}/pixelarraythirdparty/project/project.py +0 -0
  23. {pixelarraythirdparty-1.2.7/pixelarraythirdparty/user → pixelarraythirdparty-1.2.8/pixelarraythirdparty/support_chat}/__init__.py +0 -0
  24. {pixelarraythirdparty-1.2.7 → pixelarraythirdparty-1.2.8}/pixelarraythirdparty/unified_login/__init__.py +0 -0
  25. {pixelarraythirdparty-1.2.7 → pixelarraythirdparty-1.2.8}/pixelarraythirdparty/unified_login/unified_login.py +0 -0
  26. {pixelarraythirdparty-1.2.7 → pixelarraythirdparty-1.2.8}/pixelarraythirdparty/user/user.py +0 -0
  27. {pixelarraythirdparty-1.2.7 → pixelarraythirdparty-1.2.8}/pixelarraythirdparty.egg-info/dependency_links.txt +0 -0
  28. {pixelarraythirdparty-1.2.7 → pixelarraythirdparty-1.2.8}/pixelarraythirdparty.egg-info/requires.txt +0 -0
  29. {pixelarraythirdparty-1.2.7 → pixelarraythirdparty-1.2.8}/pixelarraythirdparty.egg-info/top_level.txt +0 -0
  30. {pixelarraythirdparty-1.2.7 → pixelarraythirdparty-1.2.8}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pixelarraythirdparty
3
- Version: 1.2.7
3
+ Version: 1.2.8
4
4
  Summary: PixelArray 第三方微服务客户端
5
5
  Author-email: Lu qi <qi.lu@pixelarrayai.com>
6
6
  License-Expression: MIT
@@ -11,10 +11,12 @@ PixelArray 第三方微服务客户端
11
11
  - unified_login: 统一登录模块
12
12
  - feedback: 客户反馈模块
13
13
  - project: 项目管理模块
14
- - temporary_phone: 临时手机号接码模块
14
+ - support_chat: 在线客服(临时会话链接)
15
15
  """
16
16
 
17
- __version__ = "1.2.7"
17
+ from .support_chat.support_chat import SupportChatManagerAsync
18
+
19
+ __version__ = "1.2.8"
18
20
  __author__ = "Lu qi"
19
21
  __email__ = "qi.lu@pixelarrayai.com"
20
22
 
@@ -26,5 +28,6 @@ __all__ = [
26
28
  "order",
27
29
  "feedback",
28
30
  "project",
29
- "temporary_phone",
31
+ "support_chat",
32
+ "SupportChatManagerAsync",
30
33
  ]
@@ -0,0 +1,29 @@
1
+ from pixelarraythirdparty.client import AsyncClient
2
+
3
+
4
+ class SupportChatManagerAsync(AsyncClient):
5
+ async def create_support_chat_link(
6
+ self,
7
+ expires_in_hours: int = 24,
8
+ ):
9
+ """
10
+ description:
11
+ 创建在线客服临时会话链接。其它服务调用此接口后,将返回的 chat_url 下发给用户,
12
+ 用户打开链接即可与客服对话(无需登录)。链接有时效。
13
+ parameters:
14
+ expires_in_hours(int, optional): 链接有效小时数,默认 24,范围 1~720
15
+ return:
16
+ data(dict): 成功时包含
17
+ - chat_url(str): 客服聊天页完整 URL
18
+ - token(str): 会话 token
19
+ - session_id(int): 会话 ID
20
+ - expires_at(str): 过期时间
21
+ success(bool): 操作是否成功
22
+ """
23
+ payload = {"expires_in_hours": expires_in_hours}
24
+ data, success = await self._request(
25
+ "POST", "/api/support-chat/create-link", json=payload
26
+ )
27
+ if not success:
28
+ return data, False
29
+ return data, True
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pixelarraythirdparty
3
- Version: 1.2.7
3
+ Version: 1.2.8
4
4
  Summary: PixelArray 第三方微服务客户端
5
5
  Author-email: Lu qi <qi.lu@pixelarrayai.com>
6
6
  License-Expression: MIT
@@ -18,8 +18,8 @@ pixelarraythirdparty/product/__init__.py
18
18
  pixelarraythirdparty/product/product.py
19
19
  pixelarraythirdparty/project/__init__.py
20
20
  pixelarraythirdparty/project/project.py
21
- pixelarraythirdparty/temporary_phone/__init__.py
22
- pixelarraythirdparty/temporary_phone/temporary_phone.py
21
+ pixelarraythirdparty/support_chat/__init__.py
22
+ pixelarraythirdparty/support_chat/support_chat.py
23
23
  pixelarraythirdparty/unified_login/__init__.py
24
24
  pixelarraythirdparty/unified_login/unified_login.py
25
25
  pixelarraythirdparty/user/__init__.py
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "pixelarraythirdparty"
7
- version = "1.2.7"
7
+ version = "1.2.8"
8
8
  authors = [
9
9
  {name = "Lu qi", email = "qi.lu@pixelarrayai.com"},
10
10
  ]
@@ -1,10 +0,0 @@
1
- #!/usr/bin/env python
2
- # -*- coding: utf-8 -*-
3
-
4
- """
5
- 临时手机号接码模块
6
- """
7
-
8
- from .temporary_phone import TemporaryPhoneAsync
9
-
10
- __all__ = ["TemporaryPhoneAsync"]
@@ -1,47 +0,0 @@
1
- #!/usr/bin/env python
2
- # -*- coding: utf-8 -*-
3
-
4
- """
5
- 临时手机号接码客户端
6
- 基于RapidAPI的temp-phone-number-sms实现
7
- """
8
-
9
- from typing import Dict, Tuple
10
- from ..client import AsyncClient
11
-
12
-
13
- class TemporaryPhoneAsync(AsyncClient):
14
- """
15
- 临时手机号接码异步客户端类
16
- 提供临时手机号接码相关的API调用方法
17
- """
18
-
19
- async def get_number_sms(self, phone_number: str) -> Tuple[Dict, bool]:
20
- """
21
- description:
22
- 获取手机号短信
23
- parameters:
24
- phone_number(str): 手机号码
25
- return:
26
- data(dict): 响应数据
27
- success(bool): 是否成功
28
- """
29
- result = await self._request(
30
- "GET", "/api/temporary-phone/number-sms", params={"phone_number": phone_number}
31
- )
32
- return result
33
-
34
- async def get_temp_number(self, country_code: str) -> Tuple[Dict, bool]:
35
- """
36
- description:
37
- 获取临时手机号
38
- parameters:
39
- country_code(str): 国家代码(如:in, us, br等)
40
- return:
41
- data(dict): 响应数据
42
- success(bool): 是否成功
43
- """
44
- result = await self._request(
45
- "GET", "/api/temporary-phone/temp-number", params={"country_code": country_code}
46
- )
47
- return result