@softomnitel/omnicall-kit 0.1.0-rc.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/LICENSE +4 -0
- package/README.md +34 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +16 -0
- package/dist/index.js.map +1 -0
- package/dist/internal/account-activate-commands.d.ts +30 -0
- package/dist/internal/account-activate-commands.d.ts.map +1 -0
- package/dist/internal/account-activate-commands.js +94 -0
- package/dist/internal/account-activate-commands.js.map +1 -0
- package/dist/internal/account-activate-wire.d.ts +16 -0
- package/dist/internal/account-activate-wire.d.ts.map +1 -0
- package/dist/internal/account-activate-wire.js +22 -0
- package/dist/internal/account-activate-wire.js.map +1 -0
- package/dist/internal/account-logout-commands.d.ts +23 -0
- package/dist/internal/account-logout-commands.d.ts.map +1 -0
- package/dist/internal/account-logout-commands.js +51 -0
- package/dist/internal/account-logout-commands.js.map +1 -0
- package/dist/internal/account-logout-wire.d.ts +15 -0
- package/dist/internal/account-logout-wire.d.ts.map +1 -0
- package/dist/internal/account-logout-wire.js +24 -0
- package/dist/internal/account-logout-wire.js.map +1 -0
- package/dist/internal/auth-grants.d.ts +6 -0
- package/dist/internal/auth-grants.d.ts.map +1 -0
- package/dist/internal/auth-grants.js +16 -0
- package/dist/internal/auth-grants.js.map +1 -0
- package/dist/internal/auth-inbound.d.ts +35 -0
- package/dist/internal/auth-inbound.d.ts.map +1 -0
- package/dist/internal/auth-inbound.js +86 -0
- package/dist/internal/auth-inbound.js.map +1 -0
- package/dist/internal/auth-orchestrator.d.ts +36 -0
- package/dist/internal/auth-orchestrator.d.ts.map +1 -0
- package/dist/internal/auth-orchestrator.js +217 -0
- package/dist/internal/auth-orchestrator.js.map +1 -0
- package/dist/internal/auth-pop-flow.d.ts +38 -0
- package/dist/internal/auth-pop-flow.d.ts.map +1 -0
- package/dist/internal/auth-pop-flow.js +80 -0
- package/dist/internal/auth-pop-flow.js.map +1 -0
- package/dist/internal/auth-wire.d.ts +37 -0
- package/dist/internal/auth-wire.d.ts.map +1 -0
- package/dist/internal/auth-wire.js +62 -0
- package/dist/internal/auth-wire.js.map +1 -0
- package/dist/internal/base64url.d.ts +7 -0
- package/dist/internal/base64url.d.ts.map +1 -0
- package/dist/internal/base64url.js +28 -0
- package/dist/internal/base64url.js.map +1 -0
- package/dist/internal/browser-websocket-transport.d.ts +36 -0
- package/dist/internal/browser-websocket-transport.d.ts.map +1 -0
- package/dist/internal/browser-websocket-transport.js +131 -0
- package/dist/internal/browser-websocket-transport.js.map +1 -0
- package/dist/internal/call-commands.d.ts +32 -0
- package/dist/internal/call-commands.d.ts.map +1 -0
- package/dist/internal/call-commands.js +60 -0
- package/dist/internal/call-commands.js.map +1 -0
- package/dist/internal/call-wire.d.ts +24 -0
- package/dist/internal/call-wire.d.ts.map +1 -0
- package/dist/internal/call-wire.js +37 -0
- package/dist/internal/call-wire.js.map +1 -0
- package/dist/internal/client-error-details.d.ts +60 -0
- package/dist/internal/client-error-details.d.ts.map +1 -0
- package/dist/internal/client-error-details.js +98 -0
- package/dist/internal/client-error-details.js.map +1 -0
- package/dist/internal/client-errors.d.ts +38 -0
- package/dist/internal/client-errors.d.ts.map +1 -0
- package/dist/internal/client-errors.js +37 -0
- package/dist/internal/client-errors.js.map +1 -0
- package/dist/internal/command-classification.d.ts +7 -0
- package/dist/internal/command-classification.d.ts.map +1 -0
- package/dist/internal/command-classification.js +14 -0
- package/dist/internal/command-classification.js.map +1 -0
- package/dist/internal/connection-session.d.ts +61 -0
- package/dist/internal/connection-session.d.ts.map +1 -0
- package/dist/internal/connection-session.js +333 -0
- package/dist/internal/connection-session.js.map +1 -0
- package/dist/internal/connection-state.d.ts +13 -0
- package/dist/internal/connection-state.d.ts.map +1 -0
- package/dist/internal/connection-state.js +75 -0
- package/dist/internal/connection-state.js.map +1 -0
- package/dist/internal/diagnostics.d.ts +36 -0
- package/dist/internal/diagnostics.d.ts.map +1 -0
- package/dist/internal/diagnostics.js +51 -0
- package/dist/internal/diagnostics.js.map +1 -0
- package/dist/internal/event-subscription.d.ts +23 -0
- package/dist/internal/event-subscription.d.ts.map +1 -0
- package/dist/internal/event-subscription.js +62 -0
- package/dist/internal/event-subscription.js.map +1 -0
- package/dist/internal/heartbeat-controller.d.ts +27 -0
- package/dist/internal/heartbeat-controller.d.ts.map +1 -0
- package/dist/internal/heartbeat-controller.js +58 -0
- package/dist/internal/heartbeat-controller.js.map +1 -0
- package/dist/internal/operator-commands.d.ts +46 -0
- package/dist/internal/operator-commands.d.ts.map +1 -0
- package/dist/internal/operator-commands.js +93 -0
- package/dist/internal/operator-commands.js.map +1 -0
- package/dist/internal/operator-wire.d.ts +20 -0
- package/dist/internal/operator-wire.d.ts.map +1 -0
- package/dist/internal/operator-wire.js +33 -0
- package/dist/internal/operator-wire.js.map +1 -0
- package/dist/internal/origin-policy-errors.d.ts +22 -0
- package/dist/internal/origin-policy-errors.d.ts.map +1 -0
- package/dist/internal/origin-policy-errors.js +67 -0
- package/dist/internal/origin-policy-errors.js.map +1 -0
- package/dist/internal/pop-crypto.d.ts +23 -0
- package/dist/internal/pop-crypto.d.ts.map +1 -0
- package/dist/internal/pop-crypto.js +48 -0
- package/dist/internal/pop-crypto.js.map +1 -0
- package/dist/internal/pop-key-store.d.ts +28 -0
- package/dist/internal/pop-key-store.d.ts.map +1 -0
- package/dist/internal/pop-key-store.js +153 -0
- package/dist/internal/pop-key-store.js.map +1 -0
- package/dist/internal/product-commands.d.ts +33 -0
- package/dist/internal/product-commands.d.ts.map +1 -0
- package/dist/internal/product-commands.js +70 -0
- package/dist/internal/product-commands.js.map +1 -0
- package/dist/internal/product-inbound.d.ts +15 -0
- package/dist/internal/product-inbound.d.ts.map +1 -0
- package/dist/internal/product-inbound.js +31 -0
- package/dist/internal/product-inbound.js.map +1 -0
- package/dist/internal/product-orchestrator.d.ts +46 -0
- package/dist/internal/product-orchestrator.d.ts.map +1 -0
- package/dist/internal/product-orchestrator.js +188 -0
- package/dist/internal/product-orchestrator.js.map +1 -0
- package/dist/internal/product-wire.d.ts +29 -0
- package/dist/internal/product-wire.d.ts.map +1 -0
- package/dist/internal/product-wire.js +54 -0
- package/dist/internal/product-wire.js.map +1 -0
- package/dist/internal/public-event-map.d.ts +27 -0
- package/dist/internal/public-event-map.d.ts.map +1 -0
- package/dist/internal/public-event-map.js +38 -0
- package/dist/internal/public-event-map.js.map +1 -0
- package/dist/internal/reconnect-policy.d.ts +16 -0
- package/dist/internal/reconnect-policy.d.ts.map +1 -0
- package/dist/internal/reconnect-policy.js +23 -0
- package/dist/internal/reconnect-policy.js.map +1 -0
- package/dist/internal/request-correlator.d.ts +41 -0
- package/dist/internal/request-correlator.d.ts.map +1 -0
- package/dist/internal/request-correlator.js +130 -0
- package/dist/internal/request-correlator.js.map +1 -0
- package/dist/internal/requested-capabilities.d.ts +10 -0
- package/dist/internal/requested-capabilities.d.ts.map +1 -0
- package/dist/internal/requested-capabilities.js +25 -0
- package/dist/internal/requested-capabilities.js.map +1 -0
- package/dist/internal/scheduler.d.ts +41 -0
- package/dist/internal/scheduler.d.ts.map +1 -0
- package/dist/internal/scheduler.js +104 -0
- package/dist/internal/scheduler.js.map +1 -0
- package/dist/internal/session-identity.d.ts +16 -0
- package/dist/internal/session-identity.d.ts.map +1 -0
- package/dist/internal/session-identity.js +13 -0
- package/dist/internal/session-identity.js.map +1 -0
- package/dist/internal/snapshot-acquisition.d.ts +21 -0
- package/dist/internal/snapshot-acquisition.d.ts.map +1 -0
- package/dist/internal/snapshot-acquisition.js +40 -0
- package/dist/internal/snapshot-acquisition.js.map +1 -0
- package/dist/internal/snapshot-cache.d.ts +13 -0
- package/dist/internal/snapshot-cache.d.ts.map +1 -0
- package/dist/internal/snapshot-cache.js +18 -0
- package/dist/internal/snapshot-cache.js.map +1 -0
- package/dist/internal/transport-port.d.ts +34 -0
- package/dist/internal/transport-port.d.ts.map +1 -0
- package/dist/internal/transport-port.js +7 -0
- package/dist/internal/transport-port.js.map +1 -0
- package/dist/internal/window-commands.d.ts +23 -0
- package/dist/internal/window-commands.d.ts.map +1 -0
- package/dist/internal/window-commands.js +76 -0
- package/dist/internal/window-commands.js.map +1 -0
- package/dist/public/auth-client.d.ts +87 -0
- package/dist/public/auth-client.d.ts.map +1 -0
- package/dist/public/auth-client.js +116 -0
- package/dist/public/auth-client.js.map +1 -0
- package/dist/public/omnicall-client-api.d.ts +159 -0
- package/dist/public/omnicall-client-api.d.ts.map +1 -0
- package/dist/public/omnicall-client-api.js +5 -0
- package/dist/public/omnicall-client-api.js.map +1 -0
- package/dist/public/omnicall-client.d.ts +22 -0
- package/dist/public/omnicall-client.d.ts.map +1 -0
- package/dist/public/omnicall-client.js +171 -0
- package/dist/public/omnicall-client.js.map +1 -0
- package/dist/public/protocol-reexports.d.ts +41 -0
- package/dist/public/protocol-reexports.d.ts.map +1 -0
- package/dist/public/protocol-reexports.js +7 -0
- package/dist/public/protocol-reexports.js.map +1 -0
- package/package.json +46 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pending getSnapshot acquisitions: revision-bound resolve + typed reject.
|
|
3
|
+
*/
|
|
4
|
+
import { createClientError } from './client-errors.js';
|
|
5
|
+
export function matchSnapshotRevision(snapshot, revision) {
|
|
6
|
+
return snapshot.revision === revision;
|
|
7
|
+
}
|
|
8
|
+
export function rejectAllAcquisitions(acquisitions, error) {
|
|
9
|
+
for (const acquisition of acquisitions) {
|
|
10
|
+
settleReject(acquisition, error);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
export function settleResolve(acquisition, snapshot) {
|
|
14
|
+
if (acquisition.settled) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
acquisition.settled = true;
|
|
18
|
+
acquisition.timer?.clear();
|
|
19
|
+
acquisition.timer = undefined;
|
|
20
|
+
acquisition.resolve(snapshot);
|
|
21
|
+
}
|
|
22
|
+
export function settleReject(acquisition, error) {
|
|
23
|
+
if (acquisition.settled) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
acquisition.settled = true;
|
|
27
|
+
acquisition.timer?.clear();
|
|
28
|
+
acquisition.timer = undefined;
|
|
29
|
+
acquisition.reject(error);
|
|
30
|
+
}
|
|
31
|
+
export function invalidateErrorForState(state) {
|
|
32
|
+
if (state === 'revoked') {
|
|
33
|
+
return createClientError({ code: 'revoked', retryable: false });
|
|
34
|
+
}
|
|
35
|
+
return createClientError({ code: 'not_ready', retryable: true });
|
|
36
|
+
}
|
|
37
|
+
export function timeoutSnapshotError() {
|
|
38
|
+
return createClientError({ code: 'timeout', retryable: true });
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=snapshot-acquisition.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snapshot-acquisition.js","sourceRoot":"","sources":["../../src/internal/snapshot-acquisition.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,EACL,iBAAiB,EAElB,MAAM,oBAAoB,CAAC;AAY5B,MAAM,UAAU,qBAAqB,CACnC,QAAyB,EACzB,QAAgB;IAEhB,OAAO,QAAQ,CAAC,QAAQ,KAAK,QAAQ,CAAC;AACxC,CAAC;AAED,MAAM,UAAU,qBAAqB,CACnC,YAA4C,EAC5C,KAA0B;IAE1B,KAAK,MAAM,WAAW,IAAI,YAAY,EAAE,CAAC;QACvC,YAAY,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;IACnC,CAAC;AACH,CAAC;AAED,MAAM,UAAU,aAAa,CAC3B,WAAgC,EAChC,QAAyB;IAEzB,IAAI,WAAW,CAAC,OAAO,EAAE,CAAC;QACxB,OAAO;IACT,CAAC;IACD,WAAW,CAAC,OAAO,GAAG,IAAI,CAAC;IAC3B,WAAW,CAAC,KAAK,EAAE,KAAK,EAAE,CAAC;IAC3B,WAAW,CAAC,KAAK,GAAG,SAAS,CAAC;IAC9B,WAAW,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;AAChC,CAAC;AAED,MAAM,UAAU,YAAY,CAC1B,WAAgC,EAChC,KAA0B;IAE1B,IAAI,WAAW,CAAC,OAAO,EAAE,CAAC;QACxB,OAAO;IACT,CAAC;IACD,WAAW,CAAC,OAAO,GAAG,IAAI,CAAC;IAC3B,WAAW,CAAC,KAAK,EAAE,KAAK,EAAE,CAAC;IAC3B,WAAW,CAAC,KAAK,GAAG,SAAS,CAAC;IAC9B,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC5B,CAAC;AAED,MAAM,UAAU,uBAAuB,CACrC,KAAa;IAEb,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,OAAO,iBAAiB,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC;IAClE,CAAC;IACD,OAAO,iBAAiB,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;AACnE,CAAC;AAED,MAAM,UAAU,oBAAoB;IAClC,OAAO,iBAAiB,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;AACjE,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* In-memory snapshot cache. Cleared on reconnect/revoke/disconnect.
|
|
3
|
+
* Never persists secrets or authorization material.
|
|
4
|
+
*/
|
|
5
|
+
import type { SnapshotMessage } from '@softomnitel/omnicall-protocol';
|
|
6
|
+
export type SnapshotCache = {
|
|
7
|
+
readonly get: () => SnapshotMessage | undefined;
|
|
8
|
+
readonly set: (snapshot: SnapshotMessage) => void;
|
|
9
|
+
readonly clear: () => void;
|
|
10
|
+
readonly getRevision: () => number | undefined;
|
|
11
|
+
};
|
|
12
|
+
export declare function createSnapshotCache(): SnapshotCache;
|
|
13
|
+
//# sourceMappingURL=snapshot-cache.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snapshot-cache.d.ts","sourceRoot":"","sources":["../../src/internal/snapshot-cache.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAEtE,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,CAAC,GAAG,EAAE,MAAM,eAAe,GAAG,SAAS,CAAC;IAChD,QAAQ,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,eAAe,KAAK,IAAI,CAAC;IAClD,QAAQ,CAAC,KAAK,EAAE,MAAM,IAAI,CAAC;IAC3B,QAAQ,CAAC,WAAW,EAAE,MAAM,MAAM,GAAG,SAAS,CAAC;CAChD,CAAC;AAEF,wBAAgB,mBAAmB,IAAI,aAAa,CAYnD"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* In-memory snapshot cache. Cleared on reconnect/revoke/disconnect.
|
|
3
|
+
* Never persists secrets or authorization material.
|
|
4
|
+
*/
|
|
5
|
+
export function createSnapshotCache() {
|
|
6
|
+
let current;
|
|
7
|
+
return {
|
|
8
|
+
get: () => current,
|
|
9
|
+
set: (snapshot) => {
|
|
10
|
+
current = snapshot;
|
|
11
|
+
},
|
|
12
|
+
clear: () => {
|
|
13
|
+
current = undefined;
|
|
14
|
+
},
|
|
15
|
+
getRevision: () => current?.revision
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=snapshot-cache.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snapshot-cache.js","sourceRoot":"","sources":["../../src/internal/snapshot-cache.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAWH,MAAM,UAAU,mBAAmB;IACjC,IAAI,OAAoC,CAAC;IACzC,OAAO;QACL,GAAG,EAAE,GAAG,EAAE,CAAC,OAAO;QAClB,GAAG,EAAE,CAAC,QAAQ,EAAE,EAAE;YAChB,OAAO,GAAG,QAAQ,CAAC;QACrB,CAAC;QACD,KAAK,EAAE,GAAG,EAAE;YACV,OAAO,GAAG,SAAS,CAAC;QACtB,CAAC;QACD,WAAW,EAAE,GAAG,EAAE,CAAC,OAAO,EAAE,QAAQ;KACrC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Injectable browser-compatible transport port.
|
|
3
|
+
* Production default: {@link createBrowserWebSocketTransport}.
|
|
4
|
+
* Tests: FakeTransport via an explicit `transportFactory`.
|
|
5
|
+
*/
|
|
6
|
+
/** @public */
|
|
7
|
+
export type TransportCloseInfo = {
|
|
8
|
+
readonly code: number;
|
|
9
|
+
readonly reason: string;
|
|
10
|
+
};
|
|
11
|
+
/** @public */
|
|
12
|
+
export type TransportErrorInfo = {
|
|
13
|
+
readonly name: string;
|
|
14
|
+
readonly message: string;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Injectable byte-channel port. Must not own protocol, auth, or reconnect policy.
|
|
18
|
+
* @public
|
|
19
|
+
*/
|
|
20
|
+
export type TransportPort = {
|
|
21
|
+
readonly connect: (url: string) => void;
|
|
22
|
+
readonly send: (data: string) => void;
|
|
23
|
+
readonly close: (code?: number, reason?: string) => void;
|
|
24
|
+
readonly onOpen: (handler: () => void) => () => void;
|
|
25
|
+
readonly onMessage: (handler: (data: string) => void) => () => void;
|
|
26
|
+
readonly onClose: (handler: (info: TransportCloseInfo) => void) => () => void;
|
|
27
|
+
readonly onError: (handler: (info: TransportErrorInfo) => void) => () => void;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Creates a fresh {@link TransportPort} per connect/reconnect attempt.
|
|
31
|
+
* @public
|
|
32
|
+
*/
|
|
33
|
+
export type TransportFactory = () => TransportPort;
|
|
34
|
+
//# sourceMappingURL=transport-port.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transport-port.d.ts","sourceRoot":"","sources":["../../src/internal/transport-port.ts"],"names":[],"mapp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|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Capability-gated window command runner (SDK-05 + window.hide).
|
|
3
|
+
*/
|
|
4
|
+
import type { CapabilityId } from '@softomnitel/omnicall-protocol';
|
|
5
|
+
import type { ConnectionSession } from './connection-session.js';
|
|
6
|
+
import type { Scheduler } from './scheduler.js';
|
|
7
|
+
export type WindowStateResult = {
|
|
8
|
+
readonly visible: boolean;
|
|
9
|
+
readonly revision: number;
|
|
10
|
+
};
|
|
11
|
+
export type WindowCommandApi = {
|
|
12
|
+
readonly showWindow: () => Promise<WindowStateResult>;
|
|
13
|
+
readonly hideWindow: (input: {
|
|
14
|
+
readonly expectedRevision: number;
|
|
15
|
+
}) => Promise<WindowStateResult>;
|
|
16
|
+
readonly getWindowState: () => Promise<WindowStateResult>;
|
|
17
|
+
};
|
|
18
|
+
export declare function createWindowCommandApi(deps: {
|
|
19
|
+
readonly connection: ConnectionSession;
|
|
20
|
+
readonly scheduler: Scheduler;
|
|
21
|
+
readonly getGrantedCapabilities: () => readonly CapabilityId[];
|
|
22
|
+
}): WindowCommandApi;
|
|
23
|
+
//# sourceMappingURL=window-commands.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"window-commands.d.ts","sourceRoot":"","sources":["../../src/internal/window-commands.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAEnE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAajE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,CAAC,UAAU,EAAE,MAAM,OAAO,CAAC,iBAAiB,CAAC,CAAC;IACtD,QAAQ,CAAC,UAAU,EAAE,CAAC,KAAK,EAAE;QAC3B,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;KACnC,KAAK,OAAO,CAAC,iBAAiB,CAAC,CAAC;IACjC,QAAQ,CAAC,cAAc,EAAE,MAAM,OAAO,CAAC,iBAAiB,CAAC,CAAC;CAC3D,CAAC;AAEF,wBAAgB,sBAAsB,CAAC,IAAI,EAAE;IAC3C,QAAQ,CAAC,UAAU,EAAE,iBAAiB,CAAC;IACvC,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAC9B,QAAQ,CAAC,sBAAsB,EAAE,MAAM,SAAS,YAAY,EAAE,CAAC;CAChE,GAAG,gBAAgB,CAkFnB"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Capability-gated window command runner (SDK-05 + window.hide).
|
|
3
|
+
*/
|
|
4
|
+
import { guardCapability, guardReady, mapReplyFailure, readWindowState, requireWireIdentity } from './product-commands.js';
|
|
5
|
+
import { buildWindowGetStateBody, buildWindowHideBody, buildWindowShowBody } from './product-wire.js';
|
|
6
|
+
export function createWindowCommandApi(deps) {
|
|
7
|
+
const runShowOrGetState = async (commandType) => {
|
|
8
|
+
const notReady = guardReady(deps.connection);
|
|
9
|
+
if (notReady !== undefined) {
|
|
10
|
+
return Promise.reject(notReady);
|
|
11
|
+
}
|
|
12
|
+
const missingCap = guardCapability(deps.getGrantedCapabilities(), 'window.show');
|
|
13
|
+
if (missingCap !== undefined) {
|
|
14
|
+
return Promise.reject(missingCap);
|
|
15
|
+
}
|
|
16
|
+
const identity = requireWireIdentity(deps.connection);
|
|
17
|
+
if ('code' in identity) {
|
|
18
|
+
return Promise.reject(identity);
|
|
19
|
+
}
|
|
20
|
+
const requestId = crypto.randomUUID();
|
|
21
|
+
const fields = {
|
|
22
|
+
requestId,
|
|
23
|
+
serverInstanceId: identity.serverInstanceId,
|
|
24
|
+
sessionEpoch: identity.sessionEpoch,
|
|
25
|
+
occurredAtMs: deps.scheduler.now()
|
|
26
|
+
};
|
|
27
|
+
const body = commandType === 'window:show'
|
|
28
|
+
? buildWindowShowBody(fields)
|
|
29
|
+
: buildWindowGetStateBody(fields);
|
|
30
|
+
const result = await deps.connection.request({
|
|
31
|
+
requestId,
|
|
32
|
+
commandType,
|
|
33
|
+
body
|
|
34
|
+
});
|
|
35
|
+
if (!result.ok || !result.reply.ok) {
|
|
36
|
+
return Promise.reject(mapReplyFailure(result));
|
|
37
|
+
}
|
|
38
|
+
return readWindowState(result.reply);
|
|
39
|
+
};
|
|
40
|
+
const hideWindow = async (input) => {
|
|
41
|
+
const notReady = guardReady(deps.connection);
|
|
42
|
+
if (notReady !== undefined) {
|
|
43
|
+
return Promise.reject(notReady);
|
|
44
|
+
}
|
|
45
|
+
const missingCap = guardCapability(deps.getGrantedCapabilities(), 'window.hide');
|
|
46
|
+
if (missingCap !== undefined) {
|
|
47
|
+
return Promise.reject(missingCap);
|
|
48
|
+
}
|
|
49
|
+
const identity = requireWireIdentity(deps.connection);
|
|
50
|
+
if ('code' in identity) {
|
|
51
|
+
return Promise.reject(identity);
|
|
52
|
+
}
|
|
53
|
+
const requestId = crypto.randomUUID();
|
|
54
|
+
const result = await deps.connection.request({
|
|
55
|
+
requestId,
|
|
56
|
+
commandType: 'window:hide',
|
|
57
|
+
body: buildWindowHideBody({
|
|
58
|
+
requestId,
|
|
59
|
+
serverInstanceId: identity.serverInstanceId,
|
|
60
|
+
sessionEpoch: identity.sessionEpoch,
|
|
61
|
+
occurredAtMs: deps.scheduler.now(),
|
|
62
|
+
expectedRevision: input.expectedRevision
|
|
63
|
+
})
|
|
64
|
+
});
|
|
65
|
+
if (!result.ok || !result.reply.ok) {
|
|
66
|
+
return Promise.reject(mapReplyFailure(result));
|
|
67
|
+
}
|
|
68
|
+
return readWindowState(result.reply);
|
|
69
|
+
};
|
|
70
|
+
return {
|
|
71
|
+
showWindow: () => runShowOrGetState('window:show'),
|
|
72
|
+
hideWindow,
|
|
73
|
+
getWindowState: () => runShowOrGetState('window:get-state')
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=window-commands.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"window-commands.js","sourceRoot":"","sources":["../../src/internal/window-commands.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,EACL,eAAe,EACf,UAAU,EACV,eAAe,EACf,eAAe,EACf,mBAAmB,EACpB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,uBAAuB,EACvB,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,mBAAmB,CAAC;AAgB3B,MAAM,UAAU,sBAAsB,CAAC,IAItC;IACC,MAAM,iBAAiB,GAAG,KAAK,EAC7B,WAA+C,EACnB,EAAE;QAC9B,MAAM,QAAQ,GAAG,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC7C,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;YAC3B,OAAO,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QAClC,CAAC;QACD,MAAM,UAAU,GAAG,eAAe,CAChC,IAAI,CAAC,sBAAsB,EAAE,EAC7B,aAAa,CACd,CAAC;QACF,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;YAC7B,OAAO,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;QACpC,CAAC;QACD,MAAM,QAAQ,GAAG,mBAAmB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACtD,IAAI,MAAM,IAAI,QAAQ,EAAE,CAAC;YACvB,OAAO,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QAClC,CAAC;QACD,MAAM,SAAS,GAAG,MAAM,CAAC,UAAU,EAAE,CAAC;QACtC,MAAM,MAAM,GAAG;YACb,SAAS;YACT,gBAAgB,EAAE,QAAQ,CAAC,gBAAgB;YAC3C,YAAY,EAAE,Q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AU,EAAE,CAAC;QACtC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;YAC3C,SAAS;YACT,WAAW,EAAE,aAAa;YAC1B,IAAI,EAAE,mBAAmB,CAAC;gBACxB,SAAS;gBACT,gBAAgB,EAAE,QAAQ,CAAC,gBAAgB;gBAC3C,YAAY,EAAE,QAAQ,CAAC,YAAY;gBACnC,YAAY,EAAE,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE;gBAClC,gBAAgB,EAAE,KAAK,CAAC,gBAAgB;aACzC,CAAC;SACH,CAAC,CAAC;QACH,IAAI,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC;YACnC,OAAO,OAAO,CAAC,MAAM,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC;QACjD,CAAC;QACD,OAAO,eAAe,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACvC,CAAC,CAAC;IAEF,OAAO;QACL,UAAU,EAAE,GAAG,EAAE,CAAC,iBAAiB,CAAC,aAAa,CAAC;QAClD,UAAU;QACV,cAAc,EAAE,GAAG,EAAE,CAAC,iBAAiB,CAAC,kBAAkB,CAAC;KAC5D,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal authenticated connection client (SDK-04).
|
|
3
|
+
* No product snapshot/call/operator/account methods.
|
|
4
|
+
*/
|
|
5
|
+
import type { ApplicationIdentity, CapabilityId, PairingProfile } from '@softomnitel/omnicall-protocol';
|
|
6
|
+
import type { ConnectionState } from '../internal/connection-state.js';
|
|
7
|
+
import type { OmniCallClientError } from '../internal/client-errors.js';
|
|
8
|
+
import type { DiagnosticsSink } from '../internal/diagnostics.js';
|
|
9
|
+
import type { PopKeyStore } from '../internal/pop-key-store.js';
|
|
10
|
+
import type { ReconnectPolicy } from '../internal/reconnect-policy.js';
|
|
11
|
+
import type { HeartbeatPolicy } from '../internal/heartbeat-controller.js';
|
|
12
|
+
import type { JitterSource, Scheduler } from '../internal/scheduler.js';
|
|
13
|
+
import type { TransportFactory } from '../internal/transport-port.js';
|
|
14
|
+
/**
|
|
15
|
+
* Pairing-required notification for consumers.
|
|
16
|
+
* @public
|
|
17
|
+
*/
|
|
18
|
+
export type PairingRequiredInfo = {
|
|
19
|
+
readonly origin: string;
|
|
20
|
+
readonly requestedProfile: PairingProfile;
|
|
21
|
+
readonly clientId: string | undefined;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Read-only authenticated session projection.
|
|
25
|
+
* @public
|
|
26
|
+
*/
|
|
27
|
+
export type AuthSessionSnapshot = {
|
|
28
|
+
readonly serverInstanceId: string;
|
|
29
|
+
readonly sessionEpoch: string;
|
|
30
|
+
readonly clientId: string;
|
|
31
|
+
readonly profile: PairingProfile | undefined;
|
|
32
|
+
readonly grantedCapabilities: readonly CapabilityId[];
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Options for {@link createAuthClient}. Constructor has no network side effects.
|
|
36
|
+
* @public
|
|
37
|
+
*/
|
|
38
|
+
export type AuthClientOptions = {
|
|
39
|
+
readonly url: string;
|
|
40
|
+
readonly origin: string;
|
|
41
|
+
readonly application: ApplicationIdentity;
|
|
42
|
+
readonly sdkVersion: string;
|
|
43
|
+
readonly requestedProfile: PairingProfile;
|
|
44
|
+
readonly requestedCapabilities?: readonly CapabilityId[];
|
|
45
|
+
readonly keyStore: PopKeyStore;
|
|
46
|
+
/**
|
|
47
|
+
* Fresh {@link TransportPort} per connect/reconnect.
|
|
48
|
+
* Defaults to {@link createBrowserWebSocketTransport} when omitted.
|
|
49
|
+
*/
|
|
50
|
+
readonly transportFactory?: TransportFactory;
|
|
51
|
+
/**
|
|
52
|
+
* Clock/timers. Defaults to {@link createBrowserScheduler} when omitted.
|
|
53
|
+
* Inject {@link createFakeScheduler} in unit tests.
|
|
54
|
+
*/
|
|
55
|
+
readonly scheduler?: Scheduler;
|
|
56
|
+
/**
|
|
57
|
+
* Reconnect jitter. Defaults to {@link createBrowserJitterSource} when omitted.
|
|
58
|
+
* Inject {@link createFixedJitterSource} in unit tests.
|
|
59
|
+
*/
|
|
60
|
+
readonly jitter?: JitterSource;
|
|
61
|
+
readonly diagnostics?: DiagnosticsSink;
|
|
62
|
+
readonly defaultRequestTimeoutMs?: number;
|
|
63
|
+
readonly reconnect?: ReconnectPolicy;
|
|
64
|
+
readonly heartbeat?: HeartbeatPolicy;
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* Auth lifecycle client — pairing, PoP, capability projection.
|
|
68
|
+
* @public
|
|
69
|
+
*/
|
|
70
|
+
export type AuthClient = {
|
|
71
|
+
readonly getState: () => ConnectionState;
|
|
72
|
+
readonly getGrantedCapabilities: () => readonly CapabilityId[];
|
|
73
|
+
readonly getSession: () => AuthSessionSnapshot | undefined;
|
|
74
|
+
readonly preauthDropCount: () => number;
|
|
75
|
+
readonly connect: () => Promise<void>;
|
|
76
|
+
readonly disconnect: () => void;
|
|
77
|
+
readonly onStateChange: (listener: (state: ConnectionState) => void) => () => void;
|
|
78
|
+
readonly onPairingRequired: (listener: (info: PairingRequiredInfo) => void) => () => void;
|
|
79
|
+
readonly waitUntil: (predicate: (state: ConnectionState) => boolean, timeoutMs?: number) => Promise<ConnectionState>;
|
|
80
|
+
readonly getConnectError: () => OmniCallClientError | undefined;
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* Create an auth client. Does not connect, pair, or authenticate.
|
|
84
|
+
* @public
|
|
85
|
+
*/
|
|
86
|
+
export declare function createAuthClient(options: AuthClientOptions): AuthClient;
|
|
87
|
+
//# sourceMappingURL=auth-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth-client.d.ts","sourceRoot":"","sources":["../../src/public/auth-client.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACV,mBAAmB,EACnB,Y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,EAAE,CAClB,SAAS,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,OAAO,EAC9C,SAAS,CAAC,EAAE,MAAM,KACf,OAAO,CAAC,eAAe,CAAC,CAAC;IAC9B,QAAQ,CAAC,eAAe,EAAE,MAAM,mBAAmB,GAAG,SAAS,CAAC;CACjE,CAAC;AAEF;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,iBAAiB,GAAG,UAAU,CA+GvE"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal authenticated connection client (SDK-04).
|
|
3
|
+
* No product snapshot/call/operator/account methods.
|
|
4
|
+
*/
|
|
5
|
+
import { createAuthOrchestrator } from '../internal/auth-orchestrator.js';
|
|
6
|
+
import { createConnectionSession } from '../internal/connection-session.js';
|
|
7
|
+
import { createBrowserWebSocketTransport } from '../internal/browser-websocket-transport.js';
|
|
8
|
+
import { createBrowserJitterSource, createBrowserScheduler } from '../internal/scheduler.js';
|
|
9
|
+
/**
|
|
10
|
+
* Create an auth client. Does not connect, pair, or authenticate.
|
|
11
|
+
* @public
|
|
12
|
+
*/
|
|
13
|
+
export function createAuthClient(options) {
|
|
14
|
+
const pairingListeners = new Set();
|
|
15
|
+
const orchestratorHolder = { current: undefined };
|
|
16
|
+
const transportFactory = options.transportFactory ?? createBrowserWebSocketTransport;
|
|
17
|
+
const scheduler = options.scheduler ?? createBrowserScheduler();
|
|
18
|
+
const jitter = options.jitter ?? createBrowserJitterSource();
|
|
19
|
+
const connection = createConnectionSession({
|
|
20
|
+
url: options.url,
|
|
21
|
+
transportFactory,
|
|
22
|
+
scheduler,
|
|
23
|
+
jitter,
|
|
24
|
+
...(options.diagnostics !== undefined
|
|
25
|
+
? { diagnostics: options.diagnostics }
|
|
26
|
+
: {}),
|
|
27
|
+
...(options.defaultRequestTimeoutMs !== undefined
|
|
28
|
+
? { defaultRequestTimeoutMs: options.defaultRequestTimeoutMs }
|
|
29
|
+
: {}),
|
|
30
|
+
...(options.reconnect !== undefined ? { reconnect: options.reconnect } : {}),
|
|
31
|
+
...(options.heartbeat !== undefined ? { heartbeat: options.heartbeat } : {}),
|
|
32
|
+
onHandshaking: () => {
|
|
33
|
+
orchestratorHolder.current?.onHandshaking();
|
|
34
|
+
},
|
|
35
|
+
onUnhandledMessage: (data) => {
|
|
36
|
+
orchestratorHolder.current?.onUnhandledMessage(data);
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
const orchestrator = createAuthOrchestrator({
|
|
40
|
+
connection,
|
|
41
|
+
origin: options.origin,
|
|
42
|
+
application: options.application,
|
|
43
|
+
sdkVersion: options.sdkVersion,
|
|
44
|
+
requestedProfile: options.requestedProfile,
|
|
45
|
+
requestedCapabilities: options.requestedCapabilities ?? [],
|
|
46
|
+
keyStore: options.keyStore,
|
|
47
|
+
scheduler,
|
|
48
|
+
...(options.diagnostics !== undefined
|
|
49
|
+
? { diagnostics: options.diagnostics }
|
|
50
|
+
: {}),
|
|
51
|
+
onPairingRequired: (info) => {
|
|
52
|
+
for (const listener of pairingListeners) {
|
|
53
|
+
listener(info);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
orchestratorHolder.current = orchestrator;
|
|
58
|
+
connection.onStateChange((state) => {
|
|
59
|
+
if (state === 'reconnecting') {
|
|
60
|
+
// Never assume prior grants across reconnect (ARCHITECTURE / SECURITY).
|
|
61
|
+
orchestrator.clearSession();
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
return {
|
|
65
|
+
getState: () => connection.getState(),
|
|
66
|
+
getGrantedCapabilities: () => orchestrator.getGrantedCapabilities(),
|
|
67
|
+
getSession: () => {
|
|
68
|
+
const session = orchestrator.getSession();
|
|
69
|
+
if (session === undefined) {
|
|
70
|
+
return undefined;
|
|
71
|
+
}
|
|
72
|
+
return Object.freeze({
|
|
73
|
+
serverInstanceId: session.serverInstanceId,
|
|
74
|
+
sessionEpoch: session.sessionEpoch,
|
|
75
|
+
clientId: session.clientId,
|
|
76
|
+
profile: session.profile,
|
|
77
|
+
grantedCapabilities: session.grantedCapabilities
|
|
78
|
+
});
|
|
79
|
+
},
|
|
80
|
+
preauthDropCount: () => orchestrator.preauthDropCount(),
|
|
81
|
+
connect: async () => {
|
|
82
|
+
await orchestrator.prepareConnect();
|
|
83
|
+
connection.connect();
|
|
84
|
+
},
|
|
85
|
+
disconnect: () => {
|
|
86
|
+
connection.disconnect();
|
|
87
|
+
orchestrator.clearSession();
|
|
88
|
+
},
|
|
89
|
+
onStateChange: (listener) => connection.onStateChange(listener),
|
|
90
|
+
onPairingRequired: (listener) => {
|
|
91
|
+
pairingListeners.add(listener);
|
|
92
|
+
return () => {
|
|
93
|
+
pairingListeners.delete(listener);
|
|
94
|
+
};
|
|
95
|
+
},
|
|
96
|
+
waitUntil: (predicate, timeoutMs = 5_000) => new Promise((resolve, reject) => {
|
|
97
|
+
if (predicate(connection.getState())) {
|
|
98
|
+
resolve(connection.getState());
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
const timer = scheduler.setTimeout(() => {
|
|
102
|
+
unsubscribe();
|
|
103
|
+
reject(new Error('waitUntil timeout'));
|
|
104
|
+
}, timeoutMs);
|
|
105
|
+
const unsubscribe = connection.onStateChange((next) => {
|
|
106
|
+
if (predicate(next)) {
|
|
107
|
+
timer.clear();
|
|
108
|
+
unsubscribe();
|
|
109
|
+
resolve(next);
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
}),
|
|
113
|
+
getConnectError: () => connection.getConnectError()
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
//# sourceMappingURL=auth-client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth-client.js","sourceRoot":"","sources":["../../src/public/auth-client.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAC1E,OAAO,EAAE,uBAAuB,EAAE,MA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,OAAO;YACT,CAAC;YACD,MAAM,KAAK,GAAG,SAAS,CAAC,UAAU,CAAC,GAAG,EAAE;gBACtC,WAAW,EAAE,CAAC;gBACd,MAAM,CAAC,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC,CAAC;YACzC,CAAC,EAAE,SAAS,CAAC,CAAC;YACd,MAAM,WAAW,GAAG,UAAU,CAAC,aAAa,CAAC,CAAC,IAAI,EAAE,EAAE;gBACpD,IAAI,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC;oBACpB,KAAK,CAAC,KAAK,EAAE,CAAC;oBACd,WAAW,EAAE,CAAC;oBACd,OAAO,CAAC,IAAI,CAAC,CAAC;gBAChB,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC,CAAC;QACJ,eAAe,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,eAAe,EAAE;KACpD,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public API type surface for OmniCallClient namespaces (SDK-05…SDK-08).
|
|
3
|
+
*/
|
|
4
|
+
import type { CapabilityId, SnapshotMessage } from '@softomnitel/omnicall-protocol';
|
|
5
|
+
import type { ActivateProfileMode, ActivateProfileResult } from '../internal/account-activate-commands.js';
|
|
6
|
+
import type { OmniCallClientError } from '../internal/client-errors.js';
|
|
7
|
+
import type { LogoutResult } from '../internal/account-logout-commands.js';
|
|
8
|
+
import type { ConnectionState } from '../internal/connection-state.js';
|
|
9
|
+
import type { OperatorFinishAppealResult, OperatorReasonsResult, OperatorStatusChangeResult } from '../internal/operator-commands.js';
|
|
10
|
+
import type { OmniCallEvent, PublicEventType } from '../internal/public-event-map.js';
|
|
11
|
+
import type { AuthClientOptions, AuthSessionSnapshot, PairingRequiredInfo } from './auth-client.js';
|
|
12
|
+
/** @public */
|
|
13
|
+
export type OmniCallClientOptions = AuthClientOptions;
|
|
14
|
+
/** @public */
|
|
15
|
+
export type CallMutationResult = {
|
|
16
|
+
readonly callId: string;
|
|
17
|
+
readonly revision: number;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Window visibility commands.
|
|
21
|
+
* `hide` is privileged (`window.hide`) — Origin matrix grant only; never request
|
|
22
|
+
* at pairing. Telephony-busy → `conflict` (ADR-0013).
|
|
23
|
+
* @public
|
|
24
|
+
*/
|
|
25
|
+
export type OmniCallWindowApi = {
|
|
26
|
+
/** Raise / show desktop window (`window.show`). */
|
|
27
|
+
readonly show: () => Promise<{
|
|
28
|
+
readonly visible: boolean;
|
|
29
|
+
readonly revision: number;
|
|
30
|
+
}>;
|
|
31
|
+
/**
|
|
32
|
+
* Hide to tray / background when granted (`window.hide`).
|
|
33
|
+
* Requires explicit Origin-matrix grant; stripped from pairing requests.
|
|
34
|
+
*/
|
|
35
|
+
readonly hide: (input: {
|
|
36
|
+
readonly expectedRevision: number;
|
|
37
|
+
}) => Promise<{
|
|
38
|
+
readonly visible: boolean;
|
|
39
|
+
readonly revision: number;
|
|
40
|
+
}>;
|
|
41
|
+
/** Current visibility projection. */
|
|
42
|
+
readonly getState: () => Promise<{
|
|
43
|
+
readonly visible: boolean;
|
|
44
|
+
readonly revision: number;
|
|
45
|
+
}>;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Call mutation namespace. Every method requires explicit `expectedRevision`.
|
|
49
|
+
* @public
|
|
50
|
+
*/
|
|
51
|
+
export type OmniCallCallsApi = {
|
|
52
|
+
readonly originate: (input: {
|
|
53
|
+
readonly destination: string;
|
|
54
|
+
readonly expectedRevision: number;
|
|
55
|
+
}) => Promise<CallMutationResult>;
|
|
56
|
+
readonly answer: (input: {
|
|
57
|
+
readonly callId: string;
|
|
58
|
+
readonly expectedRevision: number;
|
|
59
|
+
}) => Promise<CallMutationResult>;
|
|
60
|
+
readonly reject: (input: {
|
|
61
|
+
readonly callId: string;
|
|
62
|
+
readonly expectedRevision: number;
|
|
63
|
+
}) => Promise<CallMutationResult>;
|
|
64
|
+
readonly hangup: (input: {
|
|
65
|
+
readonly callId: string;
|
|
66
|
+
readonly expectedRevision: number;
|
|
67
|
+
}) => Promise<CallMutationResult>;
|
|
68
|
+
readonly hold: (input: {
|
|
69
|
+
readonly callId: string;
|
|
70
|
+
readonly expectedRevision: number;
|
|
71
|
+
}) => Promise<CallMutationResult>;
|
|
72
|
+
readonly resume: (input: {
|
|
73
|
+
readonly callId: string;
|
|
74
|
+
readonly expectedRevision: number;
|
|
75
|
+
}) => Promise<CallMutationResult>;
|
|
76
|
+
readonly mute: (input: {
|
|
77
|
+
readonly callId: string;
|
|
78
|
+
readonly expectedRevision: number;
|
|
79
|
+
}) => Promise<CallMutationResult>;
|
|
80
|
+
readonly unmute: (input: {
|
|
81
|
+
readonly callId: string;
|
|
82
|
+
readonly expectedRevision: number;
|
|
83
|
+
}) => Promise<CallMutationResult>;
|
|
84
|
+
readonly sendDtmf: (input: {
|
|
85
|
+
readonly callId: string;
|
|
86
|
+
readonly digits: string;
|
|
87
|
+
readonly expectedRevision: number;
|
|
88
|
+
}) => Promise<CallMutationResult>;
|
|
89
|
+
};
|
|
90
|
+
/**
|
|
91
|
+
* Operator status namespace (`operator.status.write`).
|
|
92
|
+
* Campaign notify events use `operator.campaign.read` (subscribe / snapshot).
|
|
93
|
+
* ACD MainCallIDInfo events use `ocp.acd_context.read` (`call:acd-context`).
|
|
94
|
+
* Finish appeal is only valid during post-call processing (desktop-enforced).
|
|
95
|
+
* @public
|
|
96
|
+
*/
|
|
97
|
+
export type OmniCallOperatorApi = {
|
|
98
|
+
readonly getReasons: () => Promise<OperatorReasonsResult>;
|
|
99
|
+
readonly changeStatus: (input: {
|
|
100
|
+
readonly target: 'ready' | 'break';
|
|
101
|
+
readonly reasonId?: number;
|
|
102
|
+
readonly expectedRevision: number;
|
|
103
|
+
}) => Promise<OperatorStatusChangeResult>;
|
|
104
|
+
readonly finishAppeal: (input: {
|
|
105
|
+
readonly expectedRevision: number;
|
|
106
|
+
}) => Promise<OperatorFinishAppealResult>;
|
|
107
|
+
};
|
|
108
|
+
/**
|
|
109
|
+
* Account namespace: single-shot logout (`session.logout`) + privileged activate
|
|
110
|
+
* (`account.activate`, server-granted only). Cancel logout = do not call logout.
|
|
111
|
+
* No raw credentials / list-profiles.
|
|
112
|
+
* @public
|
|
113
|
+
*/
|
|
114
|
+
export type OmniCallAccountApi = {
|
|
115
|
+
readonly logout: (input: {
|
|
116
|
+
readonly reasonId?: number;
|
|
117
|
+
readonly expectedRevision: number;
|
|
118
|
+
}) => Promise<LogoutResult>;
|
|
119
|
+
readonly activateProfile: (input: {
|
|
120
|
+
readonly login: string;
|
|
121
|
+
readonly expectedRevision: number;
|
|
122
|
+
readonly mode?: ActivateProfileMode;
|
|
123
|
+
}) => Promise<ActivateProfileResult>;
|
|
124
|
+
};
|
|
125
|
+
/**
|
|
126
|
+
* OmniCall browser client. Namespaced product APIs only.
|
|
127
|
+
* @public
|
|
128
|
+
*/
|
|
129
|
+
export type OmniCallClient = {
|
|
130
|
+
readonly getState: () => ConnectionState;
|
|
131
|
+
readonly getGrantedCapabilities: () => readonly CapabilityId[];
|
|
132
|
+
readonly getSession: () => AuthSessionSnapshot | undefined;
|
|
133
|
+
readonly preauthDropCount: () => number;
|
|
134
|
+
readonly connect: () => Promise<void>;
|
|
135
|
+
readonly disconnect: () => void;
|
|
136
|
+
readonly onStateChange: (listener: (state: ConnectionState) => void) => () => void;
|
|
137
|
+
readonly onPairingRequired: (listener: (info: PairingRequiredInfo) => void) => () => void;
|
|
138
|
+
readonly waitUntil: (predicate: (state: ConnectionState) => boolean, timeoutMs?: number) => Promise<ConnectionState>;
|
|
139
|
+
readonly getConnectError: () => OmniCallClientError | undefined;
|
|
140
|
+
/** Fresh authenticated snapshot (also after reconnect). */
|
|
141
|
+
readonly getSnapshot: () => Promise<SnapshotMessage>;
|
|
142
|
+
/** Last cached snapshot; `undefined` before first successful fetch. */
|
|
143
|
+
readonly getCachedSnapshot: () => SnapshotMessage | undefined;
|
|
144
|
+
/** Aggregate revision from cache, if any. */
|
|
145
|
+
readonly getRevision: () => number | undefined;
|
|
146
|
+
/**
|
|
147
|
+
* Subscribe to a public product event. Listener payload is narrowed by `type`.
|
|
148
|
+
* Lifecycle `sdk:permission-changed` / `sdk:revoked` are not delivered here —
|
|
149
|
+
* use `getGrantedCapabilities` / connection state (`revoked`).
|
|
150
|
+
*/
|
|
151
|
+
readonly subscribe: <T extends PublicEventType>(type: T, listener: (event: Extract<OmniCallEvent, {
|
|
152
|
+
type: T;
|
|
153
|
+
}>) => void) => () => void;
|
|
154
|
+
readonly window: OmniCallWindowApi;
|
|
155
|
+
readonly calls: OmniCallCallsApi;
|
|
156
|
+
readonly operator: OmniCallOperatorApi;
|
|
157
|
+
readonly account: OmniCallAccountApi;
|
|
158
|
+
};
|
|
159
|
+
//# sourceMappingURL=omnicall-client-api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"omnicall-client-api.d.ts","sourceRoot":"","sources":["../../src/public/omnicall-client-api.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAEpF,OAAO,KAAK,EACV,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,0CAA0C,CAAC;AAClD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AAC3E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,KAAK,EACV,0BAA0B,EAC1B,qBAAqB,EACrB,0BAA0B,EAC3B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AACtF,OAAO,KAAK,EACV,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,kBAAkB,CAAC;AAE1B,cAAc;AACd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