Skip to content

Commit 97c585a

Browse files
authored
sync features and bugfixs from 7698f10 (#1606)
* sync features and bugfixs from 7698f10 * remove unused file
1 parent 658ef77 commit 97c585a

File tree

1,233 files changed

+27587
-18983
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,233 files changed

+27587
-18983
lines changed

.sync

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
ac165a0f343a29ede4aad1fb555aff401f3dfea7
1+
7698f1018c89580fc352022f2b6da694f5533b77
Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
const plugins = [
2+
[
3+
'@babel/plugin-proposal-decorators',
4+
{
5+
legacy: true,
6+
},
7+
],
8+
'@babel/plugin-proposal-function-bind',
9+
[
10+
'@babel/plugin-proposal-class-properties',
11+
{
12+
loose: true,
13+
},
14+
],
15+
'@babel/plugin-proposal-export-default-from',
16+
'@babel/plugin-proposal-export-namespace-from',
17+
'@babel/plugin-proposal-object-rest-spread',
18+
];
19+
120
module.exports = function baseBabelConfig(api) {
221
api.cache(true);
322
return {
@@ -18,23 +37,6 @@ module.exports = function baseBabelConfig(api) {
1837
},
1938
],
2039
],
21-
plugins: [
22-
[
23-
'@babel/plugin-proposal-decorators',
24-
{
25-
legacy: true,
26-
},
27-
],
28-
'@babel/plugin-proposal-function-bind',
29-
[
30-
'@babel/plugin-proposal-class-properties',
31-
{
32-
loose: true,
33-
},
34-
],
35-
'@babel/plugin-proposal-export-default-from',
36-
'@babel/plugin-proposal-export-namespace-from',
37-
'@babel/plugin-proposal-object-rest-spread',
38-
],
40+
plugins,
3941
};
4042
};

packages/eslint-settings/.eslintrc.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ module.exports = {
121121
{ declaration: false, assignment: false },
122122
],
123123
'react/jsx-one-expression-per-line': 0,
124+
camelcase: 0,
124125
},
125126
overrides: [
126127
{
@@ -177,6 +178,7 @@ module.exports = {
177178
'object-shorthand': [2, 'always'],
178179
'no-unused-vars': 0,
179180
'@typescript-eslint/no-unused-vars': 1,
181+
'import/export': 0,
180182
},
181183
},
182184
],

packages/glip-widgets/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
},
2121
"homepage": "https://github.com/ringcentral/ringcentral-js-widgets#readme",
2222
"peerDependencies": {
23-
"react": "^16.8.6",
24-
"react-dom": "^16.8.6",
23+
"react": "^16.11.0",
24+
"react-dom": "^16.11.0",
2525
"react-redux": "^5.1.1",
2626
"react-router": "^3.0.0",
2727
"react-router-redux": "^4.0.7",
@@ -34,7 +34,7 @@
3434
"@ringcentral-integration/locale-settings": "*",
3535
"autoprefixer": "^9.6.1",
3636
"execa": "^1.0.0",
37-
"fs-extra": "^7.0.1",
37+
"fs-extra": "^8.1.0",
3838
"gulp": "^4.0.2",
3939
"gulp-babel": "^8.0.0",
4040
"gulp-istanbul": "^1.1.1",

packages/i18n/index.d.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
export declare const DEFAULT_LOCALE = "en-US";
2-
export declare const PSEUDO_LOCALE = "en-ZZ";
1+
export declare const DEFAULT_LOCALE = 'en-US';
2+
export declare const PSEUDO_LOCALE = 'en-ZZ';
33
export declare const RUNTIME: {
4-
locale: string;
5-
defaultLocale: string;
6-
instances: Set<any>;
7-
padRatio: number;
4+
locale: string;
5+
defaultLocale: string;
6+
instances: Set<any>;
7+
padRatio: number;
88
};
99
declare function setLocale(locale: any): Promise<void>;
1010
export default class I18n {
11-
_loadLocale: any;
12-
_cache: any;
13-
constructor(loadLocale: any);
14-
_load(locale: any): Promise<void>;
15-
load(): Promise<void>;
16-
_getString(key: any, locale: any): any;
17-
getString(key: any, locale?: string): any;
18-
readonly currentLocale: string;
19-
readonly setLocale: typeof setLocale;
11+
_loadLocale: any;
12+
_cache: any;
13+
constructor(loadLocale: any);
14+
_load(locale: any): Promise<void>;
15+
load(): Promise<void>;
16+
_getString(key: any, locale: any): any;
17+
getString(key: any, locale?: string): any;
18+
readonly currentLocale: string;
19+
static readonly setLocale: typeof setLocale;
2020
}
2121
export {};

packages/i18n/lib/toPseudoString/index.d.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,20 @@ export declare const charMap: {
5454
};
5555
export declare function toAccentString(str: string): string;
5656
export declare function processVars(str: string): string;
57-
export declare function padString({ str, padRatio, padChar }?: {
57+
export declare function padString({
58+
str,
59+
padRatio,
60+
padChar,
61+
}?: {
5862
str?: string;
5963
padRatio?: number;
6064
padChar?: string;
6165
}): string;
62-
export default function toPseudoString({ str, padRatio, padChar }: {
66+
export default function toPseudoString({
67+
str,
68+
padRatio,
69+
padChar,
70+
}: {
6371
str: any;
6472
padRatio: any;
6573
padChar: any;

packages/i18n/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"@ringcentral-integration/babel-settings": "*",
2222
"babel-jest": "^24.8.0",
2323
"faker": "^4.1.0",
24-
"fs-extra": "^7.0.1",
24+
"fs-extra": "^8.1.0",
2525
"gulp": "^4.0.2",
2626
"gulp-babel": "^8.0.0",
2727
"gulp-sourcemaps": "^2.6.5",

packages/locale-loader/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"@babel/parser": "^7.6.0",
3939
"chalk": "^2.4.1",
4040
"dedent": "^0.7.0",
41-
"fs-extra": "^7.0.1",
41+
"fs-extra": "^8.1.0",
4242
"glob": "^7.1.2",
4343
"inquirer": "^6.0.0",
4444
"loader-utils": "^1.1.0",

packages/phone-number/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"devDependencies": {
2323
"@ringcentral-integration/babel-settings": "*",
2424
"babel-jest": "^24.8.0",
25-
"fs-extra": "^7.0.1",
25+
"fs-extra": "^8.1.0",
2626
"gulp": "^4.0.2",
2727
"gulp-babel": "^8.0.0",
2828
"gulp-sourcemaps": "^2.6.5",

packages/ringcentral-integration/enums/callDirections.js

Lines changed: 0 additions & 6 deletions
This file was deleted.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { createHashMap } from '../lib/HashMap';
2+
3+
const callDirection = createHashMap({
4+
inbound: 'Inbound',
5+
outbound: 'Outbound',
6+
});
7+
8+
export default callDirection;
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import Enum from 'ringcentral-integration/lib/Enum';
2+
3+
export default new Enum(
4+
['loggedSuccess', 'loggedFailure'],
5+
'conversationLogStatus',
6+
);

packages/ringcentral-integration/enums/messageTypes.js

Lines changed: 0 additions & 10 deletions
This file was deleted.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { createHashMap } from '../lib/HashMap';
2+
3+
const messageTypes = createHashMap({
4+
all: 'All',
5+
fax: 'Fax',
6+
sms: 'SMS',
7+
voiceMail: 'VoiceMail',
8+
pager: 'Pager',
9+
text: 'Text',
10+
});
11+
12+
export default messageTypes;
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
import HashMap from '../lib/HashMap';
1+
import { createHashMap } from '../lib/HashMap';
22

3-
export default new HashMap({
3+
const telephonyStatus = createHashMap({
44
noCall: 'NoCall',
55
onHold: 'OnHold',
66
ringing: 'Ringing',
77
callConnected: 'CallConnected',
88
parkedCall: 'ParkedCall',
99
});
10+
11+
export default telephonyStatus;

packages/ringcentral-integration/helpers/meetingHelper.ts

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import format, {
22
formatTypes,
33
} from '@ringcentral-integration/phone-number/lib/format';
44

5-
export function getMobileDialingNumberTpl(dialInNumbers, meetingId) {
5+
function getMobileDialingNumberTpl(dialInNumbers, meetingId) {
66
return dialInNumbers
77
.map(
88
({ phoneNumber, location = '' }) =>
@@ -11,7 +11,7 @@ export function getMobileDialingNumberTpl(dialInNumbers, meetingId) {
1111
.join('\n ');
1212
}
1313

14-
export function getPhoneDialingNumberTpl(dialInNumbers) {
14+
function getPhoneDialingNumberTpl(dialInNumbers) {
1515
return dialInNumbers
1616
.map(({ phoneNumber, location = '', country }) => {
1717
const filterFormattedNumber = format({
@@ -24,14 +24,14 @@ export function getPhoneDialingNumberTpl(dialInNumbers) {
2424
.join('\n ');
2525
}
2626

27-
export const UTC_TIMEZONE_ID = '1';
28-
export const MeetingType = {
27+
const UTC_TIMEZONE_ID = '1';
28+
const MeetingType = {
2929
SCHEDULED: 'Scheduled',
3030
RECURRING: 'Recurring',
3131
INSTANT: 'Instant',
3232
};
3333

34-
export function getMeetingSettings({
34+
function getMeetingSettings({
3535
extensionName,
3636
startTime,
3737
durationInMinutes = 60,
@@ -59,7 +59,7 @@ export function getMeetingSettings({
5959
}
6060

6161
// Basic default meeting type information
62-
export function getDefaultMeetingSettings(extensionName, startTime) {
62+
function getDefaultMeetingSettings(extensionName, startTime) {
6363
return {
6464
topic: `${extensionName}'s Meeting`,
6565
meetingType: MeetingType.SCHEDULED,
@@ -85,8 +85,18 @@ export function getDefaultMeetingSettings(extensionName, startTime) {
8585
};
8686
}
8787

88-
export function getInitializedStartTime() {
88+
function getInitializedStartTime() {
8989
const now = new Date();
9090
const startTime = now.setHours(now.getHours() + 1, 0, 0);
9191
return startTime;
9292
}
93+
94+
export {
95+
getMobileDialingNumberTpl,
96+
getPhoneDialingNumberTpl,
97+
UTC_TIMEZONE_ID,
98+
MeetingType,
99+
getMeetingSettings,
100+
getDefaultMeetingSettings,
101+
getInitializedStartTime,
102+
};

packages/ringcentral-integration/lib/HashMap/index.d.ts

Lines changed: 0 additions & 11 deletions
This file was deleted.

packages/ringcentral-integration/lib/HashMap/index.js renamed to packages/ringcentral-integration/lib/HashMap/index.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export default class HashMap {
2020

2121
for (const key in definition) {
2222
/* istanbul ignore else */
23-
if (definition::Object.prototype.hasOwnProperty(key)) {
23+
if (Object.prototype.hasOwnProperty.call(definition, key)) {
2424
Object.defineProperty(this, key, {
2525
get() {
2626
return this[sDefinition][key];
@@ -32,12 +32,15 @@ export default class HashMap {
3232
}
3333
Object.freeze(this);
3434
}
35+
3536
static getKey(map, value) {
3637
return map[sValueMap].get(value);
3738
}
39+
3840
static hasValue(map, value) {
3941
return map[sValueMap].has(value);
4042
}
43+
4144
static fromSet({
4245
set,
4346
getKey = defaultGetFunction,
@@ -54,3 +57,9 @@ export default class HashMap {
5457
return new HashMap(definition);
5558
}
5659
}
60+
61+
export function createHashMap<V extends string, P>(
62+
definition: { [K in V]: string },
63+
): { [K in V]: string } & { [K in keyof P]: string } {
64+
return new HashMap(definition) as any;
65+
}

packages/ringcentral-integration/lib/MessageTransport/index.js renamed to packages/ringcentral-integration/lib/MessageTransport/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,9 @@ export default class MessageTransport extends TransportBase {
8585
}
8686
}
8787

88-
async request({ payload }) {
88+
async request<T = any>({ payload }) {
8989
const requestId = uuid.v4();
90-
let promise = new Promise((resolve, reject) => {
90+
let promise = new Promise<T>((resolve, reject) => {
9191
this._myRequests.set(requestId, {
9292
resolve,
9393
reject,

0 commit comments

Comments
 (0)