@16x/webphone-sdk 3.1.9 → 3.1.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/CHANGELOG.md +24 -0
- package/README.md +6 -1
- package/dist/CCBarClient-B7SRICz8.cjs +1 -0
- package/dist/{CCBarClient-CfHT0tl2.js → CCBarClient-Dmw3T0lF.js} +189 -120
- package/dist/{Diagnostics-CfbmMp-b.js → Diagnostics-BLHANihC.js} +1 -1
- package/dist/Diagnostics-Dmhx4niF.cjs +1 -0
- package/dist/core/CCBarClient.d.ts +5 -1
- package/dist/diagnostics/index.cjs +1 -1
- package/dist/diagnostics/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +3 -3
- package/dist/index.umd.js +17 -17
- package/dist/legacy/index.cjs +1 -1
- package/dist/legacy/index.js +102 -131
- package/dist/legacy/legacyAes.d.ts +4 -26
- package/dist/legacy/legacySessionProvider.d.ts +8 -4
- package/dist/version.d.ts +1 -1
- package/package.json +109 -109
- package/dist/CCBarClient-B6WqgloY.cjs +0 -1
- package/dist/Diagnostics-DkKlZQnY.cjs +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./redact-Bq26pObO.cjs");var t=`3.1.11`,n=class{capacity;entries=[];constructor(e){if(this.capacity=e,!Number.isInteger(e)||e<=0)throw RangeError(`RingBuffer capacity must be a positive integer`)}push(e){this.entries.length===this.capacity&&this.entries.shift(),this.entries.push(e)}toArray(){return[...this.entries]}},r=`@16x/webphone-sdk`,i=200,a=class{dependencies;logs=new n(i);now;constructor(e){this.dependencies=e,this.now=e.now??(()=>new Date)}log(t,n,r){this.logs.push({timestamp:this.now().toISOString(),level:t,message:e.t(n),...r===void 0?{}:{context:e.n(r)}})}async getReport(n={}){let i=n.includeRecentLogs!==!1,a=n.includeDeviceNames===!0,u=n.maskPhoneNumbers!==!1,d=this.dependencies.getSnapshot(),f=this.dependencies.getPermission===void 0?d.permission:await o(this.dependencies.getPermission,d.permission),p=a?await s(this.dependencies.getDeviceNames):void 0,m=l(c(this.dependencies.getUserAgent)),h={generatedAt:this.now().toISOString(),sdk:{name:r,version:t},browser:m.browser,os:m.os,...d,permission:f,recentLogs:i?this.logs.toArray():[],...p===void 0?{}:{deviceNames:p}};return e.n(h,{maskPhoneNumbers:u})}};async function o(e,t){try{return await e()}catch{return t}}async function s(e){if(e===void 0)return[];try{return[...await e()]}catch{return[]}}function c(e){if(e!==void 0)try{return e()}catch{return``}return typeof navigator>`u`?``:navigator.userAgent}function l(e){return{browser:u(e),os:d(e)}}function u(e){for(let[t,n]of[[`Edge`,/Edg\/([\d.]+)/],[`Chrome`,/(?:Chrome|CriOS)\/([\d.]+)/],[`Firefox`,/(?:Firefox|FxiOS)\/([\d.]+)/],[`Safari`,/Version\/([\d.]+).*Safari/]]){let r=e.match(n);if(r?.[1]!==void 0)return{name:t,version:r[1]}}return{name:`unknown`,version:``}}function d(e){let t=e.match(/(?:iPhone|iPad).*OS ([\d_]+)/);if(t?.[1]!==void 0)return{name:`iOS`,version:t[1].replaceAll(`_`,`.`)};let n=e.match(/Android ([\d.]+)/);if(n?.[1]!==void 0)return{name:`Android`,version:n[1]};let r=e.match(/Windows NT ([\d.]+)/);if(r?.[1]!==void 0)return{name:`Windows`,version:r[1]};let i=e.match(/Mac OS X ([\d_]+)/);return i?.[1]===void 0?/Linux/.test(e)?{name:`Linux`,version:``}:{name:`unknown`,version:``}:{name:`macOS`,version:i[1].replaceAll(`_`,`.`)}}Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return a}});
|
|
@@ -6,7 +6,11 @@ import { CCBarCall, CallPlatform } from './CCBarCall.js';
|
|
|
6
6
|
import { DiagnosticsOptions, DiagnosticsReport } from '../diagnostics/Diagnostics.js';
|
|
7
7
|
/**
|
|
8
8
|
* 会话来源:由接入方在自己的服务端把会话拼好后交给 SDK。
|
|
9
|
-
*
|
|
9
|
+
* 签名、取 token 等必须在服务端做的事,由接入方自己的接口完成;SDK 不请求平台的会话接口。
|
|
10
|
+
*
|
|
11
|
+
* 会话里的 `sip.registerTicket` 按**明文 SIP 密码**处理。如果接入方直接把老平台
|
|
12
|
+
* `seat/account/get` 返回的 `password` 密文塞了进来,SDK 会在会话入口自动解一次
|
|
13
|
+
* (老平台内置 key/iv;判据与兜底见 `tryDecryptSipTicket`),解不出来就原样放行。
|
|
10
14
|
*/
|
|
11
15
|
export interface SessionProvider {
|
|
12
16
|
createSession(request: CreateSessionRequest): Promise<WebPhoneSession>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../Diagnostics-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../Diagnostics-Dmhx4niF.cjs"),t=require("../redact-Bq26pObO.cjs");require("../createJsSipFactory-Dr8HbLl-.cjs"),exports.Diagnostics=e.t,exports.RingBuffer=e.n,exports.diagnosticsVersion=e.r,exports.redactText=t.t,exports.redactValue=t.n;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { n as e, r as t, t as n } from "../Diagnostics-
|
|
1
|
+
import { n as e, r as t, t as n } from "../Diagnostics-BLHANihC.js";
|
|
2
2
|
import { n as r, t as i } from "../redact-DB3CMbsK.js";
|
|
3
3
|
export { n as Diagnostics, e as RingBuffer, t as diagnosticsVersion, i as redactText, r as redactValue };
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./SharedWorkerProtocol-39dch6xL.cjs"),t=require("./CCBarClient-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./SharedWorkerProtocol-39dch6xL.cjs"),t=require("./CCBarClient-B7SRICz8.cjs"),n=require("./Diagnostics-Dmhx4niF.cjs"),r=require("./redact-Bq26pObO.cjs");require("./diagnostics/index.cjs"),require("./createJsSipFactory-Dr8HbLl-.cjs");function i(e){if(e.code!==`OK`)throw TypeError(`Unexpected session response code: ${e.code}`);if(e.data===void 0||e.data===null)throw TypeError(`Unexpected session response: missing data`);return e.data}function a(e={}){return{version:`0.1.0`,options:e}}var o=`0.1.0`;exports.CCBarCall=t.o,exports.CCBarClient=t.t,exports.CCBarError=e.i,exports.CallManager=t.a,exports.CallStateError=t.s,exports.Diagnostics=n.t,exports.RingBuffer=n.n,exports.TypedEventBus=t.f,exports.assertCallTransition=t.c,exports.canTransition=t.l,exports.createSdk=a,exports.createSharedWorkerSelection=t.n,exports.diagnosticsVersion=n.r,exports.parseSessionResponse=i,exports.redactText=r.t,exports.redactValue=r.n,exports.resolveWorkerUrl=t.r,exports.transition=t.u,exports.transitions=t.d,exports.version=o;
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { i as e } from "./SharedWorkerProtocol-DKVQ5-po.js";
|
|
2
|
-
import { a as t, c as n, d as r, i, l as a, n as o, o as s, r as c, s as l, t as u, u as d } from "./CCBarClient-
|
|
3
|
-
import { n as f, r as p, t as m } from "./Diagnostics-
|
|
2
|
+
import { a as t, c as n, d as r, f as i, l as a, n as o, o as s, r as c, s as l, t as u, u as d } from "./CCBarClient-Dmw3T0lF.js";
|
|
3
|
+
import { n as f, r as p, t as m } from "./Diagnostics-BLHANihC.js";
|
|
4
4
|
import { n as h, t as g } from "./redact-DB3CMbsK.js";
|
|
5
5
|
import "./diagnostics/index.js";
|
|
6
6
|
//#region src/api/contracts.ts
|
|
@@ -19,4 +19,4 @@ function v(e = {}) {
|
|
|
19
19
|
}
|
|
20
20
|
var y = "0.1.0";
|
|
21
21
|
//#endregion
|
|
22
|
-
export {
|
|
22
|
+
export { s as CCBarCall, u as CCBarClient, e as CCBarError, t as CallManager, l as CallStateError, m as Diagnostics, f as RingBuffer, i as TypedEventBus, n as assertCallTransition, a as canTransition, v as createSdk, o as createSharedWorkerSelection, p as diagnosticsVersion, _ as parseSessionResponse, g as redactText, h as redactValue, c as resolveWorkerUrl, d as transition, r as transitions, y as version };
|