@app-connect/core 1.7.0-beta.2 → 1.7.0-beta.4
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/handlers/admin.js +10 -0
- package/handlers/auth.js +3 -0
- package/handlers/user.js +0 -1
- package/index.js +2 -0
- package/lib/callLogComposer.js +10 -3
- package/lib/oauth.js +1 -1
- package/package.json +1 -1
- package/releaseNotes.json +24 -0
package/handlers/admin.js
CHANGED
|
@@ -73,6 +73,11 @@ async function updateServerLoggingSettings({ user, additionalFieldValues }) {
|
|
|
73
73
|
|
|
74
74
|
async function getAdminReport({ rcAccountId, timezone, timeFrom, timeTo }) {
|
|
75
75
|
try {
|
|
76
|
+
if (!process.env.RINGCENTRAL_SERVER || !process.env.RINGCENTRAL_CLIENT_ID || !process.env.RINGCENTRAL_CLIENT_SECRET) {
|
|
77
|
+
return {
|
|
78
|
+
callLogStats: {}
|
|
79
|
+
};
|
|
80
|
+
}
|
|
76
81
|
const rcSDK = new RingCentral({
|
|
77
82
|
server: process.env.RINGCENTRAL_SERVER,
|
|
78
83
|
clientId: process.env.RINGCENTRAL_CLIENT_ID,
|
|
@@ -127,6 +132,11 @@ async function getAdminReport({ rcAccountId, timezone, timeFrom, timeTo }) {
|
|
|
127
132
|
|
|
128
133
|
async function getUserReport({ rcAccountId, rcExtensionId, timezone, timeFrom, timeTo }) {
|
|
129
134
|
try {
|
|
135
|
+
if (!process.env.RINGCENTRAL_SERVER || !process.env.RINGCENTRAL_CLIENT_ID || !process.env.RINGCENTRAL_CLIENT_SECRET) {
|
|
136
|
+
return {
|
|
137
|
+
callLogStats: {}
|
|
138
|
+
};
|
|
139
|
+
}
|
|
130
140
|
const rcSDK = new RingCentral({
|
|
131
141
|
server: process.env.RINGCENTRAL_SERVER,
|
|
132
142
|
clientId: process.env.RINGCENTRAL_CLIENT_ID,
|
package/handlers/auth.js
CHANGED
|
@@ -209,6 +209,9 @@ async function authValidation({ platform, userId }) {
|
|
|
209
209
|
|
|
210
210
|
// Ringcentral
|
|
211
211
|
async function onRingcentralOAuthCallback({ code, rcAccountId }) {
|
|
212
|
+
if (!process.env.RINGCENTRAL_SERVER || !process.env.RINGCENTRAL_CLIENT_ID || !process.env.RINGCENTRAL_CLIENT_SECRET) {
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
212
215
|
const rcSDK = new RingCentral({
|
|
213
216
|
server: process.env.RINGCENTRAL_SERVER,
|
|
214
217
|
clientId: process.env.RINGCENTRAL_CLIENT_ID,
|
package/handlers/user.js
CHANGED
|
@@ -20,7 +20,6 @@ async function getUserSettingsByAdmin({ rcAccessToken, rcAccountId }) {
|
|
|
20
20
|
}
|
|
21
21
|
const adminConfig = await AdminConfigModel.findByPk(hashedRcAccountId);
|
|
22
22
|
return {
|
|
23
|
-
customManifestUrl: adminConfig?.customAdapter,
|
|
24
23
|
userSettings: adminConfig?.userSettings
|
|
25
24
|
};
|
|
26
25
|
}
|
package/index.js
CHANGED
|
@@ -87,6 +87,7 @@ function createCoreRouter() {
|
|
|
87
87
|
res.json(mergedReleaseNotes);
|
|
88
88
|
});
|
|
89
89
|
|
|
90
|
+
// Obsolete
|
|
90
91
|
router.get('/crmManifest', (req, res) => {
|
|
91
92
|
try {
|
|
92
93
|
const platformName = req.query.platformName || 'default';
|
|
@@ -235,6 +236,7 @@ function createCoreRouter() {
|
|
|
235
236
|
});
|
|
236
237
|
});
|
|
237
238
|
|
|
239
|
+
// Obsolete
|
|
238
240
|
router.get('/serverVersionInfo', (req, res) => {
|
|
239
241
|
const defaultCrmManifest = adapterRegistry.getManifest('default');
|
|
240
242
|
res.send({ version: defaultCrmManifest?.version ?? 'unknown' });
|
package/lib/callLogComposer.js
CHANGED
|
@@ -621,9 +621,16 @@ function upsertLegs({ body, legs, logFormat }) {
|
|
|
621
621
|
* @returns {string} Format type
|
|
622
622
|
*/
|
|
623
623
|
function getLogFormatType(platform) {
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
624
|
+
if(process.env.LOG_FORMAT_PLAIN_TEXT_PLATFORMS.split(',').includes(platform)){
|
|
625
|
+
return LOG_DETAILS_FORMAT_TYPE.PLAIN_TEXT;
|
|
626
|
+
}
|
|
627
|
+
if(process.env.LOG_FORMAT_HTML_PLATFORMS.split(',').includes(platform)){
|
|
628
|
+
return LOG_DETAILS_FORMAT_TYPE.HTML;
|
|
629
|
+
}
|
|
630
|
+
if(process.env.LOG_FORMAT_MARKDOWN_PLATFORMS.split(',').includes(platform)){
|
|
631
|
+
return LOG_DETAILS_FORMAT_TYPE.MARKDOWN;
|
|
632
|
+
}
|
|
633
|
+
return LOG_DETAILS_FORMAT_TYPE.PLAIN_TEXT;
|
|
627
634
|
}
|
|
628
635
|
|
|
629
636
|
module.exports = {
|
package/lib/oauth.js
CHANGED
|
@@ -33,7 +33,7 @@ async function checkAndRefreshAccessToken(oauthApp, user, tokenLockTimeout = 20)
|
|
|
33
33
|
// Other CRMs - check if token will expire within the buffer time
|
|
34
34
|
if (user && user.accessToken && user.refreshToken && tokenExpiry.isBefore(now.clone().add(expiryBuffer, 'minutes'))) {
|
|
35
35
|
// case: use dynamoDB to manage token refresh lock
|
|
36
|
-
if (
|
|
36
|
+
if (process.env.USE_TOKEN_REFRESH_LOCK_PLATFORMS.split(',').includes(user.platform)) {
|
|
37
37
|
let newLock;
|
|
38
38
|
const { Lock } = require('../models/dynamo/lockSchema');
|
|
39
39
|
// Try to atomically create lock only if it doesn't exist
|
package/package.json
CHANGED
package/releaseNotes.json
CHANGED
|
@@ -1,4 +1,28 @@
|
|
|
1
1
|
{
|
|
2
|
+
"1.6.9": {
|
|
3
|
+
"global": [
|
|
4
|
+
{
|
|
5
|
+
"type": "New",
|
|
6
|
+
"description": "- Server-side logging now supports multiple RingCentral users to be mapped under one CRM user"
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
"type": "Fix",
|
|
10
|
+
"description": "- Server-side logging user mapping not working properly when running under multi-site scenarios"
|
|
11
|
+
}
|
|
12
|
+
]
|
|
13
|
+
},
|
|
14
|
+
"1.6.8": {
|
|
15
|
+
"global": [
|
|
16
|
+
{
|
|
17
|
+
"type": "Fix",
|
|
18
|
+
"description": "- Server-side logging, if it's created by one admin, the other admin will be able to see its status"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"type": "Fix",
|
|
22
|
+
"description": "- Conference calls show wrong warning message"
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
},
|
|
2
26
|
"1.6.7": {
|
|
3
27
|
"global": [
|
|
4
28
|
{
|