@forestvpn/forestvpn_api
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -20,2 +20,3 @@ /* tslint:disable */ | ||
import { LegacyAuthMigrationToken } from '../models'; | ||
import { TokenLogin } from '../models'; | ||
import { TokenObtain } from '../models'; | ||
@@ -31,2 +32,38 @@ import { User } from '../models'; | ||
* | ||
* @summary Login with JWT token | ||
* @param {*} [options] Override http request option. | ||
* @throws {RequiredError} | ||
*/ | ||
loginToken: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => { | ||
const localVarPath = `/auth/token/login/`; | ||
// use dummy base URL string because the URL constructor only accepts absolute URLs. | ||
const localVarUrlObj = new URL(localVarPath, 'https://example.com'); | ||
let baseOptions; | ||
if (configuration) { | ||
baseOptions = configuration.baseOptions; | ||
} | ||
const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options}; | ||
const localVarHeaderParameter = {} as any; | ||
const localVarQueryParameter = {} as any; | ||
// authentication bearerAuth required | ||
const query = new URLSearchParams(localVarUrlObj.search); | ||
for (const key in localVarQueryParameter) { | ||
query.set(key, localVarQueryParameter[key]); | ||
} | ||
for (const key in options.params) { | ||
query.set(key, options.params[key]); | ||
} | ||
localVarUrlObj.search = (new URLSearchParams(query)).toString(); | ||
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; | ||
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; | ||
return { | ||
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, | ||
options: localVarRequestOptions, | ||
}; | ||
}, | ||
/** | ||
* | ||
* @summary Legacy auth migration | ||
@@ -80,3 +117,3 @@ * @param {*} [options] Override http request option. | ||
} | ||
const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options}; | ||
const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options}; | ||
const localVarHeaderParameter = {} as any; | ||
@@ -227,2 +264,15 @@ const localVarQueryParameter = {} as any; | ||
* | ||
* @summary Login with JWT token | ||
* @param {*} [options] Override http request option. | ||
* @throws {RequiredError} | ||
*/ | ||
async loginToken(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<TokenLogin>>> { | ||
const localVarAxiosArgs = await AuthApiAxiosParamCreator(configuration).loginToken(options); | ||
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { | ||
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; | ||
return axios.request(axiosRequestArgs); | ||
}; | ||
}, | ||
/** | ||
* | ||
* @summary Legacy auth migration | ||
@@ -303,2 +353,11 @@ * @param {*} [options] Override http request option. | ||
* | ||
* @summary Login with JWT token | ||
* @param {*} [options] Override http request option. | ||
* @throws {RequiredError} | ||
*/ | ||
async loginToken(options?: AxiosRequestConfig): Promise<AxiosResponse<TokenLogin>> { | ||
return AuthApiFp(configuration).loginToken(options).then((request) => request(axios, basePath)); | ||
}, | ||
/** | ||
* | ||
* @summary Legacy auth migration | ||
@@ -360,2 +419,12 @@ * @param {*} [options] Override http request option. | ||
* | ||
* @summary Login with JWT token | ||
* @param {*} [options] Override http request option. | ||
* @throws {RequiredError} | ||
* @memberof AuthApi | ||
*/ | ||
public async loginToken(options?: AxiosRequestConfig) : Promise<AxiosResponse<TokenLogin>> { | ||
return AuthApiFp(this.configuration).loginToken(options).then((request) => request(this.axios, this.basePath)); | ||
} | ||
/** | ||
* | ||
* @summary Legacy auth migration | ||
@@ -362,0 +431,0 @@ * @param {*} [options] Override http request option. |
@@ -19,2 +19,3 @@ /* tslint:disable */ | ||
import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; | ||
import { Country } from '../models'; | ||
import { Location } from '../models'; | ||
@@ -29,2 +30,38 @@ /** | ||
* | ||
* @summary Countries list | ||
* @param {*} [options] Override http request option. | ||
* @throws {RequiredError} | ||
*/ | ||
listCountries: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => { | ||
const localVarPath = `/geo/countries/`; | ||
// use dummy base URL string because the URL constructor only accepts absolute URLs. | ||
const localVarUrlObj = new URL(localVarPath, 'https://example.com'); | ||
let baseOptions; | ||
if (configuration) { | ||
baseOptions = configuration.baseOptions; | ||
} | ||
const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options}; | ||
const localVarHeaderParameter = {} as any; | ||
const localVarQueryParameter = {} as any; | ||
// authentication bearerAuth required | ||
const query = new URLSearchParams(localVarUrlObj.search); | ||
for (const key in localVarQueryParameter) { | ||
query.set(key, localVarQueryParameter[key]); | ||
} | ||
for (const key in options.params) { | ||
query.set(key, options.params[key]); | ||
} | ||
localVarUrlObj.search = (new URLSearchParams(query)).toString(); | ||
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; | ||
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; | ||
return { | ||
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, | ||
options: localVarRequestOptions, | ||
}; | ||
}, | ||
/** | ||
* | ||
* @summary Location list | ||
@@ -75,2 +112,15 @@ * @param {*} [options] Override http request option. | ||
* | ||
* @summary Countries list | ||
* @param {*} [options] Override http request option. | ||
* @throws {RequiredError} | ||
*/ | ||
async listCountries(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<Array<Country>>>> { | ||
const localVarAxiosArgs = await GeoApiAxiosParamCreator(configuration).listCountries(options); | ||
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { | ||
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; | ||
return axios.request(axiosRequestArgs); | ||
}; | ||
}, | ||
/** | ||
* | ||
* @summary Location list | ||
@@ -98,2 +148,11 @@ * @param {*} [options] Override http request option. | ||
* | ||
* @summary Countries list | ||
* @param {*} [options] Override http request option. | ||
* @throws {RequiredError} | ||
*/ | ||
async listCountries(options?: AxiosRequestConfig): Promise<AxiosResponse<Array<Country>>> { | ||
return GeoApiFp(configuration).listCountries(options).then((request) => request(axios, basePath)); | ||
}, | ||
/** | ||
* | ||
* @summary Location list | ||
@@ -118,2 +177,12 @@ * @param {*} [options] Override http request option. | ||
* | ||
* @summary Countries list | ||
* @param {*} [options] Override http request option. | ||
* @throws {RequiredError} | ||
* @memberof GeoApi | ||
*/ | ||
public async listCountries(options?: AxiosRequestConfig) : Promise<AxiosResponse<Array<Country>>> { | ||
return GeoApiFp(this.configuration).listCountries(options).then((request) => request(this.axios, this.basePath)); | ||
} | ||
/** | ||
* | ||
* @summary Location list | ||
@@ -120,0 +189,0 @@ * @param {*} [options] Override http request option. |
@@ -16,2 +16,3 @@ /** | ||
import { LegacyAuthMigrationToken } from '../models'; | ||
import { TokenLogin } from '../models'; | ||
import { TokenObtain } from '../models'; | ||
@@ -26,2 +27,9 @@ import { User } from '../models'; | ||
* | ||
* @summary Login with JWT token | ||
* @param {*} [options] Override http request option. | ||
* @throws {RequiredError} | ||
*/ | ||
loginToken: (options?: AxiosRequestConfig) => Promise<RequestArgs>; | ||
/** | ||
* | ||
* @summary Legacy auth migration | ||
@@ -69,2 +77,9 @@ * @param {*} [options] Override http request option. | ||
* | ||
* @summary Login with JWT token | ||
* @param {*} [options] Override http request option. | ||
* @throws {RequiredError} | ||
*/ | ||
loginToken(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<TokenLogin>>>; | ||
/** | ||
* | ||
* @summary Legacy auth migration | ||
@@ -112,2 +127,9 @@ * @param {*} [options] Override http request option. | ||
* | ||
* @summary Login with JWT token | ||
* @param {*} [options] Override http request option. | ||
* @throws {RequiredError} | ||
*/ | ||
loginToken(options?: AxiosRequestConfig): Promise<AxiosResponse<TokenLogin>>; | ||
/** | ||
* | ||
* @summary Legacy auth migration | ||
@@ -157,2 +179,10 @@ * @param {*} [options] Override http request option. | ||
* | ||
* @summary Login with JWT token | ||
* @param {*} [options] Override http request option. | ||
* @throws {RequiredError} | ||
* @memberof AuthApi | ||
*/ | ||
loginToken(options?: AxiosRequestConfig): Promise<AxiosResponse<TokenLogin>>; | ||
/** | ||
* | ||
* @summary Legacy auth migration | ||
@@ -159,0 +189,0 @@ * @param {*} [options] Override http request option. |
@@ -90,2 +90,38 @@ "use strict"; | ||
* | ||
* @summary Login with JWT token | ||
* @param {*} [options] Override http request option. | ||
* @throws {RequiredError} | ||
*/ | ||
loginToken: function (options) { | ||
if (options === void 0) { options = {}; } | ||
return __awaiter(_this, void 0, void 0, function () { | ||
var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, query, key, key, headersFromBaseOptions; | ||
return __generator(this, function (_a) { | ||
localVarPath = "/auth/token/login/"; | ||
localVarUrlObj = new URL(localVarPath, 'https://example.com'); | ||
if (configuration) { | ||
baseOptions = configuration.baseOptions; | ||
} | ||
localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options); | ||
localVarHeaderParameter = {}; | ||
localVarQueryParameter = {}; | ||
query = new URLSearchParams(localVarUrlObj.search); | ||
for (key in localVarQueryParameter) { | ||
query.set(key, localVarQueryParameter[key]); | ||
} | ||
for (key in options.params) { | ||
query.set(key, options.params[key]); | ||
} | ||
localVarUrlObj.search = (new URLSearchParams(query)).toString(); | ||
headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; | ||
localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); | ||
return [2 /*return*/, { | ||
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, | ||
options: localVarRequestOptions, | ||
}]; | ||
}); | ||
}); | ||
}, | ||
/** | ||
* | ||
* @summary Legacy auth migration | ||
@@ -141,3 +177,3 @@ * @param {*} [options] Override http request option. | ||
} | ||
localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options); | ||
localVarRequestOptions = __assign(__assign({ method: 'GET' }, baseOptions), options); | ||
localVarHeaderParameter = {}; | ||
@@ -285,2 +321,26 @@ localVarQueryParameter = {}; | ||
* | ||
* @summary Login with JWT token | ||
* @param {*} [options] Override http request option. | ||
* @throws {RequiredError} | ||
*/ | ||
loginToken: function (options) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var localVarAxiosArgs; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, exports.AuthApiAxiosParamCreator(configuration).loginToken(options)]; | ||
case 1: | ||
localVarAxiosArgs = _a.sent(); | ||
return [2 /*return*/, function (axios, basePath) { | ||
if (axios === void 0) { axios = axios_1.default; } | ||
if (basePath === void 0) { basePath = base_1.BASE_PATH; } | ||
var axiosRequestArgs = __assign(__assign({}, localVarAxiosArgs.options), { url: basePath + localVarAxiosArgs.url }); | ||
return axios.request(axiosRequestArgs); | ||
}]; | ||
} | ||
}); | ||
}); | ||
}, | ||
/** | ||
* | ||
* @summary Legacy auth migration | ||
@@ -415,2 +475,15 @@ * @param {*} [options] Override http request option. | ||
* | ||
* @summary Login with JWT token | ||
* @param {*} [options] Override http request option. | ||
* @throws {RequiredError} | ||
*/ | ||
loginToken: function (options) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, exports.AuthApiFp(configuration).loginToken(options).then(function (request) { return request(axios, basePath); })]; | ||
}); | ||
}); | ||
}, | ||
/** | ||
* | ||
* @summary Legacy auth migration | ||
@@ -495,2 +568,17 @@ * @param {*} [options] Override http request option. | ||
* | ||
* @summary Login with JWT token | ||
* @param {*} [options] Override http request option. | ||
* @throws {RequiredError} | ||
* @memberof AuthApi | ||
*/ | ||
AuthApi.prototype.loginToken = function (options) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var _this = this; | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, exports.AuthApiFp(this.configuration).loginToken(options).then(function (request) { return request(_this.axios, _this.basePath); })]; | ||
}); | ||
}); | ||
}; | ||
/** | ||
* | ||
* @summary Legacy auth migration | ||
@@ -497,0 +585,0 @@ * @param {*} [options] Override http request option. |
@@ -15,2 +15,3 @@ /** | ||
import { RequestArgs, BaseAPI } from '../base'; | ||
import { Country } from '../models'; | ||
import { Location } from '../models'; | ||
@@ -24,2 +25,9 @@ /** | ||
* | ||
* @summary Countries list | ||
* @param {*} [options] Override http request option. | ||
* @throws {RequiredError} | ||
*/ | ||
listCountries: (options?: AxiosRequestConfig) => Promise<RequestArgs>; | ||
/** | ||
* | ||
* @summary Location list | ||
@@ -38,2 +46,9 @@ * @param {*} [options] Override http request option. | ||
* | ||
* @summary Countries list | ||
* @param {*} [options] Override http request option. | ||
* @throws {RequiredError} | ||
*/ | ||
listCountries(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<Array<Country>>>>; | ||
/** | ||
* | ||
* @summary Location list | ||
@@ -52,2 +67,9 @@ * @param {*} [options] Override http request option. | ||
* | ||
* @summary Countries list | ||
* @param {*} [options] Override http request option. | ||
* @throws {RequiredError} | ||
*/ | ||
listCountries(options?: AxiosRequestConfig): Promise<AxiosResponse<Array<Country>>>; | ||
/** | ||
* | ||
* @summary Location list | ||
@@ -68,2 +90,10 @@ * @param {*} [options] Override http request option. | ||
* | ||
* @summary Countries list | ||
* @param {*} [options] Override http request option. | ||
* @throws {RequiredError} | ||
* @memberof GeoApi | ||
*/ | ||
listCountries(options?: AxiosRequestConfig): Promise<AxiosResponse<Array<Country>>>; | ||
/** | ||
* | ||
* @summary Location list | ||
@@ -70,0 +100,0 @@ * @param {*} [options] Override http request option. |
@@ -90,2 +90,38 @@ "use strict"; | ||
* | ||
* @summary Countries list | ||
* @param {*} [options] Override http request option. | ||
* @throws {RequiredError} | ||
*/ | ||
listCountries: function (options) { | ||
if (options === void 0) { options = {}; } | ||
return __awaiter(_this, void 0, void 0, function () { | ||
var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, query, key, key, headersFromBaseOptions; | ||
return __generator(this, function (_a) { | ||
localVarPath = "/geo/countries/"; | ||
localVarUrlObj = new URL(localVarPath, 'https://example.com'); | ||
if (configuration) { | ||
baseOptions = configuration.baseOptions; | ||
} | ||
localVarRequestOptions = __assign(__assign({ method: 'GET' }, baseOptions), options); | ||
localVarHeaderParameter = {}; | ||
localVarQueryParameter = {}; | ||
query = new URLSearchParams(localVarUrlObj.search); | ||
for (key in localVarQueryParameter) { | ||
query.set(key, localVarQueryParameter[key]); | ||
} | ||
for (key in options.params) { | ||
query.set(key, options.params[key]); | ||
} | ||
localVarUrlObj.search = (new URLSearchParams(query)).toString(); | ||
headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; | ||
localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); | ||
return [2 /*return*/, { | ||
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, | ||
options: localVarRequestOptions, | ||
}]; | ||
}); | ||
}); | ||
}, | ||
/** | ||
* | ||
* @summary Location list | ||
@@ -135,2 +171,26 @@ * @param {*} [options] Override http request option. | ||
* | ||
* @summary Countries list | ||
* @param {*} [options] Override http request option. | ||
* @throws {RequiredError} | ||
*/ | ||
listCountries: function (options) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var localVarAxiosArgs; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, exports.GeoApiAxiosParamCreator(configuration).listCountries(options)]; | ||
case 1: | ||
localVarAxiosArgs = _a.sent(); | ||
return [2 /*return*/, function (axios, basePath) { | ||
if (axios === void 0) { axios = axios_1.default; } | ||
if (basePath === void 0) { basePath = base_1.BASE_PATH; } | ||
var axiosRequestArgs = __assign(__assign({}, localVarAxiosArgs.options), { url: basePath + localVarAxiosArgs.url }); | ||
return axios.request(axiosRequestArgs); | ||
}]; | ||
} | ||
}); | ||
}); | ||
}, | ||
/** | ||
* | ||
* @summary Location list | ||
@@ -168,2 +228,15 @@ * @param {*} [options] Override http request option. | ||
* | ||
* @summary Countries list | ||
* @param {*} [options] Override http request option. | ||
* @throws {RequiredError} | ||
*/ | ||
listCountries: function (options) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, exports.GeoApiFp(configuration).listCountries(options).then(function (request) { return request(axios, basePath); })]; | ||
}); | ||
}); | ||
}, | ||
/** | ||
* | ||
* @summary Location list | ||
@@ -195,2 +268,17 @@ * @param {*} [options] Override http request option. | ||
* | ||
* @summary Countries list | ||
* @param {*} [options] Override http request option. | ||
* @throws {RequiredError} | ||
* @memberof GeoApi | ||
*/ | ||
GeoApi.prototype.listCountries = function (options) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var _this = this; | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, exports.GeoApiFp(this.configuration).listCountries(options).then(function (request) { return request(_this.axios, _this.basePath); })]; | ||
}); | ||
}); | ||
}; | ||
/** | ||
* | ||
* @summary Location list | ||
@@ -197,0 +285,0 @@ * @param {*} [options] Override http request option. |
@@ -38,2 +38,8 @@ /** | ||
* | ||
* @type {string} | ||
* @memberof Country | ||
*/ | ||
currency_code?: string; | ||
/** | ||
* | ||
* @type {Array<string>} | ||
@@ -40,0 +46,0 @@ * @memberof Country |
@@ -46,2 +46,3 @@ export * from './ad-placement'; | ||
export * from './stripe-checkout-session'; | ||
export * from './token-login'; | ||
export * from './token-obtain'; | ||
@@ -48,0 +49,0 @@ export * from './update-fcmdevice-request'; |
@@ -58,2 +58,3 @@ "use strict"; | ||
__exportStar(require("./stripe-checkout-session"), exports); | ||
__exportStar(require("./token-login"), exports); | ||
__exportStar(require("./token-obtain"), exports); | ||
@@ -60,0 +61,0 @@ __exportStar(require("./update-fcmdevice-request"), exports); |
@@ -40,2 +40,8 @@ /* tslint:disable */ | ||
* | ||
* @type {string} | ||
* @memberof Country | ||
*/ | ||
currency_code?: string; | ||
/** | ||
* | ||
* @type {Array<string>} | ||
@@ -42,0 +48,0 @@ * @memberof Country |
@@ -46,2 +46,3 @@ export * from './ad-placement'; | ||
export * from './stripe-checkout-session'; | ||
export * from './token-login'; | ||
export * from './token-obtain'; | ||
@@ -48,0 +49,0 @@ export * from './update-fcmdevice-request'; |
{ | ||
"name": "@forestvpn/forestvpn_api", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "A package to interact api.forestvpn.com (manage vpn profiles, check usage statistics, manage locations, ...)", | ||
@@ -33,3 +33,3 @@ "author": "ForestVPN", | ||
"@types/node": "^12.11.5", | ||
"typescript": "^3.6.4" | ||
"typescript": "^3.9.10" | ||
}, | ||
@@ -36,0 +36,0 @@ "repository": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
834792
216
19518
1