@webex/test-users 3.0.0-bnr.5 → 3.0.0

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 (657) hide show
  1. package/.eslintrc.js +6 -0
  2. package/babel.config.js +3 -0
  3. package/dist/index.js +64 -9
  4. package/dist/index.js.map +1 -1
  5. package/dist/whistler.js +2 -2
  6. package/dist/whistler.js.map +1 -1
  7. package/jest.config.js +3 -0
  8. package/package.json +26 -7
  9. package/process +1 -0
  10. package/src/index.js +58 -0
  11. package/dist/types/@webex/common/src/base64.d.ts +0 -38
  12. package/dist/types/@webex/common/src/browser-detection.d.ts +0 -8
  13. package/dist/types/@webex/common/src/capped-debounce.d.ts +0 -12
  14. package/dist/types/@webex/common/src/check-required.d.ts +0 -11
  15. package/dist/types/@webex/common/src/constants.d.ts +0 -76
  16. package/dist/types/@webex/common/src/defer.d.ts +0 -23
  17. package/dist/types/@webex/common/src/deprecated.d.ts +0 -7
  18. package/dist/types/@webex/common/src/event-envelope.d.ts +0 -13
  19. package/dist/types/@webex/common/src/events.d.ts +0 -15
  20. package/dist/types/@webex/common/src/exception.d.ts +0 -23
  21. package/dist/types/@webex/common/src/in-browser/browser.d.ts +0 -2
  22. package/dist/types/@webex/common/src/in-browser/index.d.ts +0 -1
  23. package/dist/types/@webex/common/src/in-browser/node.d.ts +0 -2
  24. package/dist/types/@webex/common/src/index.d.ts +0 -21
  25. package/dist/types/@webex/common/src/isBuffer.d.ts +0 -2
  26. package/dist/types/@webex/common/src/make-state-datatype.d.ts +0 -11
  27. package/dist/types/@webex/common/src/one-flight.d.ts +0 -9
  28. package/dist/types/@webex/common/src/patterns.d.ts +0 -8
  29. package/dist/types/@webex/common/src/resolve-with.d.ts +0 -22
  30. package/dist/types/@webex/common/src/retry.d.ts +0 -13
  31. package/dist/types/@webex/common/src/tap.d.ts +0 -17
  32. package/dist/types/@webex/common/src/template-container.d.ts +0 -59
  33. package/dist/types/@webex/common/src/uuid-utils.d.ts +0 -112
  34. package/dist/types/@webex/common/src/while-in-flight.d.ts +0 -7
  35. package/dist/types/@webex/common/test/unit/spec/capped-debounce.d.ts +0 -1
  36. package/dist/types/@webex/common/test/unit/spec/common.d.ts +0 -1
  37. package/dist/types/@webex/common/test/unit/spec/exception.d.ts +0 -1
  38. package/dist/types/@webex/common/test/unit/spec/one-flight.d.ts +0 -1
  39. package/dist/types/@webex/common/test/unit/spec/template-container.d.ts +0 -1
  40. package/dist/types/@webex/common/test/unit/spec/while-in-flight.d.ts +0 -1
  41. package/dist/types/@webex/common-evented/src/index.d.ts +0 -9
  42. package/dist/types/@webex/common-evented/test/unit/spec/evented.d.ts +0 -1
  43. package/dist/types/@webex/common-timers/src/index.d.ts +0 -19
  44. package/dist/types/@webex/helper-html/browsers.d.ts +0 -2
  45. package/dist/types/@webex/helper-html/src/html-base.d.ts +0 -12
  46. package/dist/types/@webex/helper-html/src/html.d.ts +0 -5
  47. package/dist/types/@webex/helper-html/src/html.shim.d.ts +0 -33
  48. package/dist/types/@webex/helper-html/src/index.d.ts +0 -1
  49. package/dist/types/@webex/helper-html/test/unit/spec/html.d.ts +0 -1
  50. package/dist/types/@webex/helper-image/src/detect-filetype.d.ts +0 -7
  51. package/dist/types/@webex/helper-image/src/index.d.ts +0 -26
  52. package/dist/types/@webex/helper-image/src/process-image.browser.d.ts +0 -19
  53. package/dist/types/@webex/helper-image/src/process-image.d.ts +0 -17
  54. package/dist/types/@webex/helper-image/test/unit/spec/index.d.ts +0 -1
  55. package/dist/types/@webex/http-core/src/http-error-subtypes.d.ts +0 -8
  56. package/dist/types/@webex/http-core/src/http-error.d.ts +0 -41
  57. package/dist/types/@webex/http-core/src/index.d.ts +0 -7
  58. package/dist/types/@webex/http-core/src/interceptors/http-status.d.ts +0 -17
  59. package/dist/types/@webex/http-core/src/lib/detect.d.ts +0 -6
  60. package/dist/types/@webex/http-core/src/lib/interceptor.d.ts +0 -51
  61. package/dist/types/@webex/http-core/src/lib/xhr.d.ts +0 -6
  62. package/dist/types/@webex/http-core/src/progress-event.d.ts +0 -18
  63. package/dist/types/@webex/http-core/src/request/index.d.ts +0 -5
  64. package/dist/types/@webex/http-core/src/request/request.d.ts +0 -6
  65. package/dist/types/@webex/http-core/src/request/request.shim.d.ts +0 -6
  66. package/dist/types/@webex/http-core/test/integration/spec/http-error.d.ts +0 -1
  67. package/dist/types/@webex/http-core/test/integration/spec/interceptor.d.ts +0 -1
  68. package/dist/types/@webex/http-core/test/integration/spec/progress-event.d.ts +0 -1
  69. package/dist/types/@webex/http-core/test/integration/spec/request.d.ts +0 -1
  70. package/dist/types/@webex/http-core/test/unit/spec/interceptors/http-status.d.ts +0 -1
  71. package/dist/types/@webex/internal-plugin-avatar/src/avatar-url-batcher.d.ts +0 -2
  72. package/dist/types/@webex/internal-plugin-avatar/src/avatar-url-store.d.ts +0 -50
  73. package/dist/types/@webex/internal-plugin-avatar/src/avatar.d.ts +0 -2
  74. package/dist/types/@webex/internal-plugin-avatar/src/config.d.ts +0 -13
  75. package/dist/types/@webex/internal-plugin-avatar/src/index.d.ts +0 -1
  76. package/dist/types/@webex/internal-plugin-avatar/test/integration/spec/avatar.d.ts +0 -1
  77. package/dist/types/@webex/internal-plugin-avatar/test/unit/spec/avatar-url-batcher.d.ts +0 -1
  78. package/dist/types/@webex/internal-plugin-avatar/test/unit/spec/avatar-url-store.d.ts +0 -1
  79. package/dist/types/@webex/internal-plugin-avatar/test/unit/spec/avatar.d.ts +0 -1
  80. package/dist/types/@webex/internal-plugin-board/src/board.d.ts +0 -2
  81. package/dist/types/@webex/internal-plugin-board/src/config.d.ts +0 -11
  82. package/dist/types/@webex/internal-plugin-board/src/index.d.ts +0 -4
  83. package/dist/types/@webex/internal-plugin-board/src/realtime-channel-collection.d.ts +0 -2
  84. package/dist/types/@webex/internal-plugin-board/src/realtime-channel.d.ts +0 -2
  85. package/dist/types/@webex/internal-plugin-board/src/realtime.d.ts +0 -7
  86. package/dist/types/@webex/internal-plugin-board/test/integration/spec/board.d.ts +0 -1
  87. package/dist/types/@webex/internal-plugin-board/test/integration/spec/realtime.d.ts +0 -1
  88. package/dist/types/@webex/internal-plugin-board/test/integration/spec/sharing-mercury.d.ts +0 -1
  89. package/dist/types/@webex/internal-plugin-board/test/unit/spec/board.d.ts +0 -1
  90. package/dist/types/@webex/internal-plugin-board/test/unit/spec/encryption.d.ts +0 -1
  91. package/dist/types/@webex/internal-plugin-board/test/unit/spec/realtime.d.ts +0 -1
  92. package/dist/types/@webex/internal-plugin-calendar/src/calendar.d.ts +0 -2
  93. package/dist/types/@webex/internal-plugin-calendar/src/collection.d.ts +0 -58
  94. package/dist/types/@webex/internal-plugin-calendar/src/config.d.ts +0 -7
  95. package/dist/types/@webex/internal-plugin-calendar/src/constants.d.ts +0 -6
  96. package/dist/types/@webex/internal-plugin-calendar/src/index.d.ts +0 -1
  97. package/dist/types/@webex/internal-plugin-calendar/src/util.d.ts +0 -15
  98. package/dist/types/@webex/internal-plugin-calendar/test/integration/spec/calendar.d.ts +0 -1
  99. package/dist/types/@webex/internal-plugin-calendar/test/unit/spec/calendar.d.ts +0 -1
  100. package/dist/types/@webex/internal-plugin-calendar/test/unit/spec/utils.d.ts +0 -1
  101. package/dist/types/@webex/internal-plugin-conversation/src/activities.d.ts +0 -32
  102. package/dist/types/@webex/internal-plugin-conversation/src/activity-thread-ordering.d.ts +0 -18
  103. package/dist/types/@webex/internal-plugin-conversation/src/config.d.ts +0 -19
  104. package/dist/types/@webex/internal-plugin-conversation/src/constants.d.ts +0 -5
  105. package/dist/types/@webex/internal-plugin-conversation/src/conversation.d.ts +0 -2
  106. package/dist/types/@webex/internal-plugin-conversation/src/convo-error.d.ts +0 -10
  107. package/dist/types/@webex/internal-plugin-conversation/src/decryption-transforms.d.ts +0 -1
  108. package/dist/types/@webex/internal-plugin-conversation/src/encryption-transforms.d.ts +0 -1
  109. package/dist/types/@webex/internal-plugin-conversation/src/index.d.ts +0 -3
  110. package/dist/types/@webex/internal-plugin-conversation/src/share-activity.d.ts +0 -7
  111. package/dist/types/@webex/internal-plugin-conversation/src/to-array.d.ts +0 -9
  112. package/dist/types/@webex/internal-plugin-conversation/test/integration/spec/create.d.ts +0 -1
  113. package/dist/types/@webex/internal-plugin-conversation/test/integration/spec/encryption.d.ts +0 -1
  114. package/dist/types/@webex/internal-plugin-conversation/test/integration/spec/get.d.ts +0 -1
  115. package/dist/types/@webex/internal-plugin-conversation/test/integration/spec/mercury.d.ts +0 -1
  116. package/dist/types/@webex/internal-plugin-conversation/test/integration/spec/share.d.ts +0 -1
  117. package/dist/types/@webex/internal-plugin-conversation/test/integration/spec/verbs.d.ts +0 -1
  118. package/dist/types/@webex/internal-plugin-conversation/test/unit/spec/conversation.d.ts +0 -1
  119. package/dist/types/@webex/internal-plugin-conversation/test/unit/spec/decrypt-transforms.d.ts +0 -1
  120. package/dist/types/@webex/internal-plugin-conversation/test/unit/spec/encryption-transforms.d.ts +0 -1
  121. package/dist/types/@webex/internal-plugin-conversation/test/unit/spec/share-activity.d.ts +0 -1
  122. package/dist/types/@webex/internal-plugin-device/src/config.d.ts +0 -10
  123. package/dist/types/@webex/internal-plugin-device/src/constants.d.ts +0 -12
  124. package/dist/types/@webex/internal-plugin-device/src/device.d.ts +0 -2
  125. package/dist/types/@webex/internal-plugin-device/src/features/feature-collection.d.ts +0 -9
  126. package/dist/types/@webex/internal-plugin-device/src/features/feature-model.d.ts +0 -29
  127. package/dist/types/@webex/internal-plugin-device/src/features/features-model.d.ts +0 -9
  128. package/dist/types/@webex/internal-plugin-device/src/features/index.d.ts +0 -4
  129. package/dist/types/@webex/internal-plugin-device/src/index.d.ts +0 -8
  130. package/dist/types/@webex/internal-plugin-device/src/interceptors/device-url.d.ts +0 -15
  131. package/dist/types/@webex/internal-plugin-device/src/metrics.d.ts +0 -5
  132. package/dist/types/@webex/internal-plugin-device/test/integration/spec/device.d.ts +0 -1
  133. package/dist/types/@webex/internal-plugin-device/test/integration/spec/webex.d.ts +0 -1
  134. package/dist/types/@webex/internal-plugin-device/test/unit/spec/device.d.ts +0 -1
  135. package/dist/types/@webex/internal-plugin-device/test/unit/spec/features/feature-collection.d.ts +0 -1
  136. package/dist/types/@webex/internal-plugin-device/test/unit/spec/features/feature-model.d.ts +0 -1
  137. package/dist/types/@webex/internal-plugin-device/test/unit/spec/features/features-model.d.ts +0 -1
  138. package/dist/types/@webex/internal-plugin-device/test/unit/spec/interceptors/device-url.d.ts +0 -1
  139. package/dist/types/@webex/internal-plugin-dss/src/constants.d.ts +0 -14
  140. package/dist/types/@webex/internal-plugin-dss/src/dss.d.ts +0 -3
  141. package/dist/types/@webex/internal-plugin-dss/src/index.d.ts +0 -1
  142. package/dist/types/@webex/internal-plugin-dss/src/types.d.ts +0 -28
  143. package/dist/types/@webex/internal-plugin-dss/test/unit/spec/dss.d.ts +0 -4
  144. package/dist/types/@webex/internal-plugin-ediscovery/src/config.d.ts +0 -11
  145. package/dist/types/@webex/internal-plugin-ediscovery/src/ediscovery-error.d.ts +0 -11
  146. package/dist/types/@webex/internal-plugin-ediscovery/src/ediscovery.d.ts +0 -6
  147. package/dist/types/@webex/internal-plugin-ediscovery/src/index.d.ts +0 -4
  148. package/dist/types/@webex/internal-plugin-ediscovery/src/report-request.d.ts +0 -29
  149. package/dist/types/@webex/internal-plugin-ediscovery/src/retry.d.ts +0 -2
  150. package/dist/types/@webex/internal-plugin-ediscovery/src/transforms.d.ts +0 -35
  151. package/dist/types/@webex/internal-plugin-ediscovery/test/integration/spec/ediscovery.d.ts +0 -1
  152. package/dist/types/@webex/internal-plugin-ediscovery/test/unit/spec/content.d.ts +0 -1
  153. package/dist/types/@webex/internal-plugin-ediscovery/test/unit/spec/report.d.ts +0 -1
  154. package/dist/types/@webex/internal-plugin-ediscovery/test/unit/spec/transforms.d.ts +0 -1
  155. package/dist/types/@webex/internal-plugin-encryption/src/config.d.ts +0 -16
  156. package/dist/types/@webex/internal-plugin-encryption/src/encryption.d.ts +0 -2
  157. package/dist/types/@webex/internal-plugin-encryption/src/ensure-buffer.browser.d.ts +0 -10
  158. package/dist/types/@webex/internal-plugin-encryption/src/ensure-buffer.d.ts +0 -7
  159. package/dist/types/@webex/internal-plugin-encryption/src/index.d.ts +0 -3
  160. package/dist/types/@webex/internal-plugin-encryption/src/kms-batcher.d.ts +0 -6
  161. package/dist/types/@webex/internal-plugin-encryption/src/kms-certificate-validation.d.ts +0 -24
  162. package/dist/types/@webex/internal-plugin-encryption/src/kms-dry-error-interceptor.d.ts +0 -25
  163. package/dist/types/@webex/internal-plugin-encryption/src/kms-errors.d.ts +0 -33
  164. package/dist/types/@webex/internal-plugin-encryption/src/kms.d.ts +0 -5
  165. package/dist/types/@webex/internal-plugin-encryption/test/integration/spec/encryption.d.ts +0 -1
  166. package/dist/types/@webex/internal-plugin-encryption/test/integration/spec/kms.d.ts +0 -1
  167. package/dist/types/@webex/internal-plugin-encryption/test/integration/spec/payload-transfom.d.ts +0 -1
  168. package/dist/types/@webex/internal-plugin-encryption/test/unit/spec/encryption.d.ts +0 -1
  169. package/dist/types/@webex/internal-plugin-encryption/test/unit/spec/kms-certificate-validation.d.ts +0 -1
  170. package/dist/types/@webex/internal-plugin-feature/src/config.d.ts +0 -4
  171. package/dist/types/@webex/internal-plugin-feature/src/feature.d.ts +0 -2
  172. package/dist/types/@webex/internal-plugin-feature/src/index.d.ts +0 -1
  173. package/dist/types/@webex/internal-plugin-feature/test/integration/spec/feature.d.ts +0 -1
  174. package/dist/types/@webex/internal-plugin-feature/test/unit/spec/feature.d.ts +0 -1
  175. package/dist/types/@webex/internal-plugin-flag/src/config.d.ts +0 -4
  176. package/dist/types/@webex/internal-plugin-flag/src/flag.d.ts +0 -2
  177. package/dist/types/@webex/internal-plugin-flag/src/index.d.ts +0 -1
  178. package/dist/types/@webex/internal-plugin-flag/test/integration/spec/flag.d.ts +0 -1
  179. package/dist/types/@webex/internal-plugin-flag/test/unit/spec/flag.d.ts +0 -1
  180. package/dist/types/@webex/internal-plugin-llm/src/constants.d.ts +0 -1
  181. package/dist/types/@webex/internal-plugin-llm/src/index.d.ts +0 -1
  182. package/dist/types/@webex/internal-plugin-llm/src/llm.d.ts +0 -88
  183. package/dist/types/@webex/internal-plugin-llm/src/llm.types.d.ts +0 -8
  184. package/dist/types/@webex/internal-plugin-llm/test/unit/spec/llm.d.ts +0 -1
  185. package/dist/types/@webex/internal-plugin-locus/src/event-keys.d.ts +0 -5
  186. package/dist/types/@webex/internal-plugin-locus/src/index.d.ts +0 -4
  187. package/dist/types/@webex/internal-plugin-locus/src/locus.d.ts +0 -12
  188. package/dist/types/@webex/internal-plugin-locus/test/unit/spec/locus.d.ts +0 -1
  189. package/dist/types/@webex/internal-plugin-lyra/src/config.d.ts +0 -4
  190. package/dist/types/@webex/internal-plugin-lyra/src/device.d.ts +0 -7
  191. package/dist/types/@webex/internal-plugin-lyra/src/index.d.ts +0 -3
  192. package/dist/types/@webex/internal-plugin-lyra/src/lyra.d.ts +0 -2
  193. package/dist/types/@webex/internal-plugin-lyra/src/space.d.ts +0 -7
  194. package/dist/types/@webex/internal-plugin-lyra/test/integration/spec/device.d.ts +0 -1
  195. package/dist/types/@webex/internal-plugin-lyra/test/integration/spec/space.d.ts +0 -1
  196. package/dist/types/@webex/internal-plugin-lyra/test/unit/spec/device.d.ts +0 -1
  197. package/dist/types/@webex/internal-plugin-lyra/test/unit/spec/lyra.d.ts +0 -1
  198. package/dist/types/@webex/internal-plugin-lyra/test/unit/spec/space.d.ts +0 -1
  199. package/dist/types/@webex/internal-plugin-mercury/src/config.d.ts +0 -10
  200. package/dist/types/@webex/internal-plugin-mercury/src/errors.d.ts +0 -31
  201. package/dist/types/@webex/internal-plugin-mercury/src/index.d.ts +0 -4
  202. package/dist/types/@webex/internal-plugin-mercury/src/mercury.d.ts +0 -2
  203. package/dist/types/@webex/internal-plugin-mercury/src/socket/index.d.ts +0 -1
  204. package/dist/types/@webex/internal-plugin-mercury/src/socket/socket-base.d.ts +0 -120
  205. package/dist/types/@webex/internal-plugin-mercury/src/socket/socket.d.ts +0 -2
  206. package/dist/types/@webex/internal-plugin-mercury/src/socket/socket.shim.d.ts +0 -2
  207. package/dist/types/@webex/internal-plugin-mercury/test/integration/spec/mercury.d.ts +0 -1
  208. package/dist/types/@webex/internal-plugin-mercury/test/integration/spec/sharable-mercury.d.ts +0 -1
  209. package/dist/types/@webex/internal-plugin-mercury/test/integration/spec/webex.d.ts +0 -1
  210. package/dist/types/@webex/internal-plugin-mercury/test/unit/lib/promise-tick.d.ts +0 -9
  211. package/dist/types/@webex/internal-plugin-mercury/test/unit/spec/_setup.d.ts +0 -0
  212. package/dist/types/@webex/internal-plugin-mercury/test/unit/spec/mercury-events.d.ts +0 -1
  213. package/dist/types/@webex/internal-plugin-mercury/test/unit/spec/mercury.d.ts +0 -1
  214. package/dist/types/@webex/internal-plugin-mercury/test/unit/spec/socket.d.ts +0 -1
  215. package/dist/types/@webex/internal-plugin-metrics/src/batcher.d.ts +0 -2
  216. package/dist/types/@webex/internal-plugin-metrics/src/call-diagnostic-events-batcher.d.ts +0 -2
  217. package/dist/types/@webex/internal-plugin-metrics/src/client-metrics-batcher.d.ts +0 -2
  218. package/dist/types/@webex/internal-plugin-metrics/src/config.d.ts +0 -18
  219. package/dist/types/@webex/internal-plugin-metrics/src/index.d.ts +0 -3
  220. package/dist/types/@webex/internal-plugin-metrics/src/metrics.d.ts +0 -2
  221. package/dist/types/@webex/internal-plugin-metrics/test/unit/spec/batcher.d.ts +0 -1
  222. package/dist/types/@webex/internal-plugin-metrics/test/unit/spec/call-diagnostic-events-batcher.d.ts +0 -1
  223. package/dist/types/@webex/internal-plugin-metrics/test/unit/spec/client-metrics-batcher.d.ts +0 -1
  224. package/dist/types/@webex/internal-plugin-metrics/test/unit/spec/metrics.d.ts +0 -1
  225. package/dist/types/@webex/internal-plugin-presence/src/config.d.ts +0 -8
  226. package/dist/types/@webex/internal-plugin-presence/src/constants.d.ts +0 -14
  227. package/dist/types/@webex/internal-plugin-presence/src/index.d.ts +0 -1
  228. package/dist/types/@webex/internal-plugin-presence/src/presence-batcher.d.ts +0 -6
  229. package/dist/types/@webex/internal-plugin-presence/src/presence-worker.d.ts +0 -68
  230. package/dist/types/@webex/internal-plugin-presence/src/presence.d.ts +0 -6
  231. package/dist/types/@webex/internal-plugin-presence/test/integration/spec/presence.d.ts +0 -1
  232. package/dist/types/@webex/internal-plugin-presence/test/unit/spec/presence-worker.d.ts +0 -1
  233. package/dist/types/@webex/internal-plugin-presence/test/unit/spec/presence.d.ts +0 -1
  234. package/dist/types/@webex/internal-plugin-search/src/config.d.ts +0 -4
  235. package/dist/types/@webex/internal-plugin-search/src/index.d.ts +0 -1
  236. package/dist/types/@webex/internal-plugin-search/src/search.d.ts +0 -2
  237. package/dist/types/@webex/internal-plugin-search/test/integration/spec/search.d.ts +0 -1
  238. package/dist/types/@webex/internal-plugin-support/src/config.d.ts +0 -16
  239. package/dist/types/@webex/internal-plugin-support/src/index.d.ts +0 -1
  240. package/dist/types/@webex/internal-plugin-support/src/support.d.ts +0 -2
  241. package/dist/types/@webex/internal-plugin-support/test/integration/spec/support.d.ts +0 -1
  242. package/dist/types/@webex/internal-plugin-support/test/unit/spec/support.d.ts +0 -1
  243. package/dist/types/@webex/internal-plugin-team/src/config.d.ts +0 -4
  244. package/dist/types/@webex/internal-plugin-team/src/index.d.ts +0 -1
  245. package/dist/types/@webex/internal-plugin-team/src/team.d.ts +0 -2
  246. package/dist/types/@webex/internal-plugin-team/test/integration/spec/actions.d.ts +0 -1
  247. package/dist/types/@webex/internal-plugin-team/test/integration/spec/create.d.ts +0 -1
  248. package/dist/types/@webex/internal-plugin-team/test/integration/spec/get.d.ts +0 -1
  249. package/dist/types/@webex/internal-plugin-team/test/integration/spec/mercury.d.ts +0 -1
  250. package/dist/types/@webex/internal-plugin-team/test/unit/spec/team.d.ts +0 -1
  251. package/dist/types/@webex/internal-plugin-user/src/config.d.ts +0 -17
  252. package/dist/types/@webex/internal-plugin-user/src/index.d.ts +0 -1
  253. package/dist/types/@webex/internal-plugin-user/src/user-uuid-batcher.d.ts +0 -5
  254. package/dist/types/@webex/internal-plugin-user/src/user-uuid-store.d.ts +0 -34
  255. package/dist/types/@webex/internal-plugin-user/src/user.d.ts +0 -5
  256. package/dist/types/@webex/internal-plugin-user/test/integration/spec/user.d.ts +0 -1
  257. package/dist/types/@webex/internal-plugin-user/test/unit/spec/user-uuid-batcher.d.ts +0 -1
  258. package/dist/types/@webex/internal-plugin-user/test/unit/spec/user.d.ts +0 -1
  259. package/dist/types/@webex/internal-plugin-voicea/src/constants.d.ts +0 -28
  260. package/dist/types/@webex/internal-plugin-voicea/src/index.d.ts +0 -1
  261. package/dist/types/@webex/internal-plugin-voicea/src/utils.d.ts +0 -1
  262. package/dist/types/@webex/internal-plugin-voicea/src/voicea.d.ts +0 -78
  263. package/dist/types/@webex/internal-plugin-voicea/src/voicea.types.d.ts +0 -72
  264. package/dist/types/@webex/internal-plugin-voicea/test/unit/spec/utils.d.ts +0 -1
  265. package/dist/types/@webex/internal-plugin-voicea/test/unit/spec/voicea.d.ts +0 -1
  266. package/dist/types/@webex/internal-plugin-wdm/src/index.d.ts +0 -2
  267. package/dist/types/@webex/internal-plugin-wdm/test/integration/spec/webex.d.ts +0 -1
  268. package/dist/types/@webex/internal-plugin-wdm/test/unit/spec/device.d.ts +0 -1
  269. package/dist/types/@webex/jsdoctrinetest/src/assertions/literal.d.ts +0 -12
  270. package/dist/types/@webex/jsdoctrinetest/src/extract.d.ts +0 -20
  271. package/dist/types/@webex/jsdoctrinetest/src/index.d.ts +0 -1
  272. package/dist/types/@webex/jsdoctrinetest/src/mocha-template.d.ts +0 -11
  273. package/dist/types/@webex/jsdoctrinetest/src/parse.d.ts +0 -7
  274. package/dist/types/@webex/jsdoctrinetest/src/transform.d.ts +0 -14
  275. package/dist/types/@webex/jsdoctrinetest/test/unit/spec/default.d.ts +0 -1
  276. package/dist/types/@webex/plugin-attachment-actions/src/attachmentActions.d.ts +0 -51
  277. package/dist/types/@webex/plugin-attachment-actions/src/index.d.ts +0 -2
  278. package/dist/types/@webex/plugin-attachment-actions/test/integration/spec/attachmentActions.d.ts +0 -1
  279. package/dist/types/@webex/plugin-authorization/src/index.browser.d.ts +0 -1
  280. package/dist/types/@webex/plugin-authorization/src/index.d.ts +0 -1
  281. package/dist/types/@webex/plugin-authorization-browser/src/authorization.d.ts +0 -8
  282. package/dist/types/@webex/plugin-authorization-browser/src/config.d.ts +0 -6
  283. package/dist/types/@webex/plugin-authorization-browser/src/index.d.ts +0 -2
  284. package/dist/types/@webex/plugin-authorization-browser/test/automation/fixtures/app.d.ts +0 -1
  285. package/dist/types/@webex/plugin-authorization-browser/test/automation/spec/authorization-code-grant.d.ts +0 -1
  286. package/dist/types/@webex/plugin-authorization-browser/test/automation/spec/implicit-grant.d.ts +0 -1
  287. package/dist/types/@webex/plugin-authorization-browser/test/integration/spec/authorization.d.ts +0 -1
  288. package/dist/types/@webex/plugin-authorization-browser/test/unit/spec/authorization.d.ts +0 -1
  289. package/dist/types/@webex/plugin-authorization-browser-first-party/src/authorization.d.ts +0 -12
  290. package/dist/types/@webex/plugin-authorization-browser-first-party/src/config.d.ts +0 -7
  291. package/dist/types/@webex/plugin-authorization-browser-first-party/src/index.d.ts +0 -2
  292. package/dist/types/@webex/plugin-authorization-browser-first-party/test/automation/fixtures/app.d.ts +0 -1
  293. package/dist/types/@webex/plugin-authorization-browser-first-party/test/automation/spec/authorization-code-grant.d.ts +0 -1
  294. package/dist/types/@webex/plugin-authorization-browser-first-party/test/unit/spec/authorization.d.ts +0 -1
  295. package/dist/types/@webex/plugin-authorization-node/src/authorization.d.ts +0 -7
  296. package/dist/types/@webex/plugin-authorization-node/src/config.d.ts +0 -4
  297. package/dist/types/@webex/plugin-authorization-node/src/index.d.ts +0 -2
  298. package/dist/types/@webex/plugin-authorization-node/test/integration/spec/authorization.d.ts +0 -1
  299. package/dist/types/@webex/plugin-authorization-node/test/unit/spec/authorization.d.ts +0 -1
  300. package/dist/types/@webex/plugin-device-manager/sample/app.d.ts +0 -841
  301. package/dist/types/@webex/plugin-device-manager/src/collection.d.ts +0 -8
  302. package/dist/types/@webex/plugin-device-manager/src/config.d.ts +0 -2
  303. package/dist/types/@webex/plugin-device-manager/src/constants.d.ts +0 -3
  304. package/dist/types/@webex/plugin-device-manager/src/device-manager.d.ts +0 -2
  305. package/dist/types/@webex/plugin-device-manager/src/index.d.ts +0 -2
  306. package/dist/types/@webex/plugin-device-manager/test/unit/spec/index.d.ts +0 -1
  307. package/dist/types/@webex/plugin-device-manager/webex.d.ts +0 -1
  308. package/dist/types/@webex/plugin-logger/src/config.d.ts +0 -19
  309. package/dist/types/@webex/plugin-logger/src/index.d.ts +0 -1
  310. package/dist/types/@webex/plugin-logger/src/logger.d.ts +0 -7
  311. package/dist/types/@webex/plugin-logger/test/unit/spec/logger.d.ts +0 -1
  312. package/dist/types/@webex/plugin-meetings/browsers.d.ts +0 -75
  313. package/dist/types/@webex/plugin-meetings/src/breakouts/breakout.d.ts +0 -8
  314. package/dist/types/@webex/plugin-meetings/src/breakouts/collection.d.ts +0 -5
  315. package/dist/types/@webex/plugin-meetings/src/breakouts/index.d.ts +0 -5
  316. package/dist/types/@webex/plugin-meetings/src/breakouts/request.d.ts +0 -22
  317. package/dist/types/@webex/plugin-meetings/src/breakouts/utils.d.ts +0 -1
  318. package/dist/types/@webex/plugin-meetings/src/common/browser-detection.d.ts +0 -9
  319. package/dist/types/@webex/plugin-meetings/src/common/collection.d.ts +0 -48
  320. package/dist/types/@webex/plugin-meetings/src/common/config.d.ts +0 -2
  321. package/dist/types/@webex/plugin-meetings/src/common/errors/captcha-error.d.ts +0 -15
  322. package/dist/types/@webex/plugin-meetings/src/common/errors/intent-to-join.d.ts +0 -16
  323. package/dist/types/@webex/plugin-meetings/src/common/errors/join-meeting.d.ts +0 -17
  324. package/dist/types/@webex/plugin-meetings/src/common/errors/media.d.ts +0 -15
  325. package/dist/types/@webex/plugin-meetings/src/common/errors/parameter.d.ts +0 -15
  326. package/dist/types/@webex/plugin-meetings/src/common/errors/password-error.d.ts +0 -15
  327. package/dist/types/@webex/plugin-meetings/src/common/errors/permission.d.ts +0 -14
  328. package/dist/types/@webex/plugin-meetings/src/common/errors/reconnection-in-progress.d.ts +0 -9
  329. package/dist/types/@webex/plugin-meetings/src/common/errors/reconnection.d.ts +0 -15
  330. package/dist/types/@webex/plugin-meetings/src/common/errors/stats.d.ts +0 -15
  331. package/dist/types/@webex/plugin-meetings/src/common/errors/webex-errors.d.ts +0 -69
  332. package/dist/types/@webex/plugin-meetings/src/common/errors/webex-meetings-error.d.ts +0 -20
  333. package/dist/types/@webex/plugin-meetings/src/common/events/events-scope.d.ts +0 -17
  334. package/dist/types/@webex/plugin-meetings/src/common/events/events.d.ts +0 -12
  335. package/dist/types/@webex/plugin-meetings/src/common/events/trigger-proxy.d.ts +0 -2
  336. package/dist/types/@webex/plugin-meetings/src/common/events/util.d.ts +0 -2
  337. package/dist/types/@webex/plugin-meetings/src/common/logs/logger-config.d.ts +0 -2
  338. package/dist/types/@webex/plugin-meetings/src/common/logs/logger-proxy.d.ts +0 -2
  339. package/dist/types/@webex/plugin-meetings/src/common/logs/request.d.ts +0 -34
  340. package/dist/types/@webex/plugin-meetings/src/common/queue.d.ts +0 -32
  341. package/dist/types/@webex/plugin-meetings/src/config.d.ts +0 -77
  342. package/dist/types/@webex/plugin-meetings/src/constants.d.ts +0 -899
  343. package/dist/types/@webex/plugin-meetings/src/controls-options-manager/constants.d.ts +0 -4
  344. package/dist/types/@webex/plugin-meetings/src/controls-options-manager/enums.d.ts +0 -5
  345. package/dist/types/@webex/plugin-meetings/src/controls-options-manager/index.d.ts +0 -120
  346. package/dist/types/@webex/plugin-meetings/src/controls-options-manager/util.d.ts +0 -7
  347. package/dist/types/@webex/plugin-meetings/src/index.d.ts +0 -7
  348. package/dist/types/@webex/plugin-meetings/src/locus-info/controlsUtils.d.ts +0 -2
  349. package/dist/types/@webex/plugin-meetings/src/locus-info/embeddedAppsUtils.d.ts +0 -2
  350. package/dist/types/@webex/plugin-meetings/src/locus-info/fullState.d.ts +0 -2
  351. package/dist/types/@webex/plugin-meetings/src/locus-info/hostUtils.d.ts +0 -2
  352. package/dist/types/@webex/plugin-meetings/src/locus-info/index.d.ts +0 -269
  353. package/dist/types/@webex/plugin-meetings/src/locus-info/infoUtils.d.ts +0 -2
  354. package/dist/types/@webex/plugin-meetings/src/locus-info/mediaSharesUtils.d.ts +0 -2
  355. package/dist/types/@webex/plugin-meetings/src/locus-info/parser.d.ts +0 -212
  356. package/dist/types/@webex/plugin-meetings/src/locus-info/selfUtils.d.ts +0 -2
  357. package/dist/types/@webex/plugin-meetings/src/media/index.d.ts +0 -32
  358. package/dist/types/@webex/plugin-meetings/src/media/properties.d.ts +0 -107
  359. package/dist/types/@webex/plugin-meetings/src/media/util.d.ts +0 -2
  360. package/dist/types/@webex/plugin-meetings/src/mediaQualityMetrics/config.d.ts +0 -365
  361. package/dist/types/@webex/plugin-meetings/src/meeting/effectsState.d.ts +0 -42
  362. package/dist/types/@webex/plugin-meetings/src/meeting/in-meeting-actions.d.ts +0 -83
  363. package/dist/types/@webex/plugin-meetings/src/meeting/index.d.ts +0 -1724
  364. package/dist/types/@webex/plugin-meetings/src/meeting/muteState.d.ts +0 -108
  365. package/dist/types/@webex/plugin-meetings/src/meeting/request.d.ts +0 -261
  366. package/dist/types/@webex/plugin-meetings/src/meeting/request.type.d.ts +0 -11
  367. package/dist/types/@webex/plugin-meetings/src/meeting/state.d.ts +0 -9
  368. package/dist/types/@webex/plugin-meetings/src/meeting/util.d.ts +0 -2
  369. package/dist/types/@webex/plugin-meetings/src/meeting-info/collection.d.ts +0 -20
  370. package/dist/types/@webex/plugin-meetings/src/meeting-info/index.d.ts +0 -57
  371. package/dist/types/@webex/plugin-meetings/src/meeting-info/meeting-info-v2.d.ts +0 -93
  372. package/dist/types/@webex/plugin-meetings/src/meeting-info/request.d.ts +0 -22
  373. package/dist/types/@webex/plugin-meetings/src/meeting-info/util.d.ts +0 -2
  374. package/dist/types/@webex/plugin-meetings/src/meeting-info/utilv2.d.ts +0 -2
  375. package/dist/types/@webex/plugin-meetings/src/meetings/collection.d.ts +0 -23
  376. package/dist/types/@webex/plugin-meetings/src/meetings/index.d.ts +0 -297
  377. package/dist/types/@webex/plugin-meetings/src/meetings/request.d.ts +0 -27
  378. package/dist/types/@webex/plugin-meetings/src/meetings/util.d.ts +0 -18
  379. package/dist/types/@webex/plugin-meetings/src/member/index.d.ts +0 -146
  380. package/dist/types/@webex/plugin-meetings/src/member/util.d.ts +0 -2
  381. package/dist/types/@webex/plugin-meetings/src/members/collection.d.ts +0 -24
  382. package/dist/types/@webex/plugin-meetings/src/members/index.d.ts +0 -320
  383. package/dist/types/@webex/plugin-meetings/src/members/request.d.ts +0 -50
  384. package/dist/types/@webex/plugin-meetings/src/members/util.d.ts +0 -2
  385. package/dist/types/@webex/plugin-meetings/src/metrics/config.d.ts +0 -178
  386. package/dist/types/@webex/plugin-meetings/src/metrics/constants.d.ts +0 -57
  387. package/dist/types/@webex/plugin-meetings/src/metrics/index.d.ts +0 -160
  388. package/dist/types/@webex/plugin-meetings/src/multistream/mediaRequestManager.d.ts +0 -51
  389. package/dist/types/@webex/plugin-meetings/src/multistream/receiveSlot.d.ts +0 -66
  390. package/dist/types/@webex/plugin-meetings/src/multistream/receiveSlotManager.d.ts +0 -46
  391. package/dist/types/@webex/plugin-meetings/src/multistream/remoteMedia.d.ts +0 -93
  392. package/dist/types/@webex/plugin-meetings/src/multistream/remoteMediaGroup.d.ts +0 -56
  393. package/dist/types/@webex/plugin-meetings/src/multistream/remoteMediaManager.d.ts +0 -241
  394. package/dist/types/@webex/plugin-meetings/src/networkQualityMonitor/index.d.ts +0 -70
  395. package/dist/types/@webex/plugin-meetings/src/personal-meeting-room/index.d.ts +0 -47
  396. package/dist/types/@webex/plugin-meetings/src/personal-meeting-room/request.d.ts +0 -14
  397. package/dist/types/@webex/plugin-meetings/src/personal-meeting-room/util.d.ts +0 -2
  398. package/dist/types/@webex/plugin-meetings/src/reachability/index.d.ts +0 -140
  399. package/dist/types/@webex/plugin-meetings/src/reachability/request.d.ts +0 -35
  400. package/dist/types/@webex/plugin-meetings/src/reactions/constants.d.ts +0 -3
  401. package/dist/types/@webex/plugin-meetings/src/reactions/reactions.d.ts +0 -4
  402. package/dist/types/@webex/plugin-meetings/src/reactions/reactions.type.d.ts +0 -52
  403. package/dist/types/@webex/plugin-meetings/src/reconnection-manager/index.d.ts +0 -117
  404. package/dist/types/@webex/plugin-meetings/src/recording-controller/enums.d.ts +0 -7
  405. package/dist/types/@webex/plugin-meetings/src/recording-controller/index.d.ts +0 -193
  406. package/dist/types/@webex/plugin-meetings/src/recording-controller/util.d.ts +0 -13
  407. package/dist/types/@webex/plugin-meetings/src/roap/index.d.ts +0 -77
  408. package/dist/types/@webex/plugin-meetings/src/roap/request.d.ts +0 -35
  409. package/dist/types/@webex/plugin-meetings/src/roap/turnDiscovery.d.ts +0 -74
  410. package/dist/types/@webex/plugin-meetings/src/statsAnalyzer/global.d.ts +0 -36
  411. package/dist/types/@webex/plugin-meetings/src/statsAnalyzer/index.d.ts +0 -195
  412. package/dist/types/@webex/plugin-meetings/src/statsAnalyzer/mqaUtil.d.ts +0 -24
  413. package/dist/types/@webex/plugin-meetings/src/transcription/index.d.ts +0 -64
  414. package/dist/types/@webex/plugin-meetings/test/integration/spec/converged-space-meetings.d.ts +0 -1
  415. package/dist/types/@webex/plugin-meetings/test/integration/spec/journey.d.ts +0 -1
  416. package/dist/types/@webex/plugin-meetings/test/integration/spec/space-meeting.d.ts +0 -1
  417. package/dist/types/@webex/plugin-meetings/test/integration/spec/transcription.d.ts +0 -1
  418. package/dist/types/@webex/plugin-meetings/test/unit/spec/breakouts/breakout.d.ts +0 -1
  419. package/dist/types/@webex/plugin-meetings/test/unit/spec/breakouts/collection.d.ts +0 -1
  420. package/dist/types/@webex/plugin-meetings/test/unit/spec/breakouts/index.d.ts +0 -1
  421. package/dist/types/@webex/plugin-meetings/test/unit/spec/breakouts/request.d.ts +0 -1
  422. package/dist/types/@webex/plugin-meetings/test/unit/spec/breakouts/utils.d.ts +0 -1
  423. package/dist/types/@webex/plugin-meetings/test/unit/spec/common/browser-detection.d.ts +0 -1
  424. package/dist/types/@webex/plugin-meetings/test/unit/spec/common/queue.d.ts +0 -1
  425. package/dist/types/@webex/plugin-meetings/test/unit/spec/controls-options-manager/index.d.ts +0 -1
  426. package/dist/types/@webex/plugin-meetings/test/unit/spec/controls-options-manager/util.d.ts +0 -1
  427. package/dist/types/@webex/plugin-meetings/test/unit/spec/fixture/locus.d.ts +0 -332
  428. package/dist/types/@webex/plugin-meetings/test/unit/spec/locus-info/controlsUtils.d.ts +0 -1
  429. package/dist/types/@webex/plugin-meetings/test/unit/spec/locus-info/embeddedAppsUtils.d.ts +0 -1
  430. package/dist/types/@webex/plugin-meetings/test/unit/spec/locus-info/index.d.ts +0 -1
  431. package/dist/types/@webex/plugin-meetings/test/unit/spec/locus-info/infoUtils.d.ts +0 -1
  432. package/dist/types/@webex/plugin-meetings/test/unit/spec/locus-info/parser.d.ts +0 -1
  433. package/dist/types/@webex/plugin-meetings/test/unit/spec/locus-info/selfConstant.d.ts +0 -274
  434. package/dist/types/@webex/plugin-meetings/test/unit/spec/locus-info/selfUtils.d.ts +0 -1
  435. package/dist/types/@webex/plugin-meetings/test/unit/spec/media/index.d.ts +0 -1
  436. package/dist/types/@webex/plugin-meetings/test/unit/spec/media/properties.d.ts +0 -1
  437. package/dist/types/@webex/plugin-meetings/test/unit/spec/meeting/effectsState.d.ts +0 -1
  438. package/dist/types/@webex/plugin-meetings/test/unit/spec/meeting/in-meeting-actions.d.ts +0 -1
  439. package/dist/types/@webex/plugin-meetings/test/unit/spec/meeting/index.d.ts +0 -1
  440. package/dist/types/@webex/plugin-meetings/test/unit/spec/meeting/muteState.d.ts +0 -1
  441. package/dist/types/@webex/plugin-meetings/test/unit/spec/meeting/request.d.ts +0 -1
  442. package/dist/types/@webex/plugin-meetings/test/unit/spec/meeting/utils.d.ts +0 -1
  443. package/dist/types/@webex/plugin-meetings/test/unit/spec/meeting-info/meetinginfov2.d.ts +0 -1
  444. package/dist/types/@webex/plugin-meetings/test/unit/spec/meeting-info/request.d.ts +0 -1
  445. package/dist/types/@webex/plugin-meetings/test/unit/spec/meeting-info/util.d.ts +0 -1
  446. package/dist/types/@webex/plugin-meetings/test/unit/spec/meeting-info/utilv2.d.ts +0 -1
  447. package/dist/types/@webex/plugin-meetings/test/unit/spec/meetings/collection.d.ts +0 -1
  448. package/dist/types/@webex/plugin-meetings/test/unit/spec/meetings/index.d.ts +0 -1
  449. package/dist/types/@webex/plugin-meetings/test/unit/spec/meetings/utils.d.ts +0 -1
  450. package/dist/types/@webex/plugin-meetings/test/unit/spec/member/index.d.ts +0 -1
  451. package/dist/types/@webex/plugin-meetings/test/unit/spec/member/util.d.ts +0 -1
  452. package/dist/types/@webex/plugin-meetings/test/unit/spec/members/index.d.ts +0 -1
  453. package/dist/types/@webex/plugin-meetings/test/unit/spec/members/request.d.ts +0 -1
  454. package/dist/types/@webex/plugin-meetings/test/unit/spec/members/utils.d.ts +0 -1
  455. package/dist/types/@webex/plugin-meetings/test/unit/spec/metrics/index.d.ts +0 -1
  456. package/dist/types/@webex/plugin-meetings/test/unit/spec/multistream/mediaRequestManager.d.ts +0 -1
  457. package/dist/types/@webex/plugin-meetings/test/unit/spec/multistream/receiveSlot.d.ts +0 -1
  458. package/dist/types/@webex/plugin-meetings/test/unit/spec/multistream/receiveSlotManager.d.ts +0 -1
  459. package/dist/types/@webex/plugin-meetings/test/unit/spec/multistream/remoteMedia.d.ts +0 -1
  460. package/dist/types/@webex/plugin-meetings/test/unit/spec/multistream/remoteMediaGroup.d.ts +0 -1
  461. package/dist/types/@webex/plugin-meetings/test/unit/spec/multistream/remoteMediaManager.d.ts +0 -1
  462. package/dist/types/@webex/plugin-meetings/test/unit/spec/networkQualityMonitor/index.d.ts +0 -1
  463. package/dist/types/@webex/plugin-meetings/test/unit/spec/personal-meeting-room/personal-meeting-room.d.ts +0 -1
  464. package/dist/types/@webex/plugin-meetings/test/unit/spec/reachability/index.d.ts +0 -1
  465. package/dist/types/@webex/plugin-meetings/test/unit/spec/reconnection-manager/index.d.ts +0 -1
  466. package/dist/types/@webex/plugin-meetings/test/unit/spec/recording-controller/index.d.ts +0 -1
  467. package/dist/types/@webex/plugin-meetings/test/unit/spec/recording-controller/util.d.ts +0 -1
  468. package/dist/types/@webex/plugin-meetings/test/unit/spec/roap/index.d.ts +0 -1
  469. package/dist/types/@webex/plugin-meetings/test/unit/spec/roap/request.d.ts +0 -1
  470. package/dist/types/@webex/plugin-meetings/test/unit/spec/roap/turnDiscovery.d.ts +0 -1
  471. package/dist/types/@webex/plugin-meetings/test/unit/spec/stats-analyzer/index.d.ts +0 -1
  472. package/dist/types/@webex/plugin-meetings/test/utils/cmr.d.ts +0 -6
  473. package/dist/types/@webex/plugin-meetings/test/utils/constants.d.ts +0 -5
  474. package/dist/types/@webex/plugin-meetings/test/utils/testUtils.d.ts +0 -27
  475. package/dist/types/@webex/plugin-meetings/test/utils/webex-config.d.ts +0 -63
  476. package/dist/types/@webex/plugin-meetings/test/utils/webex-test-users.d.ts +0 -2
  477. package/dist/types/@webex/plugin-memberships/src/index.d.ts +0 -2
  478. package/dist/types/@webex/plugin-memberships/src/memberships.d.ts +0 -50
  479. package/dist/types/@webex/plugin-memberships/test/integration/spec/memberships.d.ts +0 -1
  480. package/dist/types/@webex/plugin-messages/src/index.d.ts +0 -2
  481. package/dist/types/@webex/plugin-messages/src/messages.d.ts +0 -58
  482. package/dist/types/@webex/plugin-messages/test/integration/spec/messages.d.ts +0 -1
  483. package/dist/types/@webex/plugin-people/src/config.d.ts +0 -9
  484. package/dist/types/@webex/plugin-people/src/index.d.ts +0 -1
  485. package/dist/types/@webex/plugin-people/src/people-batcher.d.ts +0 -6
  486. package/dist/types/@webex/plugin-people/src/people.d.ts +0 -30
  487. package/dist/types/@webex/plugin-people/test/integration/spec/people.d.ts +0 -1
  488. package/dist/types/@webex/plugin-people/test/unit/spec/people-batcher.d.ts +0 -1
  489. package/dist/types/@webex/plugin-people/test/unit/spec/people.d.ts +0 -1
  490. package/dist/types/@webex/plugin-rooms/src/index.d.ts +0 -2
  491. package/dist/types/@webex/plugin-rooms/src/rooms.d.ts +0 -41
  492. package/dist/types/@webex/plugin-rooms/test/integration/spec/rooms.d.ts +0 -1
  493. package/dist/types/@webex/plugin-team-memberships/src/index.d.ts +0 -2
  494. package/dist/types/@webex/plugin-team-memberships/src/team-memberships.d.ts +0 -49
  495. package/dist/types/@webex/plugin-team-memberships/test/integration/spec/team-memberships.d.ts +0 -1
  496. package/dist/types/@webex/plugin-teams/src/index.d.ts +0 -2
  497. package/dist/types/@webex/plugin-teams/src/teams.d.ts +0 -27
  498. package/dist/types/@webex/plugin-teams/test/integration/spec/teams.d.ts +0 -1
  499. package/dist/types/@webex/plugin-webhooks/src/index.d.ts +0 -2
  500. package/dist/types/@webex/plugin-webhooks/src/webhooks.d.ts +0 -48
  501. package/dist/types/@webex/plugin-webhooks/test/integration/spec/webhooks.d.ts +0 -1
  502. package/dist/types/@webex/recipe-private-web-client/src/config.d.ts +0 -10
  503. package/dist/types/@webex/recipe-private-web-client/src/index.d.ts +0 -8
  504. package/dist/types/@webex/storage-adapter-local-forage/src/index.d.ts +0 -35
  505. package/dist/types/@webex/storage-adapter-local-forage/test/unit/spec/storage-adapter-local-forage.d.ts +0 -1
  506. package/dist/types/@webex/storage-adapter-local-storage/src/index.d.ts +0 -66
  507. package/dist/types/@webex/storage-adapter-local-storage/test/unit/spec/storage-adapter-local-storage.d.ts +0 -1
  508. package/dist/types/@webex/storage-adapter-session-storage/src/index.d.ts +0 -66
  509. package/dist/types/@webex/storage-adapter-session-storage/test/unit/spec/storage-adapter-session-storage.d.ts +0 -1
  510. package/dist/types/@webex/storage-adapter-spec/src/index.d.ts +0 -1
  511. package/dist/types/@webex/test-helper-appid/src/create-user.browser.d.ts +0 -2
  512. package/dist/types/@webex/test-helper-appid/src/create-user.d.ts +0 -7
  513. package/dist/types/@webex/test-helper-appid/src/index.d.ts +0 -7
  514. package/dist/types/@webex/test-helper-appid/src/router.d.ts +0 -2
  515. package/dist/types/@webex/test-helper-automation/src/index.d.ts +0 -2
  516. package/dist/types/@webex/test-helper-automation/src/wd/accept-grant.d.ts +0 -1
  517. package/dist/types/@webex/test-helper-automation/src/wd/login.d.ts +0 -1
  518. package/dist/types/@webex/test-helper-automation/src/wd/print-logs.d.ts +0 -1
  519. package/dist/types/@webex/test-helper-automation/src/wd/submit-password.d.ts +0 -1
  520. package/dist/types/@webex/test-helper-chai/src/assertions/index.d.ts +0 -2
  521. package/dist/types/@webex/test-helper-chai/src/assertions/primitives.d.ts +0 -2
  522. package/dist/types/@webex/test-helper-chai/src/assertions/schemas.d.ts +0 -2
  523. package/dist/types/@webex/test-helper-chai/src/assertions/should-to-assert.d.ts +0 -2
  524. package/dist/types/@webex/test-helper-chai/src/index.d.ts +0 -2
  525. package/dist/types/@webex/test-helper-file/src/file.d.ts +0 -5
  526. package/dist/types/@webex/test-helper-file/src/file.shim.d.ts +0 -18
  527. package/dist/types/@webex/test-helper-file/src/index.d.ts +0 -2
  528. package/dist/types/@webex/test-helper-make-local-url/src/index.d.ts +0 -4
  529. package/dist/types/@webex/test-helper-mocha/src/index.d.ts +0 -29
  530. package/dist/types/@webex/test-helper-mock-web-socket/src/index.d.ts +0 -26
  531. package/dist/types/@webex/test-helper-mock-webex/src/index.d.ts +0 -7
  532. package/dist/types/@webex/test-helper-refresh-callback/src/index.d.ts +0 -10
  533. package/dist/types/@webex/test-helper-retry/src/index.d.ts +0 -15
  534. package/dist/types/@webex/test-helper-server/src/cookies.d.ts +0 -2
  535. package/dist/types/@webex/test-helper-server/src/files.d.ts +0 -2
  536. package/dist/types/@webex/test-helper-server/src/form.d.ts +0 -2
  537. package/dist/types/@webex/test-helper-server/src/index.d.ts +0 -1
  538. package/dist/types/@webex/test-helper-server/src/json.d.ts +0 -2
  539. package/dist/types/@webex/test-helper-server/src/reflect.d.ts +0 -10
  540. package/dist/types/@webex/test-helper-test-users/src/index.d.ts +0 -8
  541. package/dist/types/@webex/test-users/src/index.d.ts +0 -115
  542. package/dist/types/@webex/test-users/src/whistler.d.ts +0 -44
  543. package/dist/types/@webex/test-users/test/integration/spec/index.d.ts +0 -1
  544. package/dist/types/@webex/test-users/test/integration/spec/whistler.d.ts +0 -1
  545. package/dist/types/@webex/webex-core/src/config.d.ts +0 -39
  546. package/dist/types/@webex/webex-core/src/credentials-config.d.ts +0 -2
  547. package/dist/types/@webex/webex-core/src/index.d.ts +0 -24
  548. package/dist/types/@webex/webex-core/src/interceptors/auth.d.ts +0 -43
  549. package/dist/types/@webex/webex-core/src/interceptors/default-options.d.ts +0 -31
  550. package/dist/types/@webex/webex-core/src/interceptors/embargo.d.ts +0 -16
  551. package/dist/types/@webex/webex-core/src/interceptors/network-timing.d.ts +0 -30
  552. package/dist/types/@webex/webex-core/src/interceptors/payload-transformer.d.ts +0 -30
  553. package/dist/types/@webex/webex-core/src/interceptors/rate-limit.d.ts +0 -61
  554. package/dist/types/@webex/webex-core/src/interceptors/redirect.d.ts +0 -22
  555. package/dist/types/@webex/webex-core/src/interceptors/request-event.d.ts +0 -36
  556. package/dist/types/@webex/webex-core/src/interceptors/request-logger.d.ts +0 -22
  557. package/dist/types/@webex/webex-core/src/interceptors/request-timing.d.ts +0 -36
  558. package/dist/types/@webex/webex-core/src/interceptors/response-logger.d.ts +0 -30
  559. package/dist/types/@webex/webex-core/src/interceptors/user-agent.d.ts +0 -38
  560. package/dist/types/@webex/webex-core/src/interceptors/webex-tracking-id.d.ts +0 -26
  561. package/dist/types/@webex/webex-core/src/interceptors/webex-user-agent.d.ts +0 -22
  562. package/dist/types/@webex/webex-core/src/lib/batcher.d.ts +0 -6
  563. package/dist/types/@webex/webex-core/src/lib/credentials/credentials.d.ts +0 -5
  564. package/dist/types/@webex/webex-core/src/lib/credentials/grant-errors.d.ts +0 -57
  565. package/dist/types/@webex/webex-core/src/lib/credentials/index.d.ts +0 -4
  566. package/dist/types/@webex/webex-core/src/lib/credentials/scope.d.ts +0 -16
  567. package/dist/types/@webex/webex-core/src/lib/credentials/token-collection.d.ts +0 -2
  568. package/dist/types/@webex/webex-core/src/lib/credentials/token.d.ts +0 -5
  569. package/dist/types/@webex/webex-core/src/lib/page.d.ts +0 -76
  570. package/dist/types/@webex/webex-core/src/lib/services/constants.d.ts +0 -6
  571. package/dist/types/@webex/webex-core/src/lib/services/index.d.ts +0 -10
  572. package/dist/types/@webex/webex-core/src/lib/services/interceptors/server-error.d.ts +0 -16
  573. package/dist/types/@webex/webex-core/src/lib/services/interceptors/service.d.ts +0 -37
  574. package/dist/types/@webex/webex-core/src/lib/services/metrics.d.ts +0 -4
  575. package/dist/types/@webex/webex-core/src/lib/services/service-catalog.d.ts +0 -5
  576. package/dist/types/@webex/webex-core/src/lib/services/service-fed-ramp.d.ts +0 -5
  577. package/dist/types/@webex/webex-core/src/lib/services/service-host.d.ts +0 -217
  578. package/dist/types/@webex/webex-core/src/lib/services/service-registry.d.ts +0 -271
  579. package/dist/types/@webex/webex-core/src/lib/services/service-state.d.ts +0 -46
  580. package/dist/types/@webex/webex-core/src/lib/services/service-url.d.ts +0 -5
  581. package/dist/types/@webex/webex-core/src/lib/services/services.d.ts +0 -5
  582. package/dist/types/@webex/webex-core/src/lib/stateless-webex-plugin.d.ts +0 -48
  583. package/dist/types/@webex/webex-core/src/lib/storage/decorators.d.ts +0 -15
  584. package/dist/types/@webex/webex-core/src/lib/storage/errors.d.ts +0 -10
  585. package/dist/types/@webex/webex-core/src/lib/storage/index.d.ts +0 -5
  586. package/dist/types/@webex/webex-core/src/lib/storage/make-webex-plugin-store.d.ts +0 -8
  587. package/dist/types/@webex/webex-core/src/lib/storage/make-webex-store.d.ts +0 -48
  588. package/dist/types/@webex/webex-core/src/lib/storage/memory-store-adapter.d.ts +0 -18
  589. package/dist/types/@webex/webex-core/src/lib/webex-core-plugin-mixin.d.ts +0 -8
  590. package/dist/types/@webex/webex-core/src/lib/webex-http-error.d.ts +0 -12
  591. package/dist/types/@webex/webex-core/src/lib/webex-internal-core-plugin-mixin.d.ts +0 -8
  592. package/dist/types/@webex/webex-core/src/lib/webex-plugin.d.ts +0 -5
  593. package/dist/types/@webex/webex-core/src/plugins/logger.d.ts +0 -2
  594. package/dist/types/@webex/webex-core/src/webex-core.d.ts +0 -31
  595. package/dist/types/@webex/webex-core/src/webex-internal-core.d.ts +0 -7
  596. package/dist/types/@webex/webex-core/test/integration/spec/credentials/credentials.d.ts +0 -1
  597. package/dist/types/@webex/webex-core/test/integration/spec/credentials/token.d.ts +0 -1
  598. package/dist/types/@webex/webex-core/test/integration/spec/services/service-catalog.d.ts +0 -1
  599. package/dist/types/@webex/webex-core/test/integration/spec/services/services.d.ts +0 -1
  600. package/dist/types/@webex/webex-core/test/integration/spec/webex-core.d.ts +0 -1
  601. package/dist/types/@webex/webex-core/test/unit/spec/_setup.d.ts +0 -1
  602. package/dist/types/@webex/webex-core/test/unit/spec/credentials/credentials.d.ts +0 -1
  603. package/dist/types/@webex/webex-core/test/unit/spec/credentials/token.d.ts +0 -1
  604. package/dist/types/@webex/webex-core/test/unit/spec/interceptors/auth.d.ts +0 -1
  605. package/dist/types/@webex/webex-core/test/unit/spec/interceptors/default-options.d.ts +0 -1
  606. package/dist/types/@webex/webex-core/test/unit/spec/interceptors/embargo.d.ts +0 -1
  607. package/dist/types/@webex/webex-core/test/unit/spec/interceptors/network-timing.d.ts +0 -1
  608. package/dist/types/@webex/webex-core/test/unit/spec/interceptors/payload-transformer.d.ts +0 -1
  609. package/dist/types/@webex/webex-core/test/unit/spec/interceptors/rate-limit.d.ts +0 -1
  610. package/dist/types/@webex/webex-core/test/unit/spec/interceptors/redirect.d.ts +0 -1
  611. package/dist/types/@webex/webex-core/test/unit/spec/interceptors/request-timing.d.ts +0 -1
  612. package/dist/types/@webex/webex-core/test/unit/spec/interceptors/user-agent.d.ts +0 -1
  613. package/dist/types/@webex/webex-core/test/unit/spec/interceptors/webex-tracking-id.d.ts +0 -1
  614. package/dist/types/@webex/webex-core/test/unit/spec/interceptors/webex-user-agent.d.ts +0 -1
  615. package/dist/types/@webex/webex-core/test/unit/spec/lib/batcher.d.ts +0 -1
  616. package/dist/types/@webex/webex-core/test/unit/spec/lib/page.d.ts +0 -1
  617. package/dist/types/@webex/webex-core/test/unit/spec/lib/webex-plugin.d.ts +0 -1
  618. package/dist/types/@webex/webex-core/test/unit/spec/services/interceptors/server-error.d.ts +0 -1
  619. package/dist/types/@webex/webex-core/test/unit/spec/services/interceptors/service.d.ts +0 -1
  620. package/dist/types/@webex/webex-core/test/unit/spec/services/service-catalog.d.ts +0 -1
  621. package/dist/types/@webex/webex-core/test/unit/spec/services/service-host.d.ts +0 -1
  622. package/dist/types/@webex/webex-core/test/unit/spec/services/service-registry.d.ts +0 -1
  623. package/dist/types/@webex/webex-core/test/unit/spec/services/service-state.d.ts +0 -1
  624. package/dist/types/@webex/webex-core/test/unit/spec/services/service-url.d.ts +0 -1
  625. package/dist/types/@webex/webex-core/test/unit/spec/services/services.d.ts +0 -1
  626. package/dist/types/@webex/webex-core/test/unit/spec/storage/persist.d.ts +0 -1
  627. package/dist/types/@webex/webex-core/test/unit/spec/storage/storage-adapter.d.ts +0 -1
  628. package/dist/types/@webex/webex-core/test/unit/spec/storage/wait-for-value.d.ts +0 -1
  629. package/dist/types/@webex/webex-core/test/unit/spec/webex-core.d.ts +0 -1
  630. package/dist/types/@webex/webex-core/test/unit/spec/webex-internal-core.d.ts +0 -1
  631. package/dist/types/@webex/webrtc/src/analyzer.d.ts +0 -0
  632. package/dist/types/@webex/webrtc/src/constants.d.ts +0 -0
  633. package/dist/types/@webex/webrtc/src/extractor.d.ts +0 -0
  634. package/dist/types/@webex/webrtc/src/generator.d.ts +0 -0
  635. package/dist/types/@webex/webrtc/src/history.d.ts +0 -0
  636. package/dist/types/@webex/webrtc/src/ice.d.ts +0 -0
  637. package/dist/types/@webex/webrtc/src/index.d.ts +0 -31
  638. package/dist/types/@webex/webrtc/src/logger.d.ts +0 -0
  639. package/dist/types/@webex/webrtc/src/parser.d.ts +0 -0
  640. package/dist/types/@webex/webrtc/src/stats.d.ts +0 -0
  641. package/dist/types/@webex/webrtc/src/transformer.d.ts +0 -0
  642. package/dist/types/@webex/webrtc/src/validator.d.ts +0 -0
  643. package/dist/types/@webex/xunit-with-logs/src/index.d.ts +0 -43
  644. package/dist/types/webex/browser.d.ts +0 -5
  645. package/dist/types/webex/env.d.ts +0 -2
  646. package/dist/types/webex/src/_setup.d.ts +0 -1
  647. package/dist/types/webex/src/config-storage.d.ts +0 -5
  648. package/dist/types/webex/src/config-storage.shim.d.ts +0 -5
  649. package/dist/types/webex/src/config.d.ts +0 -17
  650. package/dist/types/webex/src/index.d.ts +0 -11
  651. package/dist/types/webex/src/webex.d.ts +0 -9
  652. package/dist/types/webex/test/integration/spec/commonjs.d.ts +0 -1
  653. package/dist/types/webex/test/integration/spec/env.d.ts +0 -1
  654. package/dist/types/webex/test/integration/spec/init.d.ts +0 -1
  655. package/dist/types/webex/test/integration/spec/request.d.ts +0 -1
  656. package/dist/types/webex/test/unit/spec/webex.d.ts +0 -1
  657. package/dist/types/webex/umd/webex.min.d.ts +0 -2
package/.eslintrc.js ADDED
@@ -0,0 +1,6 @@
1
+ const config = {
2
+ root: true,
3
+ extends: ['@webex/eslint-config-legacy'],
4
+ };
5
+
6
+ module.exports = config;
@@ -0,0 +1,3 @@
1
+ const babelConfigLegacy = require('@webex/babel-config-legacy');
2
+
3
+ module.exports = babelConfigLegacy;
package/dist/index.js CHANGED
@@ -27,20 +27,21 @@ _Object$defineProperty(exports, "removeWhistlerTestUser", {
27
27
  return _whistler.removeTestUser;
28
28
  }
29
29
  });
30
+ exports.setPreferredSite = setPreferredSite;
31
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
30
32
  var _now = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/date/now"));
31
33
  var _promise = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/promise"));
32
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
33
- var _defaultsDeep2 = _interopRequireDefault(require("lodash/defaultsDeep"));
34
34
  var _assert = _interopRequireDefault(require("assert"));
35
35
  var _uuid = _interopRequireDefault(require("uuid"));
36
36
  var _btoa = _interopRequireDefault(require("btoa"));
37
+ var _lodash = _interopRequireDefault(require("lodash"));
37
38
  var _nodeRandomName = _interopRequireDefault(require("node-random-name"));
38
39
  var _httpCore = require("@webex/http-core");
39
40
  var _whistler = _interopRequireWildcard(require("./whistler"));
40
- function _getRequireWildcardCache(nodeInterop) { if (typeof _WeakMap !== "function") return null; var cacheBabelInterop = new _WeakMap(); var cacheNodeInterop = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
41
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = _Object$defineProperty && _Object$getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? _Object$getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { _Object$defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
42
- function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
43
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
41
+ function _getRequireWildcardCache(e) { if ("function" != typeof _WeakMap) return null; var r = new _WeakMap(), t = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
42
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = _Object$defineProperty && _Object$getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? _Object$getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? _Object$defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
43
+ function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
44
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
44
45
  var BASE_PATH_SECURE = '/users/test_users_s';
45
46
  var BASE_PATH = '/users/test_users';
46
47
 
@@ -155,6 +156,10 @@ function requestWithAuth(options) {
155
156
  * @property {string} [roles] defaults to []
156
157
  * @property {string} [scope] defaults to WEBEX_SCOPE
157
158
  * @property {string} [type] used to create a machine
159
+ * @property {boolean} [forceCreate] force creates the user, to be used in conjunction with ensureExistsInWebexSites
160
+ * @property {boolean} [ensureExistsInWebexSites] syncs the user in provided webexSites (syncInWebexSites)
161
+ * @property {Array.<string>} [syncInWebexSites] used to define in which sites account should be synced
162
+ * @property {string} [orgAdminAuthorization] bearer token of org admin to use syncInWebexSites
158
163
  */
159
164
 
160
165
  /**
@@ -202,7 +207,7 @@ function createTestUser() {
202
207
  clientSecret: clientSecret,
203
208
  displayName: options.displayName || (0, _nodeRandomName.default)(),
204
209
  emailTemplate: options.emailAddress,
205
- entitlements: options.entitlements || ['spark', 'squaredCallInitiation', 'squaredRoomModeration', 'squaredInviter', 'webExSquared'],
210
+ entitlements: options.entitlements || ['spark', 'squaredCallInitiation', 'squaredRoomModeration', 'squaredInviter', 'webExSquared', 'basicMessage'],
206
211
  idbrokerUrl: idbrokerUrl,
207
212
  machineType: options.machineType,
208
213
  orgId: options.orgId,
@@ -210,7 +215,11 @@ function createTestUser() {
210
215
  password: options.password || "".concat(_uuid.default.v4(), "zAY1*"),
211
216
  roles: options.roles || [],
212
217
  scopes: options.scope || process.env.WEBEX_SCOPE,
213
- type: options.type
218
+ type: options.type,
219
+ forceCreate: options.forceCreate || false,
220
+ ensureExistsInWebexSites: options.ensureExistsInWebexSites || false,
221
+ syncInWebexSites: options.syncInWebexSites,
222
+ orgAdminAuthorization: options.orgAdminAuthorization
214
223
  };
215
224
  return requestWithAuth({
216
225
  method: 'POST',
@@ -256,7 +265,7 @@ function loginTestUser(options) {
256
265
  method: 'POST',
257
266
  uri: "".concat(cigServiceUrl).concat(BASE_PATH, "/login"),
258
267
  json: true,
259
- body: (0, _defaultsDeep2.default)(options, {
268
+ body: _lodash.default.defaultsDeep(options, {
260
269
  clientId: clientId,
261
270
  clientSecret: clientSecret
262
271
  })
@@ -308,4 +317,50 @@ function removeTestUser() {
308
317
  uri: "".concat(cigServiceUrl).concat(BASE_PATH, "/delete")
309
318
  });
310
319
  }
320
+
321
+ /**
322
+ * Sets the preferredWebexSite for the provided user
323
+ *
324
+ * This method should be used to ensure a created test user has the right webex site set.
325
+ *
326
+ * @param {Object} options
327
+ * @param {string} options.userId user id to set site
328
+ * @param {string} options.preferredSite new preferred webexsite
329
+ * @param {string} options.orgId orgId of the site
330
+ * @param {string} options.identityServiceUrl url of identity service
331
+ * @param {string} options.authorization
332
+ * @param {string} options.clientId
333
+ * @param {string} options.clientSecret
334
+ * @returns {Promise}
335
+ */
336
+ function setPreferredSite() {
337
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
338
+ var clientId = options.clientId || process.env.WEBEX_CLIENT_ID;
339
+ var clientSecret = options.clientSecret || process.env.WEBEX_CLIENT_SECRET;
340
+ if (!clientId) {
341
+ throw new Error('options.clientId or process.env.WEBEX_CLIENT_ID must be defined');
342
+ }
343
+ if (!clientSecret) {
344
+ throw new Error('options.clientSecret or process.env.WEBEX_CLIENT_SECRET must be defined');
345
+ }
346
+
347
+ /* eslint-disable no-useless-escape */
348
+ var body = {
349
+ schemas: ['urn:scim:schemas:core:1.0', 'urn:scim:schemas:extension:cisco:commonidentity:1.0'],
350
+ userPreferences: [{
351
+ value: "\"preferredWebExSite\":\"".concat(options.preferredSite, "\"")
352
+ }]
353
+ };
354
+ /* eslint-enable no-useless-escape */
355
+
356
+ return (0, _httpCore.request)({
357
+ method: 'PATCH',
358
+ headers: {
359
+ authorization: options.authorization
360
+ },
361
+ uri: "".concat(options.identityServiceUrl, "/identity/scim/").concat(options.orgId, "/v1/Users/").concat(options.userId),
362
+ json: true,
363
+ body: body
364
+ });
365
+ }
311
366
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["BASE_PATH_SECURE","BASE_PATH","fixToken","token","now","expires_in","expires","refresh_token_expires_in","refresh_token_expires","token_type","access_token","authorization","clientToken","getClientCredentials","clientId","clientSecret","idbrokerUrl","resolve","request","method","uri","json","form","grant_type","scope","client_id","client_secret","headers","btoa","then","res","body","requestWithAuth","options","createTestUser","process","env","WEBEX_CLIENT_ID","WEBEX_CLIENT_SECRET","IDBROKER_BASE_URL","cigServiceUrl","WEBEX_TEST_USERS_CI_GATEWAY_SERVICE_URL","WEBEX_TEST_USERS_CONVERSATION_SERVICE_URL","Error","authCodeOnly","displayName","randomName","emailTemplate","emailAddress","entitlements","machineType","orgId","password","uuid","v4","roles","scopes","WEBEX_SCOPE","type","user","email","name","loginTestUser","removeTestUser","id","reject","assert","user_id","refresh_token","user_type","userType"],"sources":["index.js"],"sourcesContent":["import assert from 'assert';\n\nimport uuid from 'uuid';\nimport btoa from 'btoa';\nimport _ from 'lodash';\nimport randomName from 'node-random-name';\nimport {request} from '@webex/http-core';\n\nconst BASE_PATH_SECURE = '/users/test_users_s';\nconst BASE_PATH = '/users/test_users';\n\n/**\n * Computes `expires` and `refresh_token_expires` from `expires_in` and\n * `refresh_token_expires_in` and creates an `authorization` string.\n * @param {Object} token\n * @private\n * @returns {Object}\n */\nfunction fixToken(token) {\n const now = Date.now();\n\n if (token.expires_in && !token.expires) {\n token.expires = now + token.expires_in * 1000;\n }\n\n if (token.refresh_token_expires_in && !token.refresh_token_expires) {\n /* eslint camelcase: [0] */\n token.refresh_token_expires = now + token.refresh_token_expires_in * 1000;\n }\n\n if (token.token_type && token.access_token) {\n token.authorization = `${token.token_type} ${token.access_token}`;\n }\n\n return token;\n}\n\nlet clientToken;\n\n/**\n * Fetches credentials to talk to the test_users_s endpoint\n *\n * Caches result in `clientToken` variable for multiple runs\n * @param {Object} options\n * @param {string} options.clientId\n * @param {string} options.clientSecret\n * @param {string} options.idbrokerUrl\n * @private\n * @returns {String}\n */\nfunction getClientCredentials({clientId, clientSecret, idbrokerUrl}) {\n if (clientToken) {\n return Promise.resolve(clientToken);\n }\n\n return request({\n method: 'POST',\n uri: `${idbrokerUrl}/idb/oauth2/v1/access_token`,\n json: true,\n form: {\n grant_type: 'client_credentials',\n scope: 'Identity:SCIM webexsquare:get_conversation',\n client_id: clientId,\n client_secret: clientSecret,\n },\n headers: {\n // Note: we can't request's auth hash here because this endpoint expects\n // us to send the auth header *without including \"Basic \"* before the\n // token string\n authorization: btoa(`${clientId}:${clientSecret}`),\n },\n })\n .then((res) => {\n const token = fixToken(res.body);\n\n return `${token.token_type} ${token.access_token}`;\n })\n .then((token) => {\n clientToken = token;\n\n return clientToken;\n });\n}\n\n/**\n * Makes a request authorized with client credentials\n * @param {Object} options\n * @param {Object} options.body\n * @param {string} options.body.clientId\n * @param {string} options.body.clientSecret\n * @param {string} options.body.idbrokerUrl\n * @private\n * @returns {Promise<HttpResponseObject>}\n */\nfunction requestWithAuth(options) {\n return getClientCredentials(options.body).then((authorization) => {\n options.headers = options.headers || {};\n options.headers.authorization = authorization;\n\n return request(options);\n });\n}\n\n/**\n * @typedef {Object} AccessTokenObject\n * @property {string} token.access_token\n * @property {Number} token.expires_in\n * @property {string} token.token_type\n * @property {string} token.refresh_token\n * @property {Number} token.refresh_token_expires_in\n * @property {string} token.expires\n * @property {string} token.refresh_token_expires\n */\n\n/**\n * @typedef {Object} CreateUserOptions\n * @property {boolean} [authCodeOnly] generates auth_code\n * @param {string} [clientId] defaults to WEBEX_CLIENT_ID\n * @param {string} [clientSecret] defaults to WEBEX_CLIENT_SECRET\n * @param {string} [cigServiceUrl] defaults to WEBEX_TEST_USERS_CI_GATEWAY_SERVICE_URL\n * @property {string} [displayName]\n * @property {string} [emailAddress]\n * @property {Array.<string>} [entitlements]\n * @param {string} [idbrokerUrl] defaults to IDBROKER_BASE_URL\n * @property {string} [machineType] used when creating a machine user/device\n * @property {string} [orgId] organization ID to create the user under\n * @property {string} [password] defaults to a random password\n * @property {string} [roles] defaults to []\n * @property {string} [scope] defaults to WEBEX_SCOPE\n * @property {string} [type] used to create a machine\n */\n\n/**\n * @typedef {Object} TestUserObject\n * @property {string} password\n * @property {string} emailAddress\n * @property {string} displayName\n * @property {string} id\n * @property {string} userName\n * @property {string} email\n * @property {string} name\n * @property {string} givenName\n * @property {string} type\n * @property {Array.<string>} entitlements\n * @property {string} orgId\n * @property {AccessTokenObject} token\n */\n\n/**\n * Creates a test user\n * @param {CreateUserOptions} options\n * @returns {Promise.<TestUserObject>}\n */\nexport function createTestUser(options = {}) {\n const clientId = options.clientId || process.env.WEBEX_CLIENT_ID;\n const clientSecret = options.clientSecret || process.env.WEBEX_CLIENT_SECRET;\n const idbrokerUrl = options.idbrokerUrl || process.env.IDBROKER_BASE_URL;\n const cigServiceUrl =\n options.cigServiceUrl ||\n process.env.WEBEX_TEST_USERS_CI_GATEWAY_SERVICE_URL ||\n process.env.WEBEX_TEST_USERS_CONVERSATION_SERVICE_URL;\n\n if (!clientId) {\n throw new Error('options.clientId or process.env.WEBEX_CLIENT_ID must be defined');\n }\n\n if (!clientSecret) {\n throw new Error('options.clientSecret or process.env.WEBEX_CLIENT_SECRET must be defined');\n }\n\n if (!idbrokerUrl) {\n throw new Error('options.idbrokerUrl or process.env.IDBROKER_BASE_URL must be defined');\n }\n\n if (!cigServiceUrl) {\n throw new Error(\n 'options.cigServiceUrl or process.env.WEBEX_TEST_USERS_CI_GATEWAY_SERVICE_URL must be defined'\n );\n }\n\n const body = {\n authCodeOnly: options.authCodeOnly,\n clientId,\n clientSecret,\n displayName: options.displayName || randomName(),\n emailTemplate: options.emailAddress,\n entitlements: options.entitlements || [\n 'spark',\n 'squaredCallInitiation',\n 'squaredRoomModeration',\n 'squaredInviter',\n 'webExSquared',\n ],\n idbrokerUrl,\n machineType: options.machineType,\n orgId: options.orgId,\n // The five characters on the end are to hit all the password requirements\n password: options.password || `${uuid.v4()}zAY1*`,\n roles: options.roles || [],\n scopes: options.scope || process.env.WEBEX_SCOPE,\n type: options.type,\n };\n\n return requestWithAuth({\n method: 'POST',\n uri: `${cigServiceUrl}${BASE_PATH_SECURE}`,\n json: true,\n body,\n }).then((res) => ({\n password: body.password,\n emailAddress: res.body.user.email,\n displayName: res.body.user.name,\n ...res.body.user,\n token: fixToken(res.body.token),\n }));\n}\n\n/**\n * Exchanges a user name/password for an access token\n * @param {Object} options\n * @param {string} options.id\n * @param {string} options.email\n * @param {string} options.password\n * @param {string} options.clientId\n * @param {string} options.clientSecret\n * @param {string} options.cigServiceUrl\n * @returns {Promise.<AccessTokenObject>}\n */\nexport function loginTestUser(options) {\n const clientId = options.clientId || process.env.WEBEX_CLIENT_ID;\n const clientSecret = options.clientSecret || process.env.WEBEX_CLIENT_SECRET;\n const cigServiceUrl =\n options.cigServiceUrl ||\n process.env.WEBEX_TEST_USERS_CI_GATEWAY_SERVICE_URL ||\n process.env.WEBEX_TEST_USERS_CONVERSATION_SERVICE_URL;\n\n if (!clientId) {\n throw new Error('options.clientId or process.env.WEBEX_CLIENT_ID must be defined');\n }\n\n if (!clientSecret) {\n throw new Error('options.clientSecret or process.env.WEBEX_CLIENT_SECRET must be defined');\n }\n\n if (!cigServiceUrl) {\n throw new Error(\n 'options.cigServiceUrl or process.env.WEBEX_TEST_USERS_CI_GATEWAY_SERVICE_URL must be defined'\n );\n }\n\n return request({\n method: 'POST',\n uri: `${cigServiceUrl}${BASE_PATH}/login`,\n json: true,\n body: _.defaultsDeep(options, {\n clientId,\n clientSecret,\n }),\n }).then((res) => fixToken(res.body));\n}\n\n/**\n * Removes a test user\n * @param {Object} options\n * @param {string} options.id user id to remove\n * @param {string} options.cigServiceUrl\n * @param {Object} options.token\n * @param {string} options.token.authorization\n * @param {string} [options.token.refresh_token]\n * @returns {Promise}\n */\nexport function removeTestUser(options = {}) {\n const cigServiceUrl =\n options.cigServiceUrl ||\n process.env.WEBEX_TEST_USERS_CI_GATEWAY_SERVICE_URL ||\n process.env.WEBEX_TEST_USERS_CONVERSATION_SERVICE_URL;\n\n if (!cigServiceUrl) {\n throw new Error(\n 'options.cigServiceUrl or process.env.WEBEX_TEST_USERS_CI_GATEWAY_SERVICE_URL must be defined'\n );\n }\n\n if (!options.id) {\n return Promise.reject(new Error('options.id is required'));\n }\n\n if (!options.token) {\n return loginTestUser(options).then((token) => {\n options.token = token;\n\n return removeTestUser(options);\n });\n }\n\n assert(options.token.authorization, 'options.token.authorization must be defined');\n\n return request({\n method: 'POST',\n json: true,\n headers: {\n authorization: options.token.authorization,\n },\n body: {\n /* eslint-disable camelcase */\n user_id: options.id,\n refresh_token: options.token.refresh_token,\n user_type: options.userType || 'PERSON',\n /* eslint-enable camelcase */\n },\n uri: `${cigServiceUrl}${BASE_PATH}/delete`,\n });\n}\n\nexport {\n default as createWhistlerTestUser,\n removeTestUser as removeWhistlerTestUser,\n} from './whistler';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAEA;AACA;AAEA;AACA;AAoTA;AAGoB;AAAA;AAAA;AAAA;AArTpB,IAAMA,gBAAgB,GAAG,qBAAqB;AAC9C,IAAMC,SAAS,GAAG,mBAAmB;;AAErC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,QAAQ,CAACC,KAAK,EAAE;EACvB,IAAMC,GAAG,GAAG,mBAAU;EAEtB,IAAID,KAAK,CAACE,UAAU,IAAI,CAACF,KAAK,CAACG,OAAO,EAAE;IACtCH,KAAK,CAACG,OAAO,GAAGF,GAAG,GAAGD,KAAK,CAACE,UAAU,GAAG,IAAI;EAC/C;EAEA,IAAIF,KAAK,CAACI,wBAAwB,IAAI,CAACJ,KAAK,CAACK,qBAAqB,EAAE;IAClE;IACAL,KAAK,CAACK,qBAAqB,GAAGJ,GAAG,GAAGD,KAAK,CAACI,wBAAwB,GAAG,IAAI;EAC3E;EAEA,IAAIJ,KAAK,CAACM,UAAU,IAAIN,KAAK,CAACO,YAAY,EAAE;IAC1CP,KAAK,CAACQ,aAAa,aAAMR,KAAK,CAACM,UAAU,cAAIN,KAAK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V,OAAO,CAAC+B,EAAE,EAAE;IACf,OAAO,iBAAQC,MAAM,CAAC,IAAItB,KAAK,CAAC,wBAAwB,CAAC,CAAC;EAC5D;EAEA,IAAI,CAACV,OAAO,CAAC9B,KAAK,EAAE;IAClB,OAAO2D,aAAa,CAAC7B,OAAO,CAAC,CAACJ,IAAI,CAAC,UAAC1B,KAAK,EAAK;MAC5C8B,OAAO,CAAC9B,KAAK,GAAGA,KAAK;MAErB,OAAO4D,cAAc,CAAC9B,OAAO,CAAC;IAChC,CAAC,CAAC;EACJ;EAEA,IAAAiC,eAAM,EAACjC,OAAO,CAAC9B,KAAK,CAACQ,aAAa,EAAE,6CAA6C,CAAC;EAElF,OAAO,IAAAO,iBAAO,EAAC;IACbC,MAAM,EAAE,MAAM;IACdE,IAAI,EAAE,IAAI;IACVM,OAAO,EAAE;MACPhB,aAAa,EAAEsB,OAAO,CAAC9B,KAAK,CAACQ;IAC/B,CAAC;IACDoB,IAAI,EAAE;MACJ;MACAoC,OAAO,EAAElC,OAAO,CAAC+B,EAAE;MACnBI,aAAa,EAAEnC,OAAO,CAAC9B,KAAK,CAACiE,aAAa;MAC1CC,SAAS,EAAEpC,OAAO,CAACqC,QAAQ,IAAI;MAC/B;IACF,CAAC;;IACDlD,GAAG,YAAKoB,aAAa,SAAGvC,SAAS;EACnC,CAAC,CAAC;AACJ"}
1
+ {"version":3,"names":["_assert","_interopRequireDefault","require","_uuid","_btoa","_lodash","_nodeRandomName","_httpCore","_whistler","_interopRequireWildcard","_getRequireWildcardCache","e","_WeakMap","r","t","__esModule","_typeof","default","has","get","n","__proto__","a","_Object$defineProperty","_Object$getOwnPropertyDescriptor","u","Object","prototype","hasOwnProperty","call","i","set","ownKeys","_Object$keys","_Object$getOwnPropertySymbols","o","filter","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty2","_Object$getOwnPropertyDescriptors","_Object$defineProperties","BASE_PATH_SECURE","BASE_PATH","fixToken","token","now","_now","expires_in","expires","refresh_token_expires_in","refresh_token_expires","token_type","access_token","authorization","concat","clientToken","getClientCredentials","_ref","clientId","clientSecret","idbrokerUrl","_promise","resolve","request","method","uri","json","form","grant_type","scope","client_id","client_secret","headers","btoa","then","res","body","requestWithAuth","options","createTestUser","undefined","process","env","WEBEX_CLIENT_ID","WEBEX_CLIENT_SECRET","IDBROKER_BASE_URL","cigServiceUrl","WEBEX_TEST_USERS_CI_GATEWAY_SERVICE_URL","WEBEX_TEST_USERS_CONVERSATION_SERVICE_URL","Error","authCodeOnly","displayName","randomName","emailTemplate","emailAddress","entitlements","machineType","orgId","password","uuid","v4","roles","scopes","WEBEX_SCOPE","type","forceCreate","ensureExistsInWebexSites","syncInWebexSites","orgAdminAuthorization","user","email","name","loginTestUser","_","defaultsDeep","removeTestUser","id","reject","assert","user_id","refresh_token","user_type","userType","setPreferredSite","schemas","userPreferences","value","preferredSite","identityServiceUrl","userId"],"sources":["index.js"],"sourcesContent":["import assert from 'assert';\n\nimport uuid from 'uuid';\nimport btoa from 'btoa';\nimport _ from 'lodash';\nimport randomName from 'node-random-name';\nimport {request} from '@webex/http-core';\n\nconst BASE_PATH_SECURE = '/users/test_users_s';\nconst BASE_PATH = '/users/test_users';\n\n/**\n * Computes `expires` and `refresh_token_expires` from `expires_in` and\n * `refresh_token_expires_in` and creates an `authorization` string.\n * @param {Object} token\n * @private\n * @returns {Object}\n */\nfunction fixToken(token) {\n const now = Date.now();\n\n if (token.expires_in && !token.expires) {\n token.expires = now + token.expires_in * 1000;\n }\n\n if (token.refresh_token_expires_in && !token.refresh_token_expires) {\n /* eslint camelcase: [0] */\n token.refresh_token_expires = now + token.refresh_token_expires_in * 1000;\n }\n\n if (token.token_type && token.access_token) {\n token.authorization = `${token.token_type} ${token.access_token}`;\n }\n\n return token;\n}\n\nlet clientToken;\n\n/**\n * Fetches credentials to talk to the test_users_s endpoint\n *\n * Caches result in `clientToken` variable for multiple runs\n * @param {Object} options\n * @param {string} options.clientId\n * @param {string} options.clientSecret\n * @param {string} options.idbrokerUrl\n * @private\n * @returns {String}\n */\nfunction getClientCredentials({clientId, clientSecret, idbrokerUrl}) {\n if (clientToken) {\n return Promise.resolve(clientToken);\n }\n\n return request({\n method: 'POST',\n uri: `${idbrokerUrl}/idb/oauth2/v1/access_token`,\n json: true,\n form: {\n grant_type: 'client_credentials',\n scope: 'Identity:SCIM webexsquare:get_conversation',\n client_id: clientId,\n client_secret: clientSecret,\n },\n headers: {\n // Note: we can't request's auth hash here because this endpoint expects\n // us to send the auth header *without including \"Basic \"* before the\n // token string\n authorization: btoa(`${clientId}:${clientSecret}`),\n },\n })\n .then((res) => {\n const token = fixToken(res.body);\n\n return `${token.token_type} ${token.access_token}`;\n })\n .then((token) => {\n clientToken = token;\n\n return clientToken;\n });\n}\n\n/**\n * Makes a request authorized with client credentials\n * @param {Object} options\n * @param {Object} options.body\n * @param {string} options.body.clientId\n * @param {string} options.body.clientSecret\n * @param {string} options.body.idbrokerUrl\n * @private\n * @returns {Promise<HttpResponseObject>}\n */\nfunction requestWithAuth(options) {\n return getClientCredentials(options.body).then((authorization) => {\n options.headers = options.headers || {};\n options.headers.authorization = authorization;\n\n return request(options);\n });\n}\n\n/**\n * @typedef {Object} AccessTokenObject\n * @property {string} token.access_token\n * @property {Number} token.expires_in\n * @property {string} token.token_type\n * @property {string} token.refresh_token\n * @property {Number} token.refresh_token_expires_in\n * @property {string} token.expires\n * @property {string} token.refresh_token_expires\n */\n\n/**\n * @typedef {Object} CreateUserOptions\n * @property {boolean} [authCodeOnly] generates auth_code\n * @param {string} [clientId] defaults to WEBEX_CLIENT_ID\n * @param {string} [clientSecret] defaults to WEBEX_CLIENT_SECRET\n * @param {string} [cigServiceUrl] defaults to WEBEX_TEST_USERS_CI_GATEWAY_SERVICE_URL\n * @property {string} [displayName]\n * @property {string} [emailAddress]\n * @property {Array.<string>} [entitlements]\n * @param {string} [idbrokerUrl] defaults to IDBROKER_BASE_URL\n * @property {string} [machineType] used when creating a machine user/device\n * @property {string} [orgId] organization ID to create the user under\n * @property {string} [password] defaults to a random password\n * @property {string} [roles] defaults to []\n * @property {string} [scope] defaults to WEBEX_SCOPE\n * @property {string} [type] used to create a machine\n * @property {boolean} [forceCreate] force creates the user, to be used in conjunction with ensureExistsInWebexSites\n * @property {boolean} [ensureExistsInWebexSites] syncs the user in provided webexSites (syncInWebexSites)\n * @property {Array.<string>} [syncInWebexSites] used to define in which sites account should be synced\n * @property {string} [orgAdminAuthorization] bearer token of org admin to use syncInWebexSites\n */\n\n/**\n * @typedef {Object} TestUserObject\n * @property {string} password\n * @property {string} emailAddress\n * @property {string} displayName\n * @property {string} id\n * @property {string} userName\n * @property {string} email\n * @property {string} name\n * @property {string} givenName\n * @property {string} type\n * @property {Array.<string>} entitlements\n * @property {string} orgId\n * @property {AccessTokenObject} token\n */\n\n/**\n * Creates a test user\n * @param {CreateUserOptions} options\n * @returns {Promise.<TestUserObject>}\n */\nexport function createTestUser(options = {}) {\n const clientId = options.clientId || process.env.WEBEX_CLIENT_ID;\n const clientSecret = options.clientSecret || process.env.WEBEX_CLIENT_SECRET;\n const idbrokerUrl = options.idbrokerUrl || process.env.IDBROKER_BASE_URL;\n const cigServiceUrl =\n options.cigServiceUrl ||\n process.env.WEBEX_TEST_USERS_CI_GATEWAY_SERVICE_URL ||\n process.env.WEBEX_TEST_USERS_CONVERSATION_SERVICE_URL;\n\n if (!clientId) {\n throw new Error('options.clientId or process.env.WEBEX_CLIENT_ID must be defined');\n }\n\n if (!clientSecret) {\n throw new Error('options.clientSecret or process.env.WEBEX_CLIENT_SECRET must be defined');\n }\n\n if (!idbrokerUrl) {\n throw new Error('options.idbrokerUrl or process.env.IDBROKER_BASE_URL must be defined');\n }\n\n if (!cigServiceUrl) {\n throw new Error(\n 'options.cigServiceUrl or process.env.WEBEX_TEST_USERS_CI_GATEWAY_SERVICE_URL must be defined'\n );\n }\n\n const body = {\n authCodeOnly: options.authCodeOnly,\n clientId,\n clientSecret,\n displayName: options.displayName || randomName(),\n emailTemplate: options.emailAddress,\n entitlements: options.entitlements || [\n 'spark',\n 'squaredCallInitiation',\n 'squaredRoomModeration',\n 'squaredInviter',\n 'webExSquared',\n 'basicMessage',\n ],\n idbrokerUrl,\n machineType: options.machineType,\n orgId: options.orgId,\n // The five characters on the end are to hit all the password requirements\n password: options.password || `${uuid.v4()}zAY1*`,\n roles: options.roles || [],\n scopes: options.scope || process.env.WEBEX_SCOPE,\n type: options.type,\n forceCreate: options.forceCreate || false,\n ensureExistsInWebexSites: options.ensureExistsInWebexSites || false,\n syncInWebexSites: options.syncInWebexSites,\n orgAdminAuthorization: options.orgAdminAuthorization,\n };\n\n return requestWithAuth({\n method: 'POST',\n uri: `${cigServiceUrl}${BASE_PATH_SECURE}`,\n json: true,\n body,\n }).then((res) => ({\n password: body.password,\n emailAddress: res.body.user.email,\n displayName: res.body.user.name,\n ...res.body.user,\n token: fixToken(res.body.token),\n }));\n}\n\n/**\n * Exchanges a user name/password for an access token\n * @param {Object} options\n * @param {string} options.id\n * @param {string} options.email\n * @param {string} options.password\n * @param {string} options.clientId\n * @param {string} options.clientSecret\n * @param {string} options.cigServiceUrl\n * @returns {Promise.<AccessTokenObject>}\n */\nexport function loginTestUser(options) {\n const clientId = options.clientId || process.env.WEBEX_CLIENT_ID;\n const clientSecret = options.clientSecret || process.env.WEBEX_CLIENT_SECRET;\n const cigServiceUrl =\n options.cigServiceUrl ||\n process.env.WEBEX_TEST_USERS_CI_GATEWAY_SERVICE_URL ||\n process.env.WEBEX_TEST_USERS_CONVERSATION_SERVICE_URL;\n\n if (!clientId) {\n throw new Error('options.clientId or process.env.WEBEX_CLIENT_ID must be defined');\n }\n\n if (!clientSecret) {\n throw new Error('options.clientSecret or process.env.WEBEX_CLIENT_SECRET must be defined');\n }\n\n if (!cigServiceUrl) {\n throw new Error(\n 'options.cigServiceUrl or process.env.WEBEX_TEST_USERS_CI_GATEWAY_SERVICE_URL must be defined'\n );\n }\n\n return request({\n method: 'POST',\n uri: `${cigServiceUrl}${BASE_PATH}/login`,\n json: true,\n body: _.defaultsDeep(options, {\n clientId,\n clientSecret,\n }),\n }).then((res) => fixToken(res.body));\n}\n\n/**\n * Removes a test user\n * @param {Object} options\n * @param {string} options.id user id to remove\n * @param {string} options.cigServiceUrl\n * @param {Object} options.token\n * @param {string} options.token.authorization\n * @param {string} [options.token.refresh_token]\n * @returns {Promise}\n */\nexport function removeTestUser(options = {}) {\n const cigServiceUrl =\n options.cigServiceUrl ||\n process.env.WEBEX_TEST_USERS_CI_GATEWAY_SERVICE_URL ||\n process.env.WEBEX_TEST_USERS_CONVERSATION_SERVICE_URL;\n\n if (!cigServiceUrl) {\n throw new Error(\n 'options.cigServiceUrl or process.env.WEBEX_TEST_USERS_CI_GATEWAY_SERVICE_URL must be defined'\n );\n }\n\n if (!options.id) {\n return Promise.reject(new Error('options.id is required'));\n }\n\n if (!options.token) {\n return loginTestUser(options).then((token) => {\n options.token = token;\n\n return removeTestUser(options);\n });\n }\n\n assert(options.token.authorization, 'options.token.authorization must be defined');\n\n return request({\n method: 'POST',\n json: true,\n headers: {\n authorization: options.token.authorization,\n },\n body: {\n /* eslint-disable camelcase */\n user_id: options.id,\n refresh_token: options.token.refresh_token,\n user_type: options.userType || 'PERSON',\n /* eslint-enable camelcase */\n },\n uri: `${cigServiceUrl}${BASE_PATH}/delete`,\n });\n}\n\n/**\n * Sets the preferredWebexSite for the provided user\n *\n * This method should be used to ensure a created test user has the right webex site set.\n *\n * @param {Object} options\n * @param {string} options.userId user id to set site\n * @param {string} options.preferredSite new preferred webexsite\n * @param {string} options.orgId orgId of the site\n * @param {string} options.identityServiceUrl url of identity service\n * @param {string} options.authorization\n * @param {string} options.clientId\n * @param {string} options.clientSecret\n * @returns {Promise}\n */\nexport function setPreferredSite(options = {}) {\n const clientId = options.clientId || process.env.WEBEX_CLIENT_ID;\n const clientSecret = options.clientSecret || process.env.WEBEX_CLIENT_SECRET;\n\n if (!clientId) {\n throw new Error('options.clientId or process.env.WEBEX_CLIENT_ID must be defined');\n }\n\n if (!clientSecret) {\n throw new Error('options.clientSecret or process.env.WEBEX_CLIENT_SECRET must be defined');\n }\n\n /* eslint-disable no-useless-escape */\n const body = {\n schemas: ['urn:scim:schemas:core:1.0', 'urn:scim:schemas:extension:cisco:commonidentity:1.0'],\n userPreferences: [\n {\n value: `\\\"preferredWebExSite\\\":\\\"${options.preferredSite}\\\"`,\n },\n ],\n };\n /* eslint-enable no-useless-escape */\n\n return request({\n method: 'PATCH',\n headers: {\n authorization: options.authorization,\n },\n uri: `${options.identityServiceUrl}/identity/scim/${options.orgId}/v1/Users/${options.userId}`,\n json: true,\n body,\n });\n}\n\nexport {\n default as createWhistlerTestUser,\n removeTestUser as removeWhistlerTestUser,\n} from './whistler';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,KAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,KAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,OAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,eAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AA8WA,IAAAM,SAAA,GAAAC,uBAAA,CAAAP,OAAA;AAGoB,SAAAQ,yBAAAC,CAAA,6BAAAC,QAAA,mBAAAC,CAAA,OAAAD,QAAA,IAAAE,CAAA,OAAAF,QAAA,YAAAF,wBAAA,YAAAA,yBAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAF,wBAAAE,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,gBAAAK,OAAA,CAAAL,CAAA,0BAAAA,CAAA,WAAAM,OAAA,EAAAN,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CA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ED
@@ -17,8 +17,8 @@ var _btoa = _interopRequireDefault(require("btoa"));
17
17
  var _httpCore = require("@webex/http-core");
18
18
  var _nodeRandomName = _interopRequireDefault(require("node-random-name"));
19
19
  var _uuid = _interopRequireDefault(require("uuid"));
20
- function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
21
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
20
+ function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
21
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
22
22
  /**
23
23
  * Fetches credentials/access_token to talk to the whistler endpoint
24
24
  *
@@ -1 +1 @@
1
- {"version":3,"names":["getClientCredentials","clientId","clientSecret","orgId","idbrokerUrl","machineAccount","machinePassword","request","method","uri","json","body","uid","password","then","res","form","assertion","BearerToken","grant_type","scope","self_contained_token","client_id","client_secret","headers","authorization","btoa","token_type","access_token","createTestUser","options","process","env","WEBEX_CLIENT_ID","WEBEX_CLIENT_SECRET","WHISTLER_MACHINE_ACCOUNT","randomName","WHISTLER_MACHINE_PASSWORD","uuid","v4","IDBROKER_BASE_URL","WHISTLER_TEST_ORG_ID","whistlerServiceUrl","WHISTLER_API_SERVICE_URL","reservationGroup","userScopes","Error","qs","isAccessTokenRequired","responseMetaData","ciPassword","emailAddress","name","displayName","webExUserName","token","ciAccessToken","reservationUrl","removeTestUser"],"sources":["whistler.js"],"sourcesContent":["import btoa from 'btoa';\nimport {request} from '@webex/http-core';\nimport randomName from 'node-random-name';\nimport uuid from 'uuid';\n\n/**\n * Fetches credentials/access_token to talk to the whistler endpoint\n *\n * @param {Object} options\n * @param {string} options.clientId\n * @param {string} options.clientSecret\n * @param {string} options.idbrokerUrl\n * @param {string} options.orgId\n * @param {string} options.machineAccount\n * @param {string} options.machinePassword\n * @private\n * @returns {Promise<string>}\n */\nconst getClientCredentials = ({\n clientId,\n clientSecret,\n orgId,\n idbrokerUrl,\n machineAccount,\n machinePassword,\n}) =>\n request({\n method: 'POST',\n uri: `${idbrokerUrl}/idb/token/${orgId}/v2/actions/GetBearerToken/invoke`,\n json: true,\n body: {\n uid: machineAccount,\n password: machinePassword,\n },\n })\n .then((res) =>\n request({\n method: 'POST',\n uri: `${idbrokerUrl}/idb/oauth2/v1/access_token`,\n json: true,\n form: {\n assertion: res.body.BearerToken,\n grant_type: 'urn:ietf:params:oauth:grant-type:saml2-bearer',\n scope: 'webexsquare:get_conversation webexsquare:admin',\n self_contained_token: true,\n client_id: clientId,\n client_secret: clientSecret,\n },\n headers: {\n // Note: we can't request's auth hash here because this endpoint expects\n // us to send the auth header *without including \"Basic \"* before the\n // token string\n // authorization: `Basic + ${btoa(`${clientId}:${clientSecret}`)}`\n authorization: btoa(`${clientId}:${clientSecret}`),\n },\n })\n )\n .then((res) => `${res.body.token_type} ${res.body.access_token}`);\n\n/**\n * @typedef {Object} TestUserObject\n * @property {string} password\n * @property {string} emailAddress\n * @property {string} displayName\n * @property {string} token\n * @property {string} reservationUrl\n * @property {object} responseMetaData - whistler given properties\n */\n\n/**\n * @typedef {Object} CreateUserOptions\n * @param {Object} [options]\n * @param {string} [whistlerServiceUrl] defaults to WHISTLER_API_SERVICE_URL\n * @param {string} [options.clientId] defaults to WEBEX_CLIENT_ID\n * @param {string} [options.clientSecret] defaults to WEBEX_CLIENT_SECRET\n * @param {string} [options.idbrokerUrl] defaults to IDBROKER_BASE_URL\n * @param {string} [options.orgId] organization ID to create the user under\n * @param {string} [options.machineAccount] defaults to WHISTLER_MACHINE_ACCOUNT\n * @param {string} [options.machinePassword] defaults to WHISTLER_MACHINE_PASSWORD\n */\n\n/**\n * Creates a test user\n * @param {CreateUserOptions} options\n * @returns {Promise.<TestUserObject>}\n */\nexport default function createTestUser(options = {}) {\n const clientId = options.clientId || process.env.WEBEX_CLIENT_ID;\n const clientSecret = options.clientSecret || process.env.WEBEX_CLIENT_SECRET;\n const machineAccount =\n options.machineAccount || process.env.WHISTLER_MACHINE_ACCOUNT || randomName();\n const machinePassword =\n options.machinePassword || process.env.WHISTLER_MACHINE_PASSWORD || `${uuid.v4()}zAY1*`;\n const idbrokerUrl = options.idbrokerUrl || process.env.IDBROKER_BASE_URL;\n const orgId = options.orgId || process.env.WHISTLER_TEST_ORG_ID;\n const whistlerServiceUrl = options.whistlerServiceUrl || process.env.WHISTLER_API_SERVICE_URL;\n const {reservationGroup, userScopes} = options;\n\n if (!clientId) {\n throw new Error('options.clientId or process.env.WEBEX_CLIENT_ID must be defined');\n }\n\n if (!clientSecret) {\n throw new Error('options.clientSecret or process.env.WEBEX_CLIENT_SECRET must be defined');\n }\n\n if (!machineAccount) {\n throw new Error(\n 'options.machineAccount or process.env.WHISTLER_MACHINE_ACCOUNT must be defined'\n );\n }\n\n if (!machinePassword) {\n throw new Error(\n 'options.machinePassword or process.env.WHISTLER_MACHINE_PASSWORD must be defined'\n );\n }\n if (!idbrokerUrl) {\n throw new Error('options.idbrokerUrl or process.env.IDBROKER_BASE_URL must be defined');\n }\n\n if (!orgId) {\n throw new Error('options.orgId or process.env.WHISTLER_TEST_ORG_ID must be defined');\n }\n\n if (!whistlerServiceUrl) {\n throw new Error(\n 'options.whistlerServiceUrl or process.env.WHISTLER_API_SERVICE_URL must be defined'\n );\n }\n\n // For reservation groups and user scopes\n // Please check https://confluence-eng-gpk2.cisco.com/conf/pages/viewpage.action?spaceKey=LOCUS&title=Whistler+APIs#WhistlerAPIs-GET/reservations/testUser\n return getClientCredentials({\n clientId,\n clientSecret,\n machineAccount,\n machinePassword,\n idbrokerUrl,\n orgId,\n })\n .then((authorization) =>\n request({\n method: 'GET',\n uri: `${whistlerServiceUrl}/reservations/testUser`,\n qs: {\n reservationGroup,\n userScopes,\n isAccessTokenRequired: true,\n },\n headers: {\n authorization,\n },\n })\n )\n .then((res) => ({\n password: res.body.responseMetaData.ciPassword,\n emailAddress: res.body.responseMetaData.name,\n displayName: res.body.responseMetaData.webExUserName,\n token: res.body.responseMetaData.ciAccessToken,\n reservationUrl: res.body.reservationUrl,\n ...res.body.responseMetaData,\n }));\n}\n\n/**\n *\n * @param {Object} options\n * @returns {Promise}\n */\nexport function removeTestUser(options = {}) {\n return request({\n method: 'DELETE',\n headers: {\n authorization: `Bearer ${options.token}`,\n },\n uri: options.reservationUrl,\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AAAwB;AAAA;AAExB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAMA,oBAAoB,GAAG,SAAvBA,oBAAoB;EAAA,IACxBC,QAAQ,QAARA,QAAQ;IACRC,YAAY,QAAZA,YAAY;IACZC,KAAK,QAALA,KAAK;IACLC,WAAW,QAAXA,WAAW;IACXC,cAAc,QAAdA,cAAc;IACdC,eAAe,QAAfA,eAAe;EAAA,OAEf,IAAAC,iBAA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;IACRC,YAAY,EAAZA,YAAY;IACZG,cAAc,EAAdA,cAAc;IACdC,eAAe,EAAfA,eAAe;IACfF,WAAW,EAAXA,WAAW;IACXD,KAAK,EAALA;EACF,CAAC,CAAC,CACCW,IAAI,CAAC,UAACW,aAAa;IAAA,OAClB,IAAAlB,iBAAO,EAAC;MACNC,MAAM,EAAE,KAAK;MACbC,GAAG,YAAKiC,kBAAkB,2BAAwB;MAClDK,EAAE,EAAE;QACFH,gBAAgB,EAAhBA,gBAAgB;QAChBC,UAAU,EAAVA,UAAU;QACVG,qBAAqB,EAAE;MACzB,CAAC;MACDxB,OAAO,EAAE;QACPC,aAAa,EAAbA;MACF;IACF,CAAC,CAAC;EAAA,EACH,CACAX,IAAI,CAAC,UAACC,GAAG;IAAA;MACRF,QAAQ,EAAEE,GAAG,CAACJ,IAAI,CAACsC,gBAAgB,CAACC,UAAU;MAC9CC,YAAY,EAAEpC,GAAG,CAACJ,IAAI,CAACsC,gBAAgB,CAACG,IAAI;MAC5CC,WAAW,EAAEtC,GAAG,CAACJ,IAAI,CAACsC,gBAAgB,CAACK,aAAa;MACpDC,KAAK,EAAExC,GAAG,CAACJ,IAAI,CAACsC,gBAAgB,CAACO,aAAa;MAC9CC,cAAc,EAAE1C,GAAG,CAACJ,IAAI,CAAC8C;IAAc,GACpC1C,GAAG,CAACJ,IAAI,CAACsC,gBAAgB;EAAA,CAC5B,CAAC;AACP;;AAEA;AACA;AACA;AACA;AACA;AACO,SAASS,cAAc,GAAe;EAAA,IAAd5B,OAAO,uEAAG,CAAC,CAAC;EACzC,OAAO,IAAAvB,iBAAO,EAAC;IACbC,MAAM,EAAE,QAAQ;IAChBgB,OAAO,EAAE;MACPC,aAAa,mBAAYK,OAAO,CAACyB,KAAK;IACxC,CAAC;IACD9C,GAAG,EAAEqB,OAAO,CAAC2B;EACf,CAAC,CAAC;AACJ"}
1
+ {"version":3,"names":["_btoa","_interopRequireDefault","require","_httpCore","_nodeRandomName","_uuid","ownKeys","e","r","t","_Object$keys","_Object$getOwnPropertySymbols","o","filter","_Object$getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","Object","forEach","_defineProperty2","default","_Object$getOwnPropertyDescriptors","_Object$defineProperties","_Object$defineProperty","getClientCredentials","_ref","clientId","clientSecret","orgId","idbrokerUrl","machineAccount","machinePassword","request","method","uri","concat","json","body","uid","password","then","res","form","assertion","BearerToken","grant_type","scope","self_contained_token","client_id","client_secret","headers","authorization","btoa","token_type","access_token","createTestUser","options","undefined","process","env","WEBEX_CLIENT_ID","WEBEX_CLIENT_SECRET","WHISTLER_MACHINE_ACCOUNT","randomName","WHISTLER_MACHINE_PASSWORD","uuid","v4","IDBROKER_BASE_URL","WHISTLER_TEST_ORG_ID","whistlerServiceUrl","WHISTLER_API_SERVICE_URL","reservationGroup","userScopes","Error","qs","isAccessTokenRequired","responseMetaData","ciPassword","emailAddress","name","displayName","webExUserName","token","ciAccessToken","reservationUrl","removeTestUser"],"sources":["whistler.js"],"sourcesContent":["import btoa from 'btoa';\nimport {request} from '@webex/http-core';\nimport randomName from 'node-random-name';\nimport uuid from 'uuid';\n\n/**\n * Fetches credentials/access_token to talk to the whistler endpoint\n *\n * @param {Object} options\n * @param {string} options.clientId\n * @param {string} options.clientSecret\n * @param {string} options.idbrokerUrl\n * @param {string} options.orgId\n * @param {string} options.machineAccount\n * @param {string} options.machinePassword\n * @private\n * @returns {Promise<string>}\n */\nconst getClientCredentials = ({\n clientId,\n clientSecret,\n orgId,\n idbrokerUrl,\n machineAccount,\n machinePassword,\n}) =>\n request({\n method: 'POST',\n uri: `${idbrokerUrl}/idb/token/${orgId}/v2/actions/GetBearerToken/invoke`,\n json: true,\n body: {\n uid: machineAccount,\n password: machinePassword,\n },\n })\n .then((res) =>\n request({\n method: 'POST',\n uri: `${idbrokerUrl}/idb/oauth2/v1/access_token`,\n json: true,\n form: {\n assertion: res.body.BearerToken,\n grant_type: 'urn:ietf:params:oauth:grant-type:saml2-bearer',\n scope: 'webexsquare:get_conversation webexsquare:admin',\n self_contained_token: true,\n client_id: clientId,\n client_secret: clientSecret,\n },\n headers: {\n // Note: we can't request's auth hash here because this endpoint expects\n // us to send the auth header *without including \"Basic \"* before the\n // token string\n // authorization: `Basic + ${btoa(`${clientId}:${clientSecret}`)}`\n authorization: btoa(`${clientId}:${clientSecret}`),\n },\n })\n )\n .then((res) => `${res.body.token_type} ${res.body.access_token}`);\n\n/**\n * @typedef {Object} TestUserObject\n * @property {string} password\n * @property {string} emailAddress\n * @property {string} displayName\n * @property {string} token\n * @property {string} reservationUrl\n * @property {object} responseMetaData - whistler given properties\n */\n\n/**\n * @typedef {Object} CreateUserOptions\n * @param {Object} [options]\n * @param {string} [whistlerServiceUrl] defaults to WHISTLER_API_SERVICE_URL\n * @param {string} [options.clientId] defaults to WEBEX_CLIENT_ID\n * @param {string} [options.clientSecret] defaults to WEBEX_CLIENT_SECRET\n * @param {string} [options.idbrokerUrl] defaults to IDBROKER_BASE_URL\n * @param {string} [options.orgId] organization ID to create the user under\n * @param {string} [options.machineAccount] defaults to WHISTLER_MACHINE_ACCOUNT\n * @param {string} [options.machinePassword] defaults to WHISTLER_MACHINE_PASSWORD\n */\n\n/**\n * Creates a test user\n * @param {CreateUserOptions} options\n * @returns {Promise.<TestUserObject>}\n */\nexport default function createTestUser(options = {}) {\n const clientId = options.clientId || process.env.WEBEX_CLIENT_ID;\n const clientSecret = options.clientSecret || process.env.WEBEX_CLIENT_SECRET;\n const machineAccount =\n options.machineAccount || process.env.WHISTLER_MACHINE_ACCOUNT || randomName();\n const machinePassword =\n options.machinePassword || process.env.WHISTLER_MACHINE_PASSWORD || `${uuid.v4()}zAY1*`;\n const idbrokerUrl = options.idbrokerUrl || process.env.IDBROKER_BASE_URL;\n const orgId = options.orgId || process.env.WHISTLER_TEST_ORG_ID;\n const whistlerServiceUrl = options.whistlerServiceUrl || process.env.WHISTLER_API_SERVICE_URL;\n const {reservationGroup, userScopes} = options;\n\n if (!clientId) {\n throw new Error('options.clientId or process.env.WEBEX_CLIENT_ID must be defined');\n }\n\n if (!clientSecret) {\n throw new Error('options.clientSecret or process.env.WEBEX_CLIENT_SECRET must be defined');\n }\n\n if (!machineAccount) {\n throw new Error(\n 'options.machineAccount or process.env.WHISTLER_MACHINE_ACCOUNT must be defined'\n );\n }\n\n if (!machinePassword) {\n throw new Error(\n 'options.machinePassword or process.env.WHISTLER_MACHINE_PASSWORD must be defined'\n );\n }\n if (!idbrokerUrl) {\n throw new Error('options.idbrokerUrl or process.env.IDBROKER_BASE_URL must be defined');\n }\n\n if (!orgId) {\n throw new Error('options.orgId or process.env.WHISTLER_TEST_ORG_ID must be defined');\n }\n\n if (!whistlerServiceUrl) {\n throw new Error(\n 'options.whistlerServiceUrl or process.env.WHISTLER_API_SERVICE_URL must be defined'\n );\n }\n\n // For reservation groups and user scopes\n // Please check https://confluence-eng-gpk2.cisco.com/conf/pages/viewpage.action?spaceKey=LOCUS&title=Whistler+APIs#WhistlerAPIs-GET/reservations/testUser\n return getClientCredentials({\n clientId,\n clientSecret,\n machineAccount,\n machinePassword,\n idbrokerUrl,\n orgId,\n })\n .then((authorization) =>\n request({\n method: 'GET',\n uri: `${whistlerServiceUrl}/reservations/testUser`,\n qs: {\n reservationGroup,\n userScopes,\n isAccessTokenRequired: true,\n },\n headers: {\n authorization,\n },\n })\n )\n .then((res) => ({\n password: res.body.responseMetaData.ciPassword,\n emailAddress: res.body.responseMetaData.name,\n displayName: res.body.responseMetaData.webExUserName,\n token: res.body.responseMetaData.ciAccessToken,\n reservationUrl: res.body.reservationUrl,\n ...res.body.responseMetaData,\n }));\n}\n\n/**\n *\n * @param {Object} options\n * @returns {Promise}\n */\nexport function removeTestUser(options = {}) {\n return request({\n method: 'DELETE',\n headers: {\n authorization: `Bearer ${options.token}`,\n },\n uri: options.reservationUrl,\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAA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CAACuC,gBAAgB;EAAA,CAC5B,CAAC;AACP;;AAEA;AACA;AACA;AACA;AACA;AACO,SAASS,cAAcA,CAAA,EAAe;EAAA,IAAd7B,OAAO,GAAAzC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAA0C,SAAA,GAAA1C,SAAA,MAAG,CAAC,CAAC;EACzC,OAAO,IAAAiB,iBAAO,EAAC;IACbC,MAAM,EAAE,QAAQ;IAChBiB,OAAO,EAAE;MACPC,aAAa,YAAAhB,MAAA,CAAYqB,OAAO,CAAC0B,KAAK;IACxC,CAAC;IACDhD,GAAG,EAAEsB,OAAO,CAAC4B;EACf,CAAC,CAAC;AACJ"}
package/jest.config.js ADDED
@@ -0,0 +1,3 @@
1
+ const config = require('@webex/jest-config-legacy');
2
+
3
+ module.exports = config;
package/package.json CHANGED
@@ -1,6 +1,5 @@
1
1
  {
2
2
  "name": "@webex/test-users",
3
- "version": "3.0.0-bnr.5",
4
3
  "description": "Cisco Webex Test Users",
5
4
  "license": "MIT",
6
5
  "main": "dist/index.js",
@@ -20,16 +19,36 @@
20
19
  ]
21
20
  },
22
21
  "devDependencies": {
22
+ "@babel/core": "^7.17.10",
23
+ "@webex/babel-config-legacy": "0.0.0",
24
+ "@webex/eslint-config-legacy": "0.0.0",
25
+ "@webex/jest-config-legacy": "0.0.0",
26
+ "@webex/legacy-tools": "0.0.0",
27
+ "@webex/test-helper-chai": "3.0.0",
28
+ "@webex/test-helper-mocha": "3.0.0",
29
+ "@webex/test-helper-mock-webex": "3.0.0",
30
+ "@webex/test-helper-test-users": "3.0.0",
23
31
  "chai": "^4.3.4",
24
- "chai-as-promised": "^7.1.1"
32
+ "chai-as-promised": "^7.1.1",
33
+ "eslint": "^8.24.0",
34
+ "prettier": "^2.7.1"
25
35
  },
26
36
  "dependencies": {
27
- "@webex/http-core": "3.0.0-bnr.5",
28
- "@webex/test-helper-mocha": "3.0.0-bnr.5",
29
- "@webex/test-users": "3.0.0-bnr.5",
37
+ "@webex/http-core": "3.0.0",
38
+ "@webex/test-helper-mocha": "3.0.0",
30
39
  "btoa": "^1.2.1",
31
40
  "lodash": "^4.17.21",
32
41
  "node-random-name": "^1.0.1",
33
42
  "uuid": "^3.3.2"
34
- }
35
- }
43
+ },
44
+ "scripts": {
45
+ "build": "yarn build:src",
46
+ "build:src": "webex-legacy-tools build -dest \"./dist\" -src \"./src\" -js -ts -maps",
47
+ "deploy:npm": "yarn npm publish",
48
+ "test": "yarn test:style && yarn test:unit && yarn test:integration && yarn test:browser",
49
+ "test:browser": "webex-legacy-tools test --integration --runner karma",
50
+ "test:integration": "webex-legacy-tools test --integration --runner mocha",
51
+ "test:style": "eslint ./src/**/*.*"
52
+ },
53
+ "version": "3.0.0"
54
+ }
package/process ADDED
@@ -0,0 +1 @@
1
+ module.exports = {browser: true};
package/src/index.js CHANGED
@@ -128,6 +128,10 @@ function requestWithAuth(options) {
128
128
  * @property {string} [roles] defaults to []
129
129
  * @property {string} [scope] defaults to WEBEX_SCOPE
130
130
  * @property {string} [type] used to create a machine
131
+ * @property {boolean} [forceCreate] force creates the user, to be used in conjunction with ensureExistsInWebexSites
132
+ * @property {boolean} [ensureExistsInWebexSites] syncs the user in provided webexSites (syncInWebexSites)
133
+ * @property {Array.<string>} [syncInWebexSites] used to define in which sites account should be synced
134
+ * @property {string} [orgAdminAuthorization] bearer token of org admin to use syncInWebexSites
131
135
  */
132
136
 
133
137
  /**
@@ -190,6 +194,7 @@ export function createTestUser(options = {}) {
190
194
  'squaredRoomModeration',
191
195
  'squaredInviter',
192
196
  'webExSquared',
197
+ 'basicMessage',
193
198
  ],
194
199
  idbrokerUrl,
195
200
  machineType: options.machineType,
@@ -199,6 +204,10 @@ export function createTestUser(options = {}) {
199
204
  roles: options.roles || [],
200
205
  scopes: options.scope || process.env.WEBEX_SCOPE,
201
206
  type: options.type,
207
+ forceCreate: options.forceCreate || false,
208
+ ensureExistsInWebexSites: options.ensureExistsInWebexSites || false,
209
+ syncInWebexSites: options.syncInWebexSites,
210
+ orgAdminAuthorization: options.orgAdminAuthorization,
202
211
  };
203
212
 
204
213
  return requestWithAuth({
@@ -312,6 +321,55 @@ export function removeTestUser(options = {}) {
312
321
  });
313
322
  }
314
323
 
324
+ /**
325
+ * Sets the preferredWebexSite for the provided user
326
+ *
327
+ * This method should be used to ensure a created test user has the right webex site set.
328
+ *
329
+ * @param {Object} options
330
+ * @param {string} options.userId user id to set site
331
+ * @param {string} options.preferredSite new preferred webexsite
332
+ * @param {string} options.orgId orgId of the site
333
+ * @param {string} options.identityServiceUrl url of identity service
334
+ * @param {string} options.authorization
335
+ * @param {string} options.clientId
336
+ * @param {string} options.clientSecret
337
+ * @returns {Promise}
338
+ */
339
+ export function setPreferredSite(options = {}) {
340
+ const clientId = options.clientId || process.env.WEBEX_CLIENT_ID;
341
+ const clientSecret = options.clientSecret || process.env.WEBEX_CLIENT_SECRET;
342
+
343
+ if (!clientId) {
344
+ throw new Error('options.clientId or process.env.WEBEX_CLIENT_ID must be defined');
345
+ }
346
+
347
+ if (!clientSecret) {
348
+ throw new Error('options.clientSecret or process.env.WEBEX_CLIENT_SECRET must be defined');
349
+ }
350
+
351
+ /* eslint-disable no-useless-escape */
352
+ const body = {
353
+ schemas: ['urn:scim:schemas:core:1.0', 'urn:scim:schemas:extension:cisco:commonidentity:1.0'],
354
+ userPreferences: [
355
+ {
356
+ value: `\"preferredWebExSite\":\"${options.preferredSite}\"`,
357
+ },
358
+ ],
359
+ };
360
+ /* eslint-enable no-useless-escape */
361
+
362
+ return request({
363
+ method: 'PATCH',
364
+ headers: {
365
+ authorization: options.authorization,
366
+ },
367
+ uri: `${options.identityServiceUrl}/identity/scim/${options.orgId}/v1/Users/${options.userId}`,
368
+ json: true,
369
+ body,
370
+ });
371
+ }
372
+
315
373
  export {
316
374
  default as createWhistlerTestUser,
317
375
  removeTestUser as removeWhistlerTestUser,
@@ -1,38 +0,0 @@
1
- /**
2
- * Converts a string from a base64url-encoded string
3
- * @param {string} str
4
- * @returns {string}
5
- */
6
- export function fromBase64url(str: string): string;
7
- /**
8
- * Converts a string to a base64url-encoded string. It also accepts a buffer
9
- * @param {string|buffer} str
10
- * @returns {string}
11
- */
12
- export function toBase64Url(str: any): string;
13
- /**
14
- * Converts a string to a base64url-encoded string. It also accepts a buffer
15
- * @param {string|buffer} str
16
- * @returns {string}
17
- */
18
- export function encode(str: string | buffer): string;
19
- /**
20
- * Converts a string from a base64url-encoded string
21
- * @param {string} str
22
- * @returns {string}
23
- */
24
- export function decode(str: string): string;
25
- /**
26
- * Indicates if the provided string is, in fact, a base64 string
27
- * @param {String} str
28
- * @returns {Boolean}
29
- */
30
- export function validate(str: string): boolean;
31
- declare namespace _default {
32
- export { fromBase64url };
33
- export { toBase64Url };
34
- export { encode };
35
- export { decode };
36
- export { validate };
37
- }
38
- export default _default;
@@ -1,8 +0,0 @@
1
- declare const _default: ((agent: any) => {
2
- getOSName: () => any;
3
- getOSVersion: () => any;
4
- getBrowserName: () => any;
5
- getBrowserVersion: () => any;
6
- isBrowser: (name: any) => boolean;
7
- }) & import("lodash").MemoizedFunction;
8
- export default _default;
@@ -1,12 +0,0 @@
1
- /*!
2
- * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
3
- */
4
- /**
5
- * Behaves like debounce, but additionally executes after a number of calls are
6
- * attempted, rather than just time
7
- * @param {Function} fn
8
- * @param {Number} wait
9
- * @param {Object} options
10
- * @returns {Function}
11
- */
12
- export default function debounce(fn: Function, wait: number, options: any): Function;
@@ -1,11 +0,0 @@
1
- /*!
2
- * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
3
- */
4
- /**
5
- * Check object for the specified keys
6
- * @param {Array<string>} keys
7
- * @param {Object} object
8
- * @returns {undefined}
9
- * @throws Error
10
- */
11
- export default function checkRequired(keys: Array<string>, object: any): undefined;
@@ -1,76 +0,0 @@
1
- export namespace SDK_EVENT {
2
- namespace INTERNAL {
3
- const WEBEX_ACTIVITY: string;
4
- namespace ACTIVITY_FIELD {
5
- const ACTOR: string;
6
- const OBJECT: string;
7
- const TARGET: string;
8
- }
9
- namespace ACTIVITY_VERB {
10
- const ACKNOWLEDGE: string;
11
- const CARD_ACTION: string;
12
- const CREATE: string;
13
- const POST: string;
14
- const SHARE: string;
15
- const DELETE: string;
16
- const ADD: string;
17
- const LEAVE: string;
18
- const ADD_MODERATOR: string;
19
- const REMOVE_MODERATOR: string;
20
- const LOCK: string;
21
- const UNLOCK: string;
22
- const HIDE: string;
23
- const UPDATE: string;
24
- }
25
- namespace ACTIVITY_TAG {
26
- const HIDDEN: string;
27
- const ONE_ON_ONE: string;
28
- const LOCKED: string;
29
- }
30
- }
31
- namespace EXTERNAL {
32
- namespace EVENT_TYPE {
33
- const CREATED: string;
34
- const DELETED: string;
35
- const UPDATED: string;
36
- const SEEN: string;
37
- }
38
- namespace OWNER {
39
- const CREATOR: string;
40
- const ORG: string;
41
- }
42
- namespace STATUS {
43
- const ACTIVE: string;
44
- const DISABLED: string;
45
- }
46
- namespace SPACE_TYPE {
47
- const DIRECT: string;
48
- const GROUP: string;
49
- }
50
- namespace RESOURCE {
51
- const ATTACHMENT_ACTIONS: string;
52
- const MEMBERSHIPS: string;
53
- const MESSAGES: string;
54
- const ROOMS: string;
55
- }
56
- namespace ATTACHMENTS {
57
- const CARD_CONTENT_TYPE: string;
58
- }
59
- }
60
- }
61
- export namespace hydraTypes {
62
- const ATTACHMENT_ACTION: string;
63
- const CONTENT: string;
64
- const MEMBERSHIP: string;
65
- const MESSAGE: string;
66
- const ORGANIZATION: string;
67
- const PEOPLE: string;
68
- const ROOM: string;
69
- const TEAM: string;
70
- }
71
- export namespace deviceType {
72
- const PROVISIONAL: string;
73
- const WEB: string;
74
- }
75
- export const INTERNAL_US_CLUSTER_NAME: "urn:TEAM:us-east-2_a";
76
- export const INTERNAL_US_INTEGRATION_CLUSTER_NAME: "urn:TEAM:us-east-1_int13";
@@ -1,23 +0,0 @@
1
- /*!
2
- * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
3
- */
4
- /**
5
- * Creates a new `Defer`red object,
6
- * @returns {Defer}
7
- */
8
- export default function Defer(): Defer;
9
- export default class Defer {
10
- promise: Promise<any>;
11
- /**
12
- * @instance
13
- * @memberof Defer
14
- * @type {function}
15
- */
16
- resolve: Function;
17
- /**
18
- * @instance
19
- * @memberof Defer
20
- * @type {function}
21
- */
22
- reject: Function;
23
- }
@@ -1,7 +0,0 @@
1
- export default exportedDeprecated;
2
- declare const exportedDeprecated: import("core-decorators").Deprecate | typeof emptyDecorator;
3
- /**
4
- * @private
5
- * @returns {function}
6
- */
7
- declare function emptyDecorator(): Function;