@webex/calling 3.11.0-webex-services-ready.1 → 3.12.0-mobius-socket.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 (110) hide show
  1. package/dist/CallHistory/CallHistory.js +68 -51
  2. package/dist/CallHistory/CallHistory.js.map +1 -1
  3. package/dist/CallingClient/CallingClient.js +489 -165
  4. package/dist/CallingClient/CallingClient.js.map +1 -1
  5. package/dist/CallingClient/CallingClient.test.js +207 -6
  6. package/dist/CallingClient/CallingClient.test.js.map +1 -1
  7. package/dist/CallingClient/calling/call.js +20 -16
  8. package/dist/CallingClient/calling/call.js.map +1 -1
  9. package/dist/CallingClient/calling/call.test.js +467 -387
  10. package/dist/CallingClient/calling/call.test.js.map +1 -1
  11. package/dist/CallingClient/calling/callManager.js +53 -32
  12. package/dist/CallingClient/calling/callManager.js.map +1 -1
  13. package/dist/CallingClient/calling/callManager.test.js +35 -0
  14. package/dist/CallingClient/calling/callManager.test.js.map +1 -1
  15. package/dist/CallingClient/calling/types.js +2 -0
  16. package/dist/CallingClient/calling/types.js.map +1 -1
  17. package/dist/CallingClient/constants.js +11 -3
  18. package/dist/CallingClient/constants.js.map +1 -1
  19. package/dist/CallingClient/line/line.test.js +15 -0
  20. package/dist/CallingClient/line/line.test.js.map +1 -1
  21. package/dist/CallingClient/registration/register.js +114 -71
  22. package/dist/CallingClient/registration/register.js.map +1 -1
  23. package/dist/CallingClient/registration/register.test.js +21 -12
  24. package/dist/CallingClient/registration/register.test.js.map +1 -1
  25. package/dist/CallingClient/registration/types.js.map +1 -1
  26. package/dist/CallingClient/registration/webWorker.js +2 -0
  27. package/dist/CallingClient/registration/webWorker.js.map +1 -1
  28. package/dist/CallingClient/types.js.map +1 -1
  29. package/dist/CallingClient/utils/constants.js +46 -0
  30. package/dist/CallingClient/utils/constants.js.map +1 -0
  31. package/dist/CallingClient/utils/index.js +63 -0
  32. package/dist/CallingClient/utils/index.js.map +1 -0
  33. package/dist/CallingClient/utils/mobiusSocketMapper.js +106 -0
  34. package/dist/CallingClient/utils/mobiusSocketMapper.js.map +1 -0
  35. package/dist/CallingClient/utils/request.js +267 -0
  36. package/dist/CallingClient/utils/request.js.map +1 -0
  37. package/dist/CallingClient/utils/types.js +7 -0
  38. package/dist/CallingClient/utils/types.js.map +1 -0
  39. package/dist/CallingClient/utils/wsFeatureFlag.js +20 -0
  40. package/dist/CallingClient/utils/wsFeatureFlag.js.map +1 -0
  41. package/dist/Events/types.js +1 -11
  42. package/dist/Events/types.js.map +1 -1
  43. package/dist/SDKConnector/index.js +32 -0
  44. package/dist/SDKConnector/index.js.map +1 -1
  45. package/dist/SDKConnector/types.js.map +1 -1
  46. package/dist/common/Utils.js +69 -10
  47. package/dist/common/Utils.js.map +1 -1
  48. package/dist/common/testUtil.js +5 -0
  49. package/dist/common/testUtil.js.map +1 -1
  50. package/dist/common/types.js.map +1 -1
  51. package/dist/module/CallHistory/CallHistory.js +28 -17
  52. package/dist/module/CallingClient/CallingClient.js +157 -4
  53. package/dist/module/CallingClient/calling/call.js +12 -8
  54. package/dist/module/CallingClient/calling/callManager.js +29 -10
  55. package/dist/module/CallingClient/calling/types.js +2 -0
  56. package/dist/module/CallingClient/constants.js +8 -0
  57. package/dist/module/CallingClient/registration/register.js +46 -16
  58. package/dist/module/CallingClient/utils/constants.js +30 -0
  59. package/dist/module/CallingClient/utils/index.js +5 -0
  60. package/dist/module/CallingClient/utils/mobiusSocketMapper.js +56 -0
  61. package/dist/module/CallingClient/utils/request.js +112 -0
  62. package/dist/module/CallingClient/utils/types.js +1 -0
  63. package/dist/module/CallingClient/utils/wsFeatureFlag.js +5 -0
  64. package/dist/module/Events/types.js +0 -10
  65. package/dist/module/SDKConnector/index.js +17 -0
  66. package/dist/module/common/Utils.js +35 -4
  67. package/dist/module/common/testUtil.js +3 -0
  68. package/dist/types/CallHistory/CallHistory.d.ts.map +1 -1
  69. package/dist/types/CallingClient/CallingClient.d.ts +10 -1
  70. package/dist/types/CallingClient/CallingClient.d.ts.map +1 -1
  71. package/dist/types/CallingClient/calling/call.d.ts +1 -0
  72. package/dist/types/CallingClient/calling/call.d.ts.map +1 -1
  73. package/dist/types/CallingClient/calling/callManager.d.ts +5 -4
  74. package/dist/types/CallingClient/calling/callManager.d.ts.map +1 -1
  75. package/dist/types/CallingClient/calling/types.d.ts +21 -9
  76. package/dist/types/CallingClient/calling/types.d.ts.map +1 -1
  77. package/dist/types/CallingClient/constants.d.ts +8 -0
  78. package/dist/types/CallingClient/constants.d.ts.map +1 -1
  79. package/dist/types/CallingClient/registration/register.d.ts +3 -1
  80. package/dist/types/CallingClient/registration/register.d.ts.map +1 -1
  81. package/dist/types/CallingClient/registration/types.d.ts +2 -1
  82. package/dist/types/CallingClient/registration/types.d.ts.map +1 -1
  83. package/dist/types/CallingClient/registration/webWorker.d.ts.map +1 -1
  84. package/dist/types/CallingClient/types.d.ts +3 -1
  85. package/dist/types/CallingClient/types.d.ts.map +1 -1
  86. package/dist/types/CallingClient/utils/constants.d.ts +30 -0
  87. package/dist/types/CallingClient/utils/constants.d.ts.map +1 -0
  88. package/dist/types/CallingClient/utils/index.d.ts +6 -0
  89. package/dist/types/CallingClient/utils/index.d.ts.map +1 -0
  90. package/dist/types/CallingClient/utils/mobiusSocketMapper.d.ts +4 -0
  91. package/dist/types/CallingClient/utils/mobiusSocketMapper.d.ts.map +1 -0
  92. package/dist/types/CallingClient/utils/request.d.ts +20 -0
  93. package/dist/types/CallingClient/utils/request.d.ts.map +1 -0
  94. package/dist/types/CallingClient/utils/types.d.ts +23 -0
  95. package/dist/types/CallingClient/utils/types.d.ts.map +1 -0
  96. package/dist/types/CallingClient/utils/wsFeatureFlag.d.ts +4 -0
  97. package/dist/types/CallingClient/utils/wsFeatureFlag.d.ts.map +1 -0
  98. package/dist/types/Events/types.d.ts +0 -10
  99. package/dist/types/Events/types.d.ts.map +1 -1
  100. package/dist/types/SDKConnector/index.d.ts +2 -0
  101. package/dist/types/SDKConnector/index.d.ts.map +1 -1
  102. package/dist/types/SDKConnector/types.d.ts +11 -0
  103. package/dist/types/SDKConnector/types.d.ts.map +1 -1
  104. package/dist/types/common/Utils.d.ts +4 -1
  105. package/dist/types/common/Utils.d.ts.map +1 -1
  106. package/dist/types/common/testUtil.d.ts +3 -0
  107. package/dist/types/common/testUtil.d.ts.map +1 -1
  108. package/dist/types/common/types.d.ts +5 -0
  109. package/dist/types/common/types.d.ts.map +1 -1
  110. package/package.json +8 -4
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import {IDeviceInfo, RegistrationStatus} from '../../common/types';\n\nexport type Header = {\n [key: string]: string;\n};\n\nexport type restoreRegistrationCallBack = (\n restoreData: IDeviceInfo,\n caller: string\n) => Promise<boolean>;\n\nexport type retry429CallBack = (retryAfter: number, caller: string) => void;\n\nexport type FailoverCacheState = {\n attempt: number;\n timeElapsed: number;\n retryScheduledTime: number;\n serverType: 'primary' | 'backup';\n};\n\n/**\n * Represents an interface for managing registration-related operations.\n */\nexport interface IRegistration {\n /**\n * Sets the primary and backup Mobius server URLs.\n *\n * @param primaryMobiusUris - An array of primary Mobius server URLs.\n * @param backupMobiusUris - An array of backup Mobius server URLs.\n */\n setMobiusServers(primaryMobiusUris: string[], backupMobiusUris: string[]): void;\n\n /**\n * Triggers the registration process with the given list of servers\n * Registration is attempted with primary and backup until it succeeds or the list is exhausted\n */\n triggerRegistration(): Promise<void>;\n\n /**\n * Checks if the device is currently registered.\n *\n */\n isDeviceRegistered(): boolean;\n\n /**\n * Sets the status of the registration.\n *\n * @param value - The registration status to set.\n */\n setStatus(value: RegistrationStatus): void;\n\n /**\n * Retrieves the current registration status.\n *\n */\n getStatus(): RegistrationStatus;\n\n /**\n * Retrieves information about the device as {@link IDeviceInfo}.\n *\n */\n getDeviceInfo(): IDeviceInfo;\n\n /**\n * Clears the keep-alive timer used for registration.\n */\n clearKeepaliveTimer(): void;\n\n /**\n * Deregisters the device.\n */\n deregister(): void;\n\n /**\n * Sets the active Mobius server URL to use for registration.\n *\n * @param url - The Mobius server URL to set as active.\n */\n setActiveMobiusUrl(url: string): void;\n\n /**\n * Retrieves the active Mobius server URL.\n *\n */\n getActiveMobiusUrl(): string;\n\n /**\n * Attempts to reconnect after a connection failure.\n *\n * @param caller - The caller's identifier for reconnection.\n */\n reconnectOnFailure(caller: string): Promise<void>;\n\n /**\n * Checks if a reconnection attempt is pending.\n *\n */\n isReconnectPending(): boolean;\n\n /**\n * Restores the connection and attempts refreshing existing registration with server.\n * Allows retry if not restored in the first attempt.\n *\n * @param retry - Set to `true` to trigger a retry after restoration.\n */\n handleConnectionRestoration(retry: boolean): Promise<boolean>;\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import {Devices, IDeviceInfo, RegistrationStatus} from '../../common/types';\n\nexport type Header = {\n [key: string]: string;\n};\n\nexport type restoreRegistrationCallBack = (\n restoreData: IDeviceInfo,\n caller: string\n) => Promise<boolean>;\n\nexport type retry429CallBack = (retryAfter: number, caller: string) => void;\n\nexport type FailoverCacheState = {\n attempt: number;\n timeElapsed: number;\n retryScheduledTime: number;\n serverType: 'primary' | 'backup';\n};\n\n/**\n * Represents an interface for managing registration-related operations.\n */\nexport interface IRegistration {\n /**\n * Sets the primary and backup Mobius server URLs.\n *\n * @param primaryMobiusUris - An array of primary Mobius server URLs.\n * @param backupMobiusUris - An array of backup Mobius server URLs.\n */\n setMobiusServers(primaryMobiusUris: string[], backupMobiusUris: string[]): void;\n\n /**\n * Triggers the registration process with the given list of servers\n * Registration is attempted with primary and backup until it succeeds or the list is exhausted\n */\n triggerRegistration(): Promise<void>;\n\n /**\n * Checks if the device is currently registered.\n *\n */\n isDeviceRegistered(): boolean;\n\n /**\n * Sets the status of the registration.\n *\n * @param value - The registration status to set.\n */\n setStatus(value: RegistrationStatus): void;\n\n /**\n * Retrieves the current registration status.\n *\n */\n getStatus(): RegistrationStatus;\n\n /**\n * Retrieves information about the device as {@link IDeviceInfo}.\n *\n */\n getDeviceInfo(): IDeviceInfo;\n\n /**\n * Clears the keep-alive timer used for registration.\n */\n clearKeepaliveTimer(): void;\n\n /**\n * Deregisters the device.\n */\n deregister(): void;\n\n /**\n * Sets the active Mobius server URL to use for registration.\n *\n * @param url - The Mobius server URL to set as active.\n */\n setActiveMobiusUrl(url: string): void;\n\n /**\n * Retrieves the active Mobius server URL.\n *\n */\n getActiveMobiusUrl(): string;\n\n /**\n * Attempts to reconnect after a connection failure.\n *\n * @param caller - The caller's identifier for reconnection.\n */\n reconnectOnFailure(caller: string): Promise<void>;\n\n /**\n * Checks if a reconnection attempt is pending.\n *\n */\n isReconnectPending(): boolean;\n\n /**\n * Restores the connection and attempts refreshing existing registration with server.\n * Allows retry if not restored in the first attempt.\n *\n * @param retry - Set to `true` to trigger a retry after restoration.\n */\n handleConnectionRestoration(retry: boolean): Promise<boolean>;\n\n /**\n * Populate deviceInfo from a devices response (e.g., getDevices API).\n */\n setDeviceInfo(body: Devices): void;\n}\n"],"mappings":"","ignoreList":[]}
@@ -15,6 +15,8 @@ var _types = require("../../common/types");
15
15
  var keepaliveTimer;
16
16
  var messageHandler = function messageHandler(event) {
17
17
  var type = event.data.type;
18
+
19
+ // TODO: Use APIRequest to make the request
18
20
  var postKeepAlive = /*#__PURE__*/function () {
19
21
  var _ref = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee(accessToken, deviceUrl, url) {
20
22
  var response;
@@ -1 +1 @@
1
- {"version":3,"names":["_uuid","require","_types","keepaliveTimer","messageHandler","event","type","data","postKeepAlive","_ref","_asyncToGenerator2","default","_regenerator","mark","_callee","accessToken","deviceUrl","url","response","wrap","_context","prev","next","fetch","concat","method","HTTP_METHODS","POST","headers","Authorization","trackingId","uuid","sent","ok","abrupt","stop","_x","_x2","_x3","apply","arguments","WorkerMessageType","START_KEEPALIVE","keepAliveRetryCount","_event$data","interval","retryCountThreshold","clearInterval","undefined","setInterval","_callee2","res","statusCode","_err$headers","_err$headers2","error","_t","_context2","status","postMessage","KEEPALIVE_SUCCESS","has","get","statusText","KEEPALIVE_FAILURE","err","CLEAR_KEEPALIVE","self","addEventListener","_default","exports"],"sources":["webWorker.ts"],"sourcesContent":["/* eslint-env worker */\nimport {v4 as uuid} from 'uuid';\nimport {HTTP_METHODS, KeepaliveStatusMessage, WorkerMessageType} from '../../common/types';\n\nlet keepaliveTimer: NodeJS.Timeout | undefined;\n\nconst messageHandler = (event: MessageEvent) => {\n const {type} = event.data;\n\n const postKeepAlive = async (accessToken: string, deviceUrl: string, url: string) => {\n const response = await fetch(`${url}/status`, {\n method: HTTP_METHODS.POST,\n headers: {\n 'cisco-device-url': deviceUrl,\n 'spark-user-agent': 'webex-calling/beta',\n Authorization: `${accessToken}`,\n trackingId: `web_worker_${uuid()}`,\n },\n });\n\n if (!response.ok) {\n throw response;\n }\n\n return response;\n };\n\n if (type === WorkerMessageType.START_KEEPALIVE) {\n let keepAliveRetryCount = 0;\n const {accessToken, deviceUrl, interval, retryCountThreshold, url} = event.data;\n\n if (keepaliveTimer) {\n clearInterval(keepaliveTimer);\n keepaliveTimer = undefined;\n }\n\n keepaliveTimer = setInterval(async () => {\n if (keepAliveRetryCount < retryCountThreshold) {\n try {\n const res = await postKeepAlive(accessToken, deviceUrl, url);\n const statusCode = res.status;\n if (keepAliveRetryCount > 0) {\n postMessage({\n type: WorkerMessageType.KEEPALIVE_SUCCESS,\n statusCode,\n } as KeepaliveStatusMessage);\n }\n keepAliveRetryCount = 0;\n } catch (err: any) {\n const headers = {} as Record<string, string>;\n if (err.headers?.has('Retry-After')) {\n headers['retry-after'] = err.headers.get('Retry-After');\n }\n\n if (err.headers?.has('Trackingid')) {\n // eslint-disable-next-line dot-notation\n headers['trackingid'] = err.headers.get('Trackingid');\n }\n\n const error = {\n headers,\n statusCode: err.status,\n statusText: err.statusText,\n type: err.type,\n };\n keepAliveRetryCount += 1;\n postMessage({\n type: WorkerMessageType.KEEPALIVE_FAILURE,\n err: error,\n keepAliveRetryCount,\n } as KeepaliveStatusMessage);\n }\n }\n }, interval * 1000);\n }\n\n if (type === WorkerMessageType.CLEAR_KEEPALIVE) {\n if (keepaliveTimer) {\n clearInterval(keepaliveTimer);\n keepaliveTimer = undefined;\n }\n }\n};\n\n// eslint-disable-next-line no-restricted-globals\nself.addEventListener('message', messageHandler);\nexport default messageHandler;\n"],"mappings":";;;;;;;;;;AACA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAFA;;AAIA,IAAIE,cAA0C;AAE9C,IAAMC,cAAc,GAAG,SAAjBA,cAAcA,CAAIC,KAAmB,EAAK;EAC9C,IAAOC,IAAI,GAAID,KAAK,CAACE,IAAI,CAAlBD,IAAI;EAEX,IAAME,aAAa;IAAA,IAAAC,IAAA,OAAAC,kBAAA,CAAAC,OAAA,eAAAC,YAAA,CAAAD,OAAA,CAAAE,IAAA,CAAG,SAAAC,QAAOC,WAAmB,EAAEC,SAAiB,EAAEC,GAAW;MAAA,IAAAC,QAAA;MAAA,OAAAN,YAAA,CAAAD,OAAA,CAAAQ,IAAA,WAAAC,QAAA;QAAA,kBAAAA,QAAA,CAAAC,IAAA,GAAAD,QAAA,CAAAE,IAAA;UAAA;YAAAF,QAAA,CAAAE,IAAA;YAAA,OACvDC,KAAK,IAAAC,MAAA,CAAIP,GAAG,cAAW;cAC5CQ,MAAM,EAAEC,mBAAY,CAACC,IAAI;cACzBC,OAAO,EAAE;gBACP,kBAAkB,EAAEZ,SAAS;gBAC7B,kBAAkB,EAAE,oBAAoB;gBACxCa,aAAa,KAAAL,MAAA,CAAKT,WAAW,CAAE;gBAC/Be,UAAU,gBAAAN,MAAA,CAAgB,IAAAO,QAAI,EAAC,CAAC;cAClC;YACF,CAAC,CAAC;UAAA;YARIb,QAAQ,GAAAE,QAAA,CAAAY,IAAA;YAAA,IAUTd,QAAQ,CAACe,EAAE;cAAAb,QAAA,CAAAE,IAAA;cAAA;YAA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AAA;YAAA,OAAAc,SAAA,CAAAtB,IAAA;QAAA;MAAA,GAAAe,QAAA;IAAA,CAGlC,IAAEL,QAAQ,GAAG,IAAI,CAAC;EACrB;EAEA,IAAIvC,IAAI,KAAKmC,wBAAiB,CAACyB,eAAe,EAAE;IAC9C,IAAI/D,cAAc,EAAE;MAClB4C,aAAa,CAAC5C,cAAc,CAAC;MAC7BA,cAAc,GAAG6C,SAAS;IAC5B;EACF;AACF,CAAC;;AAED;AACAmB,IAAI,CAACC,gBAAgB,CAAC,SAAS,EAAEhE,cAAc,CAAC;AAAC,IAAAiE,QAAA,GAAAC,OAAA,CAAA3D,OAAA,GAClCP,cAAc","ignoreList":[]}
1
+ {"version":3,"names":["_uuid","require","_types","keepaliveTimer","messageHandler","event","type","data","postKeepAlive","_ref","_asyncToGenerator2","default","_regenerator","mark","_callee","accessToken","deviceUrl","url","response","wrap","_context","prev","next","fetch","concat","method","HTTP_METHODS","POST","headers","Authorization","trackingId","uuid","sent","ok","abrupt","stop","_x","_x2","_x3","apply","arguments","WorkerMessageType","START_KEEPALIVE","keepAliveRetryCount","_event$data","interval","retryCountThreshold","clearInterval","undefined","setInterval","_callee2","res","statusCode","_err$headers","_err$headers2","error","_t","_context2","status","postMessage","KEEPALIVE_SUCCESS","has","get","statusText","KEEPALIVE_FAILURE","err","CLEAR_KEEPALIVE","self","addEventListener","_default","exports"],"sources":["webWorker.ts"],"sourcesContent":["/* eslint-env worker */\nimport {v4 as uuid} from 'uuid';\nimport {HTTP_METHODS, KeepaliveStatusMessage, WorkerMessageType} from '../../common/types';\n\nlet keepaliveTimer: NodeJS.Timeout | undefined;\n\nconst messageHandler = (event: MessageEvent) => {\n const {type} = event.data;\n\n // TODO: Use APIRequest to make the request\n const postKeepAlive = async (accessToken: string, deviceUrl: string, url: string) => {\n const response = await fetch(`${url}/status`, {\n method: HTTP_METHODS.POST,\n headers: {\n 'cisco-device-url': deviceUrl,\n 'spark-user-agent': 'webex-calling/beta',\n Authorization: `${accessToken}`,\n trackingId: `web_worker_${uuid()}`,\n },\n });\n\n if (!response.ok) {\n throw response;\n }\n\n return response;\n };\n\n if (type === WorkerMessageType.START_KEEPALIVE) {\n let keepAliveRetryCount = 0;\n const {accessToken, deviceUrl, interval, retryCountThreshold, url} = event.data;\n\n if (keepaliveTimer) {\n clearInterval(keepaliveTimer);\n keepaliveTimer = undefined;\n }\n\n keepaliveTimer = setInterval(async () => {\n if (keepAliveRetryCount < retryCountThreshold) {\n try {\n const res = await postKeepAlive(accessToken, deviceUrl, url);\n const statusCode = res.status;\n if (keepAliveRetryCount > 0) {\n postMessage({\n type: WorkerMessageType.KEEPALIVE_SUCCESS,\n statusCode,\n } as KeepaliveStatusMessage);\n }\n keepAliveRetryCount = 0;\n } catch (err: any) {\n const headers = {} as Record<string, string>;\n if (err.headers?.has('Retry-After')) {\n headers['retry-after'] = err.headers.get('Retry-After');\n }\n\n if (err.headers?.has('Trackingid')) {\n // eslint-disable-next-line dot-notation\n headers['trackingid'] = err.headers.get('Trackingid');\n }\n\n const error = {\n headers,\n statusCode: err.status,\n statusText: err.statusText,\n type: err.type,\n };\n keepAliveRetryCount += 1;\n postMessage({\n type: WorkerMessageType.KEEPALIVE_FAILURE,\n err: error,\n keepAliveRetryCount,\n } as KeepaliveStatusMessage);\n }\n }\n }, interval * 1000);\n }\n\n if (type === WorkerMessageType.CLEAR_KEEPALIVE) {\n if (keepaliveTimer) {\n clearInterval(keepaliveTimer);\n keepaliveTimer = undefined;\n }\n }\n};\n\n// eslint-disable-next-line no-restricted-globals\nself.addEventListener('message', messageHandler);\nexport default messageHandler;\n"],"mappings":";;;;;;;;;;AACA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAFA;;AAIA,IAAIE,cAA0C;AAE9C,IAAMC,cAAc,GAAG,SAAjBA,cAAcA,CAAIC,KAAmB,EAAK;EAC9C,IAAOC,IAAI,GAAID,KAAK,CAACE,IAAI,CAAlBD,IAAI;;EAEX;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import * as Media from '@webex/internal-media-core';\nimport {LOGGER} from '../Logger/types';\nimport {ISDKConnector} from '../SDKConnector/types';\nimport {Eventing} from '../Events/impl';\nimport {CallingClientEventTypes} from '../Events/types';\nimport {ServiceData} from '../common/types';\nimport {ICall} from './calling/types';\nimport {CallingClientError} from '../Errors';\nimport {ILine} from './line/types';\n\nexport interface LoggerConfig {\n level: LOGGER;\n}\n\ninterface DiscoveryConfig {\n country: string;\n region: string;\n}\n\nexport interface CallingClientConfig {\n logger?: LoggerConfig;\n discovery?: DiscoveryConfig;\n serviceData?: ServiceData;\n jwe?: string;\n}\n\nexport type CallingClientErrorEmitterCallback = (\n err: CallingClientError,\n finalError?: boolean\n) => void;\n\n/**\n * An interface for the `CallingClient` module.\n * The `CallingClient` module is designed to provide a set of APIs related to line registration and calling functionalities within the SDK.\n *\n * @example\n * ```javascript\n * const callingClient = createClient(webex, callingConfig);\n * ```\n */\nexport interface ICallingClient extends Eventing<CallingClientEventTypes> {\n /**\n * Represents the `mediaEngine for managing media-related operations within the CallingClient.\n * The media engine provides access to audio and video devices such as cameras, microphones, and speakers within the media layer.\n *\n * @public\n * @example\n * ```\n * const microphones = await callingClient.mediaEngine.Media.getMicrophones();\n * const speakers = await callingClient.mediaEngine.Media.getSpeakers();\n * const cameras = await callingClient.mediaEngine.Media.getCameras();\n * ```\n */\n mediaEngine: typeof Media;\n\n /**\n * @ignore\n */\n getSDKConnector(): ISDKConnector;\n\n /**\n * @ignore\n */\n getLoggingLevel(): LOGGER;\n\n /**\n * Retrieves details of the line object(s) belonging to a user.\n *\n * This method gathers all the {@link ILine} objects and organizes them into a dictionary\n * where keys represent `lineId`s and values are arrays of {@link ILine} objects registered with\n * the `callingClient`\n *\n * @example\n * ```typescript\n * const lines = callingClient.getLines();\n * ```\n * The `lines` response object will have `lineId` as its key and\n * a list {@link ILine} objects as it's value.\n * ```\n * {\n * 'lineId1': lineObj1,\n * 'lineId2': lineObj2,\n * }\n * ```\n */\n getLines(): Record<string, ILine>;\n\n /**\n * Retrieves a dictionary of active calls grouped by `lineId`.\n *\n * This method gathers active {@link ICall} objects and organizes them into a dictionary\n * where keys represent `lineId`s and values are arrays of {@link ICall} objects of active calls associated\n * with each line.\n *\n * @example\n * ```typescript\n * const activeCalls = callingClient.getActiveCalls();\n * ```\n * The `activeCalls` response object will have `lineId` as its key and\n * a list {@link ICall} objects as it's value.\n *\n * ```\n * {\n * 'line1': [call1, call2],\n * 'line2': [call3],\n * }\n * ```\n */\n getActiveCalls(): Record<string, ICall[]>;\n\n /**\n * Retrieves the {@link ICall} object for the currently connected call in the client.\n *\n * This method iterates through active call objects and returns the call\n * that is currently connected (not on hold).\n *\n * @example\n * ```typescript\n * const connectedCall : ICall = callingClient.getConnectedCall();\n * ```\n * The `connectedCall` object will be the Call object of the connected call with the client\n */\n getConnectedCall(): ICall | undefined;\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import * as Media from '@webex/internal-media-core';\nimport {LOGGER} from '../Logger/types';\nimport {ISDKConnector} from '../SDKConnector/types';\nimport {Eventing} from '../Events/impl';\nimport {CallingClientEventTypes} from '../Events/types';\nimport {DeviceType, ServiceData} from '../common/types';\nimport {ICall} from './calling/types';\nimport {CallingClientError} from '../Errors';\nimport {ILine} from './line/types';\n\nexport interface LoggerConfig {\n level: LOGGER;\n}\n\ninterface DiscoveryConfig {\n country: string;\n region: string;\n}\n\nexport interface CallingClientConfig {\n logger?: LoggerConfig;\n discovery?: DiscoveryConfig;\n serviceData?: ServiceData;\n jwe?: string;\n isMobiusSocketEnabled?: boolean;\n}\n\nexport type CallingClientErrorEmitterCallback = (\n err: CallingClientError,\n finalError?: boolean\n) => void;\n\n/**\n * An interface for the `CallingClient` module.\n * The `CallingClient` module is designed to provide a set of APIs related to line registration and calling functionalities within the SDK.\n *\n * @example\n * ```javascript\n * const callingClient = createClient(webex, callingConfig);\n * ```\n */\nexport interface ICallingClient extends Eventing<CallingClientEventTypes> {\n /**\n * Represents the `mediaEngine for managing media-related operations within the CallingClient.\n * The media engine provides access to audio and video devices such as cameras, microphones, and speakers within the media layer.\n *\n * @public\n * @example\n * ```\n * const microphones = await callingClient.mediaEngine.Media.getMicrophones();\n * const speakers = await callingClient.mediaEngine.Media.getSpeakers();\n * const cameras = await callingClient.mediaEngine.Media.getCameras();\n * ```\n */\n mediaEngine: typeof Media;\n\n /**\n * @ignore\n */\n getSDKConnector(): ISDKConnector;\n\n /**\n * @ignore\n */\n getLoggingLevel(): LOGGER;\n\n /**\n * Retrieves details of the line object(s) belonging to a user.\n *\n * This method gathers all the {@link ILine} objects and organizes them into a dictionary\n * where keys represent `lineId`s and values are arrays of {@link ILine} objects registered with\n * the `callingClient`\n *\n * @example\n * ```typescript\n * const lines = callingClient.getLines();\n * ```\n * The `lines` response object will have `lineId` as its key and\n * a list {@link ILine} objects as it's value.\n * ```\n * {\n * 'lineId1': lineObj1,\n * 'lineId2': lineObj2,\n * }\n * ```\n */\n getLines(): Record<string, ILine>;\n\n /**\n * Retrieves the list of devices registered for the given userId from Mobius.\n * @param userId - The user identifier whose devices should be fetched.\n * @returns List of devices associated with the user.\n */\n getDevices(userId?: string): Promise<DeviceType[]>;\n\n /**\n * Retrieves a dictionary of active calls grouped by `lineId`.\n *\n * This method gathers active {@link ICall} objects and organizes them into a dictionary\n * where keys represent `lineId`s and values are arrays of {@link ICall} objects of active calls associated\n * with each line.\n *\n * @example\n * ```typescript\n * const activeCalls = callingClient.getActiveCalls();\n * ```\n * The `activeCalls` response object will have `lineId` as its key and\n * a list {@link ICall} objects as it's value.\n *\n * ```\n * {\n * 'line1': [call1, call2],\n * 'line2': [call3],\n * }\n * ```\n */\n getActiveCalls(): Record<string, ICall[]>;\n\n /**\n * Retrieves the {@link ICall} object for the currently connected call in the client.\n *\n * This method iterates through active call objects and returns the call\n * that is currently connected (not on hold).\n *\n * @example\n * ```typescript\n * const connectedCall : ICall = callingClient.getConnectedCall();\n * ```\n * The `connectedCall` object will be the Call object of the connected call with the client\n */\n getConnectedCall(): ICall | undefined;\n}\n"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+
3
+ var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
4
+ _Object$defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.MOBIUS_SOCKET_MESSAGE_TYPE = void 0;
8
+ /**
9
+ * Mobius WebSocket event names for request and response messages
10
+ * Response events follow the pattern: `{request_event}.response`
11
+ */
12
+ // eslint-disable-next-line import/prefer-default-export
13
+ var MOBIUS_SOCKET_MESSAGE_TYPE = exports.MOBIUS_SOCKET_MESSAGE_TYPE = /*#__PURE__*/function (MOBIUS_SOCKET_MESSAGE_TYPE) {
14
+ MOBIUS_SOCKET_MESSAGE_TYPE["UNKNOWN"] = "UNKNOWN";
15
+ // Registration messages
16
+ MOBIUS_SOCKET_MESSAGE_TYPE["REGISTER"] = "register";
17
+ MOBIUS_SOCKET_MESSAGE_TYPE["REGISTER_RESPONSE"] = "register.response";
18
+ MOBIUS_SOCKET_MESSAGE_TYPE["UNREGISTER"] = "unregister";
19
+ MOBIUS_SOCKET_MESSAGE_TYPE["UNREGISTER_RESPONSE"] = "unregister.response";
20
+ MOBIUS_SOCKET_MESSAGE_TYPE["DEVICE_STATUS"] = "device_status";
21
+ MOBIUS_SOCKET_MESSAGE_TYPE["DEVICE_STATUS_RESPONSE"] = "device_status.response";
22
+ MOBIUS_SOCKET_MESSAGE_TYPE["DEVICE_GET"] = "device_get";
23
+ MOBIUS_SOCKET_MESSAGE_TYPE["DEVICE_GET_RESPONSE"] = "device_get.response";
24
+ MOBIUS_SOCKET_MESSAGE_TYPE["DEVICE_LIST"] = "device_list";
25
+ MOBIUS_SOCKET_MESSAGE_TYPE["DEVICE_LIST_RESPONSE"] = "device_list.response";
26
+ // Call messages
27
+ MOBIUS_SOCKET_MESSAGE_TYPE["CALL_SETUP"] = "call_setup";
28
+ MOBIUS_SOCKET_MESSAGE_TYPE["CALL_SETUP_RESPONSE"] = "call_setup.response";
29
+ MOBIUS_SOCKET_MESSAGE_TYPE["CALL_STATE"] = "call_state";
30
+ MOBIUS_SOCKET_MESSAGE_TYPE["CALL_STATE_RESPONSE"] = "call_state.response";
31
+ MOBIUS_SOCKET_MESSAGE_TYPE["CALL_STATUS"] = "call_status";
32
+ MOBIUS_SOCKET_MESSAGE_TYPE["CALL_STATUS_RESPONSE"] = "call_status.response";
33
+ MOBIUS_SOCKET_MESSAGE_TYPE["CALL_MEDIA"] = "call_media";
34
+ MOBIUS_SOCKET_MESSAGE_TYPE["CALL_MEDIA_RESPONSE"] = "call_media.response";
35
+ // Supplementary services messages
36
+ MOBIUS_SOCKET_MESSAGE_TYPE["CALL_HOLD"] = "call_hold";
37
+ MOBIUS_SOCKET_MESSAGE_TYPE["CALL_HOLD_RESPONSE"] = "call_hold.response";
38
+ MOBIUS_SOCKET_MESSAGE_TYPE["CALL_RESUME"] = "call_resume";
39
+ MOBIUS_SOCKET_MESSAGE_TYPE["CALL_RESUME_RESPONSE"] = "call_resume.response";
40
+ MOBIUS_SOCKET_MESSAGE_TYPE["CALL_TRANSFER"] = "call_transfer";
41
+ MOBIUS_SOCKET_MESSAGE_TYPE["CALL_TRANSFER_RESPONSE"] = "call_transfer.response";
42
+ MOBIUS_SOCKET_MESSAGE_TYPE["CALL_DELETE"] = "call_delete";
43
+ MOBIUS_SOCKET_MESSAGE_TYPE["CALL_DELETE_RESPONSE"] = "call_delete.response";
44
+ return MOBIUS_SOCKET_MESSAGE_TYPE;
45
+ }({});
46
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["MOBIUS_SOCKET_MESSAGE_TYPE","exports"],"sources":["constants.ts"],"sourcesContent":["/**\n * Mobius WebSocket event names for request and response messages\n * Response events follow the pattern: `{request_event}.response`\n */\n// eslint-disable-next-line import/prefer-default-export\nexport enum MOBIUS_SOCKET_MESSAGE_TYPE {\n UNKNOWN = 'UNKNOWN',\n\n // Registration messages\n REGISTER = 'register',\n REGISTER_RESPONSE = 'register.response',\n UNREGISTER = 'unregister',\n UNREGISTER_RESPONSE = 'unregister.response',\n DEVICE_STATUS = 'device_status',\n DEVICE_STATUS_RESPONSE = 'device_status.response',\n DEVICE_GET = 'device_get',\n DEVICE_GET_RESPONSE = 'device_get.response',\n DEVICE_LIST = 'device_list',\n DEVICE_LIST_RESPONSE = 'device_list.response',\n\n // Call messages\n CALL_SETUP = 'call_setup',\n CALL_SETUP_RESPONSE = 'call_setup.response',\n CALL_STATE = 'call_state',\n CALL_STATE_RESPONSE = 'call_state.response',\n CALL_STATUS = 'call_status',\n CALL_STATUS_RESPONSE = 'call_status.response',\n CALL_MEDIA = 'call_media',\n CALL_MEDIA_RESPONSE = 'call_media.response',\n\n // Supplementary services messages\n CALL_HOLD = 'call_hold',\n CALL_HOLD_RESPONSE = 'call_hold.response',\n CALL_RESUME = 'call_resume',\n CALL_RESUME_RESPONSE = 'call_resume.response',\n CALL_TRANSFER = 'call_transfer',\n CALL_TRANSFER_RESPONSE = 'call_transfer.response',\n\n CALL_DELETE = 'call_delete',\n CALL_DELETE_RESPONSE = 'call_delete.response',\n}\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AAAA,IACYA,0BAA0B,GAAAC,OAAA,CAAAD,0BAAA,0BAA1BA,0BAA0B;EAA1BA,0BAA0B;EAGpC;EAHUA,0BAA0B;EAA1BA,0BAA0B;EAA1BA,0BAA0B;EAA1BA,0BAA0B;EAA1BA,0BAA0B;EAA1BA,0BAA0B;EAA1BA,0BAA0B;EAA1BA,0BAA0B;EAA1BA,0BAA0B;EAA1BA,0BAA0B;EAepC;EAfUA,0BAA0B;EAA1BA,0BAA0B;EAA1BA,0BAA0B;EAA1BA,0BAA0B;EAA1BA,0BAA0B;EAA1BA,0BAA0B;EAA1BA,0BAA0B;EAA1BA,0BAA0B;EAyBpC;EAzBUA,0BAA0B;EAA1BA,0BAA0B;EAA1BA,0BAA0B;EAA1BA,0BAA0B;EAA1BA,0BAA0B;EAA1BA,0BAA0B;EAA1BA,0BAA0B;EAA1BA,0BAA0B;EAAA,OAA1BA,0BAA0B;AAAA","ignoreList":[]}
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+
3
+ var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
4
+ var _Object$keys = require("@babel/runtime-corejs2/core-js/object/keys");
5
+ _Object$defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ var _request = require("./request");
9
+ _Object$keys(_request).forEach(function (key) {
10
+ if (key === "default" || key === "__esModule") return;
11
+ if (key in exports && exports[key] === _request[key]) return;
12
+ _Object$defineProperty(exports, key, {
13
+ enumerable: true,
14
+ get: function get() {
15
+ return _request[key];
16
+ }
17
+ });
18
+ });
19
+ var _types = require("./types");
20
+ _Object$keys(_types).forEach(function (key) {
21
+ if (key === "default" || key === "__esModule") return;
22
+ if (key in exports && exports[key] === _types[key]) return;
23
+ _Object$defineProperty(exports, key, {
24
+ enumerable: true,
25
+ get: function get() {
26
+ return _types[key];
27
+ }
28
+ });
29
+ });
30
+ var _mobiusSocketMapper = require("./mobiusSocketMapper");
31
+ _Object$keys(_mobiusSocketMapper).forEach(function (key) {
32
+ if (key === "default" || key === "__esModule") return;
33
+ if (key in exports && exports[key] === _mobiusSocketMapper[key]) return;
34
+ _Object$defineProperty(exports, key, {
35
+ enumerable: true,
36
+ get: function get() {
37
+ return _mobiusSocketMapper[key];
38
+ }
39
+ });
40
+ });
41
+ var _constants = require("./constants");
42
+ _Object$keys(_constants).forEach(function (key) {
43
+ if (key === "default" || key === "__esModule") return;
44
+ if (key in exports && exports[key] === _constants[key]) return;
45
+ _Object$defineProperty(exports, key, {
46
+ enumerable: true,
47
+ get: function get() {
48
+ return _constants[key];
49
+ }
50
+ });
51
+ });
52
+ var _wsFeatureFlag = require("./wsFeatureFlag");
53
+ _Object$keys(_wsFeatureFlag).forEach(function (key) {
54
+ if (key === "default" || key === "__esModule") return;
55
+ if (key in exports && exports[key] === _wsFeatureFlag[key]) return;
56
+ _Object$defineProperty(exports, key, {
57
+ enumerable: true,
58
+ get: function get() {
59
+ return _wsFeatureFlag[key];
60
+ }
61
+ });
62
+ });
63
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_request","require","_Object$keys","forEach","key","exports","_Object$defineProperty","enumerable","get","_types","_mobiusSocketMapper","_constants","_wsFeatureFlag"],"sources":["index.ts"],"sourcesContent":["export * from './request';\nexport * from './types';\nexport * from './mobiusSocketMapper';\nexport * from './constants';\nexport * from './wsFeatureFlag';\n"],"mappings":";;;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAAAC,YAAA,CAAAF,QAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAJ,QAAA,CAAAI,GAAA;EAAAE,sBAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAR,QAAA,CAAAI,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,MAAA,GAAAR,OAAA;AAAAC,YAAA,CAAAO,MAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,MAAA,CAAAL,GAAA;EAAAE,sBAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAC,MAAA,CAAAL,GAAA;IAAA;EAAA;AAAA;AACA,IAAAM,mBAAA,GAAAT,OAAA;AAAAC,YAAA,CAAAQ,mBAAA,EAAAP,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAM,mBAAA,CAAAN,GAAA;EAAAE,sBAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAE,mBAAA,CAAAN,GAAA;IAAA;EAAA;AAAA;AACA,IAAAO,UAAA,GAAAV,OAAA;AAAAC,YAAA,CAAAS,UAAA,EAAAR,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAO,UAAA,CAAAP,GAAA;EAAAE,sBAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAG,UAAA,CAAAP,GAAA;IAAA;EAAA;AAAA;AACA,IAAAQ,cAAA,GAAAX,OAAA;AAAAC,YAAA,CAAAU,cAAA,EAAAT,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAQ,cAAA,CAAAR,GAAA;EAAAE,sBAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAI,cAAA,CAAAR,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
@@ -0,0 +1,106 @@
1
+ "use strict";
2
+
3
+ var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
4
+ _Object$defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.deriveMobiusSocketMessageType = deriveMobiusSocketMessageType;
8
+ var _types = require("../../common/types");
9
+ var _constants = require("./constants");
10
+ /**
11
+ * Derives the Mobius Socket message type from the URI and HTTP method.
12
+ * Uses both the URI path pattern and the HTTP method to disambiguate operations
13
+ * that share the same endpoint (e.g., PATCH vs DELETE on calls/{callId}).
14
+ *
15
+ * @param uri - The request URI
16
+ * @param httpMethodType - The HTTP method used for the request
17
+ * @returns The socket message type based on the URI pattern and HTTP method
18
+ *
19
+ * @example
20
+ * deriveMobiusSocketMessageType('/api/v1/calling/web/device', HTTP_METHODS.POST)
21
+ * // returns 'register'
22
+ *
23
+ * deriveMobiusSocketMessageType('/api/v1/calling/web/devices/abc123/calls/xyz789', HTTP_METHODS.PATCH)
24
+ * // returns 'call_state'
25
+ *
26
+ * deriveMobiusSocketMessageType('/api/v1/calling/web/devices/abc123/calls/xyz789', HTTP_METHODS.DELETE)
27
+ * // returns 'call_delete'
28
+ */
29
+ // eslint-disable-next-line import/prefer-default-export
30
+ function deriveMobiusSocketMessageType(uri, httpMethodType) {
31
+ if (!uri) {
32
+ return _constants.MOBIUS_SOCKET_MESSAGE_TYPE.UNKNOWN;
33
+ }
34
+
35
+ // --- Supplementary services: .../services/{service}/{action} ---
36
+ if (uri.includes('/services')) {
37
+ if (uri.includes('/callhold/hold')) {
38
+ return _constants.MOBIUS_SOCKET_MESSAGE_TYPE.CALL_HOLD;
39
+ }
40
+ if (uri.includes('/callhold/resume')) {
41
+ return _constants.MOBIUS_SOCKET_MESSAGE_TYPE.CALL_RESUME;
42
+ }
43
+ if (uri.includes('/calltransfer/commit')) {
44
+ return _constants.MOBIUS_SOCKET_MESSAGE_TYPE.CALL_TRANSFER;
45
+ }
46
+ return _constants.MOBIUS_SOCKET_MESSAGE_TYPE.UNKNOWN;
47
+ }
48
+
49
+ // --- Call sub-resource actions (checked before bare calls/{callId}) ---
50
+
51
+ // Call media: .../calls/{callId}/media
52
+ if (uri.includes('/calls/') && uri.includes('/media')) {
53
+ return _constants.MOBIUS_SOCKET_MESSAGE_TYPE.CALL_MEDIA;
54
+ }
55
+
56
+ // Call status: .../calls/{callId}/status
57
+ if (uri.includes('/calls/') && uri.includes('/status')) {
58
+ return _constants.MOBIUS_SOCKET_MESSAGE_TYPE.CALL_STATUS;
59
+ }
60
+
61
+ // Call state or delete: .../calls/{callId} (PATCH → state, DELETE → delete)
62
+ if (uri.match(/\/calls\/[^/]+$/)) {
63
+ if (httpMethodType === _types.HTTP_METHODS.PATCH) {
64
+ return _constants.MOBIUS_SOCKET_MESSAGE_TYPE.CALL_STATE;
65
+ }
66
+ if (httpMethodType === _types.HTTP_METHODS.DELETE) {
67
+ return _constants.MOBIUS_SOCKET_MESSAGE_TYPE.CALL_DELETE;
68
+ }
69
+ return _constants.MOBIUS_SOCKET_MESSAGE_TYPE.UNKNOWN;
70
+ }
71
+
72
+ // Call setup: .../devices/{deviceId}/call (singular)
73
+ if (uri.endsWith('/call')) {
74
+ return _constants.MOBIUS_SOCKET_MESSAGE_TYPE.CALL_SETUP;
75
+ }
76
+
77
+ // --- Device-level operations ---
78
+
79
+ // Device keepalive: .../devices/{deviceId}/status (no /calls/ in path)
80
+ if (uri.includes('/devices/') && uri.endsWith('/status')) {
81
+ return _constants.MOBIUS_SOCKET_MESSAGE_TYPE.DEVICE_STATUS;
82
+ }
83
+
84
+ // Device registration: .../calling/web/device (singular)
85
+ if (uri.endsWith('/device')) {
86
+ return _constants.MOBIUS_SOCKET_MESSAGE_TYPE.REGISTER;
87
+ }
88
+
89
+ // Device unregister or get: .../devices/{deviceId} (DELETE → unregister, GET → device_get)
90
+ if (uri.match(/\/devices\/[^/?]+$/) && !uri.includes('/calls')) {
91
+ if (httpMethodType === _types.HTTP_METHODS.DELETE) {
92
+ return _constants.MOBIUS_SOCKET_MESSAGE_TYPE.UNREGISTER;
93
+ }
94
+ if (httpMethodType === _types.HTTP_METHODS.GET) {
95
+ return _constants.MOBIUS_SOCKET_MESSAGE_TYPE.DEVICE_GET;
96
+ }
97
+ return _constants.MOBIUS_SOCKET_MESSAGE_TYPE.UNKNOWN;
98
+ }
99
+
100
+ // Device list: .../devices or .../devices?userid=...
101
+ if (uri.includes('/devices') && !uri.match(/\/devices\/[^/?]+/)) {
102
+ return _constants.MOBIUS_SOCKET_MESSAGE_TYPE.DEVICE_LIST;
103
+ }
104
+ return _constants.MOBIUS_SOCKET_MESSAGE_TYPE.UNKNOWN;
105
+ }
106
+ //# sourceMappingURL=mobiusSocketMapper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_types","require","_constants","deriveMobiusSocketMessageType","uri","httpMethodType","MOBIUS_SOCKET_MESSAGE_TYPE","UNKNOWN","includes","CALL_HOLD","CALL_RESUME","CALL_TRANSFER","CALL_MEDIA","CALL_STATUS","match","HTTP_METHODS","PATCH","CALL_STATE","DELETE","CALL_DELETE","endsWith","CALL_SETUP","DEVICE_STATUS","REGISTER","UNREGISTER","GET","DEVICE_GET","DEVICE_LIST"],"sources":["mobiusSocketMapper.ts"],"sourcesContent":["import {HTTP_METHODS} from '../../common/types';\nimport {MOBIUS_SOCKET_MESSAGE_TYPE} from './constants';\n\n/**\n * Derives the Mobius Socket message type from the URI and HTTP method.\n * Uses both the URI path pattern and the HTTP method to disambiguate operations\n * that share the same endpoint (e.g., PATCH vs DELETE on calls/{callId}).\n *\n * @param uri - The request URI\n * @param httpMethodType - The HTTP method used for the request\n * @returns The socket message type based on the URI pattern and HTTP method\n *\n * @example\n * deriveMobiusSocketMessageType('/api/v1/calling/web/device', HTTP_METHODS.POST)\n * // returns 'register'\n *\n * deriveMobiusSocketMessageType('/api/v1/calling/web/devices/abc123/calls/xyz789', HTTP_METHODS.PATCH)\n * // returns 'call_state'\n *\n * deriveMobiusSocketMessageType('/api/v1/calling/web/devices/abc123/calls/xyz789', HTTP_METHODS.DELETE)\n * // returns 'call_delete'\n */\n// eslint-disable-next-line import/prefer-default-export\nexport function deriveMobiusSocketMessageType(\n uri?: string,\n httpMethodType?: HTTP_METHODS\n): MOBIUS_SOCKET_MESSAGE_TYPE {\n if (!uri) {\n return MOBIUS_SOCKET_MESSAGE_TYPE.UNKNOWN;\n }\n\n // --- Supplementary services: .../services/{service}/{action} ---\n if (uri.includes('/services')) {\n if (uri.includes('/callhold/hold')) {\n return MOBIUS_SOCKET_MESSAGE_TYPE.CALL_HOLD;\n }\n if (uri.includes('/callhold/resume')) {\n return MOBIUS_SOCKET_MESSAGE_TYPE.CALL_RESUME;\n }\n if (uri.includes('/calltransfer/commit')) {\n return MOBIUS_SOCKET_MESSAGE_TYPE.CALL_TRANSFER;\n }\n\n return MOBIUS_SOCKET_MESSAGE_TYPE.UNKNOWN;\n }\n\n // --- Call sub-resource actions (checked before bare calls/{callId}) ---\n\n // Call media: .../calls/{callId}/media\n if (uri.includes('/calls/') && uri.includes('/media')) {\n return MOBIUS_SOCKET_MESSAGE_TYPE.CALL_MEDIA;\n }\n\n // Call status: .../calls/{callId}/status\n if (uri.includes('/calls/') && uri.includes('/status')) {\n return MOBIUS_SOCKET_MESSAGE_TYPE.CALL_STATUS;\n }\n\n // Call state or delete: .../calls/{callId} (PATCH → state, DELETE → delete)\n if (uri.match(/\\/calls\\/[^/]+$/)) {\n if (httpMethodType === HTTP_METHODS.PATCH) {\n return MOBIUS_SOCKET_MESSAGE_TYPE.CALL_STATE;\n }\n if (httpMethodType === HTTP_METHODS.DELETE) {\n return MOBIUS_SOCKET_MESSAGE_TYPE.CALL_DELETE;\n }\n\n return MOBIUS_SOCKET_MESSAGE_TYPE.UNKNOWN;\n }\n\n // Call setup: .../devices/{deviceId}/call (singular)\n if (uri.endsWith('/call')) {\n return MOBIUS_SOCKET_MESSAGE_TYPE.CALL_SETUP;\n }\n\n // --- Device-level operations ---\n\n // Device keepalive: .../devices/{deviceId}/status (no /calls/ in path)\n if (uri.includes('/devices/') && uri.endsWith('/status')) {\n return MOBIUS_SOCKET_MESSAGE_TYPE.DEVICE_STATUS;\n }\n\n // Device registration: .../calling/web/device (singular)\n if (uri.endsWith('/device')) {\n return MOBIUS_SOCKET_MESSAGE_TYPE.REGISTER;\n }\n\n // Device unregister or get: .../devices/{deviceId} (DELETE → unregister, GET → device_get)\n if (uri.match(/\\/devices\\/[^/?]+$/) && !uri.includes('/calls')) {\n if (httpMethodType === HTTP_METHODS.DELETE) {\n return MOBIUS_SOCKET_MESSAGE_TYPE.UNREGISTER;\n }\n if (httpMethodType === HTTP_METHODS.GET) {\n return MOBIUS_SOCKET_MESSAGE_TYPE.DEVICE_GET;\n }\n\n return MOBIUS_SOCKET_MESSAGE_TYPE.UNKNOWN;\n }\n\n // Device list: .../devices or .../devices?userid=...\n if (uri.includes('/devices') && !uri.match(/\\/devices\\/[^/?]+/)) {\n return MOBIUS_SOCKET_MESSAGE_TYPE.DEVICE_LIST;\n }\n\n return MOBIUS_SOCKET_MESSAGE_TYPE.UNKNOWN;\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASE,6BAA6BA,CAC3CC,GAAY,EACZC,cAA6B,EACD;EAC5B,IAAI,CAACD,GAAG,EAAE;IACR,OAAOE,qCAA0B,CAACC,OAAO;EAC3C;;EAEA;EACA,IAAIH,GAAG,CAACI,QAAQ,CAAC,WAAW,CAAC,EAAE;IAC7B,IAAIJ,GAAG,CAACI,QAAQ,CAAC,gBAAgB,CAAC,EAAE;MAClC,OAAOF,qCAA0B,CAACG,SAAS;IAC7C;IACA,IAAIL,GAAG,CAACI,QAAQ,CAAC,kBAAkB,CAAC,EAAE;MACpC,OAAOF,qCAA0B,CAACI,WAAW;IAC/C;IACA,IAAIN,GAAG,CAACI,QAAQ,CAAC,sBAAsB,CAAC,EAAE;MACxC,OAAOF,qCAA0B,CAACK,aAAa;IACjD;IAEA,OAAOL,qCAA0B,CAACC,OAAO;EAC3C;;EAEA;;EAEA;EACA,IAAIH,GAAG,CAACI,QAAQ,CAAC,SAAS,CAAC,IAAIJ,GAAG,CAACI,QAAQ,CAAC,QAAQ,CAAC,EAAE;IACrD,OAAOF,qCAA0B,CAACM,UAAU;EAC9C;;EAEA;EACA,IAAIR,GAAG,CAACI,QAAQ,CAAC,SAAS,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,OAAOR,qCAA0B,CAACqB,WAAW;EAC/C;EAEA,OAAOrB,qCAA0B,CAACC,OAAO;AAC3C","ignoreList":[]}
@@ -0,0 +1,267 @@
1
+ "use strict";
2
+
3
+ var _Object$keys = require("@babel/runtime-corejs2/core-js/object/keys");
4
+ var _Object$getOwnPropertySymbols = require("@babel/runtime-corejs2/core-js/object/get-own-property-symbols");
5
+ var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs2/core-js/object/get-own-property-descriptor");
6
+ var _Object$getOwnPropertyDescriptors = require("@babel/runtime-corejs2/core-js/object/get-own-property-descriptors");
7
+ var _Object$defineProperties = require("@babel/runtime-corejs2/core-js/object/define-properties");
8
+ var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
9
+ var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
10
+ _Object$defineProperty(exports, "__esModule", {
11
+ value: true
12
+ });
13
+ exports.createAPIRequest = exports.APIRequest = void 0;
14
+ var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs2/regenerator"));
15
+ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/asyncToGenerator"));
16
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));
17
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));
18
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
19
+ var _uuid = require("uuid");
20
+ var _internalPluginMobiusSocket = require("@webex/internal-plugin-mobius-socket");
21
+ var _Logger = _interopRequireDefault(require("../../Logger"));
22
+ var _mobiusSocketMapper = require("./mobiusSocketMapper");
23
+ var _constants = require("./constants");
24
+ var _wsFeatureFlag = require("./wsFeatureFlag");
25
+ var _constants2 = require("../constants");
26
+ function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
27
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; } // @ts-ignore - JS module without type declarations
28
+ /**
29
+ * Converts a MobiusSocketResponse into the WebexRequestPayload shape that
30
+ * all callers (registration, call, keepalive error-handlers) expect.
31
+ */
32
+ function normalizeWsResponse(wsResponse) {
33
+ var _ref, _ref2;
34
+ return {
35
+ statusCode: wsResponse.statusCode,
36
+ body: (_ref = wsResponse.data) !== null && _ref !== void 0 ? _ref : undefined,
37
+ headers: _objectSpread({
38
+ trackingid: wsResponse.trackingId
39
+ }, (_ref2 = wsResponse.metadata) !== null && _ref2 !== void 0 ? _ref2 : {})
40
+ };
41
+ }
42
+
43
+ /**
44
+ * Converts a MobiusSocketResponseError rejection into a WebexRequestPayload-shaped
45
+ * error so handleRegistrationErrors / handleCallErrors can process it identically.
46
+ */
47
+ function normalizeWsError(err) {
48
+ var _ref3, _wsErr$response, _ref4, _wsErr$trackingId, _wsErr$response2, _ref5, _wsErr$response3;
49
+ var wsErr = err;
50
+ return {
51
+ statusCode: wsErr.statusCode,
52
+ body: (_ref3 = (_wsErr$response = wsErr.response) === null || _wsErr$response === void 0 ? void 0 : _wsErr$response.data) !== null && _ref3 !== void 0 ? _ref3 : undefined,
53
+ headers: _objectSpread({
54
+ trackingid: (_ref4 = (_wsErr$trackingId = wsErr.trackingId) !== null && _wsErr$trackingId !== void 0 ? _wsErr$trackingId : (_wsErr$response2 = wsErr.response) === null || _wsErr$response2 === void 0 ? void 0 : _wsErr$response2.trackingId) !== null && _ref4 !== void 0 ? _ref4 : ''
55
+ }, (_ref5 = (_wsErr$response3 = wsErr.response) === null || _wsErr$response3 === void 0 ? void 0 : _wsErr$response3.metadata) !== null && _ref5 !== void 0 ? _ref5 : {})
56
+ };
57
+ }
58
+
59
+ /**
60
+ * APIRequest routes Mobius traffic over HTTP (`webex.request`) or the Mobius WebSocket path
61
+ * (`mobiusSocketRequest`). `isMobiusSocketEnabled` is set in the constructor from WDM
62
+ * `webrtc-calling-over-ws` and/or SDK config (interim until WDM is fully in prod).
63
+ */
64
+ var APIRequest = exports.APIRequest = /*#__PURE__*/function () {
65
+ /**
66
+ * @param config - Webex instance plus optional SDK Mobius-socket override
67
+ */
68
+ function APIRequest(config) {
69
+ var _config$isMobiusSocke;
70
+ (0, _classCallCheck2.default)(this, APIRequest);
71
+ (0, _defineProperty2.default)(this, "isMobiusSocketEnabled", void 0);
72
+ (0, _defineProperty2.default)(this, "webex", void 0);
73
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
74
+ (0, _defineProperty2.default)(this, "mobiusSocket", void 0);
75
+ if (!config.webex) {
76
+ throw new Error('WebexSDK instance is required');
77
+ }
78
+ this.webex = config.webex;
79
+ this.isMobiusSocketEnabled = (0, _wsFeatureFlag.isMobiusWssEnabled)(config.webex) || ((_config$isMobiusSocke = config.isMobiusSocketEnabled) !== null && _config$isMobiusSocke !== void 0 ? _config$isMobiusSocke : false);
80
+ this.mobiusSocket = (0, _internalPluginMobiusSocket.getMobiusSocketInstance)(this.webex);
81
+ }
82
+
83
+ /**
84
+ * Whether the Mobius WebSocket transport is active for this instance.
85
+ */
86
+ return (0, _createClass2.default)(APIRequest, [{
87
+ key: "isSocketEnabled",
88
+ value: function isSocketEnabled() {
89
+ return this.isMobiusSocketEnabled;
90
+ }
91
+
92
+ /**
93
+ * Ensures the Mobius WebSocket is connected before sending API requests.
94
+ * If the socket is already connected, resolves immediately. Otherwise,
95
+ * initiates a new connection to the provided WebSocket URL.
96
+ * On failure, throws a normalized WebexRequestPayload-shaped error.
97
+ *
98
+ * @param wssUrl - The Mobius WebSocket URL to connect to.
99
+ */
100
+ }, {
101
+ key: "connectToMobiusSocket",
102
+ value: (function () {
103
+ var _connectToMobiusSocket = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee(wssUrl) {
104
+ var logContext, _t;
105
+ return _regenerator.default.wrap(function (_context) {
106
+ while (1) switch (_context.prev = _context.next) {
107
+ case 0:
108
+ logContext = {
109
+ file: _constants2.REQUEST_FILE,
110
+ method: _constants2.METHODS.CONNECT_TO_MOBIUS_SOCKET
111
+ };
112
+ if (!this.mobiusSocket.isConnected()) {
113
+ _context.next = 1;
114
+ break;
115
+ }
116
+ _Logger.default.info('Mobius WebSocket already connected', logContext);
117
+ return _context.abrupt("return");
118
+ case 1:
119
+ _Logger.default.info('Mobius WebSocket not connected, initiating connection', logContext);
120
+ _context.prev = 2;
121
+ _context.next = 3;
122
+ return this.mobiusSocket.connect(wssUrl);
123
+ case 3:
124
+ _Logger.default.log('Mobius WebSocket connected successfully', logContext);
125
+ _context.next = 5;
126
+ break;
127
+ case 4:
128
+ _context.prev = 4;
129
+ _t = _context["catch"](2);
130
+ _Logger.default.warn("Mobius WebSocket connection failed: ".concat(String(_t)), logContext);
131
+ throw normalizeWsError(_t);
132
+ case 5:
133
+ case "end":
134
+ return _context.stop();
135
+ }
136
+ }, _callee, this, [[2, 4]]);
137
+ }));
138
+ function connectToMobiusSocket(_x) {
139
+ return _connectToMobiusSocket.apply(this, arguments);
140
+ }
141
+ return connectToMobiusSocket;
142
+ }()
143
+ /**
144
+ * Disconnects the default session from the Mobius WebSocket.
145
+ */
146
+ )
147
+ }, {
148
+ key: "disconnectFromMobiusSocket",
149
+ value: (function () {
150
+ var _disconnectFromMobiusSocket = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee2(options) {
151
+ var logContext, _t2;
152
+ return _regenerator.default.wrap(function (_context2) {
153
+ while (1) switch (_context2.prev = _context2.next) {
154
+ case 0:
155
+ logContext = {
156
+ file: _constants2.REQUEST_FILE,
157
+ method: 'disconnectFromMobiusSocket'
158
+ };
159
+ _context2.prev = 1;
160
+ _context2.next = 2;
161
+ return this.mobiusSocket.disconnect(options);
162
+ case 2:
163
+ _Logger.default.log('Mobius WebSocket disconnected successfully', logContext);
164
+ _context2.next = 4;
165
+ break;
166
+ case 3:
167
+ _context2.prev = 3;
168
+ _t2 = _context2["catch"](1);
169
+ // silent error - no need to throw an error
170
+ _Logger.default.warn("Mobius WebSocket disconnection failed: ".concat(String(_t2)), logContext);
171
+ case 4:
172
+ case "end":
173
+ return _context2.stop();
174
+ }
175
+ }, _callee2, this, [[1, 3]]);
176
+ }));
177
+ function disconnectFromMobiusSocket(_x2) {
178
+ return _disconnectFromMobiusSocket.apply(this, arguments);
179
+ }
180
+ return disconnectFromMobiusSocket;
181
+ }()
182
+ /**
183
+ * Makes a request using HTTP or WebSocket transport per the flag set in the constructor.
184
+ * When using WebSocket, the response is normalized to the WebexRequestPayload shape
185
+ * so callers do not need to know which transport was used.
186
+ * @param request - Request options (uri, method, body, headers, service)
187
+ * @returns Promise resolving to WebexRequestPayload
188
+ */
189
+ )
190
+ }, {
191
+ key: "makeRequest",
192
+ value: (function () {
193
+ var _makeRequest = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee3(request) {
194
+ var trackingId, socketType, wsResponse, _t3;
195
+ return _regenerator.default.wrap(function (_context3) {
196
+ while (1) switch (_context3.prev = _context3.next) {
197
+ case 0:
198
+ if (!this.isMobiusSocketEnabled) {
199
+ _context3.next = 4;
200
+ break;
201
+ }
202
+ trackingId = "webex-js-sdk_".concat((0, _uuid.v4)());
203
+ socketType = (0, _mobiusSocketMapper.deriveMobiusSocketMessageType)(request.uri, request.method);
204
+ if (!(socketType === _constants.MOBIUS_SOCKET_MESSAGE_TYPE.UNKNOWN)) {
205
+ _context3.next = 1;
206
+ break;
207
+ }
208
+ throw new Error("Unknown Mobius Socket message type: ".concat(socketType));
209
+ case 1:
210
+ _context3.prev = 1;
211
+ _context3.next = 2;
212
+ return this.mobiusSocket.sendWssRequest({
213
+ type: socketType,
214
+ trackingId: trackingId,
215
+ metadata: {
216
+ // userAgent: CALLING_USER_AGENT,
217
+ userAgent: 'mobius-ws-test-ui' // TODO: Confirm if this needs to be hardcoded
218
+ },
219
+ // TODO: Add auth token to metadata for call transfer etc
220
+ data: request.body
221
+ });
222
+ case 2:
223
+ wsResponse = _context3.sent;
224
+ return _context3.abrupt("return", normalizeWsResponse(wsResponse));
225
+ case 3:
226
+ _context3.prev = 3;
227
+ _t3 = _context3["catch"](1);
228
+ throw normalizeWsError(_t3);
229
+ case 4:
230
+ return _context3.abrupt("return", this.webex.request(request));
231
+ case 5:
232
+ case "end":
233
+ return _context3.stop();
234
+ }
235
+ }, _callee3, this, [[1, 3]]);
236
+ }));
237
+ function makeRequest(_x3) {
238
+ return _makeRequest.apply(this, arguments);
239
+ }
240
+ return makeRequest;
241
+ }())
242
+ }], [{
243
+ key: "getInstance",
244
+ value: function getInstance(config) {
245
+ if (!APIRequest.instance) {
246
+ APIRequest.instance = new APIRequest(config);
247
+ }
248
+ return APIRequest.instance;
249
+ }
250
+ }, {
251
+ key: "resetInstance",
252
+ value: function resetInstance() {
253
+ APIRequest.instance = undefined;
254
+ }
255
+ }]);
256
+ }();
257
+ /**
258
+ * Factory function to create a singleton APIRequest instance
259
+ * @param config - Configuration object for APIRequest
260
+ * @returns APIRequest instance
261
+ */
262
+ // eslint-disable-next-line no-use-before-define
263
+ (0, _defineProperty2.default)(APIRequest, "instance", void 0);
264
+ var createAPIRequest = exports.createAPIRequest = function createAPIRequest(config) {
265
+ return APIRequest.getInstance(config);
266
+ };
267
+ //# sourceMappingURL=request.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_uuid","require","_internalPluginMobiusSocket","_Logger","_interopRequireDefault","_mobiusSocketMapper","_constants","_wsFeatureFlag","_constants2","ownKeys","e","r","t","_Object$keys","_Object$getOwnPropertySymbols","o","filter","_Object$getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","Object","forEach","_defineProperty2","default","_Object$getOwnPropertyDescriptors","_Object$defineProperties","_Object$defineProperty","normalizeWsResponse","wsResponse","_ref","_ref2","statusCode","body","data","undefined","headers","trackingid","trackingId","metadata","normalizeWsError","err","_ref3","_wsErr$response","_ref4","_wsErr$trackingId","_wsErr$response2","_ref5","_wsErr$response3","wsErr","response","APIRequest","exports","config","_config$isMobiusSocke","_classCallCheck2","webex","Error","isMobiusSocketEnabled","isMobiusWssEnabled","mobiusSocket","getMobiusSocketInstance","_createClass2","key","value","isSocketEnabled","_connectToMobiusSocket","_asyncToGenerator2","_regenerator","mark","_callee","wssUrl","logContext","_t","wrap","_context","prev","next","file","REQUEST_FILE","method","METHODS","CONNECT_TO_MOBIUS_SOCKET","isConnected","log","info","abrupt","connect","warn","concat","String","stop","connectToMobiusSocket","_x","_disconnectFromMobiusSocket","_callee2","options","_t2","_context2","disconnect","disconnectFromMobiusSocket","_x2","_makeRequest","_callee3","request","socketType","_t3","_context3","uuid","deriveMobiusSocketMessageType","uri","MOBIUS_SOCKET_MESSAGE_TYPE","UNKNOWN","sendWssRequest","type","userAgent","sent","makeRequest","_x3","getInstance","instance","resetInstance","createAPIRequest"],"sources":["request.ts"],"sourcesContent":["import {v4 as uuid} from 'uuid';\n// @ts-ignore - JS module without type declarations\nimport {getMobiusSocketInstance} from '@webex/internal-plugin-mobius-socket';\nimport {WebexRequestPayload} from '../../common/types';\nimport {WebexSDK} from '../../SDKConnector/types';\nimport log from '../../Logger';\nimport {APIRequestConfig, APIRequestOptions, MobiusSocketResponse} from './types';\nimport {deriveMobiusSocketMessageType} from './mobiusSocketMapper';\nimport {MOBIUS_SOCKET_MESSAGE_TYPE} from './constants';\nimport {isMobiusWssEnabled} from './wsFeatureFlag';\nimport {METHODS, REQUEST_FILE} from '../constants';\n\n/**\n * Converts a MobiusSocketResponse into the WebexRequestPayload shape that\n * all callers (registration, call, keepalive error-handlers) expect.\n */\nfunction normalizeWsResponse(wsResponse: MobiusSocketResponse): WebexRequestPayload {\n return {\n statusCode: wsResponse.statusCode,\n body: (wsResponse.data as object) ?? undefined,\n headers: {\n trackingid: wsResponse.trackingId,\n ...((wsResponse.metadata as Record<string, string>) ?? {}),\n },\n };\n}\n\n/**\n * Converts a MobiusSocketResponseError rejection into a WebexRequestPayload-shaped\n * error so handleRegistrationErrors / handleCallErrors can process it identically.\n */\nfunction normalizeWsError(err: unknown): WebexRequestPayload {\n const wsErr = err as {\n statusCode?: number;\n statusMessage?: string;\n response?: MobiusSocketResponse;\n trackingId?: string;\n };\n\n return {\n statusCode: wsErr.statusCode,\n body: (wsErr.response?.data as object) ?? undefined,\n headers: {\n trackingid: wsErr.trackingId ?? wsErr.response?.trackingId ?? '',\n ...((wsErr.response?.metadata as Record<string, string>) ?? {}),\n },\n };\n}\n\n/**\n * APIRequest routes Mobius traffic over HTTP (`webex.request`) or the Mobius WebSocket path\n * (`mobiusSocketRequest`). `isMobiusSocketEnabled` is set in the constructor from WDM\n * `webrtc-calling-over-ws` and/or SDK config (interim until WDM is fully in prod).\n */\nexport class APIRequest {\n // eslint-disable-next-line no-use-before-define\n private static instance: APIRequest | undefined;\n private isMobiusSocketEnabled: boolean;\n private webex: WebexSDK;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private mobiusSocket: any;\n\n static getInstance(config: APIRequestConfig): APIRequest {\n if (!APIRequest.instance) {\n APIRequest.instance = new APIRequest(config);\n }\n\n return APIRequest.instance;\n }\n\n static resetInstance(): void {\n APIRequest.instance = undefined;\n }\n\n /**\n * @param config - Webex instance plus optional SDK Mobius-socket override\n */\n constructor(config: APIRequestConfig) {\n if (!config.webex) {\n throw new Error('WebexSDK instance is required');\n }\n\n this.webex = config.webex;\n this.isMobiusSocketEnabled =\n isMobiusWssEnabled(config.webex) || (config.isMobiusSocketEnabled ?? false);\n this.mobiusSocket = getMobiusSocketInstance(this.webex);\n }\n\n /**\n * Whether the Mobius WebSocket transport is active for this instance.\n */\n public isSocketEnabled(): boolean {\n return this.isMobiusSocketEnabled;\n }\n\n /**\n * Ensures the Mobius WebSocket is connected before sending API requests.\n * If the socket is already connected, resolves immediately. Otherwise,\n * initiates a new connection to the provided WebSocket URL.\n * On failure, throws a normalized WebexRequestPayload-shaped error.\n *\n * @param wssUrl - The Mobius WebSocket URL to connect to.\n */\n public async connectToMobiusSocket(wssUrl: string): Promise<void> {\n const logContext = {\n file: REQUEST_FILE,\n method: METHODS.CONNECT_TO_MOBIUS_SOCKET,\n };\n\n if (this.mobiusSocket.isConnected()) {\n log.info('Mobius WebSocket already connected', logContext);\n\n return;\n }\n\n log.info('Mobius WebSocket not connected, initiating connection', logContext);\n\n try {\n await this.mobiusSocket.connect(wssUrl);\n log.log('Mobius WebSocket connected successfully', logContext);\n } catch (err) {\n log.warn(`Mobius WebSocket connection failed: ${String(err)}`, logContext);\n throw normalizeWsError(err);\n }\n }\n\n /**\n * Disconnects the default session from the Mobius WebSocket.\n */\n public async disconnectFromMobiusSocket(options?: {code: number; reason: string}): Promise<void> {\n const logContext = {\n file: REQUEST_FILE,\n method: 'disconnectFromMobiusSocket',\n };\n\n try {\n await this.mobiusSocket.disconnect(options);\n log.log('Mobius WebSocket disconnected successfully', logContext);\n } catch (err) {\n // silent error - no need to throw an error\n log.warn(`Mobius WebSocket disconnection failed: ${String(err)}`, logContext);\n }\n }\n\n /**\n * Makes a request using HTTP or WebSocket transport per the flag set in the constructor.\n * When using WebSocket, the response is normalized to the WebexRequestPayload shape\n * so callers do not need to know which transport was used.\n * @param request - Request options (uri, method, body, headers, service)\n * @returns Promise resolving to WebexRequestPayload\n */\n public async makeRequest(request: APIRequestOptions): Promise<WebexRequestPayload> {\n if (this.isMobiusSocketEnabled) {\n const trackingId = `webex-js-sdk_${uuid()}`;\n const socketType = deriveMobiusSocketMessageType(request.uri, request.method);\n\n if (socketType === MOBIUS_SOCKET_MESSAGE_TYPE.UNKNOWN) {\n throw new Error(`Unknown Mobius Socket message type: ${socketType}`);\n }\n\n try {\n const wsResponse: MobiusSocketResponse = await this.mobiusSocket.sendWssRequest({\n type: socketType,\n trackingId,\n metadata: {\n // userAgent: CALLING_USER_AGENT,\n userAgent: 'mobius-ws-test-ui', // TODO: Confirm if this needs to be hardcoded\n }, // TODO: Add auth token to metadata for call transfer etc\n data: request.body,\n });\n\n return normalizeWsResponse(wsResponse);\n } catch (err) {\n throw normalizeWsError(err);\n }\n }\n\n return this.webex.request(request) as Promise<WebexRequestPayload>;\n }\n}\n\n/**\n * Factory function to create a singleton APIRequest instance\n * @param config - Configuration object for APIRequest\n * @returns APIRequest instance\n */\nexport const createAPIRequest = (config: APIRequestConfig): APIRequest =>\n APIRequest.getInstance(config);\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAEA,IAAAC,2BAAA,GAAAD,OAAA;AAGA,IAAAE,OAAA,GAAAC,sBAAA,CAAAH,OAAA;AAEA,IAAAI,mBAAA,GAAAJ,OAAA;AACA,IAAAK,UAAA,GAAAL,OAAA;AACA,IAAAM,cAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AAAmD,SAAAQ,QAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,GAAAC,YAAA,CAAAH,CAAA,OAAAI,6BAAA,QAAAC,CAAA,GAAAD,6BAAA,CAAAJ,CAAA,GAAAC,CAAA,KAAAI,CAAA,GAAAA,CAAA,CAAAC,MAAA,WAAAL,CAAA,WAAAM,gCAAA,CAAAP,CAAA,EAAAC,CAAA,EAAAO,UAAA,OAAAN,CAAA,CAAAO,IAAA,CAAAC,KAAA,CAAAR,CAAA,EAAAG,CAAA,YAAAH,CAAA;AAAA,SAAAS,cAAAX,CAAA,aAAAC,CAAA,MAAAA,CAAA,GAAAW,SAAA,CAAAC,MAAA,EAAAZ,CAAA,UAAAC,CAAA,WAAAU,SAAA,CAAAX,CAAA,IAAAW,SAAA,CA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