@rc-ex/core 1.6.14 → 1.6.15

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 (330) hide show
  1. package/dist/cjs/FormData.js +42 -107
  2. package/dist/cjs/Rest.js +68 -105
  3. package/dist/cjs/RestException.js +11 -28
  4. package/dist/cjs/SdkExtension.js +6 -9
  5. package/dist/cjs/Utils.js +25 -36
  6. package/dist/cjs/index.js +141 -269
  7. package/dist/cjs/paths/Ai/Audio/V1/Async/SpeakerDiarize/index.js +12 -56
  8. package/dist/cjs/paths/Ai/Audio/V1/Async/SpeakerIdentify/index.js +12 -56
  9. package/dist/cjs/paths/Ai/Audio/V1/Async/SpeechToText/index.js +12 -56
  10. package/dist/cjs/paths/Ai/Audio/V1/Async/index.js +17 -16
  11. package/dist/cjs/paths/Ai/Audio/V1/Enrollments/index.js +39 -123
  12. package/dist/cjs/paths/Ai/Audio/V1/index.js +14 -14
  13. package/dist/cjs/paths/Ai/Audio/index.js +11 -10
  14. package/dist/cjs/paths/Ai/Insights/V1/Async/AnalyzeInteraction/index.js +12 -56
  15. package/dist/cjs/paths/Ai/Insights/V1/Async/index.js +11 -10
  16. package/dist/cjs/paths/Ai/Insights/V1/index.js +11 -10
  17. package/dist/cjs/paths/Ai/Insights/index.js +11 -10
  18. package/dist/cjs/paths/Ai/Ringsense/V1/Public/Accounts/Domains/Records/Insights/index.js +12 -56
  19. package/dist/cjs/paths/Ai/Ringsense/V1/Public/Accounts/Domains/Records/index.js +13 -13
  20. package/dist/cjs/paths/Ai/Ringsense/V1/Public/Accounts/Domains/index.js +13 -14
  21. package/dist/cjs/paths/Ai/Ringsense/V1/Public/Accounts/index.js +13 -14
  22. package/dist/cjs/paths/Ai/Ringsense/V1/Public/index.js +11 -11
  23. package/dist/cjs/paths/Ai/Ringsense/V1/index.js +11 -10
  24. package/dist/cjs/paths/Ai/Ringsense/index.js +11 -10
  25. package/dist/cjs/paths/Ai/Status/V1/Jobs/index.js +17 -63
  26. package/dist/cjs/paths/Ai/Status/V1/index.js +11 -11
  27. package/dist/cjs/paths/Ai/Status/index.js +11 -10
  28. package/dist/cjs/paths/Ai/Text/V1/Async/Punctuate/index.js +12 -56
  29. package/dist/cjs/paths/Ai/Text/V1/Async/Summarize/index.js +12 -56
  30. package/dist/cjs/paths/Ai/Text/V1/Async/index.js +14 -13
  31. package/dist/cjs/paths/Ai/Text/V1/index.js +11 -10
  32. package/dist/cjs/paths/Ai/Text/index.js +11 -10
  33. package/dist/cjs/paths/Ai/index.js +21 -21
  34. package/dist/cjs/paths/Analytics/Calls/V1/Accounts/Aggregation/Fetch/index.js +12 -56
  35. package/dist/cjs/paths/Analytics/Calls/V1/Accounts/Aggregation/index.js +11 -10
  36. package/dist/cjs/paths/Analytics/Calls/V1/Accounts/Timeline/Fetch/index.js +12 -56
  37. package/dist/cjs/paths/Analytics/Calls/V1/Accounts/Timeline/index.js +11 -10
  38. package/dist/cjs/paths/Analytics/Calls/V1/Accounts/index.js +16 -16
  39. package/dist/cjs/paths/Analytics/Calls/V1/index.js +11 -11
  40. package/dist/cjs/paths/Analytics/Calls/index.js +11 -10
  41. package/dist/cjs/paths/Analytics/index.js +9 -9
  42. package/dist/cjs/paths/Rcvideo/V1/Account/Extension/Recordings/index.js +12 -56
  43. package/dist/cjs/paths/Rcvideo/V1/Account/Extension/index.js +13 -13
  44. package/dist/cjs/paths/Rcvideo/V1/Account/Recordings/index.js +12 -56
  45. package/dist/cjs/paths/Rcvideo/V1/Account/index.js +16 -17
  46. package/dist/cjs/paths/Rcvideo/V1/Accounts/Extensions/Delegators/index.js +12 -56
  47. package/dist/cjs/paths/Rcvideo/V1/Accounts/Extensions/index.js +13 -13
  48. package/dist/cjs/paths/Rcvideo/V1/Accounts/index.js +13 -14
  49. package/dist/cjs/paths/Rcvideo/V1/History/Meetings/index.js +21 -76
  50. package/dist/cjs/paths/Rcvideo/V1/History/index.js +11 -11
  51. package/dist/cjs/paths/Rcvideo/V1/index.js +17 -18
  52. package/dist/cjs/paths/Rcvideo/V2/Account/Extension/Bridges/Default/index.js +12 -56
  53. package/dist/cjs/paths/Rcvideo/V2/Account/Extension/Bridges/index.js +15 -59
  54. package/dist/cjs/paths/Rcvideo/V2/Account/Extension/index.js +13 -13
  55. package/dist/cjs/paths/Rcvideo/V2/Account/index.js +13 -14
  56. package/dist/cjs/paths/Rcvideo/V2/Bridges/Pin/Pstn/index.js +17 -63
  57. package/dist/cjs/paths/Rcvideo/V2/Bridges/Pin/Web/index.js +17 -63
  58. package/dist/cjs/paths/Rcvideo/V2/Bridges/Pin/index.js +14 -15
  59. package/dist/cjs/paths/Rcvideo/V2/Bridges/index.js +34 -100
  60. package/dist/cjs/paths/Rcvideo/V2/index.js +14 -15
  61. package/dist/cjs/paths/Rcvideo/index.js +12 -12
  62. package/dist/cjs/paths/Restapi/Account/A2pSms/Batches/index.js +25 -89
  63. package/dist/cjs/paths/Restapi/Account/A2pSms/Messages/index.js +21 -76
  64. package/dist/cjs/paths/Restapi/Account/A2pSms/OptOuts/BulkAssign/index.js +12 -56
  65. package/dist/cjs/paths/Restapi/Account/A2pSms/OptOuts/index.js +15 -59
  66. package/dist/cjs/paths/Restapi/Account/A2pSms/Statuses/index.js +12 -56
  67. package/dist/cjs/paths/Restapi/Account/A2pSms/index.js +20 -21
  68. package/dist/cjs/paths/Restapi/Account/ActiveCalls/index.js +12 -56
  69. package/dist/cjs/paths/Restapi/Account/AddressBookBulkUpload/Tasks/index.js +17 -63
  70. package/dist/cjs/paths/Restapi/Account/AddressBookBulkUpload/index.js +15 -60
  71. package/dist/cjs/paths/Restapi/Account/AnsweringRule/index.js +39 -123
  72. package/dist/cjs/paths/Restapi/Account/AssignedRole/index.js +12 -56
  73. package/dist/cjs/paths/Restapi/Account/AuditTrail/Search/index.js +12 -56
  74. package/dist/cjs/paths/Restapi/Account/AuditTrail/index.js +11 -10
  75. package/dist/cjs/paths/Restapi/Account/BusinessAddress/index.js +16 -69
  76. package/dist/cjs/paths/Restapi/Account/BusinessHours/index.js +16 -69
  77. package/dist/cjs/paths/Restapi/Account/CallLog/index.js +21 -76
  78. package/dist/cjs/paths/Restapi/Account/CallLogSync/index.js +12 -56
  79. package/dist/cjs/paths/Restapi/Account/CallMonitoringGroups/BulkAssign/index.js +12 -56
  80. package/dist/cjs/paths/Restapi/Account/CallMonitoringGroups/Members/index.js +12 -56
  81. package/dist/cjs/paths/Restapi/Account/CallMonitoringGroups/index.js +38 -112
  82. package/dist/cjs/paths/Restapi/Account/CallQueues/BulkAssign/index.js +12 -56
  83. package/dist/cjs/paths/Restapi/Account/CallQueues/Members/index.js +12 -56
  84. package/dist/cjs/paths/Restapi/Account/CallQueues/Presence/index.js +16 -69
  85. package/dist/cjs/paths/Restapi/Account/CallQueues/index.js +37 -102
  86. package/dist/cjs/paths/Restapi/Account/CallRecording/BulkAssign/index.js +12 -56
  87. package/dist/cjs/paths/Restapi/Account/CallRecording/CustomGreetings/index.js +25 -89
  88. package/dist/cjs/paths/Restapi/Account/CallRecording/Extensions/index.js +12 -56
  89. package/dist/cjs/paths/Restapi/Account/CallRecording/index.js +25 -79
  90. package/dist/cjs/paths/Restapi/Account/CallRecordings/index.js +12 -56
  91. package/dist/cjs/paths/Restapi/Account/CustomFields/index.js +32 -106
  92. package/dist/cjs/paths/Restapi/Account/Device/Emergency/index.js +12 -56
  93. package/dist/cjs/paths/Restapi/Account/Device/SipInfo/index.js +12 -56
  94. package/dist/cjs/paths/Restapi/Account/Device/index.js +30 -86
  95. package/dist/cjs/paths/Restapi/Account/Directory/Entries/Search/index.js +12 -56
  96. package/dist/cjs/paths/Restapi/Account/Directory/Entries/index.js +24 -79
  97. package/dist/cjs/paths/Restapi/Account/Directory/Federation/index.js +12 -56
  98. package/dist/cjs/paths/Restapi/Account/Directory/index.js +14 -14
  99. package/dist/cjs/paths/Restapi/Account/EmergencyAddressAutoUpdate/Devices/BulkAssign/index.js +12 -56
  100. package/dist/cjs/paths/Restapi/Account/EmergencyAddressAutoUpdate/Devices/index.js +15 -59
  101. package/dist/cjs/paths/Restapi/Account/EmergencyAddressAutoUpdate/Networks/index.js +39 -123
  102. package/dist/cjs/paths/Restapi/Account/EmergencyAddressAutoUpdate/Switches/index.js +39 -123
  103. package/dist/cjs/paths/Restapi/Account/EmergencyAddressAutoUpdate/SwitchesBulkCreate/index.js +12 -56
  104. package/dist/cjs/paths/Restapi/Account/EmergencyAddressAutoUpdate/SwitchesBulkUpdate/index.js +12 -56
  105. package/dist/cjs/paths/Restapi/Account/EmergencyAddressAutoUpdate/SwitchesBulkValidate/index.js +12 -56
  106. package/dist/cjs/paths/Restapi/Account/EmergencyAddressAutoUpdate/Tasks/index.js +17 -63
  107. package/dist/cjs/paths/Restapi/Account/EmergencyAddressAutoUpdate/Users/BulkAssign/index.js +12 -56
  108. package/dist/cjs/paths/Restapi/Account/EmergencyAddressAutoUpdate/Users/index.js +15 -59
  109. package/dist/cjs/paths/Restapi/Account/EmergencyAddressAutoUpdate/WirelessPoints/index.js +39 -123
  110. package/dist/cjs/paths/Restapi/Account/EmergencyAddressAutoUpdate/WirelessPointsBulkCreate/index.js +12 -56
  111. package/dist/cjs/paths/Restapi/Account/EmergencyAddressAutoUpdate/WirelessPointsBulkUpdate/index.js +12 -56
  112. package/dist/cjs/paths/Restapi/Account/EmergencyAddressAutoUpdate/WirelessPointsBulkValidate/index.js +12 -56
  113. package/dist/cjs/paths/Restapi/Account/EmergencyAddressAutoUpdate/index.js +44 -47
  114. package/dist/cjs/paths/Restapi/Account/EmergencyLocations/index.js +39 -123
  115. package/dist/cjs/paths/Restapi/Account/Extension/ActiveCalls/index.js +12 -56
  116. package/dist/cjs/paths/Restapi/Account/Extension/AddressBook/Contact/index.js +46 -140
  117. package/dist/cjs/paths/Restapi/Account/Extension/AddressBook/index.js +11 -11
  118. package/dist/cjs/paths/Restapi/Account/Extension/AddressBookSync/index.js +12 -56
  119. package/dist/cjs/paths/Restapi/Account/Extension/AdministeredSites/index.js +16 -69
  120. package/dist/cjs/paths/Restapi/Account/Extension/AnsweringRule/index.js +39 -123
  121. package/dist/cjs/paths/Restapi/Account/Extension/AssignableRoles/index.js +12 -56
  122. package/dist/cjs/paths/Restapi/Account/Extension/AssignedRole/Default/index.js +12 -56
  123. package/dist/cjs/paths/Restapi/Account/Extension/AssignedRole/index.js +19 -72
  124. package/dist/cjs/paths/Restapi/Account/Extension/AuthzProfile/Check/index.js +12 -56
  125. package/dist/cjs/paths/Restapi/Account/Extension/AuthzProfile/index.js +15 -59
  126. package/dist/cjs/paths/Restapi/Account/Extension/BusinessHours/index.js +16 -69
  127. package/dist/cjs/paths/Restapi/Account/Extension/CallLog/index.js +25 -89
  128. package/dist/cjs/paths/Restapi/Account/Extension/CallLogSync/index.js +12 -56
  129. package/dist/cjs/paths/Restapi/Account/Extension/CallQueuePresence/index.js +16 -69
  130. package/dist/cjs/paths/Restapi/Account/Extension/CallQueues/index.js +12 -56
  131. package/dist/cjs/paths/Restapi/Account/Extension/CallerBlocking/PhoneNumbers/index.js +39 -123
  132. package/dist/cjs/paths/Restapi/Account/Extension/CallerBlocking/index.js +19 -73
  133. package/dist/cjs/paths/Restapi/Account/Extension/CallerId/index.js +16 -69
  134. package/dist/cjs/paths/Restapi/Account/Extension/CompanyPager/index.js +12 -56
  135. package/dist/cjs/paths/Restapi/Account/Extension/Conferencing/index.js +16 -69
  136. package/dist/cjs/paths/Restapi/Account/Extension/Device/index.js +12 -56
  137. package/dist/cjs/paths/Restapi/Account/Extension/EmergencyLocations/index.js +39 -123
  138. package/dist/cjs/paths/Restapi/Account/Extension/Favorite/index.js +16 -69
  139. package/dist/cjs/paths/Restapi/Account/Extension/Fax/index.js +14 -60
  140. package/dist/cjs/paths/Restapi/Account/Extension/Features/index.js +12 -56
  141. package/dist/cjs/paths/Restapi/Account/Extension/ForwardingNumber/index.js +43 -136
  142. package/dist/cjs/paths/Restapi/Account/Extension/Grant/index.js +12 -56
  143. package/dist/cjs/paths/Restapi/Account/Extension/Greeting/Content/index.js +14 -66
  144. package/dist/cjs/paths/Restapi/Account/Extension/Greeting/index.js +26 -83
  145. package/dist/cjs/paths/Restapi/Account/Extension/MessageStore/Content/index.js +19 -73
  146. package/dist/cjs/paths/Restapi/Account/Extension/MessageStore/index.js +49 -144
  147. package/dist/cjs/paths/Restapi/Account/Extension/MessageStoreTemplates/index.js +39 -123
  148. package/dist/cjs/paths/Restapi/Account/Extension/MessageSync/index.js +12 -56
  149. package/dist/cjs/paths/Restapi/Account/Extension/Mms/index.js +14 -60
  150. package/dist/cjs/paths/Restapi/Account/Extension/NotificationSettings/index.js +16 -69
  151. package/dist/cjs/paths/Restapi/Account/Extension/OverflowSettings/index.js +16 -69
  152. package/dist/cjs/paths/Restapi/Account/Extension/PhoneNumber/index.js +12 -56
  153. package/dist/cjs/paths/Restapi/Account/Extension/Presence/index.js +16 -69
  154. package/dist/cjs/paths/Restapi/Account/Extension/ProfileImage/index.js +40 -131
  155. package/dist/cjs/paths/Restapi/Account/Extension/RingOut/index.js +28 -93
  156. package/dist/cjs/paths/Restapi/Account/Extension/Sms/index.js +14 -60
  157. package/dist/cjs/paths/Restapi/Account/Extension/UnifiedPresence/index.js +16 -69
  158. package/dist/cjs/paths/Restapi/Account/Extension/VideoConfiguration/index.js +12 -56
  159. package/dist/cjs/paths/Restapi/Account/Extension/index.js +146 -229
  160. package/dist/cjs/paths/Restapi/Account/ExtensionBulkUpdate/Tasks/index.js +17 -63
  161. package/dist/cjs/paths/Restapi/Account/ExtensionBulkUpdate/index.js +15 -60
  162. package/dist/cjs/paths/Restapi/Account/ForwardAllCalls/index.js +16 -69
  163. package/dist/cjs/paths/Restapi/Account/Greeting/Content/index.js +14 -66
  164. package/dist/cjs/paths/Restapi/Account/Greeting/index.js +17 -63
  165. package/dist/cjs/paths/Restapi/Account/IvrMenus/index.js +32 -106
  166. package/dist/cjs/paths/Restapi/Account/IvrPrompts/Content/index.js +14 -66
  167. package/dist/cjs/paths/Restapi/Account/IvrPrompts/index.js +44 -130
  168. package/dist/cjs/paths/Restapi/Account/MessageStoreConfiguration/index.js +16 -69
  169. package/dist/cjs/paths/Restapi/Account/MessageStoreReport/Archive/index.js +12 -56
  170. package/dist/cjs/paths/Restapi/Account/MessageStoreReport/index.js +24 -79
  171. package/dist/cjs/paths/Restapi/Account/MessageStoreTemplates/index.js +39 -123
  172. package/dist/cjs/paths/Restapi/Account/PagingOnlyGroups/BulkAssign/index.js +12 -56
  173. package/dist/cjs/paths/Restapi/Account/PagingOnlyGroups/Devices/index.js +12 -56
  174. package/dist/cjs/paths/Restapi/Account/PagingOnlyGroups/Users/index.js +12 -56
  175. package/dist/cjs/paths/Restapi/Account/PagingOnlyGroups/index.js +19 -19
  176. package/dist/cjs/paths/Restapi/Account/PhoneNumber/index.js +21 -76
  177. package/dist/cjs/paths/Restapi/Account/Presence/index.js +12 -56
  178. package/dist/cjs/paths/Restapi/Account/Recording/Content/index.js +14 -66
  179. package/dist/cjs/paths/Restapi/Account/Recording/index.js +20 -66
  180. package/dist/cjs/paths/Restapi/Account/ServiceInfo/index.js +12 -56
  181. package/dist/cjs/paths/Restapi/Account/Sites/BulkAssign/index.js +12 -56
  182. package/dist/cjs/paths/Restapi/Account/Sites/Ivr/index.js +16 -69
  183. package/dist/cjs/paths/Restapi/Account/Sites/Members/index.js +12 -56
  184. package/dist/cjs/paths/Restapi/Account/Sites/index.js +48 -132
  185. package/dist/cjs/paths/Restapi/Account/Telephony/CallOut/index.js +12 -56
  186. package/dist/cjs/paths/Restapi/Account/Telephony/Conference/index.js +12 -56
  187. package/dist/cjs/paths/Restapi/Account/Telephony/Metadata/MultichannelRecordings/Content/index.js +12 -56
  188. package/dist/cjs/paths/Restapi/Account/Telephony/Metadata/MultichannelRecordings/index.js +13 -13
  189. package/dist/cjs/paths/Restapi/Account/Telephony/Metadata/index.js +11 -11
  190. package/dist/cjs/paths/Restapi/Account/Telephony/Sessions/Parties/Answer/index.js +12 -56
  191. package/dist/cjs/paths/Restapi/Account/Telephony/Sessions/Parties/Bridge/index.js +12 -56
  192. package/dist/cjs/paths/Restapi/Account/Telephony/Sessions/Parties/BringIn/index.js +12 -56
  193. package/dist/cjs/paths/Restapi/Account/Telephony/Sessions/Parties/Flip/index.js +12 -56
  194. package/dist/cjs/paths/Restapi/Account/Telephony/Sessions/Parties/Forward/index.js +12 -56
  195. package/dist/cjs/paths/Restapi/Account/Telephony/Sessions/Parties/Hold/index.js +12 -56
  196. package/dist/cjs/paths/Restapi/Account/Telephony/Sessions/Parties/Ignore/index.js +12 -56
  197. package/dist/cjs/paths/Restapi/Account/Telephony/Sessions/Parties/Park/index.js +12 -56
  198. package/dist/cjs/paths/Restapi/Account/Telephony/Sessions/Parties/Pickup/index.js +12 -56
  199. package/dist/cjs/paths/Restapi/Account/Telephony/Sessions/Parties/Recordings/index.js +21 -76
  200. package/dist/cjs/paths/Restapi/Account/Telephony/Sessions/Parties/Reject/index.js +12 -56
  201. package/dist/cjs/paths/Restapi/Account/Telephony/Sessions/Parties/Reply/index.js +12 -56
  202. package/dist/cjs/paths/Restapi/Account/Telephony/Sessions/Parties/Supervise/index.js +12 -56
  203. package/dist/cjs/paths/Restapi/Account/Telephony/Sessions/Parties/Transfer/index.js +12 -56
  204. package/dist/cjs/paths/Restapi/Account/Telephony/Sessions/Parties/Unhold/index.js +12 -56
  205. package/dist/cjs/paths/Restapi/Account/Telephony/Sessions/Parties/index.js +76 -143
  206. package/dist/cjs/paths/Restapi/Account/Telephony/Sessions/Supervise/index.js +12 -56
  207. package/dist/cjs/paths/Restapi/Account/Telephony/Sessions/index.js +30 -87
  208. package/dist/cjs/paths/Restapi/Account/Telephony/index.js +20 -20
  209. package/dist/cjs/paths/Restapi/Account/Templates/index.js +21 -76
  210. package/dist/cjs/paths/Restapi/Account/UserRole/BulkAssign/index.js +12 -56
  211. package/dist/cjs/paths/Restapi/Account/UserRole/Default/index.js +16 -69
  212. package/dist/cjs/paths/Restapi/Account/UserRole/index.js +45 -129
  213. package/dist/cjs/paths/Restapi/Account/index.js +128 -192
  214. package/dist/cjs/paths/Restapi/ClientInfo/SipProvision/index.js +12 -56
  215. package/dist/cjs/paths/Restapi/ClientInfo/index.js +11 -10
  216. package/dist/cjs/paths/Restapi/Dictionary/Brand/ContractedCountry/index.js +21 -76
  217. package/dist/cjs/paths/Restapi/Dictionary/Brand/index.js +13 -14
  218. package/dist/cjs/paths/Restapi/Dictionary/Country/index.js +21 -76
  219. package/dist/cjs/paths/Restapi/Dictionary/FaxCoverPage/index.js +12 -56
  220. package/dist/cjs/paths/Restapi/Dictionary/Greeting/index.js +21 -76
  221. package/dist/cjs/paths/Restapi/Dictionary/Language/index.js +21 -76
  222. package/dist/cjs/paths/Restapi/Dictionary/Location/index.js +12 -56
  223. package/dist/cjs/paths/Restapi/Dictionary/Permission/index.js +21 -76
  224. package/dist/cjs/paths/Restapi/Dictionary/PermissionCategory/index.js +21 -76
  225. package/dist/cjs/paths/Restapi/Dictionary/State/index.js +21 -76
  226. package/dist/cjs/paths/Restapi/Dictionary/Timezone/index.js +21 -76
  227. package/dist/cjs/paths/Restapi/Dictionary/UserRole/index.js +21 -76
  228. package/dist/cjs/paths/Restapi/Dictionary/index.js +41 -49
  229. package/dist/cjs/paths/Restapi/NumberParser/Parse/index.js +12 -56
  230. package/dist/cjs/paths/Restapi/NumberParser/index.js +11 -10
  231. package/dist/cjs/paths/Restapi/Oauth/Authorize/index.js +16 -69
  232. package/dist/cjs/paths/Restapi/Oauth/Revoke/index.js +12 -56
  233. package/dist/cjs/paths/Restapi/Oauth/Token/index.js +12 -56
  234. package/dist/cjs/paths/Restapi/Oauth/index.js +17 -16
  235. package/dist/cjs/paths/Restapi/Subscription/Renew/index.js +12 -56
  236. package/dist/cjs/paths/Restapi/Subscription/index.js +42 -126
  237. package/dist/cjs/paths/Restapi/V2/Accounts/BatchProvisioning/Users/index.js +12 -56
  238. package/dist/cjs/paths/Restapi/V2/Accounts/BatchProvisioning/index.js +11 -10
  239. package/dist/cjs/paths/Restapi/V2/Accounts/CostCenters/index.js +12 -56
  240. package/dist/cjs/paths/Restapi/V2/Accounts/DeviceInventory/index.js +16 -69
  241. package/dist/cjs/paths/Restapi/V2/Accounts/Devices/BulkAdd/index.js +12 -56
  242. package/dist/cjs/paths/Restapi/V2/Accounts/Devices/index.js +20 -66
  243. package/dist/cjs/paths/Restapi/V2/Accounts/Extensions/CallFlipNumbers/index.js +16 -69
  244. package/dist/cjs/paths/Restapi/V2/Accounts/Extensions/Devices/Replace/index.js +12 -56
  245. package/dist/cjs/paths/Restapi/V2/Accounts/Extensions/Devices/index.js +13 -13
  246. package/dist/cjs/paths/Restapi/V2/Accounts/Extensions/index.js +18 -63
  247. package/dist/cjs/paths/Restapi/V2/Accounts/PhoneNumbers/BulkAdd/index.js +21 -76
  248. package/dist/cjs/paths/Restapi/V2/Accounts/PhoneNumbers/Replace/index.js +12 -56
  249. package/dist/cjs/paths/Restapi/V2/Accounts/PhoneNumbers/index.js +31 -96
  250. package/dist/cjs/paths/Restapi/V2/Accounts/SendActivationEmail/index.js +12 -56
  251. package/dist/cjs/paths/Restapi/V2/Accounts/SendWelcomeEmail/index.js +12 -56
  252. package/dist/cjs/paths/Restapi/V2/Accounts/index.js +41 -89
  253. package/dist/cjs/paths/Restapi/V2/index.js +11 -11
  254. package/dist/cjs/paths/Restapi/index.js +40 -98
  255. package/dist/cjs/paths/Scim/ResourceTypes/index.js +21 -76
  256. package/dist/cjs/paths/Scim/Schemas/index.js +21 -76
  257. package/dist/cjs/paths/Scim/ServiceProviderConfig/index.js +12 -56
  258. package/dist/cjs/paths/Scim/Users/DotSearch/index.js +12 -56
  259. package/dist/cjs/paths/Scim/Users/index.js +49 -143
  260. package/dist/cjs/paths/Scim/index.js +20 -24
  261. package/dist/cjs/paths/TeamMessaging/V1/AdaptiveCards/index.js +31 -97
  262. package/dist/cjs/paths/TeamMessaging/V1/Chats/AdaptiveCards/index.js +12 -56
  263. package/dist/cjs/paths/TeamMessaging/V1/Chats/Favorite/index.js +12 -56
  264. package/dist/cjs/paths/TeamMessaging/V1/Chats/Notes/index.js +16 -69
  265. package/dist/cjs/paths/TeamMessaging/V1/Chats/Posts/index.js +39 -123
  266. package/dist/cjs/paths/TeamMessaging/V1/Chats/Tasks/index.js +16 -69
  267. package/dist/cjs/paths/TeamMessaging/V1/Chats/Unfavorite/index.js +12 -56
  268. package/dist/cjs/paths/TeamMessaging/V1/Chats/index.js +39 -95
  269. package/dist/cjs/paths/TeamMessaging/V1/Companies/index.js +17 -63
  270. package/dist/cjs/paths/TeamMessaging/V1/Conversations/index.js +25 -89
  271. package/dist/cjs/paths/TeamMessaging/V1/DataExport/index.js +25 -89
  272. package/dist/cjs/paths/TeamMessaging/V1/Events/index.js +39 -123
  273. package/dist/cjs/paths/TeamMessaging/V1/Everyone/index.js +16 -69
  274. package/dist/cjs/paths/TeamMessaging/V1/Favorites/index.js +12 -56
  275. package/dist/cjs/paths/TeamMessaging/V1/Files/index.js +14 -60
  276. package/dist/cjs/paths/TeamMessaging/V1/Groups/Events/index.js +16 -69
  277. package/dist/cjs/paths/TeamMessaging/V1/Groups/Webhooks/index.js +16 -69
  278. package/dist/cjs/paths/TeamMessaging/V1/Groups/index.js +16 -16
  279. package/dist/cjs/paths/TeamMessaging/V1/Notes/Lock/index.js +12 -56
  280. package/dist/cjs/paths/TeamMessaging/V1/Notes/Publish/index.js +12 -56
  281. package/dist/cjs/paths/TeamMessaging/V1/Notes/Unlock/index.js +12 -56
  282. package/dist/cjs/paths/TeamMessaging/V1/Notes/index.js +40 -106
  283. package/dist/cjs/paths/TeamMessaging/V1/Persons/index.js +17 -63
  284. package/dist/cjs/paths/TeamMessaging/V1/Recent/Chats/index.js +12 -56
  285. package/dist/cjs/paths/TeamMessaging/V1/Recent/index.js +11 -10
  286. package/dist/cjs/paths/TeamMessaging/V1/Tasks/Complete/index.js +12 -56
  287. package/dist/cjs/paths/TeamMessaging/V1/Tasks/index.js +34 -100
  288. package/dist/cjs/paths/TeamMessaging/V1/Teams/Add/index.js +12 -56
  289. package/dist/cjs/paths/TeamMessaging/V1/Teams/Archive/index.js +12 -56
  290. package/dist/cjs/paths/TeamMessaging/V1/Teams/Join/index.js +12 -56
  291. package/dist/cjs/paths/TeamMessaging/V1/Teams/Leave/index.js +12 -56
  292. package/dist/cjs/paths/TeamMessaging/V1/Teams/Remove/index.js +12 -56
  293. package/dist/cjs/paths/TeamMessaging/V1/Teams/Unarchive/index.js +12 -56
  294. package/dist/cjs/paths/TeamMessaging/V1/Teams/index.js +57 -141
  295. package/dist/cjs/paths/TeamMessaging/V1/Webhooks/Activate/index.js +12 -56
  296. package/dist/cjs/paths/TeamMessaging/V1/Webhooks/Suspend/index.js +12 -56
  297. package/dist/cjs/paths/TeamMessaging/V1/Webhooks/index.js +34 -99
  298. package/dist/cjs/paths/TeamMessaging/V1/index.js +56 -67
  299. package/dist/cjs/paths/TeamMessaging/index.js +9 -9
  300. package/dist/cjs/paths/Webinar/Configuration/V1/Company/Sessions/index.js +12 -56
  301. package/dist/cjs/paths/Webinar/Configuration/V1/Company/index.js +11 -10
  302. package/dist/cjs/paths/Webinar/Configuration/V1/Sessions/index.js +12 -56
  303. package/dist/cjs/paths/Webinar/Configuration/V1/Webinars/Sessions/Invitees/index.js +39 -123
  304. package/dist/cjs/paths/Webinar/Configuration/V1/Webinars/Sessions/index.js +38 -114
  305. package/dist/cjs/paths/Webinar/Configuration/V1/Webinars/index.js +42 -127
  306. package/dist/cjs/paths/Webinar/Configuration/V1/index.js +17 -17
  307. package/dist/cjs/paths/Webinar/Configuration/index.js +11 -10
  308. package/dist/cjs/paths/Webinar/History/V1/Company/Recordings/index.js +21 -76
  309. package/dist/cjs/paths/Webinar/History/V1/Company/Sessions/index.js +12 -56
  310. package/dist/cjs/paths/Webinar/History/V1/Company/index.js +14 -14
  311. package/dist/cjs/paths/Webinar/History/V1/Recordings/Download/index.js +12 -56
  312. package/dist/cjs/paths/Webinar/History/V1/Recordings/index.js +24 -79
  313. package/dist/cjs/paths/Webinar/History/V1/Sessions/index.js +12 -56
  314. package/dist/cjs/paths/Webinar/History/V1/Webinars/Sessions/Invitees/index.js +21 -76
  315. package/dist/cjs/paths/Webinar/History/V1/Webinars/Sessions/Participants/Self/index.js +12 -56
  316. package/dist/cjs/paths/Webinar/History/V1/Webinars/Sessions/Participants/index.js +15 -59
  317. package/dist/cjs/paths/Webinar/History/V1/Webinars/Sessions/index.js +23 -70
  318. package/dist/cjs/paths/Webinar/History/V1/Webinars/index.js +20 -67
  319. package/dist/cjs/paths/Webinar/History/V1/index.js +20 -21
  320. package/dist/cjs/paths/Webinar/History/index.js +11 -10
  321. package/dist/cjs/paths/Webinar/Notifications/V1/Subscriptions/Renew/index.js +12 -56
  322. package/dist/cjs/paths/Webinar/Notifications/V1/Subscriptions/index.js +42 -126
  323. package/dist/cjs/paths/Webinar/Notifications/V1/index.js +11 -11
  324. package/dist/cjs/paths/Webinar/Notifications/index.js +11 -10
  325. package/dist/cjs/paths/Webinar/Registration/V1/Sessions/Registrants/index.js +32 -106
  326. package/dist/cjs/paths/Webinar/Registration/V1/Sessions/index.js +27 -84
  327. package/dist/cjs/paths/Webinar/Registration/V1/index.js +11 -11
  328. package/dist/cjs/paths/Webinar/Registration/index.js +11 -10
  329. package/dist/cjs/paths/Webinar/index.js +18 -18
  330. package/package.json +5 -5
@@ -1,116 +1,51 @@
1
1
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
13
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
- function verb(n) { return function (v) { return step([n, v]); }; }
15
- function step(op) {
16
- if (f) throw new TypeError("Generator is already executing.");
17
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
- if (y = 0, t) op = [op[0] & 2, t.value];
20
- switch (op[0]) {
21
- case 0: case 1: t = op; break;
22
- case 4: _.label++; return { value: op[1], done: false };
23
- case 5: _.label++; y = op[1]; op = [0]; continue;
24
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
- default:
26
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
- if (t[2]) _.ops.pop();
31
- _.trys.pop(); continue;
32
- }
33
- op = body.call(thisArg, _);
34
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
- }
37
- };
38
2
  Object.defineProperty(exports, "__esModule", { value: true });
39
3
  exports.boundary = void 0;
40
- function stream2buffer(stream) {
41
- return __awaiter(this, void 0, void 0, function () {
42
- return __generator(this, function (_a) {
43
- return [2 /*return*/, new Promise(function (resolve, reject) {
44
- var buf = Array();
45
- stream.on("data", function (chunk) { return buf.push(chunk); });
46
- stream.on("end", function () { return resolve(Buffer.concat(buf)); });
47
- stream.on("error", function (err) { return reject(new Error("error converting stream - ".concat(err))); });
48
- })];
49
- });
4
+ async function stream2buffer(stream) {
5
+ return new Promise((resolve, reject) => {
6
+ const buf = Array();
7
+ stream.on("data", (chunk) => buf.push(chunk));
8
+ stream.on("end", () => resolve(Buffer.concat(buf)));
9
+ stream.on("error", (err) => reject(new Error(`error converting stream - ${err}`)));
50
10
  });
51
11
  }
52
12
  exports.boundary = "ad05fc42-a66d-4a94-b807-f1c91136c17b";
53
- var FormData = /** @class */ (function () {
54
- function FormData() {
55
- this.files = [];
56
- }
57
- FormData.prototype.append = function (formFile) {
13
+ class FormData {
14
+ files = [];
15
+ append(formFile) {
58
16
  this.files.push(formFile);
59
- };
60
- FormData.prototype.prepend = function (formFile) {
17
+ }
18
+ prepend(formFile) {
61
19
  this.files.unshift(formFile);
62
- };
63
- FormData.prototype.getBody = function () {
64
- return __awaiter(this, void 0, void 0, function () {
65
- var buffer, _i, _a, formFile, temp, fileBuffer, _b, _c;
66
- return __generator(this, function (_d) {
67
- switch (_d.label) {
68
- case 0:
69
- buffer = Buffer.alloc(0);
70
- _i = 0, _a = this.files;
71
- _d.label = 1;
72
- case 1:
73
- if (!(_i < _a.length)) return [3 /*break*/, 9];
74
- formFile = _a[_i];
75
- temp = "--".concat(exports.boundary, "\r\n");
76
- temp += "Content-Type: ".concat(formFile.contentType, "\r\n");
77
- temp +=
78
- "Content-Disposition: form-data; name=\"".concat(formFile.name, "\"; filename=\"").concat(formFile.filename, "\"\r\n\r\n");
79
- buffer = Buffer.concat([buffer, Buffer.from(temp, "utf-8")]);
80
- fileBuffer = Buffer.alloc(0);
81
- if (!(typeof formFile.content === "string")) return [3 /*break*/, 2];
82
- fileBuffer = Buffer.from("".concat(formFile.content, "\r\n"), "utf-8");
83
- return [3 /*break*/, 7];
84
- case 2:
85
- if (!Buffer.isBuffer(formFile.content)) return [3 /*break*/, 3];
86
- fileBuffer = formFile.content;
87
- return [3 /*break*/, 7];
88
- case 3:
89
- if (!(formFile.content instanceof Blob)) return [3 /*break*/, 5];
90
- _c = (_b = Buffer).from;
91
- return [4 /*yield*/, formFile.content.arrayBuffer()];
92
- case 4:
93
- fileBuffer = _c.apply(_b, [_d.sent()]);
94
- return [3 /*break*/, 7];
95
- case 5: return [4 /*yield*/, stream2buffer(formFile.content)];
96
- case 6:
97
- // NodeJS.ReadableStream
98
- fileBuffer = (_d.sent());
99
- _d.label = 7;
100
- case 7:
101
- buffer = Buffer.concat([buffer, fileBuffer]);
102
- _d.label = 8;
103
- case 8:
104
- _i++;
105
- return [3 /*break*/, 1];
106
- case 9: return [2 /*return*/, Buffer.concat([
107
- buffer,
108
- Buffer.from("\r\n--".concat(exports.boundary, "--\r\n"), "utf8"),
109
- ])];
110
- }
111
- });
112
- });
113
- };
114
- return FormData;
115
- }());
20
+ }
21
+ async getBody() {
22
+ let buffer = Buffer.alloc(0);
23
+ for (const formFile of this.files) {
24
+ let temp = `--${exports.boundary}\r\n`;
25
+ temp += `Content-Type: ${formFile.contentType}\r\n`;
26
+ temp +=
27
+ `Content-Disposition: form-data; name="${formFile.name}"; filename="${formFile.filename}"\r\n\r\n`;
28
+ buffer = Buffer.concat([buffer, Buffer.from(temp, "utf-8")]);
29
+ let fileBuffer = Buffer.alloc(0);
30
+ if (typeof formFile.content === "string") {
31
+ fileBuffer = Buffer.from(`${formFile.content}\r\n`, "utf-8");
32
+ }
33
+ else if (Buffer.isBuffer(formFile.content)) {
34
+ fileBuffer = formFile.content;
35
+ }
36
+ else if (formFile.content instanceof Blob) {
37
+ fileBuffer = Buffer.from(await formFile.content.arrayBuffer());
38
+ }
39
+ else {
40
+ // NodeJS.ReadableStream
41
+ fileBuffer = await stream2buffer(formFile.content);
42
+ }
43
+ buffer = Buffer.concat([buffer, fileBuffer]);
44
+ }
45
+ return Buffer.concat([
46
+ buffer,
47
+ Buffer.from(`\r\n--${exports.boundary}--\r\n`, "utf8"),
48
+ ]);
49
+ }
50
+ }
116
51
  exports.default = FormData;
package/dist/cjs/Rest.js CHANGED
@@ -1,123 +1,86 @@
1
1
  "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
14
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
15
- return new (P || (P = Promise))(function (resolve, reject) {
16
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
17
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
18
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
19
- step((generator = generator.apply(thisArg, _arguments || [])).next());
20
- });
21
- };
22
- var __generator = (this && this.__generator) || function (thisArg, body) {
23
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
24
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
25
- function verb(n) { return function (v) { return step([n, v]); }; }
26
- function step(op) {
27
- if (f) throw new TypeError("Generator is already executing.");
28
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
29
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
30
- if (y = 0, t) op = [op[0] & 2, t.value];
31
- switch (op[0]) {
32
- case 0: case 1: t = op; break;
33
- case 4: _.label++; return { value: op[1], done: false };
34
- case 5: _.label++; y = op[1]; op = [0]; continue;
35
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
36
- default:
37
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
38
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
39
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
40
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
41
- if (t[2]) _.ops.pop();
42
- _.trys.pop(); continue;
43
- }
44
- op = body.call(thisArg, _);
45
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
46
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
47
- }
48
- };
49
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
50
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
51
4
  };
52
5
  Object.defineProperty(exports, "__esModule", { value: true });
53
- var axios_1 = __importDefault(require("axios"));
54
- var qs_1 = __importDefault(require("qs"));
55
- var FormData_js_1 = require("./FormData.js");
56
- var RestException_js_1 = __importDefault(require("./RestException.js"));
57
- var version = "1.5.0";
58
- var Rest = /** @class */ (function () {
59
- function Rest(options) {
60
- var _a, _b, _c, _d, _e;
61
- this.server = (_a = options.server) !== null && _a !== void 0 ? _a : Rest.productionServer;
62
- this.clientId = (_b = options.clientId) !== null && _b !== void 0 ? _b : "";
6
+ const axios_1 = __importDefault(require("axios"));
7
+ const qs_1 = __importDefault(require("qs"));
8
+ const FormData_js_1 = require("./FormData.js");
9
+ const RestException_js_1 = __importDefault(require("./RestException.js"));
10
+ const version = "1.5.0";
11
+ class Rest {
12
+ static sandboxServer = "https://platform.devtest.ringcentral.com";
13
+ static productionServer = "https://platform.ringcentral.com";
14
+ server;
15
+ clientId;
16
+ clientSecret;
17
+ token;
18
+ appName;
19
+ appVersion;
20
+ httpClient;
21
+ constructor(options) {
22
+ this.server = options.server ?? Rest.productionServer;
23
+ this.clientId = options.clientId ?? "";
63
24
  this.clientSecret = options.clientSecret;
64
- this.token = (_c = options.token) !== null && _c !== void 0 ? _c : undefined;
65
- this.appName = (_d = options.appName) !== null && _d !== void 0 ? _d : "Unknown";
66
- this.appVersion = (_e = options.appVersion) !== null && _e !== void 0 ? _e : "0.0.1";
25
+ this.token = options.token ?? undefined;
26
+ this.appName = options.appName ?? "Unknown";
27
+ this.appVersion = options.appVersion ?? "0.0.1";
67
28
  this.httpClient = axios_1.default.create({
68
29
  headers: {
69
- "X-User-Agent": "".concat(this.appName, "/").concat(this.appVersion, " ringcentral-extensible/core/").concat(version),
30
+ "X-User-Agent": `${this.appName}/${this.appVersion} ringcentral-extensible/core/${version}`,
70
31
  },
71
- validateStatus: function () { return true; },
32
+ validateStatus: () => true,
72
33
  paramsSerializer: {
73
- serialize: function (params) { return qs_1.default.stringify(params, { arrayFormat: "repeat" }); },
34
+ serialize: (params) => qs_1.default.stringify(params, { arrayFormat: "repeat" }),
74
35
  },
75
36
  });
76
- this.httpClient.interceptors.request.use(function (config) {
37
+ this.httpClient.interceptors.request.use((config) => {
77
38
  if (Buffer.isBuffer(config.data)) {
78
- return __assign(__assign({}, config), { headers: __assign(__assign({}, config.headers), { "Content-Type": "multipart/form-data; boundary=".concat(FormData_js_1.boundary) }) });
39
+ return {
40
+ ...config,
41
+ headers: {
42
+ ...config.headers,
43
+ "Content-Type": `multipart/form-data; boundary=${FormData_js_1.boundary}`,
44
+ },
45
+ };
79
46
  }
80
47
  return config;
81
48
  });
82
49
  }
83
- Rest.prototype.request = function (method, endpoint, content, queryParams, config) {
84
- return __awaiter(this, void 0, void 0, function () {
85
- var newConfig, r;
86
- var _a;
87
- return __generator(this, function (_b) {
88
- switch (_b.label) {
89
- case 0:
90
- newConfig = __assign({ baseURL: this.server, method: method, url: endpoint, data: content, params: queryParams }, config);
91
- // /restapi/oauth/wstoken uses bearer token
92
- if (endpoint === "/restapi/oauth/token" ||
93
- endpoint === "/restapi/oauth/revoke") {
94
- if (this.clientSecret) {
95
- // basic token
96
- newConfig.auth = {
97
- username: this.clientId,
98
- password: this.clientSecret,
99
- };
100
- }
101
- // else: PKCE: https://medium.com/ringcentral-developers/use-authorization-code-pkce-for-ringcentral-api-in-client-app-e9108f04b5f0
102
- newConfig.data = qs_1.default.stringify(newConfig.data);
103
- }
104
- else {
105
- // bearer token
106
- newConfig.headers = __assign(__assign({}, newConfig.headers), { Authorization: "Bearer ".concat((_a = this.token) === null || _a === void 0 ? void 0 : _a.access_token) });
107
- }
108
- return [4 /*yield*/, this.httpClient.request(newConfig)];
109
- case 1:
110
- r = _b.sent();
111
- if (r.status >= 200 && r.status < 300) {
112
- return [2 /*return*/, r];
113
- }
114
- throw new RestException_js_1.default(r);
115
- }
116
- });
117
- });
118
- };
119
- Rest.sandboxServer = "https://platform.devtest.ringcentral.com";
120
- Rest.productionServer = "https://platform.ringcentral.com";
121
- return Rest;
122
- }());
50
+ async request(method, endpoint, content, queryParams, config) {
51
+ const newConfig = {
52
+ baseURL: this.server,
53
+ method,
54
+ url: endpoint,
55
+ data: content,
56
+ params: queryParams,
57
+ ...config,
58
+ };
59
+ // /restapi/oauth/wstoken uses bearer token
60
+ if (endpoint === "/restapi/oauth/token" ||
61
+ endpoint === "/restapi/oauth/revoke") {
62
+ if (this.clientSecret) {
63
+ // basic token
64
+ newConfig.auth = {
65
+ username: this.clientId,
66
+ password: this.clientSecret,
67
+ };
68
+ }
69
+ // else: PKCE: https://medium.com/ringcentral-developers/use-authorization-code-pkce-for-ringcentral-api-in-client-app-e9108f04b5f0
70
+ newConfig.data = qs_1.default.stringify(newConfig.data);
71
+ }
72
+ else {
73
+ // bearer token
74
+ newConfig.headers = {
75
+ ...newConfig.headers,
76
+ Authorization: `Bearer ${this.token?.access_token}`,
77
+ };
78
+ }
79
+ const r = await this.httpClient.request(newConfig);
80
+ if (r.status >= 200 && r.status < 300) {
81
+ return r;
82
+ }
83
+ throw new RestException_js_1.default(r);
84
+ }
85
+ }
123
86
  exports.default = Rest;
@@ -1,35 +1,18 @@
1
1
  "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
18
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
19
4
  };
20
5
  Object.defineProperty(exports, "__esModule", { value: true });
21
- var Utils_js_1 = __importDefault(require("./Utils.js"));
22
- var RestException = /** @class */ (function (_super) {
23
- __extends(RestException, _super);
24
- function RestException(r) {
25
- var _this = this;
26
- var message = Utils_js_1.default.formatTraffic(r);
27
- _this = _super.call(this, message) || this;
28
- Object.setPrototypeOf(_this, RestException.prototype);
29
- _this.response = r;
30
- _this.message = message;
31
- return _this;
6
+ const Utils_js_1 = __importDefault(require("./Utils.js"));
7
+ class RestException extends Error {
8
+ response;
9
+ message;
10
+ constructor(r) {
11
+ const message = Utils_js_1.default.formatTraffic(r);
12
+ super(message);
13
+ Object.setPrototypeOf(this, RestException.prototype);
14
+ this.response = r;
15
+ this.message = message;
32
16
  }
33
- return RestException;
34
- }(Error));
17
+ }
35
18
  exports.default = RestException;
@@ -1,15 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- var SdkExtension = /** @class */ (function () {
4
- function SdkExtension() {
3
+ class SdkExtension {
4
+ enabled = true;
5
+ enable() {
5
6
  this.enabled = true;
6
7
  }
7
- SdkExtension.prototype.enable = function () {
8
- this.enabled = true;
9
- };
10
- SdkExtension.prototype.disable = function () {
8
+ disable() {
11
9
  this.enabled = false;
12
- };
13
- return SdkExtension;
14
- }());
10
+ }
11
+ }
15
12
  exports.default = SdkExtension;
package/dist/cjs/Utils.js CHANGED
@@ -1,56 +1,47 @@
1
1
  "use strict";
2
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
3
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
4
- if (ar || !(i in from)) {
5
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
6
- ar[i] = from[i];
7
- }
8
- }
9
- return to.concat(ar || Array.prototype.slice.call(from));
10
- };
11
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
12
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
4
  };
14
5
  Object.defineProperty(exports, "__esModule", { value: true });
15
- var FormData_js_1 = __importDefault(require("./FormData.js"));
16
- var Utils = /** @class */ (function () {
17
- function Utils() {
18
- }
19
- Utils.formatTraffic = function (r) {
20
- return "HTTP ".concat(r.status, " ").concat(r.statusText).concat(r.data.message ? " - ".concat(r.data.message) : "", "\n\n Response:\n ").concat(JSON.stringify({
6
+ const FormData_js_1 = __importDefault(require("./FormData.js"));
7
+ class Utils {
8
+ static formatTraffic(r) {
9
+ return `HTTP ${r.status} ${r.statusText}${r.data.message ? ` - ${r.data.message}` : ""}
10
+
11
+ Response:
12
+ ${JSON.stringify({
21
13
  data: r.data,
22
14
  status: r.status,
23
15
  statusText: r.statusText,
24
16
  headers: r.headers,
25
- }, null, 2), "\n\n Request:\n ").concat(JSON.stringify({
17
+ }, null, 2)}
18
+
19
+ Request:
20
+ ${JSON.stringify({
26
21
  method: r.config.method,
27
22
  baseURL: r.config.baseURL,
28
23
  url: r.config.url,
29
24
  params: r.config.params,
30
25
  data: Buffer.isBuffer(r.config.data) ? "<Buffer>" : r.config.data,
31
26
  headers: r.config.headers,
32
- }, null, 2), "\n ");
33
- };
34
- Utils.isAttachment = function (obj) {
27
+ }, null, 2)}
28
+ `;
29
+ }
30
+ static isAttachment(obj) {
35
31
  return typeof obj === "object" && obj !== null && "filename" in obj &&
36
32
  "content" in obj;
37
- };
38
- Utils.getFormData = function () {
39
- var objects = [];
40
- for (var _i = 0; _i < arguments.length; _i++) {
41
- objects[_i] = arguments[_i];
42
- }
43
- var formData = new FormData_js_1.default();
44
- var obj = Object.assign.apply(Object, __spreadArray([{}], objects, false));
45
- for (var _a = 0, _b = Object.keys(obj); _a < _b.length; _a++) {
46
- var key = _b[_a];
47
- var value = obj[key];
33
+ }
34
+ static getFormData(...objects) {
35
+ const formData = new FormData_js_1.default();
36
+ const obj = Object.assign({}, ...objects);
37
+ for (const key of Object.keys(obj)) {
38
+ const value = obj[key];
48
39
  if (value === undefined || value === null) {
49
40
  delete obj[key];
50
41
  continue;
51
42
  }
52
43
  if (Utils.isAttachment(value)) {
53
- var attachment = value;
44
+ const attachment = value;
54
45
  formData.append({
55
46
  name: key,
56
47
  filename: attachment.filename,
@@ -61,8 +52,7 @@ var Utils = /** @class */ (function () {
61
52
  continue;
62
53
  }
63
54
  if (Array.isArray(value) && Utils.isAttachment(value[0])) {
64
- for (var _c = 0, value_1 = value; _c < value_1.length; _c++) {
65
- var attachment = value_1[_c];
55
+ for (const attachment of value) {
66
56
  formData.append({
67
57
  name: key,
68
58
  filename: attachment.filename,
@@ -82,7 +72,6 @@ var Utils = /** @class */ (function () {
82
72
  });
83
73
  }
84
74
  return formData.getBody();
85
- };
86
- return Utils;
87
- }());
75
+ }
76
+ }
88
77
  exports.default = Utils;