@vonage/voice
Version:
The Voice API lets you create outbound calls, control in-progress calls and get information about historical calls.
53 lines (51 loc) • 1.68 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/NCCOBuilder.ts
var NCCOBuilder_exports = {};
__export(NCCOBuilder_exports, {
NCCOBuilder: () => NCCOBuilder
});
module.exports = __toCommonJS(NCCOBuilder_exports);
var NCCOBuilder = class {
actions = [];
/**
* Add an action to the NCCO builder.
*
* @param {Action} action - The action to add to the NCCO.
* @return {NCCOBuilder} - The NCCO builder instance (for method chaining).
*/
addAction(action) {
this.actions.push(
"serializeToNCCO" in action ? action.serializeToNCCO() : action
);
return this;
}
/**
* Build the NCCO by serializing the added actions.
*
* @return {Array<Action | Serializable>} - The built NCCO, which is an array of actions.
*/
build() {
return this.actions;
}
};
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
NCCOBuilder
});