Auto-commit 2026-04-29 16:31
This commit is contained in:
20
node_modules/twilio/lib/rest/oauth/V1.d.ts
generated
vendored
Normal file
20
node_modules/twilio/lib/rest/oauth/V1.d.ts
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
import OauthBase from "../OauthBase";
|
||||
import Version from "../../base/Version";
|
||||
import { AuthorizeListInstance } from "./v1/authorize";
|
||||
import { TokenListInstance } from "./v1/token";
|
||||
export default class V1 extends Version {
|
||||
/**
|
||||
* Initialize the V1 version of Oauth
|
||||
*
|
||||
* @param domain - The Twilio (Twilio.Oauth) domain
|
||||
*/
|
||||
constructor(domain: OauthBase);
|
||||
/** authorize - { Twilio.Oauth.V1.AuthorizeListInstance } resource */
|
||||
protected _authorize?: AuthorizeListInstance;
|
||||
/** token - { Twilio.Oauth.V1.TokenListInstance } resource */
|
||||
protected _token?: TokenListInstance;
|
||||
/** Getter for authorize resource */
|
||||
get authorize(): AuthorizeListInstance;
|
||||
/** Getter for token resource */
|
||||
get token(): TokenListInstance;
|
||||
}
|
||||
42
node_modules/twilio/lib/rest/oauth/V1.js
generated
vendored
Normal file
42
node_modules/twilio/lib/rest/oauth/V1.js
generated
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
"use strict";
|
||||
/*
|
||||
* This code was generated by
|
||||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
||||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
||||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
||||
*
|
||||
* Twilio - Oauth
|
||||
* 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 authorize_1 = require("./v1/authorize");
|
||||
const token_1 = require("./v1/token");
|
||||
class V1 extends Version_1.default {
|
||||
/**
|
||||
* Initialize the V1 version of Oauth
|
||||
*
|
||||
* @param domain - The Twilio (Twilio.Oauth) domain
|
||||
*/
|
||||
constructor(domain) {
|
||||
super(domain, "v1");
|
||||
}
|
||||
/** Getter for authorize resource */
|
||||
get authorize() {
|
||||
this._authorize = this._authorize || (0, authorize_1.AuthorizeListInstance)(this);
|
||||
return this._authorize;
|
||||
}
|
||||
/** Getter for token resource */
|
||||
get token() {
|
||||
this._token = this._token || (0, token_1.TokenListInstance)(this);
|
||||
return this._token;
|
||||
}
|
||||
}
|
||||
exports.default = V1;
|
||||
20
node_modules/twilio/lib/rest/oauth/V2.d.ts
generated
vendored
Normal file
20
node_modules/twilio/lib/rest/oauth/V2.d.ts
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
import OauthBase from "../OauthBase";
|
||||
import Version from "../../base/Version";
|
||||
import { AuthorizeListInstance } from "./v2/authorize";
|
||||
import { TokenListInstance } from "./v2/token";
|
||||
export default class V2 extends Version {
|
||||
/**
|
||||
* Initialize the V2 version of Oauth
|
||||
*
|
||||
* @param domain - The Twilio (Twilio.Oauth) domain
|
||||
*/
|
||||
constructor(domain: OauthBase);
|
||||
/** authorize - { Twilio.Oauth.V2.AuthorizeListInstance } resource */
|
||||
protected _authorize?: AuthorizeListInstance;
|
||||
/** token - { Twilio.Oauth.V2.TokenListInstance } resource */
|
||||
protected _token?: TokenListInstance;
|
||||
/** Getter for authorize resource */
|
||||
get authorize(): AuthorizeListInstance;
|
||||
/** Getter for token resource */
|
||||
get token(): TokenListInstance;
|
||||
}
|
||||
42
node_modules/twilio/lib/rest/oauth/V2.js
generated
vendored
Normal file
42
node_modules/twilio/lib/rest/oauth/V2.js
generated
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
"use strict";
|
||||
/*
|
||||
* This code was generated by
|
||||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
||||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
||||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
||||
*
|
||||
* User OAuth API
|
||||
* User OAuth 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 authorize_1 = require("./v2/authorize");
|
||||
const token_1 = require("./v2/token");
|
||||
class V2 extends Version_1.default {
|
||||
/**
|
||||
* Initialize the V2 version of Oauth
|
||||
*
|
||||
* @param domain - The Twilio (Twilio.Oauth) domain
|
||||
*/
|
||||
constructor(domain) {
|
||||
super(domain, "v2");
|
||||
}
|
||||
/** Getter for authorize resource */
|
||||
get authorize() {
|
||||
this._authorize = this._authorize || (0, authorize_1.AuthorizeListInstance)(this);
|
||||
return this._authorize;
|
||||
}
|
||||
/** Getter for token resource */
|
||||
get token() {
|
||||
this._token = this._token || (0, token_1.TokenListInstance)(this);
|
||||
return this._token;
|
||||
}
|
||||
}
|
||||
exports.default = V2;
|
||||
86
node_modules/twilio/lib/rest/oauth/v1/authorize.d.ts
generated
vendored
Normal file
86
node_modules/twilio/lib/rest/oauth/v1/authorize.d.ts
generated
vendored
Normal file
@@ -0,0 +1,86 @@
|
||||
import { inspect, InspectOptions } from "util";
|
||||
import V1 from "../V1";
|
||||
import { ApiResponse } from "../../../base/ApiResponse";
|
||||
/**
|
||||
* Options to pass to fetch a AuthorizeInstance
|
||||
*/
|
||||
export interface AuthorizeListInstanceFetchOptions {
|
||||
/** Response Type */
|
||||
responseType?: string;
|
||||
/** The Client Identifier */
|
||||
clientId?: string;
|
||||
/** The url to which response will be redirected to */
|
||||
redirectUri?: string;
|
||||
/** The scope of the access request */
|
||||
scope?: string;
|
||||
/** An opaque value which can be used to maintain state between the request and callback */
|
||||
state?: string;
|
||||
}
|
||||
export interface AuthorizeSolution {
|
||||
}
|
||||
export interface AuthorizeListInstance {
|
||||
_version: V1;
|
||||
_solution: AuthorizeSolution;
|
||||
_uri: string;
|
||||
/**
|
||||
* Fetch a AuthorizeInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed AuthorizeInstance
|
||||
*/
|
||||
fetch(callback?: (error: Error | null, item?: AuthorizeInstance) => any): Promise<AuthorizeInstance>;
|
||||
/**
|
||||
* Fetch a AuthorizeInstance
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed AuthorizeInstance
|
||||
*/
|
||||
fetch(params: AuthorizeListInstanceFetchOptions, callback?: (error: Error | null, item?: AuthorizeInstance) => any): Promise<AuthorizeInstance>;
|
||||
/**
|
||||
* Fetch a AuthorizeInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed AuthorizeInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<AuthorizeInstance>) => any): Promise<ApiResponse<AuthorizeInstance>>;
|
||||
/**
|
||||
* Fetch a AuthorizeInstance and return HTTP info
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed AuthorizeInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(params: AuthorizeListInstanceFetchOptions, callback?: (error: Error | null, item?: ApiResponse<AuthorizeInstance>) => any): Promise<ApiResponse<AuthorizeInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export declare function AuthorizeListInstance(version: V1): AuthorizeListInstance;
|
||||
interface AuthorizeResource {
|
||||
redirect_to: string;
|
||||
}
|
||||
export declare class AuthorizeInstance {
|
||||
protected _version: V1;
|
||||
constructor(_version: V1, payload: AuthorizeResource);
|
||||
/**
|
||||
* The callback URL
|
||||
*/
|
||||
redirectTo: string;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): {
|
||||
redirectTo: string;
|
||||
};
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export {};
|
||||
121
node_modules/twilio/lib/rest/oauth/v1/authorize.js
generated
vendored
Normal file
121
node_modules/twilio/lib/rest/oauth/v1/authorize.js
generated
vendored
Normal file
@@ -0,0 +1,121 @@
|
||||
"use strict";
|
||||
/*
|
||||
* This code was generated by
|
||||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
||||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
||||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
||||
*
|
||||
* Twilio - Oauth
|
||||
* 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.AuthorizeInstance = void 0;
|
||||
exports.AuthorizeListInstance = AuthorizeListInstance;
|
||||
const util_1 = require("util");
|
||||
const deserialize = require("../../../base/deserialize");
|
||||
const serialize = require("../../../base/serialize");
|
||||
function AuthorizeListInstance(version) {
|
||||
const instance = {};
|
||||
instance._version = version;
|
||||
instance._solution = {};
|
||||
instance._uri = `/authorize`;
|
||||
instance.fetch = function fetch(params, callback) {
|
||||
if (params instanceof Function) {
|
||||
callback = params;
|
||||
params = {};
|
||||
}
|
||||
else {
|
||||
params = params || {};
|
||||
}
|
||||
let data = {};
|
||||
if (params["responseType"] !== undefined)
|
||||
data["ResponseType"] = params["responseType"];
|
||||
if (params["clientId"] !== undefined)
|
||||
data["ClientId"] = params["clientId"];
|
||||
if (params["redirectUri"] !== undefined)
|
||||
data["RedirectUri"] = params["redirectUri"];
|
||||
if (params["scope"] !== undefined)
|
||||
data["Scope"] = params["scope"];
|
||||
if (params["state"] !== undefined)
|
||||
data["State"] = params["state"];
|
||||
const headers = {};
|
||||
headers["Accept"] = "application/json";
|
||||
let operationVersion = version, operationPromise = operationVersion.fetch({
|
||||
uri: instance._uri,
|
||||
method: "get",
|
||||
params: data,
|
||||
headers,
|
||||
});
|
||||
operationPromise = operationPromise.then((payload) => new AuthorizeInstance(operationVersion, payload));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
};
|
||||
instance.fetchWithHttpInfo = function fetchWithHttpInfo(params, callback) {
|
||||
if (params instanceof Function) {
|
||||
callback = params;
|
||||
params = {};
|
||||
}
|
||||
else {
|
||||
params = params || {};
|
||||
}
|
||||
let data = {};
|
||||
if (params["responseType"] !== undefined)
|
||||
data["ResponseType"] = params["responseType"];
|
||||
if (params["clientId"] !== undefined)
|
||||
data["ClientId"] = params["clientId"];
|
||||
if (params["redirectUri"] !== undefined)
|
||||
data["RedirectUri"] = params["redirectUri"];
|
||||
if (params["scope"] !== undefined)
|
||||
data["Scope"] = params["scope"];
|
||||
if (params["state"] !== undefined)
|
||||
data["State"] = params["state"];
|
||||
const headers = {};
|
||||
headers["Accept"] = "application/json";
|
||||
let operationVersion = version;
|
||||
// CREATE, FETCH, UPDATE operations
|
||||
let operationPromise = operationVersion
|
||||
.fetchWithResponseInfo({
|
||||
uri: instance._uri,
|
||||
method: "get",
|
||||
params: data,
|
||||
headers,
|
||||
})
|
||||
.then((response) => ({
|
||||
...response,
|
||||
body: new AuthorizeInstance(operationVersion, response.body),
|
||||
}));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
};
|
||||
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;
|
||||
}
|
||||
class AuthorizeInstance {
|
||||
constructor(_version, payload) {
|
||||
this._version = _version;
|
||||
this.redirectTo = payload.redirect_to;
|
||||
}
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON() {
|
||||
return {
|
||||
redirectTo: this.redirectTo,
|
||||
};
|
||||
}
|
||||
[util_1.inspect.custom](_depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.AuthorizeInstance = AuthorizeInstance;
|
||||
97
node_modules/twilio/lib/rest/oauth/v1/token.d.ts
generated
vendored
Normal file
97
node_modules/twilio/lib/rest/oauth/v1/token.d.ts
generated
vendored
Normal file
@@ -0,0 +1,97 @@
|
||||
import { inspect, InspectOptions } from "util";
|
||||
import V1 from "../V1";
|
||||
import { ApiResponse } from "../../../base/ApiResponse";
|
||||
/**
|
||||
* Options to pass to create a TokenInstance
|
||||
*/
|
||||
export interface TokenListInstanceCreateOptions {
|
||||
/** Grant type is a credential representing resource owner\\\'s authorization which can be used by client to obtain access token. */
|
||||
grantType: string;
|
||||
/** A 34 character string that uniquely identifies this OAuth App. */
|
||||
clientId: string;
|
||||
/** The credential for confidential OAuth App. */
|
||||
clientSecret?: string;
|
||||
/** JWT token related to the authorization code grant type. */
|
||||
code?: string;
|
||||
/** The redirect uri */
|
||||
redirectUri?: string;
|
||||
/** The targeted audience uri */
|
||||
audience?: string;
|
||||
/** JWT token related to refresh access token. */
|
||||
refreshToken?: string;
|
||||
/** The scope of token */
|
||||
scope?: string;
|
||||
}
|
||||
export interface TokenSolution {
|
||||
}
|
||||
export interface TokenListInstance {
|
||||
_version: V1;
|
||||
_solution: TokenSolution;
|
||||
_uri: string;
|
||||
/**
|
||||
* Create a TokenInstance
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed TokenInstance
|
||||
*/
|
||||
create(params: TokenListInstanceCreateOptions, callback?: (error: Error | null, item?: TokenInstance) => any): Promise<TokenInstance>;
|
||||
/**
|
||||
* Create a TokenInstance and return HTTP info
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed TokenInstance with HTTP metadata
|
||||
*/
|
||||
createWithHttpInfo(params: TokenListInstanceCreateOptions, callback?: (error: Error | null, item?: ApiResponse<TokenInstance>) => any): Promise<ApiResponse<TokenInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export declare function TokenListInstance(version: V1): TokenListInstance;
|
||||
interface TokenResource {
|
||||
access_token: string;
|
||||
refresh_token: string;
|
||||
id_token: string;
|
||||
token_type: string;
|
||||
expires_in: number;
|
||||
}
|
||||
export declare class TokenInstance {
|
||||
protected _version: V1;
|
||||
constructor(_version: V1, payload: TokenResource);
|
||||
/**
|
||||
* Token which carries the necessary information to access a Twilio resource directly.
|
||||
*/
|
||||
accessToken: string;
|
||||
/**
|
||||
* Token which carries the information necessary to get a new access token.
|
||||
*/
|
||||
refreshToken: string;
|
||||
/**
|
||||
* Token which carries the information necessary of user profile.
|
||||
*/
|
||||
idToken: string;
|
||||
/**
|
||||
* Token type
|
||||
*/
|
||||
tokenType: string;
|
||||
expiresIn: number;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): {
|
||||
accessToken: string;
|
||||
refreshToken: string;
|
||||
idToken: string;
|
||||
tokenType: string;
|
||||
expiresIn: number;
|
||||
};
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export {};
|
||||
143
node_modules/twilio/lib/rest/oauth/v1/token.js
generated
vendored
Normal file
143
node_modules/twilio/lib/rest/oauth/v1/token.js
generated
vendored
Normal file
@@ -0,0 +1,143 @@
|
||||
"use strict";
|
||||
/*
|
||||
* This code was generated by
|
||||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
||||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
||||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
||||
*
|
||||
* Twilio - Oauth
|
||||
* 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.TokenInstance = void 0;
|
||||
exports.TokenListInstance = TokenListInstance;
|
||||
const util_1 = require("util");
|
||||
const deserialize = require("../../../base/deserialize");
|
||||
const serialize = require("../../../base/serialize");
|
||||
function TokenListInstance(version) {
|
||||
const instance = {};
|
||||
instance._version = version;
|
||||
instance._solution = {};
|
||||
instance._uri = `/token`;
|
||||
instance.create = function create(params, callback) {
|
||||
if (params === null || params === undefined) {
|
||||
throw new Error('Required parameter "params" missing.');
|
||||
}
|
||||
if (params["grantType"] === null || params["grantType"] === undefined) {
|
||||
throw new Error("Required parameter \"params['grantType']\" missing.");
|
||||
}
|
||||
if (params["clientId"] === null || params["clientId"] === undefined) {
|
||||
throw new Error("Required parameter \"params['clientId']\" missing.");
|
||||
}
|
||||
let data = {};
|
||||
data["GrantType"] = params["grantType"];
|
||||
data["ClientId"] = params["clientId"];
|
||||
if (params["clientSecret"] !== undefined)
|
||||
data["ClientSecret"] = params["clientSecret"];
|
||||
if (params["code"] !== undefined)
|
||||
data["Code"] = params["code"];
|
||||
if (params["redirectUri"] !== undefined)
|
||||
data["RedirectUri"] = params["redirectUri"];
|
||||
if (params["audience"] !== undefined)
|
||||
data["Audience"] = params["audience"];
|
||||
if (params["refreshToken"] !== undefined)
|
||||
data["RefreshToken"] = params["refreshToken"];
|
||||
if (params["scope"] !== undefined)
|
||||
data["Scope"] = params["scope"];
|
||||
const headers = {};
|
||||
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 TokenInstance(operationVersion, payload));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
};
|
||||
instance.createWithHttpInfo = function createWithHttpInfo(params, callback) {
|
||||
if (params === null || params === undefined) {
|
||||
throw new Error('Required parameter "params" missing.');
|
||||
}
|
||||
if (params["grantType"] === null || params["grantType"] === undefined) {
|
||||
throw new Error("Required parameter \"params['grantType']\" missing.");
|
||||
}
|
||||
if (params["clientId"] === null || params["clientId"] === undefined) {
|
||||
throw new Error("Required parameter \"params['clientId']\" missing.");
|
||||
}
|
||||
let data = {};
|
||||
data["GrantType"] = params["grantType"];
|
||||
data["ClientId"] = params["clientId"];
|
||||
if (params["clientSecret"] !== undefined)
|
||||
data["ClientSecret"] = params["clientSecret"];
|
||||
if (params["code"] !== undefined)
|
||||
data["Code"] = params["code"];
|
||||
if (params["redirectUri"] !== undefined)
|
||||
data["RedirectUri"] = params["redirectUri"];
|
||||
if (params["audience"] !== undefined)
|
||||
data["Audience"] = params["audience"];
|
||||
if (params["refreshToken"] !== undefined)
|
||||
data["RefreshToken"] = params["refreshToken"];
|
||||
if (params["scope"] !== undefined)
|
||||
data["Scope"] = params["scope"];
|
||||
const headers = {};
|
||||
headers["Content-Type"] = "application/x-www-form-urlencoded";
|
||||
headers["Accept"] = "application/json";
|
||||
let operationVersion = version;
|
||||
// CREATE, FETCH, UPDATE operations
|
||||
let operationPromise = operationVersion
|
||||
.createWithResponseInfo({
|
||||
uri: instance._uri,
|
||||
method: "post",
|
||||
data,
|
||||
headers,
|
||||
})
|
||||
.then((response) => ({
|
||||
...response,
|
||||
body: new TokenInstance(operationVersion, response.body),
|
||||
}));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
};
|
||||
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;
|
||||
}
|
||||
class TokenInstance {
|
||||
constructor(_version, payload) {
|
||||
this._version = _version;
|
||||
this.accessToken = payload.access_token;
|
||||
this.refreshToken = payload.refresh_token;
|
||||
this.idToken = payload.id_token;
|
||||
this.tokenType = payload.token_type;
|
||||
this.expiresIn = payload.expires_in;
|
||||
}
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON() {
|
||||
return {
|
||||
accessToken: this.accessToken,
|
||||
refreshToken: this.refreshToken,
|
||||
idToken: this.idToken,
|
||||
tokenType: this.tokenType,
|
||||
expiresIn: this.expiresIn,
|
||||
};
|
||||
}
|
||||
[util_1.inspect.custom](_depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.TokenInstance = TokenInstance;
|
||||
86
node_modules/twilio/lib/rest/oauth/v2/authorize.d.ts
generated
vendored
Normal file
86
node_modules/twilio/lib/rest/oauth/v2/authorize.d.ts
generated
vendored
Normal file
@@ -0,0 +1,86 @@
|
||||
import { inspect, InspectOptions } from "util";
|
||||
import V2 from "../V2";
|
||||
import { ApiResponse } from "../../../base/ApiResponse";
|
||||
/**
|
||||
* Options to pass to fetch a AuthorizeInstance
|
||||
*/
|
||||
export interface AuthorizeListInstanceFetchOptions {
|
||||
/** */
|
||||
responseType?: string;
|
||||
/** */
|
||||
clientId?: string;
|
||||
/** */
|
||||
redirectUri?: string;
|
||||
/** */
|
||||
scope?: string;
|
||||
/** */
|
||||
state?: string;
|
||||
}
|
||||
export interface AuthorizeSolution {
|
||||
}
|
||||
export interface AuthorizeListInstance {
|
||||
_version: V2;
|
||||
_solution: AuthorizeSolution;
|
||||
_uri: string;
|
||||
/**
|
||||
* Fetch a AuthorizeInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed AuthorizeInstance
|
||||
*/
|
||||
fetch(callback?: (error: Error | null, item?: AuthorizeInstance) => any): Promise<AuthorizeInstance>;
|
||||
/**
|
||||
* Fetch a AuthorizeInstance
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed AuthorizeInstance
|
||||
*/
|
||||
fetch(params: AuthorizeListInstanceFetchOptions, callback?: (error: Error | null, item?: AuthorizeInstance) => any): Promise<AuthorizeInstance>;
|
||||
/**
|
||||
* Fetch a AuthorizeInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed AuthorizeInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<AuthorizeInstance>) => any): Promise<ApiResponse<AuthorizeInstance>>;
|
||||
/**
|
||||
* Fetch a AuthorizeInstance and return HTTP info
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed AuthorizeInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(params: AuthorizeListInstanceFetchOptions, callback?: (error: Error | null, item?: ApiResponse<AuthorizeInstance>) => any): Promise<ApiResponse<AuthorizeInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export declare function AuthorizeListInstance(version: V2): AuthorizeListInstance;
|
||||
interface AuthorizeResource {
|
||||
redirect_to: string;
|
||||
}
|
||||
export declare class AuthorizeInstance {
|
||||
protected _version: V2;
|
||||
constructor(_version: V2, payload: AuthorizeResource);
|
||||
/**
|
||||
* The callback URL
|
||||
*/
|
||||
redirectTo: string;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): {
|
||||
redirectTo: string;
|
||||
};
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export {};
|
||||
121
node_modules/twilio/lib/rest/oauth/v2/authorize.js
generated
vendored
Normal file
121
node_modules/twilio/lib/rest/oauth/v2/authorize.js
generated
vendored
Normal file
@@ -0,0 +1,121 @@
|
||||
"use strict";
|
||||
/*
|
||||
* This code was generated by
|
||||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
||||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
||||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
||||
*
|
||||
* User OAuth API
|
||||
* User OAuth 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.AuthorizeInstance = void 0;
|
||||
exports.AuthorizeListInstance = AuthorizeListInstance;
|
||||
const util_1 = require("util");
|
||||
const deserialize = require("../../../base/deserialize");
|
||||
const serialize = require("../../../base/serialize");
|
||||
function AuthorizeListInstance(version) {
|
||||
const instance = {};
|
||||
instance._version = version;
|
||||
instance._solution = {};
|
||||
instance._uri = `/authorize`;
|
||||
instance.fetch = function fetch(params, callback) {
|
||||
if (params instanceof Function) {
|
||||
callback = params;
|
||||
params = {};
|
||||
}
|
||||
else {
|
||||
params = params || {};
|
||||
}
|
||||
let data = {};
|
||||
if (params["responseType"] !== undefined)
|
||||
data["response_type"] = params["responseType"];
|
||||
if (params["clientId"] !== undefined)
|
||||
data["client_id"] = params["clientId"];
|
||||
if (params["redirectUri"] !== undefined)
|
||||
data["redirect_uri"] = params["redirectUri"];
|
||||
if (params["scope"] !== undefined)
|
||||
data["scope"] = params["scope"];
|
||||
if (params["state"] !== undefined)
|
||||
data["state"] = params["state"];
|
||||
const headers = {};
|
||||
headers["Accept"] = "application/json";
|
||||
let operationVersion = version, operationPromise = operationVersion.fetch({
|
||||
uri: instance._uri,
|
||||
method: "get",
|
||||
params: data,
|
||||
headers,
|
||||
});
|
||||
operationPromise = operationPromise.then((payload) => new AuthorizeInstance(operationVersion, payload));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
};
|
||||
instance.fetchWithHttpInfo = function fetchWithHttpInfo(params, callback) {
|
||||
if (params instanceof Function) {
|
||||
callback = params;
|
||||
params = {};
|
||||
}
|
||||
else {
|
||||
params = params || {};
|
||||
}
|
||||
let data = {};
|
||||
if (params["responseType"] !== undefined)
|
||||
data["response_type"] = params["responseType"];
|
||||
if (params["clientId"] !== undefined)
|
||||
data["client_id"] = params["clientId"];
|
||||
if (params["redirectUri"] !== undefined)
|
||||
data["redirect_uri"] = params["redirectUri"];
|
||||
if (params["scope"] !== undefined)
|
||||
data["scope"] = params["scope"];
|
||||
if (params["state"] !== undefined)
|
||||
data["state"] = params["state"];
|
||||
const headers = {};
|
||||
headers["Accept"] = "application/json";
|
||||
let operationVersion = version;
|
||||
// CREATE, FETCH, UPDATE operations
|
||||
let operationPromise = operationVersion
|
||||
.fetchWithResponseInfo({
|
||||
uri: instance._uri,
|
||||
method: "get",
|
||||
params: data,
|
||||
headers,
|
||||
})
|
||||
.then((response) => ({
|
||||
...response,
|
||||
body: new AuthorizeInstance(operationVersion, response.body),
|
||||
}));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
};
|
||||
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;
|
||||
}
|
||||
class AuthorizeInstance {
|
||||
constructor(_version, payload) {
|
||||
this._version = _version;
|
||||
this.redirectTo = payload.redirect_to;
|
||||
}
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON() {
|
||||
return {
|
||||
redirectTo: this.redirectTo,
|
||||
};
|
||||
}
|
||||
[util_1.inspect.custom](_depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.AuthorizeInstance = AuthorizeInstance;
|
||||
115
node_modules/twilio/lib/rest/oauth/v2/token.d.ts
generated
vendored
Normal file
115
node_modules/twilio/lib/rest/oauth/v2/token.d.ts
generated
vendored
Normal file
@@ -0,0 +1,115 @@
|
||||
import { inspect, InspectOptions } from "util";
|
||||
import V2 from "../V2";
|
||||
import { ApiResponse } from "../../../base/ApiResponse";
|
||||
/**
|
||||
* Options to pass to create a TokenInstance
|
||||
*/
|
||||
export interface TokenListInstanceCreateOptions {
|
||||
/** Optional Account SID to perform on behalf of requests. */
|
||||
accountSid?: string;
|
||||
/** Grant type is a credential representing resource owner\\\'s authorization which can be used by client to obtain access token. */
|
||||
grantType?: string;
|
||||
/** A 34 character string that uniquely identifies this OAuth App. */
|
||||
clientId?: string;
|
||||
/** The credential for confidential OAuth App. */
|
||||
clientSecret?: string;
|
||||
/** JWT token related to the authorization code grant type. */
|
||||
code?: string;
|
||||
/** The redirect uri */
|
||||
redirectUri?: string;
|
||||
/** The targeted audience uri */
|
||||
audience?: string;
|
||||
/** JWT token related to refresh access token. */
|
||||
refreshToken?: string;
|
||||
/** The scope of token */
|
||||
scope?: string;
|
||||
}
|
||||
export interface TokenSolution {
|
||||
}
|
||||
export interface TokenListInstance {
|
||||
_version: V2;
|
||||
_solution: TokenSolution;
|
||||
_uri: string;
|
||||
/**
|
||||
* Create a TokenInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed TokenInstance
|
||||
*/
|
||||
create(callback?: (error: Error | null, item?: TokenInstance) => any): Promise<TokenInstance>;
|
||||
/**
|
||||
* Create a TokenInstance
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed TokenInstance
|
||||
*/
|
||||
create(params: TokenListInstanceCreateOptions, callback?: (error: Error | null, item?: TokenInstance) => any): Promise<TokenInstance>;
|
||||
/**
|
||||
* Create a TokenInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed TokenInstance with HTTP metadata
|
||||
*/
|
||||
createWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<TokenInstance>) => any): Promise<ApiResponse<TokenInstance>>;
|
||||
/**
|
||||
* Create a TokenInstance and return HTTP info
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed TokenInstance with HTTP metadata
|
||||
*/
|
||||
createWithHttpInfo(params: TokenListInstanceCreateOptions, callback?: (error: Error | null, item?: ApiResponse<TokenInstance>) => any): Promise<ApiResponse<TokenInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export declare function TokenListInstance(version: V2): TokenListInstance;
|
||||
interface TokenResource {
|
||||
access_token: string;
|
||||
refresh_token: string;
|
||||
id_token: string;
|
||||
token_type: string;
|
||||
expires_in: number;
|
||||
}
|
||||
export declare class TokenInstance {
|
||||
protected _version: V2;
|
||||
constructor(_version: V2, payload: TokenResource);
|
||||
/**
|
||||
* Token which carries the necessary information to access a Twilio resource directly.
|
||||
*/
|
||||
accessToken: string;
|
||||
/**
|
||||
* Token which carries the information necessary to get a new access token.
|
||||
*/
|
||||
refreshToken: string;
|
||||
/**
|
||||
* Token which carries the information necessary of user profile.
|
||||
*/
|
||||
idToken: string;
|
||||
/**
|
||||
* Token type
|
||||
*/
|
||||
tokenType: string;
|
||||
expiresIn: number;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): {
|
||||
accessToken: string;
|
||||
refreshToken: string;
|
||||
idToken: string;
|
||||
tokenType: string;
|
||||
expiresIn: number;
|
||||
};
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export {};
|
||||
147
node_modules/twilio/lib/rest/oauth/v2/token.js
generated
vendored
Normal file
147
node_modules/twilio/lib/rest/oauth/v2/token.js
generated
vendored
Normal file
@@ -0,0 +1,147 @@
|
||||
"use strict";
|
||||
/*
|
||||
* This code was generated by
|
||||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
||||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
||||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
||||
*
|
||||
* User OAuth API
|
||||
* User OAuth 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.TokenInstance = void 0;
|
||||
exports.TokenListInstance = TokenListInstance;
|
||||
const util_1 = require("util");
|
||||
const deserialize = require("../../../base/deserialize");
|
||||
const serialize = require("../../../base/serialize");
|
||||
function TokenListInstance(version) {
|
||||
const instance = {};
|
||||
instance._version = version;
|
||||
instance._solution = {};
|
||||
instance._uri = `/token`;
|
||||
instance.create = function create(params, callback) {
|
||||
if (params instanceof Function) {
|
||||
callback = params;
|
||||
params = {};
|
||||
}
|
||||
else {
|
||||
params = params || {};
|
||||
}
|
||||
let data = {};
|
||||
if (params["accountSid"] !== undefined)
|
||||
data["account_sid"] = params["accountSid"];
|
||||
if (params["grantType"] !== undefined)
|
||||
data["grant_type"] = params["grantType"];
|
||||
if (params["clientId"] !== undefined)
|
||||
data["client_id"] = params["clientId"];
|
||||
if (params["clientSecret"] !== undefined)
|
||||
data["client_secret"] = params["clientSecret"];
|
||||
if (params["code"] !== undefined)
|
||||
data["code"] = params["code"];
|
||||
if (params["redirectUri"] !== undefined)
|
||||
data["redirect_uri"] = params["redirectUri"];
|
||||
if (params["audience"] !== undefined)
|
||||
data["audience"] = params["audience"];
|
||||
if (params["refreshToken"] !== undefined)
|
||||
data["refresh_token"] = params["refreshToken"];
|
||||
if (params["scope"] !== undefined)
|
||||
data["scope"] = params["scope"];
|
||||
const headers = {};
|
||||
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 TokenInstance(operationVersion, payload));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
};
|
||||
instance.createWithHttpInfo = function createWithHttpInfo(params, callback) {
|
||||
if (params instanceof Function) {
|
||||
callback = params;
|
||||
params = {};
|
||||
}
|
||||
else {
|
||||
params = params || {};
|
||||
}
|
||||
let data = {};
|
||||
if (params["accountSid"] !== undefined)
|
||||
data["account_sid"] = params["accountSid"];
|
||||
if (params["grantType"] !== undefined)
|
||||
data["grant_type"] = params["grantType"];
|
||||
if (params["clientId"] !== undefined)
|
||||
data["client_id"] = params["clientId"];
|
||||
if (params["clientSecret"] !== undefined)
|
||||
data["client_secret"] = params["clientSecret"];
|
||||
if (params["code"] !== undefined)
|
||||
data["code"] = params["code"];
|
||||
if (params["redirectUri"] !== undefined)
|
||||
data["redirect_uri"] = params["redirectUri"];
|
||||
if (params["audience"] !== undefined)
|
||||
data["audience"] = params["audience"];
|
||||
if (params["refreshToken"] !== undefined)
|
||||
data["refresh_token"] = params["refreshToken"];
|
||||
if (params["scope"] !== undefined)
|
||||
data["scope"] = params["scope"];
|
||||
const headers = {};
|
||||
headers["Content-Type"] = "application/x-www-form-urlencoded";
|
||||
headers["Accept"] = "application/json";
|
||||
let operationVersion = version;
|
||||
// CREATE, FETCH, UPDATE operations
|
||||
let operationPromise = operationVersion
|
||||
.createWithResponseInfo({
|
||||
uri: instance._uri,
|
||||
method: "post",
|
||||
data,
|
||||
headers,
|
||||
})
|
||||
.then((response) => ({
|
||||
...response,
|
||||
body: new TokenInstance(operationVersion, response.body),
|
||||
}));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
};
|
||||
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;
|
||||
}
|
||||
class TokenInstance {
|
||||
constructor(_version, payload) {
|
||||
this._version = _version;
|
||||
this.accessToken = payload.access_token;
|
||||
this.refreshToken = payload.refresh_token;
|
||||
this.idToken = payload.id_token;
|
||||
this.tokenType = payload.token_type;
|
||||
this.expiresIn = payload.expires_in;
|
||||
}
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON() {
|
||||
return {
|
||||
accessToken: this.accessToken,
|
||||
refreshToken: this.refreshToken,
|
||||
idToken: this.idToken,
|
||||
tokenType: this.tokenType,
|
||||
expiresIn: this.expiresIn,
|
||||
};
|
||||
}
|
||||
[util_1.inspect.custom](_depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.TokenInstance = TokenInstance;
|
||||
Reference in New Issue
Block a user