Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
261 changes: 247 additions & 14 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions packages/zoom/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ZOOM_CLIENT_ID=""
ZOOM_CLIENT_SECRET=""
REDIRECT_URI=http://localhost:3000/redirect
6 changes: 3 additions & 3 deletions packages/zoom/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# zoom
# Zoom

This is the API Module for zoom that allows the [Frigg](https://friggframework.org) code to talk to the zoom API.
This is the API Module for Zoom that allows the [Frigg](https://friggframework.org) code to talk to the Zoom API.

Read more on the [Frigg documentation site](https://docs.friggframework.org/api-modules/list/zoom
Read more on the [Frigg documentation site](https://docs.friggframework.org/api-modules/list/zoom)
17 changes: 13 additions & 4 deletions packages/zoom/api.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const {get, OAuth2Requester} = require('@friggframework/core');
const moment = require('moment');

class Api extends OAuth2Requester {
constructor(params) {
Expand All @@ -8,22 +7,33 @@ class Api extends OAuth2Requester {
this.baseUrl = `https://api.zoom.us/v2/`;
this.client_id = process.env.ZOOM_CLIENT_ID;
this.client_secret = process.env.ZOOM_CLIENT_SECRET;
this.redirect_uri = 'https://29a3f7035dbb.ngrok.io';

this.authorizationUri = encodeURI(
`https://zoom.us/oauth/authorize?client_id=${this.client_id}&response_type=code&redirect_uri=${this.redirect_uri}`
);

this.URLs = {
user: 'users/me',
}

this.tokenUri = `https://zoom.us/oauth/token`;

this.access_token = get(params, 'access_token', null);
this.refresh_token = get(params, 'refresh_token', null);
}

async getTokenFromCode(code) {
delete this.access_token;
return await this.getTokenFromCodeBasicAuthHeader(code);
}

async getUserDetails() {
const options = {
url: this.baseUrl + this.URLs.user,
}
return this._get(options);
}

async getUserList() {
console.log('getUserList');
let options = {
Expand Down Expand Up @@ -67,8 +77,7 @@ class Api extends OAuth2Requester {
async createNewMeeting(userId, topic) {
console.log('createNewMeeting');
let url = `users/${userId}/meetings`;
let time = moment().format();
let startTime = time.slice(0, -6) + 'Z';
let startTime = new Date().toISOString();
let body = {
topic: topic,
type: 2,
Expand Down
Loading