twilio 5.0.2 → 5.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -39,6 +39,8 @@ function WebChannelsListInstance(version) {
39
39
  data["PreEngagementData"] = params["preEngagementData"];
40
40
  const headers = {};
41
41
  headers["Content-Type"] = "application/x-www-form-urlencoded";
42
+ if (params["uiVersion"] !== undefined)
43
+ headers["Ui-Version"] = params["uiVersion"];
42
44
  let operationVersion = version, operationPromise = operationVersion.create({
43
45
  uri: instance._uri,
44
46
  method: "post",
@@ -6,7 +6,7 @@ export type PhoneNumberValidationError = "TOO_SHORT" | "TOO_LONG" | "INVALID_BUT
6
6
  * Options to pass to fetch a PhoneNumberInstance
7
7
  */
8
8
  export interface PhoneNumberContextFetchOptions {
9
- /** A comma-separated list of fields to return. Possible values are validation, caller_name, sim_swap, call_forwarding, line_status, line_type_intelligence, identity_match, reassigned_number, sms_pumping_risk, phone_number_quality_score. */
9
+ /** A comma-separated list of fields to return. Possible values are validation, caller_name, sim_swap, call_forwarding, line_status, line_type_intelligence, identity_match, reassigned_number, sms_pumping_risk, phone_number_quality_score, pre_fill. */
10
10
  fields?: string;
11
11
  /** The [country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) used if the phone number provided is in national format. */
12
12
  countryCode?: string;
@@ -32,6 +32,8 @@ export interface PhoneNumberContextFetchOptions {
32
32
  dateOfBirth?: string;
33
33
  /** The date you obtained consent to call or text the end-user of the phone number or a date on which you are reasonably certain that the end-user could still be reached at that number. This query parameter is only used (optionally) for reassigned_number package requests. */
34
34
  lastVerifiedDate?: string;
35
+ /** The unique identifier associated with a verification process through verify API. This query parameter is only used (optionally) for pre_fill package requests. */
36
+ verificationSid?: string;
35
37
  }
36
38
  export interface PhoneNumberContext {
37
39
  /**
@@ -90,6 +92,7 @@ interface PhoneNumberResource {
90
92
  reassigned_number: any;
91
93
  sms_pumping_risk: any;
92
94
  phone_number_quality_score: any;
95
+ pre_fill: any;
93
96
  url: string;
94
97
  }
95
98
  export declare class PhoneNumberInstance {
@@ -157,6 +160,10 @@ export declare class PhoneNumberInstance {
157
160
  * An object that contains information of a mobile phone number quality score. Quality score will return a risk score about the phone number.
158
161
  */
159
162
  phoneNumberQualityScore: any;
163
+ /**
164
+ * An object that contains pre fill information. pre_fill will return PII information associated with the phone number like first name, last name, address line, country code, state and postal code.
165
+ */
166
+ preFill: any;
160
167
  /**
161
168
  * The absolute URL of the resource.
162
169
  */
@@ -200,6 +207,7 @@ export declare class PhoneNumberInstance {
200
207
  reassignedNumber: any;
201
208
  smsPumpingRisk: any;
202
209
  phoneNumberQualityScore: any;
210
+ preFill: any;
203
211
  url: string;
204
212
  };
205
213
  [inspect.custom](_depth: any, options: InspectOptions): string;
@@ -62,6 +62,8 @@ class PhoneNumberContextImpl {
62
62
  data["DateOfBirth"] = params["dateOfBirth"];
63
63
  if (params["lastVerifiedDate"] !== undefined)
64
64
  data["LastVerifiedDate"] = params["lastVerifiedDate"];
65
+ if (params["verificationSid"] !== undefined)
66
+ data["VerificationSid"] = params["verificationSid"];
65
67
  const headers = {};
66
68
  const instance = this;
67
69
  let operationVersion = instance._version, operationPromise = operationVersion.fetch({
@@ -105,6 +107,7 @@ class PhoneNumberInstance {
105
107
  this.reassignedNumber = payload.reassigned_number;
106
108
  this.smsPumpingRisk = payload.sms_pumping_risk;
107
109
  this.phoneNumberQualityScore = payload.phone_number_quality_score;
110
+ this.preFill = payload.pre_fill;
108
111
  this.url = payload.url;
109
112
  this._solution = { phoneNumber: phoneNumber || this.phoneNumber };
110
113
  }
@@ -139,6 +142,7 @@ class PhoneNumberInstance {
139
142
  reassignedNumber: this.reassignedNumber,
140
143
  smsPumpingRisk: this.smsPumpingRisk,
141
144
  phoneNumberQualityScore: this.phoneNumberQualityScore,
145
+ preFill: this.preFill,
142
146
  url: this.url,
143
147
  };
144
148
  }
@@ -221,6 +221,7 @@ interface ServiceResource {
221
221
  usecase: string;
222
222
  us_app_to_person_registered: boolean;
223
223
  use_inbound_webhook_on_number: boolean;
224
+ sending_windows: any;
224
225
  }
225
226
  export declare class ServiceInstance {
226
227
  protected _version: V1;
@@ -316,6 +317,10 @@ export declare class ServiceInstance {
316
317
  * A boolean value that indicates either the webhook url configured on the phone number will be used or `inbound_request_url`/`fallback_url` url will be called when a message is received from the phone number. If this field is enabled then the webhook url defined on the phone number will override the `inbound_request_url`/`fallback_url` defined for the Messaging Service.
317
318
  */
318
319
  useInboundWebhookOnNumber: boolean;
320
+ /**
321
+ * A list of Sending Windows, which indicate defined time ranges in which a message can be sent, in the UTC time zone. Each window is defined by two strings, labeled \"start_time\" and \"end_time\".
322
+ */
323
+ sendingWindows: any;
319
324
  private get _proxy();
320
325
  /**
321
326
  * Remove a ServiceInstance
@@ -403,6 +408,7 @@ export declare class ServiceInstance {
403
408
  usecase: string;
404
409
  usAppToPersonRegistered: boolean;
405
410
  useInboundWebhookOnNumber: boolean;
411
+ sendingWindows: any;
406
412
  };
407
413
  [inspect.custom](_depth: any, options: InspectOptions): string;
408
414
  }
@@ -185,6 +185,7 @@ class ServiceInstance {
185
185
  this.usecase = payload.usecase;
186
186
  this.usAppToPersonRegistered = payload.us_app_to_person_registered;
187
187
  this.useInboundWebhookOnNumber = payload.use_inbound_webhook_on_number;
188
+ this.sendingWindows = payload.sending_windows;
188
189
  this._solution = { sid: sid || this.sid };
189
190
  }
190
191
  get _proxy() {
@@ -282,6 +283,7 @@ class ServiceInstance {
282
283
  usecase: this.usecase,
283
284
  usAppToPersonRegistered: this.usAppToPersonRegistered,
284
285
  useInboundWebhookOnNumber: this.useInboundWebhookOnNumber,
286
+ sendingWindows: this.sendingWindows,
285
287
  };
286
288
  }
287
289
  [util_1.inspect.custom](_depth, options) {
@@ -5,6 +5,7 @@ import { EligibilityListInstance } from "./v1/eligibility";
5
5
  import { PortingBulkPortabilityListInstance } from "./v1/portingBulkPortability";
6
6
  import { PortingPortInListInstance } from "./v1/portingPortIn";
7
7
  import { PortingPortInFetchListInstance } from "./v1/portingPortInFetch";
8
+ import { PortingPortInPhoneNumberListInstance } from "./v1/portingPortInPhoneNumber";
8
9
  import { PortingPortabilityListInstance } from "./v1/portingPortability";
9
10
  export default class V1 extends Version {
10
11
  /**
@@ -23,6 +24,8 @@ export default class V1 extends Version {
23
24
  protected _portingPortIns?: PortingPortInListInstance;
24
25
  /** portingPortInsFetch - { Twilio.Numbers.V1.PortingPortInFetchListInstance } resource */
25
26
  protected _portingPortInsFetch?: PortingPortInFetchListInstance;
27
+ /** portingPortInPhoneNumber - { Twilio.Numbers.V1.PortingPortInPhoneNumberListInstance } resource */
28
+ protected _portingPortInPhoneNumber?: PortingPortInPhoneNumberListInstance;
26
29
  /** portingPortabilities - { Twilio.Numbers.V1.PortingPortabilityListInstance } resource */
27
30
  protected _portingPortabilities?: PortingPortabilityListInstance;
28
31
  /** Getter for bulkEligibilities resource */
@@ -35,6 +38,8 @@ export default class V1 extends Version {
35
38
  get portingPortIns(): PortingPortInListInstance;
36
39
  /** Getter for portingPortInsFetch resource */
37
40
  get portingPortInsFetch(): PortingPortInFetchListInstance;
41
+ /** Getter for portingPortInPhoneNumber resource */
42
+ get portingPortInPhoneNumber(): PortingPortInPhoneNumberListInstance;
38
43
  /** Getter for portingPortabilities resource */
39
44
  get portingPortabilities(): PortingPortabilityListInstance;
40
45
  }
@@ -22,6 +22,7 @@ const eligibility_1 = require("./v1/eligibility");
22
22
  const portingBulkPortability_1 = require("./v1/portingBulkPortability");
23
23
  const portingPortIn_1 = require("./v1/portingPortIn");
24
24
  const portingPortInFetch_1 = require("./v1/portingPortInFetch");
25
+ const portingPortInPhoneNumber_1 = require("./v1/portingPortInPhoneNumber");
25
26
  const portingPortability_1 = require("./v1/portingPortability");
26
27
  class V1 extends Version_1.default {
27
28
  /**
@@ -62,6 +63,13 @@ class V1 extends Version_1.default {
62
63
  this._portingPortInsFetch || (0, portingPortInFetch_1.PortingPortInFetchListInstance)(this);
63
64
  return this._portingPortInsFetch;
64
65
  }
66
+ /** Getter for portingPortInPhoneNumber resource */
67
+ get portingPortInPhoneNumber() {
68
+ this._portingPortInPhoneNumber =
69
+ this._portingPortInPhoneNumber ||
70
+ (0, portingPortInPhoneNumber_1.PortingPortInPhoneNumberListInstance)(this);
71
+ return this._portingPortInPhoneNumber;
72
+ }
65
73
  /** Getter for portingPortabilities resource */
66
74
  get portingPortabilities() {
67
75
  this._portingPortabilities =
@@ -8,48 +8,61 @@ export interface PortingPortInListInstanceCreateOptions {
8
8
  /** */
9
9
  body?: object;
10
10
  }
11
- export interface PortingPortInSolution {
12
- }
13
- export interface PortingPortInListInstance {
14
- _version: V1;
15
- _solution: PortingPortInSolution;
16
- _uri: string;
17
- /**
18
- * Create a PortingPortInInstance
19
- *
20
- * @param callback - Callback to handle processed record
21
- *
22
- * @returns Resolves to processed PortingPortInInstance
23
- */
24
- create(callback?: (error: Error | null, item?: PortingPortInInstance) => any): Promise<PortingPortInInstance>;
11
+ export interface PortingPortInContext {
25
12
  /**
26
- * Create a PortingPortInInstance
13
+ * Remove a PortingPortInInstance
27
14
  *
28
- * @param params - Body for request
29
15
  * @param callback - Callback to handle processed record
30
16
  *
31
- * @returns Resolves to processed PortingPortInInstance
17
+ * @returns Resolves to processed boolean
32
18
  */
33
- create(params: object, callback?: (error: Error | null, item?: PortingPortInInstance) => any): Promise<PortingPortInInstance>;
19
+ remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
34
20
  /**
35
21
  * Provide a user-friendly representation
36
22
  */
37
23
  toJSON(): any;
38
24
  [inspect.custom](_depth: any, options: InspectOptions): any;
39
25
  }
40
- export declare function PortingPortInListInstance(version: V1): PortingPortInListInstance;
26
+ export interface PortingPortInContextSolution {
27
+ portInRequestSid: string;
28
+ }
29
+ export declare class PortingPortInContextImpl implements PortingPortInContext {
30
+ protected _version: V1;
31
+ protected _solution: PortingPortInContextSolution;
32
+ protected _uri: string;
33
+ constructor(_version: V1, portInRequestSid: string);
34
+ remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
35
+ /**
36
+ * Provide a user-friendly representation
37
+ *
38
+ * @returns Object
39
+ */
40
+ toJSON(): PortingPortInContextSolution;
41
+ [inspect.custom](_depth: any, options: InspectOptions): string;
42
+ }
41
43
  interface PortingPortInResource {
42
44
  port_in_request_sid: string;
43
45
  url: string;
44
46
  }
45
47
  export declare class PortingPortInInstance {
46
48
  protected _version: V1;
47
- constructor(_version: V1, payload: PortingPortInResource);
49
+ protected _solution: PortingPortInContextSolution;
50
+ protected _context?: PortingPortInContext;
51
+ constructor(_version: V1, payload: PortingPortInResource, portInRequestSid?: string);
48
52
  /**
49
53
  * The SID of the Port In request. This is a unique identifier of the port in request.
50
54
  */
51
55
  portInRequestSid: string;
52
56
  url: string;
57
+ private get _proxy();
58
+ /**
59
+ * Remove a PortingPortInInstance
60
+ *
61
+ * @param callback - Callback to handle processed record
62
+ *
63
+ * @returns Resolves to processed boolean
64
+ */
65
+ remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
53
66
  /**
54
67
  * Provide a user-friendly representation
55
68
  *
@@ -61,4 +74,36 @@ export declare class PortingPortInInstance {
61
74
  };
62
75
  [inspect.custom](_depth: any, options: InspectOptions): string;
63
76
  }
77
+ export interface PortingPortInSolution {
78
+ }
79
+ export interface PortingPortInListInstance {
80
+ _version: V1;
81
+ _solution: PortingPortInSolution;
82
+ _uri: string;
83
+ (portInRequestSid: string): PortingPortInContext;
84
+ get(portInRequestSid: string): PortingPortInContext;
85
+ /**
86
+ * Create a PortingPortInInstance
87
+ *
88
+ * @param callback - Callback to handle processed record
89
+ *
90
+ * @returns Resolves to processed PortingPortInInstance
91
+ */
92
+ create(callback?: (error: Error | null, item?: PortingPortInInstance) => any): Promise<PortingPortInInstance>;
93
+ /**
94
+ * Create a PortingPortInInstance
95
+ *
96
+ * @param params - Body for request
97
+ * @param callback - Callback to handle processed record
98
+ *
99
+ * @returns Resolves to processed PortingPortInInstance
100
+ */
101
+ create(params: object, callback?: (error: Error | null, item?: PortingPortInInstance) => any): Promise<PortingPortInInstance>;
102
+ /**
103
+ * Provide a user-friendly representation
104
+ */
105
+ toJSON(): any;
106
+ [inspect.custom](_depth: any, options: InspectOptions): any;
107
+ }
108
+ export declare function PortingPortInListInstance(version: V1): PortingPortInListInstance;
64
109
  export {};
@@ -13,12 +13,88 @@
13
13
  * Do not edit the class manually.
14
14
  */
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.PortingPortInInstance = exports.PortingPortInListInstance = void 0;
16
+ exports.PortingPortInListInstance = exports.PortingPortInInstance = exports.PortingPortInContextImpl = void 0;
17
17
  const util_1 = require("util");
18
18
  const deserialize = require("../../../base/deserialize");
19
19
  const serialize = require("../../../base/serialize");
20
+ const utility_1 = require("../../../base/utility");
21
+ class PortingPortInContextImpl {
22
+ constructor(_version, portInRequestSid) {
23
+ this._version = _version;
24
+ if (!(0, utility_1.isValidPathParam)(portInRequestSid)) {
25
+ throw new Error("Parameter 'portInRequestSid' is not valid.");
26
+ }
27
+ this._solution = { portInRequestSid };
28
+ this._uri = `/Porting/PortIn/${portInRequestSid}`;
29
+ }
30
+ remove(callback) {
31
+ const instance = this;
32
+ let operationVersion = instance._version, operationPromise = operationVersion.remove({
33
+ uri: instance._uri,
34
+ method: "delete",
35
+ });
36
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
37
+ return operationPromise;
38
+ }
39
+ /**
40
+ * Provide a user-friendly representation
41
+ *
42
+ * @returns Object
43
+ */
44
+ toJSON() {
45
+ return this._solution;
46
+ }
47
+ [util_1.inspect.custom](_depth, options) {
48
+ return (0, util_1.inspect)(this.toJSON(), options);
49
+ }
50
+ }
51
+ exports.PortingPortInContextImpl = PortingPortInContextImpl;
52
+ class PortingPortInInstance {
53
+ constructor(_version, payload, portInRequestSid) {
54
+ this._version = _version;
55
+ this.portInRequestSid = payload.port_in_request_sid;
56
+ this.url = payload.url;
57
+ this._solution = {
58
+ portInRequestSid: portInRequestSid || this.portInRequestSid,
59
+ };
60
+ }
61
+ get _proxy() {
62
+ this._context =
63
+ this._context ||
64
+ new PortingPortInContextImpl(this._version, this._solution.portInRequestSid);
65
+ return this._context;
66
+ }
67
+ /**
68
+ * Remove a PortingPortInInstance
69
+ *
70
+ * @param callback - Callback to handle processed record
71
+ *
72
+ * @returns Resolves to processed boolean
73
+ */
74
+ remove(callback) {
75
+ return this._proxy.remove(callback);
76
+ }
77
+ /**
78
+ * Provide a user-friendly representation
79
+ *
80
+ * @returns Object
81
+ */
82
+ toJSON() {
83
+ return {
84
+ portInRequestSid: this.portInRequestSid,
85
+ url: this.url,
86
+ };
87
+ }
88
+ [util_1.inspect.custom](_depth, options) {
89
+ return (0, util_1.inspect)(this.toJSON(), options);
90
+ }
91
+ }
92
+ exports.PortingPortInInstance = PortingPortInInstance;
20
93
  function PortingPortInListInstance(version) {
21
- const instance = {};
94
+ const instance = ((portInRequestSid) => instance.get(portInRequestSid));
95
+ instance.get = function get(portInRequestSid) {
96
+ return new PortingPortInContextImpl(version, portInRequestSid);
97
+ };
22
98
  instance._version = version;
23
99
  instance._solution = {};
24
100
  instance._uri = `/Porting/PortIn`;
@@ -53,25 +129,3 @@ function PortingPortInListInstance(version) {
53
129
  return instance;
54
130
  }
55
131
  exports.PortingPortInListInstance = PortingPortInListInstance;
56
- class PortingPortInInstance {
57
- constructor(_version, payload) {
58
- this._version = _version;
59
- this.portInRequestSid = payload.port_in_request_sid;
60
- this.url = payload.url;
61
- }
62
- /**
63
- * Provide a user-friendly representation
64
- *
65
- * @returns Object
66
- */
67
- toJSON() {
68
- return {
69
- portInRequestSid: this.portInRequestSid,
70
- url: this.url,
71
- };
72
- }
73
- [util_1.inspect.custom](_depth, options) {
74
- return (0, util_1.inspect)(this.toJSON(), options);
75
- }
76
- }
77
- exports.PortingPortInInstance = PortingPortInInstance;
@@ -0,0 +1,51 @@
1
+ /// <reference types="node" />
2
+ import { inspect, InspectOptions } from "util";
3
+ import V1 from "../V1";
4
+ export interface PortingPortInPhoneNumberContext {
5
+ /**
6
+ * Remove a PortingPortInPhoneNumberInstance
7
+ *
8
+ * @param callback - Callback to handle processed record
9
+ *
10
+ * @returns Resolves to processed boolean
11
+ */
12
+ remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
13
+ /**
14
+ * Provide a user-friendly representation
15
+ */
16
+ toJSON(): any;
17
+ [inspect.custom](_depth: any, options: InspectOptions): any;
18
+ }
19
+ export interface PortingPortInPhoneNumberContextSolution {
20
+ portInRequestSid: string;
21
+ phoneNumberSid: string;
22
+ }
23
+ export declare class PortingPortInPhoneNumberContextImpl implements PortingPortInPhoneNumberContext {
24
+ protected _version: V1;
25
+ protected _solution: PortingPortInPhoneNumberContextSolution;
26
+ protected _uri: string;
27
+ constructor(_version: V1, portInRequestSid: string, phoneNumberSid: string);
28
+ remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
29
+ /**
30
+ * Provide a user-friendly representation
31
+ *
32
+ * @returns Object
33
+ */
34
+ toJSON(): PortingPortInPhoneNumberContextSolution;
35
+ [inspect.custom](_depth: any, options: InspectOptions): string;
36
+ }
37
+ export interface PortingPortInPhoneNumberSolution {
38
+ }
39
+ export interface PortingPortInPhoneNumberListInstance {
40
+ _version: V1;
41
+ _solution: PortingPortInPhoneNumberSolution;
42
+ _uri: string;
43
+ (portInRequestSid: string, phoneNumberSid: string): PortingPortInPhoneNumberContext;
44
+ get(portInRequestSid: string, phoneNumberSid: string): PortingPortInPhoneNumberContext;
45
+ /**
46
+ * Provide a user-friendly representation
47
+ */
48
+ toJSON(): any;
49
+ [inspect.custom](_depth: any, options: InspectOptions): any;
50
+ }
51
+ export declare function PortingPortInPhoneNumberListInstance(version: V1): PortingPortInPhoneNumberListInstance;
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+ /*
3
+ * This code was generated by
4
+ * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
5
+ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
6
+ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
7
+ *
8
+ * Twilio - Numbers
9
+ * This is the public Twilio REST API.
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator.
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.PortingPortInPhoneNumberListInstance = exports.PortingPortInPhoneNumberContextImpl = void 0;
17
+ const util_1 = require("util");
18
+ const deserialize = require("../../../base/deserialize");
19
+ const serialize = require("../../../base/serialize");
20
+ const utility_1 = require("../../../base/utility");
21
+ class PortingPortInPhoneNumberContextImpl {
22
+ constructor(_version, portInRequestSid, phoneNumberSid) {
23
+ this._version = _version;
24
+ if (!(0, utility_1.isValidPathParam)(portInRequestSid)) {
25
+ throw new Error("Parameter 'portInRequestSid' is not valid.");
26
+ }
27
+ if (!(0, utility_1.isValidPathParam)(phoneNumberSid)) {
28
+ throw new Error("Parameter 'phoneNumberSid' is not valid.");
29
+ }
30
+ this._solution = { portInRequestSid, phoneNumberSid };
31
+ this._uri = `/Porting/PortIn/${portInRequestSid}/PhoneNumber/${phoneNumberSid}`;
32
+ }
33
+ remove(callback) {
34
+ const instance = this;
35
+ let operationVersion = instance._version, operationPromise = operationVersion.remove({
36
+ uri: instance._uri,
37
+ method: "delete",
38
+ });
39
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
40
+ return operationPromise;
41
+ }
42
+ /**
43
+ * Provide a user-friendly representation
44
+ *
45
+ * @returns Object
46
+ */
47
+ toJSON() {
48
+ return this._solution;
49
+ }
50
+ [util_1.inspect.custom](_depth, options) {
51
+ return (0, util_1.inspect)(this.toJSON(), options);
52
+ }
53
+ }
54
+ exports.PortingPortInPhoneNumberContextImpl = PortingPortInPhoneNumberContextImpl;
55
+ function PortingPortInPhoneNumberListInstance(version) {
56
+ const instance = ((portInRequestSid, phoneNumberSid) => instance.get(portInRequestSid, phoneNumberSid));
57
+ instance.get = function get(portInRequestSid, phoneNumberSid) {
58
+ return new PortingPortInPhoneNumberContextImpl(version, portInRequestSid, phoneNumberSid);
59
+ };
60
+ instance._version = version;
61
+ instance._solution = {};
62
+ instance._uri = ``;
63
+ instance.toJSON = function toJSON() {
64
+ return instance._solution;
65
+ };
66
+ instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
67
+ return (0, util_1.inspect)(instance.toJSON(), options);
68
+ };
69
+ return instance;
70
+ }
71
+ exports.PortingPortInPhoneNumberListInstance = PortingPortInPhoneNumberListInstance;
@@ -48,6 +48,10 @@ export interface ServiceContextUpdateOptions {
48
48
  "totp.skew"?: number;
49
49
  /** 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. */
50
50
  defaultTemplateSid?: string;
51
+ /** The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/services) to associate with the Verification Service. */
52
+ "whatsapp.msgServiceSid"?: string;
53
+ /** The WhatsApp number to use as the sender of the verification messages. This number must be associated with the WhatsApp Message Service. */
54
+ "whatsapp.from"?: string;
51
55
  /** Whether to allow verifications from the service to reach the stream-events sinks if configured */
52
56
  verifyEventSubscriptionEnabled?: boolean;
53
57
  }
@@ -89,6 +93,10 @@ export interface ServiceListInstanceCreateOptions {
89
93
  "totp.skew"?: number;
90
94
  /** 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. */
91
95
  defaultTemplateSid?: string;
96
+ /** The SID of the Messaging Service containing WhatsApp Sender(s) that Verify will use to send WhatsApp messages to your users. */
97
+ "whatsapp.msgServiceSid"?: string;
98
+ /** The number to use as the WhatsApp Sender that Verify will use to send WhatsApp messages to your users.This WhatsApp Sender must be associated with a Messaging Service SID. */
99
+ "whatsapp.from"?: string;
92
100
  /** Whether to allow verifications from the service to reach the stream-events sinks if configured */
93
101
  verifyEventSubscriptionEnabled?: boolean;
94
102
  }
@@ -223,6 +231,7 @@ interface ServiceResource {
223
231
  push: any;
224
232
  totp: any;
225
233
  default_template_sid: string;
234
+ whatsapp: any;
226
235
  verify_event_subscription_enabled: boolean;
227
236
  date_created: Date;
228
237
  date_updated: Date;
@@ -287,6 +296,7 @@ export declare class ServiceInstance {
287
296
  */
288
297
  totp: any;
289
298
  defaultTemplateSid: string;
299
+ whatsapp: any;
290
300
  /**
291
301
  * Whether to allow verifications from the service to reach the stream-events sinks if configured
292
302
  */
@@ -389,6 +399,7 @@ export declare class ServiceInstance {
389
399
  push: any;
390
400
  totp: any;
391
401
  defaultTemplateSid: string;
402
+ whatsapp: any;
392
403
  verifyEventSubscriptionEnabled: boolean;
393
404
  dateCreated: Date;
394
405
  dateUpdated: Date;
@@ -140,6 +140,10 @@ class ServiceContextImpl {
140
140
  data["Totp.Skew"] = params["totp.skew"];
141
141
  if (params["defaultTemplateSid"] !== undefined)
142
142
  data["DefaultTemplateSid"] = params["defaultTemplateSid"];
143
+ if (params["whatsapp.msgServiceSid"] !== undefined)
144
+ data["Whatsapp.MsgServiceSid"] = params["whatsapp.msgServiceSid"];
145
+ if (params["whatsapp.from"] !== undefined)
146
+ data["Whatsapp.From"] = params["whatsapp.from"];
143
147
  if (params["verifyEventSubscriptionEnabled"] !== undefined)
144
148
  data["VerifyEventSubscriptionEnabled"] = serialize.bool(params["verifyEventSubscriptionEnabled"]);
145
149
  const headers = {};
@@ -185,6 +189,7 @@ class ServiceInstance {
185
189
  this.push = payload.push;
186
190
  this.totp = payload.totp;
187
191
  this.defaultTemplateSid = payload.default_template_sid;
192
+ this.whatsapp = payload.whatsapp;
188
193
  this.verifyEventSubscriptionEnabled =
189
194
  payload.verify_event_subscription_enabled;
190
195
  this.dateCreated = deserialize.iso8601DateTime(payload.date_created);
@@ -285,6 +290,7 @@ class ServiceInstance {
285
290
  push: this.push,
286
291
  totp: this.totp,
287
292
  defaultTemplateSid: this.defaultTemplateSid,
293
+ whatsapp: this.whatsapp,
288
294
  verifyEventSubscriptionEnabled: this.verifyEventSubscriptionEnabled,
289
295
  dateCreated: this.dateCreated,
290
296
  dateUpdated: this.dateUpdated,
@@ -347,6 +353,10 @@ function ServiceListInstance(version) {
347
353
  data["Totp.Skew"] = params["totp.skew"];
348
354
  if (params["defaultTemplateSid"] !== undefined)
349
355
  data["DefaultTemplateSid"] = params["defaultTemplateSid"];
356
+ if (params["whatsapp.msgServiceSid"] !== undefined)
357
+ data["Whatsapp.MsgServiceSid"] = params["whatsapp.msgServiceSid"];
358
+ if (params["whatsapp.from"] !== undefined)
359
+ data["Whatsapp.From"] = params["whatsapp.from"];
350
360
  if (params["verifyEventSubscriptionEnabled"] !== undefined)
351
361
  data["VerifyEventSubscriptionEnabled"] = serialize.bool(params["verifyEventSubscriptionEnabled"]);
352
362
  const headers = {};
@@ -192,7 +192,7 @@ declare namespace VoiceResponse {
192
192
  type PayLanguage = "de-DE" | "en-AU" | "en-CA" | "en-GB" | "en-IN" | "en-IE" | "en-NZ" | "en-PH" | "en-ZA" | "en-US" | "es-ES" | "es-US" | "fr-CA" | "fr-FR" | "it-IT";
193
193
  type PayPaymentMethod = "ach-debit" | "credit-card";
194
194
  type PayStatusCallbackMethod = "GET" | "POST";
195
- type PayTokenType = "one-time" | "reusable";
195
+ type PayTokenType = "one-time" | "reusable" | "payment-method";
196
196
  type PayValidCardTypes = "visa" | "mastercard" | "amex" | "maestro" | "discover" | "optima" | "jcb" | "diners-club" | "enroute";
197
197
  type PromptCardType = "visa" | "mastercard" | "amex" | "maestro" | "discover" | "optima" | "jcb" | "diners-club" | "enroute";
198
198
  type PromptErrorType = "timeout" | "invalid-card-number" | "invalid-card-type" | "invalid-date" | "invalid-security-code" | "internal-error" | "input-matching-failed";
@@ -7,7 +7,6 @@ exports.webhook = exports.validateExpressRequest = exports.validateIncomingReque
7
7
  const scmp = require("scmp");
8
8
  const crypto_1 = __importDefault(require("crypto"));
9
9
  const url_1 = __importDefault(require("url"));
10
- const url_parse_1 = __importDefault(require("url-parse"));
11
10
  /**
12
11
  * Utility function to construct the URL string, since Node.js url library won't include standard port numbers
13
12
  *
@@ -22,7 +21,7 @@ function buildUrlWithStandardPort(parsedUrl) {
22
21
  url += parsedUrl.password ? ":" + parsedUrl.password : "";
23
22
  url += parsedUrl.username || parsedUrl.password ? "@" : "";
24
23
  url += parsedUrl.host ? parsedUrl.host + port : "";
25
- url += parsedUrl.pathname + parsedUrl.query + parsedUrl.hash;
24
+ url += parsedUrl.pathname + parsedUrl.search + parsedUrl.hash;
26
25
  return url;
27
26
  }
28
27
  /**
@@ -44,7 +43,7 @@ function addPort(parsedUrl) {
44
43
  @returns URL without port
45
44
  */
46
45
  function removePort(parsedUrl) {
47
- parsedUrl.set("port", "");
46
+ parsedUrl.port = "";
48
47
  return parsedUrl.toString();
49
48
  }
50
49
  /**
@@ -108,7 +107,7 @@ exports.getExpectedBodyHash = getExpectedBodyHash;
108
107
  */
109
108
  function validateRequest(authToken, twilioHeader, url, params) {
110
109
  twilioHeader = twilioHeader || "";
111
- const urlObject = new url_parse_1.default(url);
110
+ const urlObject = new URL(url);
112
111
  const urlWithPort = addPort(urlObject);
113
112
  const urlWithoutPort = removePort(urlObject);
114
113
  /*
@@ -138,9 +137,9 @@ exports.validateBody = validateBody;
138
137
  @returns valid
139
138
  */
140
139
  function validateRequestWithBody(authToken, twilioHeader, url, body) {
141
- const urlObject = new url_parse_1.default(url, true);
140
+ const urlObject = new URL(url);
142
141
  return (validateRequest(authToken, twilioHeader, url, {}) &&
143
- validateBody(body, urlObject.query.bodySHA256 || ""));
142
+ validateBody(body, urlObject.searchParams.get("bodySHA256") || ""));
144
143
  }
145
144
  exports.validateRequestWithBody = validateRequestWithBody;
146
145
  /**