Auto-commit 2026-04-29 16:31
This commit is contained in:
15
node_modules/twilio/lib/rest/frontlineApi/V1.d.ts
generated
vendored
Normal file
15
node_modules/twilio/lib/rest/frontlineApi/V1.d.ts
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
import FrontlineApiBase from "../FrontlineApiBase";
|
||||
import Version from "../../base/Version";
|
||||
import { UserListInstance } from "./v1/user";
|
||||
export default class V1 extends Version {
|
||||
/**
|
||||
* Initialize the V1 version of FrontlineApi
|
||||
*
|
||||
* @param domain - The Twilio (Twilio.FrontlineApi) domain
|
||||
*/
|
||||
constructor(domain: FrontlineApiBase);
|
||||
/** users - { Twilio.FrontlineApi.V1.UserListInstance } resource */
|
||||
protected _users?: UserListInstance;
|
||||
/** Getter for users resource */
|
||||
get users(): UserListInstance;
|
||||
}
|
||||
36
node_modules/twilio/lib/rest/frontlineApi/V1.js
generated
vendored
Normal file
36
node_modules/twilio/lib/rest/frontlineApi/V1.js
generated
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
"use strict";
|
||||
/*
|
||||
* This code was generated by
|
||||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
||||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
||||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
||||
*
|
||||
* Twilio - Frontline
|
||||
* 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.
|
||||
*/
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const Version_1 = __importDefault(require("../../base/Version"));
|
||||
const user_1 = require("./v1/user");
|
||||
class V1 extends Version_1.default {
|
||||
/**
|
||||
* Initialize the V1 version of FrontlineApi
|
||||
*
|
||||
* @param domain - The Twilio (Twilio.FrontlineApi) domain
|
||||
*/
|
||||
constructor(domain) {
|
||||
super(domain, "v1");
|
||||
}
|
||||
/** Getter for users resource */
|
||||
get users() {
|
||||
this._users = this._users || (0, user_1.UserListInstance)(this);
|
||||
return this._users;
|
||||
}
|
||||
}
|
||||
exports.default = V1;
|
||||
219
node_modules/twilio/lib/rest/frontlineApi/v1/user.d.ts
generated
vendored
Normal file
219
node_modules/twilio/lib/rest/frontlineApi/v1/user.d.ts
generated
vendored
Normal file
@@ -0,0 +1,219 @@
|
||||
import { inspect, InspectOptions } from "util";
|
||||
import V1 from "../V1";
|
||||
import { ApiResponse } from "../../../base/ApiResponse";
|
||||
/**
|
||||
* Current state of this user. Can be either `active` or `deactivated` and defaults to `active`
|
||||
*/
|
||||
export type UserStateType = "active" | "deactivated";
|
||||
/**
|
||||
* Options to pass to update a UserInstance
|
||||
*/
|
||||
export interface UserContextUpdateOptions {
|
||||
/** The string that you assigned to describe the User. */
|
||||
friendlyName?: string;
|
||||
/** The avatar URL which will be shown in Frontline application. */
|
||||
avatar?: string;
|
||||
/** */
|
||||
state?: UserStateType;
|
||||
/** Whether the User is available for new conversations. Set to `false` to prevent User from receiving new inbound conversations if you are using [Pool Routing](https://www.twilio.com/docs/frontline/handle-incoming-conversations#3-pool-routing). */
|
||||
isAvailable?: boolean;
|
||||
}
|
||||
export interface UserContext {
|
||||
/**
|
||||
* Fetch a UserInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed UserInstance
|
||||
*/
|
||||
fetch(callback?: (error: Error | null, item?: UserInstance) => any): Promise<UserInstance>;
|
||||
/**
|
||||
* Fetch a UserInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed UserInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<UserInstance>) => any): Promise<ApiResponse<UserInstance>>;
|
||||
/**
|
||||
* Update a UserInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed UserInstance
|
||||
*/
|
||||
update(callback?: (error: Error | null, item?: UserInstance) => any): Promise<UserInstance>;
|
||||
/**
|
||||
* Update a UserInstance
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed UserInstance
|
||||
*/
|
||||
update(params: UserContextUpdateOptions, callback?: (error: Error | null, item?: UserInstance) => any): Promise<UserInstance>;
|
||||
/**
|
||||
* Update a UserInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed UserInstance with HTTP metadata
|
||||
*/
|
||||
updateWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<UserInstance>) => any): Promise<ApiResponse<UserInstance>>;
|
||||
/**
|
||||
* Update a UserInstance and return HTTP info
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed UserInstance with HTTP metadata
|
||||
*/
|
||||
updateWithHttpInfo(params: UserContextUpdateOptions, callback?: (error: Error | null, item?: ApiResponse<UserInstance>) => any): Promise<ApiResponse<UserInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export interface UserContextSolution {
|
||||
sid: string;
|
||||
}
|
||||
export declare class UserContextImpl implements UserContext {
|
||||
protected _version: V1;
|
||||
protected _solution: UserContextSolution;
|
||||
protected _uri: string;
|
||||
constructor(_version: V1, sid: string);
|
||||
fetch(callback?: (error: Error | null, item?: UserInstance) => any): Promise<UserInstance>;
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<UserInstance>) => any): Promise<ApiResponse<UserInstance>>;
|
||||
update(params?: UserContextUpdateOptions | ((error: Error | null, item?: UserInstance) => any), callback?: (error: Error | null, item?: UserInstance) => any): Promise<UserInstance>;
|
||||
updateWithHttpInfo(params?: UserContextUpdateOptions | ((error: Error | null, item?: ApiResponse<UserInstance>) => any), callback?: (error: Error | null, item?: ApiResponse<UserInstance>) => any): Promise<ApiResponse<UserInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): UserContextSolution;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
interface UserResource {
|
||||
sid: string;
|
||||
identity: string;
|
||||
friendly_name: string;
|
||||
avatar: string;
|
||||
state: UserStateType;
|
||||
is_available: boolean;
|
||||
url: string;
|
||||
}
|
||||
export declare class UserInstance {
|
||||
protected _version: V1;
|
||||
protected _solution: UserContextSolution;
|
||||
protected _context?: UserContext;
|
||||
constructor(_version: V1, payload: UserResource, sid?: string);
|
||||
/**
|
||||
* The unique string that we created to identify the User resource.
|
||||
*/
|
||||
sid: string;
|
||||
/**
|
||||
* The application-defined string that uniquely identifies the resource\'s User. This value is often a username or an email address, and is case-sensitive.
|
||||
*/
|
||||
identity: string;
|
||||
/**
|
||||
* The string that you assigned to describe the User.
|
||||
*/
|
||||
friendlyName: string;
|
||||
/**
|
||||
* The avatar URL which will be shown in Frontline application.
|
||||
*/
|
||||
avatar: string;
|
||||
state: UserStateType;
|
||||
/**
|
||||
* Whether the User is available for new conversations. Defaults to `false` for new users.
|
||||
*/
|
||||
isAvailable: boolean;
|
||||
/**
|
||||
* An absolute API resource URL for this user.
|
||||
*/
|
||||
url: string;
|
||||
private get _proxy();
|
||||
/**
|
||||
* Fetch a UserInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed UserInstance
|
||||
*/
|
||||
fetch(callback?: (error: Error | null, item?: UserInstance) => any): Promise<UserInstance>;
|
||||
/**
|
||||
* Fetch a UserInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed UserInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<UserInstance>) => any): Promise<ApiResponse<UserInstance>>;
|
||||
/**
|
||||
* Update a UserInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed UserInstance
|
||||
*/
|
||||
update(callback?: (error: Error | null, item?: UserInstance) => any): Promise<UserInstance>;
|
||||
/**
|
||||
* Update a UserInstance
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed UserInstance
|
||||
*/
|
||||
update(params: UserContextUpdateOptions, callback?: (error: Error | null, item?: UserInstance) => any): Promise<UserInstance>;
|
||||
/**
|
||||
* Update a UserInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed UserInstance with HTTP metadata
|
||||
*/
|
||||
updateWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<UserInstance>) => any): Promise<ApiResponse<UserInstance>>;
|
||||
/**
|
||||
* Update a UserInstance and return HTTP info
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed UserInstance with HTTP metadata
|
||||
*/
|
||||
updateWithHttpInfo(params: UserContextUpdateOptions, callback?: (error: Error | null, item?: ApiResponse<UserInstance>) => any): Promise<ApiResponse<UserInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): {
|
||||
sid: string;
|
||||
identity: string;
|
||||
friendlyName: string;
|
||||
avatar: string;
|
||||
state: UserStateType;
|
||||
isAvailable: boolean;
|
||||
url: string;
|
||||
};
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export interface UserSolution {
|
||||
}
|
||||
export interface UserListInstance {
|
||||
_version: V1;
|
||||
_solution: UserSolution;
|
||||
_uri: string;
|
||||
(sid: string): UserContext;
|
||||
get(sid: string): UserContext;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export declare function UserListInstance(version: V1): UserListInstance;
|
||||
export {};
|
||||
223
node_modules/twilio/lib/rest/frontlineApi/v1/user.js
generated
vendored
Normal file
223
node_modules/twilio/lib/rest/frontlineApi/v1/user.js
generated
vendored
Normal file
@@ -0,0 +1,223 @@
|
||||
"use strict";
|
||||
/*
|
||||
* This code was generated by
|
||||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
||||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
||||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
||||
*
|
||||
* Twilio - Frontline
|
||||
* 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.
|
||||
*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.UserInstance = exports.UserContextImpl = void 0;
|
||||
exports.UserListInstance = UserListInstance;
|
||||
const util_1 = require("util");
|
||||
const deserialize = require("../../../base/deserialize");
|
||||
const serialize = require("../../../base/serialize");
|
||||
const utility_1 = require("../../../base/utility");
|
||||
class UserContextImpl {
|
||||
constructor(_version, sid) {
|
||||
this._version = _version;
|
||||
if (!(0, utility_1.isValidPathParam)(sid)) {
|
||||
throw new Error("Parameter 'sid' is not valid.");
|
||||
}
|
||||
this._solution = { sid };
|
||||
this._uri = `/Users/${sid}`;
|
||||
}
|
||||
fetch(callback) {
|
||||
const headers = {};
|
||||
headers["Accept"] = "application/json";
|
||||
const instance = this;
|
||||
let operationVersion = instance._version, operationPromise = operationVersion.fetch({
|
||||
uri: instance._uri,
|
||||
method: "get",
|
||||
headers,
|
||||
});
|
||||
operationPromise = operationPromise.then((payload) => new UserInstance(operationVersion, payload, instance._solution.sid));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
}
|
||||
fetchWithHttpInfo(callback) {
|
||||
const headers = {};
|
||||
headers["Accept"] = "application/json";
|
||||
const instance = this;
|
||||
let operationVersion = instance._version;
|
||||
// CREATE, FETCH, UPDATE operations
|
||||
let operationPromise = operationVersion
|
||||
.fetchWithResponseInfo({
|
||||
uri: instance._uri,
|
||||
method: "get",
|
||||
headers,
|
||||
})
|
||||
.then((response) => ({
|
||||
...response,
|
||||
body: new UserInstance(operationVersion, response.body, instance._solution.sid),
|
||||
}));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
}
|
||||
update(params, callback) {
|
||||
if (params instanceof Function) {
|
||||
callback = params;
|
||||
params = {};
|
||||
}
|
||||
else {
|
||||
params = params || {};
|
||||
}
|
||||
let data = {};
|
||||
if (params["friendlyName"] !== undefined)
|
||||
data["FriendlyName"] = params["friendlyName"];
|
||||
if (params["avatar"] !== undefined)
|
||||
data["Avatar"] = params["avatar"];
|
||||
if (params["state"] !== undefined)
|
||||
data["State"] = params["state"];
|
||||
if (params["isAvailable"] !== undefined)
|
||||
data["IsAvailable"] = serialize.bool(params["isAvailable"]);
|
||||
const headers = {};
|
||||
headers["Content-Type"] = "application/x-www-form-urlencoded";
|
||||
headers["Accept"] = "application/json";
|
||||
const instance = this;
|
||||
let operationVersion = instance._version, operationPromise = operationVersion.update({
|
||||
uri: instance._uri,
|
||||
method: "post",
|
||||
data,
|
||||
headers,
|
||||
});
|
||||
operationPromise = operationPromise.then((payload) => new UserInstance(operationVersion, payload, instance._solution.sid));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
}
|
||||
updateWithHttpInfo(params, callback) {
|
||||
if (params instanceof Function) {
|
||||
callback = params;
|
||||
params = {};
|
||||
}
|
||||
else {
|
||||
params = params || {};
|
||||
}
|
||||
let data = {};
|
||||
if (params["friendlyName"] !== undefined)
|
||||
data["FriendlyName"] = params["friendlyName"];
|
||||
if (params["avatar"] !== undefined)
|
||||
data["Avatar"] = params["avatar"];
|
||||
if (params["state"] !== undefined)
|
||||
data["State"] = params["state"];
|
||||
if (params["isAvailable"] !== undefined)
|
||||
data["IsAvailable"] = serialize.bool(params["isAvailable"]);
|
||||
const headers = {};
|
||||
headers["Content-Type"] = "application/x-www-form-urlencoded";
|
||||
headers["Accept"] = "application/json";
|
||||
const instance = this;
|
||||
let operationVersion = instance._version;
|
||||
// CREATE, FETCH, UPDATE operations
|
||||
let operationPromise = operationVersion
|
||||
.updateWithResponseInfo({
|
||||
uri: instance._uri,
|
||||
method: "post",
|
||||
data,
|
||||
headers,
|
||||
})
|
||||
.then((response) => ({
|
||||
...response,
|
||||
body: new UserInstance(operationVersion, response.body, instance._solution.sid),
|
||||
}));
|
||||
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.UserContextImpl = UserContextImpl;
|
||||
class UserInstance {
|
||||
constructor(_version, payload, sid) {
|
||||
this._version = _version;
|
||||
this.sid = payload.sid;
|
||||
this.identity = payload.identity;
|
||||
this.friendlyName = payload.friendly_name;
|
||||
this.avatar = payload.avatar;
|
||||
this.state = payload.state;
|
||||
this.isAvailable = payload.is_available;
|
||||
this.url = payload.url;
|
||||
this._solution = { sid: sid || this.sid };
|
||||
}
|
||||
get _proxy() {
|
||||
this._context =
|
||||
this._context || new UserContextImpl(this._version, this._solution.sid);
|
||||
return this._context;
|
||||
}
|
||||
/**
|
||||
* Fetch a UserInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed UserInstance
|
||||
*/
|
||||
fetch(callback) {
|
||||
return this._proxy.fetch(callback);
|
||||
}
|
||||
/**
|
||||
* Fetch a UserInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed UserInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback) {
|
||||
return this._proxy.fetchWithHttpInfo(callback);
|
||||
}
|
||||
update(params, callback) {
|
||||
return this._proxy.update(params, callback);
|
||||
}
|
||||
updateWithHttpInfo(params, callback) {
|
||||
return this._proxy.updateWithHttpInfo(params, callback);
|
||||
}
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON() {
|
||||
return {
|
||||
sid: this.sid,
|
||||
identity: this.identity,
|
||||
friendlyName: this.friendlyName,
|
||||
avatar: this.avatar,
|
||||
state: this.state,
|
||||
isAvailable: this.isAvailable,
|
||||
url: this.url,
|
||||
};
|
||||
}
|
||||
[util_1.inspect.custom](_depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.UserInstance = UserInstance;
|
||||
function UserListInstance(version) {
|
||||
const instance = ((sid) => instance.get(sid));
|
||||
instance.get = function get(sid) {
|
||||
return new UserContextImpl(version, sid);
|
||||
};
|
||||
instance._version = version;
|
||||
instance._solution = {};
|
||||
instance._uri = ``;
|
||||
instance.toJSON = function toJSON() {
|
||||
return instance._solution;
|
||||
};
|
||||
instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
|
||||
return (0, util_1.inspect)(instance.toJSON(), options);
|
||||
};
|
||||
return instance;
|
||||
}
|
||||
Reference in New Issue
Block a user