Skip to content

Commit

Permalink
Merge branch 'main' into twilio-help-changes
Browse files Browse the repository at this point in the history
  • Loading branch information
tiwarishubham635 authored Nov 9, 2023
2 parents b1fe533 + a981eb0 commit 1133925
Show file tree
Hide file tree
Showing 25 changed files with 1,131 additions and 111 deletions.
42 changes: 42 additions & 0 deletions .github/ISSUE_TEMPLATE/feature-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Feature Request
description: Suggest an idea for twilio-node
title: "[Feature Request]: "
labels: "type: community enhancement"
body:
- type: checkboxes
attributes:
label: Preflight Checklist
description: Please ensure you've completed all of the following.
options:
- label: I have read the [Contributing Guidelines](https://github.com/twilio/twilio-node/blob/main/CONTRIBUTING.md) for this project.
required: true
- label: I agree to follow the [Code of Conduct](https://github.com/twilio/twilio-node/blob/main/CODE_OF_CONDUCT.md) that this project adheres to.
required: true
- label: I have searched the [issue tracker](https://github.com/twilio/twilio-node/issues) for a feature request that matches the one I want to file, without success.
required: true
- label: This is not a general Twilio feature request or bug report. It is a feature request for the twilio-node JavaScript package.
required: true
- type: textarea
attributes:
label: Problem Description
description: Please add a clear and concise description of the problem you are seeking to solve with this feature request.
validations:
required: true
- type: textarea
attributes:
label: Proposed Solution
description: Describe the solution you would like in a clear and concise manner.
validations:
required: true
- type: textarea
attributes:
label: Alternatives Considered
description: A clear and concise description of any alternative solutions or features you have considered.
validations:
required: true
- type: textarea
attributes:
label: Additional Information
description: Add any other context about the problem here.
validations:
required: false
6 changes: 3 additions & 3 deletions .github/workflows/test-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -69,7 +69,7 @@ jobs:
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: lts/*
node-version: 18

- run: npm install

Expand Down
59 changes: 59 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,65 @@
twilio-node changelog
=====================

[2023-11-06] Version 4.19.1
---------------------------
**Flex**
- Adding `provisioning_status` for Email Manager

**Intelligence**
- Add text-generation operator (for example conversation summary) results to existing OperatorResults collection.

**Messaging**
- Add DELETE support to Tollfree Verification resource

**Serverless**
- Add node18 as a valid Build runtime

**Verify**
- Update Verify TOTP maturity to GA.


[2023-10-19] Version 4.19.0
---------------------------
**Library - Chore**
- [PR #966](https://github.com/twilio/twilio-node/pull/966): upgraded semver versions. Thanks to [@sbansla](https://github.com/sbansla)!
- [PR #964](https://github.com/twilio/twilio-node/pull/964): added feature request issue template. Thanks to [@sbansla](https://github.com/sbansla)!

**Accounts**
- Updated Safelist metadata to correct the docs.
- Add Global SafeList API changes

**Api**
- Added optional parameter `CallToken` for create participant api

**Flex**
- Adding `offline_config` to Flex Configuration

**Intelligence**
- Deleted `redacted` parameter from fetching transcript in v2 **(breaking change)**

**Lookups**
- Add new `phone_number_quality_score` package to the lookup response
- Remove `disposable_phone_number_risk` package **(breaking change)**

**Messaging**
- Update US App To Person documentation with current `message_samples` requirements

**Taskrouter**
- Remove beta_feature check on task_queue_bulk_real_time_statistics endpoint
- Add `virtual_start_time` property to tasks
- Updating `task_queue_data` format from `map` to `array` in the response of bulk get endpoint of TaskQueue Real Time Statistics API **(breaking change)**


[2023-10-05] Version 4.18.1
---------------------------
**Library - Fix**
- [PR #961](https://github.com/twilio/twilio-node/pull/961): update security method validatessl. Thanks to [@AsabuHere](https://github.com/AsabuHere)!

**Lookups**
- Add test api support for Lookup v2


[2023-09-21] Version 4.18.0
---------------------------
**Conversations**
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "twilio",
"description": "A Twilio helper library",
"version": "4.18.0",
"version": "4.19.1",
"author": "API Team <[email protected]>",
"contributors": [
{
Expand All @@ -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",
Expand All @@ -30,23 +30,23 @@
"xmlbuilder": "^13.0.2"
},
"devDependencies": {
"@babel/preset-env": "^7.20.2",
"@babel/preset-env": "^7.23.0",
"@babel/preset-typescript": "^7.18.6",
"@types/jest": "^29.2.5",
"@types/jest": "^29.5.5",
"@types/jsonwebtoken": "^9.0.0",
"@types/node": "^18.11.18",
"@types/qs": "^6.9.7",
"@types/url-parse": "^1.4.8",
"babel-plugin-replace-ts-export-assignment": "^0.0.2",
"eslint": "^8.31.0",
"express": "^4.17.1",
"jest": "^29.3.1",
"jest": "^29.5.5",
"jshint": "^2.11.0",
"mock-fs": "^5.2.0",
"nock": "^13.2.9",
"node-mocks-http": "^1.8.1",
"prettier": "^2.7.1",
"ts-jest": "^29.0.5",
"ts-jest": "^29.1.1",
"typescript": "^4.7.2",
"typedoc": "^0.23.21"
},
Expand Down
2 changes: 1 addition & 1 deletion src/base/RequestClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<AxiosResponse>) => void) => {
setTimeout(() => resolve(axios(config)), delay);
});
}
Expand Down
9 changes: 9 additions & 0 deletions src/rest/accounts/V1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import AccountsBase from "../AccountsBase";
import Version from "../../base/Version";
import { AuthTokenPromotionListInstance } from "./v1/authTokenPromotion";
import { CredentialListInstance } from "./v1/credential";
import { SafelistListInstance } from "./v1/safelist";
import { SecondaryAuthTokenListInstance } from "./v1/secondaryAuthToken";

export default class V1 extends Version {
Expand All @@ -32,6 +33,8 @@ export default class V1 extends Version {
protected _authTokenPromotion?: AuthTokenPromotionListInstance;
/** credentials - { Twilio.Accounts.V1.CredentialListInstance } resource */
protected _credentials?: CredentialListInstance;
/** safelist - { Twilio.Accounts.V1.SafelistListInstance } resource */
protected _safelist?: SafelistListInstance;
/** secondaryAuthToken - { Twilio.Accounts.V1.SecondaryAuthTokenListInstance } resource */
protected _secondaryAuthToken?: SecondaryAuthTokenListInstance;

Expand All @@ -48,6 +51,12 @@ export default class V1 extends Version {
return this._credentials;
}

/** Getter for safelist resource */
get safelist(): SafelistListInstance {
this._safelist = this._safelist || SafelistListInstance(this);
return this._safelist;
}

/** Getter for secondaryAuthToken resource */
get secondaryAuthToken(): SecondaryAuthTokenListInstance {
this._secondaryAuthToken =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
*
* Twilio - Api
* Twilio - Accounts
* This is the public Twilio REST API.
*
* NOTE: This class is auto generated by OpenAPI Generator.
Expand All @@ -13,7 +13,7 @@
*/

import { inspect, InspectOptions } from "util";
import V2010 from "../V2010";
import V1 from "../V1";
const deserialize = require("../../../base/deserialize");
const serialize = require("../../../base/serialize");
import { isValidPathParam } from "../../../base/utility";
Expand Down Expand Up @@ -45,7 +45,7 @@ export interface SafelistListInstanceFetchOptions {
export interface SafelistSolution {}

export interface SafelistListInstance {
_version: V2010;
_version: V1;
_solution: SafelistSolution;
_uri: string;

Expand Down Expand Up @@ -115,12 +115,12 @@ export interface SafelistListInstance {
[inspect.custom](_depth: any, options: InspectOptions): any;
}

export function SafelistListInstance(version: V2010): SafelistListInstance {
export function SafelistListInstance(version: V1): SafelistListInstance {
const instance = {} as SafelistListInstance;

instance._version = version;
instance._solution = {};
instance._uri = `/SafeList/Numbers.json`;
instance._uri = `/SafeList/Numbers`;

instance.create = function create(
params: SafelistListInstanceCreateOptions,
Expand Down Expand Up @@ -256,7 +256,7 @@ interface SafelistResource {
}

export class SafelistInstance {
constructor(protected _version: V2010, payload: SafelistResource) {
constructor(protected _version: V1, payload: SafelistResource) {
this.sid = payload.sid;
this.phoneNumber = payload.phone_number;
}
Expand Down
9 changes: 0 additions & 9 deletions src/rest/api/V2010.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import ApiBase from "../ApiBase";
import Version from "../../base/Version";
import { AccountListInstance } from "./v2010/account";
import { SafelistListInstance } from "./v2010/safelist";
import { AccountContext } from "./v2010/account";

export default class V2010 extends Version {
Expand All @@ -30,8 +29,6 @@ export default class V2010 extends Version {

/** accounts - { Twilio.Api.V2010.AccountListInstance } resource */
protected _accounts?: AccountListInstance;
/** safelist - { Twilio.Api.V2010.SafelistListInstance } resource */
protected _safelist?: SafelistListInstance;
/** account - { Twilio.Api.V2010.AccountContext } resource */
protected _account?: AccountContext;

Expand All @@ -41,12 +38,6 @@ export default class V2010 extends Version {
return this._accounts;
}

/** Getter for safelist resource */
get safelist(): SafelistListInstance {
this._safelist = this._safelist || SafelistListInstance(this);
return this._safelist;
}

/** Getter for account resource */
get account(): AccountContext {
this._account =
Expand Down
4 changes: 4 additions & 0 deletions src/rest/api/v2010/account/conference/participant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@ export interface ParticipantListInstanceCreateOptions {
amdStatusCallbackMethod?: string;
/** Whether to trim any leading and trailing silence from the participant recording. Can be: `trim-silence` or `do-not-trim` and the default is `trim-silence`. */
trim?: string;
/** A token string needed to invoke a forwarded call. A call_token is generated when an incoming call is received on a Twilio number. Pass an incoming call\\\'s call_token value to a forwarded call via the call_token parameter when creating a new call. A forwarded call should bear the same CallerID of the original incoming call. */
callToken?: string;
}
/**
* Options to pass to each
Expand Down Expand Up @@ -887,6 +889,8 @@ export function ParticipantListInstance(
if (params["amdStatusCallbackMethod"] !== undefined)
data["AmdStatusCallbackMethod"] = params["amdStatusCallbackMethod"];
if (params["trim"] !== undefined) data["Trim"] = params["trim"];
if (params["callToken"] !== undefined)
data["CallToken"] = params["callToken"];

const headers: any = {};
headers["Content-Type"] = "application/x-www-form-urlencoded";
Expand Down
10 changes: 0 additions & 10 deletions src/rest/api/v2010/account/message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,6 @@ export interface MessageListInstanceCreateOptions {
sendAsMms?: boolean;
/** For [Content Editor/API](https://www.twilio.com/docs/content) only: Key-value pairs of [Template variables](https://www.twilio.com/docs/content/using-variables-with-content-api) and their substitution values. `content_sid` parameter must also be provided. If values are not defined in the `content_variables` parameter, the [Template\\\'s default placeholder values](https://www.twilio.com/docs/content/content-api-resources#create-templates) are used. */
contentVariables?: string;
/** 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;
/** */
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. */
Expand Down Expand Up @@ -415,7 +413,6 @@ interface MessageResource {
price_unit: string;
api_version: string;
subresource_uris: Record<string, string>;
tags: any;
}

export class MessageInstance {
Expand Down Expand Up @@ -448,7 +445,6 @@ export class MessageInstance {
this.priceUnit = payload.price_unit;
this.apiVersion = payload.api_version;
this.subresourceUris = payload.subresource_uris;
this.tags = payload.tags;

this._solution = { accountSid, sid: sid || this.sid };
}
Expand Down Expand Up @@ -527,10 +523,6 @@ export class MessageInstance {
* A list of related resources identified by their URIs relative to `https://api.twilio.com`
*/
subresourceUris: Record<string, string>;
/**
* A string containing a JSON map of key value pairs of tags to be recorded as metadata for the message.
*/
tags: any;

private get _proxy(): MessageContext {
this._context =
Expand Down Expand Up @@ -640,7 +632,6 @@ export class MessageInstance {
priceUnit: this.priceUnit,
apiVersion: this.apiVersion,
subresourceUris: this.subresourceUris,
tags: this.tags,
};
}

Expand Down Expand Up @@ -816,7 +807,6 @@ export function MessageListInstance(
data["SendAsMms"] = serialize.bool(params["sendAsMms"]);
if (params["contentVariables"] !== undefined)
data["ContentVariables"] = params["contentVariables"];
if (params["tags"] !== undefined) data["Tags"] = params["tags"];
if (params["riskCheck"] !== undefined)
data["RiskCheck"] = params["riskCheck"];
if (params["from"] !== undefined) data["From"] = params["from"];
Expand Down
Loading

0 comments on commit 1133925

Please sign in to comment.