@coventia/softphone 0.1.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/dist/3x2-2HQTJDKZ.js +6583 -0
- package/dist/3x2-2HQTJDKZ.js.map +1 -0
- package/dist/3x2-INKWPNLA.js +6585 -0
- package/dist/3x2-INKWPNLA.js.map +1 -0
- package/dist/call-BTYlT2SU.d.cts +680 -0
- package/dist/call-BTYlT2SU.d.ts +680 -0
- package/dist/chunk-2ZSOGGPO.js +169 -0
- package/dist/chunk-2ZSOGGPO.js.map +1 -0
- package/dist/chunk-3V2L6UTK.js +129 -0
- package/dist/chunk-3V2L6UTK.js.map +1 -0
- package/dist/chunk-5BGEHMPP.js +945 -0
- package/dist/chunk-5BGEHMPP.js.map +1 -0
- package/dist/chunk-5WRI5ZAA.js +29 -0
- package/dist/chunk-5WRI5ZAA.js.map +1 -0
- package/dist/chunk-KAXEMJ7E.js +11 -0
- package/dist/chunk-KAXEMJ7E.js.map +1 -0
- package/dist/chunk-MHOJHG5E.js +39 -0
- package/dist/chunk-MHOJHG5E.js.map +1 -0
- package/dist/chunk-MP7CSA24.js +299 -0
- package/dist/chunk-MP7CSA24.js.map +1 -0
- package/dist/chunk-N2N2EQQJ.js +29 -0
- package/dist/chunk-N2N2EQQJ.js.map +1 -0
- package/dist/element/index.d.ts +853 -0
- package/dist/element/index.js +9635 -0
- package/dist/element/index.js.map +1 -0
- package/dist/engine-D9nbeY08.d.cts +115 -0
- package/dist/engine-Doa6Brkm.d.ts +115 -0
- package/dist/index.cjs +2133 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +62 -0
- package/dist/index.d.ts +62 -0
- package/dist/index.js +630 -0
- package/dist/index.js.map +1 -0
- package/dist/min-64GIMWWL.js +5456 -0
- package/dist/min-64GIMWWL.js.map +1 -0
- package/dist/min-ATXYR23R.js +5458 -0
- package/dist/min-ATXYR23R.js.map +1 -0
- package/dist/react/index.cjs +138 -0
- package/dist/react/index.cjs.map +1 -0
- package/dist/react/index.d.cts +68 -0
- package/dist/react/index.d.ts +68 -0
- package/dist/react/index.js +4 -0
- package/dist/react/index.js.map +1 -0
- package/dist/softphone-DHmhotbf.d.ts +128 -0
- package/dist/softphone-DhuhcKCy.d.cts +128 -0
- package/dist/softphone.css +1923 -0
- package/dist/sources-N4BOEDRL.js +226 -0
- package/dist/sources-N4BOEDRL.js.map +1 -0
- package/dist/testing/index.cjs +345 -0
- package/dist/testing/index.cjs.map +1 -0
- package/dist/testing/index.d.cts +66 -0
- package/dist/testing/index.d.ts +66 -0
- package/dist/testing/index.js +186 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/ui/index.cjs +15428 -0
- package/dist/ui/index.cjs.map +1 -0
- package/dist/ui/index.d.cts +188 -0
- package/dist/ui/index.d.ts +188 -0
- package/dist/ui/index.js +2256 -0
- package/dist/ui/index.js.map +1 -0
- package/dist/zadarma/index.cjs +1144 -0
- package/dist/zadarma/index.cjs.map +1 -0
- package/dist/zadarma/index.d.cts +86 -0
- package/dist/zadarma/index.d.ts +86 -0
- package/dist/zadarma/index.js +5 -0
- package/dist/zadarma/index.js.map +1 -0
- package/dist/zadarma-engine-DN2SZSQ3.js +5 -0
- package/dist/zadarma-engine-DN2SZSQ3.js.map +1 -0
- package/package.json +123 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { S as Softphone } from './softphone-DhuhcKCy.cjs';
|
|
2
|
+
export { A as AudioDevices } from './softphone-DhuhcKCy.cjs';
|
|
3
|
+
import { S as SoftphoneConfig } from './call-BTYlT2SU.cjs';
|
|
4
|
+
export { C as CALL_TRANSITIONS, a as Call, b as CallDirection, c as CallEvent, d as CallEventMap, e as CallOptions, f as CallState, g as Contact, E as ERROR_CATALOGUE, F as FatalErrorCode, h as FatalSoftphoneError, H as HangupReason, i as HoldOriginator, I as INITIAL_STATES, L as LogLevel, N as NonFatalErrorCode, j as NonFatalSoftphoneError, R as RemoteParty, k as SoftphoneError, l as SoftphoneErrorCode, m as SoftphoneEvent, n as SoftphoneEventMap, o as SoftphoneState, T as TokenEndpointOptions, p as TokenSource, q as TypedEmitter, V as VoiceToken, r as canTransition, s as isFatal, t as isTerminal } from './call-BTYlT2SU.cjs';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Construct a softphone.
|
|
8
|
+
*
|
|
9
|
+
* A factory, not `new Softphone()`, for two reasons: it resolves the underlying call engine from
|
|
10
|
+
* config without exposing that machinery, and it returns the `Softphone` INTERFACE, so the concrete
|
|
11
|
+
* class stays an implementation detail free to change without a major version.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* const phone = createSoftphone({
|
|
15
|
+
* tokenSource: TokenSource.endpoint('/voice/token'),
|
|
16
|
+
* resolveContact: (n) => api.lookup(n),
|
|
17
|
+
* });
|
|
18
|
+
* await phone.start(); // from a user gesture — see Softphone.start()
|
|
19
|
+
*/
|
|
20
|
+
declare function createSoftphone(config: SoftphoneConfig): Softphone;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Browser-capability probes.
|
|
24
|
+
*
|
|
25
|
+
* SPEC §10.2: nothing under core/ or transports/ may touch `window`, `document` or `navigator` at
|
|
26
|
+
* MODULE SCOPE. Importing the package must be safe on a server — a Next.js consumer renders on the
|
|
27
|
+
* server first, and a bare `ReferenceError: window is not defined` at import time makes us unusable
|
|
28
|
+
* there no matter how framework-agnostic the runtime API is.
|
|
29
|
+
*
|
|
30
|
+
* Every probe below is therefore a FUNCTION, evaluated lazily at call time.
|
|
31
|
+
*/
|
|
32
|
+
/** True when running in a browser with a DOM. False under SSR, in Node, and in a worker. */
|
|
33
|
+
declare function isBrowser(): boolean;
|
|
34
|
+
/**
|
|
35
|
+
* True when the browser exposes the WebRTC APIs the softphone needs.
|
|
36
|
+
*
|
|
37
|
+
* Worth a distinct check rather than folding into isBrowser(): privacy extensions
|
|
38
|
+
* (uBlock Origin Extra, WebRTC Leak Prevent) disable RTCPeerConnection outright, and the resulting
|
|
39
|
+
* failure is otherwise reported as a confusing SIP error deep in a call attempt.
|
|
40
|
+
*/
|
|
41
|
+
declare function isWebRtcSupported(): boolean;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* @coventia/softphone — the framework-free engine.
|
|
45
|
+
*
|
|
46
|
+
* Importable from vanilla JS, Vue, Svelte, a PHP-rendered page, and a Node/SSR process. Exports NO
|
|
47
|
+
* React and touches NO browser global at module scope (SPEC §10.1, §10.2). Those two rules — not the
|
|
48
|
+
* authoring language, not the package layout — are what make this usable anywhere.
|
|
49
|
+
*
|
|
50
|
+
* THIS FILE IS THE PUBLIC API. Anything not exported here is free to change without a major version;
|
|
51
|
+
* anything exported here is not. Adding to it is cheap and removing from it is expensive, so add
|
|
52
|
+
* deliberately.
|
|
53
|
+
*
|
|
54
|
+
* Notably NOT exported, and deliberately:
|
|
55
|
+
* - `SipProvider` and everything under transports/ — the provider seam is internal (SPEC §5.4).
|
|
56
|
+
* Exporting it would freeze the shape of a Zadarma migration we have not designed yet.
|
|
57
|
+
* - `MockProvider` — lives at @coventia/softphone/testing, so it never lands in a production bundle.
|
|
58
|
+
*/
|
|
59
|
+
|
|
60
|
+
declare const VERSION = "0.0.0";
|
|
61
|
+
|
|
62
|
+
export { Softphone, SoftphoneConfig, VERSION, createSoftphone, isBrowser, isWebRtcSupported };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { S as Softphone } from './softphone-DHmhotbf.js';
|
|
2
|
+
export { A as AudioDevices } from './softphone-DHmhotbf.js';
|
|
3
|
+
import { S as SoftphoneConfig } from './call-BTYlT2SU.js';
|
|
4
|
+
export { C as CALL_TRANSITIONS, a as Call, b as CallDirection, c as CallEvent, d as CallEventMap, e as CallOptions, f as CallState, g as Contact, E as ERROR_CATALOGUE, F as FatalErrorCode, h as FatalSoftphoneError, H as HangupReason, i as HoldOriginator, I as INITIAL_STATES, L as LogLevel, N as NonFatalErrorCode, j as NonFatalSoftphoneError, R as RemoteParty, k as SoftphoneError, l as SoftphoneErrorCode, m as SoftphoneEvent, n as SoftphoneEventMap, o as SoftphoneState, T as TokenEndpointOptions, p as TokenSource, q as TypedEmitter, V as VoiceToken, r as canTransition, s as isFatal, t as isTerminal } from './call-BTYlT2SU.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Construct a softphone.
|
|
8
|
+
*
|
|
9
|
+
* A factory, not `new Softphone()`, for two reasons: it resolves the underlying call engine from
|
|
10
|
+
* config without exposing that machinery, and it returns the `Softphone` INTERFACE, so the concrete
|
|
11
|
+
* class stays an implementation detail free to change without a major version.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* const phone = createSoftphone({
|
|
15
|
+
* tokenSource: TokenSource.endpoint('/voice/token'),
|
|
16
|
+
* resolveContact: (n) => api.lookup(n),
|
|
17
|
+
* });
|
|
18
|
+
* await phone.start(); // from a user gesture — see Softphone.start()
|
|
19
|
+
*/
|
|
20
|
+
declare function createSoftphone(config: SoftphoneConfig): Softphone;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Browser-capability probes.
|
|
24
|
+
*
|
|
25
|
+
* SPEC §10.2: nothing under core/ or transports/ may touch `window`, `document` or `navigator` at
|
|
26
|
+
* MODULE SCOPE. Importing the package must be safe on a server — a Next.js consumer renders on the
|
|
27
|
+
* server first, and a bare `ReferenceError: window is not defined` at import time makes us unusable
|
|
28
|
+
* there no matter how framework-agnostic the runtime API is.
|
|
29
|
+
*
|
|
30
|
+
* Every probe below is therefore a FUNCTION, evaluated lazily at call time.
|
|
31
|
+
*/
|
|
32
|
+
/** True when running in a browser with a DOM. False under SSR, in Node, and in a worker. */
|
|
33
|
+
declare function isBrowser(): boolean;
|
|
34
|
+
/**
|
|
35
|
+
* True when the browser exposes the WebRTC APIs the softphone needs.
|
|
36
|
+
*
|
|
37
|
+
* Worth a distinct check rather than folding into isBrowser(): privacy extensions
|
|
38
|
+
* (uBlock Origin Extra, WebRTC Leak Prevent) disable RTCPeerConnection outright, and the resulting
|
|
39
|
+
* failure is otherwise reported as a confusing SIP error deep in a call attempt.
|
|
40
|
+
*/
|
|
41
|
+
declare function isWebRtcSupported(): boolean;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* @coventia/softphone — the framework-free engine.
|
|
45
|
+
*
|
|
46
|
+
* Importable from vanilla JS, Vue, Svelte, a PHP-rendered page, and a Node/SSR process. Exports NO
|
|
47
|
+
* React and touches NO browser global at module scope (SPEC §10.1, §10.2). Those two rules — not the
|
|
48
|
+
* authoring language, not the package layout — are what make this usable anywhere.
|
|
49
|
+
*
|
|
50
|
+
* THIS FILE IS THE PUBLIC API. Anything not exported here is free to change without a major version;
|
|
51
|
+
* anything exported here is not. Adding to it is cheap and removing from it is expensive, so add
|
|
52
|
+
* deliberately.
|
|
53
|
+
*
|
|
54
|
+
* Notably NOT exported, and deliberately:
|
|
55
|
+
* - `SipProvider` and everything under transports/ — the provider seam is internal (SPEC §5.4).
|
|
56
|
+
* Exporting it would freeze the shape of a Zadarma migration we have not designed yet.
|
|
57
|
+
* - `MockProvider` — lives at @coventia/softphone/testing, so it never lands in a production bundle.
|
|
58
|
+
*/
|
|
59
|
+
|
|
60
|
+
declare const VERSION = "0.0.0";
|
|
61
|
+
|
|
62
|
+
export { Softphone, SoftphoneConfig, VERSION, createSoftphone, isBrowser, isWebRtcSupported };
|