@webex/calling 3.12.0-webex-services-ready.4 → 3.13.0-next.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 (124) hide show
  1. package/dist/CallRecording/WxcCallRecordingConnector.js +345 -174
  2. package/dist/CallRecording/WxcCallRecordingConnector.js.map +1 -1
  3. package/dist/CallRecording/WxcCallRecordingConnector.test.js +354 -182
  4. package/dist/CallRecording/WxcCallRecordingConnector.test.js.map +1 -1
  5. package/dist/CallRecording/callRecordingFixtures.js +40 -9
  6. package/dist/CallRecording/callRecordingFixtures.js.map +1 -1
  7. package/dist/CallRecording/constants.js +12 -27
  8. package/dist/CallRecording/constants.js.map +1 -1
  9. package/dist/CallRecording/types.js +21 -16
  10. package/dist/CallRecording/types.js.map +1 -1
  11. package/dist/CallRecording/userhub.js +117 -0
  12. package/dist/CallRecording/userhub.js.map +1 -0
  13. package/dist/CallRecording/utils.js +3 -3
  14. package/dist/CallRecording/utils.js.map +1 -1
  15. package/dist/CallingClient/CallingClient.js +19 -13
  16. package/dist/CallingClient/CallingClient.js.map +1 -1
  17. package/dist/CallingClient/CallingClient.test.js +383 -185
  18. package/dist/CallingClient/CallingClient.test.js.map +1 -1
  19. package/dist/CallingClient/calling/CallerId/index.js +3 -1
  20. package/dist/CallingClient/calling/CallerId/index.js.map +1 -1
  21. package/dist/CallingClient/calling/CallerId/index.test.js +12 -2
  22. package/dist/CallingClient/calling/CallerId/index.test.js.map +1 -1
  23. package/dist/CallingClient/calling/call.js +15 -8
  24. package/dist/CallingClient/calling/call.js.map +1 -1
  25. package/dist/CallingClient/calling/call.test.js +617 -527
  26. package/dist/CallingClient/calling/call.test.js.map +1 -1
  27. package/dist/CallingClient/constants.js +5 -2
  28. package/dist/CallingClient/constants.js.map +1 -1
  29. package/dist/CallingClient/line/index.js +23 -2
  30. package/dist/CallingClient/line/index.js.map +1 -1
  31. package/dist/CallingClient/line/line.test.js +87 -17
  32. package/dist/CallingClient/line/line.test.js.map +1 -1
  33. package/dist/CallingClient/registration/register.js +559 -411
  34. package/dist/CallingClient/registration/register.js.map +1 -1
  35. package/dist/CallingClient/registration/register.test.js +646 -83
  36. package/dist/CallingClient/registration/register.test.js.map +1 -1
  37. package/dist/CallingClient/registration/types.js +26 -0
  38. package/dist/CallingClient/registration/types.js.map +1 -1
  39. package/dist/CallingClient/types.js.map +1 -1
  40. package/dist/Errors/types.js +2 -0
  41. package/dist/Errors/types.js.map +1 -1
  42. package/dist/Events/types.js.map +1 -1
  43. package/dist/SDKConnector/types.js.map +1 -1
  44. package/dist/common/Utils.js +124 -105
  45. package/dist/common/Utils.js.map +1 -1
  46. package/dist/common/Utils.test.js +346 -243
  47. package/dist/common/Utils.test.js.map +1 -1
  48. package/dist/common/callUtils.js +187 -0
  49. package/dist/common/callUtils.js.map +1 -0
  50. package/dist/common/callUtils.test.js +313 -0
  51. package/dist/common/callUtils.test.js.map +1 -0
  52. package/dist/common/constants.js +27 -1
  53. package/dist/common/constants.js.map +1 -1
  54. package/dist/common/index.js +11 -0
  55. package/dist/common/index.js.map +1 -1
  56. package/dist/common/testUtil.js +2 -1
  57. package/dist/common/testUtil.js.map +1 -1
  58. package/dist/mobius-socket/mobius-socket-events.test.js +1 -0
  59. package/dist/mobius-socket/mobius-socket-events.test.js.map +1 -1
  60. package/dist/mobius-socket/mobius-socket.test.js +12 -12
  61. package/dist/mobius-socket/mobius-socket.test.js.map +1 -1
  62. package/dist/mobius-socket/socket/socket-base.js +10 -0
  63. package/dist/mobius-socket/socket/socket-base.js.map +1 -1
  64. package/dist/mobius-socket/socket.test.js +34 -14
  65. package/dist/mobius-socket/socket.test.js.map +1 -1
  66. package/dist/module/CallRecording/WxcCallRecordingConnector.js +155 -63
  67. package/dist/module/CallRecording/callRecordingFixtures.js +38 -8
  68. package/dist/module/CallRecording/constants.js +11 -12
  69. package/dist/module/CallRecording/userhub.js +100 -0
  70. package/dist/module/CallingClient/CallingClient.js +12 -11
  71. package/dist/module/CallingClient/calling/CallerId/index.js +2 -2
  72. package/dist/module/CallingClient/calling/call.js +10 -3
  73. package/dist/module/CallingClient/constants.js +3 -0
  74. package/dist/module/CallingClient/line/index.js +9 -1
  75. package/dist/module/CallingClient/registration/register.js +69 -16
  76. package/dist/module/CallingClient/registration/types.js +5 -1
  77. package/dist/module/Errors/types.js +2 -0
  78. package/dist/module/common/Utils.js +43 -43
  79. package/dist/module/common/callUtils.js +90 -0
  80. package/dist/module/common/constants.js +11 -0
  81. package/dist/module/common/index.js +1 -0
  82. package/dist/module/common/testUtil.js +1 -0
  83. package/dist/module/mobius-socket/socket/socket-base.js +8 -0
  84. package/dist/types/CallRecording/WxcCallRecordingConnector.d.ts +6 -2
  85. package/dist/types/CallRecording/WxcCallRecordingConnector.d.ts.map +1 -1
  86. package/dist/types/CallRecording/callRecordingFixtures.d.ts +95 -4
  87. package/dist/types/CallRecording/callRecordingFixtures.d.ts.map +1 -1
  88. package/dist/types/CallRecording/constants.d.ts +11 -12
  89. package/dist/types/CallRecording/constants.d.ts.map +1 -1
  90. package/dist/types/CallRecording/types.d.ts +11 -3
  91. package/dist/types/CallRecording/types.d.ts.map +1 -1
  92. package/dist/types/CallRecording/userhub.d.ts +44 -0
  93. package/dist/types/CallRecording/userhub.d.ts.map +1 -0
  94. package/dist/types/CallingClient/CallingClient.d.ts.map +1 -1
  95. package/dist/types/CallingClient/calling/CallerId/index.d.ts.map +1 -1
  96. package/dist/types/CallingClient/calling/call.d.ts.map +1 -1
  97. package/dist/types/CallingClient/constants.d.ts +3 -0
  98. package/dist/types/CallingClient/constants.d.ts.map +1 -1
  99. package/dist/types/CallingClient/line/index.d.ts +2 -1
  100. package/dist/types/CallingClient/line/index.d.ts.map +1 -1
  101. package/dist/types/CallingClient/registration/register.d.ts +3 -1
  102. package/dist/types/CallingClient/registration/register.d.ts.map +1 -1
  103. package/dist/types/CallingClient/registration/types.d.ts +22 -0
  104. package/dist/types/CallingClient/registration/types.d.ts.map +1 -1
  105. package/dist/types/CallingClient/types.d.ts +2 -0
  106. package/dist/types/CallingClient/types.d.ts.map +1 -1
  107. package/dist/types/Errors/types.d.ts +2 -0
  108. package/dist/types/Errors/types.d.ts.map +1 -1
  109. package/dist/types/Events/types.d.ts +1 -1
  110. package/dist/types/Events/types.d.ts.map +1 -1
  111. package/dist/types/SDKConnector/types.d.ts +1 -0
  112. package/dist/types/SDKConnector/types.d.ts.map +1 -1
  113. package/dist/types/common/Utils.d.ts +4 -6
  114. package/dist/types/common/Utils.d.ts.map +1 -1
  115. package/dist/types/common/callUtils.d.ts +6 -0
  116. package/dist/types/common/callUtils.d.ts.map +1 -0
  117. package/dist/types/common/constants.d.ts +6 -0
  118. package/dist/types/common/constants.d.ts.map +1 -1
  119. package/dist/types/common/index.d.ts +1 -0
  120. package/dist/types/common/index.d.ts.map +1 -1
  121. package/dist/types/common/testUtil.d.ts +1 -0
  122. package/dist/types/common/testUtil.d.ts.map +1 -1
  123. package/dist/types/mobius-socket/socket/socket-base.d.ts.map +1 -1
  124. package/package.json +12 -11
@@ -1 +1 @@
1
- {"version":3,"names":["RecordingStatus","exports","AiGenerationStatus","RecordingRequestType"],"sources":["types.ts"],"sourcesContent":["import {Eventing} from '../Events/impl';\nimport {CallRecordingEventTypes} from '../Events/types';\nimport {LOGGER} from '../Logger/types';\n\nexport interface LoggerInterface {\n level: LOGGER;\n}\n\n/**\n * Status of a converged recording, used both as the response field and as the list filter.\n *\n * - `available`: the recording is available (default).\n * - `deleted`: the recording has been moved into the recycle bin.\n */\nexport enum RecordingStatus {\n AVAILABLE = 'available',\n DELETED = 'deleted',\n}\n\n/**\n * Status of an AI-generated artifact (summary / suggested notes / action items).\n */\nexport enum AiGenerationStatus {\n NOT_STARTED = 'NOT_STARTED',\n IN_PROGRESS = 'IN_PROGRESS',\n COMPLETED = 'COMPLETED',\n FAILED = 'FAILED',\n}\n\n/**\n * Which side of the call the recording owner was on, as reported by `serviceData.personality`:\n * - `originator`: the owner placed the call (the remote party is `calledParty`).\n * - `terminator`: the owner received the call (the remote party is `callingParty`).\n *\n * Use {@link getRemoteParty} to resolve the other party without having to branch on this manually.\n */\nexport type RecordingPersonality = 'originator' | 'terminator';\n\n/**\n * The acting entity behind a call party. For Webex users `type` is `USER` and `id` is the Webex\n * person UUID — the identifier accepted by the avatar (`@webex/internal-plugin-avatar`) and\n * presence (DSS) services. External/PSTN parties may have only a `number`/`name` on the parent\n * {@link RecordingParty} and no `actor.id`.\n */\nexport type RecordingActor = {\n type?: string;\n id?: string;\n email?: string;\n};\n\n/**\n * A party (calling or called) involved in the recorded call. `actor.id` is the resolvable person\n * UUID when the party is a Webex user; `number`/`name` are the dialable number and display name.\n */\nexport type RecordingParty = {\n actor?: RecordingActor;\n number?: string;\n name?: string;\n};\n\n/**\n * Service-specific data attached to a converged recording. For calling recordings this carries the\n * `locationId` and the `callSessionId` shared with the originating call session.\n *\n * The party details (`personality`, `callingParty`, `calledParty`) identify who the call was with\n * and are returned by the metadata endpoint (`GET /convergedRecordings/{recordingId}/metadata`);\n * the list endpoint only populates `locationId`/`callSessionId`. Resolve the remote participant's\n * person UUID (for avatar/presence) via `getRemoteParty(serviceData)?.actor?.id`.\n */\nexport type RecordingServiceData = {\n callRecordingId?: string;\n locationId?: string;\n callSessionId?: string;\n personality?: RecordingPersonality;\n callingParty?: RecordingParty;\n calledParty?: RecordingParty;\n [key: string]: unknown;\n};\n\n/**\n * Temporary, direct download links for a recording's media, returned by\n * `GET /convergedRecordings/{recordingId}`. Only available for authorized users / Compliance\n * Officers and absent when downloading is prevented.\n */\nexport type TemporaryDirectDownloadLinks = {\n audioDownloadLink?: string;\n transcriptDownloadLink?: string;\n expiration?: string;\n};\n\n/**\n * A converged recording as returned by `GET /convergedRecordings` (list `items[]`) and\n * `GET /convergedRecordings/{recordingId}`.\n *\n * Field mapping note (matches the public Webex Converged Recordings API):\n * - `id` is the recording id used by {@link ICallRecording.getRecording}.\n * - `serviceData.callSessionId` is the call session id used by\n * {@link ICallRecording.getRecordingsByCallSessionId}.\n */\nexport type Recording = {\n id: string;\n topic?: string;\n createTime?: string;\n timeRecorded?: string;\n format?: string;\n serviceType?: string;\n durationSeconds?: number;\n sizeBytes?: number;\n status?: RecordingStatus;\n ownerId?: string;\n ownerEmail?: string;\n ownerType?: string;\n storageRegion?: string;\n serviceData?: RecordingServiceData;\n temporaryDirectDownloadLinks?: TemporaryDirectDownloadLinks;\n};\n\n/**\n * Raw list response body returned by `GET /convergedRecordings`.\n */\nexport type RecordingListBody = {\n items?: Recording[];\n};\n\n/**\n * Metadata returned by `GET /convergedRecordings/{recordingUUID}/metadata`.\n * The structure is preserved as returned by the backend; optional typed fields are provided\n * for the well-known properties.\n */\nexport type RecordingMetadataOwner = {\n ownerID?: string;\n ownerEmail?: string;\n ownerName?: string;\n orgID?: string;\n};\n\nexport type RecordingMetadataParticipant = {\n id?: string;\n name?: string;\n email?: string;\n phoneNumber?: string;\n joinTime?: string;\n leaveTime?: string;\n};\n\nexport type RecordingMediaStream = {\n streamId?: string;\n type?: string;\n codec?: string;\n durationMS?: number;\n};\n\nexport type RecordingExtensionData = {\n callData?: Record<string, unknown>;\n acd?: Record<string, unknown>;\n redirectInfo?: Record<string, unknown>;\n};\n\nexport type RecordingMetadata = {\n id?: string;\n callSessionId?: string;\n owner?: RecordingMetadataOwner;\n session?: Record<string, unknown>;\n participants?: RecordingMetadataParticipant[];\n mediaStreams?: RecordingMediaStream[];\n extensionData?: RecordingExtensionData;\n /**\n * Service-specific data, including the call party details (`personality`, `callingParty`,\n * `calledParty`) used to resolve the remote participant for avatar/presence. See\n * {@link getRemoteParty}.\n */\n serviceData?: RecordingServiceData;\n [key: string]: unknown;\n};\n\n/**\n * Options for {@link ICallRecording.getRecordings}. All fields are optional and are passed through\n * to the recording API as query parameters where supported. `webexUserRequest` toggles the\n * `WebexUserRequest` header (ad-hoc rate-limit bypass), defaulting to `false`.\n */\nexport type GetRecordingsOptions = {\n /**\n * ISO-8601 start of the time window (inclusive). When omitted, it is derived from `days`\n * (`now - days`), mirroring CallHistory's mandatory `from` date.\n */\n from?: string;\n /**\n * ISO-8601 end of the time window (inclusive). When omitted, it defaults to the current time\n * (`now`). The API requires both `from` and `to` to return results.\n */\n to?: string;\n /**\n * Lookback window in days used to derive `from` when `from` is not provided. Defaults to `30`.\n * The list API only accepts a `from`/`to` interval of at most 30 days; larger windows are\n * rejected, so callers must keep custom values within that limit.\n * Ignored when an explicit `from` is supplied.\n */\n days?: number;\n /** Filter by recording status. Defaults to `available`. */\n status?: RecordingStatus;\n /** Maximum number of records to return per page. Defaults to `30`. */\n max?: number;\n /**\n * Filter by the service that produced the recording (e.g. `'calling'`). Sent only when provided;\n * when omitted the API applies its own default.\n */\n serviceType?: string;\n /** Filter by recording media format (e.g. `'MP3'`, `'MP4'`). Sent only when provided. */\n format?: string;\n /** Filter by recording owner type (e.g. `'user'`). Sent only when provided. */\n ownerType?: string;\n /** Filter by storage region (e.g. `'US'`). Sent only when provided. */\n storageRegion?: string;\n /** Filter by the location id the recording belongs to. Sent only when provided. */\n locationId?: string;\n /** Filter by recording topic. Sent only when provided. */\n topic?: string;\n /** When true, sends the `WebexUserRequest: true` header. Defaults to false. */\n webexUserRequest?: boolean;\n};\n\nexport type RecordingListResponse = {\n statusCode: number;\n data: {\n recordings?: Recording[];\n error?: string;\n };\n message: string | null;\n};\n\nexport type RecordingResponse = {\n statusCode: number;\n data: {\n recording?: Recording;\n error?: string;\n };\n message: string | null;\n};\n\nexport type RecordingMetadataResponse = {\n statusCode: number;\n data: {\n metadata?: RecordingMetadata;\n error?: string;\n };\n message: string | null;\n};\n\nexport type RecordingDeleteResponse = {\n statusCode: number;\n data: {\n error?: string;\n };\n message: string | null;\n};\n\n/**\n * @deprecated Ignored by {@link ICallRecording.deleteRecording}. Retained for backward-compatible\n * signatures only. Compliance permanent delete is not exposed on the CallRecording client.\n */\nexport type DeleteRecordingOptions = {\n /** Reason for deleting the recording (e.g. `audit`). */\n reason?: string;\n /** Compliance Officer's explanation for the deletion. Max 255 characters. */\n comment?: string;\n};\n\n/**\n * Discriminator for {@link GetCallRecordingRequest}. Selects which read operation\n * {@link ICallRecording.getCallRecording} performs based on the request body.\n *\n * - `LIST`: list the current user's recordings.\n * - `DETAIL`: fetch a single recording (with download/playback links).\n * - `METADATA`: fetch a single recording's metadata document.\n * - `BY_CALL_SESSION`: list recordings tied to a call session id (client-side filter).\n */\nexport enum RecordingRequestType {\n LIST = 'list',\n DETAIL = 'detail',\n METADATA = 'metadata',\n BY_CALL_SESSION = 'byCallSession',\n}\n\n/**\n * Lists the current user's converged recordings.\n * Maps to `GET /convergedRecordings` with the query params from {@link GetRecordingsOptions}.\n */\nexport type ListRecordingsRequest = {\n type: RecordingRequestType.LIST;\n options?: GetRecordingsOptions;\n};\n\n/**\n * Fetches a single converged recording by id.\n * Maps to `GET /convergedRecordings/{recordingId}`.\n */\nexport type DetailRecordingRequest = {\n type: RecordingRequestType.DETAIL;\n recordingId: string;\n};\n\n/**\n * Fetches the metadata document for a single recording.\n * Maps to `GET /convergedRecordings/{recordingId}/metadata`.\n */\nexport type MetadataRecordingRequest = {\n type: RecordingRequestType.METADATA;\n recordingId: string;\n};\n\n/**\n * Returns the recordings tied to a call session id (`serviceData.callSessionId`).\n * Fetches a list and filters client-side; `options` widen the scanned set.\n */\nexport type CallSessionRecordingsRequest = {\n type: RecordingRequestType.BY_CALL_SESSION;\n callSessionId: string;\n options?: GetRecordingsOptions;\n};\n\n/**\n * Discriminated union of every read request accepted by {@link ICallRecording.getCallRecording}.\n * The `type` field selects the operation and constrains the rest of the body, while\n * {@link RecordingResponseFor} maps each member to its concrete response type so the caller keeps\n * full type inference from a single method.\n */\nexport type GetCallRecordingRequest =\n | ListRecordingsRequest\n | DetailRecordingRequest\n | MetadataRecordingRequest\n | CallSessionRecordingsRequest;\n\n/**\n * Maps a {@link GetCallRecordingRequest} member to the response type\n * {@link ICallRecording.getCallRecording} resolves with for that request, preserving per-request\n * return-type inference behind the single method.\n */\nexport type RecordingResponseFor<T extends GetCallRecordingRequest> =\n T extends DetailRecordingRequest\n ? RecordingResponse\n : T extends MetadataRecordingRequest\n ? RecordingMetadataResponse\n : RecordingListResponse;\n\n/**\n * Interface for the CallRecording client.\n *\n * Provides read access to Post Call Recordings through a single {@link getCallRecording} method\n * (listing, single fetch, lookup by call session, and metadata — selected by the request `type`),\n * moves a recording to the recycle bin (soft delete), and emits recording lifecycle events received\n * over Mercury.\n */\nexport interface ICallRecording extends Eventing<CallRecordingEventTypes> {\n /**\n * Reads Post Call Recordings. The {@link GetCallRecordingRequest} `type` selects the operation\n * and constrains the rest of the request body; the resolved response type is inferred per\n * request via {@link RecordingResponseFor}:\n *\n * - `LIST` (`GET /convergedRecordings`) -> {@link RecordingListResponse}. The query params come\n * from {@link GetRecordingsOptions}; both a `from` lower bound (derived from `days` when not\n * provided) and a `to` upper bound (defaults to `now`) are always sent, because the API only\n * returns results when the time window is bounded on both ends.\n * - `DETAIL` (`GET /convergedRecordings/{recordingId}`) -> {@link RecordingResponse}.\n * - `METADATA` (`GET /convergedRecordings/{recordingId}/metadata`) ->\n * {@link RecordingMetadataResponse}.\n * - `BY_CALL_SESSION` -> {@link RecordingListResponse}. The recording API has no confirmed\n * server-side filter for call session id, so this fetches a list and filters client-side on\n * `serviceData.callSessionId`. The scan is bounded by the list query, so pass `options` to\n * widen the time window/status/page when the target session may fall outside the defaults.\n *\n * @param request - The discriminated read request.\n *\n * @example\n * ```javascript\n * const list = await callRecording.getCallRecording({type: RecordingRequestType.LIST, options: {max: 30}});\n * const one = await callRecording.getCallRecording({type: RecordingRequestType.DETAIL, recordingId});\n * const meta = await callRecording.getCallRecording({type: RecordingRequestType.METADATA, recordingId});\n * const bySession = await callRecording.getCallRecording({\n * type: RecordingRequestType.BY_CALL_SESSION,\n * callSessionId,\n * options: {days: 30, max: 100},\n * });\n * ```\n */\n getCallRecording<T extends GetCallRecordingRequest>(request: T): Promise<RecordingResponseFor<T>>;\n\n /**\n * Moves a recording to the recycle bin (soft delete).\n *\n * Calls `POST /convergedRecordings/softDelete` with `{ recordingIds: [recordingId] }`.\n * The recording can be restored from the recycle bin via the platform restore API. Requires\n * `spark:recordings_write` on the access token (recording owner). Control Hub\n * \"Delete recordings and transcripts\" enables this for the user; it does **not** grant\n * compliance-officer permanent delete.\n *\n * Mercury emits `convergedRecordings.updated` + `TRASH`, surfaced as `callRecording:deleted`.\n *\n * @param recordingId - The recording id (`id`) to move to the recycle bin.\n * @param _options - Deprecated. Ignored.\n *\n * @example\n * ```javascript\n * await callRecording.deleteRecording(recordingId);\n * ```\n */\n deleteRecording(\n recordingId: string,\n _options?: DeleteRecordingOptions\n ): Promise<RecordingDeleteResponse>;\n}\n"],"mappings":";;;;;;;AAQA;AACA;AACA;AACA;AACA;AACA;AALA,IAMYA,eAAe,GAAAC,OAAA,CAAAD,eAAA,0BAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAA,OAAfA,eAAe;AAAA;AAK3B;AACA;AACA;AAFA,IAGYE,kBAAkB,GAAAD,OAAA,CAAAC,kBAAA,0BAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAA,OAAlBA,kBAAkB;AAAA;AAO9B;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AAOA;AACA;AACA;AACA;AAOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAWA;AACA;AACA;AACA;AACA;AAOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAmBA;AACA;AACA;AAKA;AACA;AACA;AACA;AACA;AA+CA;AACA;AACA;AACA;AACA;AA6EA;AACA;AACA;AACA;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AARA,IASYC,oBAAoB,GAAAF,OAAA,CAAAE,oBAAA,0BAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAAA,OAApBA,oBAAoB;AAAA;AAOhC;AACA;AACA;AACA;AAMA;AACA;AACA;AACA;AAMA;AACA;AACA;AACA;AAMA;AACA;AACA;AACA;AAOA;AACA;AACA;AACA;AACA;AACA;AAOA;AACA;AACA;AACA;AACA;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
1
+ {"version":3,"names":["RecordingStatus","exports","AiGenerationStatus","RecordingRequestType"],"sources":["types.ts"],"sourcesContent":["import {Eventing} from '../Events/impl';\nimport {CallRecordingEventTypes} from '../Events/types';\nimport {LOGGER} from '../Logger/types';\n\nexport interface LoggerInterface {\n level: LOGGER;\n}\n\n/**\n * Status of a converged recording, used both as the response field and as the list filter.\n *\n * - `available`: the recording is available (default).\n * - `deleted`: the recording has been moved into the recycle bin.\n */\nexport enum RecordingStatus {\n AVAILABLE = 'available',\n DELETED = 'deleted',\n}\n\n/**\n * Status of an AI-generated artifact (summary / suggested notes / action items).\n */\nexport enum AiGenerationStatus {\n NOT_STARTED = 'NOT_STARTED',\n IN_PROGRESS = 'IN_PROGRESS',\n COMPLETED = 'COMPLETED',\n FAILED = 'FAILED',\n}\n\n/**\n * Which side of the call the recording owner was on, as reported by `serviceData.personality`:\n * - `originator`: the owner placed the call (the remote party is `calledParty`).\n * - `terminator`: the owner received the call (the remote party is `callingParty`).\n *\n * Use {@link getRemoteParty} to resolve the other party without having to branch on this manually.\n */\nexport type RecordingPersonality = 'originator' | 'terminator';\n\n/**\n * The acting entity behind a call party. For Webex users `type` is `USER` and `id` is the Webex\n * person UUID — the identifier accepted by the avatar (`@webex/internal-plugin-avatar`) and\n * presence (DSS) services. External/PSTN parties may have only a `number`/`name` on the parent\n * {@link RecordingParty} and no `actor.id`.\n */\nexport type RecordingActor = {\n type?: string;\n id?: string;\n email?: string;\n};\n\n/**\n * A party (calling or called) involved in the recorded call. `actor.id` is the resolvable person\n * UUID when the party is a Webex user; `number`/`name` are the dialable number and display name.\n */\nexport type RecordingParty = {\n actor?: RecordingActor;\n number?: string;\n name?: string;\n};\n\n/**\n * Service-specific data attached to a converged recording. For calling recordings this carries the\n * `locationId` and the `callSessionId` shared with the originating call session.\n *\n * The party details (`personality`, `callingParty`, `calledParty`) identify who the call was with\n * and are mapped from User Hub `callingData` on list and detail. Resolve the remote participant's\n * person UUID (for avatar/presence) via `getRemoteParty(serviceData)?.actor?.id`.\n */\nexport type RecordingServiceData = {\n callRecordingId?: string;\n locationId?: string;\n callSessionId?: string;\n personality?: RecordingPersonality;\n callingParty?: RecordingParty;\n calledParty?: RecordingParty;\n [key: string]: unknown;\n};\n\n/**\n * Browser-safe playback URLs from userhub DETAIL (`recordingPlaybackLinks`).\n * `transcriptPlaybackLink` is the transcript URL. `audioPlaybackLink` is the audio URL.\n */\nexport type RecordingPlaybackLinks = {\n audioPlaybackLink?: string;\n transcriptPlaybackLink?: string;\n videoPlaybackLink?: string;\n};\n\n/**\n * AI notes/summary pointers from userhub DETAIL (`aiAssistantData`).\n * `suggestedNoteUrl` is the aibridge notes URL.\n */\nexport type RecordingAiAssistantData = {\n suggestedNoteUrl?: string;\n suggestedNoteStatus?: string;\n};\n\n/**\n * Hydra download links previously returned by `GET /convergedRecordings/{recordingId}`.\n * User Hub does not populate this. Use {@link RecordingPlaybackLinks} and\n * {@link RecordingAiAssistantData} instead.\n */\nexport type TemporaryDirectDownloadLinks = {\n audioDownloadLink?: string;\n transcriptDownloadLink?: string;\n expiration?: string;\n};\n\n/**\n * A converged recording as returned by `GET /convergedRecordings` (list `items[]`) and\n * `GET /convergedRecordings/{recordingId}`.\n *\n * Field mapping note (matches the public Webex Converged Recordings API):\n * - `id` is the recording id used by {@link ICallRecording.getRecording}.\n * - `serviceData.callSessionId` is the call session id used by\n * {@link ICallRecording.getRecordingsByCallSessionId}.\n */\nexport type Recording = {\n id: string;\n topic?: string;\n createTime?: string;\n timeRecorded?: string;\n format?: string;\n serviceType?: string;\n durationSeconds?: number;\n sizeBytes?: number;\n status?: RecordingStatus;\n ownerId?: string;\n ownerEmail?: string;\n /**\n * @deprecated Hydra field. Kept so existing TypeScript callers still compile.\n * User Hub does not populate this.\n */\n ownerType?: string;\n /**\n * @deprecated Hydra field. Kept so existing TypeScript callers still compile.\n * User Hub does not populate this.\n */\n storageRegion?: string;\n serviceData?: RecordingServiceData;\n recordingPlaybackLinks?: RecordingPlaybackLinks;\n aiAssistantData?: RecordingAiAssistantData;\n /**\n * @deprecated Hydra download links. Kept so existing TypeScript callers still compile.\n * User Hub does not populate this. Use `recordingPlaybackLinks` and `aiAssistantData`.\n */\n temporaryDirectDownloadLinks?: TemporaryDirectDownloadLinks;\n};\n\n/**\n * Metadata mapped from the User Hub detail body.\n * User Hub fills `id`, `callSessionId`, `owner`, and `serviceData`.\n * `session`, `participants`, `mediaStreams`, and `extensionData` stay on the type so existing\n * callers still compile; User Hub does not populate them.\n */\nexport type RecordingMetadataOwner = {\n ownerID?: string;\n ownerEmail?: string;\n ownerName?: string;\n orgID?: string;\n};\n\nexport type RecordingMetadataParticipant = {\n id?: string;\n name?: string;\n email?: string;\n phoneNumber?: string;\n joinTime?: string;\n leaveTime?: string;\n};\n\nexport type RecordingMediaStream = {\n streamId?: string;\n type?: string;\n codec?: string;\n durationMS?: number;\n};\n\nexport type RecordingExtensionData = {\n callData?: Record<string, unknown>;\n acd?: Record<string, unknown>;\n redirectInfo?: Record<string, unknown>;\n};\n\nexport type RecordingMetadata = {\n id?: string;\n callSessionId?: string;\n owner?: RecordingMetadataOwner;\n session?: Record<string, unknown>;\n participants?: RecordingMetadataParticipant[];\n mediaStreams?: RecordingMediaStream[];\n extensionData?: RecordingExtensionData;\n /**\n * Service-specific data, including the call party details (`personality`, `callingParty`,\n * `calledParty`) used to resolve the remote participant for avatar/presence. See\n * {@link getRemoteParty}.\n */\n serviceData?: RecordingServiceData;\n [key: string]: unknown;\n};\n\n/**\n * Options for a recording list. Only `status` and `max` are sent.\n * The other fields are accepted so existing callers keep compiling. The User Hub list does not send them.\n * The connector always sends `WebexUserRequest: true`.\n */\nexport type GetRecordingsOptions = {\n /**\n * @deprecated Accepted for existing callers. Not sent. The list is ordered by `appCreateTime`.\n */\n from?: string;\n /**\n * @deprecated Accepted for existing callers. Not sent. The list is ordered by `appCreateTime`.\n */\n to?: string;\n /**\n * @deprecated Accepted for existing callers. Not sent. The list is ordered by `appCreateTime`.\n */\n days?: number;\n /** Filter by recording status. Defaults to `available`. Sent as `status`. */\n status?: RecordingStatus;\n /** Page size. Defaults to `30`. Sent as `limit`. */\n max?: number;\n /**\n * @deprecated Accepted for existing callers. Not sent. The list always uses `category=calling`.\n */\n serviceType?: string;\n /** @deprecated Accepted for existing callers. Not sent. */\n format?: string;\n /** @deprecated Accepted for existing callers. Not sent. */\n ownerType?: string;\n /** @deprecated Accepted for existing callers. Not sent. */\n storageRegion?: string;\n /** @deprecated Accepted for existing callers. Not sent. */\n locationId?: string;\n /** @deprecated Accepted for existing callers. Not sent. */\n topic?: string;\n /**\n * @deprecated Accepted for existing callers. Not sent as a switch.\n * The connector always sends `WebexUserRequest: true`.\n */\n webexUserRequest?: boolean;\n};\n\nexport type RecordingListResponse = {\n statusCode: number;\n data: {\n recordings?: Recording[];\n error?: string;\n };\n message: string | null;\n};\n\nexport type RecordingResponse = {\n statusCode: number;\n data: {\n recording?: Recording;\n error?: string;\n };\n message: string | null;\n};\n\nexport type RecordingMetadataResponse = {\n statusCode: number;\n data: {\n metadata?: RecordingMetadata;\n error?: string;\n };\n message: string | null;\n};\n\nexport type RecordingDeleteResponse = {\n statusCode: number;\n data: {\n error?: string;\n };\n message: string | null;\n};\n\n/**\n * @deprecated Ignored by {@link ICallRecording.deleteRecording}. Retained for backward-compatible\n * signatures only. Compliance permanent delete is not exposed on the CallRecording client.\n */\nexport type DeleteRecordingOptions = {\n /** Reason for deleting the recording (e.g. `audit`). */\n reason?: string;\n /** Compliance Officer's explanation for the deletion. Max 255 characters. */\n comment?: string;\n};\n\n/**\n * Discriminator for {@link GetCallRecordingRequest}. Selects which read operation\n * {@link ICallRecording.getCallRecording} performs based on the request body.\n *\n * - `LIST`: list the current user's recordings.\n * - `DETAIL`: fetch a single recording (with download/playback links).\n * - `METADATA`: fetch a single recording's metadata document.\n * - `BY_CALL_SESSION`: list recordings tied to a call session id (client-side filter).\n */\nexport enum RecordingRequestType {\n LIST = 'list',\n DETAIL = 'detail',\n METADATA = 'metadata',\n BY_CALL_SESSION = 'byCallSession',\n}\n\n/**\n * Lists the current user's converged recordings.\n * Maps to `GET /convergedRecordings` with the query params from {@link GetRecordingsOptions}.\n */\nexport type ListRecordingsRequest = {\n type: RecordingRequestType.LIST;\n options?: GetRecordingsOptions;\n};\n\n/**\n * Fetches a single converged recording by id.\n * Maps to `GET /convergedRecordings/{recordingId}`.\n */\nexport type DetailRecordingRequest = {\n type: RecordingRequestType.DETAIL;\n recordingId: string;\n};\n\n/**\n * Fetches metadata for a single recording from the User Hub detail URL.\n * Maps to `GET /webappng/api/v1/hub/convergedRecordings/{recordingId}`.\n */\nexport type MetadataRecordingRequest = {\n type: RecordingRequestType.METADATA;\n recordingId: string;\n};\n\n/**\n * Returns the recordings tied to a call session id (`serviceData.callSessionId`).\n * Fetches a list and filters client-side; `options` widen the scanned set.\n */\nexport type CallSessionRecordingsRequest = {\n type: RecordingRequestType.BY_CALL_SESSION;\n callSessionId: string;\n options?: GetRecordingsOptions;\n};\n\n/**\n * Discriminated union of every read request accepted by {@link ICallRecording.getCallRecording}.\n * The `type` field selects the operation and constrains the rest of the body, while\n * {@link RecordingResponseFor} maps each member to its concrete response type so the caller keeps\n * full type inference from a single method.\n */\nexport type GetCallRecordingRequest =\n | ListRecordingsRequest\n | DetailRecordingRequest\n | MetadataRecordingRequest\n | CallSessionRecordingsRequest;\n\n/**\n * Maps a {@link GetCallRecordingRequest} member to the response type\n * {@link ICallRecording.getCallRecording} resolves with for that request, preserving per-request\n * return-type inference behind the single method.\n */\nexport type RecordingResponseFor<T extends GetCallRecordingRequest> =\n T extends DetailRecordingRequest\n ? RecordingResponse\n : T extends MetadataRecordingRequest\n ? RecordingMetadataResponse\n : RecordingListResponse;\n\n/**\n * Interface for the CallRecording client.\n *\n * Provides read access to Post Call Recordings through a single {@link getCallRecording} method\n * (listing, single fetch, lookup by call session, and metadata — selected by the request `type`),\n * moves a recording to the recycle bin (soft delete), and emits recording lifecycle events received\n * over Mercury.\n */\nexport interface ICallRecording extends Eventing<CallRecordingEventTypes> {\n /**\n * Reads Post Call Recordings. The {@link GetCallRecordingRequest} `type` selects the operation\n * and constrains the rest of the request body; the resolved response type is inferred per\n * request via {@link RecordingResponseFor}:\n *\n * - `LIST` -> {@link RecordingListResponse}. Query is\n * `orderType=DESC&orderBy=appCreateTime&status&category=calling&offset=0&limit`.\n * `status` and `max` come from {@link GetRecordingsOptions}.\n * - `DETAIL` (`GET .../convergedRecordings/{recordingId}`) -> {@link RecordingResponse}.\n * - `METADATA` uses the same detail URL and maps owner plus `serviceData` ->\n * {@link RecordingMetadataResponse}.\n * - `BY_CALL_SESSION` -> {@link RecordingListResponse}. User Hub has no session filter, so this\n * fetches the list and keeps rows whose `serviceData.callSessionId` matches.\n *\n * @param request - The discriminated read request.\n *\n * @example\n * ```javascript\n * const list = await callRecording.getCallRecording({type: RecordingRequestType.LIST, options: {max: 30}});\n * const one = await callRecording.getCallRecording({type: RecordingRequestType.DETAIL, recordingId});\n * const meta = await callRecording.getCallRecording({type: RecordingRequestType.METADATA, recordingId});\n * const bySession = await callRecording.getCallRecording({\n * type: RecordingRequestType.BY_CALL_SESSION,\n * callSessionId,\n * options: {max: 100},\n * });\n * ```\n */\n getCallRecording<T extends GetCallRecordingRequest>(request: T): Promise<RecordingResponseFor<T>>;\n\n /**\n * Moves a recording to the recycle bin (soft delete).\n *\n * Calls `POST .../convergedRecordings/softDelete` with `{ recordUUIDs: [recordingId] }`.\n * The recording can be restored from the recycle bin via the platform restore API. Requires\n * `spark:recordings_write` on the access token (recording owner). Control Hub\n * \"Delete recordings and transcripts\" enables this for the user; it does **not** grant\n * compliance-officer permanent delete.\n *\n * Mercury emits `convergedRecordings.updated` + `TRASH`, surfaced as `callRecording:deleted`.\n *\n * @param recordingId - The recording id (`id`) to move to the recycle bin.\n * @param _options - Deprecated. Ignored.\n *\n * @example\n * ```javascript\n * await callRecording.deleteRecording(recordingId);\n * ```\n */\n deleteRecording(\n recordingId: string,\n _options?: DeleteRecordingOptions\n ): Promise<RecordingDeleteResponse>;\n}\n"],"mappings":";;;;;;;AAQA;AACA;AACA;AACA;AACA;AACA;AALA,IAMYA,eAAe,GAAAC,OAAA,CAAAD,eAAA,0BAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAA,OAAfA,eAAe;AAAA;AAK3B;AACA;AACA;AAFA,IAGYE,kBAAkB,GAAAD,OAAA,CAAAC,kBAAA,0BAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAA,OAAlBA,kBAAkB;AAAA;AAO9B;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AAOA;AACA;AACA;AACA;AAOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAWA;AACA;AACA;AACA;AAOA;AACA;AACA;AACA;AAMA;AACA;AACA;AACA;AACA;AAOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAiCA;AACA;AACA;AACA;AACA;AACA;AA+CA;AACA;AACA;AACA;AACA;AA0EA;AACA;AACA;AACA;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AARA,IASYC,oBAAoB,GAAAF,OAAA,CAAAE,oBAAA,0BAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAAA,OAApBA,oBAAoB;AAAA;AAOhC;AACA;AACA;AACA;AAMA;AACA;AACA;AACA;AAMA;AACA;AACA;AACA;AAMA;AACA;AACA;AACA;AAOA;AACA;AACA;AACA;AACA;AACA;AAOA;AACA;AACA;AACA;AACA;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
@@ -0,0 +1,117 @@
1
+ "use strict";
2
+
3
+ var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
4
+ var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
5
+ _Object$defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.joinUserhubRecordingsUrl = joinUserhubRecordingsUrl;
9
+ exports.mapUserhubMetadata = mapUserhubMetadata;
10
+ exports.mapUserhubRecording = mapUserhubRecording;
11
+ exports.unwrapUserhubRecording = unwrapUserhubRecording;
12
+ var _isNan = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/number/is-nan"));
13
+ var _isFinite = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/number/is-finite"));
14
+ var _typeof2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/typeof"));
15
+ var _constants = require("./constants");
16
+ var _types = require("./types");
17
+ function joinUserhubRecordingsUrl(baseUrl) {
18
+ var trimmed = (baseUrl || '').replace(/\/+$/, '');
19
+ if (!trimmed) {
20
+ return '';
21
+ }
22
+ if (trimmed.includes("/".concat(_constants.USERHUB_RECORDINGS_PATH))) {
23
+ return trimmed.replace(/\/+$/, '');
24
+ }
25
+ if (trimmed.endsWith('/webappng/api/v1')) {
26
+ return "".concat(trimmed, "/hub/convergedRecordings");
27
+ }
28
+ if (trimmed.endsWith('/webappng')) {
29
+ return "".concat(trimmed, "/api/v1/hub/convergedRecordings");
30
+ }
31
+ return "".concat(trimmed, "/").concat(_constants.USERHUB_RECORDINGS_PATH);
32
+ }
33
+ function unwrapUserhubRecording(body) {
34
+ if (!body || (0, _typeof2.default)(body) !== 'object') {
35
+ return {};
36
+ }
37
+ if ('recording' in body && body.recording && (0, _typeof2.default)(body.recording) === 'object') {
38
+ return body.recording;
39
+ }
40
+ return body;
41
+ }
42
+ function toIsoTime(value) {
43
+ var raw = (value !== null && value !== void 0 ? value : '').trim();
44
+ if (!raw) {
45
+ return undefined;
46
+ }
47
+ var normalized = raw.includes(' ') && !raw.includes('T') ? "".concat(raw.replace(' ', 'T')).concat(/Z|[+-]\d{2}:?\d{2}$/.test(raw) ? '' : 'Z') : raw;
48
+ var parsed = Date.parse(normalized);
49
+ return (0, _isNan.default)(parsed) ? raw : new Date(parsed).toISOString();
50
+ }
51
+ function mapPersonality(value) {
52
+ var personality = (value !== null && value !== void 0 ? value : '').trim().toLowerCase();
53
+ if (personality === 'terminator' || personality === 'terminating' || personality === 'callee') {
54
+ return 'terminator';
55
+ }
56
+ if (personality === 'originator' || personality === 'originating' || personality === 'caller') {
57
+ return 'originator';
58
+ }
59
+ return undefined;
60
+ }
61
+ function mapUserhubRecording(item) {
62
+ var _item$durationMS, _item$status;
63
+ var id = (item.recordUUID || item.id || '').trim();
64
+ var callingData = item.callingData;
65
+ var personality = mapPersonality(callingData === null || callingData === void 0 ? void 0 : callingData.personality);
66
+ var durationSeconds = typeof item.durationSeconds === 'number' ? item.durationSeconds : Math.round(Number((_item$durationMS = item.durationMS) !== null && _item$durationMS !== void 0 ? _item$durationMS : 0) / 1000);
67
+ return {
68
+ id: id,
69
+ topic: (item.title || item.topic || '').trim() || undefined,
70
+ createTime: toIsoTime(item.appCreateTime),
71
+ timeRecorded: toIsoTime(item.startRecordingTime || item.appCreateTime),
72
+ format: item.format,
73
+ serviceType: 'calling',
74
+ durationSeconds: (0, _isFinite.default)(durationSeconds) ? durationSeconds : undefined,
75
+ sizeBytes: item.sizeByte,
76
+ status: ((_item$status = item.status) !== null && _item$status !== void 0 ? _item$status : '').toLowerCase() === _types.RecordingStatus.DELETED ? _types.RecordingStatus.DELETED : _types.RecordingStatus.AVAILABLE,
77
+ ownerId: item.ownerID,
78
+ ownerEmail: item.ownerEmail,
79
+ recordingPlaybackLinks: item.recordingPlaybackLinks,
80
+ aiAssistantData: item.aiAssistantData,
81
+ serviceData: {
82
+ locationId: callingData === null || callingData === void 0 ? void 0 : callingData.locationID,
83
+ callSessionId: callingData === null || callingData === void 0 ? void 0 : callingData.callSessionID,
84
+ personality: personality,
85
+ callingParty: {
86
+ actor: {
87
+ type: callingData === null || callingData === void 0 ? void 0 : callingData.callingActorType,
88
+ id: callingData === null || callingData === void 0 ? void 0 : callingData.callingActorID
89
+ },
90
+ name: callingData === null || callingData === void 0 ? void 0 : callingData.callingName,
91
+ number: callingData === null || callingData === void 0 ? void 0 : callingData.callingNumber
92
+ },
93
+ calledParty: {
94
+ actor: {
95
+ type: callingData === null || callingData === void 0 ? void 0 : callingData.calledActorType,
96
+ id: callingData === null || callingData === void 0 ? void 0 : callingData.calledActorID
97
+ },
98
+ name: callingData === null || callingData === void 0 ? void 0 : callingData.calledName,
99
+ number: callingData === null || callingData === void 0 ? void 0 : callingData.calledNumber
100
+ }
101
+ }
102
+ };
103
+ }
104
+ function mapUserhubMetadata(item) {
105
+ var _recording$serviceDat;
106
+ var recording = mapUserhubRecording(item);
107
+ return {
108
+ id: recording.id,
109
+ callSessionId: (_recording$serviceDat = recording.serviceData) === null || _recording$serviceDat === void 0 ? void 0 : _recording$serviceDat.callSessionId,
110
+ owner: {
111
+ ownerID: recording.ownerId,
112
+ ownerEmail: recording.ownerEmail
113
+ },
114
+ serviceData: recording.serviceData
115
+ };
116
+ }
117
+ //# sourceMappingURL=userhub.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_constants","require","_types","joinUserhubRecordingsUrl","baseUrl","trimmed","replace","includes","concat","USERHUB_RECORDINGS_PATH","endsWith","unwrapUserhubRecording","body","_typeof2","default","recording","toIsoTime","value","raw","trim","undefined","normalized","test","parsed","Date","parse","_isNan","toISOString","mapPersonality","personality","toLowerCase","mapUserhubRecording","item","_item$durationMS","_item$status","id","recordUUID","callingData","durationSeconds","Math","round","Number","durationMS","topic","title","createTime","appCreateTime","timeRecorded","startRecordingTime","format","serviceType","_isFinite","sizeBytes","sizeByte","status","RecordingStatus","DELETED","AVAILABLE","ownerId","ownerID","ownerEmail","recordingPlaybackLinks","aiAssistantData","serviceData","locationId","locationID","callSessionId","callSessionID","callingParty","actor","type","callingActorType","callingActorID","name","callingName","number","callingNumber","calledParty","calledActorType","calledActorID","calledName","calledNumber","mapUserhubMetadata","_recording$serviceDat","owner"],"sources":["userhub.ts"],"sourcesContent":["import {USERHUB_RECORDINGS_PATH} from './constants';\nimport {Recording, RecordingMetadata, RecordingPersonality, RecordingStatus} from './types';\n\nexport type UserhubCallingData = {\n locationID?: string;\n callingActorType?: string;\n calledActorType?: string;\n callingActorID?: string;\n calledActorID?: string;\n callingName?: string;\n calledName?: string;\n callingNumber?: string;\n calledNumber?: string;\n callSessionID?: string;\n personality?: string;\n};\n\nexport type UserhubRecording = {\n recordUUID?: string;\n id?: string;\n title?: string;\n topic?: string;\n ownerEmail?: string;\n ownerID?: string;\n durationMS?: number;\n durationSeconds?: number;\n status?: string;\n format?: string;\n sizeByte?: number;\n storageLocation?: string;\n appCreateTime?: string;\n startRecordingTime?: string;\n callingData?: UserhubCallingData;\n recordingPlaybackLinks?: Recording['recordingPlaybackLinks'];\n aiAssistantData?: Recording['aiAssistantData'];\n};\n\nexport type UserhubRecordingListBody = {\n recordings?: UserhubRecording[];\n items?: UserhubRecording[];\n};\n\nexport function joinUserhubRecordingsUrl(baseUrl: string): string {\n const trimmed = (baseUrl || '').replace(/\\/+$/, '');\n if (!trimmed) {\n return '';\n }\n if (trimmed.includes(`/${USERHUB_RECORDINGS_PATH}`)) {\n return trimmed.replace(/\\/+$/, '');\n }\n if (trimmed.endsWith('/webappng/api/v1')) {\n return `${trimmed}/hub/convergedRecordings`;\n }\n if (trimmed.endsWith('/webappng')) {\n return `${trimmed}/api/v1/hub/convergedRecordings`;\n }\n\n return `${trimmed}/${USERHUB_RECORDINGS_PATH}`;\n}\n\nexport function unwrapUserhubRecording(\n body: UserhubRecording | {recording?: UserhubRecording} | null | undefined\n): UserhubRecording {\n if (!body || typeof body !== 'object') {\n return {};\n }\n if ('recording' in body && body.recording && typeof body.recording === 'object') {\n return body.recording;\n }\n\n return body as UserhubRecording;\n}\n\nfunction toIsoTime(value?: string): string | undefined {\n const raw = (value ?? '').trim();\n if (!raw) {\n return undefined;\n }\n const normalized =\n raw.includes(' ') && !raw.includes('T')\n ? `${raw.replace(' ', 'T')}${/Z|[+-]\\d{2}:?\\d{2}$/.test(raw) ? '' : 'Z'}`\n : raw;\n const parsed = Date.parse(normalized);\n\n return Number.isNaN(parsed) ? raw : new Date(parsed).toISOString();\n}\n\nfunction mapPersonality(value?: string): RecordingPersonality | undefined {\n const personality = (value ?? '').trim().toLowerCase();\n if (personality === 'terminator' || personality === 'terminating' || personality === 'callee') {\n return 'terminator';\n }\n if (personality === 'originator' || personality === 'originating' || personality === 'caller') {\n return 'originator';\n }\n\n return undefined;\n}\n\nexport function mapUserhubRecording(item: UserhubRecording): Recording {\n const id = (item.recordUUID || item.id || '').trim();\n const callingData = item.callingData;\n const personality = mapPersonality(callingData?.personality);\n const durationSeconds =\n typeof item.durationSeconds === 'number'\n ? item.durationSeconds\n : Math.round(Number(item.durationMS ?? 0) / 1000);\n\n return {\n id,\n topic: (item.title || item.topic || '').trim() || undefined,\n createTime: toIsoTime(item.appCreateTime),\n timeRecorded: toIsoTime(item.startRecordingTime || item.appCreateTime),\n format: item.format,\n serviceType: 'calling',\n durationSeconds: Number.isFinite(durationSeconds) ? durationSeconds : undefined,\n sizeBytes: item.sizeByte,\n status:\n (item.status ?? '').toLowerCase() === RecordingStatus.DELETED\n ? RecordingStatus.DELETED\n : RecordingStatus.AVAILABLE,\n ownerId: item.ownerID,\n ownerEmail: item.ownerEmail,\n recordingPlaybackLinks: item.recordingPlaybackLinks,\n aiAssistantData: item.aiAssistantData,\n serviceData: {\n locationId: callingData?.locationID,\n callSessionId: callingData?.callSessionID,\n personality,\n callingParty: {\n actor: {type: callingData?.callingActorType, id: callingData?.callingActorID},\n name: callingData?.callingName,\n number: callingData?.callingNumber,\n },\n calledParty: {\n actor: {type: callingData?.calledActorType, id: callingData?.calledActorID},\n name: callingData?.calledName,\n number: callingData?.calledNumber,\n },\n },\n };\n}\n\nexport function mapUserhubMetadata(item: UserhubRecording): RecordingMetadata {\n const recording = mapUserhubRecording(item);\n\n return {\n id: recording.id,\n callSessionId: recording.serviceData?.callSessionId,\n owner: {\n ownerID: recording.ownerId,\n ownerEmail: recording.ownerEmail,\n },\n serviceData: recording.serviceData,\n };\n}\n"],"mappings":"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","ignoreList":[]}
@@ -13,9 +13,9 @@ exports.getRemoteParty = void 0;
13
13
  * - `originator` -> the owner placed the call, so the remote party is `calledParty`.
14
14
  * - `terminator` -> the owner received the call, so the remote party is `callingParty`.
15
15
  *
16
- * Returns `undefined` when the party details are absent (e.g. the list endpoint, which only
17
- * populates `locationId`/`callSessionId`) or when `personality` is unknown. The party details are
18
- * returned by the metadata endpoint (`GET /convergedRecordings/{recordingId}/metadata`).
16
+ * Returns `undefined` when the party details are absent or when `personality` is unknown.
17
+ * User Hub maps `callingData` onto `serviceData` for list and detail, so this works on a list row
18
+ * when those parties are present.
19
19
  *
20
20
  * Use `getRemoteParty(serviceData)?.actor?.id` for the Webex person UUID (avatar/presence
21
21
  * services). External/PSTN parties may have no `actor.id`; fall back to `?.name` for display.
@@ -1 +1 @@
1
- {"version":3,"names":["getRemoteParty","exports","serviceData","undefined","personality","callingParty","calledParty"],"sources":["utils.ts"],"sourcesContent":["import {RecordingParty, RecordingServiceData} from './types';\n\n/**\n * Resolves the *remote* party of a recorded call (the party that is not the recording owner) from a\n * recording's {@link RecordingServiceData}.\n *\n * The owner's side is indicated by `serviceData.personality`:\n * - `originator` -> the owner placed the call, so the remote party is `calledParty`.\n * - `terminator` -> the owner received the call, so the remote party is `callingParty`.\n *\n * Returns `undefined` when the party details are absent (e.g. the list endpoint, which only\n * populates `locationId`/`callSessionId`) or when `personality` is unknown. The party details are\n * returned by the metadata endpoint (`GET /convergedRecordings/{recordingId}/metadata`).\n *\n * Use `getRemoteParty(serviceData)?.actor?.id` for the Webex person UUID (avatar/presence\n * services). External/PSTN parties may have no `actor.id`; fall back to `?.name` for display.\n *\n * @param serviceData - The `serviceData` from a {@link Recording} or {@link RecordingMetadata}.\n * @returns The remote {@link RecordingParty}, or `undefined` when it cannot be determined.\n */\nexport const getRemoteParty = (serviceData?: RecordingServiceData): RecordingParty | undefined => {\n if (!serviceData) {\n return undefined;\n }\n\n const {personality, callingParty, calledParty} = serviceData;\n\n switch (personality) {\n case 'originator':\n return calledParty;\n case 'terminator':\n return callingParty;\n default:\n return undefined;\n }\n};\n"],"mappings":";;;;;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,IAAMA,cAAc,GAAAC,OAAA,CAAAD,cAAA,GAAG,SAAjBA,cAAcA,CAAIE,WAAkC,EAAiC;EAChG,IAAI,CAACA,WAAW,EAAE;IAChB,OAAOC,SAAS;EAClB;EAEA,IAAOC,WAAW,GAA+BF,WAAW,CAArDE,WAAW;IAAEC,YAAY,GAAiBH,WAAW,CAAxCG,YAAY;IAAEC,WAAW,GAAIJ,WAAW,CAA1BI,WAAW;EAE7C,QAAQF,WAAW;IACjB,KAAK,YAAY;MACf,OAAOE,WAAW;IACpB,KAAK,YAAY;MACf,OAAOD,YAAY;IACrB;MACE,OAAOF,SAAS;EACpB;AACF,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["getRemoteParty","exports","serviceData","undefined","personality","callingParty","calledParty"],"sources":["utils.ts"],"sourcesContent":["import {RecordingParty, RecordingServiceData} from './types';\n\n/**\n * Resolves the *remote* party of a recorded call (the party that is not the recording owner) from a\n * recording's {@link RecordingServiceData}.\n *\n * The owner's side is indicated by `serviceData.personality`:\n * - `originator` -> the owner placed the call, so the remote party is `calledParty`.\n * - `terminator` -> the owner received the call, so the remote party is `callingParty`.\n *\n * Returns `undefined` when the party details are absent or when `personality` is unknown.\n * User Hub maps `callingData` onto `serviceData` for list and detail, so this works on a list row\n * when those parties are present.\n *\n * Use `getRemoteParty(serviceData)?.actor?.id` for the Webex person UUID (avatar/presence\n * services). External/PSTN parties may have no `actor.id`; fall back to `?.name` for display.\n *\n * @param serviceData - The `serviceData` from a {@link Recording} or {@link RecordingMetadata}.\n * @returns The remote {@link RecordingParty}, or `undefined` when it cannot be determined.\n */\nexport const getRemoteParty = (serviceData?: RecordingServiceData): RecordingParty | undefined => {\n if (!serviceData) {\n return undefined;\n }\n\n const {personality, callingParty, calledParty} = serviceData;\n\n switch (personality) {\n case 'originator':\n return calledParty;\n case 'terminator':\n return callingParty;\n default:\n return undefined;\n }\n};\n"],"mappings":";;;;;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,IAAMA,cAAc,GAAAC,OAAA,CAAAD,cAAA,GAAG,SAAjBA,cAAcA,CAAIE,WAAkC,EAAiC;EAChG,IAAI,CAACA,WAAW,EAAE;IAChB,OAAOC,SAAS;EAClB;EAEA,IAAOC,WAAW,GAA+BF,WAAW,CAArDE,WAAW;IAAEC,YAAY,GAAiBH,WAAW,CAAxCG,YAAY;IAAEC,WAAW,GAAIJ,WAAW,CAA1BI,WAAW;EAE7C,QAAQF,WAAW;IACjB,KAAK,YAAY;MACf,OAAOE,WAAW;IACpB,KAAK,YAAY;MACf,OAAOD,YAAY;IACrB;MACE,OAAOF,SAAS;EACpB;AACF,CAAC","ignoreList":[]}
@@ -18,6 +18,7 @@ var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs2/regene
18
18
  var _values = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/values"));
19
19
  var _keys = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/keys"));
20
20
  var _stringify = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/json/stringify"));
21
+ var _set = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/set"));
21
22
  var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/toConsumableArray"));
22
23
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/asyncToGenerator"));
23
24
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));
@@ -741,12 +742,13 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
741
742
  key: "getMobiusServers",
742
743
  value: (function () {
743
744
  var _getMobiusServers = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee1() {
744
- var _this$sdkConfig5,
745
+ var _this$webex$internal$,
746
+ _this$sdkConfig5,
745
747
  _this$sdkConfig5$disc,
746
748
  _this$sdkConfig6,
747
749
  _this$sdkConfig6$disc,
748
750
  _this5 = this;
749
- var useDefault, clientRegion, countryCode, _this$sdkConfig7, _this$sdkConfig7$disc, _this$sdkConfig8, _this$sdkConfig8$disc, _this$webex$internal$, regionInfo, _iterator2, _step2, _loop2, _ret, _t6;
751
+ var useDefault, clientRegion, countryCode, _this$sdkConfig7, _this$sdkConfig7$disc, _this$sdkConfig8, _this$sdkConfig8$disc, regionInfo, candidateHosts, _iterator2, _step2, _loop2, _ret, _t6;
750
752
  return _regenerator.default.wrap(function (_context11) {
751
753
  while (1) switch (_context11.prev = _context11.next) {
752
754
  case 0:
@@ -762,6 +764,7 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
762
764
  5. Otherwise send registration
763
765
  */
764
766
  useDefault = false;
767
+ this.mobiusHost = ((_this$webex$internal$ = this.webex.internal.services._serviceUrls) === null || _this$webex$internal$ === void 0 ? void 0 : _this$webex$internal$.mobius) || this.webex.internal.services.get(this.webex.internal.services._activeServices.mobius);
765
768
  if (!((_this$sdkConfig5 = this.sdkConfig) !== null && _this$sdkConfig5 !== void 0 && (_this$sdkConfig5$disc = _this$sdkConfig5.discovery) !== null && _this$sdkConfig5$disc !== void 0 && _this$sdkConfig5$disc.country && (_this$sdkConfig6 = this.sdkConfig) !== null && _this$sdkConfig6 !== void 0 && (_this$sdkConfig6$disc = _this$sdkConfig6.discovery) !== null && _this$sdkConfig6$disc !== void 0 && _this$sdkConfig6$disc.region)) {
766
769
  _context11.next = 1;
767
770
  break;
@@ -772,7 +775,6 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
772
775
  });
773
776
  clientRegion = (_this$sdkConfig7 = this.sdkConfig) === null || _this$sdkConfig7 === void 0 ? void 0 : (_this$sdkConfig7$disc = _this$sdkConfig7.discovery) === null || _this$sdkConfig7$disc === void 0 ? void 0 : _this$sdkConfig7$disc.region;
774
777
  countryCode = (_this$sdkConfig8 = this.sdkConfig) === null || _this$sdkConfig8 === void 0 ? void 0 : (_this$sdkConfig8$disc = _this$sdkConfig8.discovery) === null || _this$sdkConfig8$disc === void 0 ? void 0 : _this$sdkConfig8$disc.country;
775
- this.mobiusHost = ((_this$webex$internal$ = this.webex.internal.services._serviceUrls) === null || _this$webex$internal$ === void 0 ? void 0 : _this$webex$internal$.mobius) || this.webex.internal.services.get(this.webex.internal.services._activeServices.mobius);
776
778
  _context11.next = 3;
777
779
  break;
778
780
  case 1:
@@ -795,19 +797,23 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
795
797
  file: _constants2.CALLING_CLIENT_FILE,
796
798
  method: _constants2.GET_MOBIUS_SERVERS_UTIL
797
799
  });
798
- _iterator2 = _createForOfIteratorHelper(this.mobiusClusters);
800
+
801
+ /* Attempt the Mobius host from the service link first (when available) and then
802
+ * fall back to the catalog clusters. Duplicate candidates are removed so the same
803
+ * host is never queried twice.
804
+ */
805
+ candidateHosts = (0, _toConsumableArray2.default)(new _set.default([].concat((0, _toConsumableArray2.default)(this.mobiusHost ? [this.mobiusHost] : []), (0, _toConsumableArray2.default)(this.mobiusClusters.map(function (mobius) {
806
+ return mobius.host ? "https://".concat(mobius.host).concat(_constants2.API_V1) : mobius;
807
+ })))));
808
+ _iterator2 = _createForOfIteratorHelper(candidateHosts);
799
809
  _context11.prev = 4;
800
810
  _loop2 = /*#__PURE__*/_regenerator.default.mark(function _loop2() {
801
- var mobius, _response$headers3, _response$headers$tra2, _response$headers4, response, mobiusServers, mobiusUris, abort, _t5;
811
+ var host, _response$headers3, _response$headers$tra2, _response$headers4, response, mobiusServers, mobiusUris, abort, _t5;
802
812
  return _regenerator.default.wrap(function (_context10) {
803
813
  while (1) switch (_context10.prev = _context10.next) {
804
814
  case 0:
805
- mobius = _step2.value;
806
- if (mobius.host) {
807
- _this5.mobiusHost = "https://".concat(mobius.host).concat(_constants2.API_V1);
808
- } else {
809
- _this5.mobiusHost = mobius;
810
- }
815
+ host = _step2.value;
816
+ _this5.mobiusHost = host;
811
817
  _context10.prev = 1;
812
818
  _context10.next = 2;
813
819
  return _this5.webex.request({
@@ -1096,7 +1102,7 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
1096
1102
  key: "createLine",
1097
1103
  value: (function () {
1098
1104
  var _createLine = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee12() {
1099
- var _this$sdkConfig9;
1105
+ var _this$sdkConfig9, _this$sdkConfig0;
1100
1106
  var socketEnabled, primaryUris, backupUris, line;
1101
1107
  return _regenerator.default.wrap(function (_context14) {
1102
1108
  while (1) switch (_context14.prev = _context14.next) {
@@ -1111,7 +1117,7 @@ var CallingClient = exports.CallingClient = /*#__PURE__*/function (_Eventing) {
1111
1117
  socketEnabled = this.apiRequest.isSocketEnabled();
1112
1118
  primaryUris = socketEnabled && this.primaryWssMobiusUris.length ? (0, _Utils.normalizeMobiusUris)(this.primaryWssMobiusUris) : this.primaryMobiusUris;
1113
1119
  backupUris = socketEnabled && this.backupWssMobiusUris.length ? (0, _Utils.normalizeMobiusUris)(this.backupWssMobiusUris) : this.backupMobiusUris;
1114
- line = new _line.default(this.webex.internal.device.userId, this.webex.internal.device.url, this.mutex, primaryUris, backupUris, this.getLoggingLevel(), this.serviceData, (_this$sdkConfig9 = this.sdkConfig) === null || _this$sdkConfig9 === void 0 ? void 0 : _this$sdkConfig9.jwe);
1120
+ line = new _line.default(this.webex.internal.device.userId, this.webex.internal.device.url, this.mutex, primaryUris, backupUris, this.getLoggingLevel(), this.serviceData, (_this$sdkConfig9 = this.sdkConfig) === null || _this$sdkConfig9 === void 0 ? void 0 : _this$sdkConfig9.jwe, (_this$sdkConfig0 = this.sdkConfig) === null || _this$sdkConfig0 === void 0 ? void 0 : _this$sdkConfig0.localAudioStream);
1115
1121
  this.lineDict[line.lineId] = line;
1116
1122
  case 1:
1117
1123
  case "end":