@coventia/softphone 0.5.0 → 0.5.1

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 (37) hide show
  1. package/dist/{call-FqcvDg1t.d.cts → call-iGvr2ZnO.d.cts} +26 -2
  2. package/dist/{call-FqcvDg1t.d.ts → call-iGvr2ZnO.d.ts} +26 -2
  3. package/dist/chunk-3UTUWGVG.js +1891 -0
  4. package/dist/chunk-3UTUWGVG.js.map +1 -0
  5. package/dist/chunk-DZRSSZWB.js +39 -0
  6. package/dist/chunk-DZRSSZWB.js.map +1 -0
  7. package/dist/element/index.d.ts +25 -1
  8. package/dist/{engine-CzOCrfY9.d.cts → engine-BKoT_Pj7.d.cts} +10 -1
  9. package/dist/{engine-CsNRD7B7.d.ts → engine-CeGh5Yai.d.ts} +10 -1
  10. package/dist/index.cjs +1049 -130
  11. package/dist/index.cjs.map +1 -1
  12. package/dist/index.d.cts +5 -5
  13. package/dist/index.d.ts +5 -5
  14. package/dist/index.js +179 -13
  15. package/dist/index.js.map +1 -1
  16. package/dist/react/index.d.cts +2 -2
  17. package/dist/react/index.d.ts +2 -2
  18. package/dist/{softphone-By9sizlV.d.ts → softphone-D0ao5W4z.d.ts} +1 -1
  19. package/dist/{softphone-JZvJdzU3.d.cts → softphone-DRoS0jJR.d.cts} +1 -1
  20. package/dist/{sources-QL2LRZVH.js → sources-LGFJG7W2.js} +10 -38
  21. package/dist/sources-LGFJG7W2.js.map +1 -0
  22. package/dist/testing/index.d.cts +2 -2
  23. package/dist/testing/index.d.ts +2 -2
  24. package/dist/ui/index.d.cts +2 -2
  25. package/dist/ui/index.d.ts +2 -2
  26. package/dist/zadarma/index.cjs +865 -116
  27. package/dist/zadarma/index.cjs.map +1 -1
  28. package/dist/zadarma/index.d.cts +37 -10
  29. package/dist/zadarma/index.d.ts +37 -10
  30. package/dist/zadarma/index.js +2 -1
  31. package/dist/zadarma-engine-VYIXLBQG.js +7 -0
  32. package/dist/{zadarma-engine-TIUE7PZ7.js.map → zadarma-engine-VYIXLBQG.js.map} +1 -1
  33. package/package.json +1 -1
  34. package/dist/chunk-6RR6G35E.js +0 -1146
  35. package/dist/chunk-6RR6G35E.js.map +0 -1
  36. package/dist/sources-QL2LRZVH.js.map +0 -1
  37. package/dist/zadarma-engine-TIUE7PZ7.js +0 -6
@@ -223,6 +223,24 @@ interface LineUpdate {
223
223
  /** Who has the line when it is `elsewhere`; `null` when it is here, or the server did not say. */
224
224
  readonly where: LineLocation | null;
225
225
  }
226
+ /**
227
+ * A call offered to this user's line, as the backend announces it over the presence socket
228
+ * (incoming-call-reliability.md §5): `start` each time the call is offered to the extension (a re-offer of the
229
+ * same call repeats it, same `callId`), `end` when the call is over. `callId` is opaque; `from` is the caller,
230
+ * `null` (or, on an `end`, absent) when the backend did not say.
231
+ *
232
+ * The softphone uses it for one thing: after a decline, to know when the declined call's re-offers stop, so a
233
+ * new call from the same number rings (§4.4). A presence source that never sends it loses nothing but that.
234
+ */
235
+ type CallOffer = {
236
+ readonly state: 'start';
237
+ readonly callId: string;
238
+ readonly from: string | null;
239
+ } | {
240
+ readonly state: 'end';
241
+ readonly callId: string;
242
+ readonly from?: string | null;
243
+ };
226
244
  /** The answer to `PresenceConnection.claimLine()`. */
227
245
  interface LineClaimResult {
228
246
  readonly ok: boolean;
@@ -429,6 +447,12 @@ interface PresenceCallbacks {
429
447
  readonly onLine?: (update: LineUpdate) => void;
430
448
  /** The answer to `PresenceConnection.claimLine()`. Optional, like `onLine`. */
431
449
  readonly onClaimResult?: (result: LineClaimResult) => void;
450
+ /**
451
+ * A call offered to this line started or ended (`CallOffer`). Sent only to the line's owner. Optional, like
452
+ * `onLine`: callbacks written before it existed still type-check, and a source that never calls it leaves the
453
+ * softphone on its fallback after a decline (incoming-call-reliability.md §4.4).
454
+ */
455
+ readonly onOffer?: (offer: CallOffer) => void;
432
456
  }
433
457
  /**
434
458
  * Opens one live presence connection. Coventia-backed by default (mints a one-time ticket, opens
@@ -903,7 +927,7 @@ interface TypedEmitter<M> {
903
927
  *
904
928
  * - **`rejecting`.** Today's engine has one, purely to swallow Zadarma's `return_timeout` retries
905
929
  * for 35 s after a decline (SPEC §3.4). That is a PROVIDER quirk — it belongs in
906
- * `providers/zadarma.ts` as `quirks.rejectGuardMs`, not in the shared state machine. A rejected
930
+ * `providers/zadarma.ts` as `quirks.declinedCallerGuardMs`, not in the shared state machine. A rejected
907
931
  * call is simply `ended`. Our own SIP infrastructure would not need it at all (SPEC §2.3).
908
932
  *
909
933
  * - **A pre-INVITE state.** A Call exists only once an INVITE has landed. The "user answered
@@ -1029,4 +1053,4 @@ interface Call extends TypedEmitter<CallEventMap> {
1029
1053
  cancelConsult(): Promise<void>;
1030
1054
  }
1031
1055
 
1032
- export { type TokenSource as A, type TypedEmitter as B, CALL_TRANSITIONS as C, canTransition as D, ERROR_CATALOGUE as E, type FatalErrorCode as F, isFatal as G, type HangupReason as H, INITIAL_STATES as I, isTerminal as J, type ContactsSource as K, type LineClaim as L, type HistorySource as M, type NonFatalErrorCode as N, type OutboundNumberRefusal as O, type PresenceEntry as P, type AgentsDirectory as Q, type RemoteParty as R, type SoftphoneConfig as S, type TokenEndpointOptions as T, type TransferOutcomesPage as U, type VoiceToken as V, type PresenceSource as W, type CallHistoryEntry as X, type ContactsPage as Y, type Call as a, type CallDirection as b, CallEvent as c, type CallEventMap as d, type CallOptions as e, type CallState as f, type Contact as g, type FatalSoftphoneError as h, type HoldOriginator as i, type LineLocation as j, type LineState as k, type LogLevel as l, type NonFatalSoftphoneError as m, type OutboundNumber as n, type OutboundNumberKind as o, type OutboundNumberSettings as p, type OutboundNumberState as q, type OutboundNumbersSource as r, type RingtoneOption as s, type RingtoneSettings as t, type RingtoneSource as u, type SoftphoneError as v, type SoftphoneErrorCode as w, SoftphoneEvent as x, type SoftphoneEventMap as y, type SoftphoneState as z };
1056
+ export { type TokenSource as A, type TypedEmitter as B, CALL_TRANSITIONS as C, canTransition as D, ERROR_CATALOGUE as E, type FatalErrorCode as F, isFatal as G, type HangupReason as H, INITIAL_STATES as I, isTerminal as J, type ContactsSource as K, type LineClaim as L, type HistorySource as M, type NonFatalErrorCode as N, type OutboundNumberRefusal as O, type PresenceEntry as P, type AgentsDirectory as Q, type RemoteParty as R, type SoftphoneConfig as S, type TokenEndpointOptions as T, type TransferOutcomesPage as U, type VoiceToken as V, type PresenceSource as W, type CallHistoryEntry as X, type ContactsPage as Y, type CallOffer as Z, type Call as a, type CallDirection as b, CallEvent as c, type CallEventMap as d, type CallOptions as e, type CallState as f, type Contact as g, type FatalSoftphoneError as h, type HoldOriginator as i, type LineLocation as j, type LineState as k, type LogLevel as l, type NonFatalSoftphoneError as m, type OutboundNumber as n, type OutboundNumberKind as o, type OutboundNumberSettings as p, type OutboundNumberState as q, type OutboundNumbersSource as r, type RingtoneOption as s, type RingtoneSettings as t, type RingtoneSource as u, type SoftphoneError as v, type SoftphoneErrorCode as w, SoftphoneEvent as x, type SoftphoneEventMap as y, type SoftphoneState as z };
@@ -223,6 +223,24 @@ interface LineUpdate {
223
223
  /** Who has the line when it is `elsewhere`; `null` when it is here, or the server did not say. */
224
224
  readonly where: LineLocation | null;
225
225
  }
226
+ /**
227
+ * A call offered to this user's line, as the backend announces it over the presence socket
228
+ * (incoming-call-reliability.md §5): `start` each time the call is offered to the extension (a re-offer of the
229
+ * same call repeats it, same `callId`), `end` when the call is over. `callId` is opaque; `from` is the caller,
230
+ * `null` (or, on an `end`, absent) when the backend did not say.
231
+ *
232
+ * The softphone uses it for one thing: after a decline, to know when the declined call's re-offers stop, so a
233
+ * new call from the same number rings (§4.4). A presence source that never sends it loses nothing but that.
234
+ */
235
+ type CallOffer = {
236
+ readonly state: 'start';
237
+ readonly callId: string;
238
+ readonly from: string | null;
239
+ } | {
240
+ readonly state: 'end';
241
+ readonly callId: string;
242
+ readonly from?: string | null;
243
+ };
226
244
  /** The answer to `PresenceConnection.claimLine()`. */
227
245
  interface LineClaimResult {
228
246
  readonly ok: boolean;
@@ -429,6 +447,12 @@ interface PresenceCallbacks {
429
447
  readonly onLine?: (update: LineUpdate) => void;
430
448
  /** The answer to `PresenceConnection.claimLine()`. Optional, like `onLine`. */
431
449
  readonly onClaimResult?: (result: LineClaimResult) => void;
450
+ /**
451
+ * A call offered to this line started or ended (`CallOffer`). Sent only to the line's owner. Optional, like
452
+ * `onLine`: callbacks written before it existed still type-check, and a source that never calls it leaves the
453
+ * softphone on its fallback after a decline (incoming-call-reliability.md §4.4).
454
+ */
455
+ readonly onOffer?: (offer: CallOffer) => void;
432
456
  }
433
457
  /**
434
458
  * Opens one live presence connection. Coventia-backed by default (mints a one-time ticket, opens
@@ -903,7 +927,7 @@ interface TypedEmitter<M> {
903
927
  *
904
928
  * - **`rejecting`.** Today's engine has one, purely to swallow Zadarma's `return_timeout` retries
905
929
  * for 35 s after a decline (SPEC §3.4). That is a PROVIDER quirk — it belongs in
906
- * `providers/zadarma.ts` as `quirks.rejectGuardMs`, not in the shared state machine. A rejected
930
+ * `providers/zadarma.ts` as `quirks.declinedCallerGuardMs`, not in the shared state machine. A rejected
907
931
  * call is simply `ended`. Our own SIP infrastructure would not need it at all (SPEC §2.3).
908
932
  *
909
933
  * - **A pre-INVITE state.** A Call exists only once an INVITE has landed. The "user answered
@@ -1029,4 +1053,4 @@ interface Call extends TypedEmitter<CallEventMap> {
1029
1053
  cancelConsult(): Promise<void>;
1030
1054
  }
1031
1055
 
1032
- export { type TokenSource as A, type TypedEmitter as B, CALL_TRANSITIONS as C, canTransition as D, ERROR_CATALOGUE as E, type FatalErrorCode as F, isFatal as G, type HangupReason as H, INITIAL_STATES as I, isTerminal as J, type ContactsSource as K, type LineClaim as L, type HistorySource as M, type NonFatalErrorCode as N, type OutboundNumberRefusal as O, type PresenceEntry as P, type AgentsDirectory as Q, type RemoteParty as R, type SoftphoneConfig as S, type TokenEndpointOptions as T, type TransferOutcomesPage as U, type VoiceToken as V, type PresenceSource as W, type CallHistoryEntry as X, type ContactsPage as Y, type Call as a, type CallDirection as b, CallEvent as c, type CallEventMap as d, type CallOptions as e, type CallState as f, type Contact as g, type FatalSoftphoneError as h, type HoldOriginator as i, type LineLocation as j, type LineState as k, type LogLevel as l, type NonFatalSoftphoneError as m, type OutboundNumber as n, type OutboundNumberKind as o, type OutboundNumberSettings as p, type OutboundNumberState as q, type OutboundNumbersSource as r, type RingtoneOption as s, type RingtoneSettings as t, type RingtoneSource as u, type SoftphoneError as v, type SoftphoneErrorCode as w, SoftphoneEvent as x, type SoftphoneEventMap as y, type SoftphoneState as z };
1056
+ export { type TokenSource as A, type TypedEmitter as B, CALL_TRANSITIONS as C, canTransition as D, ERROR_CATALOGUE as E, type FatalErrorCode as F, isFatal as G, type HangupReason as H, INITIAL_STATES as I, isTerminal as J, type ContactsSource as K, type LineClaim as L, type HistorySource as M, type NonFatalErrorCode as N, type OutboundNumberRefusal as O, type PresenceEntry as P, type AgentsDirectory as Q, type RemoteParty as R, type SoftphoneConfig as S, type TokenEndpointOptions as T, type TransferOutcomesPage as U, type VoiceToken as V, type PresenceSource as W, type CallHistoryEntry as X, type ContactsPage as Y, type CallOffer as Z, type Call as a, type CallDirection as b, CallEvent as c, type CallEventMap as d, type CallOptions as e, type CallState as f, type Contact as g, type FatalSoftphoneError as h, type HoldOriginator as i, type LineLocation as j, type LineState as k, type LogLevel as l, type NonFatalSoftphoneError as m, type OutboundNumber as n, type OutboundNumberKind as o, type OutboundNumberSettings as p, type OutboundNumberState as q, type OutboundNumbersSource as r, type RingtoneOption as s, type RingtoneSettings as t, type RingtoneSource as u, type SoftphoneError as v, type SoftphoneErrorCode as w, SoftphoneEvent as x, type SoftphoneEventMap as y, type SoftphoneState as z };