@16x/webphone-sdk 3.8.1 → 4.0.0
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/CHANGELOG.md +0 -28
- package/README.md +0 -43
- package/dist/{CCBarClient-BJryiSYT.cjs → CCBarClient-BFq7695C.cjs} +1 -1
- package/dist/{CCBarClient-CbkMKzEw.js → CCBarClient-CAGBUxil.js} +4 -6
- package/dist/{Diagnostics-Cmo6qDKu.js → Diagnostics-Cs02iAlB.js} +1 -1
- package/dist/{Diagnostics--D2xwro7.cjs → Diagnostics-DwF6aDHZ.cjs} +1 -1
- package/dist/api/contracts.d.ts +0 -11
- package/dist/core/CCBarClient.d.ts +3 -3
- package/dist/diagnostics/index.cjs +1 -1
- package/dist/diagnostics/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +2 -2
- package/dist/index.umd.js +2 -2
- package/dist/legacy/index.cjs +1 -1
- package/dist/legacy/index.d.ts +0 -2
- package/dist/legacy/index.js +3 -300
- package/dist/types.d.ts +1 -5
- package/dist/version.d.ts +1 -1
- package/package.json +109 -109
- package/dist/legacy/legacyAes.d.ts +0 -29
- package/dist/legacy/legacySessionProvider.d.ts +0 -79
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { SessionProvider } from '../core/CCBarClient.js';
|
|
2
|
-
/** 换票结果:`{ token, expires }`、`{ accessToken, expires }`、`{ data: {...} }` 或裸字符串都能接 */
|
|
3
|
-
export type LegacyTokenResult = string | {
|
|
4
|
-
token?: string;
|
|
5
|
-
accessToken?: string;
|
|
6
|
-
expires?: number;
|
|
7
|
-
data?: unknown;
|
|
8
|
-
};
|
|
9
|
-
export interface LegacySeatAccount {
|
|
10
|
-
username?: string;
|
|
11
|
-
account?: string;
|
|
12
|
-
customerPrefix?: string;
|
|
13
|
-
extension?: string;
|
|
14
|
-
password?: string;
|
|
15
|
-
registerPassword?: string;
|
|
16
|
-
expiresIn?: number;
|
|
17
|
-
expires_in?: number;
|
|
18
|
-
domain?: string;
|
|
19
|
-
wsPort?: number;
|
|
20
|
-
wssPort?: number;
|
|
21
|
-
turnIp?: string;
|
|
22
|
-
turnPort?: number;
|
|
23
|
-
iceServers?: Array<{
|
|
24
|
-
urls?: string[] | string;
|
|
25
|
-
username?: string;
|
|
26
|
-
credential?: string;
|
|
27
|
-
}>;
|
|
28
|
-
[key: string]: unknown;
|
|
29
|
-
}
|
|
30
|
-
export interface LegacyPlatformSessionProviderOptions {
|
|
31
|
-
/** 平台网关地址,例如 `https://vxapi.yundianlab.com`(不含路径前缀);必填 */
|
|
32
|
-
host: string;
|
|
33
|
-
/** 取 token 的两种写法二选一:函数(接入方自己调) */
|
|
34
|
-
getToken?: () => LegacyTokenResult | Promise<LegacyTokenResult>;
|
|
35
|
-
/** 取 token 的两种写法二选一:地址(SDK 去 POST 这个地址,通常是接入方自己的接口) */
|
|
36
|
-
tokenUrl?: string;
|
|
37
|
-
/** tokenUrl 的请求方法,默认 POST */
|
|
38
|
-
tokenMethod?: 'GET' | 'POST';
|
|
39
|
-
/** tokenUrl 的请求体(POST 时 JSON 发送),默认 {} */
|
|
40
|
-
tokenBody?: Record<string, unknown>;
|
|
41
|
-
/** tokenUrl 的额外请求头 */
|
|
42
|
-
tokenHeaders?: Record<string, string>;
|
|
43
|
-
/** 路径前缀,默认 `/openapi/token/v1` */
|
|
44
|
-
pathPrefix?: string;
|
|
45
|
-
/** 坐席账号路径(相对 pathPrefix),默认 `/seat/account/get` */
|
|
46
|
-
accountPath?: string;
|
|
47
|
-
/** 坐席状态路径(相对 pathPrefix),默认 `/seats/set-status` */
|
|
48
|
-
statusPath?: string;
|
|
49
|
-
/** 软电话路径,默认 `/api/fs/sip-ws` */
|
|
50
|
-
sipWsPath?: string;
|
|
51
|
-
/** 显式指定 WSS 地址(覆盖按 domain/wssPort 拼装),可以是相对路径 */
|
|
52
|
-
sipWsUrl?: string;
|
|
53
|
-
/** 是否把 token 挂到 WSS 的 `?token=`,默认 true(旧页面那套不挂时可设 false) */
|
|
54
|
-
attachTokenToWss?: boolean;
|
|
55
|
-
/** AES key / iv(16 字节,UTF-8);默认用平台内置值 */
|
|
56
|
-
aesKey?: string;
|
|
57
|
-
aesIv?: string;
|
|
58
|
-
/** REGISTER 有效期(秒),默认 600 */
|
|
59
|
-
registerExpires?: number;
|
|
60
|
-
/** 会话 TTL 的提前换票缓冲(秒),默认 180 */
|
|
61
|
-
refreshBufferSeconds?: number;
|
|
62
|
-
/** 并发上限,默认 2(移动端形态下 SDK 也会压到 1) */
|
|
63
|
-
maxConcurrentCalls?: number;
|
|
64
|
-
/** 是否允许接来电(总闸),默认 true */
|
|
65
|
-
incomingEnabled?: boolean;
|
|
66
|
-
/** 移动端是否允许接来电,默认 true(桌面形态不看这一项) */
|
|
67
|
-
mobileIncomingEnabled?: boolean;
|
|
68
|
-
/** 能力白名单,默认老平台六项 */
|
|
69
|
-
capabilities?: string[];
|
|
70
|
-
/** 请求实现(测试/代理场景可替换),默认全局 fetch */
|
|
71
|
-
fetchImpl?: typeof fetch;
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* 造一个会话来源:`new CCBarClient({ sessionProvider: createLegacySessionProvider({...}) })`。
|
|
75
|
-
* `refreshSession` 与 `createSession` 等价——整条链路重跑一遍,等价于换一次 SIP 密码。
|
|
76
|
-
*/
|
|
77
|
-
export declare function createLegacySessionProvider(options: LegacyPlatformSessionProviderOptions): SessionProvider & {
|
|
78
|
-
getSeatAccount(): Promise<LegacySeatAccount>;
|
|
79
|
-
};
|