@wavv/dialer 2.3.0 → 2.4.0

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/README.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  For more information, see our [documentation](https://docs.wavv.com)
4
4
 
5
+ <br />
6
+ ### Version 2.4.0
7
+
8
+ - Added `close`
9
+ - Added `endCampaign`
10
+
5
11
  <br />
6
12
 
7
13
  ### Version 2.3.0
package/dist/constants.js CHANGED
@@ -1,16 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DNC_TYPE_MANUAL = exports.DNC_TYPE_SMS = exports.DNC_TYPE_IVR = exports.OUTCOME_UNKNOWN = exports.OUTCOME_NO_VOICEMAIL = exports.OUTCOME_NO_CALLBACK = exports.OUTCOME_VOICEMAIL = exports.OUTCOME_CALLBACK = exports.OUTCOME_DISCONNECTED = exports.OUTCOME_BUSY = exports.OUTCOME_NO_ANSWER = exports.OUTCOME_USER_HUNG_UP = exports.OUTCOME_HUNG_UP = void 0;
4
- exports.OUTCOME_HUNG_UP = 'HUNG_UP'; // callee hung up the line
5
- exports.OUTCOME_USER_HUNG_UP = 'USER_HUNG_UP'; // user hung up the line
6
- exports.OUTCOME_NO_ANSWER = 'NO_ANSWER'; // call was not answered
7
- exports.OUTCOME_BUSY = 'BUSY'; // line was busy
8
- exports.OUTCOME_DISCONNECTED = 'DISCONNECTED'; // number was disconnected
9
- exports.OUTCOME_CALLBACK = 'CALLBACK'; // callback message was played
10
- exports.OUTCOME_VOICEMAIL = 'VOICEMAIL'; // voicemail message was played
11
- exports.OUTCOME_NO_CALLBACK = 'NO_CALLBACK'; // callback message would have been played if the user had one recorded
12
- exports.OUTCOME_NO_VOICEMAIL = 'NO_VOICEMAIL'; // voicemail message would have been played if the user had one recorded
13
- exports.OUTCOME_UNKNOWN = 'UNKNOWN'; // call ended, but no one knows why
14
- exports.DNC_TYPE_IVR = 'IVR OPT-OUT'; // recipient opted out via call
15
- exports.DNC_TYPE_SMS = 'SMS OPT-OUT'; // recipient opted out via text
16
- exports.DNC_TYPE_MANUAL = 'MANUAL'; // number was manually added
4
+ exports.OUTCOME_HUNG_UP = 'HUNG_UP';
5
+ exports.OUTCOME_USER_HUNG_UP = 'USER_HUNG_UP';
6
+ exports.OUTCOME_NO_ANSWER = 'NO_ANSWER';
7
+ exports.OUTCOME_BUSY = 'BUSY';
8
+ exports.OUTCOME_DISCONNECTED = 'DISCONNECTED';
9
+ exports.OUTCOME_CALLBACK = 'CALLBACK';
10
+ exports.OUTCOME_VOICEMAIL = 'VOICEMAIL';
11
+ exports.OUTCOME_NO_CALLBACK = 'NO_CALLBACK';
12
+ exports.OUTCOME_NO_VOICEMAIL = 'NO_VOICEMAIL';
13
+ exports.OUTCOME_UNKNOWN = 'UNKNOWN';
14
+ exports.DNC_TYPE_IVR = 'IVR OPT-OUT';
15
+ exports.DNC_TYPE_SMS = 'SMS OPT-OUT';
16
+ exports.DNC_TYPE_MANUAL = 'MANUAL';
package/dist/events.d.ts CHANGED
@@ -6,69 +6,49 @@ interface Call {
6
6
  contactId: string;
7
7
  }
8
8
  interface Line extends Call {
9
- /** Call should have focus in your app */
10
9
  focused: boolean;
11
- /** Numbers the dialer intends to skip */
12
10
  skippedNumbers: string[];
13
11
  }
14
12
  export interface CallStarted extends Call {
15
13
  }
16
14
  export interface CallAnswered extends Call {
17
- /** Call answered in the background */
18
15
  backgrounded: boolean;
19
16
  }
20
17
  export interface CallEnded extends Call {
21
- /** Call was answered */
22
18
  answered: boolean;
23
- /** Human was detected on the call */
24
19
  human: boolean;
25
- /** Duration of the call in seconds */
26
20
  duration: number;
27
- /** Outcome of the call */
28
21
  outcome: Outcome;
29
- /** Voicemail left on the call */
30
22
  voicemailId?: string;
31
23
  }
32
24
  export interface CallRecorded extends Call {
33
- /** Call recording ID */
34
25
  recordingId: string;
35
26
  }
36
27
  export interface WaitingForContinue extends Call {
37
- /** Dialer is waiting on host app to continue */
38
28
  waiting: boolean;
39
29
  }
40
30
  export interface LinesChanged {
41
- /** Lines currently in use by the dialer */
42
31
  lines: Line[];
43
32
  }
44
33
  export interface DialerIdle {
45
- /** Dialer is idle, pending auto-disconnect */
46
34
  idle: boolean;
47
35
  }
48
36
  export interface CampaignEnded {
49
- /** All contacts in the campaign were called */
50
37
  complete: boolean;
51
- /** History of call objects for the campaign */
52
38
  history: CallEnded[];
53
39
  }
54
40
  export interface DncChanged {
55
- /** Number on the DNC list */
56
41
  number: string;
57
- /** Reason for being on DNC list */
58
42
  type: DncType;
59
- /** Number was removed (added when false) */
60
43
  removed: boolean;
61
44
  }
62
45
  export interface DialerVisible {
63
- /** Dialer is visible */
64
46
  visible: boolean;
65
47
  }
66
48
  export interface MiniDialerVisible {
67
- /** Mini dialer is visible */
68
49
  visible: boolean;
69
50
  }
70
51
  export interface OverlayVisible {
71
- /** Overlay is visible */
72
52
  visible: boolean;
73
53
  }
74
54
  export {};
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Listener, InitOps, SetThemeOps, Voicemail } from './utils';
2
2
  import { CallAnswered, CallEnded, CallRecorded, CallStarted, CampaignEnded, DialerIdle, DialerVisible, DncChanged, LinesChanged, MiniDialerVisible, WaitingForContinue, OverlayVisible } from './events';
3
- import { AddDncNumberOps, AddPhoneOps, CallPhoneOps, ContinueCampaignOps, RemoveContactOps, RemoveDncNumberOps, RemovePhoneOps, StartCampaignOps, DropVoicemailOps } from './options';
3
+ import { AddDncNumberOps, AddPhoneOps, CallPhoneOps, ContinueCampaignOps, RemoveContactOps, RemoveDncNumberOps, RemovePhoneOps, StartCampaignOps, DropVoicemailOps, EndCampaignOps } from './options';
4
4
  export * from './constants';
5
5
  export declare const init: (options: InitOps) => Promise<any>;
6
6
  export declare const close: () => Promise<any>;
@@ -14,6 +14,7 @@ export declare const removeContact: (options: RemoveContactOps) => Promise<void>
14
14
  export declare const removeDncNumber: (options: RemoveDncNumberOps) => Promise<void>;
15
15
  export declare const removePhone: (options: RemovePhoneOps) => Promise<void>;
16
16
  export declare const startCampaign: (options: StartCampaignOps) => Promise<void>;
17
+ export declare const endCampaign: (options: EndCampaignOps) => Promise<void>;
17
18
  export declare const purchaseDialer: () => Promise<void>;
18
19
  export declare const recordCall: () => Promise<void>;
19
20
  export declare const listVoicemails: () => Promise<Voicemail[]>;
package/dist/index.js CHANGED
@@ -10,19 +10,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
10
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
11
  };
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
- exports.addUpsellClickListener = exports.addManageSubscriptionListener = exports.addClosedListener = exports.addOverlayVisibleListener = exports.addWaitingForContinueListener = exports.addMiniDialerVisibleListener = exports.addLinesChangedListener = exports.addDncChangedListener = exports.addDialerVisibleListener = exports.addDialerIdleListener = exports.addCampaignEndedListener = exports.addCallStartedListener = exports.addCallRecordedListener = exports.addCallEndedListener = exports.addCallAnsweredListener = exports.dropVoicemail = exports.listVoicemails = exports.recordCall = exports.purchaseDialer = exports.startCampaign = exports.removePhone = exports.removeDncNumber = exports.removeContact = exports.load = exports.continueCampaign = exports.callPhone = exports.addPhone = exports.addDncNumber = exports.setTheme = exports.close = exports.init = void 0;
13
+ exports.addUpsellClickListener = exports.addManageSubscriptionListener = exports.addClosedListener = exports.addOverlayVisibleListener = exports.addWaitingForContinueListener = exports.addMiniDialerVisibleListener = exports.addLinesChangedListener = exports.addDncChangedListener = exports.addDialerVisibleListener = exports.addDialerIdleListener = exports.addCampaignEndedListener = exports.addCallStartedListener = exports.addCallRecordedListener = exports.addCallEndedListener = exports.addCallAnsweredListener = exports.dropVoicemail = exports.listVoicemails = exports.recordCall = exports.purchaseDialer = exports.endCampaign = exports.startCampaign = exports.removePhone = exports.removeDncNumber = exports.removeContact = exports.load = exports.continueCampaign = exports.callPhone = exports.addPhone = exports.addDncNumber = exports.setTheme = exports.close = exports.init = void 0;
14
14
  const utils_1 = require("./utils");
15
- // -----------
16
- // VERSION
17
- // -----------
18
15
  const V = 2;
19
- // -----------
20
- // CONSTANTS
21
- // -----------
22
16
  __exportStar(require("./constants"), exports);
23
- // -----------
24
- // FUNCTIONS
25
- // -----------
26
17
  const init = (options) => utils_1.initialize(V, options);
27
18
  exports.init = init;
28
19
  const close = () => utils_1.deinitialize(V);
@@ -33,7 +24,6 @@ const addDncNumber = (options) => utils_1.execute(V, 'ADD_DNC_NUMBER', options);
33
24
  exports.addDncNumber = addDncNumber;
34
25
  const addPhone = (options) => utils_1.execute(V, 'ADD_PHONE', options);
35
26
  exports.addPhone = addPhone;
36
- // TODO: accept contact object (for additional fields)
37
27
  const callPhone = (options) => utils_1.execute(V, 'CALL_PHONE', options);
38
28
  exports.callPhone = callPhone;
39
29
  const continueCampaign = (options) => utils_1.execute(V, 'CONTINUE', options);
@@ -48,6 +38,8 @@ const removePhone = (options) => utils_1.execute(V, 'REMOVE_PHONE', options);
48
38
  exports.removePhone = removePhone;
49
39
  const startCampaign = (options) => utils_1.execute(V, 'START_CAMPAIGN', options);
50
40
  exports.startCampaign = startCampaign;
41
+ const endCampaign = (options) => utils_1.execute(V, 'END_CAMPAIGN', options);
42
+ exports.endCampaign = endCampaign;
51
43
  const purchaseDialer = () => utils_1.execute(V, 'PURCHASE_DIALER');
52
44
  exports.purchaseDialer = purchaseDialer;
53
45
  const recordCall = () => utils_1.execute(V, 'RECORD_CALL');
@@ -56,9 +48,6 @@ const listVoicemails = () => utils_1.execute(V, 'LIST_VOICEMAILS');
56
48
  exports.listVoicemails = listVoicemails;
57
49
  const dropVoicemail = (options) => utils_1.execute(V, 'DROP_VOICEMAIL');
58
50
  exports.dropVoicemail = dropVoicemail;
59
- // -----------
60
- // LISTENERS
61
- // -----------
62
51
  const addCallAnsweredListener = (callback) => utils_1.listen(V, 'CALL_ANSWERED', callback);
63
52
  exports.addCallAnsweredListener = addCallAnsweredListener;
64
53
  const addCallEndedListener = (callback) => utils_1.listen(V, 'CALL_ENDED', callback);
package/dist/options.d.ts CHANGED
@@ -29,6 +29,9 @@ export interface RemovePhoneOps {
29
29
  export interface StartCampaignOps {
30
30
  contacts: Contact[];
31
31
  }
32
+ export interface EndCampaignOps {
33
+ close?: boolean;
34
+ }
32
35
  export interface DropVoicemailOps {
33
36
  id: string;
34
37
  }
package/dist/utils.d.ts CHANGED
@@ -16,13 +16,10 @@ export interface SetThemeOps {
16
16
  primaryColor?: string;
17
17
  }
18
18
  export interface MergeField {
19
- /** Field ID, e.g. "first_name" */
20
19
  id: string;
21
- /** Field label, e.g. "First Name" */
22
20
  label: string;
23
21
  }
24
22
  interface MergeFieldValue extends MergeField {
25
- /** Field value, e.g. "Jerry" */
26
23
  value: string;
27
24
  }
28
25
  export interface Contact {
@@ -33,11 +30,8 @@ export interface Contact {
33
30
  lastName?: string;
34
31
  address?: string;
35
32
  city?: string;
36
- /** Avatar image URL */
37
33
  avatarUrl?: string;
38
- /** Subheading, appears below name */
39
34
  subheading?: string;
40
- /** Additional merge field data */
41
35
  mergeFields?: MergeFieldValue[];
42
36
  }
43
37
  export interface Voicemail {
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@wavv/dialer",
3
- "version": "2.3.0",
4
- "description": "",
3
+ "version": "2.4.0",
4
+ "description": "WAVV Dialer",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
7
- "build": "tsc",
7
+ "build": "tsc --removeComments",
8
8
  "start": "tsc -w",
9
9
  "pub": "npm publish --access public"
10
10
  },
@@ -15,6 +15,7 @@
15
15
  "author": "WAVV Communications",
16
16
  "license": "ISC",
17
17
  "devDependencies": {
18
+ "@types/node": "^17.0.21",
18
19
  "prettier": "^2.2.1",
19
20
  "tslint": "^6.1.3",
20
21
  "tslint-config-prettier": "^1.18.0",
package/dist/models.d.ts DELETED
@@ -1,27 +0,0 @@
1
- export interface Listener {
2
- remove: Function;
3
- }
4
- export interface Response {
5
- success: boolean;
6
- }
7
- export interface MergeField {
8
- /** Field ID, e.g. "first_name" */
9
- id: string;
10
- /** Field label, e.g. "First Name" */
11
- label: string;
12
- /** Field value, e.g. "Jerry" */
13
- value: string;
14
- }
15
- export interface Contact {
16
- contactId: string;
17
- numbers: string[];
18
- name: string;
19
- address?: string;
20
- city?: string;
21
- /** Avatar image URL */
22
- avatarUrl?: string;
23
- /** Subheading, appears below name */
24
- subheading?: string;
25
- /** Additional merge field data */
26
- mergeFields?: MergeField[];
27
- }
package/dist/models.js DELETED
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });