@vonage/voice
Version:
The Voice API lets you create outbound calls, control in-progress calls and get information about historical calls.
65 lines (63 loc) • 1.84 kB
JavaScript
;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// lib/classes/NCCO/Wait.ts
var Wait_exports = {};
__export(Wait_exports, {
Wait: () => Wait
});
module.exports = __toCommonJS(Wait_exports);
var Wait = class {
/**
* The action type for this NCCO action.
*/
action = "wait" /* WAIT */;
/**
* The duration in seconds to pause execution (optional).
*/
timeout;
/**
* Creates a new Wait action.
*
* @param {number} [timeout] - The duration in seconds to pause execution.
* Valid values range from `0.1` to `7200`. Defaults to `10`.
*/
constructor(timeout) {
if (timeout !== void 0) {
this.timeout = timeout;
}
}
/**
* Serializes the Wait action to a Nexmo Call Control Object (NCCO).
*
* @return {WaitAction} - The serialized Wait action.
*/
serializeToNCCO() {
const data = {
action: "wait" /* WAIT */
};
if (this.timeout !== void 0) {
data.timeout = this.timeout;
}
return data;
}
};
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
Wait
});