/* tslint:disable */ /* eslint-disable */ /** * openfilz-api * API for Document Management System * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import type { Configuration } from '../configuration'; import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction, replaceWithSerializableTypeIfNeeded } from '../common'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; // @ts-ignore import type { ApplySignatureRequest } from '../models'; // @ts-ignore import type { DeclineSignatureRequest } from '../models'; // @ts-ignore import type { PublicSignatureView } from '../models'; // @ts-ignore import type { VerifyOtpRequest } from '../models'; /** * ESignPublicApi - axios parameter creator */ export const ESignPublicApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * * @summary Decline to sign (voids the envelope) * @param {string} token * @param {DeclineSignatureRequest} [declineSignatureRequest] * @param {*} [options] Override http request option. * @throws {RequiredError} */ decline: async (token: string, declineSignatureRequest?: DeclineSignatureRequest, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'token' is not null or undefined assertParamExists('decline', 'token', token) const localVarPath = `/api/v1/public/signatures/decline`; // 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 keycloak_auth required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) if (token !== undefined) { localVarQueryParameter['token'] = token; } localVarHeaderParameter['Content-Type'] = 'application/json'; localVarHeaderParameter['Accept'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(declineSignatureRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Stream the source PDF for signing * @param {string} token * @param {*} [options] Override http request option. * @throws {RequiredError} */ document: async (token: string, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'token' is not null or undefined assertParamExists('document', 'token', token) const localVarPath = `/api/v1/public/signatures/document`; // 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 keycloak_auth required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) if (token !== undefined) { localVarQueryParameter['token'] = token; } localVarHeaderParameter['Accept'] = 'application/pdf'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Record that the recipient opened the document * @param {string} token * @param {string} [userAgent] * @param {*} [options] Override http request option. * @throws {RequiredError} */ markViewed: async (token: string, userAgent?: string, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'token' is not null or undefined assertParamExists('markViewed', 'token', token) const localVarPath = `/api/v1/public/signatures/viewed`; // 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 keycloak_auth required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) if (token !== undefined) { localVarQueryParameter['token'] = token; } localVarHeaderParameter['Accept'] = 'application/json'; if (userAgent != null) { localVarHeaderParameter['User-Agent'] = String(userAgent); } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Send a one-time access code to the recipient (EMAIL_OTP / SMS_OTP) * @param {string} token * @param {*} [options] Override http request option. * @throws {RequiredError} */ requestOtp: async (token: string, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'token' is not null or undefined assertParamExists('requestOtp', 'token', token) const localVarPath = `/api/v1/public/signatures/otp/request`; // 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 keycloak_auth required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) if (token !== undefined) { localVarQueryParameter['token'] = token; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Submit the recipient\'s fields and sign * @param {string} token * @param {ApplySignatureRequest} applySignatureRequest * @param {string} [userAgent] * @param {*} [options] Override http request option. * @throws {RequiredError} */ sign: async (token: string, applySignatureRequest: ApplySignatureRequest, userAgent?: string, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'token' is not null or undefined assertParamExists('sign', 'token', token) // verify required parameter 'applySignatureRequest' is not null or undefined assertParamExists('sign', 'applySignatureRequest', applySignatureRequest) const localVarPath = `/api/v1/public/signatures/sign`; // 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 keycloak_auth required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) if (token !== undefined) { localVarQueryParameter['token'] = token; } localVarHeaderParameter['Content-Type'] = 'application/json'; localVarHeaderParameter['Accept'] = 'application/json'; if (userAgent != null) { localVarHeaderParameter['User-Agent'] = String(userAgent); } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(applySignatureRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Verify the one-time access code * @param {string} token * @param {VerifyOtpRequest} verifyOtpRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ verifyOtp: async (token: string, verifyOtpRequest: VerifyOtpRequest, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'token' is not null or undefined assertParamExists('verifyOtp', 'token', token) // verify required parameter 'verifyOtpRequest' is not null or undefined assertParamExists('verifyOtp', 'verifyOtpRequest', verifyOtpRequest) const localVarPath = `/api/v1/public/signatures/otp/verify`; // 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 keycloak_auth required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) if (token !== undefined) { localVarQueryParameter['token'] = token; } localVarHeaderParameter['Content-Type'] = 'application/json'; localVarHeaderParameter['Accept'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(verifyOtpRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Resolve a signing token to its envelope view * @param {string} token * @param {*} [options] Override http request option. * @throws {RequiredError} */ view: async (token: string, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'token' is not null or undefined assertParamExists('view', 'token', token) const localVarPath = `/api/v1/public/signatures`; // 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 keycloak_auth required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) if (token !== undefined) { localVarQueryParameter['token'] = token; } localVarHeaderParameter['Accept'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, } }; /** * ESignPublicApi - functional programming interface */ export const ESignPublicApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = ESignPublicApiAxiosParamCreator(configuration) return { /** * * @summary Decline to sign (voids the envelope) * @param {string} token * @param {DeclineSignatureRequest} [declineSignatureRequest] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async decline(token: string, declineSignatureRequest?: DeclineSignatureRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.decline(token, declineSignatureRequest, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['ESignPublicApi.decline']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Stream the source PDF for signing * @param {string} token * @param {*} [options] Override http request option. * @throws {RequiredError} */ async document(token: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.document(token, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['ESignPublicApi.document']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Record that the recipient opened the document * @param {string} token * @param {string} [userAgent] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async markViewed(token: string, userAgent?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.markViewed(token, userAgent, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['ESignPublicApi.markViewed']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Send a one-time access code to the recipient (EMAIL_OTP / SMS_OTP) * @param {string} token * @param {*} [options] Override http request option. * @throws {RequiredError} */ async requestOtp(token: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.requestOtp(token, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['ESignPublicApi.requestOtp']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Submit the recipient\'s fields and sign * @param {string} token * @param {ApplySignatureRequest} applySignatureRequest * @param {string} [userAgent] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async sign(token: string, applySignatureRequest: ApplySignatureRequest, userAgent?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.sign(token, applySignatureRequest, userAgent, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['ESignPublicApi.sign']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Verify the one-time access code * @param {string} token * @param {VerifyOtpRequest} verifyOtpRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ async verifyOtp(token: string, verifyOtpRequest: VerifyOtpRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.verifyOtp(token, verifyOtpRequest, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['ESignPublicApi.verifyOtp']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Resolve a signing token to its envelope view * @param {string} token * @param {*} [options] Override http request option. * @throws {RequiredError} */ async view(token: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.view(token, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['ESignPublicApi.view']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, } }; /** * ESignPublicApi - factory interface */ export const ESignPublicApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = ESignPublicApiFp(configuration) return { /** * * @summary Decline to sign (voids the envelope) * @param {string} token * @param {DeclineSignatureRequest} [declineSignatureRequest] * @param {*} [options] Override http request option. * @throws {RequiredError} */ decline(token: string, declineSignatureRequest?: DeclineSignatureRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.decline(token, declineSignatureRequest, options).then((request) => request(axios, basePath)); }, /** * * @summary Stream the source PDF for signing * @param {string} token * @param {*} [options] Override http request option. * @throws {RequiredError} */ document(token: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.document(token, options).then((request) => request(axios, basePath)); }, /** * * @summary Record that the recipient opened the document * @param {string} token * @param {string} [userAgent] * @param {*} [options] Override http request option. * @throws {RequiredError} */ markViewed(token: string, userAgent?: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.markViewed(token, userAgent, options).then((request) => request(axios, basePath)); }, /** * * @summary Send a one-time access code to the recipient (EMAIL_OTP / SMS_OTP) * @param {string} token * @param {*} [options] Override http request option. * @throws {RequiredError} */ requestOtp(token: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.requestOtp(token, options).then((request) => request(axios, basePath)); }, /** * * @summary Submit the recipient\'s fields and sign * @param {string} token * @param {ApplySignatureRequest} applySignatureRequest * @param {string} [userAgent] * @param {*} [options] Override http request option. * @throws {RequiredError} */ sign(token: string, applySignatureRequest: ApplySignatureRequest, userAgent?: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.sign(token, applySignatureRequest, userAgent, options).then((request) => request(axios, basePath)); }, /** * * @summary Verify the one-time access code * @param {string} token * @param {VerifyOtpRequest} verifyOtpRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ verifyOtp(token: string, verifyOtpRequest: VerifyOtpRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.verifyOtp(token, verifyOtpRequest, options).then((request) => request(axios, basePath)); }, /** * * @summary Resolve a signing token to its envelope view * @param {string} token * @param {*} [options] Override http request option. * @throws {RequiredError} */ view(token: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.view(token, options).then((request) => request(axios, basePath)); }, }; }; /** * ESignPublicApi - object-oriented interface */ export class ESignPublicApi extends BaseAPI { /** * * @summary Decline to sign (voids the envelope) * @param {string} token * @param {DeclineSignatureRequest} [declineSignatureRequest] * @param {*} [options] Override http request option. * @throws {RequiredError} */ public decline(token: string, declineSignatureRequest?: DeclineSignatureRequest, options?: RawAxiosRequestConfig) { return ESignPublicApiFp(this.configuration).decline(token, declineSignatureRequest, options).then((request) => request(this.axios, this.basePath)); } /** * * @summary Stream the source PDF for signing * @param {string} token * @param {*} [options] Override http request option. * @throws {RequiredError} */ public document(token: string, options?: RawAxiosRequestConfig) { return ESignPublicApiFp(this.configuration).document(token, options).then((request) => request(this.axios, this.basePath)); } /** * * @summary Record that the recipient opened the document * @param {string} token * @param {string} [userAgent] * @param {*} [options] Override http request option. * @throws {RequiredError} */ public markViewed(token: string, userAgent?: string, options?: RawAxiosRequestConfig) { return ESignPublicApiFp(this.configuration).markViewed(token, userAgent, options).then((request) => request(this.axios, this.basePath)); } /** * * @summary Send a one-time access code to the recipient (EMAIL_OTP / SMS_OTP) * @param {string} token * @param {*} [options] Override http request option. * @throws {RequiredError} */ public requestOtp(token: string, options?: RawAxiosRequestConfig) { return ESignPublicApiFp(this.configuration).requestOtp(token, options).then((request) => request(this.axios, this.basePath)); } /** * * @summary Submit the recipient\'s fields and sign * @param {string} token * @param {ApplySignatureRequest} applySignatureRequest * @param {string} [userAgent] * @param {*} [options] Override http request option. * @throws {RequiredError} */ public sign(token: string, applySignatureRequest: ApplySignatureRequest, userAgent?: string, options?: RawAxiosRequestConfig) { return ESignPublicApiFp(this.configuration).sign(token, applySignatureRequest, userAgent, options).then((request) => request(this.axios, this.basePath)); } /** * * @summary Verify the one-time access code * @param {string} token * @param {VerifyOtpRequest} verifyOtpRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ public verifyOtp(token: string, verifyOtpRequest: VerifyOtpRequest, options?: RawAxiosRequestConfig) { return ESignPublicApiFp(this.configuration).verifyOtp(token, verifyOtpRequest, options).then((request) => request(this.axios, this.basePath)); } /** * * @summary Resolve a signing token to its envelope view * @param {string} token * @param {*} [options] Override http request option. * @throws {RequiredError} */ public view(token: string, options?: RawAxiosRequestConfig) { return ESignPublicApiFp(this.configuration).view(token, options).then((request) => request(this.axios, this.basePath)); } }