zaccl 3.0.17 → 4.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 (70) hide show
  1. package/docs/ECatCloudRecording.js.html +74 -27
  2. package/docs/ECatGroup.js.html +207 -0
  3. package/docs/ECatMeeting.js.html +76 -11
  4. package/docs/ECatUser.js.html +7 -10
  5. package/docs/ECatWebinar.js.html +6 -5
  6. package/docs/api.cloudRecording.html +371 -48
  7. package/docs/api.group.html +367 -0
  8. package/docs/api.meeting.html +437 -15
  9. package/docs/api.user.html +10 -10
  10. package/docs/api.webinar.html +5 -5
  11. package/docs/index.html +1 -1
  12. package/lib/endpoints/ECatCloudRecording.d.ts +33 -9
  13. package/lib/endpoints/ECatCloudRecording.js +73 -26
  14. package/lib/endpoints/ECatCloudRecording.js.map +1 -1
  15. package/lib/endpoints/ECatGroup.d.ts +39 -0
  16. package/lib/endpoints/ECatGroup.js +142 -0
  17. package/lib/endpoints/ECatGroup.js.map +1 -0
  18. package/lib/endpoints/ECatMeeting.d.ts +40 -10
  19. package/lib/endpoints/ECatMeeting.js +75 -10
  20. package/lib/endpoints/ECatMeeting.js.map +1 -1
  21. package/lib/endpoints/ECatUser.d.ts +5 -5
  22. package/lib/endpoints/ECatUser.js +6 -9
  23. package/lib/endpoints/ECatUser.js.map +1 -1
  24. package/lib/endpoints/ECatWebinar.d.ts +4 -4
  25. package/lib/endpoints/ECatWebinar.js +5 -4
  26. package/lib/endpoints/ECatWebinar.js.map +1 -1
  27. package/lib/index.d.ts +22 -0
  28. package/lib/index.js +19 -0
  29. package/lib/index.js.map +1 -1
  30. package/lib/shared/helpers/genVisitEndpoint.js +60 -17
  31. package/lib/shared/helpers/genVisitEndpoint.js.map +1 -1
  32. package/lib/shared/types/VisitEndpointFunc.d.ts +2 -1
  33. package/lib/types/ZoomAPI.d.ts +2 -0
  34. package/lib/types/ZoomAPI.js.map +1 -1
  35. package/lib/types/ZoomGroup.d.ts +10 -0
  36. package/lib/types/ZoomGroup.js +3 -0
  37. package/lib/types/ZoomGroup.js.map +1 -0
  38. package/lib/types/ZoomGroupMember.d.ts +12 -0
  39. package/lib/types/ZoomGroupMember.js +3 -0
  40. package/lib/types/ZoomGroupMember.js.map +1 -0
  41. package/lib/types/ZoomMeetingRecordings.d.ts +1 -0
  42. package/lib/types/ZoomMeetingTranscript.d.ts +17 -0
  43. package/lib/types/ZoomMeetingTranscript.js +3 -0
  44. package/lib/types/ZoomMeetingTranscript.js.map +1 -0
  45. package/lib/types/ZoomPastMeetingDetails.d.ts +22 -0
  46. package/lib/types/ZoomPastMeetingDetails.js +3 -0
  47. package/lib/types/ZoomPastMeetingDetails.js.map +1 -0
  48. package/lib/types/ZoomPastMeetingParticipant.d.ts +18 -0
  49. package/lib/types/ZoomPastMeetingParticipant.js +3 -0
  50. package/lib/types/ZoomPastMeetingParticipant.js.map +1 -0
  51. package/lib/types/ZoomRecordingInAccount.d.ts +22 -0
  52. package/lib/types/ZoomRecordingInAccount.js +3 -0
  53. package/lib/types/ZoomRecordingInAccount.js.map +1 -0
  54. package/package.json +2 -2
  55. package/src/endpoints/ECatCloudRecording.ts +86 -30
  56. package/src/endpoints/ECatGroup.ts +89 -0
  57. package/src/endpoints/ECatMeeting.ts +81 -10
  58. package/src/endpoints/ECatUser.ts +6 -9
  59. package/src/endpoints/ECatWebinar.ts +5 -4
  60. package/src/index.ts +53 -0
  61. package/src/shared/helpers/genVisitEndpoint.ts +123 -79
  62. package/src/shared/types/VisitEndpointFunc.ts +4 -2
  63. package/src/types/ZoomAPI.ts +2 -0
  64. package/src/types/ZoomGroup.ts +14 -0
  65. package/src/types/ZoomGroupMember.ts +20 -0
  66. package/src/types/ZoomMeetingRecordings.ts +2 -0
  67. package/src/types/ZoomMeetingTranscript.ts +28 -0
  68. package/src/types/ZoomPastMeetingDetails.ts +38 -0
  69. package/src/types/ZoomPastMeetingParticipant.ts +30 -0
  70. package/src/types/ZoomRecordingInAccount.ts +38 -0
@@ -1,4 +1,15 @@
1
1
  "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
2
13
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
14
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
15
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -63,26 +74,39 @@ var genVisitEndpoint = function (zoomAPIConfig) {
63
74
  * @param [opts.postProcessor] function that processes the response before
64
75
  * returning
65
76
  * @param [opts.params] Parameters/args/body to send with request
77
+ * @param [opts.onNewPage] callback function that is called when a
78
+ * new page of results is received
79
+ * @param [opts.itemKey] the key in the response body where the list of items can be found
80
+ * @param [opts.onNewPage] callback function that is called when a new page of results is received
66
81
  * @returns response body
67
82
  */
68
83
  return function (opts) { return __awaiter(void 0, void 0, void 0, function () {
69
- var path, params, action, errorMap, postProcessor, method, _a, status, headers, body, rateLimitTypeHeader, rateLimitType, zoomErrorMessage, errorMessage, errorCode;
84
+ var path, params, action, errorMap, itemKey, onNewPage, method, nextPageToken, isFirstPage, isPaginated, allItems, _a, status_1, headers, body, rateLimitTypeHeader, rateLimitType, zoomErrorMessage, errorMessage, errorCode, results;
70
85
  var _b;
71
86
  return __generator(this, function (_c) {
72
87
  switch (_c.label) {
73
88
  case 0:
74
- path = opts.path, params = opts.params, action = opts.action, errorMap = opts.errorMap, postProcessor = opts.postProcessor;
89
+ path = opts.path, params = opts.params, action = opts.action, errorMap = opts.errorMap, itemKey = opts.itemKey, onNewPage = opts.onNewPage;
75
90
  method = ((_b = opts.method) !== null && _b !== void 0 ? _b : 'GET');
91
+ nextPageToken = undefined;
92
+ isFirstPage = true;
93
+ isPaginated = false;
94
+ allItems = [];
95
+ _c.label = 1;
96
+ case 1:
97
+ if (!(nextPageToken || isFirstPage)) return [3 /*break*/, 3];
98
+ // Don't fetch another page unless we get a token
99
+ isFirstPage = false;
76
100
  return [4 /*yield*/, (0, sendZoomRequest_1.default)({
77
101
  path: path,
78
102
  method: method,
79
- params: params,
103
+ params: __assign(__assign({}, params), { next_page_token: nextPageToken }),
80
104
  zoomAPIConfig: zoomAPIConfig,
81
105
  })];
82
- case 1:
83
- _a = _c.sent(), status = _a.status, headers = _a.headers, body = _a.body;
106
+ case 2:
107
+ _a = _c.sent(), status_1 = _a.status, headers = _a.headers, body = _a.body;
84
108
  /* ----------- Rate Error ----------- */
85
- if (status === 429) {
109
+ if (status_1 === 429) {
86
110
  rateLimitTypeHeader = Object.keys(headers).filter(function (header) {
87
111
  return (header.toLowerCase() === 'x-ratelimit-type');
88
112
  })[0];
@@ -111,18 +135,18 @@ var genVisitEndpoint = function (zoomAPIConfig) {
111
135
  }
112
136
  }
113
137
  /* -------- Custom Error Code ------- */
114
- if (status < 200 || status >= 300) {
138
+ if (status_1 < 200 || status_1 >= 300) {
115
139
  zoomErrorMessage = 'An unknown Zoom error occurred.';
116
- if (errorMap[status]) {
117
- if (typeof errorMap[status] === 'string') {
140
+ if (errorMap[status_1]) {
141
+ if (typeof errorMap[status_1] === 'string') {
118
142
  // Found the error message
119
- zoomErrorMessage = errorMap[status];
143
+ zoomErrorMessage = errorMap[status_1];
120
144
  }
121
145
  else if (body.code) {
122
146
  // Check for nested error message
123
- if (typeof errorMap[status][body.code] === 'string') {
147
+ if (typeof errorMap[status_1][body.code] === 'string') {
124
148
  // Found nested error message
125
- zoomErrorMessage = errorMap[status][body.code];
149
+ zoomErrorMessage = errorMap[status_1][body.code];
126
150
  }
127
151
  else if (body.message) {
128
152
  // errorMap[status][code] did not return err message
@@ -140,17 +164,36 @@ var genVisitEndpoint = function (zoomAPIConfig) {
140
164
  }
141
165
  }
142
166
  errorMessage = "We couldn't ".concat(action, " because an error occurred: ").concat(zoomErrorMessage);
143
- errorCode = "ZOOM".concat(status).concat(body.code ? "-".concat(body.code) : '');
167
+ errorCode = "ZOOM".concat(status_1).concat(body.code ? "-".concat(body.code) : '');
144
168
  throw new ZACCLError_1.default({
145
169
  message: errorMessage,
146
170
  code: errorCode,
147
171
  });
148
172
  }
149
- /* ----- Post-process and Return ---- */
150
- if (postProcessor) {
151
- return [2 /*return*/, postProcessor(body)];
173
+ results = itemKey ? body[itemKey] : body;
174
+ // Update next page token
175
+ nextPageToken = body.next_page_token;
176
+ if (nextPageToken) {
177
+ isPaginated = true;
178
+ }
179
+ // End if not paginated
180
+ if (!isPaginated) {
181
+ return [2 /*return*/, results];
182
+ }
183
+ /* --------- Paging Handling -------- */
184
+ // Add items to allItems if paginated
185
+ if (Array.isArray(results)) {
186
+ allItems.push.apply(allItems, results);
187
+ }
188
+ // Call onNewPage callback if it exists
189
+ if (onNewPage) {
190
+ onNewPage(results);
152
191
  }
153
- return [2 /*return*/, body];
192
+ return [3 /*break*/, 1];
193
+ case 3:
194
+ ;
195
+ // Return all items (if we got here, response is paginated)
196
+ return [2 /*return*/, allItems];
154
197
  }
155
198
  });
156
199
  }); };
@@ -1 +1 @@
1
- {"version":3,"file":"genVisitEndpoint.js","sourceRoot":"","sources":["../../../src/shared/helpers/genVisitEndpoint.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wBAAwB;AACxB,sEAAgD;AAKhD,iEAA2C;AAC3C,2EAAqD;AAErD,wBAAwB;AACxB,qEAA+C;AAE/C;;;;;GAKG;AACH,IAAM,gBAAgB,GAAG,UAAC,aAA4B;IACpD;;;;;;;;;;;;OAYG;IACH,OAAO,UACL,IAcC;;;;;;oBAGC,IAAI,GAKF,IAAI,KALF,EACJ,MAAM,GAIJ,IAAI,OAJA,EACN,MAAM,GAGJ,IAAI,OAHA,EACN,QAAQ,GAEN,IAAI,SAFE,EACR,aAAa,GACX,IAAI,cADO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AAE;wBAC1B,QAAQ,CAAC,IAAI,OAAb,QAAQ,EAAS,OAAO,EAAE;qBAC3B;oBAED,uCAAuC;oBACvC,IAAI,SAAS,EAAE;wBACb,SAAS,CAAC,OAAO,CAAC,CAAC;qBACpB;;;oBACF,CAAC;oBAEF,2DAA2D;oBAC3D,sBAAO,QAAQ,EAAC;;;SACjB,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,gBAAgB,CAAC"}
@@ -14,6 +14,7 @@ type VisitEndpointFunc = ((opts: {
14
14
  params?: {
15
15
  [k: string]: any;
16
16
  };
17
- postProcessor?: (response: any) => any;
17
+ itemKey?: string;
18
+ onNewPage?: (items: any[]) => void;
18
19
  }) => Promise<any>);
19
20
  export default VisitEndpointFunc;
@@ -1,4 +1,5 @@
1
1
  import ECatCloudRecording from '../endpoints/ECatCloudRecording';
2
+ import ECatGroup from '../endpoints/ECatGroup';
2
3
  import ECatMeeting from '../endpoints/ECatMeeting';
3
4
  import ECatUser from '../endpoints/ECatUser';
4
5
  import ECatWebinar from '../endpoints/ECatWebinar';
@@ -11,5 +12,6 @@ interface ZoomAPI {
11
12
  meeting: ECatMeeting;
12
13
  user: ECatUser;
13
14
  webinar: ECatWebinar;
15
+ group: ECatGroup;
14
16
  }
15
17
  export default ZoomAPI;
@@ -1 +1 @@
1
- {"version":3,"file":"ZoomAPI.js","sourceRoot":"","sources":["../../src/types/ZoomAPI.ts"],"names":[],"mappings":";;AAcC,CAAC"}
1
+ {"version":3,"file":"ZoomAPI.js","sourceRoot":"","sources":["../../src/types/ZoomAPI.ts"],"names":[],"mappings":";;AAgBC,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Zoom user group
3
+ * @author Gabe Abrams
4
+ */
5
+ type ZoomGroup = {
6
+ id: string;
7
+ name: string;
8
+ total_members: number;
9
+ };
10
+ export default ZoomGroup;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=ZoomGroup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ZoomGroup.js","sourceRoot":"","sources":["../../src/types/ZoomGroup.ts"],"names":[],"mappings":""}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * A single group member within a Zoom group
3
+ * @author Gabe Abrams
4
+ */
5
+ type ZoomGroupMember = {
6
+ email: string;
7
+ first_name: string;
8
+ id: string;
9
+ last_name: string;
10
+ type: (1 | 2);
11
+ };
12
+ export default ZoomGroupMember;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=ZoomGroupMember.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ZoomGroupMember.js","sourceRoot":"","sources":["../../src/types/ZoomGroupMember.ts"],"names":[],"mappings":""}
@@ -16,5 +16,6 @@ type ZoomMeetingRecordings = {
16
16
  type: ZoomMeetingOrWebinarType;
17
17
  uuid: string;
18
18
  recording_files?: ZoomRecordingFile[];
19
+ download_access_token?: string;
19
20
  };
20
21
  export default ZoomMeetingRecordings;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Transcript for a specific zoom meeting instance
3
+ * @author Gabe Abrams
4
+ */
5
+ type ZoomMeetingTranscript = {
6
+ meeting_id: string;
7
+ account_id: string;
8
+ meeting_topic: string;
9
+ host_id: string;
10
+ transcript_created_time: string;
11
+ can_download: boolean;
12
+ auto_delete: boolean;
13
+ auto_delete_date: string;
14
+ download_url: string | null;
15
+ download_restriction_reason: 'DELETED_OR_TRASHED' | 'UNSUPPORTED' | 'NO_TRANSCRIPT_DATA' | 'NOT_READY' | null;
16
+ };
17
+ export default ZoomMeetingTranscript;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=ZoomMeetingTranscript.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ZoomMeetingTranscript.js","sourceRoot":"","sources":["../../src/types/ZoomMeetingTranscript.ts"],"names":[],"mappings":""}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Details about a past meeting
3
+ * @author Gabe Abrams
4
+ */
5
+ type ZoomPastMeetingDetails = {
6
+ id: number;
7
+ uuid: string;
8
+ duration: number;
9
+ start_time: string;
10
+ end_time: string;
11
+ host_id: string;
12
+ dept: string;
13
+ participants_count: number;
14
+ source: string;
15
+ topic: string;
16
+ total_minutes: number;
17
+ type: 0 | 1 | 2 | 3 | 4 | 7 | 8;
18
+ user_email: string;
19
+ user_name: string;
20
+ has_meeting_summary: boolean;
21
+ };
22
+ export default ZoomPastMeetingDetails;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=ZoomPastMeetingDetails.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ZoomPastMeetingDetails.js","sourceRoot":"","sources":["../../src/types/ZoomPastMeetingDetails.ts"],"names":[],"mappings":""}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Represents a participant in a Zoom past meeting.
3
+ * @author Gabe Abrams
4
+ */
5
+ type ZoomPastMeetingParticipant = {
6
+ id?: string;
7
+ name?: string;
8
+ user_id?: string;
9
+ registrant_id?: string;
10
+ user_email?: string;
11
+ join_time?: string;
12
+ leave_time?: string;
13
+ duration?: number;
14
+ failover?: boolean;
15
+ status?: 'in_meeting' | 'in_waiting_room';
16
+ internal_user?: boolean;
17
+ };
18
+ export default ZoomPastMeetingParticipant;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=ZoomPastMeetingParticipant.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ZoomPastMeetingParticipant.js","sourceRoot":"","sources":["../../src/types/ZoomPastMeetingParticipant.ts"],"names":[],"mappings":""}
@@ -0,0 +1,22 @@
1
+ import ZoomRecordingFile from './ZoomRecordingFile';
2
+ /**
3
+ * A single recording in an account
4
+ * @author Gabe Abrams
5
+ */
6
+ type ZoomRecordingInAccount = {
7
+ duration: number;
8
+ host_id: string;
9
+ id: number;
10
+ recording_count: number;
11
+ recording_files: ZoomRecordingFile[];
12
+ start_time: string;
13
+ topic: string;
14
+ total_size: number;
15
+ type: number;
16
+ uuid: string;
17
+ rc_zone?: string;
18
+ instance_id?: string;
19
+ service_name?: string;
20
+ external_storage_addr?: string;
21
+ };
22
+ export default ZoomRecordingInAccount;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=ZoomRecordingInAccount.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ZoomRecordingInAccount.js","sourceRoot":"","sources":["../../src/types/ZoomRecordingInAccount.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "zaccl",
3
- "version": "3.0.17",
3
+ "version": "4.0.0",
4
4
  "description": "The Zoom App Complete Connection Library, a project that handles everything required to build a zoom-integrated app.",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./lib/index.d.ts",
7
7
  "scripts": {
8
8
  "build": "tsc --project ./tsconfig.json && rm -rf ./docBuilder/template;cp -r ./node_modules/docdash ./docBuilder/template; node ./docBuilder/updateBuilder.js;rm -rf ./docs;./node_modules/.bin/jsdoc -c ./docBuilder/jsdocConfig.json",
9
- "sandbox": "npm run build && npx ts-node sandbox.ts"
9
+ "dev:sandbox": "npm run build && npx ts-node sandbox.ts"
10
10
  },
11
11
  "repository": {
12
12
  "type": "git",
@@ -14,6 +14,7 @@ import ErrorCode from '../shared/types/ErrorCode';
14
14
 
15
15
  // Import shared types
16
16
  import ZoomMeetingRecordings from '../types/ZoomMeetingRecordings';
17
+ import ZoomRecordingInAccount from '../types/ZoomRecordingInAccount';
17
18
 
18
19
  // Import shared helper
19
20
  import {
@@ -23,18 +24,86 @@ import {
23
24
 
24
25
  class ECatCloudRecording extends EndpointCategory {
25
26
  /**
26
- * Get all recordings of a meeting
27
+ * List recordings in the account (Medium)
28
+ * @author Gabe Abrams
29
+ * @instance
30
+ * @memberof api.cloudRecording
31
+ * @method listAccountRecordings
32
+ * @param opts object containing all arguments
33
+ * @param opts.fromYear the start of the date range to list recordings for (e.g. 2026)
34
+ * @param opts.fromMonth the month of the date range to list recordings for (1-12)
35
+ * @param [opts.fromDay] the day of the month of the date range to list recordings for (1-31, defaults to 1)
36
+ * @param [opts.accountId] the account ID of the account of interest (defaults to the account
37
+ * associated with the current access)
38
+ * @param [opts.onNewPage] callback function that is called when a new page of results is received.
39
+ * The function is passed the new page of results as an argument.
40
+ * @returns the list of recordings in the account
41
+ */
42
+ async listAccountRecordings(
43
+ opts: {
44
+ fromYear: number,
45
+ fromMonth: number,
46
+ fromDay?: number,
47
+ accountId?: string,
48
+ onNewPage?: (recordings: ZoomRecordingInAccount[]) => void,
49
+ },
50
+ ): Promise<ZoomRecordingInAccount[]> {
51
+ // Generate from date
52
+ const {
53
+ fromYear,
54
+ fromMonth,
55
+ } = opts;
56
+ const fromMonthPadded = fromMonth < 10 ? `0${fromMonth}` : fromMonth;
57
+ const fromDay = opts.fromDay ?? 1;
58
+ const fromDayPadded = fromDay < 10 ? `0${fromDay}` : fromDay;
59
+ const fromDateString = `${fromYear}-${fromMonthPadded}-${fromDayPadded}`;
60
+
61
+ // Generate to date
62
+ let toYear = fromYear;
63
+ let toMonth = opts.fromMonth + 1;
64
+ if (toMonth > 12) {
65
+ toMonth = 1;
66
+ toYear += 1;
67
+ }
68
+ let toMonthPadded = toMonth < 10 ? `0${toMonth}` : toMonth;
69
+ let toDay = fromDay;
70
+ let toDayPadded = toDay < 10 ? `0${toDay}` : toDay;
71
+ const toDateString = `${toYear}-${toMonthPadded}-${toDayPadded}`;
72
+
73
+ return this.visitEndpoint({
74
+ path: `/accounts/${opts.accountId ?? 'me'}/recordings`,
75
+ action: 'list recordings in the account',
76
+ method: 'GET',
77
+ params: {
78
+ page_size: 300, // max allowed page size
79
+ from: fromDateString,
80
+ to: toDateString,
81
+ },
82
+ onNewPage: opts.onNewPage,
83
+ itemKey: 'meetings',
84
+ errorMap: {
85
+ 400: 'Bad request',
86
+ 404: 'No recordings found',
87
+ },
88
+ });
89
+ }
90
+
91
+ /**
92
+ * Get all recordings of a meeting (Light)
27
93
  * @author Aryan Pandey
28
94
  * @instance
29
95
  * @memberof api.cloudRecording
30
96
  * @method listMeetingRecordings
31
97
  * @param opts object containing all arguments
32
- * @param options.meetingId the Zoom meeting ID or UUID
98
+ * @param opts.meetingId the Zoom meeting ID or UUID
99
+ * @param opts.includeDownloadAccessToken if true, the response will include a download_access_token
100
+ * that can be used to download the recording files
33
101
  * @returns list of Zoom meeting recording objects {@link https://marketplace.zoom.us/docs/api-reference/zoom-api/cloud-recording/recordingget#responses}
34
102
  */
35
103
  async listMeetingRecordings(
36
104
  opts: {
37
105
  meetingId: string | number,
106
+ includeDownloadAccessToken?: boolean,
38
107
  },
39
108
  ): Promise<ZoomMeetingRecordings> {
40
109
  // Check if required param is present
@@ -45,11 +114,19 @@ class ECatCloudRecording extends EndpointCategory {
45
114
  });
46
115
  }
47
116
 
117
+ // Create params
118
+ const params: { [k: string]: any } = {};
119
+ if (opts.includeDownloadAccessToken) {
120
+ params.include_fields = 'download_access_token';
121
+ params.ttl = 604800; // Max TTL
122
+ }
123
+
48
124
  return this.visitEndpoint({
49
125
  // Call function on meetingId to handle double encoding if necessary
50
126
  path: `/meetings/${doubleEncode(String(opts.meetingId))}/recordings`,
51
127
  method: 'GET',
52
128
  action: 'get all recordings of a meeting',
129
+ params,
53
130
  errorMap: {
54
131
  400: {
55
132
  1010: 'We could not find the user on this account',
@@ -63,17 +140,13 @@ class ECatCloudRecording extends EndpointCategory {
63
140
  }
64
141
 
65
142
  /**
66
- * List all cloud recordings of a user
143
+ * List all cloud recordings of a user (Medium)
67
144
  * @author Aryan Pandey
68
145
  * @instance
69
146
  * @memberof api.cloudRecording
70
147
  * @method listUserRecordings
71
148
  * @param opts object containing all arguments
72
149
  * @param opts.userId the user ID or email address of the user
73
- * @param [opts.pageSize=300] number of records
74
- * returned from a single API call
75
- * @param [opts.nextPageToken] token used to pageinate
76
- * through large result sets
77
150
  * @param [opts.searchTrash=false] set to true to retrieve
78
151
  * meeting recordings from the trash.
79
152
  * @param [opts.startDate=1 month before today]
@@ -84,26 +157,26 @@ class ECatCloudRecording extends EndpointCategory {
84
157
  * constructor or instance of Date object.
85
158
  * Date needs to be within past 6 months. Time data (hours and seconds)
86
159
  * is discarded
160
+ * @param [opts.onNewPage] callback function that is called when a new page of results is received.
161
+
87
162
  * @returns List of Zoom Recordings {@link https://marketplace.zoom.us/docs/api-reference/zoom-api/cloud-recording/recordingslist#responses}
88
163
  */
89
164
  async listUserRecordings(
90
165
  opts: {
91
166
  userId: string,
92
- pageSize?: number,
93
- nextPageToken?: string,
94
167
  searchTrash?: boolean,
95
168
  startDate?: (string | Date),
96
169
  endDate?: (string | Date),
170
+ onNewPage?: (recordings: ZoomMeetingRecordings[]) => void,
97
171
  },
98
172
  ): Promise<ZoomMeetingRecordings[]> {
99
173
  // Destructure arguments
100
174
  const {
101
175
  userId,
102
176
  searchTrash,
103
- nextPageToken,
104
177
  startDate,
105
178
  endDate,
106
- pageSize,
179
+ onNewPage,
107
180
  } = opts;
108
181
 
109
182
  // Declare default start Date to 1 month before
@@ -124,17 +197,6 @@ class ECatCloudRecording extends EndpointCategory {
124
197
  from: formatDate(defaultDate, 'startDate'),
125
198
  };
126
199
 
127
- if (pageSize) {
128
- // Throw error if pageSize is over max val of 300
129
- if (pageSize > 300) {
130
- throw new ZACCLError({
131
- message: `We requested ${pageSize} recordings from Zoom but it can only give us 300 at a time`,
132
- code: ErrorCode.InvalidPageSize,
133
- });
134
- }
135
- params.page_size = pageSize;
136
- }
137
-
138
200
  if (startDate) {
139
201
  params.from = formatDate(startDate, 'startDate');
140
202
  }
@@ -143,19 +205,13 @@ class ECatCloudRecording extends EndpointCategory {
143
205
  params.to = formatDate(endDate, 'endDate');
144
206
  }
145
207
 
146
- if (nextPageToken) {
147
- params.next_page_token = nextPageToken;
148
- }
149
-
150
208
  return this.visitEndpoint({
151
209
  path: `/users/${userId}/recordings`,
152
210
  action: 'list all cloud recordings of a user',
153
211
  method: 'GET',
154
212
  params,
155
- postProcessor: (body) => {
156
- // Extract the recordings from the body
157
- return Array.from(body.meetings);
158
- },
213
+ onNewPage: opts.onNewPage,
214
+ itemKey: 'meetings',
159
215
  errorMap: {
160
216
  404: {
161
217
  1001: `We could not find the Zoom user ${userId} on this account`,
@@ -0,0 +1,89 @@
1
+ /**
2
+ * Category of endpoints for Zoom groups
3
+ * @author Gabe Abrams
4
+ * @namespace api.group
5
+ */
6
+
7
+ // Import shared interfaces
8
+ import EndpointCategory from '../shared/interfaces/EndpointCategory';
9
+
10
+ // Import shared types
11
+ import ZoomGroup from '../types/ZoomGroup';
12
+ import ZoomGroupMember from '../types/ZoomGroupMember';
13
+
14
+ class ECatGroup extends EndpointCategory {
15
+ /**
16
+ * List groups in the account (Medium)
17
+ * @author Gabe Abrams
18
+ * @instance
19
+ * @memberof api.account
20
+ * @method listGroups
21
+ * @param [opts] object containing all arguments
22
+ * @param [opts.onNewPage] callback function that is called when a new page of results is received.
23
+ * @returns the list of groups in the account
24
+ */
25
+ async listGroups(
26
+ opts: {
27
+ onNewPage?: (groups: ZoomGroup[]) => void,
28
+ } = {},
29
+ ): Promise<ZoomGroup[]> {
30
+ return this.visitEndpoint({
31
+ path: '/groups',
32
+ action: 'list groups in the account',
33
+ method: 'GET',
34
+ params: {
35
+ page_size: 10, // max allowed page size
36
+ // TODO: change above to 300
37
+ },
38
+ errorMap: {
39
+ 400: 'Bad request',
40
+ 404: {
41
+ 4130: 'No groups found for this account.',
42
+ },
43
+ },
44
+ itemKey: 'groups',
45
+ onNewPage: opts.onNewPage,
46
+ });
47
+ }
48
+
49
+ /**
50
+ * List the members within a group (Medium)
51
+ * @author Gabe Abrams
52
+ * @instance
53
+ * @memberof api.group
54
+ * @method listGroupMembers
55
+ * @param opts object containing all arguments
56
+ * @params opts.groupId the group ID of the group of interest
57
+ * @param [opts.onNewPage] callback function that is called when a new page of results is received.
58
+ * @returns the list of members in the group
59
+ */
60
+ async listGroupMembers(
61
+ opts: {
62
+ groupId: string,
63
+ onNewPage?: (groupMembers: ZoomGroupMember[]) => void,
64
+ },): Promise<ZoomGroupMember[]> {
65
+ return this.visitEndpoint({
66
+ path: `/groups/${opts.groupId}/members`,
67
+ action: 'list members in a Zoom group',
68
+ method: 'GET',
69
+ params: {
70
+ page_size: 2000, // max allowed page size
71
+ },
72
+ itemKey: 'members',
73
+ errorMap: {
74
+ 400: 'Bad request',
75
+ 404: {
76
+ 4130: 'No groups found for this account.',
77
+ },
78
+ },
79
+ onNewPage: opts.onNewPage,
80
+ });
81
+ }
82
+ }
83
+
84
+ /*------------------------------------------------------------------------*/
85
+ /* Export */
86
+ /*------------------------------------------------------------------------*/
87
+
88
+ export default ECatGroup;
89
+