@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.
Files changed (69) hide show
  1. package/dist/3x2-2HQTJDKZ.js +6583 -0
  2. package/dist/3x2-2HQTJDKZ.js.map +1 -0
  3. package/dist/3x2-INKWPNLA.js +6585 -0
  4. package/dist/3x2-INKWPNLA.js.map +1 -0
  5. package/dist/call-BTYlT2SU.d.cts +680 -0
  6. package/dist/call-BTYlT2SU.d.ts +680 -0
  7. package/dist/chunk-2ZSOGGPO.js +169 -0
  8. package/dist/chunk-2ZSOGGPO.js.map +1 -0
  9. package/dist/chunk-3V2L6UTK.js +129 -0
  10. package/dist/chunk-3V2L6UTK.js.map +1 -0
  11. package/dist/chunk-5BGEHMPP.js +945 -0
  12. package/dist/chunk-5BGEHMPP.js.map +1 -0
  13. package/dist/chunk-5WRI5ZAA.js +29 -0
  14. package/dist/chunk-5WRI5ZAA.js.map +1 -0
  15. package/dist/chunk-KAXEMJ7E.js +11 -0
  16. package/dist/chunk-KAXEMJ7E.js.map +1 -0
  17. package/dist/chunk-MHOJHG5E.js +39 -0
  18. package/dist/chunk-MHOJHG5E.js.map +1 -0
  19. package/dist/chunk-MP7CSA24.js +299 -0
  20. package/dist/chunk-MP7CSA24.js.map +1 -0
  21. package/dist/chunk-N2N2EQQJ.js +29 -0
  22. package/dist/chunk-N2N2EQQJ.js.map +1 -0
  23. package/dist/element/index.d.ts +853 -0
  24. package/dist/element/index.js +9635 -0
  25. package/dist/element/index.js.map +1 -0
  26. package/dist/engine-D9nbeY08.d.cts +115 -0
  27. package/dist/engine-Doa6Brkm.d.ts +115 -0
  28. package/dist/index.cjs +2133 -0
  29. package/dist/index.cjs.map +1 -0
  30. package/dist/index.d.cts +62 -0
  31. package/dist/index.d.ts +62 -0
  32. package/dist/index.js +630 -0
  33. package/dist/index.js.map +1 -0
  34. package/dist/min-64GIMWWL.js +5456 -0
  35. package/dist/min-64GIMWWL.js.map +1 -0
  36. package/dist/min-ATXYR23R.js +5458 -0
  37. package/dist/min-ATXYR23R.js.map +1 -0
  38. package/dist/react/index.cjs +138 -0
  39. package/dist/react/index.cjs.map +1 -0
  40. package/dist/react/index.d.cts +68 -0
  41. package/dist/react/index.d.ts +68 -0
  42. package/dist/react/index.js +4 -0
  43. package/dist/react/index.js.map +1 -0
  44. package/dist/softphone-DHmhotbf.d.ts +128 -0
  45. package/dist/softphone-DhuhcKCy.d.cts +128 -0
  46. package/dist/softphone.css +1923 -0
  47. package/dist/sources-N4BOEDRL.js +226 -0
  48. package/dist/sources-N4BOEDRL.js.map +1 -0
  49. package/dist/testing/index.cjs +345 -0
  50. package/dist/testing/index.cjs.map +1 -0
  51. package/dist/testing/index.d.cts +66 -0
  52. package/dist/testing/index.d.ts +66 -0
  53. package/dist/testing/index.js +186 -0
  54. package/dist/testing/index.js.map +1 -0
  55. package/dist/ui/index.cjs +15428 -0
  56. package/dist/ui/index.cjs.map +1 -0
  57. package/dist/ui/index.d.cts +188 -0
  58. package/dist/ui/index.d.ts +188 -0
  59. package/dist/ui/index.js +2256 -0
  60. package/dist/ui/index.js.map +1 -0
  61. package/dist/zadarma/index.cjs +1144 -0
  62. package/dist/zadarma/index.cjs.map +1 -0
  63. package/dist/zadarma/index.d.cts +86 -0
  64. package/dist/zadarma/index.d.ts +86 -0
  65. package/dist/zadarma/index.js +5 -0
  66. package/dist/zadarma/index.js.map +1 -0
  67. package/dist/zadarma-engine-DN2SZSQ3.js +5 -0
  68. package/dist/zadarma-engine-DN2SZSQ3.js.map +1 -0
  69. package/package.json +123 -0
@@ -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 };
@@ -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 };