Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ export default Object.freeze({
REMOVE_PARTICIPANT_VARIANT: Object.freeze({
ALWAYS : 'ALWAYS',
NEVER: 'NEVER',
ALWAYS_EXCEPT_ON_HOLD: 'ALWAYS_EXCEPT_ON_HOLD'
ALWAYS_EXCEPT_WHEN_ON_HOLD: 'ALWAYS_EXCEPT_WHEN_ON_HOLD'
}),
LOG_LEVEL: Object.freeze({
ERROR: "ERROR",
Expand Down
34 changes: 27 additions & 7 deletions src/main/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,26 @@ export class ActiveCallsResult {
}
}

/**
* Class representing an AudioDevice
*/
export class AudioDevice {
/**
* Create AudioDevice
* @param {object} param
* @param {string} [param.deviceId]
* @param {string} [param.kind]
* @param {string} [param.label]
* @param {string} [param.groupId]
*/
constructor({ deviceId, kind, label, groupId }) {
this.deviceId = deviceId
this.kind = kind
this.label = label
this.groupId = groupId
}
}

/**
* Class representing result type for getAudioDevices()
*/
Expand Down Expand Up @@ -771,7 +791,7 @@ export class CallInfo {
* @param {boolean} [param.showAddBlindTransferButton]
* @param {boolean} [param.showMergeButton]
* @param {boolean} [param.showSwapButton]
* @param {("ALWAYS"|"NEVER"|"ALWAYS_EXCEPT_ON_HOLD")} [param.removeParticipantVariant] - The type of remove participant variant when in a transfer call.
* @param {typeof Constants.REMOVE_PARTICIPANT_VARIANT[keyof typeof Constants.REMOVE_PARTICIPANT_VARIANT]} [param.removeParticipantVariant] - The type of remove participant variant when in a transfer call.
* @param {String} [param.additionalFields] - Represents additional standard and custom fields in the voice call record, where each key-value pair value corresponds to a standard or custom field and its values.
* @param {boolean} [param.isMultiParty]
* @param {boolean} [param.isHIDCall]
Expand Down Expand Up @@ -1003,13 +1023,13 @@ export class PhoneCall {
* @param {typeof Constants.CALL_TYPE[keyof typeof Constants.CALL_TYPE]} [param.callType] - The type of the call, one of the CALL_TYPE values
* @param {typeof Constants.CALL_SUBTYPE[keyof typeof Constants.CALL_SUBTYPE]} [param.callSubtype] - The subtype of the call, one of the CALL_SUBTYPE values
* @param {Contact} [param.contact] - The Call Target / Contact . TODO: to be deprecated, replace with toContact
* @param {string} [param.state] - The state of the call, i.e. ringing, connected, declined, failed
* @param {typeof Constants.CALL_STATE[keyof typeof Constants.CALL_STATE]} [param.state] - The state of the call, i.e. ringing, connected, declined, failed
* @param {PhoneCallAttributes} [param.callAttributes] - Any additional call attributes
* @param {string} [param.phoneNumber] - The phone number associated with this call (usually external number)
* @param {CallInfo} [param.callInfo]
* @param {string} [param.reason]
* @param {typeof Constants.HANGUP_REASON[keyof typeof Constants.HANGUP_REASON]} [param.reason]
* @param {boolean} [param.closeCallOnError]
* @param {string} [param.agentStatus]
* @param {typeof Constants.HANGUP_STATUS[keyof typeof Constants.HANGUP_STATUS]} [param.agentStatus]
* @param {string} [param.agentARN]
* @param {Contact} [param.fromContact] - This is optional, and being populated when dialing/consulting a contact or adding a participant
* @param {Contact} [param.toContact] - This is currently the same as param.contact (just rename)
Expand Down Expand Up @@ -1281,7 +1301,7 @@ export class TelephonyConnector {
/**
* Supervise a call
* @param {SupervisedCallInfo} supervisedCallInfo CallInfo of the call to be supervised
* @returns {Promise <SuperviseCallResult>}
* @returns {Promise<SuperviseCallResult>}
*/
superviseCall(supervisedCallInfo) {
throw new Error('Not implemented');
Expand All @@ -1290,7 +1310,7 @@ export class TelephonyConnector {
/**
* Supervisor disconnects from a call
* @param {SupervisedCallInfo} supervisedCallInfo CallInfo of the supervised call to be disconnected
* @returns {Promise <SupervisorHangupResult>}
* @returns {Promise<SupervisorHangupResult>}
*/
supervisorDisconnect(supervisedCallInfo) {
throw new Error('Not implemented');
Expand All @@ -1299,7 +1319,7 @@ export class TelephonyConnector {
/**
* Supervisor Barges into a ongoing call
* @param {SupervisedCallInfo} supervisedCallInfo CallInfo of the supervised call which supervisor barges in
* @returns {Promise <SuperviseCallResult>}
* @returns {Promise<SuperviseCallResult>}
*/
supervisorBargeIn(supervisedCallInfo) {
throw new Error('Not implemented');
Expand Down
2 changes: 1 addition & 1 deletion ts-declaration/constants.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ declare const _default: Readonly<{
REMOVE_PARTICIPANT_VARIANT: Readonly<{
ALWAYS: "ALWAYS";
NEVER: "NEVER";
ALWAYS_EXCEPT_ON_HOLD: "ALWAYS_EXCEPT_ON_HOLD";
ALWAYS_EXCEPT_WHEN_ON_HOLD: "ALWAYS_EXCEPT_WHEN_ON_HOLD";
}>;
LOG_LEVEL: Readonly<{
ERROR: "ERROR";
Expand Down
55 changes: 39 additions & 16 deletions ts-declaration/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export namespace Constants {
const REMOVE_PARTICIPANT_VARIANT: {
ALWAYS: "ALWAYS";
NEVER: "NEVER";
ALWAYS_EXCEPT_ON_HOLD: "ALWAYS_EXCEPT_ON_HOLD";
ALWAYS_EXCEPT_WHEN_ON_HOLD: "ALWAYS_EXCEPT_WHEN_ON_HOLD";
};
const LOG_LEVEL: {
ERROR: "ERROR";
Expand Down Expand Up @@ -239,6 +239,29 @@ export class ActiveCallsResult {
});
activeCalls: PhoneCall[];
}
/**
* Class representing an AudioDevice
*/
export class AudioDevice {
/**
* Create AudioDevice
* @param {object} param
* @param {string} [param.deviceId]
* @param {string} [param.kind]
* @param {string} [param.label]
* @param {string} [param.groupId]
*/
constructor({ deviceId, kind, label, groupId }: {
deviceId?: string;
kind?: string;
label?: string;
groupId?: string;
});
deviceId: string;
kind: string;
label: string;
groupId: string;
}
/**
* Class representing result type for getAudioDevices()
*/
Expand Down Expand Up @@ -692,7 +715,7 @@ export class CallInfo {
* @param {boolean} [param.showAddBlindTransferButton]
* @param {boolean} [param.showMergeButton]
* @param {boolean} [param.showSwapButton]
* @param {("ALWAYS"|"NEVER"|"ALWAYS_EXCEPT_ON_HOLD")} [param.removeParticipantVariant] - The type of remove participant variant when in a transfer call.
* @param {typeof Constants.REMOVE_PARTICIPANT_VARIANT[keyof typeof Constants.REMOVE_PARTICIPANT_VARIANT]} [param.removeParticipantVariant] - The type of remove participant variant when in a transfer call.
* @param {String} [param.additionalFields] - Represents additional standard and custom fields in the voice call record, where each key-value pair value corresponds to a standard or custom field and its values.
* @param {boolean} [param.isMultiParty]
* @param {boolean} [param.isHIDCall]
Expand Down Expand Up @@ -727,7 +750,7 @@ export class CallInfo {
showAddBlindTransferButton?: boolean;
showMergeButton?: boolean;
showSwapButton?: boolean;
removeParticipantVariant?: ("ALWAYS" | "NEVER" | "ALWAYS_EXCEPT_ON_HOLD");
removeParticipantVariant?: "ALWAYS" | "NEVER" | "ALWAYS_EXCEPT_WHEN_ON_HOLD";
additionalFields?: string;
isMultiParty?: boolean;
isHIDCall?: boolean;
Expand Down Expand Up @@ -755,7 +778,7 @@ export class CallInfo {
isReplayable: boolean;
isBargeable: boolean;
isExternalTransfer: boolean;
removeParticipantVariant: "ALWAYS" | "NEVER" | "ALWAYS_EXCEPT_ON_HOLD";
removeParticipantVariant: "ALWAYS" | "NEVER" | "ALWAYS_EXCEPT_WHEN_ON_HOLD";
showMuteButton: boolean;
showRecordButton: boolean;
showAddCallerButton: boolean;
Expand Down Expand Up @@ -866,13 +889,13 @@ export class PhoneCall {
* @param {typeof Constants.CALL_TYPE[keyof typeof Constants.CALL_TYPE]} [param.callType] - The type of the call, one of the CALL_TYPE values
* @param {typeof Constants.CALL_SUBTYPE[keyof typeof Constants.CALL_SUBTYPE]} [param.callSubtype] - The subtype of the call, one of the CALL_SUBTYPE values
* @param {Contact} [param.contact] - The Call Target / Contact . TODO: to be deprecated, replace with toContact
* @param {string} [param.state] - The state of the call, i.e. ringing, connected, declined, failed
* @param {typeof Constants.CALL_STATE[keyof typeof Constants.CALL_STATE]} [param.state] - The state of the call, i.e. ringing, connected, declined, failed
* @param {PhoneCallAttributes} [param.callAttributes] - Any additional call attributes
* @param {string} [param.phoneNumber] - The phone number associated with this call (usually external number)
* @param {CallInfo} [param.callInfo]
* @param {string} [param.reason]
* @param {typeof Constants.HANGUP_REASON[keyof typeof Constants.HANGUP_REASON]} [param.reason]
* @param {boolean} [param.closeCallOnError]
* @param {string} [param.agentStatus]
* @param {typeof Constants.HANGUP_STATUS[keyof typeof Constants.HANGUP_STATUS]} [param.agentStatus]
* @param {string} [param.agentARN]
* @param {Contact} [param.fromContact] - This is optional, and being populated when dialing/consulting a contact or adding a participant
* @param {Contact} [param.toContact] - This is currently the same as param.contact (just rename)
Expand All @@ -883,13 +906,13 @@ export class PhoneCall {
callType?: "Inbound" | "Outbound" | "Callback" | "AddParticipant" | "Transfer" | "InternalCall" | "DialedCallback" | "Consult";
callSubtype?: "PSTN" | "WebRTC";
contact?: Contact;
state?: string;
state?: "ringing" | "connected" | "transferring" | "transferred" | "ended";
callAttributes?: PhoneCallAttributes;
phoneNumber?: string;
callInfo?: CallInfo;
reason?: string;
reason?: "ended" | "error";
closeCallOnError?: boolean;
agentStatus?: string;
agentStatus?: "MissedCallAgent" | "DeclinedByAgent" | "FailedConnectAgent" | "FailedConnectCustomer" | "CallbackMissedOrRejected";
agentARN?: string;
fromContact?: Contact;
toContact?: Contact;
Expand All @@ -903,11 +926,11 @@ export class PhoneCall {
contact: Contact;
fromContact: Contact;
toContact: Contact;
reason: string;
reason: "ended" | "error";
closeCallOnError: true;
agentStatus: string;
agentStatus: "MissedCallAgent" | "DeclinedByAgent" | "FailedConnectAgent" | "FailedConnectCustomer" | "CallbackMissedOrRejected";
agentARN: string;
state: string;
state: "ringing" | "connected" | "transferring" | "transferred" | "ended";
callAttributes: PhoneCallAttributes;
}
/**
Expand Down Expand Up @@ -1052,19 +1075,19 @@ export class TelephonyConnector {
/**
* Supervise a call
* @param {SupervisedCallInfo} supervisedCallInfo CallInfo of the call to be supervised
* @returns {Promise <SuperviseCallResult>}
* @returns {Promise<SuperviseCallResult>}
*/
superviseCall(supervisedCallInfo: SupervisedCallInfo): Promise<SuperviseCallResult>;
/**
* Supervisor disconnects from a call
* @param {SupervisedCallInfo} supervisedCallInfo CallInfo of the supervised call to be disconnected
* @returns {Promise <SupervisorHangupResult>}
* @returns {Promise<SupervisorHangupResult>}
*/
supervisorDisconnect(supervisedCallInfo: SupervisedCallInfo): Promise<SupervisorHangupResult>;
/**
* Supervisor Barges into a ongoing call
* @param {SupervisedCallInfo} supervisedCallInfo CallInfo of the supervised call which supervisor barges in
* @returns {Promise <SuperviseCallResult>}
* @returns {Promise<SuperviseCallResult>}
*/
supervisorBargeIn(supervisedCallInfo: SupervisedCallInfo): Promise<SuperviseCallResult>;
}
Expand Down