zaccl 1.2.0 → 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.
- package/.eslintrc.js +95 -0
- package/.vscode/settings.json +8 -0
- package/docBuilder/DOCS_HOME.md +43 -7
- package/docBuilder/jsdocConfig.json +1 -1
- package/docs/ECatCloudRecording.js.html +260 -0
- package/docs/ECatMeeting.js.html +411 -0
- package/docs/ECatUser.js.html +321 -0
- package/docs/ECatWebinar.js.html +295 -0
- package/docs/api.cloudRecording.html +15 -117
- package/docs/api.meeting.html +56 -388
- package/docs/api.user.html +29 -91
- package/docs/api.webinar.html +15 -85
- package/docs/index.html +33 -7
- package/lib/endpoints/ECatCloudRecording.d.ts +57 -0
- package/lib/endpoints/ECatCloudRecording.js +195 -0
- package/lib/endpoints/ECatCloudRecording.js.map +1 -0
- package/lib/endpoints/ECatMeeting.d.ts +122 -0
- package/lib/endpoints/ECatMeeting.js +346 -0
- package/lib/endpoints/ECatMeeting.js.map +1 -0
- package/lib/endpoints/ECatUser.d.ts +79 -0
- package/lib/endpoints/ECatUser.js +256 -0
- package/lib/endpoints/ECatUser.js.map +1 -0
- package/lib/endpoints/ECatWebinar.d.ts +76 -0
- package/lib/endpoints/ECatWebinar.js +230 -0
- package/lib/endpoints/ECatWebinar.js.map +1 -0
- package/lib/index.d.ts +35 -0
- package/lib/index.js +103 -0
- package/lib/index.js.map +1 -0
- package/lib/shared/classes/Mutex.d.ts +19 -0
- package/lib/shared/classes/Mutex.js +69 -0
- package/lib/shared/classes/Mutex.js.map +1 -0
- package/lib/shared/classes/ZACCLError.d.ts +27 -0
- package/lib/shared/classes/ZACCLError.js +48 -0
- package/lib/shared/classes/ZACCLError.js.map +1 -0
- package/lib/shared/constants/DEFAULT_ZOOM_HOSTNAME.d.ts +6 -0
- package/lib/shared/constants/DEFAULT_ZOOM_HOSTNAME.js +9 -0
- package/lib/shared/constants/DEFAULT_ZOOM_HOSTNAME.js.map +1 -0
- package/lib/shared/constants/HARVARD_APIGEE_HOSTNAME_SUFFIX.d.ts +6 -0
- package/lib/shared/constants/HARVARD_APIGEE_HOSTNAME_SUFFIX.js +9 -0
- package/lib/shared/constants/HARVARD_APIGEE_HOSTNAME_SUFFIX.js.map +1 -0
- package/lib/shared/constants/JWT_EXPIRY_SEC.d.ts +6 -0
- package/lib/shared/constants/JWT_EXPIRY_SEC.js +9 -0
- package/lib/shared/constants/JWT_EXPIRY_SEC.js.map +1 -0
- package/lib/shared/constants/ZOOM_HOSTNAME.d.ts +6 -0
- package/lib/shared/constants/ZOOM_HOSTNAME.js +9 -0
- package/lib/shared/constants/ZOOM_HOSTNAME.js.map +1 -0
- package/lib/shared/helpers/genVisitEndpoint.d.ts +10 -0
- package/lib/shared/helpers/genVisitEndpoint.js +159 -0
- package/lib/shared/helpers/genVisitEndpoint.js.map +1 -0
- package/lib/shared/helpers/getCurrentOAuthAccessToken.d.ts +9 -0
- package/lib/shared/helpers/getCurrentOAuthAccessToken.js +144 -0
- package/lib/shared/helpers/getCurrentOAuthAccessToken.js.map +1 -0
- package/lib/shared/helpers/sendRequest.d.ts +32 -0
- package/lib/shared/helpers/sendRequest.js +139 -0
- package/lib/shared/helpers/sendRequest.js.map +1 -0
- package/lib/shared/helpers/sendZoomRequest.d.ts +27 -0
- package/lib/shared/helpers/sendZoomRequest.js +126 -0
- package/lib/shared/helpers/sendZoomRequest.js.map +1 -0
- package/lib/shared/helpers/utils.d.ts +33 -0
- package/lib/shared/helpers/utils.js +80 -0
- package/lib/shared/helpers/utils.js.map +1 -0
- package/lib/shared/interfaces/EndpointCategory.d.ts +18 -0
- package/lib/shared/interfaces/EndpointCategory.js +22 -0
- package/lib/shared/interfaces/EndpointCategory.js.map +1 -0
- package/lib/shared/types/ErrorCode.d.ts +23 -0
- package/lib/shared/types/ErrorCode.js +36 -0
- package/lib/shared/types/ErrorCode.js.map +1 -0
- package/lib/shared/types/InitPack.d.ts +11 -0
- package/lib/shared/types/InitPack.js +3 -0
- package/lib/shared/types/InitPack.js.map +1 -0
- package/lib/shared/types/ThrottleHeader.d.ts +9 -0
- package/lib/shared/types/ThrottleHeader.js +14 -0
- package/lib/shared/types/ThrottleHeader.js.map +1 -0
- package/lib/shared/types/VisitEndpointFunc.d.ts +19 -0
- package/lib/shared/types/VisitEndpointFunc.js +3 -0
- package/lib/shared/types/VisitEndpointFunc.js.map +1 -0
- package/lib/types/ZoomAPI.d.ts +15 -0
- package/lib/types/ZoomAPI.js +4 -0
- package/lib/types/ZoomAPI.js.map +1 -0
- package/lib/types/ZoomAPIConfig.d.ts +21 -0
- package/lib/types/ZoomAPIConfig.js +3 -0
- package/lib/types/ZoomAPIConfig.js.map +1 -0
- package/lib/types/ZoomAPIConfigType.d.ts +10 -0
- package/lib/types/ZoomAPIConfigType.js +17 -0
- package/lib/types/ZoomAPIConfigType.js.map +1 -0
- package/lib/types/ZoomCloudRecording.d.ts +6 -0
- package/lib/types/ZoomCloudRecording.js +3 -0
- package/lib/types/ZoomCloudRecording.js.map +1 -0
- package/lib/types/ZoomFileType.d.ts +15 -0
- package/lib/types/ZoomFileType.js +31 -0
- package/lib/types/ZoomFileType.js.map +1 -0
- package/lib/types/ZoomLoginMethod.d.ts +16 -0
- package/lib/types/ZoomLoginMethod.js +20 -0
- package/lib/types/ZoomLoginMethod.js.map +1 -0
- package/lib/types/ZoomMeeting.d.ts +115 -0
- package/lib/types/ZoomMeeting.js +3 -0
- package/lib/types/ZoomMeeting.js.map +1 -0
- package/lib/types/ZoomMeetingOrWebinarType.d.ts +19 -0
- package/lib/types/ZoomMeetingOrWebinarType.js +23 -0
- package/lib/types/ZoomMeetingOrWebinarType.js.map +1 -0
- package/lib/types/ZoomMeetingRecordings.d.ts +20 -0
- package/lib/types/ZoomMeetingRecordings.js +3 -0
- package/lib/types/ZoomMeetingRecordings.js.map +1 -0
- package/lib/types/ZoomPanelist.d.ts +16 -0
- package/lib/types/ZoomPanelist.js +3 -0
- package/lib/types/ZoomPanelist.js.map +1 -0
- package/lib/types/ZoomRecordingFIle.d.ts +27 -0
- package/lib/types/ZoomRecordingFIle.js +3 -0
- package/lib/types/ZoomRecordingFIle.js.map +1 -0
- package/lib/types/ZoomRecordingType.d.ts +24 -0
- package/lib/types/ZoomRecordingType.js +28 -0
- package/lib/types/ZoomRecordingType.js.map +1 -0
- package/lib/types/ZoomRecurrenceInfo.d.ts +15 -0
- package/lib/types/ZoomRecurrenceInfo.js +3 -0
- package/lib/types/ZoomRecurrenceInfo.js.map +1 -0
- package/lib/types/ZoomUser.d.ts +55 -0
- package/lib/types/ZoomUser.js +3 -0
- package/lib/types/ZoomUser.js.map +1 -0
- package/lib/types/ZoomUserRecording.d.ts +15 -0
- package/lib/types/ZoomUserRecording.js +3 -0
- package/lib/types/ZoomUserRecording.js.map +1 -0
- package/lib/types/ZoomUserRecordings.d.ts +15 -0
- package/lib/types/ZoomUserRecordings.js +3 -0
- package/lib/types/ZoomUserRecordings.js.map +1 -0
- package/lib/types/ZoomWebinar.d.ts +46 -0
- package/lib/types/ZoomWebinar.js +3 -0
- package/lib/types/ZoomWebinar.js.map +1 -0
- package/package.json +21 -17
- package/src/endpoints/ECatCloudRecording.ts +175 -0
- package/src/endpoints/ECatMeeting.ts +321 -0
- package/src/endpoints/ECatUser.ts +208 -0
- package/src/endpoints/ECatWebinar.ts +185 -0
- package/src/index.ts +145 -0
- package/src/shared/classes/Mutex.ts +30 -0
- package/src/shared/classes/ZACCLError.ts +40 -0
- package/src/shared/constants/DEFAULT_ZOOM_HOSTNAME.ts +7 -0
- package/src/shared/constants/HARVARD_APIGEE_HOSTNAME_SUFFIX.ts +7 -0
- package/src/shared/constants/JWT_EXPIRY_SEC.ts +7 -0
- package/src/shared/helpers/genVisitEndpoint.ts +153 -0
- package/src/shared/helpers/getCurrentOAuthAccessToken.ts +106 -0
- package/src/shared/helpers/sendRequest.ts +110 -0
- package/src/shared/helpers/sendZoomRequest.ts +122 -0
- package/src/shared/helpers/utils.ts +82 -0
- package/src/shared/interfaces/EndpointCategory.ts +28 -0
- package/src/shared/types/ErrorCode.ts +41 -0
- package/src/shared/types/InitPack.ts +16 -0
- package/src/shared/types/ThrottleHeader.ts +10 -0
- package/src/shared/types/VisitEndpointFunc.ts +31 -0
- package/src/types/ZoomAPI.ts +17 -0
- package/src/types/ZoomAPIConfig.ts +34 -0
- package/src/types/ZoomAPIConfigType.ts +14 -0
- package/src/types/ZoomFileType.ts +28 -0
- package/src/types/ZoomLoginMethod.ts +17 -0
- package/src/types/ZoomMeeting.ts +315 -0
- package/src/types/ZoomMeetingOrWebinarType.ts +20 -0
- package/src/types/ZoomMeetingRecordings.ts +37 -0
- package/src/types/ZoomPanelist.ts +26 -0
- package/src/types/ZoomRecordingFile.ts +67 -0
- package/src/types/ZoomRecordingType.ts +25 -0
- package/src/types/ZoomRecurrenceInfo.ts +55 -0
- package/src/types/ZoomUser.ts +113 -0
- package/src/types/ZoomUserRecordings.ts +25 -0
- package/src/types/ZoomWebinar.ts +126 -0
- package/tsconfig.json +19 -0
- package/.eslintrc.json +0 -61
- package/API/endpoints/.eslintrc.json +0 -5
- package/API/endpoints/CloudRecording.js +0 -169
- package/API/endpoints/Meeting.js +0 -353
- package/API/endpoints/User.js +0 -217
- package/API/endpoints/Webinar.js +0 -198
- package/API/index.js +0 -264
- package/API/sendZoomRequest.js +0 -97
- package/ERROR_CODES.js +0 -29
- package/EndpointCategory/.eslintrc.json +0 -14
- package/EndpointCategory/helpers/instantiateEndpoint.js +0 -257
- package/EndpointCategory/helpers/utils.js +0 -110
- package/EndpointCategory/index.js +0 -51
- package/ZACCLError.js +0 -14
- package/constants/HARVARD_APIGEE_HOSTNAME_SUFFIX.js +0 -5
- package/constants/THROTTLE.js +0 -9
- package/constants/ZOOM_HOSTNAME.js +0 -5
- package/constants/ZOOM_THROTTLE_LIMIT_RULES.js +0 -45
- package/docs/CloudRecording.js.html +0 -235
- package/docs/Meeting.js.html +0 -419
- package/docs/User.js.html +0 -283
- package/docs/Webinar.js.html +0 -264
- package/helpers/IntervalCaller.js +0 -38
- package/helpers/Mutex.js +0 -24
- package/helpers/TaskQueue.js +0 -242
- package/helpers/Throttle.js +0 -172
- package/helpers/ThrottleMap.js +0 -111
- package/helpers/sendRequest.js +0 -90
- package/helpers/templateToRegExp.js +0 -13
- package/index.js +0 -1
- package/test/.eslintrc.json +0 -9
- package/test/API/endpoints/index.spec.js +0 -326
- package/test/API/helpers/stubAPIRequest.js +0 -36
- package/test/API/helpers/stubZoomRequest.js +0 -97
- package/test/API/helpers/testDailyLimit.js +0 -27
- package/test/API/helpers/testRateLimit.js +0 -27
- package/test/API/index.spec.js +0 -479
- package/test/helpers/TaskQueue.spec.js +0 -143
- package/test/helpers/ThrottleMap.spec.js +0 -153
package/.eslintrc.js
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
const config = {
|
|
2
|
+
extends: [
|
|
3
|
+
'airbnb',
|
|
4
|
+
'airbnb/hooks',
|
|
5
|
+
'react-app',
|
|
6
|
+
'react-app/jest',
|
|
7
|
+
],
|
|
8
|
+
overrides: [
|
|
9
|
+
{
|
|
10
|
+
files: [
|
|
11
|
+
'*.ts',
|
|
12
|
+
'*.tsx',
|
|
13
|
+
],
|
|
14
|
+
extends: [
|
|
15
|
+
'airbnb-typescript',
|
|
16
|
+
],
|
|
17
|
+
parserOptions: {
|
|
18
|
+
project: './tsconfig.json',
|
|
19
|
+
tsconfigRootDir: __dirname,
|
|
20
|
+
sourceType: 'module',
|
|
21
|
+
},
|
|
22
|
+
rules: {
|
|
23
|
+
'@typescript-eslint/lines-between-class-members': 'off',
|
|
24
|
+
'@typescript-eslint/no-unused-expressions': 'off',
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
rules: {
|
|
29
|
+
'arrow-body-style': [
|
|
30
|
+
'warn',
|
|
31
|
+
'always',
|
|
32
|
+
],
|
|
33
|
+
'react/prop-types': 'off',
|
|
34
|
+
'react/function-component-definition': [
|
|
35
|
+
2,
|
|
36
|
+
{
|
|
37
|
+
namedComponents: 'arrow-function',
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
'no-spaced-func': 'off',
|
|
41
|
+
'react-hooks/exhaustive-deps': 'off',
|
|
42
|
+
'lines-between-class-members': 'off',
|
|
43
|
+
'no-case-declarations': 'off',
|
|
44
|
+
'react/require-default-props': 'off',
|
|
45
|
+
'react/react-in-jsx-scope': 'off',
|
|
46
|
+
'arrow-parens': [
|
|
47
|
+
'warn',
|
|
48
|
+
'always',
|
|
49
|
+
],
|
|
50
|
+
'comma-dangle': [
|
|
51
|
+
'error',
|
|
52
|
+
{
|
|
53
|
+
arrays: 'always-multiline',
|
|
54
|
+
objects: 'always-multiline',
|
|
55
|
+
imports: 'always-multiline',
|
|
56
|
+
exports: 'always-multiline',
|
|
57
|
+
functions: 'always-multiline',
|
|
58
|
+
},
|
|
59
|
+
],
|
|
60
|
+
'consistent-return': 'off',
|
|
61
|
+
'id-length': 'off',
|
|
62
|
+
'max-len': [
|
|
63
|
+
'error',
|
|
64
|
+
{
|
|
65
|
+
code: 125,
|
|
66
|
+
ignoreStrings: true,
|
|
67
|
+
ignoreTemplateLiterals: true,
|
|
68
|
+
ignoreUrls: true,
|
|
69
|
+
},
|
|
70
|
+
],
|
|
71
|
+
'newline-per-chained-call': [
|
|
72
|
+
'error',
|
|
73
|
+
{
|
|
74
|
+
ignoreChainWithDepth: 2,
|
|
75
|
+
},
|
|
76
|
+
],
|
|
77
|
+
'no-plusplus': [
|
|
78
|
+
'warn',
|
|
79
|
+
{
|
|
80
|
+
allowForLoopAfterthoughts: true,
|
|
81
|
+
},
|
|
82
|
+
],
|
|
83
|
+
'prefer-template': 1,
|
|
84
|
+
radix: 'error',
|
|
85
|
+
'no-await-in-loop': 'off',
|
|
86
|
+
'max-params': [
|
|
87
|
+
'warn',
|
|
88
|
+
{
|
|
89
|
+
max: 3,
|
|
90
|
+
},
|
|
91
|
+
],
|
|
92
|
+
},
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
module.exports = config;
|
package/docBuilder/DOCS_HOME.md
CHANGED
|
@@ -12,14 +12,50 @@ This project is designed _by_ educators _for_ educators.
|
|
|
12
12
|
</div>
|
|
13
13
|
</h1>
|
|
14
14
|
|
|
15
|
-
## 1. Create an
|
|
15
|
+
## 1. Create an "api" instance
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
const API = require('zaccl/API');
|
|
17
|
+
Independently of the type of credentials you're using, you should include a Zoom hostname as env `ZOOM_HOST` or within the initialization function:
|
|
19
18
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
```ts
|
|
20
|
+
import initZoomAPI from 'zaccl';
|
|
21
|
+
|
|
22
|
+
const api = initZoomAPI({
|
|
23
|
+
zoomHost: 'harvard.zoom.us',
|
|
24
|
+
...
|
|
25
|
+
});
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
If using a valid Zoom token, either include it in env as `ZOOM_TOKEN` or include it when initializing:
|
|
29
|
+
|
|
30
|
+
```ts
|
|
31
|
+
import initZoomAPI from 'zaccl';
|
|
32
|
+
|
|
33
|
+
const api = initZoomAPI({
|
|
34
|
+
token: '<tokenHere>',
|
|
35
|
+
});
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
If using a JWT token, either include the key and secret as env variables `ZOOM_KEY` and `ZOOM_SECRET` or include them when initializing:
|
|
39
|
+
|
|
40
|
+
```ts
|
|
41
|
+
import initZoomAPI from 'zaccl';
|
|
42
|
+
|
|
43
|
+
const api = initZoomAPI({
|
|
44
|
+
key: '<keyHere>',
|
|
45
|
+
secret: '<secretHere>',
|
|
46
|
+
});
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
If using server-to-server OAuth, either include the clientId, clientSecret, and accountId as env variables `ZOOM_CLIENT_ID`, `ZOOM_CLIENT_SECRET`, and `ZOOM_ACCOUNT_ID` or include them when initializing:
|
|
50
|
+
|
|
51
|
+
```ts
|
|
52
|
+
import initZoomAPI from 'zaccl';
|
|
53
|
+
|
|
54
|
+
const api = initZoomAPI({
|
|
55
|
+
zoomHost: 'harvard.zoom.us',
|
|
56
|
+
accountId: '<accountId>',
|
|
57
|
+
clientId: '<clientId>',
|
|
58
|
+
clientSecret: '<clientSecret>',
|
|
23
59
|
});
|
|
24
60
|
```
|
|
25
61
|
|
|
@@ -27,7 +63,7 @@ const api = new API({
|
|
|
27
63
|
|
|
28
64
|
All endpoint functions are asynchronous, so we recommend using async/await syntax:
|
|
29
65
|
|
|
30
|
-
```
|
|
66
|
+
```ts
|
|
31
67
|
const submissions = await api.meeting.create({
|
|
32
68
|
userId: 'someone@example.edu',
|
|
33
69
|
meetingObj: {
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
|
|
5
|
+
<meta charset="utf-8">
|
|
6
|
+
<title>ECatCloudRecording.js - Documentation</title>
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
<script src="scripts/prettify/prettify.js"></script>
|
|
10
|
+
<script src="scripts/prettify/lang-css.js"></script>
|
|
11
|
+
<!--[if lt IE 9]>
|
|
12
|
+
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
|
13
|
+
<![endif]-->
|
|
14
|
+
<link type="text/css" rel="stylesheet" href="styles/prettify.css">
|
|
15
|
+
<link type="text/css" rel="stylesheet" href="styles/jsdoc.css">
|
|
16
|
+
<script src="scripts/nav.js" defer></script>
|
|
17
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
18
|
+
</head>
|
|
19
|
+
<body>
|
|
20
|
+
|
|
21
|
+
<input type="checkbox" id="nav-trigger" class="nav-trigger" />
|
|
22
|
+
<label for="nav-trigger" class="navicon-button x">
|
|
23
|
+
<div class="navicon"></div>
|
|
24
|
+
</label>
|
|
25
|
+
|
|
26
|
+
<label for="nav-trigger" class="overlay"></label>
|
|
27
|
+
|
|
28
|
+
<nav style="border-right: 2px solid #ccc; padding-bottom: 25px;" >
|
|
29
|
+
|
|
30
|
+
<h2><a style="font-size: 30px;" href="index.html">ZACCL API</a></h2><h3>Endpoint Functions</h3><ul><li><a href="api.cloudRecording.html">api.cloudRecording</a><ul class='methods'><li data-type='method'><a href="api.cloudRecording.html#listMeetingRecordings">listMeetingRecordings</a></li><li data-type='method'><a href="api.cloudRecording.html#listUserRecordings">listUserRecordings</a></li></ul></li><li><a href="api.meeting.html">api.meeting</a><ul class='methods'><li data-type='method'><a href="api.meeting.html#addAltHost">addAltHost</a></li><li data-type='method'><a href="api.meeting.html#create">create</a></li><li data-type='method'><a href="api.meeting.html#delete">delete</a></li><li data-type='method'><a href="api.meeting.html#get">get</a></li><li data-type='method'><a href="api.meeting.html#listPastInstances">listPastInstances</a></li><li data-type='method'><a href="api.meeting.html#update">update</a></li></ul></li><li><a href="api.user.html">api.user</a><ul class='methods'><li data-type='method'><a href="api.user.html#activate">activate</a></li><li data-type='method'><a href="api.user.html#addWebinarLicense">addWebinarLicense</a></li><li data-type='method'><a href="api.user.html#get">get</a></li><li data-type='method'><a href="api.user.html#getZAKToken">getZAKToken</a></li><li data-type='method'><a href="api.user.html#promoteToLicensed">promoteToLicensed</a></li></ul></li><li><a href="api.webinar.html">api.webinar</a><ul class='methods'><li data-type='method'><a href="api.webinar.html#addPanelist">addPanelist</a></li><li data-type='method'><a href="api.webinar.html#create">create</a></li><li data-type='method'><a href="api.webinar.html#get">get</a></li><li data-type='method'><a href="api.webinar.html#listPanelists">listPanelists</a></li></ul></li></ul>
|
|
31
|
+
</nav>
|
|
32
|
+
|
|
33
|
+
<div id="main">
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
<section>
|
|
41
|
+
<article>
|
|
42
|
+
<pre class="prettyprint source linenums"><code>"use strict";
|
|
43
|
+
/**
|
|
44
|
+
* Category of endpoints for Zoom cloud recordings
|
|
45
|
+
* @author Gabe Abrams
|
|
46
|
+
* @author Aryan Pandey
|
|
47
|
+
* @namespace api.cloudRecording
|
|
48
|
+
*/
|
|
49
|
+
var __extends = (this && this.__extends) || (function () {
|
|
50
|
+
var extendStatics = function (d, b) {
|
|
51
|
+
extendStatics = Object.setPrototypeOf ||
|
|
52
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
53
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
54
|
+
return extendStatics(d, b);
|
|
55
|
+
};
|
|
56
|
+
return function (d, b) {
|
|
57
|
+
if (typeof b !== "function" && b !== null)
|
|
58
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
59
|
+
extendStatics(d, b);
|
|
60
|
+
function __() { this.constructor = d; }
|
|
61
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
62
|
+
};
|
|
63
|
+
})();
|
|
64
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
65
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
66
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
67
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
68
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
69
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
70
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
71
|
+
});
|
|
72
|
+
};
|
|
73
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
74
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
75
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
76
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
77
|
+
function step(op) {
|
|
78
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
79
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
80
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
81
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
82
|
+
switch (op[0]) {
|
|
83
|
+
case 0: case 1: t = op; break;
|
|
84
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
85
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
86
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
87
|
+
default:
|
|
88
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
89
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
90
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
91
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
92
|
+
if (t[2]) _.ops.pop();
|
|
93
|
+
_.trys.pop(); continue;
|
|
94
|
+
}
|
|
95
|
+
op = body.call(thisArg, _);
|
|
96
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
97
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
101
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
102
|
+
};
|
|
103
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
104
|
+
// Import shared interfaces
|
|
105
|
+
var EndpointCategory_1 = __importDefault(require("../shared/interfaces/EndpointCategory"));
|
|
106
|
+
// Import shared classes
|
|
107
|
+
var ZACCLError_1 = __importDefault(require("../shared/classes/ZACCLError"));
|
|
108
|
+
var ErrorCode_1 = __importDefault(require("../shared/types/ErrorCode"));
|
|
109
|
+
// Import shared helper
|
|
110
|
+
var utils_1 = require("../shared/helpers/utils");
|
|
111
|
+
var ECatCloudRecording = /** @class */ (function (_super) {
|
|
112
|
+
__extends(ECatCloudRecording, _super);
|
|
113
|
+
function ECatCloudRecording() {
|
|
114
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Get all recordings of a meeting
|
|
118
|
+
* @author Aryan Pandey
|
|
119
|
+
* @instance
|
|
120
|
+
* @memberof api.cloudRecording
|
|
121
|
+
* @method listMeetingRecordings
|
|
122
|
+
* @param opts object containing all arguments
|
|
123
|
+
* @param options.meetingId the Zoom meeting ID or UUID
|
|
124
|
+
* @returns list of Zoom meeting recording objects {@link https://marketplace.zoom.us/docs/api-reference/zoom-api/cloud-recording/recordingget#responses}
|
|
125
|
+
*/
|
|
126
|
+
ECatCloudRecording.prototype.listMeetingRecordings = function (opts) {
|
|
127
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
128
|
+
return __generator(this, function (_a) {
|
|
129
|
+
// Check if required param is present
|
|
130
|
+
if (!opts.meetingId) {
|
|
131
|
+
throw new ZACCLError_1.default({
|
|
132
|
+
message: 'Meeting ID is a required parameter',
|
|
133
|
+
code: ErrorCode_1.default.InvalidMeetingId,
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
return [2 /*return*/, this.visitEndpoint({
|
|
137
|
+
// Call function on meetingId to handle double encoding if necessary
|
|
138
|
+
path: "/meetings/".concat((0, utils_1.doubleEncode)(String(opts.meetingId)), "/recordings"),
|
|
139
|
+
method: 'GET',
|
|
140
|
+
action: 'get all recordings of a meeting',
|
|
141
|
+
errorMap: {
|
|
142
|
+
400: {
|
|
143
|
+
1010: 'We could not find the user on this account',
|
|
144
|
+
},
|
|
145
|
+
404: {
|
|
146
|
+
1001: 'We could not find that user',
|
|
147
|
+
3301: "There are no recordings for the meeting ".concat(opts.meetingId),
|
|
148
|
+
},
|
|
149
|
+
},
|
|
150
|
+
})];
|
|
151
|
+
});
|
|
152
|
+
});
|
|
153
|
+
};
|
|
154
|
+
/**
|
|
155
|
+
* List all cloud recordings of a user
|
|
156
|
+
* @author Aryan Pandey
|
|
157
|
+
* @instance
|
|
158
|
+
* @memberof api.cloudRecording
|
|
159
|
+
* @method listUserRecordings
|
|
160
|
+
* @param opts object containing all arguments
|
|
161
|
+
* @param opts.userId the user ID or email address of the user
|
|
162
|
+
* @param [opts.pageSize=300] number of records
|
|
163
|
+
* returned from a single API call
|
|
164
|
+
* @param [opts.nextPageToken] token used to pageinate
|
|
165
|
+
* through large result sets
|
|
166
|
+
* @param [opts.searchTrash=false] set to true to retrieve
|
|
167
|
+
* meeting recordings from the trash.
|
|
168
|
+
* @param [opts.startDate=1 month before today]
|
|
169
|
+
* string accepted by JS Date constructor or instance of Date object.
|
|
170
|
+
* Date needs to be within past 6 months. Time data (hours and seconds)
|
|
171
|
+
* is discarded
|
|
172
|
+
* @param [opts.endDate] string accepted by JS Date
|
|
173
|
+
* constructor or instance of Date object.
|
|
174
|
+
* Date needs to be within past 6 months. Time data (hours and seconds)
|
|
175
|
+
* is discarded
|
|
176
|
+
* @returns List of Zoom Recordings {@link https://marketplace.zoom.us/docs/api-reference/zoom-api/cloud-recording/recordingslist#responses}
|
|
177
|
+
*/
|
|
178
|
+
ECatCloudRecording.prototype.listUserRecordings = function (opts) {
|
|
179
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
180
|
+
var userId, searchTrash, nextPageToken, startDate, endDate, pageSize, defaultDate, params;
|
|
181
|
+
return __generator(this, function (_a) {
|
|
182
|
+
userId = opts.userId, searchTrash = opts.searchTrash, nextPageToken = opts.nextPageToken, startDate = opts.startDate, endDate = opts.endDate, pageSize = opts.pageSize;
|
|
183
|
+
defaultDate = new Date();
|
|
184
|
+
defaultDate.setMonth(defaultDate.getMonth() - 1);
|
|
185
|
+
params = {
|
|
186
|
+
page_size: 300,
|
|
187
|
+
trash: !!searchTrash,
|
|
188
|
+
from: (0, utils_1.formatDate)(defaultDate, 'startDate'),
|
|
189
|
+
};
|
|
190
|
+
if (pageSize) {
|
|
191
|
+
// Throw error if pageSize is over max val of 300
|
|
192
|
+
if (pageSize > 300) {
|
|
193
|
+
throw new ZACCLError_1.default({
|
|
194
|
+
message: "We requested ".concat(pageSize, " recordings from Zoom but it can only give us 300 at a time"),
|
|
195
|
+
code: ErrorCode_1.default.InvalidPageSize,
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
params.page_size = pageSize;
|
|
199
|
+
}
|
|
200
|
+
if (startDate) {
|
|
201
|
+
params.from = (0, utils_1.formatDate)(startDate, 'startDate');
|
|
202
|
+
}
|
|
203
|
+
if (endDate) {
|
|
204
|
+
params.to = (0, utils_1.formatDate)(endDate, 'endDate');
|
|
205
|
+
}
|
|
206
|
+
if (nextPageToken) {
|
|
207
|
+
params.next_page_token = nextPageToken;
|
|
208
|
+
}
|
|
209
|
+
return [2 /*return*/, this.visitEndpoint({
|
|
210
|
+
path: "/users/".concat(userId, "/recordings"),
|
|
211
|
+
action: 'list all cloud recordings of a user',
|
|
212
|
+
method: 'GET',
|
|
213
|
+
params: params,
|
|
214
|
+
postProcessor: function (response) {
|
|
215
|
+
// Extract the recordings from the body
|
|
216
|
+
var newResponse = response;
|
|
217
|
+
newResponse.body = response.body.meetings;
|
|
218
|
+
return newResponse;
|
|
219
|
+
},
|
|
220
|
+
errorMap: {
|
|
221
|
+
404: {
|
|
222
|
+
1001: "We could not find the Zoom user ".concat(userId, " on this account"),
|
|
223
|
+
},
|
|
224
|
+
},
|
|
225
|
+
})];
|
|
226
|
+
});
|
|
227
|
+
});
|
|
228
|
+
};
|
|
229
|
+
;
|
|
230
|
+
return ECatCloudRecording;
|
|
231
|
+
}(EndpointCategory_1.default));
|
|
232
|
+
/*------------------------------------------------------------------------*/
|
|
233
|
+
/* Export */
|
|
234
|
+
/*------------------------------------------------------------------------*/
|
|
235
|
+
exports.default = ECatCloudRecording;
|
|
236
|
+
//# sourceMappingURL=ECatCloudRecording.js.map</code></pre>
|
|
237
|
+
</article>
|
|
238
|
+
</section>
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
</div>
|
|
246
|
+
|
|
247
|
+
<br class="clear">
|
|
248
|
+
|
|
249
|
+
<footer>
|
|
250
|
+
We use <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> and the <a href="https://github.com/clenemt/docdash">docdash</a> theme to generate our docs.
|
|
251
|
+
</footer>
|
|
252
|
+
|
|
253
|
+
<script>prettyPrint();</script>
|
|
254
|
+
<script src="scripts/polyfill.js"></script>
|
|
255
|
+
<script src="scripts/linenumber.js"></script>
|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
</body>
|
|
260
|
+
</html>
|