zoom.js 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. module.exports.responses = {
  2. 'https://zoom.us/v2/users/me': {
  3. get: {
  4. id: 'DUMMY-USER-ID',
  5. first_name: 'John',
  6. last_name: 'Doe',
  7. email: 'john.doe@transloadit.com',
  8. timezone: '',
  9. dept: '',
  10. created_at: '2020-07-21T09:13:30Z',
  11. last_login_time: '2020-10-12T07:55:02Z',
  12. group_ids: [],
  13. im_group_ids: [],
  14. account_id: 'DUMMY-ACCOUNT-ID',
  15. language: 'en-US',
  16. },
  17. },
  18. 'https://zoom.us/v2/meetings/DUMMY-UUID%3D%3D/recordings': {
  19. get: {
  20. uuid: 'DUMMY-UUID==',
  21. id: 12345678900,
  22. account_id: 'DUMMY-ACCOUNT-ID',
  23. host_id: 'DUMMY-HOST-ID',
  24. topic: 'DUMMY TOPIC',
  25. type: 2,
  26. start_time: '2020-05-29T13:19:40Z',
  27. timezone: 'Europe/Amsterdam',
  28. duration: 0,
  29. total_size: 723389,
  30. recording_count: 4,
  31. recording_files:
  32. [
  33. {
  34. id: 'DUMMY-FILE-ID',
  35. meeting_id: 'DUMMY-UUID==',
  36. recording_start: '2020-05-29T13:23:57Z',
  37. recording_end: '2020-05-29T13:24:02Z',
  38. file_type: 'MP4',
  39. file_size: 758051,
  40. play_url: 'https://us02web.zoom.us/rec/play/DUMMY-DOWNLOAD-PATH',
  41. download_url: 'https://us02web.zoom.us/rec/download/DUMMY-DOWNLOAD-PATH',
  42. status: 'completed',
  43. recording_type: 'shared_screen_with_speaker_view',
  44. },
  45. ],
  46. },
  47. },
  48. 'https://us02web.zoom.us/rec/play/DUMMY-DOWNLOAD-PATH': {
  49. get: {},
  50. },
  51. 'https://api.zoom.us/oauth/data/compliance': {
  52. post: {},
  53. },
  54. 'https://zoom.us/oauth/revoke': {
  55. post: {},
  56. },
  57. }
  58. module.exports.expects = {
  59. listPath: 'DUMMY-UUID%3D%3D',
  60. itemName: 'DUMMY TOPIC - shared screen with speaker view (2020-05-29, 13:23).mp4',
  61. itemId: 'DUMMY-UUID%3D%3D__DUMMY-FILE-ID',
  62. itemRequestPath: 'DUMMY-UUID%3D%3D?recordingId=DUMMY-FILE-ID',
  63. itemIcon: 'video',
  64. remoteZoomKey: 'REMOTE-ZOOM-KEY',
  65. remoteZoomSecret: 'REMOTE-ZOOM-SECRET',
  66. remoteZoomVerificationToken: 'REMOTE-ZOOM-VERIFICATION-TOKEN',
  67. }
  68. module.exports.validators = {
  69. 'https://zoom.us/oauth/revoke': ({ headers }) => {
  70. if (process.env.COMPANION_ZOOM_KEYS_ENDPOINT) {
  71. const auth = `${module.exports.expects.remoteZoomKey}:${module.exports.expects.remoteZoomSecret}`
  72. return headers.Authorization === `Basic ${Buffer.from(auth, 'binary').toString('base64')}`
  73. }
  74. return true
  75. },
  76. }