Socket
Socket
Sign inDemoInstall

twilio

Package Overview
Dependencies
Maintainers
1
Versions
300
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

twilio - npm Package Compare versions

Comparing version 4.10.0 to 4.11.0

18

lib/rest/conversations/v1/conversation.d.ts

@@ -72,8 +72,2 @@ /// <reference types="node" />

export interface ConversationListInstanceEachOptions {
/** Start date in ISO8601 format for sorting and filtering list of Conversations. */
startDate?: string;
/** End date in ISO8601 format for sorting and filtering list of Conversations. */
endDate?: string;
/** State for sorting and filtering list of Conversations. Can be `active`, `inactive` or `closed` */
state?: ConversationState;
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */

@@ -92,8 +86,2 @@ pageSize?: number;

export interface ConversationListInstanceOptions {
/** Start date in ISO8601 format for sorting and filtering list of Conversations. */
startDate?: string;
/** End date in ISO8601 format for sorting and filtering list of Conversations. */
endDate?: string;
/** State for sorting and filtering list of Conversations. Can be `active`, `inactive` or `closed` */
state?: ConversationState;
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */

@@ -108,8 +96,2 @@ pageSize?: number;

export interface ConversationListInstancePageOptions {
/** Start date in ISO8601 format for sorting and filtering list of Conversations. */
startDate?: string;
/** End date in ISO8601 format for sorting and filtering list of Conversations. */
endDate?: string;
/** State for sorting and filtering list of Conversations. Can be `active`, `inactive` or `closed` */
state?: ConversationState;
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */

@@ -116,0 +98,0 @@ pageSize?: number;

@@ -285,8 +285,2 @@ "use strict";

let data = {};
if (params["startDate"] !== undefined)
data["StartDate"] = params["startDate"];
if (params["endDate"] !== undefined)
data["EndDate"] = params["endDate"];
if (params["state"] !== undefined)
data["State"] = params["state"];
if (params["pageSize"] !== undefined)

@@ -293,0 +287,0 @@ data["PageSize"] = params["pageSize"];

@@ -72,8 +72,2 @@ /// <reference types="node" />

export interface ConversationListInstanceEachOptions {
/** Start date in ISO8601 format for sorting and filtering list of Conversations. */
startDate?: string;
/** End date in ISO8601 format for sorting and filtering list of Conversations. */
endDate?: string;
/** State for sorting and filtering list of Conversations. Can be `active`, `inactive` or `closed` */
state?: ConversationState;
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */

@@ -92,8 +86,2 @@ pageSize?: number;

export interface ConversationListInstanceOptions {
/** Start date in ISO8601 format for sorting and filtering list of Conversations. */
startDate?: string;
/** End date in ISO8601 format for sorting and filtering list of Conversations. */
endDate?: string;
/** State for sorting and filtering list of Conversations. Can be `active`, `inactive` or `closed` */
state?: ConversationState;
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */

@@ -108,8 +96,2 @@ pageSize?: number;

export interface ConversationListInstancePageOptions {
/** Start date in ISO8601 format for sorting and filtering list of Conversations. */
startDate?: string;
/** End date in ISO8601 format for sorting and filtering list of Conversations. */
endDate?: string;
/** State for sorting and filtering list of Conversations. Can be `active`, `inactive` or `closed` */
state?: ConversationState;
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */

@@ -116,0 +98,0 @@ pageSize?: number;

@@ -293,8 +293,2 @@ "use strict";

let data = {};
if (params["startDate"] !== undefined)
data["StartDate"] = params["startDate"];
if (params["endDate"] !== undefined)
data["EndDate"] = params["endDate"];
if (params["state"] !== undefined)
data["State"] = params["state"];
if (params["pageSize"] !== undefined)

@@ -301,0 +295,0 @@ data["PageSize"] = params["pageSize"];

28

lib/rest/flexApi/v1/assessments.d.ts

@@ -23,4 +23,4 @@ /// <reference types="node" />

export interface AssessmentsListInstanceCreateOptions {
/** The id of the category */
categoryId: string;
/** The SID of the category */
categorySid: string;
/** The name of the category */

@@ -38,3 +38,3 @@ categoryName: string;

offset: number;
/** The question Id selected for assessment */
/** The question SID selected for assessment */
metricId: string;

@@ -47,4 +47,4 @@ /** The question name of the assessment */

answerId: string;
/** Questionnaire Id of the associated question */
questionnaireId: string;
/** Questionnaire SID of the associated question */
questionnaireSid: string;
/** The Token HTTP request header */

@@ -115,3 +115,3 @@ token?: string;

export interface AssessmentsContextSolution {
assessmentId: string;
assessmentSid: string;
}

@@ -122,3 +122,3 @@ export declare class AssessmentsContextImpl implements AssessmentsContext {

protected _uri: string;
constructor(_version: V1, assessmentId: string);
constructor(_version: V1, assessmentSid: string);
update(params: AssessmentsContextUpdateOptions, callback?: (error: Error | null, item?: AssessmentsInstance) => any): Promise<AssessmentsInstance>;

@@ -138,3 +138,3 @@ /**

account_sid: string;
assessment_id: string;
assessment_sid: string;
offset: number;

@@ -157,3 +157,3 @@ report: boolean;

protected _context?: AssessmentsContext;
constructor(_version: V1, payload: AssessmentsResource, assessmentId?: string);
constructor(_version: V1, payload: AssessmentsResource, assessmentSid?: string);
/**

@@ -164,5 +164,5 @@ * The unique SID identifier of the Account.

/**
* The unique id of the assessment
* The SID of the assessment
*/
assessmentId: string;
assessmentSid: string;
/**

@@ -227,3 +227,3 @@ * Offset of the conversation

accountSid: string;
assessmentId: string;
assessmentSid: string;
offset: number;

@@ -250,4 +250,4 @@ report: boolean;

_uri: string;
(assessmentId: string): AssessmentsContext;
get(assessmentId: string): AssessmentsContext;
(assessmentSid: string): AssessmentsContext;
get(assessmentSid: string): AssessmentsContext;
/**

@@ -254,0 +254,0 @@ * Create a AssessmentsInstance

@@ -26,9 +26,9 @@ "use strict";

class AssessmentsContextImpl {
constructor(_version, assessmentId) {
constructor(_version, assessmentSid) {
this._version = _version;
if (!(0, utility_1.isValidPathParam)(assessmentId)) {
throw new Error("Parameter 'assessmentId' is not valid.");
if (!(0, utility_1.isValidPathParam)(assessmentSid)) {
throw new Error("Parameter 'assessmentSid' is not valid.");
}
this._solution = { assessmentId };
this._uri = `/Insights/QM/Assessments/${assessmentId}`;
this._solution = { assessmentSid };
this._uri = `/Insights/QualityManagement/Assessments/${assessmentSid}`;
}

@@ -63,3 +63,3 @@ update(params, callback) {

});
operationPromise = operationPromise.then((payload) => new AssessmentsInstance(operationVersion, payload, instance._solution.assessmentId));
operationPromise = operationPromise.then((payload) => new AssessmentsInstance(operationVersion, payload, instance._solution.assessmentSid));
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);

@@ -82,6 +82,6 @@ return operationPromise;

class AssessmentsInstance {
constructor(_version, payload, assessmentId) {
constructor(_version, payload, assessmentSid) {
this._version = _version;
this.accountSid = payload.account_sid;
this.assessmentId = payload.assessment_id;
this.assessmentSid = payload.assessment_sid;
this.offset = payload.offset;

@@ -99,3 +99,3 @@ this.report = payload.report;

this.url = payload.url;
this._solution = { assessmentId: assessmentId || this.assessmentId };
this._solution = { assessmentSid: assessmentSid || this.assessmentSid };
}

@@ -105,3 +105,3 @@ get _proxy() {

this._context ||
new AssessmentsContextImpl(this._version, this._solution.assessmentId);
new AssessmentsContextImpl(this._version, this._solution.assessmentSid);
return this._context;

@@ -120,3 +120,3 @@ }

accountSid: this.accountSid,
assessmentId: this.assessmentId,
assessmentSid: this.assessmentSid,
offset: this.offset,

@@ -142,9 +142,9 @@ report: this.report,

function AssessmentsListInstance(version) {
const instance = ((assessmentId) => instance.get(assessmentId));
instance.get = function get(assessmentId) {
return new AssessmentsContextImpl(version, assessmentId);
const instance = ((assessmentSid) => instance.get(assessmentSid));
instance.get = function get(assessmentSid) {
return new AssessmentsContextImpl(version, assessmentSid);
};
instance._version = version;
instance._solution = {};
instance._uri = `/Insights/QM/Assessments`;
instance._uri = `/Insights/QualityManagement/Assessments`;
instance.create = function create(params, callback) {

@@ -154,4 +154,4 @@ if (params === null || params === undefined) {

}
if (params["categoryId"] === null || params["categoryId"] === undefined) {
throw new Error("Required parameter \"params['categoryId']\" missing.");
if (params["categorySid"] === null || params["categorySid"] === undefined) {
throw new Error("Required parameter \"params['categorySid']\" missing.");
}

@@ -189,8 +189,8 @@ if (params["categoryName"] === null ||

}
if (params["questionnaireId"] === null ||
params["questionnaireId"] === undefined) {
throw new Error("Required parameter \"params['questionnaireId']\" missing.");
if (params["questionnaireSid"] === null ||
params["questionnaireSid"] === undefined) {
throw new Error("Required parameter \"params['questionnaireSid']\" missing.");
}
let data = {};
data["CategoryId"] = params["categoryId"];
data["CategorySid"] = params["categorySid"];
data["CategoryName"] = params["categoryName"];

@@ -206,3 +206,3 @@ data["SegmentId"] = params["segmentId"];

data["AnswerId"] = params["answerId"];
data["QuestionnaireId"] = params["questionnaireId"];
data["QuestionnaireSid"] = params["questionnaireSid"];
const headers = {};

@@ -209,0 +209,0 @@ headers["Content-Type"] = "application/x-www-form-urlencoded";

@@ -157,3 +157,3 @@ /// <reference types="node" />

account_sid: string;
assessment_id: string;
assessment_sid: string;
comment: any;

@@ -178,5 +178,5 @@ offset: number;

/**
* The unique ID of the assessment.
* The SID of the assessment.
*/
assessmentId: string;
assessmentSid: string;
/**

@@ -226,3 +226,3 @@ * The comment added for assessment.

accountSid: string;
assessmentId: string;
assessmentSid: string;
comment: any;

@@ -229,0 +229,0 @@ offset: number;

@@ -28,3 +28,3 @@ "use strict";

instance._solution = {};
instance._uri = `/Insights/QM/Assessments/Comments`;
instance._uri = `/Insights/QualityManagement/Assessments/Comments`;
instance.create = function create(params, callback) {

@@ -138,3 +138,3 @@ if (params === null || params === undefined) {

this.accountSid = payload.account_sid;
this.assessmentId = payload.assessment_id;
this.assessmentSid = payload.assessment_sid;
this.comment = payload.comment;

@@ -159,3 +159,3 @@ this.offset = payload.offset;

accountSid: this.accountSid,
assessmentId: this.assessmentId,
assessmentSid: this.assessmentSid,
comment: this.comment,

@@ -162,0 +162,0 @@ offset: this.offset,

@@ -32,4 +32,4 @@ /// <reference types="node" />

description?: string;
/** The list of questions ids under a questionnaire */
questionIds?: Array<string>;
/** The list of questions sids under a questionnaire */
questionSids?: Array<string>;
}

@@ -48,4 +48,4 @@ /**

active?: boolean;
/** The list of questions ids under a questionnaire */
questionIds?: Array<string>;
/** The list of questions sids under a questionnaire */
questionSids?: Array<string>;
}

@@ -148,3 +148,3 @@ /**

export interface InsightsQuestionnairesContextSolution {
id: string;
questionnaireSid: string;
}

@@ -155,3 +155,3 @@ export declare class InsightsQuestionnairesContextImpl implements InsightsQuestionnairesContext {

protected _uri: string;
constructor(_version: V1, id: string);
constructor(_version: V1, questionnaireSid: string);
remove(params?: InsightsQuestionnairesContextRemoveOptions | ((error: Error | null, item?: boolean) => any), callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;

@@ -173,3 +173,3 @@ fetch(params?: InsightsQuestionnairesContextFetchOptions | ((error: Error | null, item?: InsightsQuestionnairesInstance) => any), callback?: (error: Error | null, item?: InsightsQuestionnairesInstance) => any): Promise<InsightsQuestionnairesInstance>;

account_sid: string;
id: string;
questionnaire_sid: string;
name: string;

@@ -185,3 +185,3 @@ description: string;

protected _context?: InsightsQuestionnairesContext;
constructor(_version: V1, payload: InsightsQuestionnairesResource, id?: string);
constructor(_version: V1, payload: InsightsQuestionnairesResource, questionnaireSid?: string);
/**

@@ -192,5 +192,5 @@ * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Flex Insights resource and owns this resource.

/**
* The unique id of this questionnaire
* The sid of this questionnaire
*/
id: string;
questionnaireSid: string;
/**

@@ -264,3 +264,3 @@ * The name of this category.

accountSid: string;
id: string;
questionnaireSid: string;
name: string;

@@ -280,4 +280,4 @@ description: string;

_uri: string;
(id: string): InsightsQuestionnairesContext;
get(id: string): InsightsQuestionnairesContext;
(questionnaireSid: string): InsightsQuestionnairesContext;
get(questionnaireSid: string): InsightsQuestionnairesContext;
/**

@@ -284,0 +284,0 @@ * Create a InsightsQuestionnairesInstance

@@ -26,9 +26,9 @@ "use strict";

class InsightsQuestionnairesContextImpl {
constructor(_version, id) {
constructor(_version, questionnaireSid) {
this._version = _version;
if (!(0, utility_1.isValidPathParam)(id)) {
throw new Error("Parameter 'id' is not valid.");
if (!(0, utility_1.isValidPathParam)(questionnaireSid)) {
throw new Error("Parameter 'questionnaireSid' is not valid.");
}
this._solution = { id };
this._uri = `/Insights/QM/Questionnaires/${id}`;
this._solution = { questionnaireSid };
this._uri = `/Insights/QualityManagement/Questionnaires/${questionnaireSid}`;
}

@@ -76,3 +76,3 @@ remove(params, callback) {

});
operationPromise = operationPromise.then((payload) => new InsightsQuestionnairesInstance(operationVersion, payload, instance._solution.id));
operationPromise = operationPromise.then((payload) => new InsightsQuestionnairesInstance(operationVersion, payload, instance._solution.questionnaireSid));
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);

@@ -94,4 +94,4 @@ return operationPromise;

data["Description"] = params["description"];
if (params["questionIds"] !== undefined)
data["QuestionIds"] = serialize.map(params["questionIds"], (e) => e);
if (params["questionSids"] !== undefined)
data["QuestionSids"] = serialize.map(params["questionSids"], (e) => e);
const headers = {};

@@ -108,3 +108,3 @@ headers["Content-Type"] = "application/x-www-form-urlencoded";

});
operationPromise = operationPromise.then((payload) => new InsightsQuestionnairesInstance(operationVersion, payload, instance._solution.id));
operationPromise = operationPromise.then((payload) => new InsightsQuestionnairesInstance(operationVersion, payload, instance._solution.questionnaireSid));
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);

@@ -127,6 +127,6 @@ return operationPromise;

class InsightsQuestionnairesInstance {
constructor(_version, payload, id) {
constructor(_version, payload, questionnaireSid) {
this._version = _version;
this.accountSid = payload.account_sid;
this.id = payload.id;
this.questionnaireSid = payload.questionnaire_sid;
this.name = payload.name;

@@ -137,3 +137,5 @@ this.description = payload.description;

this.url = payload.url;
this._solution = { id: id || this.id };
this._solution = {
questionnaireSid: questionnaireSid || this.questionnaireSid,
};
}

@@ -143,3 +145,3 @@ get _proxy() {

this._context ||
new InsightsQuestionnairesContextImpl(this._version, this._solution.id);
new InsightsQuestionnairesContextImpl(this._version, this._solution.questionnaireSid);
return this._context;

@@ -164,3 +166,3 @@ }

accountSid: this.accountSid,
id: this.id,
questionnaireSid: this.questionnaireSid,
name: this.name,

@@ -179,9 +181,9 @@ description: this.description,

function InsightsQuestionnairesListInstance(version) {
const instance = ((id) => instance.get(id));
instance.get = function get(id) {
return new InsightsQuestionnairesContextImpl(version, id);
const instance = ((questionnaireSid) => instance.get(questionnaireSid));
instance.get = function get(questionnaireSid) {
return new InsightsQuestionnairesContextImpl(version, questionnaireSid);
};
instance._version = version;
instance._solution = {};
instance._uri = `/Insights/QM/Questionnaires`;
instance._uri = `/Insights/QualityManagement/Questionnaires`;
instance.create = function create(params, callback) {

@@ -200,4 +202,4 @@ if (params === null || params === undefined) {

data["Active"] = serialize.bool(params["active"]);
if (params["questionIds"] !== undefined)
data["QuestionIds"] = serialize.map(params["questionIds"], (e) => e);
if (params["questionSids"] !== undefined)
data["QuestionSids"] = serialize.map(params["questionSids"], (e) => e);
const headers = {};

@@ -204,0 +206,0 @@ headers["Content-Type"] = "application/x-www-form-urlencoded";

@@ -104,3 +104,3 @@ /// <reference types="node" />

export interface InsightsQuestionnairesCategoryContextSolution {
categoryId: string;
categorySid: string;
}

@@ -111,3 +111,3 @@ export declare class InsightsQuestionnairesCategoryContextImpl implements InsightsQuestionnairesCategoryContext {

protected _uri: string;
constructor(_version: V1, categoryId: string);
constructor(_version: V1, categorySid: string);
remove(params?: InsightsQuestionnairesCategoryContextRemoveOptions | ((error: Error | null, item?: boolean) => any), callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;

@@ -128,3 +128,3 @@ update(params: InsightsQuestionnairesCategoryContextUpdateOptions, callback?: (error: Error | null, item?: InsightsQuestionnairesCategoryInstance) => any): Promise<InsightsQuestionnairesCategoryInstance>;

account_sid: string;
category_id: string;
category_sid: string;
name: string;

@@ -137,3 +137,3 @@ url: string;

protected _context?: InsightsQuestionnairesCategoryContext;
constructor(_version: V1, payload: InsightsQuestionnairesCategoryResource, categoryId?: string);
constructor(_version: V1, payload: InsightsQuestionnairesCategoryResource, categorySid?: string);
/**

@@ -144,5 +144,5 @@ * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Flex Insights resource and owns this resource.

/**
* The unique ID for the category
* The SID of the category
*/
categoryId: string;
categorySid: string;
/**

@@ -187,3 +187,3 @@ * The name of this category.

accountSid: string;
categoryId: string;
categorySid: string;
name: string;

@@ -200,4 +200,4 @@ url: string;

_uri: string;
(categoryId: string): InsightsQuestionnairesCategoryContext;
get(categoryId: string): InsightsQuestionnairesCategoryContext;
(categorySid: string): InsightsQuestionnairesCategoryContext;
get(categorySid: string): InsightsQuestionnairesCategoryContext;
/**

@@ -204,0 +204,0 @@ * Create a InsightsQuestionnairesCategoryInstance

@@ -26,9 +26,9 @@ "use strict";

class InsightsQuestionnairesCategoryContextImpl {
constructor(_version, categoryId) {
constructor(_version, categorySid) {
this._version = _version;
if (!(0, utility_1.isValidPathParam)(categoryId)) {
throw new Error("Parameter 'categoryId' is not valid.");
if (!(0, utility_1.isValidPathParam)(categorySid)) {
throw new Error("Parameter 'categorySid' is not valid.");
}
this._solution = { categoryId };
this._uri = `/Insights/QM/Categories/${categoryId}`;
this._solution = { categorySid };
this._uri = `/Insights/QualityManagement/Categories/${categorySid}`;
}

@@ -77,3 +77,3 @@ remove(params, callback) {

});
operationPromise = operationPromise.then((payload) => new InsightsQuestionnairesCategoryInstance(operationVersion, payload, instance._solution.categoryId));
operationPromise = operationPromise.then((payload) => new InsightsQuestionnairesCategoryInstance(operationVersion, payload, instance._solution.categorySid));
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);

@@ -96,9 +96,9 @@ return operationPromise;

class InsightsQuestionnairesCategoryInstance {
constructor(_version, payload, categoryId) {
constructor(_version, payload, categorySid) {
this._version = _version;
this.accountSid = payload.account_sid;
this.categoryId = payload.category_id;
this.categorySid = payload.category_sid;
this.name = payload.name;
this.url = payload.url;
this._solution = { categoryId: categoryId || this.categoryId };
this._solution = { categorySid: categorySid || this.categorySid };
}

@@ -108,3 +108,3 @@ get _proxy() {

this._context ||
new InsightsQuestionnairesCategoryContextImpl(this._version, this._solution.categoryId);
new InsightsQuestionnairesCategoryContextImpl(this._version, this._solution.categorySid);
return this._context;

@@ -126,3 +126,3 @@ }

accountSid: this.accountSid,
categoryId: this.categoryId,
categorySid: this.categorySid,
name: this.name,

@@ -138,9 +138,9 @@ url: this.url,

function InsightsQuestionnairesCategoryListInstance(version) {
const instance = ((categoryId) => instance.get(categoryId));
instance.get = function get(categoryId) {
return new InsightsQuestionnairesCategoryContextImpl(version, categoryId);
const instance = ((categorySid) => instance.get(categorySid));
instance.get = function get(categorySid) {
return new InsightsQuestionnairesCategoryContextImpl(version, categorySid);
};
instance._version = version;
instance._solution = {};
instance._uri = `/Insights/QM/Categories`;
instance._uri = `/Insights/QualityManagement/Categories`;
instance.create = function create(params, callback) {

@@ -147,0 +147,0 @@ if (params === null || params === undefined) {

@@ -21,4 +21,4 @@ /// <reference types="node" />

token?: string;
/** The ID of the category */
categoryId?: string;
/** The SID of the category */
categorySid?: string;
/** The question. */

@@ -35,4 +35,4 @@ question?: string;

export interface InsightsQuestionnairesQuestionListInstanceCreateOptions {
/** The ID of the category */
categoryId: string;
/** The SID of the category */
categorySid: string;
/** The question. */

@@ -55,4 +55,4 @@ question: string;

token?: string;
/** The list of category IDs */
categoryId?: Array<string>;
/** The list of category SIDs */
categorySid?: Array<string>;
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */

@@ -73,4 +73,4 @@ pageSize?: number;

token?: string;
/** The list of category IDs */
categoryId?: Array<string>;
/** The list of category SIDs */
categorySid?: Array<string>;
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */

@@ -87,4 +87,4 @@ pageSize?: number;

token?: string;
/** The list of category IDs */
categoryId?: Array<string>;
/** The list of category SIDs */
categorySid?: Array<string>;
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */

@@ -131,3 +131,3 @@ pageSize?: number;

export interface InsightsQuestionnairesQuestionContextSolution {
questionId: string;
questionSid: string;
}

@@ -138,3 +138,3 @@ export declare class InsightsQuestionnairesQuestionContextImpl implements InsightsQuestionnairesQuestionContext {

protected _uri: string;
constructor(_version: V1, questionId: string);
constructor(_version: V1, questionSid: string);
remove(params?: InsightsQuestionnairesQuestionContextRemoveOptions | ((error: Error | null, item?: boolean) => any), callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;

@@ -155,3 +155,3 @@ update(params: InsightsQuestionnairesQuestionContextUpdateOptions, callback?: (error: Error | null, item?: InsightsQuestionnairesQuestionInstance) => any): Promise<InsightsQuestionnairesQuestionInstance>;

account_sid: string;
question_id: string;
question_sid: string;
question: string;

@@ -170,3 +170,3 @@ description: string;

protected _context?: InsightsQuestionnairesQuestionContext;
constructor(_version: V1, payload: InsightsQuestionnairesQuestionResource, questionId?: string);
constructor(_version: V1, payload: InsightsQuestionnairesQuestionResource, questionSid?: string);
/**

@@ -177,5 +177,5 @@ * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Flex Insights resource and owns this resource.

/**
* The unique ID of the question
* The SID of the question
*/
questionId: string;
questionSid: string;
/**

@@ -244,3 +244,3 @@ * The question.

accountSid: string;
questionId: string;
questionSid: string;
question: string;

@@ -263,4 +263,4 @@ description: string;

_uri: string;
(questionId: string): InsightsQuestionnairesQuestionContext;
get(questionId: string): InsightsQuestionnairesQuestionContext;
(questionSid: string): InsightsQuestionnairesQuestionContext;
get(questionSid: string): InsightsQuestionnairesQuestionContext;
/**

@@ -267,0 +267,0 @@ * Create a InsightsQuestionnairesQuestionInstance

@@ -26,9 +26,9 @@ "use strict";

class InsightsQuestionnairesQuestionContextImpl {
constructor(_version, questionId) {
constructor(_version, questionSid) {
this._version = _version;
if (!(0, utility_1.isValidPathParam)(questionId)) {
throw new Error("Parameter 'questionId' is not valid.");
if (!(0, utility_1.isValidPathParam)(questionSid)) {
throw new Error("Parameter 'questionSid' is not valid.");
}
this._solution = { questionId };
this._uri = `/Insights/QM/Questions/${questionId}`;
this._solution = { questionSid };
this._uri = `/Insights/QualityManagement/Questions/${questionSid}`;
}

@@ -66,4 +66,4 @@ remove(params, callback) {

data["AllowNa"] = serialize.bool(params["allowNa"]);
if (params["categoryId"] !== undefined)
data["CategoryId"] = params["categoryId"];
if (params["categorySid"] !== undefined)
data["CategorySid"] = params["categorySid"];
if (params["question"] !== undefined)

@@ -86,3 +86,3 @@ data["Question"] = params["question"];

});
operationPromise = operationPromise.then((payload) => new InsightsQuestionnairesQuestionInstance(operationVersion, payload, instance._solution.questionId));
operationPromise = operationPromise.then((payload) => new InsightsQuestionnairesQuestionInstance(operationVersion, payload, instance._solution.questionSid));
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);

@@ -105,6 +105,6 @@ return operationPromise;

class InsightsQuestionnairesQuestionInstance {
constructor(_version, payload, questionId) {
constructor(_version, payload, questionSid) {
this._version = _version;
this.accountSid = payload.account_sid;
this.questionId = payload.question_id;
this.questionSid = payload.question_sid;
this.question = payload.question;

@@ -118,3 +118,3 @@ this.description = payload.description;

this.url = payload.url;
this._solution = { questionId: questionId || this.questionId };
this._solution = { questionSid: questionSid || this.questionSid };
}

@@ -124,3 +124,3 @@ get _proxy() {

this._context ||
new InsightsQuestionnairesQuestionContextImpl(this._version, this._solution.questionId);
new InsightsQuestionnairesQuestionContextImpl(this._version, this._solution.questionSid);
return this._context;

@@ -142,3 +142,3 @@ }

accountSid: this.accountSid,
questionId: this.questionId,
questionSid: this.questionSid,
question: this.question,

@@ -160,9 +160,9 @@ description: this.description,

function InsightsQuestionnairesQuestionListInstance(version) {
const instance = ((questionId) => instance.get(questionId));
instance.get = function get(questionId) {
return new InsightsQuestionnairesQuestionContextImpl(version, questionId);
const instance = ((questionSid) => instance.get(questionSid));
instance.get = function get(questionSid) {
return new InsightsQuestionnairesQuestionContextImpl(version, questionSid);
};
instance._version = version;
instance._solution = {};
instance._uri = `/Insights/QM/Questions`;
instance._uri = `/Insights/QualityManagement/Questions`;
instance.create = function create(params, callback) {

@@ -172,4 +172,4 @@ if (params === null || params === undefined) {

}
if (params["categoryId"] === null || params["categoryId"] === undefined) {
throw new Error("Required parameter \"params['categoryId']\" missing.");
if (params["categorySid"] === null || params["categorySid"] === undefined) {
throw new Error("Required parameter \"params['categorySid']\" missing.");
}

@@ -186,3 +186,3 @@ if (params["question"] === null || params["question"] === undefined) {

let data = {};
data["CategoryId"] = params["categoryId"];
data["CategorySid"] = params["categorySid"];
data["Question"] = params["question"];

@@ -216,4 +216,4 @@ data["AnswerSetId"] = params["answerSetId"];

let data = {};
if (params["categoryId"] !== undefined)
data["CategoryId"] = serialize.map(params["categoryId"], (e) => e);
if (params["categorySid"] !== undefined)
data["CategorySid"] = serialize.map(params["categorySid"], (e) => e);
if (params["pageSize"] !== undefined)

@@ -220,0 +220,0 @@ data["PageSize"] = params["pageSize"];

@@ -7,9 +7,2 @@ /// <reference types="node" />

/**
* Options to pass to fetch a InsightsSegmentsInstance
*/
export interface InsightsSegmentsContextFetchOptions {
/** The Token HTTP request header */
token?: string;
}
/**
* Options to pass to each

@@ -20,2 +13,4 @@ */

token?: string;
/** To unique id of the segment */
segmentId?: string;
/** The list of reservation Ids */

@@ -38,2 +33,4 @@ reservationId?: Array<string>;

token?: string;
/** To unique id of the segment */
segmentId?: string;
/** The list of reservation Ids */

@@ -52,2 +49,4 @@ reservationId?: Array<string>;

token?: string;
/** To unique id of the segment */
segmentId?: string;
/** The list of reservation Ids */

@@ -62,21 +61,59 @@ reservationId?: Array<string>;

}
export interface InsightsSegmentsContext {
export interface InsightsSegmentsSolution {
}
export interface InsightsSegmentsListInstance {
_version: V1;
_solution: InsightsSegmentsSolution;
_uri: string;
/**
* Fetch a InsightsSegmentsInstance
* Streams InsightsSegmentsInstance records from the API.
*
* @param callback - Callback to handle processed record
* This operation lazily loads records as efficiently as possible until the limit
* is reached.
*
* @returns Resolves to processed InsightsSegmentsInstance
* The results are passed into the callback function, so this operation is memory
* efficient.
*
* If a function is passed as the first argument, it will be used as the callback
* function.
*
* @param { InsightsSegmentsListInstanceEachOptions } [params] - Options for request
* @param { function } [callback] - Function to process each record
*/
fetch(callback?: (error: Error | null, item?: InsightsSegmentsInstance) => any): Promise<InsightsSegmentsInstance>;
each(callback?: (item: InsightsSegmentsInstance, done: (err?: Error) => void) => void): void;
each(params: InsightsSegmentsListInstanceEachOptions, callback?: (item: InsightsSegmentsInstance, done: (err?: Error) => void) => void): void;
/**
* Fetch a InsightsSegmentsInstance
* Retrieve a single target page of InsightsSegmentsInstance records from the API.
*
* @param params - Parameter for request
* @param callback - Callback to handle processed record
* The request is executed immediately.
*
* @returns Resolves to processed InsightsSegmentsInstance
* @param { string } [targetUrl] - API-generated URL for the requested results page
* @param { function } [callback] - Callback to handle list of records
*/
fetch(params: InsightsSegmentsContextFetchOptions, callback?: (error: Error | null, item?: InsightsSegmentsInstance) => any): Promise<InsightsSegmentsInstance>;
getPage(targetUrl: string, callback?: (error: Error | null, items: InsightsSegmentsPage) => any): Promise<InsightsSegmentsPage>;
/**
* Lists InsightsSegmentsInstance records from the API as a list.
*
* If a function is passed as the first argument, it will be used as the callback
* function.
*
* @param { InsightsSegmentsListInstanceOptions } [params] - Options for request
* @param { function } [callback] - Callback to handle list of records
*/
list(callback?: (error: Error | null, items: InsightsSegmentsInstance[]) => any): Promise<InsightsSegmentsInstance[]>;
list(params: InsightsSegmentsListInstanceOptions, callback?: (error: Error | null, items: InsightsSegmentsInstance[]) => any): Promise<InsightsSegmentsInstance[]>;
/**
* Retrieve a single page of InsightsSegmentsInstance records from the API.
*
* The request is executed immediately.
*
* If a function is passed as the first argument, it will be used as the callback
* function.
*
* @param { InsightsSegmentsListInstancePageOptions } [params] - Options for request
* @param { function } [callback] - Callback to handle list of records
*/
page(callback?: (error: Error | null, items: InsightsSegmentsPage) => any): Promise<InsightsSegmentsPage>;
page(params: InsightsSegmentsListInstancePageOptions, callback?: (error: Error | null, items: InsightsSegmentsPage) => any): Promise<InsightsSegmentsPage>;
/**
* Provide a user-friendly representation

@@ -87,19 +124,3 @@ */

}
export interface InsightsSegmentsContextSolution {
segmentId: string;
}
export declare class InsightsSegmentsContextImpl implements InsightsSegmentsContext {
protected _version: V1;
protected _solution: InsightsSegmentsContextSolution;
protected _uri: string;
constructor(_version: V1, segmentId: string);
fetch(params?: InsightsSegmentsContextFetchOptions | ((error: Error | null, item?: InsightsSegmentsInstance) => any), callback?: (error: Error | null, item?: InsightsSegmentsInstance) => any): Promise<InsightsSegmentsInstance>;
/**
* Provide a user-friendly representation
*
* @returns Object
*/
toJSON(): InsightsSegmentsContextSolution;
[inspect.custom](_depth: any, options: InspectOptions): string;
}
export declare function InsightsSegmentsListInstance(version: V1): InsightsSegmentsListInstance;
interface InsightsSegmentsPayload extends TwilioResponsePayload {

@@ -134,5 +155,3 @@ segments: InsightsSegmentsResource[];

protected _version: V1;
protected _solution: InsightsSegmentsContextSolution;
protected _context?: InsightsSegmentsContext;
constructor(_version: V1, payload: InsightsSegmentsResource, segmentId?: string);
constructor(_version: V1, payload: InsightsSegmentsResource);
/**

@@ -217,21 +236,3 @@ * To unique id of the segment

url: string;
private get _proxy();
/**
* Fetch a InsightsSegmentsInstance
*
* @param callback - Callback to handle processed record
*
* @returns Resolves to processed InsightsSegmentsInstance
*/
fetch(callback?: (error: Error | null, item?: InsightsSegmentsInstance) => any): Promise<InsightsSegmentsInstance>;
/**
* Fetch a InsightsSegmentsInstance
*
* @param params - Parameter for request
* @param callback - Callback to handle processed record
*
* @returns Resolves to processed InsightsSegmentsInstance
*/
fetch(params: InsightsSegmentsContextFetchOptions, callback?: (error: Error | null, item?: InsightsSegmentsInstance) => any): Promise<InsightsSegmentsInstance>;
/**
* Provide a user-friendly representation

@@ -267,67 +268,2 @@ *

}
export interface InsightsSegmentsSolution {
}
export interface InsightsSegmentsListInstance {
_version: V1;
_solution: InsightsSegmentsSolution;
_uri: string;
(segmentId: string): InsightsSegmentsContext;
get(segmentId: string): InsightsSegmentsContext;
/**
* Streams InsightsSegmentsInstance records from the API.
*
* This operation lazily loads records as efficiently as possible until the limit
* is reached.
*
* The results are passed into the callback function, so this operation is memory
* efficient.
*
* If a function is passed as the first argument, it will be used as the callback
* function.
*
* @param { InsightsSegmentsListInstanceEachOptions } [params] - Options for request
* @param { function } [callback] - Function to process each record
*/
each(callback?: (item: InsightsSegmentsInstance, done: (err?: Error) => void) => void): void;
each(params: InsightsSegmentsListInstanceEachOptions, callback?: (item: InsightsSegmentsInstance, done: (err?: Error) => void) => void): void;
/**
* Retrieve a single target page of InsightsSegmentsInstance records from the API.
*
* The request is executed immediately.
*
* @param { string } [targetUrl] - API-generated URL for the requested results page
* @param { function } [callback] - Callback to handle list of records
*/
getPage(targetUrl: string, callback?: (error: Error | null, items: InsightsSegmentsPage) => any): Promise<InsightsSegmentsPage>;
/**
* Lists InsightsSegmentsInstance records from the API as a list.
*
* If a function is passed as the first argument, it will be used as the callback
* function.
*
* @param { InsightsSegmentsListInstanceOptions } [params] - Options for request
* @param { function } [callback] - Callback to handle list of records
*/
list(callback?: (error: Error | null, items: InsightsSegmentsInstance[]) => any): Promise<InsightsSegmentsInstance[]>;
list(params: InsightsSegmentsListInstanceOptions, callback?: (error: Error | null, items: InsightsSegmentsInstance[]) => any): Promise<InsightsSegmentsInstance[]>;
/**
* Retrieve a single page of InsightsSegmentsInstance records from the API.
*
* The request is executed immediately.
*
* If a function is passed as the first argument, it will be used as the callback
* function.
*
* @param { InsightsSegmentsListInstancePageOptions } [params] - Options for request
* @param { function } [callback] - Callback to handle list of records
*/
page(callback?: (error: Error | null, items: InsightsSegmentsPage) => any): Promise<InsightsSegmentsPage>;
page(params: InsightsSegmentsListInstancePageOptions, callback?: (error: Error | null, items: InsightsSegmentsPage) => any): Promise<InsightsSegmentsPage>;
/**
* Provide a user-friendly representation
*/
toJSON(): any;
[inspect.custom](_depth: any, options: InspectOptions): any;
}
export declare function InsightsSegmentsListInstance(version: V1): InsightsSegmentsListInstance;
export declare class InsightsSegmentsPage extends Page<V1, InsightsSegmentsPayload, InsightsSegmentsResource, InsightsSegmentsInstance> {

@@ -334,0 +270,0 @@ /**

@@ -19,3 +19,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.InsightsSegmentsPage = exports.InsightsSegmentsListInstance = exports.InsightsSegmentsInstance = exports.InsightsSegmentsContextImpl = void 0;
exports.InsightsSegmentsPage = exports.InsightsSegmentsInstance = exports.InsightsSegmentsListInstance = void 0;
const util_1 = require("util");

@@ -25,13 +25,8 @@ const Page_1 = __importDefault(require("../../../base/Page"));

const serialize = require("../../../base/serialize");
const utility_1 = require("../../../base/utility");
class InsightsSegmentsContextImpl {
constructor(_version, segmentId) {
this._version = _version;
if (!(0, utility_1.isValidPathParam)(segmentId)) {
throw new Error("Parameter 'segmentId' is not valid.");
}
this._solution = { segmentId };
this._uri = `/Insights/Segments/${segmentId}`;
}
fetch(params, callback) {
function InsightsSegmentsListInstance(version) {
const instance = {};
instance._version = version;
instance._solution = {};
instance._uri = `/Insights/Segments`;
instance.page = function page(params, callback) {
if (params instanceof Function) {

@@ -45,7 +40,16 @@ callback = params;

let data = {};
if (params["segmentId"] !== undefined)
data["SegmentId"] = params["segmentId"];
if (params["reservationId"] !== undefined)
data["ReservationId"] = serialize.map(params["reservationId"], (e) => e);
if (params["pageSize"] !== undefined)
data["PageSize"] = params["pageSize"];
if (params.pageNumber !== undefined)
data["Page"] = params.pageNumber;
if (params.pageToken !== undefined)
data["PageToken"] = params.pageToken;
const headers = {};
if (params["token"] !== undefined)
headers["Token"] = params["token"];
const instance = this;
let operationVersion = instance._version, operationPromise = operationVersion.fetch({
let operationVersion = version, operationPromise = operationVersion.page({
uri: instance._uri,

@@ -56,21 +60,28 @@ method: "get",

});
operationPromise = operationPromise.then((payload) => new InsightsSegmentsInstance(operationVersion, payload, instance._solution.segmentId));
operationPromise = operationPromise.then((payload) => new InsightsSegmentsPage(operationVersion, payload, instance._solution));
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
return operationPromise;
}
/**
* Provide a user-friendly representation
*
* @returns Object
*/
toJSON() {
return this._solution;
}
[util_1.inspect.custom](_depth, options) {
return (0, util_1.inspect)(this.toJSON(), options);
}
};
instance.each = instance._version.each;
instance.list = instance._version.list;
instance.getPage = function getPage(targetUrl, callback) {
const operationPromise = instance._version._domain.twilio.request({
method: "get",
uri: targetUrl,
});
let pagePromise = operationPromise.then((payload) => new InsightsSegmentsPage(instance._version, payload, instance._solution));
pagePromise = instance._version.setPromiseCallback(pagePromise, callback);
return pagePromise;
};
instance.toJSON = function toJSON() {
return instance._solution;
};
instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
return (0, util_1.inspect)(instance.toJSON(), options);
};
return instance;
}
exports.InsightsSegmentsContextImpl = InsightsSegmentsContextImpl;
exports.InsightsSegmentsListInstance = InsightsSegmentsListInstance;
class InsightsSegmentsInstance {
constructor(_version, payload, segmentId) {
constructor(_version, payload) {
this._version = _version;

@@ -99,13 +110,3 @@ this.segmentId = payload.segment_id;

this.url = payload.url;
this._solution = { segmentId: segmentId || this.segmentId };
}
get _proxy() {
this._context =
this._context ||
new InsightsSegmentsContextImpl(this._version, this._solution.segmentId);
return this._context;
}
fetch(params, callback) {
return this._proxy.fetch(params, callback);
}
/**

@@ -147,60 +148,2 @@ * Provide a user-friendly representation

exports.InsightsSegmentsInstance = InsightsSegmentsInstance;
function InsightsSegmentsListInstance(version) {
const instance = ((segmentId) => instance.get(segmentId));
instance.get = function get(segmentId) {
return new InsightsSegmentsContextImpl(version, segmentId);
};
instance._version = version;
instance._solution = {};
instance._uri = `/Insights/Segments`;
instance.page = function page(params, callback) {
if (params instanceof Function) {
callback = params;
params = {};
}
else {
params = params || {};
}
let data = {};
if (params["reservationId"] !== undefined)
data["ReservationId"] = serialize.map(params["reservationId"], (e) => e);
if (params["pageSize"] !== undefined)
data["PageSize"] = params["pageSize"];
if (params.pageNumber !== undefined)
data["Page"] = params.pageNumber;
if (params.pageToken !== undefined)
data["PageToken"] = params.pageToken;
const headers = {};
if (params["token"] !== undefined)
headers["Token"] = params["token"];
let operationVersion = version, operationPromise = operationVersion.page({
uri: instance._uri,
method: "get",
params: data,
headers,
});
operationPromise = operationPromise.then((payload) => new InsightsSegmentsPage(operationVersion, payload, instance._solution));
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
return operationPromise;
};
instance.each = instance._version.each;
instance.list = instance._version.list;
instance.getPage = function getPage(targetUrl, callback) {
const operationPromise = instance._version._domain.twilio.request({
method: "get",
uri: targetUrl,
});
let pagePromise = operationPromise.then((payload) => new InsightsSegmentsPage(instance._version, payload, instance._solution));
pagePromise = instance._version.setPromiseCallback(pagePromise, callback);
return pagePromise;
};
instance.toJSON = function toJSON() {
return instance._solution;
};
instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
return (0, util_1.inspect)(instance.toJSON(), options);
};
return instance;
}
exports.InsightsSegmentsListInstance = InsightsSegmentsListInstance;
class InsightsSegmentsPage extends Page_1.default {

@@ -207,0 +150,0 @@ /**

@@ -24,3 +24,3 @@ "use strict";

instance._solution = {};
instance._uri = `/Insights/QM/Settings/AnswerSets`;
instance._uri = `/Insights/QualityManagement/Settings/AnswerSets`;
instance.fetch = function fetch(params, callback) {

@@ -27,0 +27,0 @@ if (params instanceof Function) {

@@ -24,3 +24,3 @@ "use strict";

instance._solution = {};
instance._uri = `/Insights/QM/Settings/CommentTags`;
instance._uri = `/Insights/QualityManagement/Settings/CommentTags`;
instance.fetch = function fetch(params, callback) {

@@ -27,0 +27,0 @@ if (params instanceof Function) {

@@ -11,3 +11,2 @@ import MessagingBase from "../MessagingBase";

import { ServiceListInstance } from "./v1/service";
import { TollfreeVerificationListInstance } from "./v1/tollfreeVerification";
import { UsecaseListInstance } from "./v1/usecase";

@@ -37,4 +36,2 @@ export default class V1 extends Version {

protected _services?: ServiceListInstance;
/** tollfreeVerifications - { Twilio.Messaging.V1.TollfreeVerificationListInstance } resource */
protected _tollfreeVerifications?: TollfreeVerificationListInstance;
/** usecases - { Twilio.Messaging.V1.UsecaseListInstance } resource */

@@ -58,6 +55,4 @@ protected _usecases?: UsecaseListInstance;

get services(): ServiceListInstance;
/** Getter for tollfreeVerifications resource */
get tollfreeVerifications(): TollfreeVerificationListInstance;
/** Getter for usecases resource */
get usecases(): UsecaseListInstance;
}

@@ -28,3 +28,2 @@ "use strict";

const service_1 = require("./v1/service");
const tollfreeVerification_1 = require("./v1/tollfreeVerification");
const usecase_1 = require("./v1/usecase");

@@ -87,8 +86,2 @@ class V1 extends Version_1.default {

}
/** Getter for tollfreeVerifications resource */
get tollfreeVerifications() {
this._tollfreeVerifications =
this._tollfreeVerifications || (0, tollfreeVerification_1.TollfreeVerificationListInstance)(this);
return this._tollfreeVerifications;
}
/** Getter for usecases resource */

@@ -95,0 +88,0 @@ get usecases() {

@@ -8,4 +8,2 @@ /// <reference types="node" />

export interface DomainConfigContextUpdateOptions {
/** A list of messagingServiceSids (with prefix MG) */
messagingServiceSids: Array<string>;
/** Any requests we receive to this domain that do not match an existing shortened message will be redirected to the fallback url. These will likely be either expired messages, random misdirected traffic, or intentional scraping. */

@@ -15,4 +13,2 @@ fallbackUrl?: string;

callbackUrl?: string;
/** An action type for messaging_service_sids operation (ADD, DELETE, REPLACE) */
messagingServiceSidsAction?: string;
}

@@ -31,2 +27,10 @@ export interface DomainConfigContext {

*
* @param callback - Callback to handle processed record
*
* @returns Resolves to processed DomainConfigInstance
*/
update(callback?: (error: Error | null, item?: DomainConfigInstance) => any): Promise<DomainConfigInstance>;
/**
* Update a DomainConfigInstance
*
* @param params - Parameter for request

@@ -53,3 +57,3 @@ * @param callback - Callback to handle processed record

fetch(callback?: (error: Error | null, item?: DomainConfigInstance) => any): Promise<DomainConfigInstance>;
update(params: DomainConfigContextUpdateOptions, callback?: (error: Error | null, item?: DomainConfigInstance) => any): Promise<DomainConfigInstance>;
update(params?: DomainConfigContextUpdateOptions | ((error: Error | null, item?: DomainConfigInstance) => any), callback?: (error: Error | null, item?: DomainConfigInstance) => any): Promise<DomainConfigInstance>;
/**

@@ -66,3 +70,2 @@ * Provide a user-friendly representation

config_sid: string;
messaging_service_sids: Array<string>;
fallback_url: string;

@@ -88,6 +91,2 @@ callback_url: string;

/**
* A list of messagingServiceSids (with prefix MG).
*/
messagingServiceSids: Array<string>;
/**
* Any requests we receive to this domain that do not match an existing shortened message will be redirected to the fallback url. These will likely be either expired messages, random misdirected traffic, or intentional scraping.

@@ -121,2 +120,10 @@ */

*
* @param callback - Callback to handle processed record
*
* @returns Resolves to processed DomainConfigInstance
*/
update(callback?: (error: Error | null, item?: DomainConfigInstance) => any): Promise<DomainConfigInstance>;
/**
* Update a DomainConfigInstance
*
* @param params - Parameter for request

@@ -136,3 +143,2 @@ * @param callback - Callback to handle processed record

configSid: string;
messagingServiceSids: string[];
fallbackUrl: string;

@@ -139,0 +145,0 @@ callbackUrl: string;

@@ -41,11 +41,10 @@ "use strict";

update(params, callback) {
if (params === null || params === undefined) {
throw new Error('Required parameter "params" missing.');
if (params instanceof Function) {
callback = params;
params = {};
}
if (params["messagingServiceSids"] === null ||
params["messagingServiceSids"] === undefined) {
throw new Error("Required parameter \"params['messagingServiceSids']\" missing.");
else {
params = params || {};
}
let data = {};
data["MessagingServiceSids"] = serialize.map(params["messagingServiceSids"], (e) => e);
if (params["fallbackUrl"] !== undefined)

@@ -55,4 +54,2 @@ data["FallbackUrl"] = params["fallbackUrl"];

data["CallbackUrl"] = params["callbackUrl"];
if (params["messagingServiceSidsAction"] !== undefined)
data["MessagingServiceSidsAction"] = params["messagingServiceSidsAction"];
const headers = {};

@@ -89,3 +86,2 @@ headers["Content-Type"] = "application/x-www-form-urlencoded";

this.configSid = payload.config_sid;
this.messagingServiceSids = payload.messaging_service_sids;
this.fallbackUrl = payload.fallback_url;

@@ -126,3 +122,2 @@ this.callbackUrl = payload.callback_url;

configSid: this.configSid,
messagingServiceSids: this.messagingServiceSids,
fallbackUrl: this.fallbackUrl,

@@ -129,0 +124,0 @@ callbackUrl: this.callbackUrl,

@@ -17,3 +17,3 @@ /// <reference types="node" />

export interface ServiceContextUpdateOptions {
/** A descriptive string that you create to describe the verification service. It can be up to 30 characters long. **This value should not contain PII.** */
/** A descriptive string that you create to describe the verification service. It can be up to 32 characters long. **This value should not contain PII.** */
friendlyName?: string;

@@ -57,3 +57,3 @@ /** The length of the verification code to generate. Must be an integer value between 4 and 10, inclusive. */

export interface ServiceListInstanceCreateOptions {
/** A descriptive string that you create to describe the verification service. It can be up to 30 characters long. **This value should not contain PII.** */
/** A descriptive string that you create to describe the verification service. It can be up to 32 characters long. **This value should not contain PII.** */
friendlyName: string;

@@ -243,3 +243,3 @@ /** The length of the verification code to generate. Must be an integer value between 4 and 10, inclusive. */

/**
* The string that you assigned to describe the verification service. **This value should not contain PII.**
* The string that you assigned to describe the verification service. It can be up to 32 characters long. **This value should not contain PII.**
*/

@@ -246,0 +246,0 @@ friendlyName: string;

@@ -10,3 +10,3 @@ /// <reference types="node" />

export interface TemplateListInstanceEachOptions {
/** String filter used to query templates with a given friendly name */
/** String filter used to query templates with a given friendly name. */
friendlyName?: string;

@@ -26,3 +26,3 @@ /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */

export interface TemplateListInstanceOptions {
/** String filter used to query templates with a given friendly name */
/** String filter used to query templates with a given friendly name. */
friendlyName?: string;

@@ -38,3 +38,3 @@ /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */

export interface TemplateListInstancePageOptions {
/** String filter used to query templates with a given friendly name */
/** String filter used to query templates with a given friendly name. */
friendlyName?: string;

@@ -133,7 +133,7 @@ /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */

/**
* A descriptive string that you create to describe a Template.
* A descriptive string that you create to describe a Template. It can be up to 32 characters long.
*/
friendlyName: string;
/**
* A list of channels that support the Template. Can include: sms, voice
* A list of channels that support the Template. Can include: sms, voice.
*/

@@ -140,0 +140,0 @@ channels: Array<string>;

{
"name": "twilio",
"description": "A Twilio helper library",
"version": "4.10.0",
"version": "4.11.0",
"author": "API Team <api@twilio.com>",

@@ -6,0 +6,0 @@ "contributors": [

@@ -22,8 +22,11 @@ # twilio-node

* Node.js 14
* Node.js 16
* Node.js 18
- Node.js 14
- Node.js 16
- Node.js 18
TypeScript is supported for TypeScript version 2.9 and above.
> **Warning**
> Do not use this Node.js library in a front-end application. Doing so can expose your Twilio credentials to end-users as part of the bundled HTML/JavaScript sent to their browser.
## Installation

@@ -33,4 +36,29 @@

## Sample Usage
### Test your installation
To make sure the installation was successful, try sending yourself an SMS message, like this:
```js
// Your AccountSID and Auth Token from console.twilio.com
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);
client.messages
.create({
body: 'Hello from twilio-node',
to: '+12345678901', // Text your number
from: '+12345678901', // From a valid Twilio number
})
.then((message) => console.log(message.sid));
```
After a brief delay, you will receive the text message on your phone.
> **Warning**
> It's okay to hardcode your credentials when testing locally, but you should use environment variables to keep them secret before committing any code or deploying to production. Check out [How to Set Environment Variables](https://www.twilio.com/blog/2017/01/how-to-set-environment-variables.html) for more information.
## Usage
Check out these [code examples](examples) in JavaScript and TypeScript to get up and running quickly.

@@ -45,12 +73,14 @@

### Client Initialization
If you invoke any V2010 operations without specifying an account SID, `twilio-node` will automatically use the `TWILIO_ACCOUNT_SID` value that the client was initialized with. This is useful for when you'd like to, for example, fetch resources for your main account but also your subaccount. See below:
```javascript
var accountSid = process.env.TWILIO_ACCOUNT_SID; // Your Account SID from www.twilio.com/console
var authToken = process.env.TWILIO_AUTH_TOKEN; // Your Auth Token from www.twilio.com/console
var subaccountSid = process.env.TWILIO_ACCOUNT_SUBACCOUNT_SID; // Your Subaccount SID from www.twilio.com/console
// Your Account SID, Subaccount SID Auth Token from console.twilio.com
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const subaccountSid = process.env.TWILIO_ACCOUNT_SUBACCOUNT_SID;
const client = require('twilio')(accountSid, authToken);
const mainAccountCalls = client.api.v2010.account.calls.list; // SID not specified, so defaults to accountSid
const subaccountCalls = client.api.v2010.account(subaccountSid).calls.list // SID specified as subaccountSid
const subaccountCalls = client.api.v2010.account(subaccountSid).calls.list; // SID specified as subaccountSid
```

@@ -61,8 +91,10 @@

`twilio-node` supports lazy loading required modules for faster loading time. Lazy loading is enabled by default. To disable lazy loading, simply instantiate the Twilio client with the `lazyLoading` flag set to `false`:
```javascript
var accountSid = process.env.TWILIO_ACCOUNT_SID; // Your Account SID from www.twilio.com/console
var authToken = process.env.TWILIO_AUTH_TOKEN; // Your Auth Token from www.twilio.com/console
// Your Account SID and Auth Token from console.twilio.com
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const client = require('twilio')(accountSid, authToken, {
lazyLoading: false
lazyLoading: false,
});

@@ -78,8 +110,8 @@ ```

```javascript
var accountSid = process.env.TWILIO_ACCOUNT_SID; // Your Account SID from www.twilio.com/console
var authToken = process.env.TWILIO_AUTH_TOKEN; // Your Auth Token from www.twilio.com/console
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const client = require('twilio')(accountSid, authToken, {
autoRetry: true,
maxRetries: 3
autoRetry: true,
maxRetries: 3,
});

@@ -93,8 +125,8 @@ ```

```javascript
var accountSid = process.env.TWILIO_ACCOUNT_SID; // Your Account SID from www.twilio.com/console
var authToken = process.env.TWILIO_AUTH_TOKEN; // Your Auth Token from www.twilio.com/console
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const client = require('twilio')(accountSid, authToken, {
region: 'au1',
edge: 'sydney',
region: 'au1',
edge: 'sydney',
});

@@ -113,13 +145,34 @@ ```

### Iterate through records
The library automatically handles paging for you. Collections, such as `calls` and `messages`, have `list` and `each` methods that page under the hood. With both `list` and `each`, you can specify the number of records you want to receive (`limit`) and the maximum size you want each page fetch to be (`pageSize`). The library will then handle the task for you.
`list` eagerly fetches all records and returns them as a list, whereas `each` streams records and lazily retrieves pages of records as you iterate over the collection. You can also page manually using the `page` method.
For more information about these methods, view the [auto-generated library docs](https://www.twilio.com/docs/libraries/reference/twilio-node/).
```js
// Your Account SID and Auth Token from console.twilio.com
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);
client.calls.each((call) => console.log(call.direction));
```
### Enable Debug Logging
There are two ways to enable debug logging in the default HTTP client. You can create an environment variable called `TWILIO_LOG_LEVEL` and set it to `debug` or you can set the logLevel variable on the client as debug:
```javascript
var accountSid = process.env.TWILIO_ACCOUNT_SID; // Your Account SID from www.twilio.com/console
var authToken = process.env.TWILIO_AUTH_TOKEN; // Your Auth Token from www.twilio.com/console
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const client = require('twilio')(accountSid, authToken, {
logLevel: 'debug'
logLevel: 'debug',
});
```
You can also set the logLevel variable on the client after constructing the Twilio client:
```javascript

@@ -130,15 +183,83 @@ const client = require('twilio')(accountSid, authToken);

## Using webhook validation
See [example](examples/express.js) for a code sample for incoming Twilio request validation.
### Debug API requests
## Handling Exceptions
To assist with debugging, the library allows you to access the underlying request and response objects. This capability is built into the default HTTP client that ships with the library.
For an example on how to handle exceptions in this helper library, please see the [Twilio documentation](https://www.twilio.com/docs/libraries/node#exceptions).
For example, you can retrieve the status code of the last response like so:
## Using a Custom HTTP Client
```js
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
To use a custom HTTP client with this helper library, please see the [Twilio documentation](https://www.twilio.com/docs/libraries/node/custom-http-clients-node).
const client = require('twilio')(accountSid, authToken);
## Docker Image
client.messages
.create({
to: '+14158675309',
from: '+14258675310',
body: 'Ahoy!',
})
.then(() => {
// Access details about the last request
console.log(client.lastRequest.method);
console.log(client.lastRequest.url);
console.log(client.lastRequest.auth);
console.log(client.lastRequest.params);
console.log(client.lastRequest.headers);
console.log(client.lastRequest.data);
// Access details about the last response
console.log(client.httpClient.lastResponse.statusCode);
console.log(client.httpClient.lastResponse.body);
});
```
### Handle exceptions
If the Twilio API returns a 400 or a 500 level HTTP response, `twilio-node` will throw an error including relevant information, which you can then `catch`:
```js
client.messages
.create({
body: 'Hello from Node',
to: '+12345678901',
from: '+12345678901',
})
.then((message) => console.log(message))
.catch((error) => {
// You can implement your fallback code here
console.log(error);
});
```
or with `async/await`:
```js
try {
const message = await client.messages.create({
body: 'Hello from Node',
to: '+12345678901',
from: '+12345678901',
});
console.log(message);
} catch (error) {
// You can implement your fallback code here
console.error(error);
}
```
If you are using callbacks, error information will be included in the `error` parameter of the callback.
400-level errors are [normal during API operation](https://www.twilio.com/docs/api/rest/request#get-responses) ("Invalid number", "Cannot deliver SMS to that number", for example) and should be handled appropriately.
### Use a custom HTTP Client
To use a custom HTTP client with this helper library, please see the [advanced example of how to do so](./advanced-examples/custom-http-client.md).
### Use webhook validation
See [example](examples/express.js) for a code sample for incoming Twilio request validation.
## Docker image
The `Dockerfile` present in this repository and its respective `twilio/twilio-node` Docker image are currently used by Twilio for testing purposes only.

@@ -160,3 +281,3 @@

#### Getting Started
### Get started

@@ -163,0 +284,0 @@ If you want to familiarize yourself with the project, you can start by [forking the repository](https://help.github.com/articles/fork-a-repo/) and [cloning it in your local development environment](https://help.github.com/articles/cloning-a-repository/). The project requires [Node.js](https://nodejs.org) to be installed on your machine.

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc