@heybox/hb-sdk-protocol 0.9.1-alpha.1 → 0.9.1-alpha.11
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.
- package/README.md +17 -1
- package/dist/card-actions.cjs.js +9 -0
- package/dist/card-actions.esm.js +7 -0
- package/dist/index.cjs.js +6579 -5
- package/dist/index.esm.js +6558 -6
- package/generated/native-host-contract.json +46 -2
- package/generated/permission-catalog.json +49 -2
- package/package.json +17 -6
- package/types/index.d.ts +6390 -9
- package/types/workspace-card-actions.d.ts +7 -0
- package/src/bridge.ts +0 -196
- package/src/capabilities.ts +0 -670
- package/src/constants.ts +0 -36
- package/src/guards.ts +0 -835
- package/src/index.ts +0 -9
- package/src/local-dev-grant.ts +0 -141
- package/src/native-host-contract.generated.ts +0 -60
- package/src/native-host-contract.source.json +0 -479
- package/src/native-host.ts +0 -213
- package/src/payloads.ts +0 -1080
- package/src/permission-catalog.ts +0 -193
- package/src/permissions.ts +0 -216
- package/types/bridge.d.ts +0 -163
- package/types/capabilities.d.ts +0 -596
- package/types/constants.d.ts +0 -33
- package/types/guards.d.ts +0 -660
- package/types/local-dev-grant.d.ts +0 -63
- package/types/native-host-contract.generated.d.ts +0 -18
- package/types/native-host.d.ts +0 -147
- package/types/payloads.d.ts +0 -992
- package/types/permission-catalog.d.ts +0 -117
- package/types/permissions.d.ts +0 -159
package/src/constants.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 所有小程序 iframe bridge envelope 共用的固定 namespace。
|
|
3
|
-
*
|
|
4
|
-
* @remarks 该值用于排除无关 `postMessage` 数据,不负责验证消息来源;接收方仍须校验 source 和 nonce,
|
|
5
|
-
* 并在 origin 可以固定且协议模式要求时校验 origin。
|
|
6
|
-
*/
|
|
7
|
-
export const MINI_PROGRAM_MESSAGE_NAMESPACE = 'heybox:miniprogram' as const;
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* 新消息默认发送的当前 bridge wire 版本。
|
|
11
|
-
*
|
|
12
|
-
* @remarks 接收 guard 为握手协商继续接受 v1 与 v2 envelope;cancel 与 operation progress 等 v2-only 消息仍必须使用 v2。
|
|
13
|
-
*/
|
|
14
|
-
export const MINI_PROGRAM_MESSAGE_VERSION = 2 as const;
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Runtime 在 iframe URL 中传递 bridge nonce 的 query 参数名。
|
|
18
|
-
*
|
|
19
|
-
* @remarks nonce 用于把消息关联到当前 iframe 实例,不是独立的身份认证凭据;接收方还必须校验 source,
|
|
20
|
-
* 并在 origin 可以固定且协议模式要求时校验 origin。
|
|
21
|
-
*/
|
|
22
|
-
export const MINI_PROGRAM_BRIDGE_NONCE_PARAM = 'hb_mini_bridge_nonce' as const;
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* SDK 发起 bridge 握手时使用的保留 method。
|
|
26
|
-
*
|
|
27
|
-
* @remarks `type: 'handshake'` 的消息必须使用该 method;Runtime 的可选握手响应也可携带该 method 供 SDK 识别环境快照。
|
|
28
|
-
*/
|
|
29
|
-
export const SDK_HANDSHAKE_METHOD = 'sdk.handshake' as const;
|
|
30
|
-
export const RUNTIME_LOCATION_PROBE_METHOD = 'runtime.location.probe' as const;
|
|
31
|
-
export const SDK_LOCATION_REPORT_METHOD = 'sdk.location.report' as const;
|
|
32
|
-
export const SDK_CSP_VIOLATION_METHOD = 'sdk.csp.violation' as const;
|
|
33
|
-
export const MINI_PROGRAM_OPERATION_PROGRESS_METHOD = 'operation.progress' as const;
|
|
34
|
-
export const COMPANION_SESSION_OUTPUT_EVENT = 'companion.session.output' as const;
|
|
35
|
-
export const COMPANION_SESSION_EXIT_EVENT = 'companion.session.exit' as const;
|
|
36
|
-
export const COMPANION_SESSION_OWNERSHIP_LOST_EVENT = 'companion.session.ownershipLost' as const;
|