beeply-native 0.1.0__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.
@@ -0,0 +1,38 @@
1
+ Metadata-Version: 2.4
2
+ Name: beeply-native
3
+ Version: 0.1.0
4
+ Summary: Native customer API adapter for Beeply; no UI or staff API
5
+ Requires-Python: >=3.11
6
+ Description-Content-Type: text/markdown
7
+ Requires-Dist: httpx<1,>=0.27
8
+ Provides-Extra: test
9
+ Requires-Dist: pytest<10,>=8; extra == "test"
10
+ Requires-Dist: pytest-asyncio<2,>=0.24; extra == "test"
11
+ Requires-Dist: black<27,>=24; extra == "test"
12
+
13
+ # Beeply Native SDK
14
+
15
+ `beeply-native` 为 Python 3.11+ 宿主提供 Beeply 客户 API。它支持求助、消息、材料、会话续期以及邮箱绑定和恢复。宿主负责界面与安全存储。
16
+
17
+ 包在 PyPI 发布后可通过 `pip install beeply-native` 安装。仓库开发者也可用 `pip install ./clients/python` 安装本地版本。
18
+
19
+ ## 接入宿主后端
20
+
21
+ 在 Beeply 工作台打开 **设置 → 产品与渠道 → 客户端接入**,获取产品 ID 和 HTTPS API 地址。每个 API origin 和产品组合在宿主进程中持有一个客户端实例。
22
+
23
+ ```python
24
+ from beeply_native import NativeSupportClient, StateStore
25
+
26
+
27
+ def create_support(store: StateStore) -> NativeSupportClient:
28
+ return NativeSupportClient("https://api.example.com", "your-product", store)
29
+ ```
30
+
31
+ 通用宿主实现 `StateStore.load()` 和 `StateStore.save(state)`。使用宿主的加密存储保护凭据、草稿和待处理操作,并在原子写入完成后让 `save` 返回。CogineWork 宿主可用 `CogineWorkStore(api_origin, product_id)` 沿用已有的 Secret Store。UI 通过宿主 API 访问公开结果,凭据留在宿主后端。
32
+
33
+ - 已有身份用 `await client.resume()` 读取会话。用户明确发起首次求助时,调用 `await client.create_guest()`。
34
+ - 通过 `prepare_request(text)` 保存提交意图,再调用 `await client.send_operation(operation_id)`。网络结果不明时用 `await client.operation(operation_id)` 查询原操作。
35
+ - 通过 `await client.conversations()` 和 `await client.messages(conversation_id)` 读取记录。宿主确定消息可见后,调用 `await client.mark_read(conversation_id, visible_cursor)`。
36
+ - 显式退出使用 `await client.logout()`。宿主关闭时用 `await client.close()` 释放 HTTP 客户端。
37
+
38
+ SDK 以 `SupportError.code` 返回服务错误,以 `StoreError` 报告本地状态错误。恢复和重试沿用原操作 ID,验证码仅在验证时提交。
@@ -0,0 +1,26 @@
1
+ # Beeply Native SDK
2
+
3
+ `beeply-native` 为 Python 3.11+ 宿主提供 Beeply 客户 API。它支持求助、消息、材料、会话续期以及邮箱绑定和恢复。宿主负责界面与安全存储。
4
+
5
+ 包在 PyPI 发布后可通过 `pip install beeply-native` 安装。仓库开发者也可用 `pip install ./clients/python` 安装本地版本。
6
+
7
+ ## 接入宿主后端
8
+
9
+ 在 Beeply 工作台打开 **设置 → 产品与渠道 → 客户端接入**,获取产品 ID 和 HTTPS API 地址。每个 API origin 和产品组合在宿主进程中持有一个客户端实例。
10
+
11
+ ```python
12
+ from beeply_native import NativeSupportClient, StateStore
13
+
14
+
15
+ def create_support(store: StateStore) -> NativeSupportClient:
16
+ return NativeSupportClient("https://api.example.com", "your-product", store)
17
+ ```
18
+
19
+ 通用宿主实现 `StateStore.load()` 和 `StateStore.save(state)`。使用宿主的加密存储保护凭据、草稿和待处理操作,并在原子写入完成后让 `save` 返回。CogineWork 宿主可用 `CogineWorkStore(api_origin, product_id)` 沿用已有的 Secret Store。UI 通过宿主 API 访问公开结果,凭据留在宿主后端。
20
+
21
+ - 已有身份用 `await client.resume()` 读取会话。用户明确发起首次求助时,调用 `await client.create_guest()`。
22
+ - 通过 `prepare_request(text)` 保存提交意图,再调用 `await client.send_operation(operation_id)`。网络结果不明时用 `await client.operation(operation_id)` 查询原操作。
23
+ - 通过 `await client.conversations()` 和 `await client.messages(conversation_id)` 读取记录。宿主确定消息可见后,调用 `await client.mark_read(conversation_id, visible_cursor)`。
24
+ - 显式退出使用 `await client.logout()`。宿主关闭时用 `await client.close()` 释放 HTTP 客户端。
25
+
26
+ SDK 以 `SupportError.code` 返回服务错误,以 `StoreError` 报告本地状态错误。恢复和重试沿用原操作 ID,验证码仅在验证时提交。
@@ -0,0 +1,21 @@
1
+ [build-system]
2
+ requires = ["setuptools>=68"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "beeply-native"
7
+ version = "0.1.0"
8
+ description = "Native customer API adapter for Beeply; no UI or staff API"
9
+ readme = "README.md"
10
+ requires-python = ">=3.11"
11
+ dependencies = ["httpx>=0.27,<1"]
12
+
13
+ [project.optional-dependencies]
14
+ test = ["pytest>=8,<10", "pytest-asyncio>=0.24,<2", "black>=24,<27"]
15
+
16
+ [tool.setuptools.packages.find]
17
+ where = ["src"]
18
+
19
+ [tool.pytest.ini_options]
20
+ testpaths = ["tests"]
21
+ asyncio_mode = "auto"
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,10 @@
1
+ from .client import NativeSupportClient, SupportError
2
+ from .store import CogineWorkStore, StateStore, StoreError
3
+
4
+ __all__ = [
5
+ "NativeSupportClient",
6
+ "SupportError",
7
+ "CogineWorkStore",
8
+ "StateStore",
9
+ "StoreError",
10
+ ]