Skip to content

Commit

Permalink
sync new features and bugfix from 57d170a (#1608)
Browse files Browse the repository at this point in the history
  • Loading branch information
embbnux authored Dec 12, 2019
1 parent 448b2b2 commit d5c9d69
Show file tree
Hide file tree
Showing 482 changed files with 5,598 additions and 3,592 deletions.
2 changes: 1 addition & 1 deletion .sync
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7698f1018c89580fc352022f2b6da694f5533b77
57d170a1333473bf028801ec050850f3251a68b1
20 changes: 16 additions & 4 deletions packages/phone-number/lib/detect/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { findPhoneNumbers } from 'libphonenumber-js';
import { forEach, find } from 'ramda';
import { findNumbers } from 'libphonenumber-js';
import { forEach, find, map } from 'ramda';
import parse from '../parse';

function find7DigitNumbers(input, countryCode) {
Expand All @@ -17,7 +17,7 @@ function find7DigitNumbers(input, countryCode) {
if (isValid && !hasPlus && phoneNumber.length === 7) {
output.push({
country: countryCode,
phone: phoneNumber,
phoneNumber,
startsAt: match.index,
endsAt: match.index + match[0].length,
});
Expand All @@ -32,7 +32,19 @@ function byStartsAt(a, b) {
}

export default function detect({ input, countryCode = 'US', areaCode = '' }) {
const output = findPhoneNumbers(input, countryCode);
const output = map(
(item) => ({
phoneNumber: item.number.number,
country: item.number.country,
nationalNumber: item.number.nationalNumber,
ext: item.number.ext,
startsAt: item.startsAt,
endsAt: item.endsAt,
}),
findNumbers(input, countryCode, {
v2: true,
}),
);
if ((countryCode === 'US' || countryCode === 'CA') && areaCode.length === 3) {
const sevenDigits = find7DigitNumbers(input, countryCode);
if (sevenDigits.length) {
Expand Down
4 changes: 2 additions & 2 deletions packages/phone-number/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ringcentral-integration/phone-number",
"version": "1.0.3",
"version": "1.0.4",
"description": "Wrapper around libphonenumber-js to provide RingCentral specific phone handling.",
"main": "index.js",
"repository": {
Expand All @@ -15,7 +15,7 @@
"homepage": "https://github.com/ringcentral/ringcentral-js-widgets#readme",
"private": false,
"dependencies": {
"libphonenumber-js": "^1.7.24",
"libphonenumber-js": "^1.7.29",
"ramda": "^0.26.1"
},
"peerDependencies": {},
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { createHashMap } from '../lib/HashMap';

export default createHashMap({
hold: 'Hold',
setUp: 'Setup',
proceeding: 'Proceeding',
});
7 changes: 0 additions & 7 deletions packages/ringcentral-integration/enums/availabilityTypes.js

This file was deleted.

7 changes: 7 additions & 0 deletions packages/ringcentral-integration/enums/availabilityTypes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { createHashMap } from '../lib/HashMap';

export default createHashMap({
alive: 'Alive',
deleted: 'Deleted',
purged: 'Purged',
});
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import HashMap from '../lib/HashMap';
import { createHashMap } from '../lib/HashMap';

export default new HashMap({
export default createHashMap({
'411Info': '411 Info',
acceptCall: 'Accept Call',
callReturn: 'Call Return',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Enum from '../lib/Enum';
import { createEnum } from '../lib/Enum';

export default new Enum(
export default createEnum(
['logCallLogFailed', 'logFailed', 'fieldRequired'],
'callLogMessages',
);
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import HashMap from '../lib/HashMap';
import { createHashMap } from '../lib/HashMap';

export default new HashMap({
export default createHashMap({
manual: 'manual',
presenceUpdate: 'presenceUpdate',
callLogSync: 'callLogSync',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import HashMap from '../lib/HashMap';
import { createHashMap } from '../lib/HashMap';

export default new HashMap({
export default createHashMap({
IPPhoneOffline: 'IP Phone offline',
abandoned: 'Abandoned',
account: 'Account',
Expand Down
3 changes: 0 additions & 3 deletions packages/ringcentral-integration/enums/calleeTypes.js

This file was deleted.

3 changes: 3 additions & 0 deletions packages/ringcentral-integration/enums/calleeTypes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { createEnum } from '../lib/Enum';

export default createEnum(['unknown', 'contacts', 'conference'], 'calleeTypes');

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { createEnum } from '../lib/Enum';

export default createEnum(
['loggedSuccess', 'loggedFailure'],
'conversationLogStatus',
);
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import HashMap from '../lib/HashMap';
import { createHashMap } from '../lib/HashMap';

/**
* @typedef ExtensionStatusTypes
Expand All @@ -11,7 +11,7 @@ import HashMap from '../lib/HashMap';
/**
* @type {ExtensionStatusTypes}
*/
export const extensionStatusTypes = new HashMap({
export const extensionStatusTypes = createHashMap({
enabled: 'Enabled',
notActivated: 'NotActivated',
disabled: 'Disabled',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import HashMap from '../lib/HashMap';
import { createHashMap } from '../lib/HashMap';

/**
* @typedef ExtensionTypes
Expand All @@ -22,7 +22,7 @@ import HashMap from '../lib/HashMap';
/**
* @type {ExtensionTypes}
*/
const extensionTypes = new HashMap({
const extensionTypes = createHashMap({
announcement: 'Announcement',
applicationExtension: 'ApplicationExtension',
bot: 'Bot',
Expand Down
6 changes: 0 additions & 6 deletions packages/ringcentral-integration/enums/messageDirection.js

This file was deleted.

6 changes: 6 additions & 0 deletions packages/ringcentral-integration/enums/messageDirection.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { createHashMap } from '../lib/HashMap';

export default createHashMap({
inbound: 'Inbound',
outbound: 'Outbound',
});
7 changes: 1 addition & 6 deletions packages/ringcentral-integration/enums/moduleActionTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,4 @@ export const moduleActionTypes = createEnum([
'resetSuccess',
]);

export interface ModuleActionTypes {
init: string;
initSuccess: string;
reset: string;
resetSuccess: string;
}
export type ModuleActionTypes = Record<keyof typeof moduleActionTypes, string>;
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Enum from '../lib/Enum';
import { createEnum } from '../lib/Enum';

export default new Enum(
export default createEnum(
['pending', 'initializing', 'ready', 'resetting'],
'module',
);
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Enum from '../lib/Enum';
import { createEnum } from '../lib/Enum';

export default new Enum([
export default createEnum([
'business',
'extension',
'home',
Expand Down
7 changes: 7 additions & 0 deletions packages/ringcentral-integration/enums/presenceStatus.enum.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { createHashMap } from '../lib/HashMap';

export const presenceStatus = createHashMap({
offline: 'Offline',
busy: 'Busy',
available: 'Available',
});
3 changes: 0 additions & 3 deletions packages/ringcentral-integration/enums/proxyActionTypes.js

This file was deleted.

3 changes: 3 additions & 0 deletions packages/ringcentral-integration/enums/proxyActionTypes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { createEnum } from '../lib/Enum';

export default createEnum(['proxyInit', 'proxyInitSuccess']);
3 changes: 0 additions & 3 deletions packages/ringcentral-integration/enums/proxyStatuses.js

This file was deleted.

3 changes: 3 additions & 0 deletions packages/ringcentral-integration/enums/proxyStatuses.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { createEnum } from '../lib/Enum';

export default createEnum(['pending', 'initializing', 'ready'], 'module');
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import HashMap from '../lib/HashMap';
import { createHashMap } from '../lib/HashMap';

export default new HashMap({
export default createHashMap({
presence: '/account/~/extension/~/presence',
detailedPresence:
'/account/~/extension/~/presence?detailedTelephonyState=true&sipData=true&totalActiveCalls',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import HashMap from '../lib/HashMap';
import { createHashMap } from '../lib/HashMap';

const hints = new HashMap({
const hints = createHashMap({
limits: 'Limits',
features: 'Features',
accountStatus: 'AccountStatus',
Expand Down
6 changes: 0 additions & 6 deletions packages/ringcentral-integration/enums/syncTypes.js

This file was deleted.

6 changes: 6 additions & 0 deletions packages/ringcentral-integration/enums/syncTypes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { createHashMap } from '../lib/HashMap';

export default createHashMap({
fSync: 'FSync',
iSync: 'ISync',
});
6 changes: 0 additions & 6 deletions packages/ringcentral-integration/enums/terminationTypes.js

This file was deleted.

6 changes: 6 additions & 0 deletions packages/ringcentral-integration/enums/terminationTypes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { createHashMap } from '../lib/HashMap';

export default createHashMap({
final: 'final',
intermediate: 'intermediate',
});
1 change: 0 additions & 1 deletion packages/ringcentral-integration/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ export function compile() {
.src([
'./**/*.js',
'./**/*.ts',
'./**/*.tsx',
'!./**/*.d.ts',
'!./**/*.test.js',
'!./*.js',
Expand Down
1 change: 1 addition & 0 deletions packages/ringcentral-integration/helpers/meetingHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const UTC_TIMEZONE_ID = '1';
const MeetingType = {
SCHEDULED: 'Scheduled',
RECURRING: 'Recurring',
SCHEDULED_RECURRING: 'ScheduledRecurring',
INSTANT: 'Instant',
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import Brand from '../../../modules/Brand';
import Call from '../../../modules/Call';
import CallingSettings from '../../../modules/CallingSettings';
import Contacts from '../../../modules/Contacts';
import ContactDetails from '../../../modules/ContactDetails';
import ConnectivityMonitor from '../../../modules/ConnectivityMonitor';
import DialingPlan from '../../../modules/DialingPlan';
import ExtensionDevice from '../../../modules/ExtensionDevice';
Expand Down Expand Up @@ -121,7 +120,6 @@ import BlockedNumber from '../../../modules/BlockedNumber';
accountContacts,
],
},
{ provide: 'ContactDetails', useClass: ContactDetails },
{ provide: 'ContactMatcher', useClass: ContactMatcher },
{ provide: 'RecentMessages', useClass: RecentMessages },
{ provide: 'RecentCalls', useClass: RecentCalls },
Expand Down
Loading

0 comments on commit d5c9d69

Please sign in to comment.