Skip to content

Commit

Permalink
chore: Added previewMessaging folder (#974)
Browse files Browse the repository at this point in the history
* chore: added PreviewMessaging directory

* chore: added PreviewMessaging directory

* [Librarian] Regenerated @ 5eb406c4977c9f6976e6053cb5b581056f541a59

* Release 4.19.1

* Update PreviewMessagingBase.ts

* chore: removed LTS version

* chore: executed prettier

---------

Co-authored-by: Twilio <[email protected]>
  • Loading branch information
tiwarishubham635 and twilio-dx authored Nov 7, 2023
1 parent b20eda1 commit 47ac32f
Show file tree
Hide file tree
Showing 15 changed files with 1,211 additions and 8 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/test-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
timeout-minutes: 20
strategy:
matrix:
node: [ 14, 16, 18, lts/* ]
node: [ 14, 16, 18 ]
steps:
- name: Checkout twilio-node
uses: actions/checkout@v3
Expand Down Expand Up @@ -49,7 +49,7 @@ jobs:
npm run test
- name: SonarCloud Scan
if: ${{ (github.event_name == 'pull_request' || github.ref_type == 'branch') && matrix.node == 'lts/*' && !github.event.pull_request.head.repo.fork }}
if: ${{ (github.event_name == 'pull_request' || github.ref_type == 'branch') && matrix.node == '18' && !github.event.pull_request.head.repo.fork }}
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
Expand All @@ -69,7 +69,7 @@ jobs:
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: lts/*
node-version: 18

- run: npm install

Expand Down
20 changes: 19 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,28 @@
twilio-node changelog
=====================

[2023-10-17] Version 5.0.0-rc.0
[2023-11-07] Version 5.0.0-rc.0
---------------------------
- Release Candidate preparation

[2023-11-06] Version 4.19.1
---------------------------
**Flex**
- Adding `provisioning_status` for Email Manager

**Intelligence**
- Add text-generation operator (for example conversation summary) results to existing OperatorResults collection.

**Messaging**
- Add DELETE support to Tollfree Verification resource

**Serverless**
- Add node18 as a valid Build runtime

**Verify**
- Update Verify TOTP maturity to GA.


[2023-10-19] Version 4.19.0
---------------------------
**Library - Chore**
Expand Down
7 changes: 4 additions & 3 deletions src/base/RequestClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,11 @@ class RequestClient {
};

if (opts.data && options.headers) {
if(options.headers["Content-Type"] === "application/x-www-form-urlencoded") {
if (
options.headers["Content-Type"] === "application/x-www-form-urlencoded"
) {
options.data = qs.stringify(opts.data, { arrayFormat: "repeat" });
}
else if(options.headers["Content-Type"] === "application/json") {
} else if (options.headers["Content-Type"] === "application/json") {
options.data = opts.data;
}
}
Expand Down
13 changes: 13 additions & 0 deletions src/rest/PreviewMessaging.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import PreviewMessagingBase from "./PreviewMessagingBase";
import { MessageListInstance } from "./previewMessaging/v1/message";

class PreviewMessaging extends PreviewMessagingBase {
/**
* @deprecated - Use v1.messages; instead
*/
get messages(): MessageListInstance {
console.warn("messages is deprecated. Use v1.messages; instead.");
return this.v1.messages;
}
}
export = PreviewMessaging;
33 changes: 33 additions & 0 deletions src/rest/PreviewMessagingBase.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* This code was generated by
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
*
* NOTE: This class is auto generated by OpenAPI Generator.
* https://openapi-generator.tech
* Do not edit the class manually.
*/

import Domain from "../base/Domain";
import V1 from "./previewMessaging/V1";

class PreviewMessagingBase extends Domain {
_v1?: V1;

/**
* Initialize accounts domain
*
* @param twilio - The twilio client
*/
constructor(twilio: any) {
super(twilio, "https://preview.messaging.twilio.com");
}

get v1(): V1 {
this._v1 = this._v1 || new V1(this);
return this._v1;
}
}

export = PreviewMessagingBase;
10 changes: 10 additions & 0 deletions src/rest/flexApi/V1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import { InsightsSettingsAnswerSetsListInstance } from "./v1/insightsSettingsAns
import { InsightsSettingsCommentListInstance } from "./v1/insightsSettingsComment";
import { InsightsUserRolesListInstance } from "./v1/insightsUserRoles";
import { InteractionListInstance } from "./v1/interaction";
import { ProvisioningStatusListInstance } from "./v1/provisioningStatus";
import { WebChannelListInstance } from "./v1/webChannel";

export default class V1 extends Version {
Expand Down Expand Up @@ -71,6 +72,8 @@ export default class V1 extends Version {
protected _insightsUserRoles?: InsightsUserRolesListInstance;
/** interaction - { Twilio.FlexApi.V1.InteractionListInstance } resource */
protected _interaction?: InteractionListInstance;
/** provisioningStatus - { Twilio.FlexApi.V1.ProvisioningStatusListInstance } resource */
protected _provisioningStatus?: ProvisioningStatusListInstance;
/** webChannel - { Twilio.FlexApi.V1.WebChannelListInstance } resource */
protected _webChannel?: WebChannelListInstance;

Expand Down Expand Up @@ -180,6 +183,13 @@ export default class V1 extends Version {
return this._interaction;
}

/** Getter for provisioningStatus resource */
get provisioningStatus(): ProvisioningStatusListInstance {
this._provisioningStatus =
this._provisioningStatus || ProvisioningStatusListInstance(this);
return this._provisioningStatus;
}

/** Getter for webChannel resource */
get webChannel(): WebChannelListInstance {
this._webChannel = this._webChannel || WebChannelListInstance(this);
Expand Down
196 changes: 196 additions & 0 deletions src/rest/flexApi/v1/provisioningStatus.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,196 @@
/*
* This code was generated by
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
*
* Twilio - Flex
* 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 ProvisioningStatusStatus =
| "active"
| "in-progress"
| "not-configured"
| "failed";

export interface ProvisioningStatusContext {
/**
* Fetch a ProvisioningStatusInstance
*
* @param callback - Callback to handle processed record
*
* @returns Resolves to processed ProvisioningStatusInstance
*/
fetch(
callback?: (error: Error | null, item?: ProvisioningStatusInstance) => any
): Promise<ProvisioningStatusInstance>;

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

export interface ProvisioningStatusContextSolution {}

export class ProvisioningStatusContextImpl
implements ProvisioningStatusContext
{
protected _solution: ProvisioningStatusContextSolution;
protected _uri: string;

constructor(protected _version: V1) {
this._solution = {};
this._uri = `/account/provision/status`;
}

fetch(
callback?: (error: Error | null, item?: ProvisioningStatusInstance) => any
): Promise<ProvisioningStatusInstance> {
const instance = this;
let operationVersion = instance._version,
operationPromise = operationVersion.fetch({
uri: instance._uri,
method: "get",
});

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

operationPromise = instance._version.setPromiseCallback(
operationPromise,
callback
);
return operationPromise;
}

/**
* Provide a user-friendly representation
*
* @returns Object
*/
toJSON() {
return this._solution;
}

[inspect.custom](_depth: any, options: InspectOptions) {
return inspect(this.toJSON(), options);
}
}

interface ProvisioningStatusPayload extends ProvisioningStatusResource {}

interface ProvisioningStatusResource {
status: ProvisioningStatusStatus;
url: string;
}

export class ProvisioningStatusInstance {
protected _solution: ProvisioningStatusContextSolution;
protected _context?: ProvisioningStatusContext;

constructor(protected _version: V1, payload: ProvisioningStatusResource) {
this.status = payload.status;
this.url = payload.url;

this._solution = {};
}

status: ProvisioningStatusStatus;
/**
* The absolute URL of the resource.
*/
url: string;

private get _proxy(): ProvisioningStatusContext {
this._context =
this._context || new ProvisioningStatusContextImpl(this._version);
return this._context;
}

/**
* Fetch a ProvisioningStatusInstance
*
* @param callback - Callback to handle processed record
*
* @returns Resolves to processed ProvisioningStatusInstance
*/
fetch(
callback?: (error: Error | null, item?: ProvisioningStatusInstance) => any
): Promise<ProvisioningStatusInstance> {
return this._proxy.fetch(callback);
}

/**
* Provide a user-friendly representation
*
* @returns Object
*/
toJSON() {
return {
status: this.status,
url: this.url,
};
}

[inspect.custom](_depth: any, options: InspectOptions) {
return inspect(this.toJSON(), options);
}
}

export interface ProvisioningStatusSolution {}

export interface ProvisioningStatusListInstance {
_version: V1;
_solution: ProvisioningStatusSolution;
_uri: string;

(): ProvisioningStatusContext;
get(): ProvisioningStatusContext;

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

export function ProvisioningStatusListInstance(
version: V1
): ProvisioningStatusListInstance {
const instance = (() => instance.get()) as ProvisioningStatusListInstance;

instance.get = function get(): ProvisioningStatusContext {
return new ProvisioningStatusContextImpl(version);
};

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

instance.toJSON = function toJSON() {
return instance._solution;
};

instance[inspect.custom] = function inspectImpl(
_depth: any,
options: InspectOptions
) {
return inspect(instance.toJSON(), options);
};

return instance;
}
7 changes: 7 additions & 0 deletions src/rest/intelligence/v2/transcript/operatorResult.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ interface OperatorResultResource {
predicted_probability: number;
label_probabilities: any;
extract_results: any;
text_generation_results: any;
transcript_sid: string;
url: string;
}
Expand All @@ -239,6 +240,7 @@ export class OperatorResultInstance {
this.predictedProbability = payload.predicted_probability;
this.labelProbabilities = payload.label_probabilities;
this.extractResults = payload.extract_results;
this.textGenerationResults = payload.text_generation_results;
this.transcriptSid = payload.transcript_sid;
this.url = payload.url;

Expand Down Expand Up @@ -293,6 +295,10 @@ export class OperatorResultInstance {
* List of text extraction results. This might be available on classify-extract model outputs.
*/
extractResults: any;
/**
* Output of a text generation operator for example Conversation Sumamary.
*/
textGenerationResults: any;
/**
* A 34 character string that uniquely identifies this Transcript.
*/
Expand Down Expand Up @@ -362,6 +368,7 @@ export class OperatorResultInstance {
predictedProbability: this.predictedProbability,
labelProbabilities: this.labelProbabilities,
extractResults: this.extractResults,
textGenerationResults: this.textGenerationResults,
transcriptSid: this.transcriptSid,
url: this.url,
};
Expand Down
Loading

0 comments on commit 47ac32f

Please sign in to comment.