From e7bbeb18ddcec8b0874326266b6c73d4e2a073f3 Mon Sep 17 00:00:00 2001 From: Shubham Date: Thu, 9 Nov 2023 13:37:50 +0530 Subject: [PATCH 01/11] chore: Removed LTS version (#978) * chore: removed LTS version * chore: removing lts from cloudscan * chore: completely removed LTS --- .github/workflows/test-and-deploy.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-and-deploy.yml b/.github/workflows/test-and-deploy.yml index 760cac0d8f..ad07a0db9a 100644 --- a/.github/workflows/test-and-deploy.yml +++ b/.github/workflows/test-and-deploy.yml @@ -17,7 +17,7 @@ jobs: timeout-minutes: 20 strategy: matrix: - node: [ 14, 16, 18, lts/* ] + node: [ 14, 16, 18 ] steps: - name: Checkout twilio-node uses: actions/checkout@v3 @@ -49,7 +49,7 @@ jobs: npm run test - name: SonarCloud Scan - if: ${{ (github.event_name == 'pull_request' || github.ref_type == 'branch') && matrix.node == 'lts/*' && !github.event.pull_request.head.repo.fork }} + if: ${{ (github.event_name == 'pull_request' || github.ref_type == 'branch') && matrix.node == '18' && !github.event.pull_request.head.repo.fork }} uses: SonarSource/sonarcloud-github-action@master env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any @@ -69,7 +69,7 @@ jobs: - name: Set up Node uses: actions/setup-node@v3 with: - node-version: lts/* + node-version: 18 - run: npm install From a981eb0266674ecc165e9fa460e2b81c8c6daa1b Mon Sep 17 00:00:00 2001 From: Andrew Pietila <149612764+kitu-apietila@users.noreply.github.com> Date: Thu, 9 Nov 2023 02:23:34 -0600 Subject: [PATCH 02/11] chore: Update axios to 1.6 to pull in fix for CVE 2023 45857 (#971) * Update axios to 1.6.0 Fixes CVE-2023-45857 * Explicit type return on Promise TypeScript's automatic type resolution for the promise returned by the function in getExponentialBackoffResponseHandler determines that it returns a Promise. This commit forces TypeScript to recognize that the resolved object is of type Promise. --------- Co-authored-by: Shubham --- package.json | 2 +- src/base/RequestClient.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 87814fbf9a..c9cd632fd5 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "url": "https://github.com/twilio/twilio-node.git" }, "dependencies": { - "axios": "^0.26.1", + "axios": "^1.6.0", "dayjs": "^1.11.9", "https-proxy-agent": "^5.0.0", "jsonwebtoken": "^9.0.0", diff --git a/src/base/RequestClient.ts b/src/base/RequestClient.ts index 002f2866e4..3d573e26b1 100644 --- a/src/base/RequestClient.ts +++ b/src/base/RequestClient.ts @@ -57,7 +57,7 @@ function getExponentialBackoffResponseHandler( ); const delay = Math.floor(baseDelay * Math.random()); // Full jitter backoff - return new Promise((resolve) => { + return new Promise((resolve: (value: Promise) => void) => { setTimeout(() => resolve(axios(config)), delay); }); } From 23eca5645571da1c293095eca511f4361ab1fb37 Mon Sep 17 00:00:00 2001 From: kridai Date: Thu, 9 Nov 2023 14:15:16 +0530 Subject: [PATCH 03/11] chore: twilio help changes (#958) Co-authored-by: Shubham --- CONTRIBUTING.md | 2 +- LICENSE | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 171e93b925..b008f1fe57 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -22,7 +22,7 @@ it can be. If you have questions about how to use `twilio-node`, please see our [docs](./README.md), and if you don't find the answer there, please contact -[help@twilio.com](mailto:help@twilio.com) with any issues you have. +[Twilio Support](https://www.twilio.com/help/contact) with any issues you have. ## Found an Issue? diff --git a/LICENSE b/LICENSE index ca16167a61..6485c1f845 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (C) 2023, Twilio, Inc. +Copyright (C) 2023, Twilio, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in From ce0804c5e1fb8f6d21026aba3858b3e1ac319521 Mon Sep 17 00:00:00 2001 From: KobeBrooks <55289738+KobeBrooks@users.noreply.github.com> Date: Thu, 9 Nov 2023 07:16:49 -0500 Subject: [PATCH 04/11] chore: Removing Test Related To Deprecated Endpoint - OAuth (#963) * removing test in relation to deprecated endpoint * removingn more oauth refrences --------- Co-authored-by: sbansla <104902068+sbansla@users.noreply.github.com> --- src/rest/Oauth.ts | 52 ------ src/rest/OauthBase.ts | 33 ---- src/rest/Twilio.ts | 8 - src/rest/oauth/V1.ts | 74 -------- src/rest/oauth/v1/deviceCode.ts | 192 ------------------- src/rest/oauth/v1/oauth.ts | 185 ------------------- src/rest/oauth/v1/openidDiscovery.ts | 266 --------------------------- src/rest/oauth/v1/token.ts | 204 -------------------- src/rest/oauth/v1/userInfo.ts | 213 --------------------- 9 files changed, 1227 deletions(-) delete mode 100644 src/rest/Oauth.ts delete mode 100644 src/rest/OauthBase.ts delete mode 100644 src/rest/oauth/V1.ts delete mode 100644 src/rest/oauth/v1/deviceCode.ts delete mode 100644 src/rest/oauth/v1/oauth.ts delete mode 100644 src/rest/oauth/v1/openidDiscovery.ts delete mode 100644 src/rest/oauth/v1/token.ts delete mode 100644 src/rest/oauth/v1/userInfo.ts diff --git a/src/rest/Oauth.ts b/src/rest/Oauth.ts deleted file mode 100644 index 5e0708b239..0000000000 --- a/src/rest/Oauth.ts +++ /dev/null @@ -1,52 +0,0 @@ -import OauthBase from "./OauthBase"; -import { OauthListInstance } from "./oauth/v1/oauth"; -import { DeviceCodeListInstance } from "./oauth/v1/deviceCode"; -import { OpenidDiscoveryListInstance } from "./oauth/v1/openidDiscovery"; -import { TokenListInstance } from "./oauth/v1/token"; -import { UserInfoListInstance } from "./oauth/v1/userInfo"; - -class Oauth extends OauthBase { - /** - * @deprecated - Use v1.deviceCode instead - */ - get deviceCode(): DeviceCodeListInstance { - console.warn("deviceCode is deprecated. Use v1.deviceCode instead."); - return this.v1.deviceCode; - } - - /** - * @deprecated - Use v1.oauth instead - */ - get oauth(): OauthListInstance { - console.warn("oauth is deprecated. Use v1.oauth instead."); - return this.v1.oauth; - } - - /** - * @deprecated - Use v1.openidDiscovery instead - */ - get openidDiscovery(): OpenidDiscoveryListInstance { - console.warn( - "openidDiscovery is deprecated. Use v1.openidDiscovery instead." - ); - return this.v1.openidDiscovery; - } - - /** - * @deprecated - Use v1.token instead - */ - get token(): TokenListInstance { - console.warn("token is deprecated. Use v1.token instead."); - return this.v1.token; - } - - /** - * @deprecated - Use v1.userInfo instead - */ - get userInfo(): UserInfoListInstance { - console.warn("userInfo is deprecated. Use v1.userInfo instead."); - return this.v1.userInfo; - } -} - -export = Oauth; diff --git a/src/rest/OauthBase.ts b/src/rest/OauthBase.ts deleted file mode 100644 index 513dd037f3..0000000000 --- a/src/rest/OauthBase.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * NOTE: This class is auto generated by OpenAPI Generator. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import Domain from "../base/Domain"; -import V1 from "./oauth/V1"; - -class OauthBase extends Domain { - _v1?: V1; - - /** - * Initialize oauth domain - * - * @param twilio - The twilio client - */ - constructor(twilio: any) { - super(twilio, "https://oauth.twilio.com"); - } - - get v1(): V1 { - this._v1 = this._v1 || new V1(this); - return this._v1; - } -} - -export = OauthBase; diff --git a/src/rest/Twilio.ts b/src/rest/Twilio.ts index 1a21d3a500..3543d11e94 100644 --- a/src/rest/Twilio.ts +++ b/src/rest/Twilio.ts @@ -30,7 +30,6 @@ import Microvisor from "./Microvisor"; import Monitor from "./Monitor"; import Notify from "./Notify"; import Numbers from "./Numbers"; -import Oauth from "./Oauth"; import Preview from "./Preview"; import Pricing from "./Pricing"; import Proxy from "./Proxy"; @@ -118,8 +117,6 @@ class Twilio extends Client { _notify?: Notify; /** (Twilio.Numbers) - numbers domain */ _numbers?: Numbers; - /** (Twilio.Oauth) - oauth domain */ - _oauth?: Oauth; /** (Twilio.Preview) - preview domain */ _preview?: Preview; /** (Twilio.Pricing) - pricing domain */ @@ -188,7 +185,6 @@ class Twilio extends Client { this.monitor; this.notify; this.numbers; - this.oauth; this.preview; this.pricing; this.proxy; @@ -314,10 +310,6 @@ class Twilio extends Client { get numbers(): Numbers { return this._numbers ?? (this._numbers = new (require("./Numbers"))(this)); } - /** Getter for (Twilio.Oauth) domain */ - get oauth(): Oauth { - return this._oauth ?? (this._oauth = new (require("./Oauth"))(this)); - } /** Getter for (Twilio.Preview) domain */ get preview(): Preview { return this._preview ?? (this._preview = new (require("./Preview"))(this)); diff --git a/src/rest/oauth/V1.ts b/src/rest/oauth/V1.ts deleted file mode 100644 index ab2759f368..0000000000 --- a/src/rest/oauth/V1.ts +++ /dev/null @@ -1,74 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Oauth - * This is the public Twilio REST API. - * - * NOTE: This class is auto generated by OpenAPI Generator. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import OauthBase from "../OauthBase"; -import Version from "../../base/Version"; -import { DeviceCodeListInstance } from "./v1/deviceCode"; -import { OauthListInstance } from "./v1/oauth"; -import { OpenidDiscoveryListInstance } from "./v1/openidDiscovery"; -import { TokenListInstance } from "./v1/token"; -import { UserInfoListInstance } from "./v1/userInfo"; - -export default class V1 extends Version { - /** - * Initialize the V1 version of Oauth - * - * @param domain - The Twilio (Twilio.Oauth) domain - */ - constructor(domain: OauthBase) { - super(domain, "v1"); - } - - /** deviceCode - { Twilio.Oauth.V1.DeviceCodeListInstance } resource */ - protected _deviceCode?: DeviceCodeListInstance; - /** oauth - { Twilio.Oauth.V1.OauthListInstance } resource */ - protected _oauth?: OauthListInstance; - /** openidDiscovery - { Twilio.Oauth.V1.OpenidDiscoveryListInstance } resource */ - protected _openidDiscovery?: OpenidDiscoveryListInstance; - /** token - { Twilio.Oauth.V1.TokenListInstance } resource */ - protected _token?: TokenListInstance; - /** userInfo - { Twilio.Oauth.V1.UserInfoListInstance } resource */ - protected _userInfo?: UserInfoListInstance; - - /** Getter for deviceCode resource */ - get deviceCode(): DeviceCodeListInstance { - this._deviceCode = this._deviceCode || DeviceCodeListInstance(this); - return this._deviceCode; - } - - /** Getter for oauth resource */ - get oauth(): OauthListInstance { - this._oauth = this._oauth || OauthListInstance(this); - return this._oauth; - } - - /** Getter for openidDiscovery resource */ - get openidDiscovery(): OpenidDiscoveryListInstance { - this._openidDiscovery = - this._openidDiscovery || OpenidDiscoveryListInstance(this); - return this._openidDiscovery; - } - - /** Getter for token resource */ - get token(): TokenListInstance { - this._token = this._token || TokenListInstance(this); - return this._token; - } - - /** Getter for userInfo resource */ - get userInfo(): UserInfoListInstance { - this._userInfo = this._userInfo || UserInfoListInstance(this); - return this._userInfo; - } -} diff --git a/src/rest/oauth/v1/deviceCode.ts b/src/rest/oauth/v1/deviceCode.ts deleted file mode 100644 index da60047a46..0000000000 --- a/src/rest/oauth/v1/deviceCode.ts +++ /dev/null @@ -1,192 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Oauth - * This is the public Twilio REST API. - * - * NOTE: This class is auto generated by OpenAPI Generator. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { inspect, InspectOptions } from "util"; -import V1 from "../V1"; -const deserialize = require("../../../base/deserialize"); -const serialize = require("../../../base/serialize"); -import { isValidPathParam } from "../../../base/utility"; - -/** - * Options to pass to create a DeviceCodeInstance - */ -export interface DeviceCodeListInstanceCreateOptions { - /** A 34 character string that uniquely identifies this OAuth App. */ - clientSid: string; - /** An Array of scopes for authorization request */ - scopes: Array; - /** An array of intended audiences for token requests */ - audiences?: Array; -} - -export interface DeviceCodeSolution {} - -export interface DeviceCodeListInstance { - _version: V1; - _solution: DeviceCodeSolution; - _uri: string; - - /** - * Create a DeviceCodeInstance - * - * @param params - Parameter for request - * @param callback - Callback to handle processed record - * - * @returns Resolves to processed DeviceCodeInstance - */ - create( - params: DeviceCodeListInstanceCreateOptions, - callback?: (error: Error | null, item?: DeviceCodeInstance) => any - ): Promise; - - /** - * Provide a user-friendly representation - */ - toJSON(): any; - [inspect.custom](_depth: any, options: InspectOptions): any; -} - -export function DeviceCodeListInstance(version: V1): DeviceCodeListInstance { - const instance = {} as DeviceCodeListInstance; - - instance._version = version; - instance._solution = {}; - instance._uri = `/device/code`; - - instance.create = function create( - params: DeviceCodeListInstanceCreateOptions, - callback?: (error: Error | null, items: DeviceCodeInstance) => any - ): Promise { - if (params === null || params === undefined) { - throw new Error('Required parameter "params" missing.'); - } - - if (params["clientSid"] === null || params["clientSid"] === undefined) { - throw new Error("Required parameter \"params['clientSid']\" missing."); - } - - if (params["scopes"] === null || params["scopes"] === undefined) { - throw new Error("Required parameter \"params['scopes']\" missing."); - } - - let data: any = {}; - - data["ClientSid"] = params["clientSid"]; - - data["Scopes"] = serialize.map(params["scopes"], (e: string) => e); - if (params["audiences"] !== undefined) - data["Audiences"] = serialize.map(params["audiences"], (e: string) => e); - - 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 DeviceCodeInstance(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; -} - -interface DeviceCodePayload extends DeviceCodeResource {} - -interface DeviceCodeResource { - device_code: string; - user_code: string; - verification_uri: string; - verification_uri_complete: string; - expires_in: number; - interval: number; -} - -export class DeviceCodeInstance { - constructor(protected _version: V1, payload: DeviceCodeResource) { - this.deviceCode = payload.device_code; - this.userCode = payload.user_code; - this.verificationUri = payload.verification_uri; - this.verificationUriComplete = payload.verification_uri_complete; - this.expiresIn = payload.expires_in; - this.interval = deserialize.integer(payload.interval); - } - - /** - * The device verification code. - */ - deviceCode: string; - /** - * The verification code which end user uses to verify authorization request. - */ - userCode: string; - /** - * The URI that the end user visits to verify authorization request. - */ - verificationUri: string; - /** - * The URI with user_code that the end-user alternatively visits to verify authorization request. - */ - verificationUriComplete: string; - /** - * The expiration time of the device_code and user_code in seconds. - */ - expiresIn: number; - /** - * The minimum amount of time in seconds that the client should wait between polling requests to the token endpoint. - */ - interval: number; - - /** - * Provide a user-friendly representation - * - * @returns Object - */ - toJSON() { - return { - deviceCode: this.deviceCode, - userCode: this.userCode, - verificationUri: this.verificationUri, - verificationUriComplete: this.verificationUriComplete, - expiresIn: this.expiresIn, - interval: this.interval, - }; - } - - [inspect.custom](_depth: any, options: InspectOptions) { - return inspect(this.toJSON(), options); - } -} diff --git a/src/rest/oauth/v1/oauth.ts b/src/rest/oauth/v1/oauth.ts deleted file mode 100644 index 7752f30008..0000000000 --- a/src/rest/oauth/v1/oauth.ts +++ /dev/null @@ -1,185 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Oauth - * This is the public Twilio REST API. - * - * NOTE: This class is auto generated by OpenAPI Generator. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { inspect, InspectOptions } from "util"; -import V1 from "../V1"; -const deserialize = require("../../../base/deserialize"); -const serialize = require("../../../base/serialize"); -import { isValidPathParam } from "../../../base/utility"; - -export interface OauthContext { - /** - * Fetch a OauthInstance - * - * @param callback - Callback to handle processed record - * - * @returns Resolves to processed OauthInstance - */ - fetch( - callback?: (error: Error | null, item?: OauthInstance) => any - ): Promise; - - /** - * Provide a user-friendly representation - */ - toJSON(): any; - [inspect.custom](_depth: any, options: InspectOptions): any; -} - -export interface OauthContextSolution {} - -export class OauthContextImpl implements OauthContext { - protected _solution: OauthContextSolution; - protected _uri: string; - - constructor(protected _version: V1) { - this._solution = {}; - this._uri = `/certs`; - } - - fetch( - callback?: (error: Error | null, item?: OauthInstance) => any - ): Promise { - const instance = this; - let operationVersion = instance._version, - operationPromise = operationVersion.fetch({ - uri: instance._uri, - method: "get", - }); - - operationPromise = operationPromise.then( - (payload) => new OauthInstance(operationVersion, payload) - ); - - operationPromise = instance._version.setPromiseCallback( - operationPromise, - callback - ); - return operationPromise; - } - - /** - * Provide a user-friendly representation - * - * @returns Object - */ - toJSON() { - return this._solution; - } - - [inspect.custom](_depth: any, options: InspectOptions) { - return inspect(this.toJSON(), options); - } -} - -interface OauthPayload extends OauthResource {} - -interface OauthResource { - keys: any; - url: string; -} - -export class OauthInstance { - protected _solution: OauthContextSolution; - protected _context?: OauthContext; - - constructor(protected _version: V1, payload: OauthResource) { - this.keys = payload.keys; - this.url = payload.url; - - this._solution = {}; - } - - /** - * A collection of certificates where are signed Twilio-issued tokens. - */ - keys: any; - url: string; - - private get _proxy(): OauthContext { - this._context = this._context || new OauthContextImpl(this._version); - return this._context; - } - - /** - * Fetch a OauthInstance - * - * @param callback - Callback to handle processed record - * - * @returns Resolves to processed OauthInstance - */ - fetch( - callback?: (error: Error | null, item?: OauthInstance) => any - ): Promise { - return this._proxy.fetch(callback); - } - - /** - * Provide a user-friendly representation - * - * @returns Object - */ - toJSON() { - return { - keys: this.keys, - url: this.url, - }; - } - - [inspect.custom](_depth: any, options: InspectOptions) { - return inspect(this.toJSON(), options); - } -} - -export interface OauthSolution {} - -export interface OauthListInstance { - _version: V1; - _solution: OauthSolution; - _uri: string; - - (): OauthContext; - get(): OauthContext; - - /** - * Provide a user-friendly representation - */ - toJSON(): any; - [inspect.custom](_depth: any, options: InspectOptions): any; -} - -export function OauthListInstance(version: V1): OauthListInstance { - const instance = (() => instance.get()) as OauthListInstance; - - instance.get = function get(): OauthContext { - return new OauthContextImpl(version); - }; - - instance._version = version; - instance._solution = {}; - instance._uri = ``; - - 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/oauth/v1/openidDiscovery.ts b/src/rest/oauth/v1/openidDiscovery.ts deleted file mode 100644 index 24b8aa9a9f..0000000000 --- a/src/rest/oauth/v1/openidDiscovery.ts +++ /dev/null @@ -1,266 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Oauth - * This is the public Twilio REST API. - * - * NOTE: This class is auto generated by OpenAPI Generator. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { inspect, InspectOptions } from "util"; -import V1 from "../V1"; -const deserialize = require("../../../base/deserialize"); -const serialize = require("../../../base/serialize"); -import { isValidPathParam } from "../../../base/utility"; - -export interface OpenidDiscoveryContext { - /** - * Fetch a OpenidDiscoveryInstance - * - * @param callback - Callback to handle processed record - * - * @returns Resolves to processed OpenidDiscoveryInstance - */ - fetch( - callback?: (error: Error | null, item?: OpenidDiscoveryInstance) => any - ): Promise; - - /** - * Provide a user-friendly representation - */ - toJSON(): any; - [inspect.custom](_depth: any, options: InspectOptions): any; -} - -export interface OpenidDiscoveryContextSolution {} - -export class OpenidDiscoveryContextImpl implements OpenidDiscoveryContext { - protected _solution: OpenidDiscoveryContextSolution; - protected _uri: string; - - constructor(protected _version: V1) { - this._solution = {}; - this._uri = `/.well-known/openid-configuration`; - } - - fetch( - callback?: (error: Error | null, item?: OpenidDiscoveryInstance) => any - ): Promise { - const instance = this; - let operationVersion = instance._version, - operationPromise = operationVersion.fetch({ - uri: instance._uri, - method: "get", - }); - - operationPromise = operationPromise.then( - (payload) => new OpenidDiscoveryInstance(operationVersion, payload) - ); - - operationPromise = instance._version.setPromiseCallback( - operationPromise, - callback - ); - return operationPromise; - } - - /** - * Provide a user-friendly representation - * - * @returns Object - */ - toJSON() { - return this._solution; - } - - [inspect.custom](_depth: any, options: InspectOptions) { - return inspect(this.toJSON(), options); - } -} - -interface OpenidDiscoveryPayload extends OpenidDiscoveryResource {} - -interface OpenidDiscoveryResource { - issuer: string; - authorization_endpoint: string; - device_authorization_endpoint: string; - token_endpoint: string; - userinfo_endpoint: string; - revocation_endpoint: string; - jwk_uri: string; - response_type_supported: Array; - subject_type_supported: Array; - id_token_signing_alg_values_supported: Array; - scopes_supported: Array; - claims_supported: Array; - url: string; -} - -export class OpenidDiscoveryInstance { - protected _solution: OpenidDiscoveryContextSolution; - protected _context?: OpenidDiscoveryContext; - - constructor(protected _version: V1, payload: OpenidDiscoveryResource) { - this.issuer = payload.issuer; - this.authorizationEndpoint = payload.authorization_endpoint; - this.deviceAuthorizationEndpoint = payload.device_authorization_endpoint; - this.tokenEndpoint = payload.token_endpoint; - this.userinfoEndpoint = payload.userinfo_endpoint; - this.revocationEndpoint = payload.revocation_endpoint; - this.jwkUri = payload.jwk_uri; - this.responseTypeSupported = payload.response_type_supported; - this.subjectTypeSupported = payload.subject_type_supported; - this.idTokenSigningAlgValuesSupported = - payload.id_token_signing_alg_values_supported; - this.scopesSupported = payload.scopes_supported; - this.claimsSupported = payload.claims_supported; - this.url = payload.url; - - this._solution = {}; - } - - /** - * The URL of the party that will create the token and sign it with its private key. - */ - issuer: string; - /** - * The endpoint that validates all authorization requests. - */ - authorizationEndpoint: string; - /** - * The endpoint that validates all device code related authorization requests. - */ - deviceAuthorizationEndpoint: string; - /** - * The URL of the token endpoint. After a client has received an authorization code, that code is presented to the token endpoint and exchanged for an identity token, an access token, and a refresh token. - */ - tokenEndpoint: string; - /** - * The URL of the user info endpoint, which returns user profile information to a client. Keep in mind that the user info endpoint returns only the information that has been requested. - */ - userinfoEndpoint: string; - /** - * The endpoint used to revoke access or refresh tokens issued by the authorization server. - */ - revocationEndpoint: string; - /** - * The URL of your JSON Web Key Set. This set is a collection of JSON Web Keys, a standard method for representing cryptographic keys in a JSON structure. - */ - jwkUri: string; - /** - * A collection of response type supported by authorization server. - */ - responseTypeSupported: Array; - /** - * A collection of subject by authorization server. - */ - subjectTypeSupported: Array; - /** - * A collection of JWS signing algorithms supported by authorization server to sign identity token. - */ - idTokenSigningAlgValuesSupported: Array; - /** - * A collection of scopes supported by authorization server for identity token - */ - scopesSupported: Array; - /** - * A collection of claims supported by authorization server for identity token - */ - claimsSupported: Array; - url: string; - - private get _proxy(): OpenidDiscoveryContext { - this._context = - this._context || new OpenidDiscoveryContextImpl(this._version); - return this._context; - } - - /** - * Fetch a OpenidDiscoveryInstance - * - * @param callback - Callback to handle processed record - * - * @returns Resolves to processed OpenidDiscoveryInstance - */ - fetch( - callback?: (error: Error | null, item?: OpenidDiscoveryInstance) => any - ): Promise { - return this._proxy.fetch(callback); - } - - /** - * Provide a user-friendly representation - * - * @returns Object - */ - toJSON() { - return { - issuer: this.issuer, - authorizationEndpoint: this.authorizationEndpoint, - deviceAuthorizationEndpoint: this.deviceAuthorizationEndpoint, - tokenEndpoint: this.tokenEndpoint, - userinfoEndpoint: this.userinfoEndpoint, - revocationEndpoint: this.revocationEndpoint, - jwkUri: this.jwkUri, - responseTypeSupported: this.responseTypeSupported, - subjectTypeSupported: this.subjectTypeSupported, - idTokenSigningAlgValuesSupported: this.idTokenSigningAlgValuesSupported, - scopesSupported: this.scopesSupported, - claimsSupported: this.claimsSupported, - url: this.url, - }; - } - - [inspect.custom](_depth: any, options: InspectOptions) { - return inspect(this.toJSON(), options); - } -} - -export interface OpenidDiscoverySolution {} - -export interface OpenidDiscoveryListInstance { - _version: V1; - _solution: OpenidDiscoverySolution; - _uri: string; - - (): OpenidDiscoveryContext; - get(): OpenidDiscoveryContext; - - /** - * Provide a user-friendly representation - */ - toJSON(): any; - [inspect.custom](_depth: any, options: InspectOptions): any; -} - -export function OpenidDiscoveryListInstance( - version: V1 -): OpenidDiscoveryListInstance { - const instance = (() => instance.get()) as OpenidDiscoveryListInstance; - - instance.get = function get(): OpenidDiscoveryContext { - return new OpenidDiscoveryContextImpl(version); - }; - - instance._version = version; - instance._solution = {}; - instance._uri = ``; - - 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/oauth/v1/token.ts b/src/rest/oauth/v1/token.ts deleted file mode 100644 index 918bb2576b..0000000000 --- a/src/rest/oauth/v1/token.ts +++ /dev/null @@ -1,204 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Oauth - * This is the public Twilio REST API. - * - * NOTE: This class is auto generated by OpenAPI Generator. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { inspect, InspectOptions } from "util"; -import V1 from "../V1"; -const deserialize = require("../../../base/deserialize"); -const serialize = require("../../../base/serialize"); -import { isValidPathParam } from "../../../base/utility"; - -/** - * Options to pass to create a TokenInstance - */ -export interface TokenListInstanceCreateOptions { - /** Grant type is a credential representing resource owner\\\'s authorization which can be used by client to obtain access token. */ - grantType: string; - /** A 34 character string that uniquely identifies this OAuth App. */ - clientSid: string; - /** The credential for confidential OAuth App. */ - clientSecret?: string; - /** JWT token related to the authorization code grant type. */ - code?: string; - /** A code which is generation cryptographically. */ - codeVerifier?: string; - /** JWT token related to the device code grant type. */ - deviceCode?: string; - /** JWT token related to the refresh token grant type. */ - refreshToken?: string; - /** The Id of the device associated with the token (refresh token). */ - deviceId?: string; -} - -export interface TokenSolution {} - -export interface TokenListInstance { - _version: V1; - _solution: TokenSolution; - _uri: string; - - /** - * Create a TokenInstance - * - * @param params - Parameter for request - * @param callback - Callback to handle processed record - * - * @returns Resolves to processed TokenInstance - */ - create( - params: TokenListInstanceCreateOptions, - callback?: (error: Error | null, item?: TokenInstance) => any - ): Promise; - - /** - * Provide a user-friendly representation - */ - toJSON(): any; - [inspect.custom](_depth: any, options: InspectOptions): any; -} - -export function TokenListInstance(version: V1): TokenListInstance { - const instance = {} as TokenListInstance; - - instance._version = version; - instance._solution = {}; - instance._uri = `/token`; - - instance.create = function create( - params: TokenListInstanceCreateOptions, - callback?: (error: Error | null, items: TokenInstance) => any - ): Promise { - if (params === null || params === undefined) { - throw new Error('Required parameter "params" missing.'); - } - - if (params["grantType"] === null || params["grantType"] === undefined) { - throw new Error("Required parameter \"params['grantType']\" missing."); - } - - if (params["clientSid"] === null || params["clientSid"] === undefined) { - throw new Error("Required parameter \"params['clientSid']\" missing."); - } - - let data: any = {}; - - data["GrantType"] = params["grantType"]; - - data["ClientSid"] = params["clientSid"]; - if (params["clientSecret"] !== undefined) - data["ClientSecret"] = params["clientSecret"]; - if (params["code"] !== undefined) data["Code"] = params["code"]; - if (params["codeVerifier"] !== undefined) - data["CodeVerifier"] = params["codeVerifier"]; - if (params["deviceCode"] !== undefined) - data["DeviceCode"] = params["deviceCode"]; - if (params["refreshToken"] !== undefined) - data["RefreshToken"] = params["refreshToken"]; - if (params["deviceId"] !== undefined) data["DeviceId"] = params["deviceId"]; - - 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 TokenInstance(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; -} - -interface TokenPayload extends TokenResource {} - -interface TokenResource { - access_token: string; - refresh_token: string; - id_token: string; - refresh_token_expires_at: Date; - access_token_expires_at: Date; -} - -export class TokenInstance { - constructor(protected _version: V1, payload: TokenResource) { - this.accessToken = payload.access_token; - this.refreshToken = payload.refresh_token; - this.idToken = payload.id_token; - this.refreshTokenExpiresAt = deserialize.iso8601DateTime( - payload.refresh_token_expires_at - ); - this.accessTokenExpiresAt = deserialize.iso8601DateTime( - payload.access_token_expires_at - ); - } - - /** - * Token which carries the necessary information to access a Twilio resource directly. - */ - accessToken: string; - /** - * Token which carries the information necessary to get a new access token. - */ - refreshToken: string; - idToken: string; - /** - * The date and time in GMT when the refresh token expires in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. - */ - refreshTokenExpiresAt: Date; - /** - * The date and time in GMT when the refresh token expires in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. - */ - accessTokenExpiresAt: Date; - - /** - * Provide a user-friendly representation - * - * @returns Object - */ - toJSON() { - return { - accessToken: this.accessToken, - refreshToken: this.refreshToken, - idToken: this.idToken, - refreshTokenExpiresAt: this.refreshTokenExpiresAt, - accessTokenExpiresAt: this.accessTokenExpiresAt, - }; - } - - [inspect.custom](_depth: any, options: InspectOptions) { - return inspect(this.toJSON(), options); - } -} diff --git a/src/rest/oauth/v1/userInfo.ts b/src/rest/oauth/v1/userInfo.ts deleted file mode 100644 index 5b974309b8..0000000000 --- a/src/rest/oauth/v1/userInfo.ts +++ /dev/null @@ -1,213 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Oauth - * This is the public Twilio REST API. - * - * NOTE: This class is auto generated by OpenAPI Generator. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { inspect, InspectOptions } from "util"; -import V1 from "../V1"; -const deserialize = require("../../../base/deserialize"); -const serialize = require("../../../base/serialize"); -import { isValidPathParam } from "../../../base/utility"; - -export interface UserInfoContext { - /** - * Fetch a UserInfoInstance - * - * @param callback - Callback to handle processed record - * - * @returns Resolves to processed UserInfoInstance - */ - fetch( - callback?: (error: Error | null, item?: UserInfoInstance) => any - ): Promise; - - /** - * Provide a user-friendly representation - */ - toJSON(): any; - [inspect.custom](_depth: any, options: InspectOptions): any; -} - -export interface UserInfoContextSolution {} - -export class UserInfoContextImpl implements UserInfoContext { - protected _solution: UserInfoContextSolution; - protected _uri: string; - - constructor(protected _version: V1) { - this._solution = {}; - this._uri = `/userinfo`; - } - - fetch( - callback?: (error: Error | null, item?: UserInfoInstance) => any - ): Promise { - const instance = this; - let operationVersion = instance._version, - operationPromise = operationVersion.fetch({ - uri: instance._uri, - method: "get", - }); - - operationPromise = operationPromise.then( - (payload) => new UserInfoInstance(operationVersion, payload) - ); - - operationPromise = instance._version.setPromiseCallback( - operationPromise, - callback - ); - return operationPromise; - } - - /** - * Provide a user-friendly representation - * - * @returns Object - */ - toJSON() { - return this._solution; - } - - [inspect.custom](_depth: any, options: InspectOptions) { - return inspect(this.toJSON(), options); - } -} - -interface UserInfoPayload extends UserInfoResource {} - -interface UserInfoResource { - user_sid: string; - first_name: string; - last_name: string; - friendly_name: string; - email: string; - url: string; -} - -export class UserInfoInstance { - protected _solution: UserInfoContextSolution; - protected _context?: UserInfoContext; - - constructor(protected _version: V1, payload: UserInfoResource) { - this.userSid = payload.user_sid; - this.firstName = payload.first_name; - this.lastName = payload.last_name; - this.friendlyName = payload.friendly_name; - this.email = payload.email; - this.url = payload.url; - - this._solution = {}; - } - - /** - * The URL of the party that will create the token and sign it with its private key. - */ - userSid: string; - /** - * The first name of the end-user. - */ - firstName: string; - /** - * The last name of the end-user. - */ - lastName: string; - /** - * The friendly name of the end-user. - */ - friendlyName: string; - /** - * The end-user\'s preferred email address. - */ - email: string; - url: string; - - private get _proxy(): UserInfoContext { - this._context = this._context || new UserInfoContextImpl(this._version); - return this._context; - } - - /** - * Fetch a UserInfoInstance - * - * @param callback - Callback to handle processed record - * - * @returns Resolves to processed UserInfoInstance - */ - fetch( - callback?: (error: Error | null, item?: UserInfoInstance) => any - ): Promise { - return this._proxy.fetch(callback); - } - - /** - * Provide a user-friendly representation - * - * @returns Object - */ - toJSON() { - return { - userSid: this.userSid, - firstName: this.firstName, - lastName: this.lastName, - friendlyName: this.friendlyName, - email: this.email, - url: this.url, - }; - } - - [inspect.custom](_depth: any, options: InspectOptions) { - return inspect(this.toJSON(), options); - } -} - -export interface UserInfoSolution {} - -export interface UserInfoListInstance { - _version: V1; - _solution: UserInfoSolution; - _uri: string; - - (): UserInfoContext; - get(): UserInfoContext; - - /** - * Provide a user-friendly representation - */ - toJSON(): any; - [inspect.custom](_depth: any, options: InspectOptions): any; -} - -export function UserInfoListInstance(version: V1): UserInfoListInstance { - const instance = (() => instance.get()) as UserInfoListInstance; - - instance.get = function get(): UserInfoContext { - return new UserInfoContextImpl(version); - }; - - instance._version = version; - instance._solution = {}; - instance._uri = ``; - - instance.toJSON = function toJSON() { - return instance._solution; - }; - - instance[inspect.custom] = function inspectImpl( - _depth: any, - options: InspectOptions - ) { - return inspect(instance.toJSON(), options); - }; - - return instance; -} From 5a3916dc0bc799cb3ca5340f39f8ecadee507588 Mon Sep 17 00:00:00 2001 From: Twilio Date: Fri, 17 Nov 2023 10:39:17 +0000 Subject: [PATCH 05/11] [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 4c86cb6f19..ef08c6b966 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 21ed2dae4c..f3444eb60a 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 40bf6921f4..563ef3f85d 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 caddf98dc1..779d605145 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 d86c38d4fb..eb92c492ff 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 a373c5491a..5d78e7d238 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 0ba1447298..4b2b3cb87c 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"; From 00e852f8617666e54bc1473624e55d994029aac1 Mon Sep 17 00:00:00 2001 From: Twilio Date: Fri, 17 Nov 2023 11:17:30 +0000 Subject: [PATCH 06/11] Release 4.19.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c9cd632fd5..f0a479e78e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "twilio", "description": "A Twilio helper library", - "version": "4.19.1", + "version": "4.19.2", "author": "API Team ", "contributors": [ { From 90208b3a7780e2685d472e95c4874f3830308e54 Mon Sep 17 00:00:00 2001 From: Twilio Date: Fri, 1 Dec 2023 05:22:32 +0000 Subject: [PATCH 07/11] [Librarian] Regenerated @ 437c39e3f150e78058f5afb3ef0672e89fc59ec0 --- CHANGES.md | 6 ++++++ src/rest/api/v2010/account/message.ts | 8 ++++---- src/rest/content/v1/content.ts | 2 +- src/rest/content/v1/contentAndApprovals.ts | 2 +- src/rest/content/v1/legacyContent.ts | 2 +- .../conversations/v1/conversation/message.ts | 4 ++-- .../v1/service/conversation/message.ts | 4 ++-- src/rest/intelligence/v2/service.ts | 6 +++--- src/rest/intelligence/v2/transcript.ts | 2 +- src/rest/notify/v1/service.ts | 6 +++--- src/rest/notify/v1/service/notification.ts | 2 +- .../proxy/v1/service/session/interaction.ts | 2 +- src/rest/proxy/v1/service/shortCode.ts | 2 +- src/rest/supersim/v1/esimProfile.ts | 8 ++++---- src/rest/verify/v2/service.ts | 20 +++++++++++++++++++ src/rest/verify/v2/verificationAttempt.ts | 2 +- 16 files changed, 52 insertions(+), 26 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index ef08c6b966..2e5aef814f 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,12 @@ twilio-node changelog ===================== +[2023-12-01] Version 4.19.3 +--------------------------- +**Verify** +- Add `VerifyEventSubscriptionEnabled` parameter to service create and update endpoints. + + [2023-11-17] Version 4.19.2 --------------------------- **Library - Chore** diff --git a/src/rest/api/v2010/account/message.ts b/src/rest/api/v2010/account/message.ts index 7f0794abc2..96c9cc5941 100644 --- a/src/rest/api/v2010/account/message.ts +++ b/src/rest/api/v2010/account/message.ts @@ -91,7 +91,7 @@ export interface MessageListInstanceCreateOptions { smartEncoded?: boolean; /** Rich actions for non-SMS/MMS channels. Used for [sending location in WhatsApp messages](https://www.twilio.com/docs/whatsapp/message-features#location-messages-with-whatsapp). */ persistentAction?: Array; - /** For Messaging Services with [Link Shortening configured](https://www.twilio.com/docs/messaging/features/how-to-configure-link-shortening) only: A Boolean indicating whether or not Twilio should shorten links in the `body` of the Message. Default value is `false`. If `true`, the `messaging_service_sid` parameter must also be provided. */ + /** For Messaging Services with [Link Shortening configured](https://www.twilio.com/docs/messaging/features/link-shortening) only: A Boolean indicating whether or not Twilio should shorten links in the `body` of the Message. Default value is `false`. If `true`, the `messaging_service_sid` parameter must also be provided. */ shortenUrls?: boolean; /** */ scheduleType?: MessageScheduleType; @@ -103,13 +103,13 @@ export interface MessageListInstanceCreateOptions { contentVariables?: string; /** */ riskCheck?: MessageRiskCheck; - /** The sender\\\'s Twilio phone number (in [E.164](https://en.wikipedia.org/wiki/E.164) format), [alphanumeric sender ID](https://www.twilio.com/docs/sms/send-messages#use-an-alphanumeric-sender-id), [Wireless SIM](https://www.twilio.com/docs/iot/wireless/programmable-wireless-send-machine-machine-sms-commands), [short code](https://www.twilio.com/docs/sms/api/short-code), or [channel address](https://www.twilio.com/docs/messaging/channels) (e.g., `whatsapp:+15554449999`). The value of the `from` parameter must be a sender that is hosted within Twilio and belongs to the Account creating the Message. If you are using `messaging_service_sid`, this parameter can be empty (Twilio assigns a `from` value from the Messaging Service\\\'s Sender Pool) or you can provide a specific sender from your Sender Pool. */ + /** The sender\\\'s Twilio phone number (in [E.164](https://en.wikipedia.org/wiki/E.164) format), [alphanumeric sender ID](https://www.twilio.com/docs/sms/quickstart), [Wireless SIM](https://www.twilio.com/docs/iot/wireless/programmable-wireless-send-machine-machine-sms-commands), [short code](https://www.twilio.com/en-us/messaging/channels/sms/short-codes), or [channel address](https://www.twilio.com/docs/messaging/channels) (e.g., `whatsapp:+15554449999`). The value of the `from` parameter must be a sender that is hosted within Twilio and belongs to the Account creating the Message. If you are using `messaging_service_sid`, this parameter can be empty (Twilio assigns a `from` value from the Messaging Service\\\'s Sender Pool) or you can provide a specific sender from your Sender Pool. */ from?: string; /** The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/services) you want to associate with the Message. When this parameter is provided and the `from` parameter is omitted, Twilio selects the optimal sender from the Messaging Service\\\'s Sender Pool. You may also provide a `from` parameter if you want to use a specific Sender from the Sender Pool. */ messagingServiceSid?: string; /** The text content of the outgoing message. Can be up to 1,600 characters in length. SMS only: If the `body` contains more than 160 [GSM-7](https://www.twilio.com/docs/glossary/what-is-gsm-7-character-encoding) characters (or 70 [UCS-2](https://www.twilio.com/docs/glossary/what-is-ucs-2-character-encoding) characters), the message is segmented and charged accordingly. For long `body` text, consider using the [send_as_mms parameter](https://www.twilio.com/blog/mms-for-long-text-messages). */ body?: string; - /** The URL of media to include in the Message content. `jpeg`, `jpg`, `gif`, and `png` file types are fully supported by Twilio and content is formatted for delivery on destination devices. The media size limit is 5 MB for supported file types (`jpeg`, `jpg`, `png`, `gif`) and 500 KB for [other types](https://www.twilio.com/docs/sms/accepted-mime-types) of accepted media. To send more than one image in the message, provide multiple `media_url` parameters in the POST request. You can include up to ten `media_url` parameters per message. [International](https://support.twilio.com/hc/en-us/articles/223179808-Sending-and-receiving-MMS-messages) and [carrier](https://support.twilio.com/hc/en-us/articles/223133707-Is-MMS-supported-for-all-carriers-in-US-and-Canada-) limits apply. */ + /** The URL of media to include in the Message content. `jpeg`, `jpg`, `gif`, and `png` file types are fully supported by Twilio and content is formatted for delivery on destination devices. The media size limit is 5 MB for supported file types (`jpeg`, `jpg`, `png`, `gif`) and 500 KB for [other types](https://www.twilio.com/docs/messaging/guides/accepted-mime-types) of accepted media. To send more than one image in the message, provide multiple `media_url` parameters in the POST request. You can include up to ten `media_url` parameters per message. [International](https://support.twilio.com/hc/en-us/articles/223179808-Sending-and-receiving-MMS-messages) and [carrier](https://support.twilio.com/hc/en-us/articles/223133707-Is-MMS-supported-for-all-carriers-in-US-and-Canada-) limits apply. */ mediaUrl?: Array; /** For [Content Editor/API](https://www.twilio.com/docs/content) only: The SID of the Content Template to be used with the Message, e.g., `HXXXXXXXXXXXXXXXXXXXXXXXXXXXXX`. If this parameter is not provided, a Content Template is not used. Find the SID in the Console on the Content Editor page. For Content API users, the SID is found in Twilio\\\'s response when [creating the Template](https://www.twilio.com/docs/content/content-api-resources#create-templates) or by [fetching your Templates](https://www.twilio.com/docs/content/content-api-resources#fetch-all-content-resources). */ contentSid?: string; @@ -459,7 +459,7 @@ export class MessageInstance { numSegments: string; direction: MessageDirection; /** - * The sender\'s phone number (in [E.164](https://en.wikipedia.org/wiki/E.164) format), [alphanumeric sender ID](https://www.twilio.com/docs/sms/send-messages#use-an-alphanumeric-sender-id), [Wireless SIM](https://www.twilio.com/docs/iot/wireless/programmable-wireless-send-machine-machine-sms-commands), [short code](https://www.twilio.com/docs/sms/api/short-code), or [channel address](https://www.twilio.com/docs/messaging/channels) (e.g., `whatsapp:+15554449999`). For incoming messages, this is the number or channel address of the sender. For outgoing messages, this value is a Twilio phone number, alphanumeric sender ID, short code, or channel address from which the message is sent. + * The sender\'s phone number (in [E.164](https://en.wikipedia.org/wiki/E.164) format), [alphanumeric sender ID](https://www.twilio.com/docs/sms/quickstart), [Wireless SIM](https://www.twilio.com/docs/iot/wireless/programmable-wireless-send-machine-machine-sms-commands), [short code](https://www.twilio.com/en-us/messaging/channels/sms/short-codes), or [channel address](https://www.twilio.com/docs/messaging/channels) (e.g., `whatsapp:+15554449999`). For incoming messages, this is the number or channel address of the sender. For outgoing messages, this value is a Twilio phone number, alphanumeric sender ID, short code, or channel address from which the message is sent. */ from: string; /** diff --git a/src/rest/content/v1/content.ts b/src/rest/content/v1/content.ts index c116969e22..cef4fb0c66 100644 --- a/src/rest/content/v1/content.ts +++ b/src/rest/content/v1/content.ts @@ -233,7 +233,7 @@ export class ContentInstance { */ variables: any; /** - * The [Content types](https://www.twilio.com/docs/content-api/content-types-overview) (e.g. twilio/text) for this Content resource. + * The [Content types](https://www.twilio.com/docs/content/content-types-overview) (e.g. twilio/text) for this Content resource. */ types: any; /** diff --git a/src/rest/content/v1/contentAndApprovals.ts b/src/rest/content/v1/contentAndApprovals.ts index ae91780152..e8e2fe7fa5 100644 --- a/src/rest/content/v1/contentAndApprovals.ts +++ b/src/rest/content/v1/contentAndApprovals.ts @@ -304,7 +304,7 @@ export class ContentAndApprovalsInstance { */ variables: any; /** - * The [Content types](https://www.twilio.com/docs/content-api/content-types-overview) (e.g. twilio/text) for this Content resource. + * The [Content types](https://www.twilio.com/docs/content/content-types-overview) (e.g. twilio/text) for this Content resource. */ types: any; /** diff --git a/src/rest/content/v1/legacyContent.ts b/src/rest/content/v1/legacyContent.ts index 343e0204af..bbdce5d4eb 100644 --- a/src/rest/content/v1/legacyContent.ts +++ b/src/rest/content/v1/legacyContent.ts @@ -291,7 +291,7 @@ export class LegacyContentInstance { */ variables: any; /** - * The [Content types](https://www.twilio.com/docs/content-api/content-types-overview) (e.g. twilio/text) for this Content resource. + * The [Content types](https://www.twilio.com/docs/content/content-types-overview) (e.g. twilio/text) for this Content resource. */ types: any; /** diff --git a/src/rest/conversations/v1/conversation/message.ts b/src/rest/conversations/v1/conversation/message.ts index 90e8308335..9e080a014e 100644 --- a/src/rest/conversations/v1/conversation/message.ts +++ b/src/rest/conversations/v1/conversation/message.ts @@ -71,7 +71,7 @@ export interface MessageListInstanceCreateOptions { attributes?: string; /** The Media SID to be attached to the new Message. */ mediaSid?: string; - /** The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content-api) template, required for template-generated messages. **Note** that if this field is set, `Body` and `MediaSid` parameters are ignored. */ + /** The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content) template, required for template-generated messages. **Note** that if this field is set, `Body` and `MediaSid` parameters are ignored. */ contentSid?: string; /** A structurally valid JSON string that contains values to resolve Rich Content template variables. */ contentVariables?: string; @@ -462,7 +462,7 @@ export class MessageInstance { */ links: Record; /** - * The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content-api) template. + * The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content) template. */ contentSid: string; diff --git a/src/rest/conversations/v1/service/conversation/message.ts b/src/rest/conversations/v1/service/conversation/message.ts index 7d539ae3ca..736505e16b 100644 --- a/src/rest/conversations/v1/service/conversation/message.ts +++ b/src/rest/conversations/v1/service/conversation/message.ts @@ -71,7 +71,7 @@ export interface MessageListInstanceCreateOptions { attributes?: string; /** The Media SID to be attached to the new Message. */ mediaSid?: string; - /** The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content-api) template, required for template-generated messages. **Note** that if this field is set, `Body` and `MediaSid` parameters are ignored. */ + /** The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content) template, required for template-generated messages. **Note** that if this field is set, `Body` and `MediaSid` parameters are ignored. */ contentSid?: string; /** A structurally valid JSON string that contains values to resolve Rich Content template variables. */ contentVariables?: string; @@ -482,7 +482,7 @@ export class MessageInstance { */ links: Record; /** - * The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content-api) template. + * The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content) template. */ contentSid: string; diff --git a/src/rest/intelligence/v2/service.ts b/src/rest/intelligence/v2/service.ts index 96b04940c6..bc937fc5f6 100644 --- a/src/rest/intelligence/v2/service.ts +++ b/src/rest/intelligence/v2/service.ts @@ -30,7 +30,7 @@ export interface ServiceContextUpdateOptions { ifMatch?: string; /** Instructs the Speech Recognition service to automatically transcribe all recordings made on the account. */ autoTranscribe?: boolean; - /** Data logging allows Twilio to improve the quality of the speech recognition through using customer data to refine its speech recognition models. */ + /** Data logging allows Twilio to improve the quality of the speech recognition & language understanding services through using customer data to refine, fine tune and evaluate machine learning models. Note: Data logging cannot be activated via API, only via www.twilio.com, as it requires additional consent. */ dataLogging?: boolean; /** A human readable description of this resource, up to 64 characters. */ friendlyName?: string; @@ -56,7 +56,7 @@ export interface ServiceListInstanceCreateOptions { uniqueName: string; /** Instructs the Speech Recognition service to automatically transcribe all recordings made on the account. */ autoTranscribe?: boolean; - /** Data logging allows Twilio to improve the quality of the speech recognition through using customer data to refine its speech recognition models. */ + /** Data logging allows Twilio to improve the quality of the speech recognition & language understanding services through using customer data to refine, fine tune and evaluate machine learning models. Note: Data logging cannot be activated via API, only via www.twilio.com, as it requires additional consent. */ dataLogging?: boolean; /** A human readable description of this resource, up to 64 characters. */ friendlyName?: string; @@ -353,7 +353,7 @@ export class ServiceInstance { */ autoTranscribe: boolean; /** - * Data logging allows Twilio to improve the quality of the speech recognition through using customer data to refine its speech recognition models. + * Data logging allows Twilio to improve the quality of the speech recognition & language understanding services through using customer data to refine, fine tune and evaluate machine learning models. Note: Data logging cannot be activated via API, only via www.twilio.com, as it requires additional consent. */ dataLogging: boolean; /** diff --git a/src/rest/intelligence/v2/transcript.ts b/src/rest/intelligence/v2/transcript.ts index a91ba8f79a..a76758a690 100644 --- a/src/rest/intelligence/v2/transcript.ts +++ b/src/rest/intelligence/v2/transcript.ts @@ -335,7 +335,7 @@ export class TranscriptInstance { */ channel: any; /** - * Data logging allows Twilio to improve the quality of the speech recognition through using customer data to refine its speech recognition models. + * Data logging allows Twilio to improve the quality of the speech recognition & language understanding services through using customer data to refine, fine tune and evaluate machine learning models. Note: Data logging cannot be activated via API, only via www.twilio.com, as it requires additional consent. */ dataLogging: boolean; /** diff --git a/src/rest/notify/v1/service.ts b/src/rest/notify/v1/service.ts index 5ac5c8aa98..9e008d5fbd 100644 --- a/src/rest/notify/v1/service.ts +++ b/src/rest/notify/v1/service.ts @@ -32,7 +32,7 @@ export interface ServiceContextUpdateOptions { apnCredentialSid?: string; /** The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for GCM Bindings. */ gcmCredentialSid?: string; - /** The SID of the [Messaging Service](https://www.twilio.com/docs/sms/send-messages#messaging-services) to use for SMS Bindings. This parameter must be set in order to send SMS notifications. */ + /** The SID of the [Messaging Service](https://www.twilio.com/docs/sms/quickstart#messaging-services) to use for SMS Bindings. This parameter must be set in order to send SMS notifications. */ messagingServiceSid?: string; /** Deprecated. */ facebookMessengerPageId?: string; @@ -66,7 +66,7 @@ export interface ServiceListInstanceCreateOptions { apnCredentialSid?: string; /** The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for GCM Bindings. */ gcmCredentialSid?: string; - /** The SID of the [Messaging Service](https://www.twilio.com/docs/sms/send-messages#messaging-services) to use for SMS Bindings. This parameter must be set in order to send SMS notifications. */ + /** The SID of the [Messaging Service](https://www.twilio.com/docs/sms/quickstart#messaging-services) to use for SMS Bindings. This parameter must be set in order to send SMS notifications. */ messagingServiceSid?: string; /** Deprecated. */ facebookMessengerPageId?: string; @@ -440,7 +440,7 @@ export class ServiceInstance { */ fcmCredentialSid: string; /** - * The SID of the [Messaging Service](https://www.twilio.com/docs/sms/send-messages#messaging-services) to use for SMS Bindings. In order to send SMS notifications this parameter has to be set. + * The SID of the [Messaging Service](https://www.twilio.com/docs/sms/quickstart#messaging-services) to use for SMS Bindings. In order to send SMS notifications this parameter has to be set. */ messagingServiceSid: string; /** diff --git a/src/rest/notify/v1/service/notification.ts b/src/rest/notify/v1/service/notification.ts index 2be9b08759..1ffb83cdbd 100644 --- a/src/rest/notify/v1/service/notification.ts +++ b/src/rest/notify/v1/service/notification.ts @@ -42,7 +42,7 @@ export interface NotificationListInstanceCreateOptions { apn?: any; /** The GCM-specific payload that overrides corresponding attributes in the generic payload for GCM Bindings. This property maps to the root JSON dictionary. See the [GCM documentation](https://firebase.google.com/docs/cloud-messaging/http-server-ref) for more details. Target parameters `to`, `registration_ids`, and `notification_key` are not allowed. We reserve keys that start with `twi_` for future use. Custom keys that start with `twi_` are not allowed. GCM also [reserves certain keys](https://firebase.google.com/docs/cloud-messaging/http-server-ref). */ gcm?: any; - /** The SMS-specific payload that overrides corresponding attributes in the generic payload for SMS Bindings. Each attribute in this value maps to the corresponding `form` parameter of the Twilio [Message](https://www.twilio.com/docs/sms/send-messages) resource. These parameters of the Message resource are supported in snake case format: `body`, `media_urls`, `status_callback`, and `max_price`. The `status_callback` parameter overrides the corresponding parameter in the messaging service, if configured. The `media_urls` property expects a JSON array. */ + /** The SMS-specific payload that overrides corresponding attributes in the generic payload for SMS Bindings. Each attribute in this value maps to the corresponding `form` parameter of the Twilio [Message](https://www.twilio.com/docs/sms/quickstart) resource. These parameters of the Message resource are supported in snake case format: `body`, `media_urls`, `status_callback`, and `max_price`. The `status_callback` parameter overrides the corresponding parameter in the messaging service, if configured. The `media_urls` property expects a JSON array. */ sms?: any; /** Deprecated. */ facebookMessenger?: any; diff --git a/src/rest/proxy/v1/service/session/interaction.ts b/src/rest/proxy/v1/service/session/interaction.ts index 27606027b8..83b8ec7449 100644 --- a/src/rest/proxy/v1/service/session/interaction.ts +++ b/src/rest/proxy/v1/service/session/interaction.ts @@ -288,7 +288,7 @@ export class InteractionInstance { */ inboundParticipantSid: string; /** - * The SID of the inbound resource; either the [Call](https://www.twilio.com/docs/voice/api/call-resource) or [Message](https://www.twilio.com/docs/sms/api/message. + * The SID of the inbound resource; either the [Call](https://www.twilio.com/docs/voice/api/call-resource) or [Message](https://www.twilio.com/docs/sms/api/message-resource). */ inboundResourceSid: string; inboundResourceStatus: InteractionResourceStatus; diff --git a/src/rest/proxy/v1/service/shortCode.ts b/src/rest/proxy/v1/service/shortCode.ts index a981ae7029..c54577b34c 100644 --- a/src/rest/proxy/v1/service/shortCode.ts +++ b/src/rest/proxy/v1/service/shortCode.ts @@ -33,7 +33,7 @@ export interface ShortCodeContextUpdateOptions { * Options to pass to create a ShortCodeInstance */ export interface ShortCodeListInstanceCreateOptions { - /** The SID of a Twilio [ShortCode](https://www.twilio.com/docs/sms/api/short-code) resource that represents the short code you would like to assign to your Proxy Service. */ + /** The SID of a Twilio [ShortCode](https://www.twilio.com/en-us/messaging/channels/sms/short-codes) resource that represents the short code you would like to assign to your Proxy Service. */ sid: string; } /** diff --git a/src/rest/supersim/v1/esimProfile.ts b/src/rest/supersim/v1/esimProfile.ts index 09a983a1c0..4c0ddbaf8e 100644 --- a/src/rest/supersim/v1/esimProfile.ts +++ b/src/rest/supersim/v1/esimProfile.ts @@ -47,7 +47,7 @@ export interface EsimProfileListInstanceCreateOptions { export interface EsimProfileListInstanceEachOptions { /** List the eSIM Profiles that have been associated with an EId. */ eid?: string; - /** Find the eSIM Profile resource related to a [Sim](https://www.twilio.com/docs/iot/wireless/api/sim-resource) resource by providing the SIM SID. Will always return an array with either 1 or 0 records. */ + /** Find the eSIM Profile resource related to a [Sim](https://www.twilio.com/docs/iot/supersim/api/sim-resource) resource by providing the SIM SID. Will always return an array with either 1 or 0 records. */ simSid?: string; /** List the eSIM Profiles that are in a given status. */ status?: EsimProfileStatus; @@ -67,7 +67,7 @@ export interface EsimProfileListInstanceEachOptions { export interface EsimProfileListInstanceOptions { /** List the eSIM Profiles that have been associated with an EId. */ eid?: string; - /** Find the eSIM Profile resource related to a [Sim](https://www.twilio.com/docs/iot/wireless/api/sim-resource) resource by providing the SIM SID. Will always return an array with either 1 or 0 records. */ + /** Find the eSIM Profile resource related to a [Sim](https://www.twilio.com/docs/iot/supersim/api/sim-resource) resource by providing the SIM SID. Will always return an array with either 1 or 0 records. */ simSid?: string; /** List the eSIM Profiles that are in a given status. */ status?: EsimProfileStatus; @@ -83,7 +83,7 @@ export interface EsimProfileListInstanceOptions { export interface EsimProfileListInstancePageOptions { /** List the eSIM Profiles that have been associated with an EId. */ eid?: string; - /** Find the eSIM Profile resource related to a [Sim](https://www.twilio.com/docs/iot/wireless/api/sim-resource) resource by providing the SIM SID. Will always return an array with either 1 or 0 records. */ + /** Find the eSIM Profile resource related to a [Sim](https://www.twilio.com/docs/iot/supersim/api/sim-resource) resource by providing the SIM SID. Will always return an array with either 1 or 0 records. */ simSid?: string; /** List the eSIM Profiles that are in a given status. */ status?: EsimProfileStatus; @@ -232,7 +232,7 @@ export class EsimProfileInstance { */ iccid: string; /** - * The SID of the [Sim](https://www.twilio.com/docs/iot/wireless/api/sim-resource) resource that this eSIM Profile controls. + * The SID of the [Sim](https://www.twilio.com/docs/iot/supersim/api/sim-resource) resource that this eSIM Profile controls. */ simSid: string; status: EsimProfileStatus; diff --git a/src/rest/verify/v2/service.ts b/src/rest/verify/v2/service.ts index 407190ee2d..14ed448f48 100644 --- a/src/rest/verify/v2/service.ts +++ b/src/rest/verify/v2/service.ts @@ -65,6 +65,8 @@ export interface ServiceContextUpdateOptions { "totp.skew"?: number; /** The default message [template](https://www.twilio.com/docs/verify/api/templates). Will be used for all SMS verifications unless explicitly overriden. SMS channel only. */ defaultTemplateSid?: string; + /** Whether to allow verifications from the service to reach the stream-events sinks if configured */ + verifyEventSubscriptionEnabled?: boolean; } /** @@ -105,6 +107,8 @@ export interface ServiceListInstanceCreateOptions { "totp.skew"?: number; /** The default message [template](https://www.twilio.com/docs/verify/api/templates). Will be used for all SMS verifications unless explicitly overriden. SMS channel only. */ defaultTemplateSid?: string; + /** Whether to allow verifications from the service to reach the stream-events sinks if configured */ + verifyEventSubscriptionEnabled?: boolean; } /** * Options to pass to each @@ -364,6 +368,10 @@ export class ServiceContextImpl implements ServiceContext { data["Totp.Skew"] = params["totp.skew"]; if (params["defaultTemplateSid"] !== undefined) data["DefaultTemplateSid"] = params["defaultTemplateSid"]; + if (params["verifyEventSubscriptionEnabled"] !== undefined) + data["VerifyEventSubscriptionEnabled"] = serialize.bool( + params["verifyEventSubscriptionEnabled"] + ); const headers: any = {}; headers["Content-Type"] = "application/x-www-form-urlencoded"; @@ -422,6 +430,7 @@ interface ServiceResource { push: any; totp: any; default_template_sid: string; + verify_event_subscription_enabled: boolean; date_created: Date; date_updated: Date; url: string; @@ -447,6 +456,8 @@ export class ServiceInstance { this.push = payload.push; this.totp = payload.totp; this.defaultTemplateSid = payload.default_template_sid; + this.verifyEventSubscriptionEnabled = + payload.verify_event_subscription_enabled; this.dateCreated = deserialize.iso8601DateTime(payload.date_created); this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); this.url = payload.url; @@ -508,6 +519,10 @@ export class ServiceInstance { */ totp: any; defaultTemplateSid: string; + /** + * Whether to allow verifications from the service to reach the stream-events sinks if configured + */ + verifyEventSubscriptionEnabled: boolean; /** * The date and time in GMT when the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. */ @@ -658,6 +673,7 @@ export class ServiceInstance { push: this.push, totp: this.totp, defaultTemplateSid: this.defaultTemplateSid, + verifyEventSubscriptionEnabled: this.verifyEventSubscriptionEnabled, dateCreated: this.dateCreated, dateUpdated: this.dateUpdated, url: this.url, @@ -831,6 +847,10 @@ export function ServiceListInstance(version: V2): ServiceListInstance { data["Totp.Skew"] = params["totp.skew"]; if (params["defaultTemplateSid"] !== undefined) data["DefaultTemplateSid"] = params["defaultTemplateSid"]; + if (params["verifyEventSubscriptionEnabled"] !== undefined) + data["VerifyEventSubscriptionEnabled"] = serialize.bool( + params["verifyEventSubscriptionEnabled"] + ); const headers: any = {}; headers["Content-Type"] = "application/x-www-form-urlencoded"; diff --git a/src/rest/verify/v2/verificationAttempt.ts b/src/rest/verify/v2/verificationAttempt.ts index 3eb86b4958..b4e096ca4d 100644 --- a/src/rest/verify/v2/verificationAttempt.ts +++ b/src/rest/verify/v2/verificationAttempt.ts @@ -258,7 +258,7 @@ export class VerificationAttemptInstance { conversionStatus: VerificationAttemptConversionStatus; channel: VerificationAttemptChannels; /** - * An object containing the charge for this verification attempt related to the channel costs and the currency used. The costs related to the succeeded verifications are not included. May not be immediately available. More information on pricing is available [here](https://www.twilio.com/verify/pricing). + * An object containing the charge for this verification attempt related to the channel costs and the currency used. The costs related to the succeeded verifications are not included. May not be immediately available. More information on pricing is available [here](https://www.twilio.com/en-us/verify/pricing). */ price: any; /** From 2a51f837687f7be5a15ad8a28639312b86d321fd Mon Sep 17 00:00:00 2001 From: Twilio Date: Fri, 1 Dec 2023 05:54:02 +0000 Subject: [PATCH 08/11] Release 4.19.3 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f0a479e78e..09cc29c46f 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "twilio", "description": "A Twilio helper library", - "version": "4.19.2", + "version": "4.19.3", "author": "API Team ", "contributors": [ { From a2f90eb47a8451198cd0ff79eb2ff3cfae3c4e3b Mon Sep 17 00:00:00 2001 From: Twilio Date: Thu, 14 Dec 2023 10:23:15 +0000 Subject: [PATCH 09/11] [Librarian] Regenerated @ 08c0904bec7ba6e5da9e5db6c4e0f74dfc97fb10 --- CHANGES.md | 24 ++ .../api/v2010/account/authorizedConnectApp.ts | 14 - .../events/v1/subscription/subscribedEvent.ts | 6 +- src/rest/numbers/V1.ts | 10 + src/rest/numbers/v1/portingPortInFetch.ts | 273 ++++++++++++++++++ .../v1/workspace/task/reservation.ts | 4 + .../v1/workspace/worker/reservation.ts | 4 + .../v1/complianceTollfreeInquiries.ts | 92 +++++- 8 files changed, 409 insertions(+), 18 deletions(-) create mode 100644 src/rest/numbers/v1/portingPortInFetch.ts diff --git a/CHANGES.md b/CHANGES.md index 2e5aef814f..25702c77f1 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,30 @@ twilio-node changelog ===================== +[2023-12-14] Version 4.20.0 +--------------------------- +**Api** +- Updated service base url for connect apps and authorized connect apps APIs **(breaking change)** + +**Events** +- Marked as GA + +**Insights** +- decommission voice-qualitystats-endpoint role + +**Numbers** +- Add Get Port In request api + +**Taskrouter** +- Add `jitter_buffer_size` param in update reservation + +**Trusthub** +- Add additional optional fields in compliance_tollfree_inquiry.json + +**Verify** +- Remove `Tags` from Public Docs **(breaking change)** + + [2023-12-01] Version 4.19.3 --------------------------- **Verify** diff --git a/src/rest/api/v2010/account/authorizedConnectApp.ts b/src/rest/api/v2010/account/authorizedConnectApp.ts index 89b456e107..208436838f 100644 --- a/src/rest/api/v2010/account/authorizedConnectApp.ts +++ b/src/rest/api/v2010/account/authorizedConnectApp.ts @@ -160,8 +160,6 @@ interface AuthorizedConnectAppResource { connect_app_friendly_name: string; connect_app_homepage_url: string; connect_app_sid: string; - date_created: Date; - date_updated: Date; permissions: Array; uri: string; } @@ -182,8 +180,6 @@ export class AuthorizedConnectAppInstance { this.connectAppFriendlyName = payload.connect_app_friendly_name; this.connectAppHomepageUrl = payload.connect_app_homepage_url; this.connectAppSid = payload.connect_app_sid; - this.dateCreated = deserialize.rfc2822DateTime(payload.date_created); - this.dateUpdated = deserialize.rfc2822DateTime(payload.date_updated); this.permissions = payload.permissions; this.uri = payload.uri; @@ -217,14 +213,6 @@ export class AuthorizedConnectAppInstance { * The SID that we assigned to the Connect App. */ connectAppSid: string; - /** - * The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. - */ - dateCreated: Date; - /** - * The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. - */ - dateUpdated: Date; /** * The set of permissions that you authorized for the Connect App. Can be: `get-all` or `post-all`. */ @@ -271,8 +259,6 @@ export class AuthorizedConnectAppInstance { connectAppFriendlyName: this.connectAppFriendlyName, connectAppHomepageUrl: this.connectAppHomepageUrl, connectAppSid: this.connectAppSid, - dateCreated: this.dateCreated, - dateUpdated: this.dateUpdated, permissions: this.permissions, uri: this.uri, }; diff --git a/src/rest/events/v1/subscription/subscribedEvent.ts b/src/rest/events/v1/subscription/subscribedEvent.ts index 42f3ba886f..184b90ea69 100644 --- a/src/rest/events/v1/subscription/subscribedEvent.ts +++ b/src/rest/events/v1/subscription/subscribedEvent.ts @@ -24,7 +24,7 @@ import { isValidPathParam } from "../../../../base/utility"; * Options to pass to update a SubscribedEventInstance */ export interface SubscribedEventContextUpdateOptions { - /** The schema version that the subscription should use. */ + /** The schema version that the Subscription should use. */ schemaVersion?: number; } @@ -34,7 +34,7 @@ export interface SubscribedEventContextUpdateOptions { export interface SubscribedEventListInstanceCreateOptions { /** Type of event being subscribed to. */ type: string; - /** The schema version that the subscription should use. */ + /** The schema version that the Subscription should use. */ schemaVersion?: number; } /** @@ -296,7 +296,7 @@ export class SubscribedEventInstance { */ type: string; /** - * The schema version that the subscription should use. + * The schema version that the Subscription should use. */ schemaVersion: number; /** diff --git a/src/rest/numbers/V1.ts b/src/rest/numbers/V1.ts index 688d63123a..4363f99742 100644 --- a/src/rest/numbers/V1.ts +++ b/src/rest/numbers/V1.ts @@ -16,6 +16,7 @@ import NumbersBase from "../NumbersBase"; import Version from "../../base/Version"; import { BulkEligibilityListInstance } from "./v1/bulkEligibility"; import { PortingBulkPortabilityListInstance } from "./v1/portingBulkPortability"; +import { PortingPortInFetchListInstance } from "./v1/portingPortInFetch"; import { PortingPortabilityListInstance } from "./v1/portingPortability"; export default class V1 extends Version { @@ -32,6 +33,8 @@ export default class V1 extends Version { protected _bulkEligibilities?: BulkEligibilityListInstance; /** portingBulkPortabilities - { Twilio.Numbers.V1.PortingBulkPortabilityListInstance } resource */ protected _portingBulkPortabilities?: PortingBulkPortabilityListInstance; + /** portingPortIns - { Twilio.Numbers.V1.PortingPortInFetchListInstance } resource */ + protected _portingPortIns?: PortingPortInFetchListInstance; /** portingPortabilities - { Twilio.Numbers.V1.PortingPortabilityListInstance } resource */ protected _portingPortabilities?: PortingPortabilityListInstance; @@ -50,6 +53,13 @@ export default class V1 extends Version { return this._portingBulkPortabilities; } + /** Getter for portingPortIns resource */ + get portingPortIns(): PortingPortInFetchListInstance { + this._portingPortIns = + this._portingPortIns || PortingPortInFetchListInstance(this); + return this._portingPortIns; + } + /** Getter for portingPortabilities resource */ get portingPortabilities(): PortingPortabilityListInstance { this._portingPortabilities = diff --git a/src/rest/numbers/v1/portingPortInFetch.ts b/src/rest/numbers/v1/portingPortInFetch.ts new file mode 100644 index 0000000000..1943b3d32c --- /dev/null +++ b/src/rest/numbers/v1/portingPortInFetch.ts @@ -0,0 +1,273 @@ +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Numbers + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { inspect, InspectOptions } from "util"; +import V1 from "../V1"; +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +import { isValidPathParam } from "../../../base/utility"; + +export interface PortingPortInFetchContext { + /** + * Fetch a PortingPortInFetchInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed PortingPortInFetchInstance + */ + fetch( + callback?: (error: Error | null, item?: PortingPortInFetchInstance) => any + ): Promise; + + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} + +export interface PortingPortInFetchContextSolution { + portInRequestSid: string; +} + +export class PortingPortInFetchContextImpl + implements PortingPortInFetchContext +{ + protected _solution: PortingPortInFetchContextSolution; + protected _uri: string; + + constructor(protected _version: V1, portInRequestSid: string) { + if (!isValidPathParam(portInRequestSid)) { + throw new Error("Parameter 'portInRequestSid' is not valid."); + } + + this._solution = { portInRequestSid }; + this._uri = `/Porting/PortIn/${portInRequestSid}`; + } + + fetch( + callback?: (error: Error | null, item?: PortingPortInFetchInstance) => any + ): Promise { + const instance = this; + let operationVersion = instance._version, + operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + }); + + operationPromise = operationPromise.then( + (payload) => + new PortingPortInFetchInstance( + operationVersion, + payload, + instance._solution.portInRequestSid + ) + ); + + operationPromise = instance._version.setPromiseCallback( + operationPromise, + callback + ); + return operationPromise; + } + + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return this._solution; + } + + [inspect.custom](_depth: any, options: InspectOptions) { + return inspect(this.toJSON(), options); + } +} + +interface PortingPortInFetchPayload extends PortingPortInFetchResource {} + +interface PortingPortInFetchResource { + port_in_request_sid: string; + url: string; + account_sid: string; + notification_emails: Array; + target_port_in_date: Date; + target_port_in_time_range_start: string; + target_port_in_time_range_end: string; + losing_carrier_information: any; + phone_numbers: Array; + documents: Array; +} + +export class PortingPortInFetchInstance { + protected _solution: PortingPortInFetchContextSolution; + protected _context?: PortingPortInFetchContext; + + constructor( + protected _version: V1, + payload: PortingPortInFetchResource, + portInRequestSid?: string + ) { + this.portInRequestSid = payload.port_in_request_sid; + this.url = payload.url; + this.accountSid = payload.account_sid; + this.notificationEmails = payload.notification_emails; + this.targetPortInDate = deserialize.iso8601Date( + payload.target_port_in_date + ); + this.targetPortInTimeRangeStart = payload.target_port_in_time_range_start; + this.targetPortInTimeRangeEnd = payload.target_port_in_time_range_end; + this.losingCarrierInformation = payload.losing_carrier_information; + this.phoneNumbers = payload.phone_numbers; + this.documents = payload.documents; + + this._solution = { + portInRequestSid: portInRequestSid || this.portInRequestSid, + }; + } + + /** + * The SID of the Port In request. This is a unique identifier of the port in request. + */ + portInRequestSid: string; + /** + * The URL of this Port In request + */ + url: string; + /** + * The Account SID that the numbers will be added to after they are ported into Twilio. + */ + accountSid: string; + /** + * List of emails for getting notifications about the LOA signing process. Allowed Max 10 emails. + */ + notificationEmails: Array; + /** + * Minimum number of days in the future (at least 2 days) needs to be established with the Ops team for validation. + */ + targetPortInDate: Date; + /** + * Minimum hour in the future needs to be established with the Ops team for validation. + */ + targetPortInTimeRangeStart: string; + /** + * Maximum hour in the future needs to be established with the Ops team for validation. + */ + targetPortInTimeRangeEnd: string; + /** + * The information for the losing carrier. + */ + losingCarrierInformation: any; + /** + * The list of phone numbers to Port in. Phone numbers are in E.164 format (e.g. +16175551212). + */ + phoneNumbers: Array; + /** + * The list of documents SID referencing a utility bills + */ + documents: Array; + + private get _proxy(): PortingPortInFetchContext { + this._context = + this._context || + new PortingPortInFetchContextImpl( + this._version, + this._solution.portInRequestSid + ); + return this._context; + } + + /** + * Fetch a PortingPortInFetchInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed PortingPortInFetchInstance + */ + fetch( + callback?: (error: Error | null, item?: PortingPortInFetchInstance) => any + ): Promise { + return this._proxy.fetch(callback); + } + + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + portInRequestSid: this.portInRequestSid, + url: this.url, + accountSid: this.accountSid, + notificationEmails: this.notificationEmails, + targetPortInDate: this.targetPortInDate, + targetPortInTimeRangeStart: this.targetPortInTimeRangeStart, + targetPortInTimeRangeEnd: this.targetPortInTimeRangeEnd, + losingCarrierInformation: this.losingCarrierInformation, + phoneNumbers: this.phoneNumbers, + documents: this.documents, + }; + } + + [inspect.custom](_depth: any, options: InspectOptions) { + return inspect(this.toJSON(), options); + } +} + +export interface PortingPortInFetchSolution {} + +export interface PortingPortInFetchListInstance { + _version: V1; + _solution: PortingPortInFetchSolution; + _uri: string; + + (portInRequestSid: string): PortingPortInFetchContext; + get(portInRequestSid: string): PortingPortInFetchContext; + + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} + +export function PortingPortInFetchListInstance( + version: V1 +): PortingPortInFetchListInstance { + const instance = ((portInRequestSid) => + instance.get(portInRequestSid)) as PortingPortInFetchListInstance; + + instance.get = function get(portInRequestSid): PortingPortInFetchContext { + return new PortingPortInFetchContextImpl(version, portInRequestSid); + }; + + instance._version = version; + instance._solution = {}; + instance._uri = ``; + + 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/taskrouter/v1/workspace/task/reservation.ts b/src/rest/taskrouter/v1/workspace/task/reservation.ts index 154b8580f4..82097e450f 100644 --- a/src/rest/taskrouter/v1/workspace/task/reservation.ts +++ b/src/rest/taskrouter/v1/workspace/task/reservation.ts @@ -159,6 +159,8 @@ export interface ReservationContextUpdateOptions { endConferenceOnCustomerExit?: boolean; /** Whether to play a notification beep when the customer joins. */ beepOnCustomerEntrance?: boolean; + /** The jitter buffer size for conference. Can be: `small`, `medium`, `large`, `off`. */ + jitterBufferSize?: string; } /** * Options to pass to each @@ -443,6 +445,8 @@ export class ReservationContextImpl implements ReservationContext { data["BeepOnCustomerEntrance"] = serialize.bool( params["beepOnCustomerEntrance"] ); + if (params["jitterBufferSize"] !== undefined) + data["JitterBufferSize"] = params["jitterBufferSize"]; const headers: any = {}; headers["Content-Type"] = "application/x-www-form-urlencoded"; diff --git a/src/rest/taskrouter/v1/workspace/worker/reservation.ts b/src/rest/taskrouter/v1/workspace/worker/reservation.ts index 93794862da..7aaecaa272 100644 --- a/src/rest/taskrouter/v1/workspace/worker/reservation.ts +++ b/src/rest/taskrouter/v1/workspace/worker/reservation.ts @@ -153,6 +153,8 @@ export interface ReservationContextUpdateOptions { endConferenceOnCustomerExit?: boolean; /** Whether to play a notification beep when the customer joins. */ beepOnCustomerEntrance?: boolean; + /** The jitter buffer size for conference. Can be: `small`, `medium`, `large`, `off`. */ + jitterBufferSize?: string; } /** * Options to pass to each @@ -427,6 +429,8 @@ export class ReservationContextImpl implements ReservationContext { data["BeepOnCustomerEntrance"] = serialize.bool( params["beepOnCustomerEntrance"] ); + if (params["jitterBufferSize"] !== undefined) + data["JitterBufferSize"] = params["jitterBufferSize"]; const headers: any = {}; headers["Content-Type"] = "application/x-www-form-urlencoded"; diff --git a/src/rest/trusthub/v1/complianceTollfreeInquiries.ts b/src/rest/trusthub/v1/complianceTollfreeInquiries.ts index 5d78e7d238..47c7c767f3 100644 --- a/src/rest/trusthub/v1/complianceTollfreeInquiries.ts +++ b/src/rest/trusthub/v1/complianceTollfreeInquiries.ts @@ -18,14 +18,59 @@ const deserialize = require("../../../base/deserialize"); const serialize = require("../../../base/serialize"); import { isValidPathParam } from "../../../base/utility"; +export type ComplianceTollfreeInquiriesOptInType = + | "VERBAL" + | "WEB_FORM" + | "PAPER_FORM" + | "VIA_TEXT" + | "MOBILE_QR_CODE"; + /** * Options to pass to create a ComplianceTollfreeInquiriesInstance */ export interface ComplianceTollfreeInquiriesListInstanceCreateOptions { /** The Tollfree phone number to be verified */ tollfreePhoneNumber: string; - /** The notification email to be triggered when verification status is changed */ + /** The email address to receive the notification about the verification result. */ notificationEmail: string; + /** The name of the business or organization using the Tollfree number. */ + businessName?: string; + /** The website of the business or organization using the Tollfree number. */ + businessWebsite?: string; + /** The category of the use case for the Tollfree Number. List as many are applicable.. */ + useCaseCategories?: Array; + /** Use this to further explain how messaging is used by the business or organization. */ + useCaseSummary?: string; + /** An example of message content, i.e. a sample message. */ + productionMessageSample?: string; + /** Link to an image that shows the opt-in workflow. Multiple images allowed and must be a publicly hosted URL. */ + optInImageUrls?: Array; + /** */ + optInType?: ComplianceTollfreeInquiriesOptInType; + /** Estimate monthly volume of messages from the Tollfree Number. */ + messageVolume?: string; + /** The address of the business or organization using the Tollfree number. */ + businessStreetAddress?: string; + /** The address of the business or organization using the Tollfree number. */ + businessStreetAddress2?: string; + /** The city of the business or organization using the Tollfree number. */ + businessCity?: string; + /** The state/province/region of the business or organization using the Tollfree number. */ + businessStateProvinceRegion?: string; + /** The postal code of the business or organization using the Tollfree number. */ + businessPostalCode?: string; + /** The country of the business or organization using the Tollfree number. */ + businessCountry?: string; + /** Additional information to be provided for verification. */ + additionalInformation?: string; + /** The first name of the contact for the business or organization using the Tollfree number. */ + businessContactFirstName?: string; + /** The last name of the contact for the business or organization using the Tollfree number. */ + businessContactLastName?: string; + /** The email address of the contact for the business or organization using the Tollfree number. */ + businessContactEmail?: string; + /** The phone number of the contact for the business or organization using the Tollfree number. */ + businessContactPhone?: string; } export interface ComplianceTollfreeInquiriesSolution {} @@ -101,6 +146,51 @@ export function ComplianceTollfreeInquiriesListInstance( data["TollfreePhoneNumber"] = params["tollfreePhoneNumber"]; data["NotificationEmail"] = params["notificationEmail"]; + if (params["businessName"] !== undefined) + data["BusinessName"] = params["businessName"]; + if (params["businessWebsite"] !== undefined) + data["BusinessWebsite"] = params["businessWebsite"]; + if (params["useCaseCategories"] !== undefined) + data["UseCaseCategories"] = serialize.map( + params["useCaseCategories"], + (e: string) => e + ); + if (params["useCaseSummary"] !== undefined) + data["UseCaseSummary"] = params["useCaseSummary"]; + if (params["productionMessageSample"] !== undefined) + data["ProductionMessageSample"] = params["productionMessageSample"]; + if (params["optInImageUrls"] !== undefined) + data["OptInImageUrls"] = serialize.map( + params["optInImageUrls"], + (e: string) => e + ); + if (params["optInType"] !== undefined) + data["OptInType"] = params["optInType"]; + if (params["messageVolume"] !== undefined) + data["MessageVolume"] = params["messageVolume"]; + if (params["businessStreetAddress"] !== undefined) + data["BusinessStreetAddress"] = params["businessStreetAddress"]; + if (params["businessStreetAddress2"] !== undefined) + data["BusinessStreetAddress2"] = params["businessStreetAddress2"]; + if (params["businessCity"] !== undefined) + data["BusinessCity"] = params["businessCity"]; + if (params["businessStateProvinceRegion"] !== undefined) + data["BusinessStateProvinceRegion"] = + params["businessStateProvinceRegion"]; + if (params["businessPostalCode"] !== undefined) + data["BusinessPostalCode"] = params["businessPostalCode"]; + if (params["businessCountry"] !== undefined) + data["BusinessCountry"] = params["businessCountry"]; + if (params["additionalInformation"] !== undefined) + data["AdditionalInformation"] = params["additionalInformation"]; + if (params["businessContactFirstName"] !== undefined) + data["BusinessContactFirstName"] = params["businessContactFirstName"]; + if (params["businessContactLastName"] !== undefined) + data["BusinessContactLastName"] = params["businessContactLastName"]; + if (params["businessContactEmail"] !== undefined) + data["BusinessContactEmail"] = params["businessContactEmail"]; + if (params["businessContactPhone"] !== undefined) + data["BusinessContactPhone"] = params["businessContactPhone"]; const headers: any = {}; headers["Content-Type"] = "application/x-www-form-urlencoded"; From aa7a28bf1279dfd6d4430e12b6b32c16f0485c87 Mon Sep 17 00:00:00 2001 From: Twilio Date: Thu, 14 Dec 2023 10:57:28 +0000 Subject: [PATCH 10/11] Release 4.20.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 09cc29c46f..0a52e52fd4 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "twilio", "description": "A Twilio helper library", - "version": "4.19.3", + "version": "4.20.0", "author": "API Team ", "contributors": [ { From dc1e741ec05364e82741403df9d77890847b485d Mon Sep 17 00:00:00 2001 From: Shubham Date: Wed, 3 Jan 2024 10:24:47 +0530 Subject: [PATCH 11/11] chore: add lts version (#989) * chore: add lts version * Update package.json --- .github/workflows/test-and-deploy.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-and-deploy.yml b/.github/workflows/test-and-deploy.yml index ad07a0db9a..760cac0d8f 100644 --- a/.github/workflows/test-and-deploy.yml +++ b/.github/workflows/test-and-deploy.yml @@ -17,7 +17,7 @@ jobs: timeout-minutes: 20 strategy: matrix: - node: [ 14, 16, 18 ] + node: [ 14, 16, 18, lts/* ] steps: - name: Checkout twilio-node uses: actions/checkout@v3 @@ -49,7 +49,7 @@ jobs: npm run test - name: SonarCloud Scan - if: ${{ (github.event_name == 'pull_request' || github.ref_type == 'branch') && matrix.node == '18' && !github.event.pull_request.head.repo.fork }} + if: ${{ (github.event_name == 'pull_request' || github.ref_type == 'branch') && matrix.node == 'lts/*' && !github.event.pull_request.head.repo.fork }} uses: SonarSource/sonarcloud-github-action@master env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any @@ -69,7 +69,7 @@ jobs: - name: Set up Node uses: actions/setup-node@v3 with: - node-version: 18 + node-version: lts/* - run: npm install