@coventia/softphone 0.3.0 → 0.4.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/index.d.cts CHANGED
@@ -1,7 +1,7 @@
1
- import { S as Softphone } from './softphone-dZMkW8V1.cjs';
2
- export { A as AudioDevices } from './softphone-dZMkW8V1.cjs';
3
- import { S as SoftphoneConfig } from './call-CaPDWVk3.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 RingtoneOption, l as RingtoneSettings, m as RingtoneSource, n as SoftphoneError, o as SoftphoneErrorCode, p as SoftphoneEvent, q as SoftphoneEventMap, r as SoftphoneState, T as TokenEndpointOptions, s as TokenSource, t as TypedEmitter, V as VoiceToken, u as canTransition, v as isFatal, w as isTerminal } from './call-CaPDWVk3.cjs';
1
+ import { S as Softphone } from './softphone-CY5d2WWY.cjs';
2
+ export { A as AudioDevices } from './softphone-CY5d2WWY.cjs';
3
+ import { S as SoftphoneConfig, O as OutboundNumberRefusal } from './call-C6YpT6uR.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, k as OutboundNumber, l as OutboundNumberKind, m as OutboundNumberSettings, n as OutboundNumberState, o as OutboundNumbersSource, R as RemoteParty, p as RingtoneOption, q as RingtoneSettings, r as RingtoneSource, s as SoftphoneError, t as SoftphoneErrorCode, u as SoftphoneEvent, v as SoftphoneEventMap, w as SoftphoneState, T as TokenEndpointOptions, x as TokenSource, y as TypedEmitter, V as VoiceToken, z as canTransition, A as isFatal, B as isTerminal } from './call-C6YpT6uR.cjs';
5
5
 
6
6
  /**
7
7
  * Construct a softphone.
@@ -19,6 +19,16 @@ export { C as CALL_TRANSITIONS, a as Call, b as CallDirection, c as CallEvent, d
19
19
  */
20
20
  declare function createSoftphone(config: SoftphoneConfig): Softphone;
21
21
 
22
+ /**
23
+ * A change of outbound number the request limits refused (outbound-number-per-agent.md §5.3–§5.5). Structural,
24
+ * like `isSoftphoneError`: the concrete error is a plain `Error` with a `refusal`, so a host — or a second copy
25
+ * of the SDK on the page — can recognise it without sharing a class.
26
+ */
27
+ interface OutboundNumberRefusedError extends Error {
28
+ readonly refusal: OutboundNumberRefusal;
29
+ }
30
+ declare function isOutboundNumberRefused(value: unknown): value is OutboundNumberRefusedError;
31
+
22
32
  /**
23
33
  * Browser-capability probes.
24
34
  *
@@ -57,6 +67,6 @@ declare function isWebRtcSupported(): boolean;
57
67
  * - `MockProvider` — lives at @coventia/softphone/testing, so it never lands in a production bundle.
58
68
  */
59
69
 
60
- declare const VERSION = "0.3.0";
70
+ declare const VERSION = "0.4.0";
61
71
 
62
- export { Softphone, SoftphoneConfig, VERSION, createSoftphone, isBrowser, isWebRtcSupported };
72
+ export { OutboundNumberRefusal, type OutboundNumberRefusedError, Softphone, SoftphoneConfig, VERSION, createSoftphone, isBrowser, isOutboundNumberRefused, isWebRtcSupported };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { S as Softphone } from './softphone-DEt0TtQw.js';
2
- export { A as AudioDevices } from './softphone-DEt0TtQw.js';
3
- import { S as SoftphoneConfig } from './call-CaPDWVk3.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 RingtoneOption, l as RingtoneSettings, m as RingtoneSource, n as SoftphoneError, o as SoftphoneErrorCode, p as SoftphoneEvent, q as SoftphoneEventMap, r as SoftphoneState, T as TokenEndpointOptions, s as TokenSource, t as TypedEmitter, V as VoiceToken, u as canTransition, v as isFatal, w as isTerminal } from './call-CaPDWVk3.js';
1
+ import { S as Softphone } from './softphone-DXgmTyrX.js';
2
+ export { A as AudioDevices } from './softphone-DXgmTyrX.js';
3
+ import { S as SoftphoneConfig, O as OutboundNumberRefusal } from './call-C6YpT6uR.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, k as OutboundNumber, l as OutboundNumberKind, m as OutboundNumberSettings, n as OutboundNumberState, o as OutboundNumbersSource, R as RemoteParty, p as RingtoneOption, q as RingtoneSettings, r as RingtoneSource, s as SoftphoneError, t as SoftphoneErrorCode, u as SoftphoneEvent, v as SoftphoneEventMap, w as SoftphoneState, T as TokenEndpointOptions, x as TokenSource, y as TypedEmitter, V as VoiceToken, z as canTransition, A as isFatal, B as isTerminal } from './call-C6YpT6uR.js';
5
5
 
6
6
  /**
7
7
  * Construct a softphone.
@@ -19,6 +19,16 @@ export { C as CALL_TRANSITIONS, a as Call, b as CallDirection, c as CallEvent, d
19
19
  */
20
20
  declare function createSoftphone(config: SoftphoneConfig): Softphone;
21
21
 
22
+ /**
23
+ * A change of outbound number the request limits refused (outbound-number-per-agent.md §5.3–§5.5). Structural,
24
+ * like `isSoftphoneError`: the concrete error is a plain `Error` with a `refusal`, so a host — or a second copy
25
+ * of the SDK on the page — can recognise it without sharing a class.
26
+ */
27
+ interface OutboundNumberRefusedError extends Error {
28
+ readonly refusal: OutboundNumberRefusal;
29
+ }
30
+ declare function isOutboundNumberRefused(value: unknown): value is OutboundNumberRefusedError;
31
+
22
32
  /**
23
33
  * Browser-capability probes.
24
34
  *
@@ -57,6 +67,6 @@ declare function isWebRtcSupported(): boolean;
57
67
  * - `MockProvider` — lives at @coventia/softphone/testing, so it never lands in a production bundle.
58
68
  */
59
69
 
60
- declare const VERSION = "0.3.0";
70
+ declare const VERSION = "0.4.0";
61
71
 
62
- export { Softphone, SoftphoneConfig, VERSION, createSoftphone, isBrowser, isWebRtcSupported };
72
+ export { OutboundNumberRefusal, type OutboundNumberRefusedError, Softphone, SoftphoneConfig, VERSION, createSoftphone, isBrowser, isOutboundNumberRefused, isWebRtcSupported };
package/dist/index.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import { isBrowser } from './chunk-KAXEMJ7E.js';
2
2
  export { isBrowser, isWebRtcSupported } from './chunk-KAXEMJ7E.js';
3
3
  export { CallEvent, SoftphoneEvent } from './chunk-7R6LOOAI.js';
4
+ export { isOutboundNumberRefused } from './chunk-5E5OEXS2.js';
4
5
  import { isFatal } from './chunk-2ZSOGGPO.js';
5
6
  export { ERROR_CATALOGUE, isFatal } from './chunk-2ZSOGGPO.js';
6
7
  import { cachedTokenSource } from './chunk-MHOJHG5E.js';
@@ -284,7 +285,7 @@ function coventiaBackend(config, tokenSource, fallbackBaseUrl) {
284
285
  }
285
286
  let pending = null;
286
287
  const load = () => {
287
- pending ??= import('./sources-M3GYMS6V.js').then(
288
+ pending ??= import('./sources-ONYQW733.js').then(
288
289
  (m) => m.coventiaSources({ ...config, baseUrl, tokenSource })
289
290
  );
290
291
  return pending;
@@ -300,6 +301,11 @@ function coventiaBackend(config, tokenSource, fallbackBaseUrl) {
300
301
  get: async (signal) => (await load()).ringtones.get(signal),
301
302
  setMine: async (id) => (await load()).ringtones.setMine(id),
302
303
  cached: async () => (await load()).ringtones.cached?.() ?? null
304
+ },
305
+ outboundNumbers: {
306
+ get: async (signal) => (await load()).outboundNumbers.get(signal),
307
+ setMine: async (id) => (await load()).outboundNumbers.setMine(id),
308
+ cached: async () => (await load()).outboundNumbers.cached?.() ?? null
303
309
  }
304
310
  };
305
311
  }
@@ -1009,7 +1015,7 @@ function isCallEngine(value) {
1009
1015
  }
1010
1016
 
1011
1017
  // src/index.ts
1012
- var VERSION = "0.3.0";
1018
+ var VERSION = "0.4.0";
1013
1019
 
1014
1020
  export { CALL_TRANSITIONS, INITIAL_STATES, VERSION, canTransition, createSoftphone, isTerminal };
1015
1021
  //# sourceMappingURL=index.js.map