From 5a3916dc0bc799cb3ca5340f39f8ecadee507588 Mon Sep 17 00:00:00 2001 From: Twilio Date: Fri, 17 Nov 2023 10:39:17 +0000 Subject: [PATCH] [Librarian] Regenerated @ 24dcf52b3ba6769ea21d08329aa544a79742b6c2 --- CHANGES.md | 26 ++ src/rest/insights/v1/call/annotation.ts | 3 - .../messaging/v1/service/channelSender.ts | 3 + src/rest/messaging/v1/tollfreeVerification.ts | 11 + src/rest/taskrouter/v1/workspace/task.ts | 8 +- .../v1/complianceTollfreeInquiries.ts | 268 ++++-------------- src/rest/verify/v2/service/verification.ts | 3 + 7 files changed, 109 insertions(+), 213 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 4c86cb6f1..ef08c6b96 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,32 @@ twilio-node changelog ===================== +[2023-11-17] Version 4.19.2 +--------------------------- +**Library - Chore** +- [PR #971](https://github.com/twilio/twilio-node/pull/971): Update axios to 1.6 to pull in fix for CVE 2023 45857. Thanks to [@kitu-apietila](https://github.com/kitu-apietila)! +- [PR #963](https://github.com/twilio/twilio-node/pull/963): Removing Test Related To Deprecated Endpoint - OAuth. Thanks to [@KobeBrooks](https://github.com/KobeBrooks)! +- [PR #958](https://github.com/twilio/twilio-node/pull/958): twilio help changes. Thanks to [@kridai](https://github.com/kridai)! +- [PR #978](https://github.com/twilio/twilio-node/pull/978): Removed LTS version. Thanks to [@tiwarishubham635](https://github.com/tiwarishubham635)! + +**Api** +- Update documentation to reflect RiskCheck GA + +**Messaging** +- Add tollfree edit_allowed and edit_reason fields +- Update Phone Number, Short Code, Alpha Sender, US A2P and Channel Sender documentation + +**Taskrouter** +- Add container attribute to task_queue_bulk_real_time_statistics endpoint + +**Trusthub** +- Rename did to tollfree_phone_number in compliance_tollfree_inquiry.json +- Add new optional field notification_email to compliance_tollfree_inquiry.json + +**Verify** +- Add `Tags` optional parameter on Verification creation. + + [2023-11-06] Version 4.19.1 --------------------------- **Flex** diff --git a/src/rest/insights/v1/call/annotation.ts b/src/rest/insights/v1/call/annotation.ts index 21ed2dae4..f3444eb60 100644 --- a/src/rest/insights/v1/call/annotation.ts +++ b/src/rest/insights/v1/call/annotation.ts @@ -271,9 +271,6 @@ export class AnnotationInstance { * Incident or support ticket associated with this call. The `incident` property is of type string with a maximum character limit of 100. Twilio does not treat this field as PII, so no PII should be included in `incident`. */ incident: string; - /** - * The URL of this resource. - */ url: string; private get _proxy(): AnnotationContext { diff --git a/src/rest/messaging/v1/service/channelSender.ts b/src/rest/messaging/v1/service/channelSender.ts index 40bf6921f..563ef3f85 100644 --- a/src/rest/messaging/v1/service/channelSender.ts +++ b/src/rest/messaging/v1/service/channelSender.ts @@ -213,6 +213,9 @@ export class ChannelSenderInstance { * The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. */ dateUpdated: Date; + /** + * The absolute URL of the ChannelSender resource. + */ url: string; private get _proxy(): ChannelSenderContext { diff --git a/src/rest/messaging/v1/tollfreeVerification.ts b/src/rest/messaging/v1/tollfreeVerification.ts index caddf98dc..779d60514 100644 --- a/src/rest/messaging/v1/tollfreeVerification.ts +++ b/src/rest/messaging/v1/tollfreeVerification.ts @@ -77,6 +77,8 @@ export interface TollfreeVerificationContextUpdateOptions { businessContactEmail?: string; /** The phone number of the contact for the business or organization using the Tollfree number. */ businessContactPhone?: string; + /** Describe why the verification is being edited. If the verification was rejected because of a technical issue, such as the website being down, and the issue has been resolved this parameter should be set to something similar to \\\'Website fixed\\\'. */ + editReason?: string; } /** @@ -358,6 +360,8 @@ export class TollfreeVerificationContextImpl data["BusinessContactEmail"] = params["businessContactEmail"]; if (params["businessContactPhone"] !== undefined) data["BusinessContactPhone"] = params["businessContactPhone"]; + if (params["editReason"] !== undefined) + data["EditReason"] = params["editReason"]; const headers: any = {}; headers["Content-Type"] = "application/x-www-form-urlencoded"; @@ -439,6 +443,7 @@ interface TollfreeVerificationResource { rejection_reason: string; error_code: number; edit_expiration: Date; + edit_allowed: boolean; resource_links: any; external_reference_id: string; } @@ -485,6 +490,7 @@ export class TollfreeVerificationInstance { this.rejectionReason = payload.rejection_reason; this.errorCode = deserialize.integer(payload.error_code); this.editExpiration = deserialize.iso8601DateTime(payload.edit_expiration); + this.editAllowed = payload.edit_allowed; this.resourceLinks = payload.resource_links; this.externalReferenceId = payload.external_reference_id; @@ -617,6 +623,10 @@ export class TollfreeVerificationInstance { * The date and time when the ability to edit a rejected verification expires. */ editExpiration: Date; + /** + * If a rejected verification is allowed to be edited/resubmitted. Some rejection reasons allow editing and some do not. + */ + editAllowed: boolean; /** * The URLs of the documents associated with the Tollfree Verification resource. */ @@ -729,6 +739,7 @@ export class TollfreeVerificationInstance { rejectionReason: this.rejectionReason, errorCode: this.errorCode, editExpiration: this.editExpiration, + editAllowed: this.editAllowed, resourceLinks: this.resourceLinks, externalReferenceId: this.externalReferenceId, }; diff --git a/src/rest/taskrouter/v1/workspace/task.ts b/src/rest/taskrouter/v1/workspace/task.ts index d86c38d4f..eb92c492f 100644 --- a/src/rest/taskrouter/v1/workspace/task.ts +++ b/src/rest/taskrouter/v1/workspace/task.ts @@ -94,7 +94,7 @@ export interface TaskListInstanceEachOptions { evaluateTaskAttributes?: string; /** How to order the returned Task resources. By default, Tasks are sorted by ascending DateCreated. This value is specified as: `Attribute:Order`, where `Attribute` can be either `DateCreated`, `Priority`, or `VirtualStartTime` and `Order` can be either `asc` or `desc`. For example, `Priority:desc` returns Tasks ordered in descending order of their Priority. Pairings of sort orders can be specified in a comma-separated list such as `Priority:desc,DateCreated:asc`, which returns the Tasks in descending Priority order and ascending DateCreated Order. The only ordering pairing not allowed is DateCreated and VirtualStartTime. */ ordering?: string; - /** Whether to read Tasks with addons. If `true`, returns only Tasks with addons. If `false`, returns only Tasks without addons. */ + /** Whether to read Tasks with Add-ons. If `true`, returns only Tasks with Add-ons. If `false`, returns only Tasks without Add-ons. */ hasAddons?: boolean; /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ pageSize?: number; @@ -126,7 +126,7 @@ export interface TaskListInstanceOptions { evaluateTaskAttributes?: string; /** How to order the returned Task resources. By default, Tasks are sorted by ascending DateCreated. This value is specified as: `Attribute:Order`, where `Attribute` can be either `DateCreated`, `Priority`, or `VirtualStartTime` and `Order` can be either `asc` or `desc`. For example, `Priority:desc` returns Tasks ordered in descending order of their Priority. Pairings of sort orders can be specified in a comma-separated list such as `Priority:desc,DateCreated:asc`, which returns the Tasks in descending Priority order and ascending DateCreated Order. The only ordering pairing not allowed is DateCreated and VirtualStartTime. */ ordering?: string; - /** Whether to read Tasks with addons. If `true`, returns only Tasks with addons. If `false`, returns only Tasks without addons. */ + /** Whether to read Tasks with Add-ons. If `true`, returns only Tasks with Add-ons. If `false`, returns only Tasks without Add-ons. */ hasAddons?: boolean; /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ pageSize?: number; @@ -154,7 +154,7 @@ export interface TaskListInstancePageOptions { evaluateTaskAttributes?: string; /** How to order the returned Task resources. By default, Tasks are sorted by ascending DateCreated. This value is specified as: `Attribute:Order`, where `Attribute` can be either `DateCreated`, `Priority`, or `VirtualStartTime` and `Order` can be either `asc` or `desc`. For example, `Priority:desc` returns Tasks ordered in descending order of their Priority. Pairings of sort orders can be specified in a comma-separated list such as `Priority:desc,DateCreated:asc`, which returns the Tasks in descending Priority order and ascending DateCreated Order. The only ordering pairing not allowed is DateCreated and VirtualStartTime. */ ordering?: string; - /** Whether to read Tasks with addons. If `true`, returns only Tasks with addons. If `false`, returns only Tasks without addons. */ + /** Whether to read Tasks with Add-ons. If `true`, returns only Tasks with Add-ons. If `false`, returns only Tasks without Add-ons. */ hasAddons?: boolean; /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */ pageSize?: number; @@ -484,7 +484,7 @@ export class TaskInstance { */ attributes: string; /** - * An object that contains the [addon](https://www.twilio.com/docs/taskrouter/marketplace) data for all installed addons. + * An object that contains the [Add-on](https://www.twilio.com/docs/add-ons) data for all installed Add-ons. */ addons: string; /** diff --git a/src/rest/trusthub/v1/complianceTollfreeInquiries.ts b/src/rest/trusthub/v1/complianceTollfreeInquiries.ts index a373c5491..5d78e7d23 100644 --- a/src/rest/trusthub/v1/complianceTollfreeInquiries.ts +++ b/src/rest/trusthub/v1/complianceTollfreeInquiries.ts @@ -18,33 +18,33 @@ const deserialize = require("../../../base/deserialize"); const serialize = require("../../../base/serialize"); import { isValidPathParam } from "../../../base/utility"; -/** - * Options to pass to update a ComplianceTollfreeInquiriesInstance - */ -export interface ComplianceTollfreeInquiriesContextUpdateOptions { - /** The Tollfree phone number to be verified */ - did: string; -} - /** * Options to pass to create a ComplianceTollfreeInquiriesInstance */ export interface ComplianceTollfreeInquiriesListInstanceCreateOptions { /** The Tollfree phone number to be verified */ - did: string; + tollfreePhoneNumber: string; + /** The notification email to be triggered when verification status is changed */ + notificationEmail: string; } -export interface ComplianceTollfreeInquiriesContext { +export interface ComplianceTollfreeInquiriesSolution {} + +export interface ComplianceTollfreeInquiriesListInstance { + _version: V1; + _solution: ComplianceTollfreeInquiriesSolution; + _uri: string; + /** - * Update a ComplianceTollfreeInquiriesInstance + * Create a ComplianceTollfreeInquiriesInstance * * @param params - Parameter for request * @param callback - Callback to handle processed record * * @returns Resolves to processed ComplianceTollfreeInquiriesInstance */ - update( - params: ComplianceTollfreeInquiriesContextUpdateOptions, + create( + params: ComplianceTollfreeInquiriesListInstanceCreateOptions, callback?: ( error: Error | null, item?: ComplianceTollfreeInquiriesInstance @@ -58,50 +58,55 @@ export interface ComplianceTollfreeInquiriesContext { [inspect.custom](_depth: any, options: InspectOptions): any; } -export interface ComplianceTollfreeInquiriesContextSolution { - tollfreeId: string; -} - -export class ComplianceTollfreeInquiriesContextImpl - implements ComplianceTollfreeInquiriesContext -{ - protected _solution: ComplianceTollfreeInquiriesContextSolution; - protected _uri: string; - - constructor(protected _version: V1, tollfreeId: string) { - if (!isValidPathParam(tollfreeId)) { - throw new Error("Parameter 'tollfreeId' is not valid."); - } +export function ComplianceTollfreeInquiriesListInstance( + version: V1 +): ComplianceTollfreeInquiriesListInstance { + const instance = {} as ComplianceTollfreeInquiriesListInstance; - this._solution = { tollfreeId }; - this._uri = `/ComplianceInquiries/Tollfree/${tollfreeId}/Initialize`; - } + instance._version = version; + instance._solution = {}; + instance._uri = `/ComplianceInquiries/Tollfree/Initialize`; - update( - params: ComplianceTollfreeInquiriesContextUpdateOptions, + instance.create = function create( + params: ComplianceTollfreeInquiriesListInstanceCreateOptions, callback?: ( error: Error | null, - item?: ComplianceTollfreeInquiriesInstance + items: ComplianceTollfreeInquiriesInstance ) => any ): Promise { if (params === null || params === undefined) { throw new Error('Required parameter "params" missing.'); } - if (params["did"] === null || params["did"] === undefined) { - throw new Error("Required parameter \"params['did']\" missing."); + if ( + params["tollfreePhoneNumber"] === null || + params["tollfreePhoneNumber"] === undefined + ) { + throw new Error( + "Required parameter \"params['tollfreePhoneNumber']\" missing." + ); + } + + if ( + params["notificationEmail"] === null || + params["notificationEmail"] === undefined + ) { + throw new Error( + "Required parameter \"params['notificationEmail']\" missing." + ); } let data: any = {}; - data["Did"] = params["did"]; + data["TollfreePhoneNumber"] = params["tollfreePhoneNumber"]; + + data["NotificationEmail"] = params["notificationEmail"]; const headers: any = {}; headers["Content-Type"] = "application/x-www-form-urlencoded"; - const instance = this; - let operationVersion = instance._version, - operationPromise = operationVersion.update({ + let operationVersion = version, + operationPromise = operationVersion.create({ uri: instance._uri, method: "post", data, @@ -110,11 +115,7 @@ export class ComplianceTollfreeInquiriesContextImpl operationPromise = operationPromise.then( (payload) => - new ComplianceTollfreeInquiriesInstance( - operationVersion, - payload, - instance._solution.tollfreeId - ) + new ComplianceTollfreeInquiriesInstance(operationVersion, payload) ); operationPromise = instance._version.setPromiseCallback( @@ -122,20 +123,20 @@ export class ComplianceTollfreeInquiriesContextImpl callback ); return operationPromise; - } + }; - /** - * Provide a user-friendly representation - * - * @returns Object - */ - toJSON() { - return this._solution; - } + instance.toJSON = function toJSON() { + return instance._solution; + }; - [inspect.custom](_depth: any, options: InspectOptions) { - return inspect(this.toJSON(), options); - } + instance[inspect.custom] = function inspectImpl( + _depth: any, + options: InspectOptions + ) { + return inspect(instance.toJSON(), options); + }; + + return instance; } interface ComplianceTollfreeInquiriesPayload @@ -144,25 +145,19 @@ interface ComplianceTollfreeInquiriesPayload interface ComplianceTollfreeInquiriesResource { inquiry_id: string; inquiry_session_token: string; - tollfree_id: string; + registration_id: string; url: string; } export class ComplianceTollfreeInquiriesInstance { - protected _solution: ComplianceTollfreeInquiriesContextSolution; - protected _context?: ComplianceTollfreeInquiriesContext; - constructor( protected _version: V1, - payload: ComplianceTollfreeInquiriesResource, - tollfreeId?: string + payload: ComplianceTollfreeInquiriesResource ) { this.inquiryId = payload.inquiry_id; this.inquirySessionToken = payload.inquiry_session_token; - this.tollfreeId = payload.tollfree_id; + this.registrationId = payload.registration_id; this.url = payload.url; - - this._solution = { tollfreeId: tollfreeId || this.tollfreeId }; } /** @@ -176,48 +171,12 @@ export class ComplianceTollfreeInquiriesInstance { /** * The TolfreeId matching the Tollfree Profile that should be resumed or resubmitted for editing. */ - tollfreeId: string; + registrationId: string; /** * The URL of this resource. */ url: string; - private get _proxy(): ComplianceTollfreeInquiriesContext { - this._context = - this._context || - new ComplianceTollfreeInquiriesContextImpl( - this._version, - this._solution.tollfreeId - ); - return this._context; - } - - /** - * Update a ComplianceTollfreeInquiriesInstance - * - * @param params - Parameter for request - * @param callback - Callback to handle processed record - * - * @returns Resolves to processed ComplianceTollfreeInquiriesInstance - */ - update( - params: ComplianceTollfreeInquiriesContextUpdateOptions, - callback?: ( - error: Error | null, - item?: ComplianceTollfreeInquiriesInstance - ) => any - ): Promise; - - update( - params?: any, - callback?: ( - error: Error | null, - item?: ComplianceTollfreeInquiriesInstance - ) => any - ): Promise { - return this._proxy.update(params, callback); - } - /** * Provide a user-friendly representation * @@ -227,7 +186,7 @@ export class ComplianceTollfreeInquiriesInstance { return { inquiryId: this.inquiryId, inquirySessionToken: this.inquirySessionToken, - tollfreeId: this.tollfreeId, + registrationId: this.registrationId, url: this.url, }; } @@ -236,106 +195,3 @@ export class ComplianceTollfreeInquiriesInstance { return inspect(this.toJSON(), options); } } - -export interface ComplianceTollfreeInquiriesSolution {} - -export interface ComplianceTollfreeInquiriesListInstance { - _version: V1; - _solution: ComplianceTollfreeInquiriesSolution; - _uri: string; - - (tollfreeId: string): ComplianceTollfreeInquiriesContext; - get(tollfreeId: string): ComplianceTollfreeInquiriesContext; - - /** - * Create a ComplianceTollfreeInquiriesInstance - * - * @param params - Parameter for request - * @param callback - Callback to handle processed record - * - * @returns Resolves to processed ComplianceTollfreeInquiriesInstance - */ - create( - params: ComplianceTollfreeInquiriesListInstanceCreateOptions, - callback?: ( - error: Error | null, - item?: ComplianceTollfreeInquiriesInstance - ) => any - ): Promise; - - /** - * Provide a user-friendly representation - */ - toJSON(): any; - [inspect.custom](_depth: any, options: InspectOptions): any; -} - -export function ComplianceTollfreeInquiriesListInstance( - version: V1 -): ComplianceTollfreeInquiriesListInstance { - const instance = ((tollfreeId) => - instance.get(tollfreeId)) as ComplianceTollfreeInquiriesListInstance; - - instance.get = function get(tollfreeId): ComplianceTollfreeInquiriesContext { - return new ComplianceTollfreeInquiriesContextImpl(version, tollfreeId); - }; - - instance._version = version; - instance._solution = {}; - instance._uri = `/ComplianceInquiries/Tollfree/Initialize`; - - instance.create = function create( - params: ComplianceTollfreeInquiriesListInstanceCreateOptions, - callback?: ( - error: Error | null, - items: ComplianceTollfreeInquiriesInstance - ) => any - ): Promise { - if (params === null || params === undefined) { - throw new Error('Required parameter "params" missing.'); - } - - if (params["did"] === null || params["did"] === undefined) { - throw new Error("Required parameter \"params['did']\" missing."); - } - - let data: any = {}; - - data["Did"] = params["did"]; - - const headers: any = {}; - headers["Content-Type"] = "application/x-www-form-urlencoded"; - - let operationVersion = version, - operationPromise = operationVersion.create({ - uri: instance._uri, - method: "post", - data, - headers, - }); - - operationPromise = operationPromise.then( - (payload) => - new ComplianceTollfreeInquiriesInstance(operationVersion, payload) - ); - - operationPromise = instance._version.setPromiseCallback( - operationPromise, - callback - ); - return operationPromise; - }; - - instance.toJSON = function toJSON() { - return instance._solution; - }; - - instance[inspect.custom] = function inspectImpl( - _depth: any, - options: InspectOptions - ) { - return inspect(instance.toJSON(), options); - }; - - return instance; -} diff --git a/src/rest/verify/v2/service/verification.ts b/src/rest/verify/v2/service/verification.ts index 0ba144729..4b2b3cb87 100644 --- a/src/rest/verify/v2/service/verification.ts +++ b/src/rest/verify/v2/service/verification.ts @@ -68,6 +68,8 @@ export interface VerificationListInstanceCreateOptions { deviceIp?: string; /** */ riskCheck?: VerificationRiskCheck; + /** A string containing a JSON map of key value pairs of tags to be recorded as metadata for the message. The object may contain up to 10 tags. Keys and values can each be up to 128 characters in length. */ + tags?: string; } export interface VerificationContext { @@ -488,6 +490,7 @@ export function VerificationListInstance( if (params["deviceIp"] !== undefined) data["DeviceIp"] = params["deviceIp"]; if (params["riskCheck"] !== undefined) data["RiskCheck"] = params["riskCheck"]; + if (params["tags"] !== undefined) data["Tags"] = params["tags"]; const headers: any = {}; headers["Content-Type"] = "application/x-www-form-urlencoded";