/* tslint:disable */ /* eslint-disable */ /** * Credify external API doc * API documentations. * * The version of the OpenAPI document: 1.0.0-oas3 * Contact: dev@credify.one * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import globalAxios, { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; import { Configuration } from '../configuration'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; // @ts-ignore import { AccessTokenResponse } from '../model'; // @ts-ignore import { IntrospectionRequest } from '../model'; // @ts-ignore import { IntrospectionResponse } from '../model'; // @ts-ignore import { PublicKeyResponse } from '../model'; /** * DefaultOrganizationApi - axios parameter creator * @export */ export const DefaultOrganizationApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * This generates a new access token out of a provided API key with the same scopes. * @summary Generates access token * @param {string} xAPIKEY * @param {*} [options] Override http request option. * @deprecated * @throws {RequiredError} */ generateAccessToken: async (xAPIKEY: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'xAPIKEY' is not null or undefined assertParamExists('generateAccessToken', 'xAPIKEY', xAPIKEY) const localVarPath = `/v1/token`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication apiKeyAuth required await setApiKeyToObject(localVarHeaderParameter, "X-API-KEY", configuration) if (xAPIKEY !== undefined && xAPIKEY !== null) { localVarHeaderParameter['X-API-KEY'] = String(xAPIKEY); } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * This returns public key of signing and encryption. * @summary Gets public key * @param {string} [entityId] * @param {*} [options] Override http request option. * @throws {RequiredError} */ getPublicKey: async (entityId?: string, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/v1/entity/public-key`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication bearerAuth required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) if (entityId !== undefined) { localVarQueryParameter['entity_id'] = entityId; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * The introspection endpoint allows to check if a token (both refresh and access) is active or not. An active token is neither expired nor revoked. If a token is active, additional information on the token will be included. * @summary Token introspection * @param {IntrospectionRequest} introspectionRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ introspectToken: async (introspectionRequest: IntrospectionRequest, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'introspectionRequest' is not null or undefined assertParamExists('introspectToken', 'introspectionRequest', introspectionRequest) const localVarPath = `/v1/oauth2/introspect`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication bearerAuth required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = introspectionRequest return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, } }; /** * DefaultOrganizationApi - functional programming interface * @export */ export const DefaultOrganizationApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = DefaultOrganizationApiAxiosParamCreator(configuration) return { /** * This generates a new access token out of a provided API key with the same scopes. * @summary Generates access token * @param {string} xAPIKEY * @param {*} [options] Override http request option. * @deprecated * @throws {RequiredError} */ async generateAccessToken(xAPIKEY: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.generateAccessToken(xAPIKEY, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * This returns public key of signing and encryption. * @summary Gets public key * @param {string} [entityId] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getPublicKey(entityId?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getPublicKey(entityId, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * The introspection endpoint allows to check if a token (both refresh and access) is active or not. An active token is neither expired nor revoked. If a token is active, additional information on the token will be included. * @summary Token introspection * @param {IntrospectionRequest} introspectionRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ async introspectToken(introspectionRequest: IntrospectionRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.introspectToken(introspectionRequest, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, } }; /** * DefaultOrganizationApi - factory interface * @export */ export const DefaultOrganizationApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = DefaultOrganizationApiFp(configuration) return { /** * This generates a new access token out of a provided API key with the same scopes. * @summary Generates access token * @param {string} xAPIKEY * @param {*} [options] Override http request option. * @deprecated * @throws {RequiredError} */ generateAccessToken(xAPIKEY: string, options?: any): AxiosPromise { return localVarFp.generateAccessToken(xAPIKEY, options).then((request) => request(axios, basePath)); }, /** * This returns public key of signing and encryption. * @summary Gets public key * @param {string} [entityId] * @param {*} [options] Override http request option. * @throws {RequiredError} */ getPublicKey(entityId?: string, options?: any): AxiosPromise { return localVarFp.getPublicKey(entityId, options).then((request) => request(axios, basePath)); }, /** * The introspection endpoint allows to check if a token (both refresh and access) is active or not. An active token is neither expired nor revoked. If a token is active, additional information on the token will be included. * @summary Token introspection * @param {IntrospectionRequest} introspectionRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ introspectToken(introspectionRequest: IntrospectionRequest, options?: any): AxiosPromise { return localVarFp.introspectToken(introspectionRequest, options).then((request) => request(axios, basePath)); }, }; }; /** * DefaultOrganizationApi - interface * @export * @interface DefaultOrganizationApi */ export interface DefaultOrganizationApiInterface { /** * This generates a new access token out of a provided API key with the same scopes. * @summary Generates access token * @param {string} xAPIKEY * @param {*} [options] Override http request option. * @deprecated * @throws {RequiredError} * @memberof DefaultOrganizationApiInterface */ generateAccessToken(xAPIKEY: string, options?: AxiosRequestConfig): AxiosPromise; /** * This returns public key of signing and encryption. * @summary Gets public key * @param {string} [entityId] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof DefaultOrganizationApiInterface */ getPublicKey(entityId?: string, options?: AxiosRequestConfig): AxiosPromise; /** * The introspection endpoint allows to check if a token (both refresh and access) is active or not. An active token is neither expired nor revoked. If a token is active, additional information on the token will be included. * @summary Token introspection * @param {IntrospectionRequest} introspectionRequest * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof DefaultOrganizationApiInterface */ introspectToken(introspectionRequest: IntrospectionRequest, options?: AxiosRequestConfig): AxiosPromise; } /** * DefaultOrganizationApi - object-oriented interface * @export * @class DefaultOrganizationApi * @extends {BaseAPI} */ export class DefaultOrganizationApi extends BaseAPI implements DefaultOrganizationApiInterface { /** * This generates a new access token out of a provided API key with the same scopes. * @summary Generates access token * @param {string} xAPIKEY * @param {*} [options] Override http request option. * @deprecated * @throws {RequiredError} * @memberof DefaultOrganizationApi */ public generateAccessToken(xAPIKEY: string, options?: AxiosRequestConfig) { return DefaultOrganizationApiFp(this.configuration).generateAccessToken(xAPIKEY, options).then((request) => request(this.axios, this.basePath)); } /** * This returns public key of signing and encryption. * @summary Gets public key * @param {string} [entityId] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof DefaultOrganizationApi */ public getPublicKey(entityId?: string, options?: AxiosRequestConfig) { return DefaultOrganizationApiFp(this.configuration).getPublicKey(entityId, options).then((request) => request(this.axios, this.basePath)); } /** * The introspection endpoint allows to check if a token (both refresh and access) is active or not. An active token is neither expired nor revoked. If a token is active, additional information on the token will be included. * @summary Token introspection * @param {IntrospectionRequest} introspectionRequest * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof DefaultOrganizationApi */ public introspectToken(introspectionRequest: IntrospectionRequest, options?: AxiosRequestConfig) { return DefaultOrganizationApiFp(this.configuration).introspectToken(introspectionRequest, options).then((request) => request(this.axios, this.basePath)); } }