Skip to content

Commit

Permalink
Merge branch 'main' into validate-request
Browse files Browse the repository at this point in the history
  • Loading branch information
manisha1997 authored Jan 14, 2025
2 parents 044e3f8 + 4bbf97d commit 7ab2a8e
Show file tree
Hide file tree
Showing 19 changed files with 387 additions and 69 deletions.
12 changes: 12 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
twilio-node changelog
=====================

[2025-01-13] Version 5.4.2
--------------------------
**Messaging**
- Adds validity period Default value in service resource documentation


[2025-01-09] Version 5.4.1
--------------------------
**Numbers**
- Change beta feature flag to use v2/BulkHostedNumberOrders


[2024-12-12] Version 5.4.0
--------------------------
**Library - Chore**
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "twilio",
"description": "A Twilio helper library",
"version": "5.4.0",
"version": "5.4.2",
"author": "API Team <api@twilio.com>",
"contributors": [
{
Expand Down
2 changes: 1 addition & 1 deletion src/rest/api/v2010/account/call/transcription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export interface TranscriptionListInstanceCreateOptions {
hints?: string;
/** The provider will add punctuation to recognition result */
enableAutomaticPunctuation?: boolean;
/** The SID or the unique name of the [IntelligentService](https://www.twilio.com/docs/voice/intelligence/api/service-resource) to process the transcription. */
/** The SID of the [Voice Intelligence Service](https://www.twilio.com/docs/voice/intelligence/api/service-resource) for persisting transcripts and running post-call Language Operators . */
intelligenceService?: string;
}

Expand Down
14 changes: 9 additions & 5 deletions src/rest/assistants/v1/assistant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export class AssistantsV1ServiceKnowledge {
/**
* The description of knowledge.
*/
"id"?: string;
"id": string;
/**
* The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Knowledge resource.
*/
Expand All @@ -72,27 +72,31 @@ export class AssistantsV1ServiceKnowledge {
/**
* The name of the knowledge source.
*/
"name"?: string;
"name": string;
/**
* The status of processing the knowledge source (\'QUEUED\', \'PROCESSING\', \'COMPLETED\', \'FAILED\')
*/
"status"?: string;
/**
* The type of knowledge source (\'Web\', \'Database\', \'Text\', \'File\')
*/
"type"?: string;
"type": string;
/**
* The url of the knowledge resource.
*/
"url"?: string;
/**
* The embedding model to be used for the knowledge source.
*/
"embedding_model"?: string;
/**
* The date and time in GMT when the Knowledge was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
*/
"date_created"?: Date;
"date_created": Date;
/**
* The date and time in GMT when the Knowledge was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
*/
"date_updated"?: Date;
"date_updated": Date;
}

export class AssistantsV1ServiceSegmentCredential {
Expand Down
7 changes: 7 additions & 0 deletions src/rest/assistants/v1/assistant/assistantsKnowledge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ interface AssistantsKnowledgeResource {
status: string;
type: string;
url: string;
embedding_model: string;
date_created: Date;
date_updated: Date;
}
Expand All @@ -212,6 +213,7 @@ export class AssistantsKnowledgeInstance {
this.status = payload.status;
this.type = payload.type;
this.url = payload.url;
this.embeddingModel = payload.embedding_model;
this.dateCreated = deserialize.iso8601DateTime(payload.date_created);
this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated);

Expand Down Expand Up @@ -250,6 +252,10 @@ export class AssistantsKnowledgeInstance {
* The url of the knowledge resource.
*/
url: string;
/**
* The embedding model to be used for the knowledge source.
*/
embeddingModel: string;
/**
* The date and time in GMT when the Knowledge was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
*/
Expand Down Expand Up @@ -311,6 +317,7 @@ export class AssistantsKnowledgeInstance {
status: this.status,
type: this.type,
url: this.url,
embeddingModel: this.embeddingModel,
dateCreated: this.dateCreated,
dateUpdated: this.dateUpdated,
};
Expand Down
15 changes: 15 additions & 0 deletions src/rest/assistants/v1/knowledge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ export class AssistantsV1ServiceCreateKnowledgeRequest {
* The type of the knowledge source.
*/
"type": string;
/**
* The embedding model to be used for the knowledge source. It\'s required for \'Database\' type but disallowed for other types.
*/
"embedding_model"?: string;
}

export class AssistantsV1ServiceCreatePolicyRequest {
Expand Down Expand Up @@ -84,6 +88,10 @@ export class AssistantsV1ServiceUpdateKnowledgeRequest {
* The description of the knowledge source.
*/
"type"?: string;
/**
* The embedding model to be used for the knowledge source. It\'s only applicable to \'Database\' type.
*/
"embedding_model"?: string;
}

/**
Expand Down Expand Up @@ -353,6 +361,7 @@ interface KnowledgeResource {
status: string;
type: string;
url: string;
embedding_model: string;
date_created: Date;
date_updated: Date;
}
Expand All @@ -370,6 +379,7 @@ export class KnowledgeInstance {
this.status = payload.status;
this.type = payload.type;
this.url = payload.url;
this.embeddingModel = payload.embedding_model;
this.dateCreated = deserialize.iso8601DateTime(payload.date_created);
this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated);

Expand Down Expand Up @@ -408,6 +418,10 @@ export class KnowledgeInstance {
* The url of the knowledge resource.
*/
url: string;
/**
* The embedding model to be used for the knowledge source.
*/
embeddingModel: string;
/**
* The date and time in GMT when the Knowledge was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
*/
Expand Down Expand Up @@ -511,6 +525,7 @@ export class KnowledgeInstance {
status: this.status,
type: this.type,
url: this.url,
embeddingModel: this.embeddingModel,
dateCreated: this.dateCreated,
dateUpdated: this.dateUpdated,
};
Expand Down
7 changes: 0 additions & 7 deletions src/rest/content/v1/content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,6 @@ export class FlowsPage {
export class FlowsPageComponent {
"label": string;
"type": string;
"text"?: string;
"options"?: Array<FlowsPageComponentSelectItem>;
}

export class FlowsPageComponentSelectItem {
"id": string;
"title": string;
}

export class ListItem {
Expand Down
3 changes: 2 additions & 1 deletion src/rest/conversations/v1/addressConfiguration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ export type AddressConfigurationType =
| "whatsapp"
| "messenger"
| "gbm"
| "email";
| "email"
| "rcs";

/**
* Options to pass to update a AddressConfigurationInstance
Expand Down
4 changes: 2 additions & 2 deletions src/rest/conversations/v1/configuration/webhook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export type WebhookTarget = "webhook" | "flex";
export interface WebhookContextUpdateOptions {
/** The HTTP method to be used when sending a webhook request. */
method?: string;
/** The list of webhook event triggers that are enabled for this Service: `onMessageAdded`, `onMessageUpdated`, `onMessageRemoved`, `onConversationUpdated`, `onConversationRemoved`, `onParticipantAdded`, `onParticipantUpdated`, `onParticipantRemoved` */
/** The list of webhook event triggers that are enabled for this Service: `onMessageAdded`, `onMessageUpdated`, `onMessageRemoved`, `onMessageAdd`, `onMessageUpdate`, `onMessageRemove`, `onConversationUpdated`, `onConversationRemoved`, `onConversationAdd`, `onConversationAdded`, `onConversationRemove`, `onConversationUpdate`, `onConversationStateUpdated`, `onParticipantAdded`, `onParticipantUpdated`, `onParticipantRemoved`, `onParticipantAdd`, `onParticipantRemove`, `onParticipantUpdate`, `onDeliveryUpdated`, `onUserAdded`, `onUserUpdate`, `onUserUpdated` */
filters?: Array<string>;
/** The absolute url the pre-event webhook request should be sent to. */
preWebhookUrl?: string;
Expand Down Expand Up @@ -212,7 +212,7 @@ export class WebhookInstance {
accountSid: string;
method: WebhookMethod;
/**
* The list of webhook event triggers that are enabled for this Service: `onMessageAdded`, `onMessageUpdated`, `onMessageRemoved`, `onConversationUpdated`, `onConversationRemoved`, `onParticipantAdded`, `onParticipantUpdated`, `onParticipantRemoved`
* The list of webhook event triggers that are enabled for this Service: `onMessageAdded`, `onMessageUpdated`, `onMessageRemoved`, `onMessageAdd`, `onMessageUpdate`, `onMessageRemove`, `onConversationUpdated`, `onConversationRemoved`, `onConversationAdd`, `onConversationAdded`, `onConversationRemove`, `onConversationUpdate`, `onConversationStateUpdated`, `onParticipantAdded`, `onParticipantUpdated`, `onParticipantRemoved`, `onParticipantAdd`, `onParticipantRemove`, `onParticipantUpdate`, `onDeliveryUpdated`, `onUserAdded`, `onUserUpdate`, `onUserUpdated`
*/
filters: Array<string>;
/**
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;
}
}
44 changes: 22 additions & 22 deletions src/rest/iam/v1/newApiKey.ts → src/rest/iam/v1/key.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,41 +18,41 @@ const deserialize = require("../../../base/deserialize");
const serialize = require("../../../base/serialize");
import { isValidPathParam } from "../../../base/utility";

export type NewApiKeyKeytype = "restricted";
export type KeyKeytype = "restricted";

/**
* Options to pass to create a NewApiKeyInstance
* Options to pass to create a KeyInstance
*/
export interface NewApiKeyListInstanceCreateOptions {
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?: NewApiKeyKeytype;
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 NewApiKeySolution {}
export interface KeySolution {}

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

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

/**
* Provide a user-friendly representation
Expand All @@ -61,17 +61,17 @@ export interface NewApiKeyListInstance {
[inspect.custom](_depth: any, options: InspectOptions): any;
}

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

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

instance.create = function create(
params: NewApiKeyListInstanceCreateOptions,
callback?: (error: Error | null, items: NewApiKeyInstance) => any
): Promise<NewApiKeyInstance> {
params: KeyListInstanceCreateOptions,
callback?: (error: Error | null, items: KeyInstance) => any
): Promise<KeyInstance> {
if (params === null || params === undefined) {
throw new Error('Required parameter "params" missing.');
}
Expand Down Expand Up @@ -102,7 +102,7 @@ export function NewApiKeyListInstance(version: V1): NewApiKeyListInstance {
});

operationPromise = operationPromise.then(
(payload) => new NewApiKeyInstance(operationVersion, payload)
(payload) => new KeyInstance(operationVersion, payload)
);

operationPromise = instance._version.setPromiseCallback(
Expand All @@ -126,9 +126,9 @@ export function NewApiKeyListInstance(version: V1): NewApiKeyListInstance {
return instance;
}

interface NewApiKeyPayload extends NewApiKeyResource {}
interface KeyPayload extends KeyResource {}

interface NewApiKeyResource {
interface KeyResource {
sid: string;
friendly_name: string;
date_created: Date;
Expand All @@ -137,8 +137,8 @@ interface NewApiKeyResource {
policy: any;
}

export class NewApiKeyInstance {
constructor(protected _version: V1, payload: NewApiKeyResource) {
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);
Expand Down
7 changes: 6 additions & 1 deletion src/rest/insights/v1/call/callSummary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,12 @@ export type CallSummaryCallState =
| "answered"
| "undialed";

export type CallSummaryCallType = "carrier" | "sip" | "trunking" | "client";
export type CallSummaryCallType =
| "carrier"
| "sip"
| "trunking"
| "client"
| "whatsapp";

export type CallSummaryProcessingState = "complete" | "partial";

Expand Down
7 changes: 6 additions & 1 deletion src/rest/insights/v1/callSummaries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,12 @@ export type CallSummariesCallState =
| "answered"
| "undialed";

export type CallSummariesCallType = "carrier" | "sip" | "trunking" | "client";
export type CallSummariesCallType =
| "carrier"
| "sip"
| "trunking"
| "client"
| "whatsapp";

export type CallSummariesProcessingState = "complete" | "partial";

Expand Down
Loading

0 comments on commit 7ab2a8e

Please sign in to comment.