@webex/calling 3.0.0-next.2 → 3.0.0-next.4

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 (283) hide show
  1. package/CHANGELOG.md +1403 -0
  2. package/README.md +74 -74
  3. package/dist/module/CallHistory/CallHistory.js +81 -81
  4. package/dist/module/CallHistory/callHistoryFixtures.js +307 -307
  5. package/dist/module/CallHistory/constants.js +9 -9
  6. package/dist/module/CallHistory/types.js +1 -1
  7. package/dist/module/CallSettings/CallSettings.js +65 -65
  8. package/dist/module/CallSettings/UcmBackendConnector.js +100 -100
  9. package/dist/module/CallSettings/WxCallBackendConnector.js +287 -287
  10. package/dist/module/CallSettings/constants.js +11 -11
  11. package/dist/module/CallSettings/testFixtures.js +62 -62
  12. package/dist/module/CallSettings/types.js +1 -1
  13. package/dist/module/CallingClient/CallingClient.js +248 -248
  14. package/dist/module/CallingClient/callRecordFixtures.js +93 -93
  15. package/dist/module/CallingClient/calling/CallerId/index.js +169 -169
  16. package/dist/module/CallingClient/calling/CallerId/types.js +1 -1
  17. package/dist/module/CallingClient/calling/call.js +1658 -1658
  18. package/dist/module/CallingClient/calling/callManager.js +284 -284
  19. package/dist/module/CallingClient/calling/index.js +2 -2
  20. package/dist/module/CallingClient/calling/types.js +53 -53
  21. package/dist/module/CallingClient/callingClientFixtures.js +38 -38
  22. package/dist/module/CallingClient/constants.js +122 -122
  23. package/dist/module/CallingClient/line/index.js +158 -158
  24. package/dist/module/CallingClient/line/types.js +15 -15
  25. package/dist/module/CallingClient/registration/index.js +1 -1
  26. package/dist/module/CallingClient/registration/register.js +507 -507
  27. package/dist/module/CallingClient/registration/registerFixtures.js +28 -28
  28. package/dist/module/CallingClient/registration/types.js +1 -1
  29. package/dist/module/CallingClient/types.js +1 -1
  30. package/dist/module/Contacts/ContactsClient.js +484 -484
  31. package/dist/module/Contacts/constants.js +20 -20
  32. package/dist/module/Contacts/contactFixtures.js +284 -284
  33. package/dist/module/Contacts/types.js +10 -10
  34. package/dist/module/Errors/catalog/CallError.js +26 -26
  35. package/dist/module/Errors/catalog/CallingDeviceError.js +18 -18
  36. package/dist/module/Errors/catalog/ExtendedError.js +10 -10
  37. package/dist/module/Errors/catalog/LineError.js +24 -24
  38. package/dist/module/Errors/index.js +2 -2
  39. package/dist/module/Errors/types.js +48 -48
  40. package/dist/module/Events/impl/index.js +19 -19
  41. package/dist/module/Events/types.js +83 -83
  42. package/dist/module/Logger/index.js +114 -114
  43. package/dist/module/Logger/types.js +25 -25
  44. package/dist/module/Metrics/index.js +232 -232
  45. package/dist/module/Metrics/types.js +37 -37
  46. package/dist/module/SDKConnector/index.js +39 -39
  47. package/dist/module/SDKConnector/types.js +1 -1
  48. package/dist/module/SDKConnector/utils.js +12 -12
  49. package/dist/module/Voicemail/BroadworksBackendConnector.js +291 -291
  50. package/dist/module/Voicemail/UcmBackendConnector.js +279 -279
  51. package/dist/module/Voicemail/Voicemail.js +110 -110
  52. package/dist/module/Voicemail/WxCallBackendConnector.js +279 -279
  53. package/dist/module/Voicemail/constants.js +29 -29
  54. package/dist/module/Voicemail/types.js +1 -1
  55. package/dist/module/Voicemail/voicemailFixture.js +510 -510
  56. package/dist/module/api.js +6 -6
  57. package/dist/module/common/Utils.js +802 -802
  58. package/dist/module/common/constants.js +41 -41
  59. package/dist/module/common/index.js +1 -1
  60. package/dist/module/common/testUtil.js +938 -938
  61. package/dist/module/common/types.js +57 -57
  62. package/dist/module/index.js +8 -8
  63. package/dist/types/CallHistory/CallHistory.d.ts +17 -17
  64. package/dist/types/CallHistory/callHistoryFixtures.d.ts +94 -94
  65. package/dist/types/CallHistory/constants.d.ts +9 -9
  66. package/dist/types/CallHistory/types.d.ts +18 -18
  67. package/dist/types/CallSettings/CallSettings.d.ts +19 -19
  68. package/dist/types/CallSettings/UcmBackendConnector.d.ts +19 -19
  69. package/dist/types/CallSettings/WxCallBackendConnector.d.ts +21 -21
  70. package/dist/types/CallSettings/constants.d.ts +11 -11
  71. package/dist/types/CallSettings/testFixtures.d.ts +15 -15
  72. package/dist/types/CallSettings/types.d.ts +107 -107
  73. package/dist/types/CallingClient/CallingClient.d.ts +35 -35
  74. package/dist/types/CallingClient/callRecordFixtures.d.ts +3 -3
  75. package/dist/types/CallingClient/calling/CallerId/index.d.ts +17 -17
  76. package/dist/types/CallingClient/calling/CallerId/types.d.ts +41 -41
  77. package/dist/types/CallingClient/calling/call.d.ts +96 -96
  78. package/dist/types/CallingClient/calling/callManager.d.ts +25 -25
  79. package/dist/types/CallingClient/calling/index.d.ts +2 -2
  80. package/dist/types/CallingClient/calling/types.d.ts +206 -206
  81. package/dist/types/CallingClient/callingClientFixtures.d.ts +18 -18
  82. package/dist/types/CallingClient/constants.d.ts +122 -122
  83. package/dist/types/CallingClient/line/index.d.ts +43 -43
  84. package/dist/types/CallingClient/line/types.d.ts +55 -55
  85. package/dist/types/CallingClient/registration/index.d.ts +1 -1
  86. package/dist/types/CallingClient/registration/register.d.ts +64 -64
  87. package/dist/types/CallingClient/registration/registerFixtures.d.ts +28 -28
  88. package/dist/types/CallingClient/registration/types.d.ts +20 -20
  89. package/dist/types/CallingClient/types.d.ts +29 -29
  90. package/dist/types/Contacts/ContactsClient.d.ts +26 -26
  91. package/dist/types/Contacts/constants.d.ts +19 -19
  92. package/dist/types/Contacts/contactFixtures.d.ts +280 -280
  93. package/dist/types/Contacts/types.d.ts +72 -72
  94. package/dist/types/Errors/catalog/CallError.d.ts +11 -11
  95. package/dist/types/Errors/catalog/CallingDeviceError.d.ts +10 -10
  96. package/dist/types/Errors/catalog/ExtendedError.d.ts +6 -6
  97. package/dist/types/Errors/catalog/LineError.d.ts +10 -10
  98. package/dist/types/Errors/index.d.ts +2 -2
  99. package/dist/types/Errors/types.d.ts +60 -60
  100. package/dist/types/Events/impl/index.d.ts +8 -8
  101. package/dist/types/Events/types.d.ts +288 -288
  102. package/dist/types/Logger/index.d.ts +12 -12
  103. package/dist/types/Logger/types.d.ts +25 -25
  104. package/dist/types/Metrics/index.d.ts +5 -5
  105. package/dist/types/Metrics/types.d.ts +42 -42
  106. package/dist/types/SDKConnector/index.d.ts +12 -12
  107. package/dist/types/SDKConnector/types.d.ts +128 -128
  108. package/dist/types/SDKConnector/utils.d.ts +5 -5
  109. package/dist/types/Voicemail/BroadworksBackendConnector.d.ts +27 -27
  110. package/dist/types/Voicemail/UcmBackendConnector.d.ts +34 -34
  111. package/dist/types/Voicemail/Voicemail.d.ts +27 -27
  112. package/dist/types/Voicemail/WxCallBackendConnector.d.ts +23 -23
  113. package/dist/types/Voicemail/constants.d.ts +29 -29
  114. package/dist/types/Voicemail/types.d.ts +133 -133
  115. package/dist/types/Voicemail/voicemailFixture.d.ts +417 -417
  116. package/dist/types/api.d.ts +16 -16
  117. package/dist/types/common/Utils.d.ts +34 -34
  118. package/dist/types/common/constants.d.ts +41 -41
  119. package/dist/types/common/index.d.ts +1 -1
  120. package/dist/types/common/testUtil.d.ts +3611 -3611
  121. package/dist/types/common/types.d.ts +191 -191
  122. package/dist/types/index.d.ts +8 -8
  123. package/package.json +4 -4
  124. package/dist/CallHistory/CallHistory.js +0 -203
  125. package/dist/CallHistory/CallHistory.js.map +0 -1
  126. package/dist/CallHistory/CallHistory.test.js +0 -133
  127. package/dist/CallHistory/CallHistory.test.js.map +0 -1
  128. package/dist/CallHistory/callHistoryFixtures.js +0 -310
  129. package/dist/CallHistory/callHistoryFixtures.js.map +0 -1
  130. package/dist/CallHistory/constants.js +0 -26
  131. package/dist/CallHistory/constants.js.map +0 -1
  132. package/dist/CallHistory/types.js +0 -7
  133. package/dist/CallHistory/types.js.map +0 -1
  134. package/dist/CallSettings/CallSettings.js +0 -276
  135. package/dist/CallSettings/CallSettings.js.map +0 -1
  136. package/dist/CallSettings/CallSettings.test.js +0 -122
  137. package/dist/CallSettings/CallSettings.test.js.map +0 -1
  138. package/dist/CallSettings/UcmBackendConnector.js +0 -217
  139. package/dist/CallSettings/UcmBackendConnector.js.map +0 -1
  140. package/dist/CallSettings/UcmBackendConnector.test.js +0 -227
  141. package/dist/CallSettings/UcmBackendConnector.test.js.map +0 -1
  142. package/dist/CallSettings/WxCallBackendConnector.js +0 -541
  143. package/dist/CallSettings/WxCallBackendConnector.js.map +0 -1
  144. package/dist/CallSettings/WxCallBackendConnector.test.js +0 -802
  145. package/dist/CallSettings/WxCallBackendConnector.test.js.map +0 -1
  146. package/dist/CallSettings/constants.js +0 -30
  147. package/dist/CallSettings/constants.js.map +0 -1
  148. package/dist/CallSettings/testFixtures.js +0 -72
  149. package/dist/CallSettings/testFixtures.js.map +0 -1
  150. package/dist/CallSettings/types.js +0 -7
  151. package/dist/CallSettings/types.js.map +0 -1
  152. package/dist/CallingClient/CallingClient.js +0 -572
  153. package/dist/CallingClient/CallingClient.js.map +0 -1
  154. package/dist/CallingClient/CallingClient.test.js +0 -931
  155. package/dist/CallingClient/CallingClient.test.js.map +0 -1
  156. package/dist/CallingClient/callRecordFixtures.js +0 -103
  157. package/dist/CallingClient/callRecordFixtures.js.map +0 -1
  158. package/dist/CallingClient/calling/CallerId/index.js +0 -287
  159. package/dist/CallingClient/calling/CallerId/index.js.map +0 -1
  160. package/dist/CallingClient/calling/CallerId/index.test.js +0 -274
  161. package/dist/CallingClient/calling/CallerId/index.test.js.map +0 -1
  162. package/dist/CallingClient/calling/CallerId/types.js +0 -7
  163. package/dist/CallingClient/calling/CallerId/types.js.map +0 -1
  164. package/dist/CallingClient/calling/call.js +0 -2995
  165. package/dist/CallingClient/calling/call.js.map +0 -1
  166. package/dist/CallingClient/calling/call.test.js +0 -2614
  167. package/dist/CallingClient/calling/call.test.js.map +0 -1
  168. package/dist/CallingClient/calling/callManager.js +0 -443
  169. package/dist/CallingClient/calling/callManager.js.map +0 -1
  170. package/dist/CallingClient/calling/callManager.test.js +0 -683
  171. package/dist/CallingClient/calling/callManager.test.js.map +0 -1
  172. package/dist/CallingClient/calling/index.js +0 -30
  173. package/dist/CallingClient/calling/index.js.map +0 -1
  174. package/dist/CallingClient/calling/types.js +0 -71
  175. package/dist/CallingClient/calling/types.js.map +0 -1
  176. package/dist/CallingClient/callingClientFixtures.js +0 -53
  177. package/dist/CallingClient/callingClientFixtures.js.map +0 -1
  178. package/dist/CallingClient/constants.js +0 -226
  179. package/dist/CallingClient/constants.js.map +0 -1
  180. package/dist/CallingClient/line/index.js +0 -312
  181. package/dist/CallingClient/line/index.js.map +0 -1
  182. package/dist/CallingClient/line/line.test.js +0 -270
  183. package/dist/CallingClient/line/line.test.js.map +0 -1
  184. package/dist/CallingClient/line/types.js +0 -25
  185. package/dist/CallingClient/line/types.js.map +0 -1
  186. package/dist/CallingClient/registration/index.js +0 -19
  187. package/dist/CallingClient/registration/index.js.map +0 -1
  188. package/dist/CallingClient/registration/register.js +0 -1295
  189. package/dist/CallingClient/registration/register.js.map +0 -1
  190. package/dist/CallingClient/registration/register.test.js +0 -838
  191. package/dist/CallingClient/registration/register.test.js.map +0 -1
  192. package/dist/CallingClient/registration/registerFixtures.js +0 -41
  193. package/dist/CallingClient/registration/registerFixtures.js.map +0 -1
  194. package/dist/CallingClient/registration/types.js +0 -7
  195. package/dist/CallingClient/registration/types.js.map +0 -1
  196. package/dist/CallingClient/types.js +0 -7
  197. package/dist/CallingClient/types.js.map +0 -1
  198. package/dist/Contacts/ContactsClient.js +0 -1139
  199. package/dist/Contacts/ContactsClient.js.map +0 -1
  200. package/dist/Contacts/ContactsClient.test.js +0 -725
  201. package/dist/Contacts/ContactsClient.test.js.map +0 -1
  202. package/dist/Contacts/constants.js +0 -36
  203. package/dist/Contacts/constants.js.map +0 -1
  204. package/dist/Contacts/contactFixtures.js +0 -340
  205. package/dist/Contacts/contactFixtures.js.map +0 -1
  206. package/dist/Contacts/types.js +0 -20
  207. package/dist/Contacts/types.js.map +0 -1
  208. package/dist/Errors/catalog/CallError.js +0 -94
  209. package/dist/Errors/catalog/CallError.js.map +0 -1
  210. package/dist/Errors/catalog/CallingDeviceError.js +0 -88
  211. package/dist/Errors/catalog/CallingDeviceError.js.map +0 -1
  212. package/dist/Errors/catalog/ExtendedError.js +0 -45
  213. package/dist/Errors/catalog/ExtendedError.js.map +0 -1
  214. package/dist/Errors/catalog/LineError.js +0 -90
  215. package/dist/Errors/catalog/LineError.js.map +0 -1
  216. package/dist/Errors/index.js +0 -21
  217. package/dist/Errors/index.js.map +0 -1
  218. package/dist/Errors/types.js +0 -62
  219. package/dist/Errors/types.js.map +0 -1
  220. package/dist/Events/impl/index.js +0 -82
  221. package/dist/Events/impl/index.js.map +0 -1
  222. package/dist/Events/types.js +0 -111
  223. package/dist/Events/types.js.map +0 -1
  224. package/dist/Logger/index.js +0 -221
  225. package/dist/Logger/index.js.map +0 -1
  226. package/dist/Logger/index.test.js +0 -62
  227. package/dist/Logger/index.test.js.map +0 -1
  228. package/dist/Logger/types.js +0 -37
  229. package/dist/Logger/types.js.map +0 -1
  230. package/dist/Metrics/index.js +0 -329
  231. package/dist/Metrics/index.js.map +0 -1
  232. package/dist/Metrics/index.test.js +0 -291
  233. package/dist/Metrics/index.test.js.map +0 -1
  234. package/dist/Metrics/types.js +0 -50
  235. package/dist/Metrics/types.js.map +0 -1
  236. package/dist/SDKConnector/index.js +0 -105
  237. package/dist/SDKConnector/index.js.map +0 -1
  238. package/dist/SDKConnector/index.test.js +0 -9
  239. package/dist/SDKConnector/index.test.js.map +0 -1
  240. package/dist/SDKConnector/types.js +0 -7
  241. package/dist/SDKConnector/types.js.map +0 -1
  242. package/dist/SDKConnector/utils.js +0 -40
  243. package/dist/SDKConnector/utils.js.map +0 -1
  244. package/dist/SDKConnector/utils.test.js +0 -9
  245. package/dist/SDKConnector/utils.test.js.map +0 -1
  246. package/dist/Voicemail/BroadworksBackendConnector.js +0 -632
  247. package/dist/Voicemail/BroadworksBackendConnector.js.map +0 -1
  248. package/dist/Voicemail/BroadworksBackendConnector.test.js +0 -733
  249. package/dist/Voicemail/BroadworksBackendConnector.test.js.map +0 -1
  250. package/dist/Voicemail/UcmBackendConnector.js +0 -566
  251. package/dist/Voicemail/UcmBackendConnector.js.map +0 -1
  252. package/dist/Voicemail/UcmBackendConnector.test.js +0 -628
  253. package/dist/Voicemail/UcmBackendConnector.test.js.map +0 -1
  254. package/dist/Voicemail/Voicemail.js +0 -378
  255. package/dist/Voicemail/Voicemail.js.map +0 -1
  256. package/dist/Voicemail/Voicemail.test.js +0 -226
  257. package/dist/Voicemail/Voicemail.test.js.map +0 -1
  258. package/dist/Voicemail/WxCallBackendConnector.js +0 -540
  259. package/dist/Voicemail/WxCallBackendConnector.js.map +0 -1
  260. package/dist/Voicemail/WxCallBackendConnector.test.js +0 -942
  261. package/dist/Voicemail/WxCallBackendConnector.test.js.map +0 -1
  262. package/dist/Voicemail/constants.js +0 -66
  263. package/dist/Voicemail/constants.js.map +0 -1
  264. package/dist/Voicemail/types.js +0 -7
  265. package/dist/Voicemail/types.js.map +0 -1
  266. package/dist/Voicemail/voicemailFixture.js +0 -559
  267. package/dist/Voicemail/voicemailFixture.js.map +0 -1
  268. package/dist/api.js +0 -134
  269. package/dist/api.js.map +0 -1
  270. package/dist/common/Utils.js +0 -1264
  271. package/dist/common/Utils.js.map +0 -1
  272. package/dist/common/Utils.test.js +0 -1227
  273. package/dist/common/Utils.test.js.map +0 -1
  274. package/dist/common/constants.js +0 -90
  275. package/dist/common/constants.js.map +0 -1
  276. package/dist/common/index.js +0 -19
  277. package/dist/common/index.js.map +0 -1
  278. package/dist/common/testUtil.js +0 -968
  279. package/dist/common/testUtil.js.map +0 -1
  280. package/dist/common/types.js +0 -75
  281. package/dist/common/types.js.map +0 -1
  282. package/dist/index.js +0 -63
  283. package/dist/index.js.map +0 -1
@@ -1,192 +1,192 @@
1
- export type MobiusDeviceId = string;
2
- export type MobiusDeviceUri = string;
3
- export type SettingEnabled = boolean;
4
- export declare enum ALLOWED_SERVICES {
5
- MOBIUS = "mobius",
6
- JANUS = "janus"
7
- }
8
- export declare enum HTTP_METHODS {
9
- GET = "GET",
10
- POST = "POST",
11
- PATCH = "PATCH",
12
- PUT = "PUT",
13
- DELETE = "DELETE"
14
- }
15
- export declare enum MobiusStatus {
16
- ACTIVE = "active",
17
- DEFAULT = "default"
18
- }
19
- export declare enum CALLING_BACKEND {
20
- WXC = "WEBEX_CALLING",
21
- BWRKS = "BROADWORKS_CALLING",
22
- UCM = "UCM_CALLING",
23
- INVALID = "Calling backend is currently not supported"
24
- }
25
- export type DeviceList = unknown;
26
- export type CallId = string;
27
- export type CorrelationId = string;
28
- export type SipAddress = string;
29
- export declare enum CallType {
30
- URI = "uri",
31
- TEL = "tel"
32
- }
33
- export type CallDetails = {
34
- type: CallType;
35
- address: SipAddress;
36
- };
37
- export type CallDestination = CallDetails;
38
- export declare enum CallDirection {
39
- INBOUND = "inbound",
40
- OUTBOUND = "outbound"
41
- }
42
- export type AvatarId = string;
43
- export type DisplayName = string;
44
- export type DisplayInformation = {
45
- avatarSrc: AvatarId | undefined;
46
- name: DisplayName | undefined;
47
- num: string | undefined;
48
- id: string | undefined;
49
- };
50
- export type WebexRequestPayload = {
51
- method?: HTTP_METHODS;
52
- uri?: string;
53
- addAuthHeader?: boolean;
54
- headers?: {
55
- [key: string]: string | null;
56
- };
57
- body?: object;
58
- statusCode?: number;
59
- json?: boolean;
60
- service?: ALLOWED_SERVICES;
61
- };
62
- export type ErrorCode = string;
63
- export type Digit = string | number;
64
- export type ServerInfo = {
65
- region: string;
66
- uris: string[];
67
- };
68
- export type MobiusServers = {
69
- primary: ServerInfo;
70
- backup: ServerInfo;
71
- };
72
- export type IpInfo = {
73
- ipv4: string;
74
- ipv6: string;
75
- };
76
- export type DeviceType = {
77
- deviceId: string;
78
- uri: string;
79
- status: string;
80
- lastSeen: string;
81
- addresses: string[];
82
- clientDeviceUri: string;
83
- };
84
- export type RegionInfo = {
85
- countryCode: string;
86
- clientRegion: string;
87
- };
88
- export interface IDeviceInfo {
89
- userId?: string;
90
- errorCode?: number;
91
- device?: DeviceType;
92
- devices?: DeviceType[];
93
- keepaliveInterval?: number;
94
- callKeepaliveInterval?: number;
95
- voicePortalNumber?: number;
96
- voicePortalExtension?: number;
97
- rehomingIntervalMin?: number;
98
- rehomingIntervalMax?: number;
99
- }
100
- export interface IMetaContext {
101
- file?: string;
102
- method?: string;
103
- }
104
- export declare enum SORT {
105
- ASC = "ASC",
106
- DESC = "DESC",
107
- DEFAULT = "DESC"
108
- }
109
- export declare enum SORT_BY {
110
- END_TIME = "endTime",
111
- DEFAULT = "endTime",
112
- START_TIME = "startTime"
113
- }
114
- export declare enum ServiceIndicator {
115
- CALLING = "calling",
116
- CONTACT_CENTER = "contactcenter"
117
- }
118
- export type ServiceData = {
119
- indicator: ServiceIndicator;
120
- domain?: string;
121
- };
122
- export type PhoneNumber = {
123
- type: string;
124
- value: string;
125
- primary?: boolean;
126
- };
127
- export type PersonInfo = {
128
- id: string;
129
- emails: string[];
130
- phoneNumbers: PhoneNumber[];
131
- displayName: string;
132
- nickName: string;
133
- firstName: string;
134
- lastName: string;
135
- avatar: string;
136
- orgId: string;
137
- created: string;
138
- lastModified: string;
139
- lastActivity: string;
140
- status: string;
141
- type: string;
142
- };
143
- export type PeopleListResponse = {
144
- items: PersonInfo[];
145
- notFoundIds: string[];
146
- };
147
- export declare enum DecodeType {
148
- PEOPLE = "PEOPLE",
149
- ORGANIZATION = "ORGANIZATION"
150
- }
151
- export type ContactDetail = {
152
- type?: string;
153
- value: string;
154
- };
155
- export interface LookupOptions {
156
- ids: string[];
157
- }
158
- export type DSSLookupResponse = {
159
- additionalInfo: {
160
- department: string;
161
- firstName: string;
162
- identityManager: {
163
- managerId: string;
164
- displayName: string;
165
- };
166
- jobTitle: string;
167
- lastName: string;
168
- };
169
- displayName: string;
170
- emails: ContactDetail[];
171
- entityProviderType: string;
172
- identity: string;
173
- orgId: string;
174
- phoneNumbers: ContactDetail[];
175
- photos: ContactDetail[];
176
- sipAddresses: ContactDetail[];
177
- type: string;
178
- };
179
- export type KmsKey = {
180
- uri: string;
181
- userId: string;
182
- createDate: string;
183
- expirationDate: string;
184
- bindDate?: string;
185
- resourceUri?: string;
186
- };
187
- export type KmsResourceObject = {
188
- uri: string;
189
- keyUris: string[];
190
- authorizationUris: string[];
191
- };
1
+ export type MobiusDeviceId = string;
2
+ export type MobiusDeviceUri = string;
3
+ export type SettingEnabled = boolean;
4
+ export declare enum ALLOWED_SERVICES {
5
+ MOBIUS = "mobius",
6
+ JANUS = "janus"
7
+ }
8
+ export declare enum HTTP_METHODS {
9
+ GET = "GET",
10
+ POST = "POST",
11
+ PATCH = "PATCH",
12
+ PUT = "PUT",
13
+ DELETE = "DELETE"
14
+ }
15
+ export declare enum MobiusStatus {
16
+ ACTIVE = "active",
17
+ DEFAULT = "default"
18
+ }
19
+ export declare enum CALLING_BACKEND {
20
+ WXC = "WEBEX_CALLING",
21
+ BWRKS = "BROADWORKS_CALLING",
22
+ UCM = "UCM_CALLING",
23
+ INVALID = "Calling backend is currently not supported"
24
+ }
25
+ export type DeviceList = unknown;
26
+ export type CallId = string;
27
+ export type CorrelationId = string;
28
+ export type SipAddress = string;
29
+ export declare enum CallType {
30
+ URI = "uri",
31
+ TEL = "tel"
32
+ }
33
+ export type CallDetails = {
34
+ type: CallType;
35
+ address: SipAddress;
36
+ };
37
+ export type CallDestination = CallDetails;
38
+ export declare enum CallDirection {
39
+ INBOUND = "inbound",
40
+ OUTBOUND = "outbound"
41
+ }
42
+ export type AvatarId = string;
43
+ export type DisplayName = string;
44
+ export type DisplayInformation = {
45
+ avatarSrc: AvatarId | undefined;
46
+ name: DisplayName | undefined;
47
+ num: string | undefined;
48
+ id: string | undefined;
49
+ };
50
+ export type WebexRequestPayload = {
51
+ method?: HTTP_METHODS;
52
+ uri?: string;
53
+ addAuthHeader?: boolean;
54
+ headers?: {
55
+ [key: string]: string | null;
56
+ };
57
+ body?: object;
58
+ statusCode?: number;
59
+ json?: boolean;
60
+ service?: ALLOWED_SERVICES;
61
+ };
62
+ export type ErrorCode = string;
63
+ export type Digit = string | number;
64
+ export type ServerInfo = {
65
+ region: string;
66
+ uris: string[];
67
+ };
68
+ export type MobiusServers = {
69
+ primary: ServerInfo;
70
+ backup: ServerInfo;
71
+ };
72
+ export type IpInfo = {
73
+ ipv4: string;
74
+ ipv6: string;
75
+ };
76
+ export type DeviceType = {
77
+ deviceId: string;
78
+ uri: string;
79
+ status: string;
80
+ lastSeen: string;
81
+ addresses: string[];
82
+ clientDeviceUri: string;
83
+ };
84
+ export type RegionInfo = {
85
+ countryCode: string;
86
+ clientRegion: string;
87
+ };
88
+ export interface IDeviceInfo {
89
+ userId?: string;
90
+ errorCode?: number;
91
+ device?: DeviceType;
92
+ devices?: DeviceType[];
93
+ keepaliveInterval?: number;
94
+ callKeepaliveInterval?: number;
95
+ voicePortalNumber?: number;
96
+ voicePortalExtension?: number;
97
+ rehomingIntervalMin?: number;
98
+ rehomingIntervalMax?: number;
99
+ }
100
+ export interface IMetaContext {
101
+ file?: string;
102
+ method?: string;
103
+ }
104
+ export declare enum SORT {
105
+ ASC = "ASC",
106
+ DESC = "DESC",
107
+ DEFAULT = "DESC"
108
+ }
109
+ export declare enum SORT_BY {
110
+ END_TIME = "endTime",
111
+ DEFAULT = "endTime",
112
+ START_TIME = "startTime"
113
+ }
114
+ export declare enum ServiceIndicator {
115
+ CALLING = "calling",
116
+ CONTACT_CENTER = "contactcenter"
117
+ }
118
+ export type ServiceData = {
119
+ indicator: ServiceIndicator;
120
+ domain?: string;
121
+ };
122
+ export type PhoneNumber = {
123
+ type: string;
124
+ value: string;
125
+ primary?: boolean;
126
+ };
127
+ export type PersonInfo = {
128
+ id: string;
129
+ emails: string[];
130
+ phoneNumbers: PhoneNumber[];
131
+ displayName: string;
132
+ nickName: string;
133
+ firstName: string;
134
+ lastName: string;
135
+ avatar: string;
136
+ orgId: string;
137
+ created: string;
138
+ lastModified: string;
139
+ lastActivity: string;
140
+ status: string;
141
+ type: string;
142
+ };
143
+ export type PeopleListResponse = {
144
+ items: PersonInfo[];
145
+ notFoundIds: string[];
146
+ };
147
+ export declare enum DecodeType {
148
+ PEOPLE = "PEOPLE",
149
+ ORGANIZATION = "ORGANIZATION"
150
+ }
151
+ export type ContactDetail = {
152
+ type?: string;
153
+ value: string;
154
+ };
155
+ export interface LookupOptions {
156
+ ids: string[];
157
+ }
158
+ export type DSSLookupResponse = {
159
+ additionalInfo: {
160
+ department: string;
161
+ firstName: string;
162
+ identityManager: {
163
+ managerId: string;
164
+ displayName: string;
165
+ };
166
+ jobTitle: string;
167
+ lastName: string;
168
+ };
169
+ displayName: string;
170
+ emails: ContactDetail[];
171
+ entityProviderType: string;
172
+ identity: string;
173
+ orgId: string;
174
+ phoneNumbers: ContactDetail[];
175
+ photos: ContactDetail[];
176
+ sipAddresses: ContactDetail[];
177
+ type: string;
178
+ };
179
+ export type KmsKey = {
180
+ uri: string;
181
+ userId: string;
182
+ createDate: string;
183
+ expirationDate: string;
184
+ bindDate?: string;
185
+ resourceUri?: string;
186
+ };
187
+ export type KmsResourceObject = {
188
+ uri: string;
189
+ keyUris: string[];
190
+ authorizationUris: string[];
191
+ };
192
192
  //# sourceMappingURL=types.d.ts.map
@@ -1,9 +1,9 @@
1
- import { NoiseReductionEffect, createMicrophoneStream } from '@webex/media-helpers';
2
- import { createCallSettingsClient } from './CallSettings/CallSettings';
3
- import { createContactsClient } from './Contacts/ContactsClient';
4
- import { createClient } from './CallingClient/CallingClient';
5
- import { createCallHistoryClient } from './CallHistory/CallHistory';
6
- import { createVoicemailClient } from './Voicemail/Voicemail';
7
- import Logger from './Logger';
8
- export { createClient, createCallHistoryClient, createCallSettingsClient, createContactsClient, createMicrophoneStream, createVoicemailClient, Logger, NoiseReductionEffect, };
1
+ import { NoiseReductionEffect, createMicrophoneStream } from '@webex/media-helpers';
2
+ import { createCallSettingsClient } from './CallSettings/CallSettings';
3
+ import { createContactsClient } from './Contacts/ContactsClient';
4
+ import { createClient } from './CallingClient/CallingClient';
5
+ import { createCallHistoryClient } from './CallHistory/CallHistory';
6
+ import { createVoicemailClient } from './Voicemail/Voicemail';
7
+ import Logger from './Logger';
8
+ export { createClient, createCallHistoryClient, createCallSettingsClient, createContactsClient, createMicrophoneStream, createVoicemailClient, Logger, NoiseReductionEffect, };
9
9
  //# sourceMappingURL=index.d.ts.map
package/package.json CHANGED
@@ -33,12 +33,12 @@
33
33
  "fix:prettier": "prettier \"src/**/*.ts\" --write",
34
34
  "build:docs": "typedoc --out ../../docs/calling",
35
35
  "docs": "typedoc --emit none",
36
- "deploy:npm": "npm publish"
36
+ "deploy:npm": "yarn npm publish"
37
37
  },
38
38
  "dependencies": {
39
39
  "@types/platform": "1.3.4",
40
40
  "@webex/internal-media-core": "2.0.0",
41
- "@webex/media-helpers": "3.0.0-next.2",
41
+ "@webex/media-helpers": "^3.0.0-next.4",
42
42
  "async-mutex": "0.4.0",
43
43
  "buffer": "6.0.3",
44
44
  "jest-html-reporters": "3.0.11",
@@ -129,5 +129,5 @@
129
129
  "staticpath": "docs",
130
130
  "noprompt": true
131
131
  },
132
- "version": "3.0.0-next.2"
133
- }
132
+ "version": "3.0.0-next.4"
133
+ }
@@ -1,203 +0,0 @@
1
- "use strict";
2
-
3
- var _Reflect$construct = require("@babel/runtime-corejs2/core-js/reflect/construct");
4
- var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
5
- var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
6
- _Object$defineProperty(exports, "__esModule", {
7
- value: true
8
- });
9
- exports.createCallHistoryClient = exports.CallHistory = void 0;
10
- var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs2/regenerator"));
11
- var _values = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/values"));
12
- var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/asyncToGenerator"));
13
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));
14
- var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));
15
- var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/assertThisInitialized"));
16
- var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/inherits"));
17
- var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/possibleConstructorReturn"));
18
- var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/getPrototypeOf"));
19
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
20
- var _SDKConnector = _interopRequireDefault(require("../SDKConnector"));
21
- var _types = require("../common/types");
22
- var _Logger = _interopRequireDefault(require("../Logger"));
23
- var _Utils = require("../common/Utils");
24
- var _constants = require("./constants");
25
- var _constants2 = require("../common/constants");
26
- var _types2 = require("../Events/types");
27
- var _impl = require("../Events/impl");
28
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
29
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
30
- /**
31
- * `CallHistory` module is designed to facilitate the retrieval of Call History Records by providing a set of APIs.
32
- *
33
- * This code snippet demonstrates how to create an instance of `CallHistory` using webex and logger.
34
- *
35
- * Example
36
- * ```javascript
37
- * const callHistory = createCallHistoryClient(webex, logger);
38
- * ```
39
- *
40
- * @implements {ICallHistory}
41
- */
42
- var CallHistory = /*#__PURE__*/function (_Eventing) {
43
- (0, _inherits2.default)(CallHistory, _Eventing);
44
- var _super = _createSuper(CallHistory);
45
- /**
46
- * @ignore
47
- */
48
- function CallHistory(webex, logger) {
49
- var _this;
50
- (0, _classCallCheck2.default)(this, CallHistory);
51
- _this = _super.call(this);
52
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "sdkConnector", void 0);
53
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "webex", void 0);
54
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "janusUrl", '');
55
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "fromDate", '');
56
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "loggerContext", {
57
- file: _constants.CALL_HISTORY_FILE,
58
- method: 'getCallHistoryData'
59
- });
60
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "userSessions", void 0);
61
- _this.sdkConnector = _SDKConnector.default;
62
- if (!_this.sdkConnector.getWebex()) {
63
- _SDKConnector.default.setWebex(webex);
64
- }
65
- _this.webex = _this.sdkConnector.getWebex();
66
- _this.janusUrl = _this.webex.internal.services._serviceUrls.janus;
67
- _this.registerSessionsListener();
68
- _Logger.default.setLogger(logger.level, _constants.CALL_HISTORY_FILE);
69
- return _this;
70
- }
71
-
72
- /**
73
- * Function to display the Janus API response.
74
- * @param days - Number of days to fetch the call history data.
75
- * @param limit - Number of records to be fetched.
76
- * @param sort - Sort the records in ascending or descending order.
77
- * @param sortBy - Sort the records by start time or end time.
78
- */
79
- (0, _createClass2.default)(CallHistory, [{
80
- key: "getCallHistoryData",
81
- value: function () {
82
- var _getCallHistoryData = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
83
- var days,
84
- limit,
85
- sort,
86
- sortBy,
87
- date,
88
- sortByParam,
89
- sortParam,
90
- url,
91
- janusResponse,
92
- responseDetails,
93
- errorInfo,
94
- errorStatus,
95
- _args = arguments;
96
- return _regenerator.default.wrap(function _callee$(_context) {
97
- while (1) switch (_context.prev = _context.next) {
98
- case 0:
99
- days = _args.length > 0 && _args[0] !== undefined ? _args[0] : _constants.NUMBER_OF_DAYS;
100
- limit = _args.length > 1 && _args[1] !== undefined ? _args[1] : _constants.LIMIT;
101
- sort = _args.length > 2 && _args[2] !== undefined ? _args[2] : _types.SORT.DEFAULT;
102
- sortBy = _args.length > 3 && _args[3] !== undefined ? _args[3] : _types.SORT_BY.DEFAULT;
103
- /*
104
- 1. Mandatory field for Janus API - fromDate
105
- 2. Calculating the fromDate by deducting the NUMBER_OF_DAYS with the current date
106
- */
107
- date = new Date();
108
- date.setDate(date.getDate() - days);
109
- this.fromDate = date.toISOString();
110
- sortByParam = (0, _values.default)(_types.SORT_BY).includes(sortBy) ? sortBy : _types.SORT_BY.DEFAULT;
111
- sortParam = (0, _values.default)(_types.SORT).includes(sort) ? sort : _types.SORT.DEFAULT;
112
- _Logger.default.log("Janus API URL ".concat(this.janusUrl), this.loggerContext);
113
- _Logger.default.info("Call history from date : ".concat(this.fromDate), this.loggerContext);
114
- _Logger.default.info("Call history sort type : ".concat(sortParam), this.loggerContext);
115
- _Logger.default.info("Call history sortby type : ".concat(sortByParam), this.loggerContext);
116
- url = "".concat(this.janusUrl, "/").concat(_constants.HISTORY, "/").concat(_constants2.USER_SESSIONS).concat(_constants.FROM_DATE, "=").concat(this.fromDate, "&limit=").concat(limit, "&includeNewSessionTypes=true&sort=").concat(sortParam);
117
- _context.prev = 14;
118
- _context.next = 17;
119
- return this.webex.request({
120
- uri: "".concat(url),
121
- method: _types.HTTP_METHODS.GET,
122
- service: _types.ALLOWED_SERVICES.JANUS
123
- });
124
- case 17:
125
- janusResponse = _context.sent;
126
- this.userSessions = janusResponse.body;
127
- if (sortByParam === _types.SORT_BY.START_TIME) {
128
- if (sortParam === _types.SORT.DESC) {
129
- this.userSessions[_constants2.USER_SESSIONS].sort(function (element, compareElement) {
130
- return new Date(compareElement[sortByParam]).getTime() - new Date(element[sortByParam]).getTime();
131
- });
132
- } else if (sortParam === _types.SORT.ASC) {
133
- this.userSessions[_constants2.USER_SESSIONS].sort(function (element, compareElement) {
134
- return new Date(element[sortByParam]).getTime() - new Date(compareElement[sortByParam]).getTime();
135
- });
136
- }
137
- }
138
- responseDetails = {
139
- statusCode: this.userSessions[_constants2.STATUS_CODE],
140
- data: {
141
- userSessions: this.userSessions[_constants2.USER_SESSIONS]
142
- },
143
- message: _constants2.SUCCESS_MESSAGE
144
- };
145
- return _context.abrupt("return", responseDetails);
146
- case 24:
147
- _context.prev = 24;
148
- _context.t0 = _context["catch"](14);
149
- errorInfo = _context.t0;
150
- errorStatus = (0, _Utils.serviceErrorCodeHandler)(errorInfo, this.loggerContext);
151
- return _context.abrupt("return", errorStatus);
152
- case 29:
153
- case "end":
154
- return _context.stop();
155
- }
156
- }, _callee, this, [[14, 24]]);
157
- }));
158
- function getCallHistoryData() {
159
- return _getCallHistoryData.apply(this, arguments);
160
- }
161
- return getCallHistoryData;
162
- }()
163
- /**
164
- *
165
- */
166
- }, {
167
- key: "registerSessionsListener",
168
- value: function registerSessionsListener() {
169
- var _this2 = this;
170
- this.sdkConnector.registerListener(_types2.MOBIUS_EVENT_KEYS.CALL_SESSION_EVENT_INCLUSIVE, /*#__PURE__*/function () {
171
- var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(event) {
172
- return _regenerator.default.wrap(function _callee2$(_context2) {
173
- while (1) switch (_context2.prev = _context2.next) {
174
- case 0:
175
- if (event && event.data.userSessions.userSessions) {
176
- _this2.emit(_types2.COMMON_EVENT_KEYS.CALL_HISTORY_USER_SESSION_INFO, event);
177
- }
178
- case 1:
179
- case "end":
180
- return _context2.stop();
181
- }
182
- }, _callee2);
183
- }));
184
- return function (_x) {
185
- return _ref.apply(this, arguments);
186
- };
187
- }());
188
- }
189
- }]);
190
- return CallHistory;
191
- }(_impl.Eventing);
192
- /**
193
- * Creates a `CallHistory` client instance for accessing Call History APIs.
194
- *
195
- * @param {WebexSDK} webex - `Webex SDK` instance.
196
- * @param {LoggerInterface} logger - An instance implementing LoggerInterface used to set the log level for the module.
197
- */
198
- exports.CallHistory = CallHistory;
199
- var createCallHistoryClient = function createCallHistoryClient(webex, logger) {
200
- return new CallHistory(webex, logger);
201
- };
202
- exports.createCallHistoryClient = createCallHistoryClient;
203
- //# sourceMappingURL=CallHistory.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_SDKConnector","_interopRequireDefault","require","_types","_Logger","_Utils","_constants","_constants2","_types2","_impl","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","_getPrototypeOf2","default","result","NewTarget","constructor","_Reflect$construct","arguments","apply","_possibleConstructorReturn2","Reflect","sham","Proxy","Boolean","prototype","valueOf","call","e","CallHistory","_Eventing","_inherits2","_super","webex","logger","_this","_classCallCheck2","_defineProperty2","_assertThisInitialized2","file","CALL_HISTORY_FILE","method","sdkConnector","SDKConnector","getWebex","setWebex","janusUrl","internal","services","_serviceUrls","janus","registerSessionsListener","log","setLogger","level","_createClass2","key","value","_getCallHistoryData","_asyncToGenerator2","_regenerator","mark","_callee","days","limit","sort","sortBy","date","sortByParam","sortParam","url","janusResponse","responseDetails","errorInfo","errorStatus","_args","wrap","_callee$","_context","prev","next","length","undefined","NUMBER_OF_DAYS","LIMIT","SORT","DEFAULT","SORT_BY","Date","setDate","getDate","fromDate","toISOString","_values","includes","concat","loggerContext","info","HISTORY","USER_SESSIONS","FROM_DATE","request","uri","HTTP_METHODS","GET","service","ALLOWED_SERVICES","JANUS","sent","userSessions","body","START_TIME","DESC","element","compareElement","getTime","ASC","statusCode","STATUS_CODE","data","message","SUCCESS_MESSAGE","abrupt","t0","serviceErrorCodeHandler","stop","getCallHistoryData","_this2","registerListener","MOBIUS_EVENT_KEYS","CALL_SESSION_EVENT_INCLUSIVE","_ref","_callee2","event","_callee2$","_context2","emit","COMMON_EVENT_KEYS","CALL_HISTORY_USER_SESSION_INFO","_x","Eventing","exports","createCallHistoryClient"],"sources":["CallHistory.ts"],"sourcesContent":["/* eslint-disable dot-notation */\n/* eslint-disable no-underscore-dangle */\nimport SDKConnector from '../SDKConnector';\nimport {ISDKConnector, WebexSDK} from '../SDKConnector/types';\nimport {ALLOWED_SERVICES, HTTP_METHODS, WebexRequestPayload, SORT, SORT_BY} from '../common/types';\nimport {ICallHistory, JanusResponseEvent, LoggerInterface} from './types';\nimport log from '../Logger';\nimport {serviceErrorCodeHandler} from '../common/Utils';\nimport {CALL_HISTORY_FILE, FROM_DATE, HISTORY, LIMIT, NUMBER_OF_DAYS} from './constants';\nimport {STATUS_CODE, SUCCESS_MESSAGE, USER_SESSIONS} from '../common/constants';\nimport {\n COMMON_EVENT_KEYS,\n CallHistoryEventTypes,\n CallSessionEvent,\n MOBIUS_EVENT_KEYS,\n UserSession,\n} from '../Events/types';\nimport {Eventing} from '../Events/impl';\n/**\n * `CallHistory` module is designed to facilitate the retrieval of Call History Records by providing a set of APIs.\n *\n * This code snippet demonstrates how to create an instance of `CallHistory` using webex and logger.\n *\n * Example\n * ```javascript\n * const callHistory = createCallHistoryClient(webex, logger);\n * ```\n *\n * @implements {ICallHistory}\n */\nexport class CallHistory extends Eventing<CallHistoryEventTypes> implements ICallHistory {\n private sdkConnector: ISDKConnector;\n\n private webex: WebexSDK;\n\n private janusUrl = '';\n\n private fromDate = '';\n\n private loggerContext = {\n file: CALL_HISTORY_FILE,\n method: 'getCallHistoryData',\n };\n\n private userSessions: UserSession[] | undefined;\n\n /**\n * @ignore\n */\n constructor(webex: WebexSDK, logger: LoggerInterface) {\n super();\n this.sdkConnector = SDKConnector;\n if (!this.sdkConnector.getWebex()) {\n SDKConnector.setWebex(webex);\n }\n this.webex = this.sdkConnector.getWebex();\n this.janusUrl = this.webex.internal.services._serviceUrls.janus;\n this.registerSessionsListener();\n log.setLogger(logger.level, CALL_HISTORY_FILE);\n }\n\n /**\n * Function to display the Janus API response.\n * @param days - Number of days to fetch the call history data.\n * @param limit - Number of records to be fetched.\n * @param sort - Sort the records in ascending or descending order.\n * @param sortBy - Sort the records by start time or end time.\n */\n public async getCallHistoryData(\n days: number = NUMBER_OF_DAYS,\n limit: number = LIMIT,\n sort: SORT = SORT.DEFAULT,\n sortBy: SORT_BY = SORT_BY.DEFAULT\n ): Promise<JanusResponseEvent> {\n /*\n 1. Mandatory field for Janus API - fromDate\n 2. Calculating the fromDate by deducting the NUMBER_OF_DAYS with the current date\n */\n const date = new Date();\n\n date.setDate(date.getDate() - days);\n this.fromDate = date.toISOString();\n const sortByParam = Object.values(SORT_BY).includes(sortBy) ? sortBy : SORT_BY.DEFAULT;\n const sortParam = Object.values(SORT).includes(sort) ? sort : SORT.DEFAULT;\n\n log.log(`Janus API URL ${this.janusUrl}`, this.loggerContext);\n log.info(`Call history from date : ${this.fromDate}`, this.loggerContext);\n log.info(`Call history sort type : ${sortParam}`, this.loggerContext);\n log.info(`Call history sortby type : ${sortByParam}`, this.loggerContext);\n const url = `${this.janusUrl}/${HISTORY}/${USER_SESSIONS}${FROM_DATE}=${this.fromDate}&limit=${limit}&includeNewSessionTypes=true&sort=${sortParam}`;\n\n try {\n const janusResponse = <WebexRequestPayload>await this.webex.request({\n uri: `${url}`,\n method: HTTP_METHODS.GET,\n service: ALLOWED_SERVICES.JANUS,\n });\n\n this.userSessions = janusResponse.body as UserSession[];\n if (sortByParam === SORT_BY.START_TIME) {\n if (sortParam === SORT.DESC) {\n this.userSessions[USER_SESSIONS].sort(\n (element: Date, compareElement: Date) =>\n new Date(compareElement[sortByParam]).getTime() -\n new Date(element[sortByParam]).getTime()\n );\n } else if (sortParam === SORT.ASC) {\n this.userSessions[USER_SESSIONS].sort(\n (element: Date, compareElement: Date) =>\n new Date(element[sortByParam]).getTime() -\n new Date(compareElement[sortByParam]).getTime()\n );\n }\n }\n const responseDetails = {\n statusCode: this.userSessions[STATUS_CODE],\n data: {\n userSessions: this.userSessions[USER_SESSIONS],\n },\n message: SUCCESS_MESSAGE,\n };\n\n return responseDetails;\n } catch (err: unknown) {\n const errorInfo = err as WebexRequestPayload;\n const errorStatus = serviceErrorCodeHandler(errorInfo, this.loggerContext);\n\n return errorStatus;\n }\n }\n\n /**\n *\n */\n private registerSessionsListener() {\n this.sdkConnector.registerListener<CallSessionEvent>(\n MOBIUS_EVENT_KEYS.CALL_SESSION_EVENT_INCLUSIVE,\n async (event?: CallSessionEvent) => {\n if (event && event.data.userSessions.userSessions) {\n this.emit(COMMON_EVENT_KEYS.CALL_HISTORY_USER_SESSION_INFO, event as CallSessionEvent);\n }\n }\n );\n }\n}\n/**\n * Creates a `CallHistory` client instance for accessing Call History APIs.\n *\n * @param {WebexSDK} webex - `Webex SDK` instance.\n * @param {LoggerInterface} logger - An instance implementing LoggerInterface used to set the log level for the module.\n */\nexport const createCallHistoryClient = (webex: WebexSDK, logger: LoggerInterface): ICallHistory =>\n new CallHistory(webex, logger);\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAEA,IAAAA,aAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AAEA,IAAAE,OAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AAOA,IAAAO,KAAA,GAAAP,OAAA;AAAwC,SAAAQ,aAAAC,OAAA,QAAAC,yBAAA,GAAAC,yBAAA,oBAAAC,qBAAA,QAAAC,KAAA,OAAAC,gBAAA,CAAAC,OAAA,EAAAN,OAAA,GAAAO,MAAA,MAAAN,yBAAA,QAAAO,SAAA,OAAAH,gBAAA,CAAAC,OAAA,QAAAG,WAAA,EAAAF,MAAA,GAAAG,kBAAA,CAAAN,KAAA,EAAAO,SAAA,EAAAH,SAAA,YAAAD,MAAA,GAAAH,KAAA,CAAAQ,KAAA,OAAAD,SAAA,gBAAAE,2BAAA,CAAAP,OAAA,QAAAC,MAAA;AAAA,SAAAL,0BAAA,eAAAY,OAAA,qBAAAJ,kBAAA,oBAAAA,kBAAA,CAAAK,IAAA,2BAAAC,KAAA,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