Socket
Socket
Sign inDemoInstall

twilio

Package Overview
Dependencies
Maintainers
1
Versions
299
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

twilio - npm Package Compare versions

Comparing version 5.0.3 to 5.0.4

lib/rest/flexApi/v2/flexUser.d.ts

10

lib/rest/api/v2010/account/call/stream.d.ts

@@ -18,11 +18,11 @@ /// <reference types="node" />

export interface StreamListInstanceCreateOptions {
/** Relative or absolute url where WebSocket connection will be established. */
/** Relative or absolute URL where WebSocket connection will be established. */
url: string;
/** The user-specified name of this Stream, if one was given when the Stream was created. This may be used to stop the Stream. */
/** The user-specified name of this Stream, if one was given when the Stream was created. This can be used to stop the Stream. */
name?: string;
/** */
track?: StreamTrack;
/** Absolute URL of the status callback. */
/** Absolute URL to which Twilio sends status callback HTTP requests. */
statusCallback?: string;
/** The http method for the status_callback (one of GET, POST). */
/** The HTTP method Twilio uses when sending `status_callback` requests. Possible values are `GET` and `POST`. Default is `POST`. */
statusCallbackMethod?: string;

@@ -488,3 +488,3 @@ /** Parameter name */

/**
* The user-specified name of this Stream, if one was given when the Stream was created. This may be used to stop the Stream.
* The user-specified name of this Stream, if one was given when the Stream was created. This can be used to stop the Stream.
*/

@@ -491,0 +491,0 @@ name: string;

import FlexApiBase from "../FlexApiBase";
import Version from "../../base/Version";
import { FlexUserListInstance } from "./v2/flexUser";
import { WebChannelsListInstance } from "./v2/webChannels";

@@ -11,6 +12,10 @@ export default class V2 extends Version {

constructor(domain: FlexApiBase);
/** flexUser - { Twilio.FlexApi.V2.FlexUserListInstance } resource */
protected _flexUser?: FlexUserListInstance;
/** webChannels - { Twilio.FlexApi.V2.WebChannelsListInstance } resource */
protected _webChannels?: WebChannelsListInstance;
/** Getter for flexUser resource */
get flexUser(): FlexUserListInstance;
/** Getter for webChannels resource */
get webChannels(): WebChannelsListInstance;
}

@@ -20,2 +20,3 @@ "use strict";

const Version_1 = __importDefault(require("../../base/Version"));
const flexUser_1 = require("./v2/flexUser");
const webChannels_1 = require("./v2/webChannels");

@@ -31,2 +32,7 @@ class V2 extends Version_1.default {

}
/** Getter for flexUser resource */
get flexUser() {
this._flexUser = this._flexUser || (0, flexUser_1.FlexUserListInstance)(this);
return this._flexUser;
}
/** Getter for webChannels resource */

@@ -33,0 +39,0 @@ get webChannels() {

@@ -10,2 +10,4 @@ /// <reference types="node" />

addressSid: string;
/** The Ui-Version HTTP request header */
uiVersion?: string;
/** The Conversation\\\'s friendly name. See the [Conversation resource](https://www.twilio.com/docs/conversations/api/conversation-resource) for an example. */

@@ -12,0 +14,0 @@ chatFriendlyName?: string;

@@ -42,2 +42,4 @@ "use strict";

headers["Content-Type"] = "application/x-www-form-urlencoded";
if (params["uiVersion"] !== undefined)
headers["Ui-Version"] = params["uiVersion"];
let operationVersion = version, operationPromise = operationVersion.create({

@@ -44,0 +46,0 @@ uri: instance._uri,

@@ -8,2 +8,3 @@ import NumbersBase from "../NumbersBase";

import { PortingPortInFetchListInstance } from "./v1/portingPortInFetch";
import { PortingPortInPhoneNumberListInstance } from "./v1/portingPortInPhoneNumber";
import { PortingPortabilityListInstance } from "./v1/portingPortability";

@@ -27,2 +28,4 @@ export default class V1 extends Version {

protected _portingPortInsFetch?: PortingPortInFetchListInstance;
/** portingPortInPhoneNumber - { Twilio.Numbers.V1.PortingPortInPhoneNumberListInstance } resource */
protected _portingPortInPhoneNumber?: PortingPortInPhoneNumberListInstance;
/** portingPortabilities - { Twilio.Numbers.V1.PortingPortabilityListInstance } resource */

@@ -40,4 +43,6 @@ protected _portingPortabilities?: PortingPortabilityListInstance;

get portingPortInsFetch(): PortingPortInFetchListInstance;
/** Getter for portingPortInPhoneNumber resource */
get portingPortInPhoneNumber(): PortingPortInPhoneNumberListInstance;
/** Getter for portingPortabilities resource */
get portingPortabilities(): PortingPortabilityListInstance;
}

@@ -25,2 +25,3 @@ "use strict";

const portingPortInFetch_1 = require("./v1/portingPortInFetch");
const portingPortInPhoneNumber_1 = require("./v1/portingPortInPhoneNumber");
const portingPortability_1 = require("./v1/portingPortability");

@@ -66,2 +67,9 @@ class V1 extends Version_1.default {

}
/** Getter for portingPortInPhoneNumber resource */
get portingPortInPhoneNumber() {
this._portingPortInPhoneNumber =
this._portingPortInPhoneNumber ||
(0, portingPortInPhoneNumber_1.PortingPortInPhoneNumberListInstance)(this);
return this._portingPortInPhoneNumber;
}
/** Getter for portingPortabilities resource */

@@ -68,0 +76,0 @@ get portingPortabilities() {

@@ -11,26 +11,12 @@ /// <reference types="node" />

}
export interface PortingPortInSolution {
}
export interface PortingPortInListInstance {
_version: V1;
_solution: PortingPortInSolution;
_uri: string;
export interface PortingPortInContext {
/**
* Create a PortingPortInInstance
* Remove a PortingPortInInstance
*
* @param callback - Callback to handle processed record
*
* @returns Resolves to processed PortingPortInInstance
* @returns Resolves to processed boolean
*/
create(callback?: (error: Error | null, item?: PortingPortInInstance) => any): Promise<PortingPortInInstance>;
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
/**
* Create a PortingPortInInstance
*
* @param params - Body for request
* @param callback - Callback to handle processed record
*
* @returns Resolves to processed PortingPortInInstance
*/
create(params: object, callback?: (error: Error | null, item?: PortingPortInInstance) => any): Promise<PortingPortInInstance>;
/**
* Provide a user-friendly representation

@@ -41,3 +27,19 @@ */

}
export declare function PortingPortInListInstance(version: V1): PortingPortInListInstance;
export interface PortingPortInContextSolution {
portInRequestSid: string;
}
export declare class PortingPortInContextImpl implements PortingPortInContext {
protected _version: V1;
protected _solution: PortingPortInContextSolution;
protected _uri: string;
constructor(_version: V1, portInRequestSid: string);
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
/**
* Provide a user-friendly representation
*
* @returns Object
*/
toJSON(): PortingPortInContextSolution;
[inspect.custom](_depth: any, options: InspectOptions): string;
}
interface PortingPortInResource {

@@ -49,3 +51,5 @@ port_in_request_sid: string;

protected _version: V1;
constructor(_version: V1, payload: PortingPortInResource);
protected _solution: PortingPortInContextSolution;
protected _context?: PortingPortInContext;
constructor(_version: V1, payload: PortingPortInResource, portInRequestSid?: string);
/**

@@ -56,3 +60,12 @@ * The SID of the Port In request. This is a unique identifier of the port in request.

url: string;
private get _proxy();
/**
* Remove a PortingPortInInstance
*
* @param callback - Callback to handle processed record
*
* @returns Resolves to processed boolean
*/
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
/**
* Provide a user-friendly representation

@@ -68,2 +81,34 @@ *

}
export interface PortingPortInSolution {
}
export interface PortingPortInListInstance {
_version: V1;
_solution: PortingPortInSolution;
_uri: string;
(portInRequestSid: string): PortingPortInContext;
get(portInRequestSid: string): PortingPortInContext;
/**
* Create a PortingPortInInstance
*
* @param callback - Callback to handle processed record
*
* @returns Resolves to processed PortingPortInInstance
*/
create(callback?: (error: Error | null, item?: PortingPortInInstance) => any): Promise<PortingPortInInstance>;
/**
* Create a PortingPortInInstance
*
* @param params - Body for request
* @param callback - Callback to handle processed record
*
* @returns Resolves to processed PortingPortInInstance
*/
create(params: object, callback?: (error: Error | null, item?: PortingPortInInstance) => any): Promise<PortingPortInInstance>;
/**
* Provide a user-friendly representation
*/
toJSON(): any;
[inspect.custom](_depth: any, options: InspectOptions): any;
}
export declare function PortingPortInListInstance(version: V1): PortingPortInListInstance;
export {};

@@ -16,8 +16,84 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.PortingPortInInstance = exports.PortingPortInListInstance = void 0;
exports.PortingPortInListInstance = exports.PortingPortInInstance = exports.PortingPortInContextImpl = void 0;
const util_1 = require("util");
const deserialize = require("../../../base/deserialize");
const serialize = require("../../../base/serialize");
const utility_1 = require("../../../base/utility");
class PortingPortInContextImpl {
constructor(_version, portInRequestSid) {
this._version = _version;
if (!(0, utility_1.isValidPathParam)(portInRequestSid)) {
throw new Error("Parameter 'portInRequestSid' is not valid.");
}
this._solution = { portInRequestSid };
this._uri = `/Porting/PortIn/${portInRequestSid}`;
}
remove(callback) {
const instance = this;
let operationVersion = instance._version, operationPromise = operationVersion.remove({
uri: instance._uri,
method: "delete",
});
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
return operationPromise;
}
/**
* Provide a user-friendly representation
*
* @returns Object
*/
toJSON() {
return this._solution;
}
[util_1.inspect.custom](_depth, options) {
return (0, util_1.inspect)(this.toJSON(), options);
}
}
exports.PortingPortInContextImpl = PortingPortInContextImpl;
class PortingPortInInstance {
constructor(_version, payload, portInRequestSid) {
this._version = _version;
this.portInRequestSid = payload.port_in_request_sid;
this.url = payload.url;
this._solution = {
portInRequestSid: portInRequestSid || this.portInRequestSid,
};
}
get _proxy() {
this._context =
this._context ||
new PortingPortInContextImpl(this._version, this._solution.portInRequestSid);
return this._context;
}
/**
* Remove a PortingPortInInstance
*
* @param callback - Callback to handle processed record
*
* @returns Resolves to processed boolean
*/
remove(callback) {
return this._proxy.remove(callback);
}
/**
* Provide a user-friendly representation
*
* @returns Object
*/
toJSON() {
return {
portInRequestSid: this.portInRequestSid,
url: this.url,
};
}
[util_1.inspect.custom](_depth, options) {
return (0, util_1.inspect)(this.toJSON(), options);
}
}
exports.PortingPortInInstance = PortingPortInInstance;
function PortingPortInListInstance(version) {
const instance = {};
const instance = ((portInRequestSid) => instance.get(portInRequestSid));
instance.get = function get(portInRequestSid) {
return new PortingPortInContextImpl(version, portInRequestSid);
};
instance._version = version;

@@ -57,23 +133,1 @@ instance._solution = {};

exports.PortingPortInListInstance = PortingPortInListInstance;
class PortingPortInInstance {
constructor(_version, payload) {
this._version = _version;
this.portInRequestSid = payload.port_in_request_sid;
this.url = payload.url;
}
/**
* Provide a user-friendly representation
*
* @returns Object
*/
toJSON() {
return {
portInRequestSid: this.portInRequestSid,
url: this.url,
};
}
[util_1.inspect.custom](_depth, options) {
return (0, util_1.inspect)(this.toJSON(), options);
}
}
exports.PortingPortInInstance = PortingPortInInstance;

@@ -10,3 +10,2 @@ "use strict";

const url_1 = __importDefault(require("url"));
const url_parse_1 = __importDefault(require("url-parse"));
/**

@@ -26,3 +25,3 @@ * Utility function to construct the URL string, since Node.js url library won't include standard port numbers

url += parsedUrl.host ? parsedUrl.host + port : "";
url += parsedUrl.pathname + parsedUrl.query + parsedUrl.hash;
url += parsedUrl.pathname + parsedUrl.search + parsedUrl.hash;
return url;

@@ -49,3 +48,3 @@ }

function removePort(parsedUrl) {
parsedUrl.set("port", "");
parsedUrl.port = "";
return parsedUrl.toString();

@@ -114,3 +113,3 @@ }

twilioHeader = twilioHeader || "";
const urlObject = new url_parse_1.default(url);
const urlObject = new URL(url);
const urlWithPort = addPort(urlObject);

@@ -145,5 +144,5 @@ const urlWithoutPort = removePort(urlObject);

function validateRequestWithBody(authToken, twilioHeader, url, body) {
const urlObject = new url_parse_1.default(url, true);
const urlObject = new URL(url);
return (validateRequest(authToken, twilioHeader, url, {}) &&
validateBody(body, urlObject.query.bodySHA256 || ""));
validateBody(body, urlObject.searchParams.get("bodySHA256") || ""));
}

@@ -150,0 +149,0 @@ exports.validateRequestWithBody = validateRequestWithBody;

{
"name": "twilio",
"description": "A Twilio helper library",
"version": "5.0.3",
"version": "5.0.4",
"author": "API Team <api@twilio.com>",

@@ -23,9 +23,8 @@ "contributors": [

"dependencies": {
"axios": "^1.6.0",
"axios": "^1.6.8",
"dayjs": "^1.11.9",
"https-proxy-agent": "^5.0.0",
"jsonwebtoken": "^9.0.0",
"jsonwebtoken": "^9.0.2",
"qs": "^6.9.4",
"scmp": "^2.1.0",
"url-parse": "^1.5.9",
"xmlbuilder": "^13.0.2"

@@ -37,6 +36,5 @@ },

"@types/jest": "^29.5.5",
"@types/jsonwebtoken": "^9.0.0",
"@types/jsonwebtoken": "^9.0.2",
"@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",

@@ -43,0 +41,0 @@ "eslint": "^8.31.0",

@@ -25,2 +25,3 @@ # twilio-node

- Node.js 18
- Node.js LTS (20)

@@ -27,0 +28,0 @@ TypeScript is supported for TypeScript version 2.9 and above.

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc