Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: preview changes by twiml gather #1069

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,30 @@
twilio-node changelog
=====================

[2025-01-31] Version 5.5.0
--------------------------
**Library - Fix**
- [PR #1061](https://github.com/twilio/twilio-node/pull/1061): validate Twilio signatures with escaped and unescaped query string values fixes #1059. Thanks to [@leon19](https://github.com/leon19)!

**Api**
- Add open-api file tag to `conference/call recordings` and `recording_transcriptions`.

**Events**
- Add support for subaccount subscriptions (beta)

**Insights**
- add new region to conference APIs

**Lookups**
- Add new `parnter_sub_id` query parameter to the lookup request

**Messaging**
- Adds validity period Default value in service resource documentation

**Twiml**
- Convert Twiml Attribute `speechModel` of type enum to string **(breaking change)**


[2025-01-28] Version 5.4.3
--------------------------
**Library - Fix**
Expand Down
10 changes: 0 additions & 10 deletions src/rest/content/v1/content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,15 +216,6 @@ export class TwilioQuickReply {
"actions": Array<QuickReplyAction>;
}

/**
* twilio/schedule templates allow us to send a message with a schedule with different time slots
*/
export class TwilioSchedule {
"id": string;
"title": string;
"timeSlots": string;
}

/**
* Type containing only plain text-based content
*/
Expand All @@ -246,7 +237,6 @@ export class Types {
"twilio/catalog"?: TwilioCatalog | null;
"twilio/carousel"?: TwilioCarousel | null;
"twilio/flows"?: TwilioFlows | null;
"twilio/schedule"?: TwilioSchedule | null;
"whatsapp/card"?: WhatsappCard | null;
"whatsapp/authentication"?: WhatsappAuthentication | null;
}
Expand Down
3 changes: 1 addition & 2 deletions src/rest/conversations/v1/addressConfiguration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ export type AddressConfigurationType =
| "messenger"
| "gbm"
| "email"
| "rcs"
| "apple";
| "rcs";

/**
* Options to pass to update a AddressConfigurationInstance
Expand Down
19 changes: 0 additions & 19 deletions src/rest/events/v1/subscription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ export interface SubscriptionContextUpdateOptions {
description?: string;
/** The SID of the sink that events selected by this subscription should be sent to. Sink must be active for the subscription to be created. */
sinkSid?: string;
/** Receive events from all children accounts in the parent account subscription. */
receiveEventsFromSubaccounts?: boolean;
}

/**
Expand All @@ -43,8 +41,6 @@ export interface SubscriptionListInstanceCreateOptions {
sinkSid: string;
/** An array of objects containing the subscribed Event Types */
types: Array<any>;
/** Receive events from all children accounts in the parent account subscription. */
receiveEventsFromSubaccounts?: boolean;
}
/**
* Options to pass to each
Expand Down Expand Up @@ -237,10 +233,6 @@ export class SubscriptionContextImpl implements SubscriptionContext {
if (params["description"] !== undefined)
data["Description"] = params["description"];
if (params["sinkSid"] !== undefined) data["SinkSid"] = params["sinkSid"];
if (params["receiveEventsFromSubaccounts"] !== undefined)
data["ReceiveEventsFromSubaccounts"] = serialize.bool(
params["receiveEventsFromSubaccounts"]
);

const headers: any = {};
headers["Content-Type"] = "application/x-www-form-urlencoded";
Expand Down Expand Up @@ -298,7 +290,6 @@ interface SubscriptionResource {
sink_sid: string;
url: string;
links: Record<string, string>;
receive_events_from_subaccounts: boolean;
}

export class SubscriptionInstance {
Expand All @@ -318,7 +309,6 @@ export class SubscriptionInstance {
this.sinkSid = payload.sink_sid;
this.url = payload.url;
this.links = payload.links;
this.receiveEventsFromSubaccounts = payload.receive_events_from_subaccounts;

this._solution = { sid: sid || this.sid };
}
Expand Down Expand Up @@ -355,10 +345,6 @@ export class SubscriptionInstance {
* Contains a dictionary of URL links to nested resources of this Subscription.
*/
links: Record<string, string>;
/**
* Receive events from all children accounts in the parent account subscription.
*/
receiveEventsFromSubaccounts: boolean;

private get _proxy(): SubscriptionContext {
this._context =
Expand Down Expand Up @@ -445,7 +431,6 @@ export class SubscriptionInstance {
sinkSid: this.sinkSid,
url: this.url,
links: this.links,
receiveEventsFromSubaccounts: this.receiveEventsFromSubaccounts,
};
}

Expand Down Expand Up @@ -595,10 +580,6 @@ export function SubscriptionListInstance(
data["Types"] = serialize.map(params["types"], (e: any) =>
serialize.object(e)
);
if (params["receiveEventsFromSubaccounts"] !== undefined)
data["ReceiveEventsFromSubaccounts"] = serialize.bool(
params["receiveEventsFromSubaccounts"]
);

const headers: any = {};
headers["Content-Type"] = "application/x-www-form-urlencoded";
Expand Down
14 changes: 7 additions & 7 deletions src/rest/iam/V1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import IamBase from "../IamBase";
import Version from "../../base/Version";
import { ApiKeyListInstance } from "./v1/apiKey";
import { GetApiKeysListInstance } from "./v1/getApiKeys";
import { NewApiKeyListInstance } from "./v1/newApiKey";
import { KeyListInstance } from "./v1/key";

export default class V1 extends Version {
/**
Expand All @@ -32,8 +32,8 @@ export default class V1 extends Version {
protected _apiKey?: ApiKeyListInstance;
/** getApiKeys - { Twilio.Iam.V1.GetApiKeysListInstance } resource */
protected _getApiKeys?: GetApiKeysListInstance;
/** newApiKey - { Twilio.Iam.V1.NewApiKeyListInstance } resource */
protected _newApiKey?: NewApiKeyListInstance;
/** keys - { Twilio.Iam.V1.KeyListInstance } resource */
protected _keys?: KeyListInstance;

/** Getter for apiKey resource */
get apiKey(): ApiKeyListInstance {
Expand All @@ -47,9 +47,9 @@ export default class V1 extends Version {
return this._getApiKeys;
}

/** Getter for newApiKey resource */
get newApiKey(): NewApiKeyListInstance {
this._newApiKey = this._newApiKey || NewApiKeyListInstance(this);
return this._newApiKey;
/** Getter for keys resource */
get keys(): KeyListInstance {
this._keys = this._keys || KeyListInstance(this);
return this._keys;
}
}
194 changes: 194 additions & 0 deletions src/rest/iam/v1/key.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
/*
* This code was generated by
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
*
* Twilio - Iam
* 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 type KeyKeytype = "restricted";

/**
* Options to pass to create a KeyInstance
*/
export interface KeyListInstanceCreateOptions {
/** The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Payments resource. */
accountSid: string;
/** A descriptive string that you create to describe the resource. It can be up to 64 characters long. */
friendlyName?: string;
/** */
keyType?: KeyKeytype;
/** The \\\\`Policy\\\\` object is a collection that specifies the allowed Twilio permissions for the restricted key. For more information on the permissions available with restricted API keys, refer to the [Twilio documentation](https://www.twilio.com/docs/iam/api-keys/restricted-api-keys#permissions-available-with-restricted-api-keys). */
policy?: any;
}

export interface KeySolution {}

export interface KeyListInstance {
_version: V1;
_solution: KeySolution;
_uri: string;

/**
* Create a KeyInstance
*
* @param params - Parameter for request
* @param callback - Callback to handle processed record
*
* @returns Resolves to processed KeyInstance
*/
create(
params: KeyListInstanceCreateOptions,
callback?: (error: Error | null, item?: KeyInstance) => any
): Promise<KeyInstance>;

/**
* Provide a user-friendly representation
*/
toJSON(): any;
[inspect.custom](_depth: any, options: InspectOptions): any;
}

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

instance._version = version;
instance._solution = {};
instance._uri = `/Keys`;

instance.create = function create(
params: KeyListInstanceCreateOptions,
callback?: (error: Error | null, items: KeyInstance) => any
): Promise<KeyInstance> {
if (params === null || params === undefined) {
throw new Error('Required parameter "params" missing.');
}

if (params["accountSid"] === null || params["accountSid"] === undefined) {
throw new Error("Required parameter \"params['accountSid']\" missing.");
}

let data: any = {};

data["AccountSid"] = params["accountSid"];
if (params["friendlyName"] !== undefined)
data["FriendlyName"] = params["friendlyName"];
if (params["keyType"] !== undefined) data["KeyType"] = params["keyType"];
if (params["policy"] !== undefined)
data["Policy"] = serialize.object(params["policy"]);

const headers: any = {};
headers["Content-Type"] = "application/x-www-form-urlencoded";
headers["Accept"] = "application/json";

let operationVersion = version,
operationPromise = operationVersion.create({
uri: instance._uri,
method: "post",
data,
headers,
});

operationPromise = operationPromise.then(
(payload) => new KeyInstance(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 KeyPayload extends KeyResource {}

interface KeyResource {
sid: string;
friendly_name: string;
date_created: Date;
date_updated: Date;
secret: string;
policy: any;
}

export class KeyInstance {
constructor(protected _version: V1, payload: KeyResource) {
this.sid = payload.sid;
this.friendlyName = payload.friendly_name;
this.dateCreated = deserialize.rfc2822DateTime(payload.date_created);
this.dateUpdated = deserialize.rfc2822DateTime(payload.date_updated);
this.secret = payload.secret;
this.policy = payload.policy;
}

/**
* The unique string that that we created to identify the NewKey resource. You will use this as the basic-auth `user` when authenticating to the API.
*/
sid: string;
/**
* The string that you assigned to describe the resource.
*/
friendlyName: string;
/**
* The date and time in GMT that the API Key was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
*/
dateCreated: Date;
/**
* The date and time in GMT that the new API Key was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
*/
dateUpdated: Date;
/**
* The secret your application uses to sign Access Tokens and to authenticate to the REST API (you will use this as the basic-auth `password`). **Note that for security reasons, this field is ONLY returned when the API Key is first created.**
*/
secret: string;
/**
* Collection of allow assertions.
*/
policy: any;

/**
* Provide a user-friendly representation
*
* @returns Object
*/
toJSON() {
return {
sid: this.sid,
friendlyName: this.friendlyName,
dateCreated: this.dateCreated,
dateUpdated: this.dateUpdated,
secret: this.secret,
policy: this.policy,
};
}

[inspect.custom](_depth: any, options: InspectOptions) {
return inspect(this.toJSON(), options);
}
}
1 change: 0 additions & 1 deletion src/rest/insights/v1/conference.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ export type ConferenceProcessingState = "complete" | "in_progress" | "timeout";

export type ConferenceRegion =
| "us1"
| "us2"
| "au1"
| "br1"
| "ie1"
Expand Down
4 changes: 0 additions & 4 deletions src/rest/lookups/v2/phoneNumber.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ export interface PhoneNumberContextFetchOptions {
lastVerifiedDate?: string;
/** The unique identifier associated with a verification process through verify API. This query parameter is only used (optionally) for pre_fill package requests. */
verificationSid?: string;
/** The optional partnerSubId parameter to provide context for your sub-accounts, tenantIDs, sender IDs or other segmentation, enhancing the accuracy of the risk analysis. */
partnerSubId?: string;
}

export interface PhoneNumberContext {
Expand Down Expand Up @@ -149,8 +147,6 @@ export class PhoneNumberContextImpl implements PhoneNumberContext {
data["LastVerifiedDate"] = params["lastVerifiedDate"];
if (params["verificationSid"] !== undefined)
data["VerificationSid"] = params["verificationSid"];
if (params["partnerSubId"] !== undefined)
data["PartnerSubId"] = params["partnerSubId"];

const headers: any = {};
headers["Accept"] = "application/json";
Expand Down
Loading
Loading