Skip to content

Commit dfb418d

Browse files
tiwarishubham635twilio-dxsbansla
authored
feat!: Merge branch '5.0.0-rc' into main (#1011)
* chore: changes for json ingress * disable-cluster-test (#1003) * chore: remove autopilot reference (#1007) * chore: removing auotpilot references * chore: enables cluster tests * chore: removing preview.understand reference (#1008) * feat!: MVR preparation (#1010) * chore: updated upgrade guide --------- Co-authored-by: Twilio <[email protected]> Co-authored-by: sbansla <[email protected]>
1 parent 0a797ba commit dfb418d

File tree

37 files changed

+1195
-523
lines changed

37 files changed

+1195
-523
lines changed

UPGRADE.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22

33
_All `MAJOR` version bumps will have upgrade notes posted here._
44

5+
## [2024-03-07] 4.x.x to 5.x.x
6+
7+
---
8+
### Overview
9+
10+
#### Twilio Node Helper Library’s major version 5.0.0 is now available. We ensured that you can upgrade to Node helper Library 5.0.0 version without any breaking changes of existing apis
11+
12+
Behind the scenes Node Helper is now auto-generated via OpenAPI with this release. This enables us to rapidly add new features and enhance consistency across versions and languages.
13+
We're pleased to inform you that version 5.0.0 adds support for the application/json content type in the request body.
14+
515
## [2023-01-25] 3.x.x to 4.x.x
616

717
---

src/base/RequestClient.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,14 @@ class RequestClient {
190190
validateStatus: (status) => status >= 100 && status < 600,
191191
};
192192

193-
if (opts.data) {
194-
options.data = qs.stringify(opts.data, { arrayFormat: "repeat" });
193+
if (opts.data && options.headers) {
194+
if (
195+
options.headers["Content-Type"] === "application/x-www-form-urlencoded"
196+
) {
197+
options.data = qs.stringify(opts.data, { arrayFormat: "repeat" });
198+
} else if (options.headers["Content-Type"] === "application/json") {
199+
options.data = opts.data;
200+
}
195201
}
196202

197203
if (opts.params) {

src/rest/PreviewMessaging.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import PreviewMessagingBase from "./PreviewMessagingBase";
2+
import { MessageListInstance } from "./previewMessaging/v1/message";
3+
4+
class PreviewMessaging extends PreviewMessagingBase {
5+
/**
6+
* @deprecated - Use v1.messages; instead
7+
*/
8+
get messages(): MessageListInstance {
9+
console.warn("messages is deprecated. Use v1.messages; instead.");
10+
return this.v1.messages;
11+
}
12+
}
13+
export = PreviewMessaging;

src/rest/PreviewMessagingBase.ts

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*
2+
* This code was generated by
3+
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
4+
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
5+
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
6+
*
7+
* NOTE: This class is auto generated by OpenAPI Generator.
8+
* https://openapi-generator.tech
9+
* Do not edit the class manually.
10+
*/
11+
12+
import Domain from "../base/Domain";
13+
import V1 from "./previewMessaging/V1";
14+
15+
class PreviewMessagingBase extends Domain {
16+
_v1?: V1;
17+
18+
/**
19+
* Initialize previewMessaging domain
20+
*
21+
* @param twilio - The twilio client
22+
*/
23+
constructor(twilio: any) {
24+
super(twilio, "https://preview.messaging.twilio.com");
25+
}
26+
27+
get v1(): V1 {
28+
this._v1 = this._v1 || new V1(this);
29+
return this._v1;
30+
}
31+
}
32+
33+
export = PreviewMessagingBase;

src/rest/Twilio.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import Intelligence from "./Intelligence";
2424
import IpMessaging from "./IpMessaging";
2525
import Lookups from "./Lookups";
2626
import Media from "./Media";
27+
import PreviewMessaging from "./PreviewMessaging";
2728
import Messaging from "./Messaging";
2829
import Microvisor from "./Microvisor";
2930
import Monitor from "./Monitor";
@@ -104,6 +105,8 @@ class Twilio extends Client {
104105
_lookups?: Lookups;
105106
/** (Twilio.Media) - media domain */
106107
_media?: Media;
108+
/** (Twilio.PreviewMessaging) - previewMessaging domain */
109+
_previewMessaging?: PreviewMessaging;
107110
/** (Twilio.Messaging) - messaging domain */
108111
_messaging?: Messaging;
109112
/** (Twilio.Microvisor) - microvisor domain */
@@ -176,6 +179,7 @@ class Twilio extends Client {
176179
this.ipMessaging;
177180
this.lookups;
178181
this.media;
182+
this.previewMessaging;
179183
this.messaging;
180184
this.microvisor;
181185
this.monitor;
@@ -275,6 +279,13 @@ class Twilio extends Client {
275279
get media(): Media {
276280
return this._media ?? (this._media = new (require("./Media"))(this));
277281
}
282+
/** Getter for (Twilio.PreviewMessaging) domain */
283+
get previewMessaging(): PreviewMessaging {
284+
return (
285+
this._previewMessaging ??
286+
(this._previewMessaging = new (require("./PreviewMessaging"))(this))
287+
);
288+
}
278289
/** Getter for (Twilio.Messaging) domain */
279290
get messaging(): Messaging {
280291
return (

src/rest/api/v2010/account/authorizedConnectApp.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,8 @@ interface AuthorizedConnectAppResource {
160160
connect_app_friendly_name: string;
161161
connect_app_homepage_url: string;
162162
connect_app_sid: string;
163+
date_created: Date;
164+
date_updated: Date;
163165
permissions: Array<AuthorizedConnectAppPermission>;
164166
uri: string;
165167
}
@@ -180,6 +182,8 @@ export class AuthorizedConnectAppInstance {
180182
this.connectAppFriendlyName = payload.connect_app_friendly_name;
181183
this.connectAppHomepageUrl = payload.connect_app_homepage_url;
182184
this.connectAppSid = payload.connect_app_sid;
185+
this.dateCreated = deserialize.rfc2822DateTime(payload.date_created);
186+
this.dateUpdated = deserialize.rfc2822DateTime(payload.date_updated);
183187
this.permissions = payload.permissions;
184188
this.uri = payload.uri;
185189

@@ -213,6 +217,14 @@ export class AuthorizedConnectAppInstance {
213217
* The SID that we assigned to the Connect App.
214218
*/
215219
connectAppSid: string;
220+
/**
221+
* The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
222+
*/
223+
dateCreated: Date;
224+
/**
225+
* The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
226+
*/
227+
dateUpdated: Date;
216228
/**
217229
* The set of permissions that you authorized for the Connect App. Can be: `get-all` or `post-all`.
218230
*/
@@ -259,6 +271,8 @@ export class AuthorizedConnectAppInstance {
259271
connectAppFriendlyName: this.connectAppFriendlyName,
260272
connectAppHomepageUrl: this.connectAppHomepageUrl,
261273
connectAppSid: this.connectAppSid,
274+
dateCreated: this.dateCreated,
275+
dateUpdated: this.dateUpdated,
262276
permissions: this.permissions,
263277
uri: this.uri,
264278
};

src/rest/api/v2010/account/call.ts

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -154,16 +154,8 @@ export interface CallListInstanceEachOptions {
154154
status?: CallStatus;
155155
/** Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. */
156156
startTime?: Date;
157-
/** Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. */
158-
startTimeBefore?: Date;
159-
/** Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. */
160-
startTimeAfter?: Date;
161157
/** Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. */
162158
endTime?: Date;
163-
/** Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. */
164-
endTimeBefore?: Date;
165-
/** Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. */
166-
endTimeAfter?: Date;
167159
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
168160
pageSize?: number;
169161
/** Function to process each record. If this and a positional callback are passed, this one will be used */
@@ -188,16 +180,8 @@ export interface CallListInstanceOptions {
188180
status?: CallStatus;
189181
/** Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. */
190182
startTime?: Date;
191-
/** Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. */
192-
startTimeBefore?: Date;
193-
/** Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. */
194-
startTimeAfter?: Date;
195183
/** Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. */
196184
endTime?: Date;
197-
/** Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. */
198-
endTimeBefore?: Date;
199-
/** Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. */
200-
endTimeAfter?: Date;
201185
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
202186
pageSize?: number;
203187
/** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */
@@ -218,16 +202,8 @@ export interface CallListInstancePageOptions {
218202
status?: CallStatus;
219203
/** Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. */
220204
startTime?: Date;
221-
/** Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. */
222-
startTimeBefore?: Date;
223-
/** Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. */
224-
startTimeAfter?: Date;
225205
/** Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. */
226206
endTime?: Date;
227-
/** Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. */
228-
endTimeBefore?: Date;
229-
/** Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. */
230-
endTimeAfter?: Date;
231207
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
232208
pageSize?: number;
233209
/** Page Number, this value is simply for client state */
@@ -1134,16 +1110,8 @@ export function CallListInstance(
11341110
if (params["status"] !== undefined) data["Status"] = params["status"];
11351111
if (params["startTime"] !== undefined)
11361112
data["StartTime"] = serialize.iso8601DateTime(params["startTime"]);
1137-
if (params["startTimeBefore"] !== undefined)
1138-
data["StartTime<"] = serialize.iso8601DateTime(params["startTimeBefore"]);
1139-
if (params["startTimeAfter"] !== undefined)
1140-
data["StartTime>"] = serialize.iso8601DateTime(params["startTimeAfter"]);
11411113
if (params["endTime"] !== undefined)
11421114
data["EndTime"] = serialize.iso8601DateTime(params["endTime"]);
1143-
if (params["endTimeBefore"] !== undefined)
1144-
data["EndTime<"] = serialize.iso8601DateTime(params["endTimeBefore"]);
1145-
if (params["endTimeAfter"] !== undefined)
1146-
data["EndTime>"] = serialize.iso8601DateTime(params["endTimeAfter"]);
11471115
if (params["pageSize"] !== undefined) data["PageSize"] = params["pageSize"];
11481116

11491117
if (params.pageNumber !== undefined) data["Page"] = params.pageNumber;

0 commit comments

Comments
 (0)