@webex/calling 3.12.0-next.51 → 3.12.0-next.52

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.
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import {FailoverCacheState} from 'CallingClient/registration/types';\nimport {\n KmsKey,\n KmsResourceObject,\n LogsMetaData,\n PeopleListResponse,\n UploadLogsResponse,\n WebexRequestPayload,\n} from '../common/types';\n/* eslint-disable no-shadow */\n\ntype Listener = (e: string, data?: unknown) => void;\ntype ListenerOff = (e: string) => void;\n\nexport type ServiceHost = {\n host: string;\n ttl: number;\n priority: number;\n id: string;\n homeCluster?: boolean;\n};\n\nexport type Model = {\n _values: {\n key: string;\n };\n};\n\nexport type ServiceCatalog = {\n serviceGroups: {\n // cSpell:disable\n postauth: [\n {\n _values: {\n name: string;\n hosts: ServiceHost[];\n };\n }\n ];\n /* cSpell:enable */\n };\n};\n\nexport type ClientRegionInfo = {\n attribution: string;\n clientAddress: string;\n clientRegion: string;\n countryCode: string;\n disclaimer: string;\n regionCode: string;\n timezone: string;\n};\n\nexport type Logger = {\n config?: {\n level: string;\n bufferLogLevel: string;\n };\n log: (payload: string) => void;\n error: (payload: string) => void;\n warn: (payload: string) => void;\n info: (payload: string) => void;\n trace: (payload: string) => void;\n debug: (payload: string) => void;\n};\n\n// TODO: is there a way to import bindings from the Webex JS SDK without having to redefine expected methods and structure?\n// This defines the shape for the webex SDK, if a typing doesn't exist, it should be added here\nexport interface WebexSDK {\n boundedStorage: {\n get: (namespace: string, key: string) => Promise<FailoverCacheState>;\n put: (namespace: string, key: string, value: FailoverCacheState) => Promise<void>;\n del: (namespace: string, key: string) => Promise<void>;\n };\n // top level primitives/funcs\n config: {\n fedramp: boolean;\n defaultMobiusSocketOptions?: Record<string, unknown>;\n };\n version: string;\n canAuthorize: boolean;\n credentials: {\n getUserToken: () => Promise<string>;\n canRefresh?: boolean;\n refresh?: (options: {force: boolean}) => Promise<unknown>;\n };\n ready: boolean;\n sessionId?: string;\n request: <T>(payload: WebexRequestPayload) => Promise<T>;\n // internal plugins\n internal: {\n mercury: {\n on: Listener;\n off: ListenerOff;\n connected: boolean;\n connecting: boolean;\n };\n feature?: {\n updateFeature?: (featureToggle: unknown) => void;\n };\n calendar: unknown;\n device: {\n url: string;\n userId: string;\n orgId: string;\n version: string;\n callingBehavior: string;\n registered?: boolean;\n webSocketUrl?: string;\n register?: () => Promise<unknown>;\n refresh?: () => Promise<unknown>;\n /** WDM / device-registration settings (e.g. `webrtc-calling-over-ws`). */\n settings?: Record<string, {value?: boolean} | undefined>;\n features: {\n developer: {\n models: Model[];\n get: (key: string) => {value: boolean} | undefined;\n };\n entitlement: {\n models: Model[];\n };\n };\n };\n encryption: {\n decryptText: (encryptionKeyUrl: string, encryptedData?: string) => Promise<string>;\n encryptText: (encryptionKeyUrl: string, text?: string) => Promise<string>;\n kms: {\n createUnboundKeys: (arg0: {count?: number}) => Promise<KmsKey[]>;\n createResource: (arg0: {keyUris: string[]}) => Promise<KmsResourceObject>;\n bindKey: (arg0: {kroUri: string; keyUri: string}) => Promise<KmsKey>;\n };\n };\n presence: unknown;\n support: {\n submitLogs: (\n metaData: LogsMetaData,\n logs?: string,\n options?: {\n type: 'diff' | 'full';\n }\n ) => Promise<UploadLogsResponse>;\n };\n services: {\n _hostCatalog: Record<string, ServiceHost[]>;\n _serviceUrls: {\n mobius: string;\n identity: string;\n janus: string;\n wdm: string;\n broadworksIdpProxy: string;\n hydra: string;\n mercuryApi: string;\n 'ucmgmt-gateway': string;\n contactsService: string;\n };\n _activeServices: {\n broadworksIdpProxy: string;\n contactsService: string;\n hydra: string;\n janus: string;\n mercuryApi: string;\n mobius: string;\n };\n get: (service: string) => string;\n getMobiusClusters: () => ServiceHost[];\n fetchClientRegionInfo: () => Promise<ClientRegionInfo>;\n invalidateCache?: (timestamp: unknown) => void;\n switchActiveClusterIds?: (activeClusters: unknown) => void;\n };\n metrics: {\n submitClientMetrics: (name: string, data: unknown) => void;\n };\n };\n // public plugins\n logger: Logger;\n messages: unknown;\n memberships: unknown;\n people: {\n list: (arg: object) => Promise<PeopleListResponse>;\n };\n rooms: unknown;\n teams: unknown;\n}\n\nexport interface ISDKConnector {\n setWebex: (webexInstance: WebexSDK) => void;\n getWebex: () => WebexSDK;\n get: () => ISDKConnector;\n registerListener: <T>(event: string, cb: (data?: T) => unknown) => void;\n unregisterListener: (event: string) => void;\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import {FailoverCacheState} from 'CallingClient/registration/types';\nimport {\n KmsKey,\n KmsResourceObject,\n LogsMetaData,\n PeopleListResponse,\n UploadLogsResponse,\n WebexRequestPayload,\n} from '../common/types';\n/* eslint-disable no-shadow */\n\ntype Listener = (e: string, data?: unknown) => void;\ntype ListenerOff = (e: string) => void;\n\nexport type ServiceHost = {\n host: string;\n ttl: number;\n priority: number;\n id: string;\n homeCluster?: boolean;\n};\n\nexport type Model = {\n _values: {\n key: string;\n };\n};\n\nexport type WDMDevice = {\n url: string;\n userId: string;\n orgId: string;\n version: string;\n callingBehavior: string;\n registered?: boolean;\n webSocketUrl?: string;\n register?: () => Promise<unknown>;\n refresh?: () => Promise<unknown>;\n /** WDM / device-registration settings (e.g. `webrtc-calling-over-ws`). */\n settings?: Record<string, {value?: boolean} | undefined>;\n features: {\n developer: {\n models: Model[];\n get: (key: string) => {value: boolean} | undefined;\n };\n entitlement: {\n models: Model[];\n };\n };\n};\n\nexport type ServiceCatalog = {\n serviceGroups: {\n // cSpell:disable\n postauth: [\n {\n _values: {\n name: string;\n hosts: ServiceHost[];\n };\n }\n ];\n /* cSpell:enable */\n };\n};\n\nexport type ClientRegionInfo = {\n attribution: string;\n clientAddress: string;\n clientRegion: string;\n countryCode: string;\n disclaimer: string;\n regionCode: string;\n timezone: string;\n};\n\nexport type Logger = {\n config?: {\n level: string;\n bufferLogLevel: string;\n };\n log: (payload: string) => void;\n error: (payload: string) => void;\n warn: (payload: string) => void;\n info: (payload: string) => void;\n trace: (payload: string) => void;\n debug: (payload: string) => void;\n};\n\n// TODO: is there a way to import bindings from the Webex JS SDK without having to redefine expected methods and structure?\n// This defines the shape for the webex SDK, if a typing doesn't exist, it should be added here\nexport interface WebexSDK {\n boundedStorage: {\n get: (namespace: string, key: string) => Promise<FailoverCacheState>;\n put: (namespace: string, key: string, value: FailoverCacheState) => Promise<void>;\n del: (namespace: string, key: string) => Promise<void>;\n };\n // top level primitives/funcs\n config: {\n fedramp: boolean;\n defaultMobiusSocketOptions?: Record<string, unknown>;\n };\n version: string;\n canAuthorize: boolean;\n credentials: {\n getUserToken: () => Promise<string>;\n canRefresh?: boolean;\n refresh?: (options: {force: boolean}) => Promise<unknown>;\n };\n ready: boolean;\n sessionId?: string;\n request: <T>(payload: WebexRequestPayload) => Promise<T>;\n // internal plugins\n internal: {\n mercury: {\n on: Listener;\n off: ListenerOff;\n connected: boolean;\n connecting: boolean;\n };\n feature?: {\n updateFeature?: (featureToggle: unknown) => void;\n };\n calendar: unknown;\n device: WDMDevice;\n encryption: {\n decryptText: (encryptionKeyUrl: string, encryptedData?: string) => Promise<string>;\n encryptText: (encryptionKeyUrl: string, text?: string) => Promise<string>;\n kms: {\n createUnboundKeys: (arg0: {count?: number}) => Promise<KmsKey[]>;\n createResource: (arg0: {keyUris: string[]}) => Promise<KmsResourceObject>;\n bindKey: (arg0: {kroUri: string; keyUri: string}) => Promise<KmsKey>;\n };\n };\n presence: unknown;\n support: {\n submitLogs: (\n metaData: LogsMetaData,\n logs?: string,\n options?: {\n type: 'diff' | 'full';\n }\n ) => Promise<UploadLogsResponse>;\n };\n services: {\n _hostCatalog: Record<string, ServiceHost[]>;\n _serviceUrls: {\n mobius: string;\n identity: string;\n janus: string;\n wdm: string;\n broadworksIdpProxy: string;\n hydra: string;\n mercuryApi: string;\n 'ucmgmt-gateway': string;\n contactsService: string;\n };\n _activeServices: {\n broadworksIdpProxy: string;\n contactsService: string;\n hydra: string;\n janus: string;\n mercuryApi: string;\n mobius: string;\n };\n get: (service: string) => string;\n getMobiusClusters: () => ServiceHost[];\n fetchClientRegionInfo: () => Promise<ClientRegionInfo>;\n invalidateCache?: (timestamp: unknown) => void;\n switchActiveClusterIds?: (activeClusters: unknown) => void;\n };\n metrics: {\n submitClientMetrics: (name: string, data: unknown) => void;\n };\n };\n // public plugins\n logger: Logger;\n messages: unknown;\n memberships: unknown;\n people: {\n list: (arg: object) => Promise<PeopleListResponse>;\n };\n rooms: unknown;\n teams: unknown;\n}\n\nexport interface ISDKConnector {\n setWebex: (webexInstance: WebexSDK) => void;\n getWebex: () => WebexSDK;\n get: () => ISDKConnector;\n registerListener: <T>(event: string, cb: (data?: T) => unknown) => void;\n unregisterListener: (event: string) => void;\n}\n"],"mappings":"","ignoreList":[]}
@@ -33,6 +33,7 @@ exports.normalizeMobiusUris = normalizeMobiusUris;
33
33
  exports.parseMediaQualityStatistics = parseMediaQualityStatistics;
34
34
  exports.resolveCallerIdByName = resolveCallerIdByName;
35
35
  exports.resolveCallerIdDisplay = resolveCallerIdDisplay;
36
+ exports.resolveCallingBackend = resolveCallingBackend;
36
37
  exports.resolveContact = resolveContact;
37
38
  exports.scimQuery = scimQuery;
38
39
  exports.serviceErrorCodeHandler = serviceErrorCodeHandler;
@@ -970,15 +971,15 @@ var waitForMsecs = exports.waitForMsecs = function waitForMsecs(msec) {
970
971
  };
971
972
 
972
973
  /**
973
- * Register calling backend.
974
+ * Determine the calling backend from the device object.
974
975
  *
975
- * @param webex -.
976
+ * @param device - The device object containing callingBehavior and entitlement features.
976
977
  * @returns CallingBackEnd.
977
978
  */
978
- function getCallingBackEnd(webex) {
979
- var entModels = webex.internal.device.features.entitlement.models;
979
+ function resolveCallingBackend(device) {
980
+ var entModels = device.features.entitlement.models;
980
981
  var callingBackend;
981
- if (webex.internal.device.callingBehavior === _constants2.NATIVE_WEBEX_TEAMS_CALLING) {
982
+ if (device.callingBehavior === _constants2.NATIVE_WEBEX_TEAMS_CALLING) {
982
983
  for (var i = 0; i < entModels.length; i += 1) {
983
984
  if (entModels[i][_constants2.VALUES][_constants2.KEY] === _constants2.ENTITLEMENT_BASIC || entModels[i][_constants2.VALUES][_constants2.KEY] === _constants2.ENTITLEMENT_STANDARD) {
984
985
  callingBackend = _types3.CALLING_BACKEND.WXC;
@@ -988,12 +989,22 @@ function getCallingBackEnd(webex) {
988
989
  break;
989
990
  }
990
991
  }
991
- } else if (webex.internal.device.callingBehavior === _constants2.NATIVE_SIP_CALL_TO_UCM) {
992
+ } else if (device.callingBehavior === _constants2.NATIVE_SIP_CALL_TO_UCM) {
992
993
  callingBackend = _types3.CALLING_BACKEND.UCM;
993
994
  } else {
994
995
  callingBackend = _types3.CALLING_BACKEND.INVALID;
995
996
  }
996
- return callingBackend;
997
+ return callingBackend || _types3.CALLING_BACKEND.INVALID;
998
+ }
999
+
1000
+ /**
1001
+ * Register calling backend.
1002
+ *
1003
+ * @param webex -.
1004
+ * @returns CallingBackEnd.
1005
+ */
1006
+ function getCallingBackEnd(webex) {
1007
+ return resolveCallingBackend(webex.internal.device);
997
1008
  }
998
1009
 
999
1010
  /**