Compare commits

..

No commits in common. "master" and "develop" have entirely different histories.

2 changed files with 18 additions and 22 deletions

View File

@ -8,15 +8,14 @@
# Required API endpoint/authentication variables # Required API endpoint/authentication variables
SONAR_URL=https://instance.sonar.software/api/graphql SONAR_URL=https://instance.sonar.software/api/graphql
SONAR_TOKEN= SONAR_TOKEN=
RINGCENTRAL_CLIENT_ID= RC_APP_KEY=
RINGCENTRAL_CLIENT_SECRET= RC_APP_SECRET=
RINGCENTRAL_USERNAME= RC_LOGIN_USERNAME=
RINGCENTRAL_EXTENSION= RC_LOGIN_EXT=
RINGCENTRAL_PASSWORD= RC_LOGIN_PASSWORD=
# Set to 'sandbox' to use RingCentral's sandbox API # Set to any value to enable use of RingCentral's sandbox API
# Any other value will result in using RingCentral's production API RC_SANDBOX=
RINGCENTRAL_SERVER=production
# The database to use # The database to use
# valid options: pg, sqlite # valid options: pg, sqlite

View File

@ -9,11 +9,11 @@ function checkEnv() {
[ [
"SONAR_URL", "SONAR_URL",
"SONAR_TOKEN", "SONAR_TOKEN",
"RINGCENTRAL_CLIENT_ID", "RC_APP_KEY",
"RINGCENTRAL_CLIENT_SECRET", "RC_APP_SECRET",
"RINGCENTRAL_USERNAME", "RC_LOGIN_USERNAME",
"RINGCENTRAL_EXTENSION", "RC_LOGIN_EXT",
"RINGCENTRAL_PASSWORD", "RC_LOGIN_PASSWORD",
"EXTENSION_TICKET_GROUPS", "EXTENSION_TICKET_GROUPS",
].forEach((env) => { ].forEach((env) => {
if (process.env[env] === undefined) { if (process.env[env] === undefined) {
@ -65,19 +65,16 @@ async function initSonar() {
async function initRingCentralSDK() { async function initRingCentralSDK() {
const sdk = new SDK({ const sdk = new SDK({
server: server: SDK.server[process.env.RC_SANDBOX ? "sandbox" : "production"],
SDK.server[ clientId: process.env.RC_APP_KEY,
process.env.RINGCENTRAL_SERVER === "sandbox" ? "sandbox" : "production" clientSecret: process.env.RC_APP_SECRET,
],
clientId: process.env.RINGCENTRAL_CLIENT_ID,
clientSecret: process.env.RINGCENTRAL_CLIENT_SECRET,
}); });
const login = () => const login = () =>
sdk.login({ sdk.login({
username: process.env.RINGCENTRAL_USERNAME, username: process.env.RC_LOGIN_USERNAME,
extension: process.env.RINGCENTRAL_EXTENSION, extension: process.env.RC_LOGIN_EXT,
password: process.env.RINGCENTRAL_PASSWORD, password: process.env.RC_LOGIN_PASSWORD,
}); });
if (DEBUG) { if (DEBUG) {