/* tslint:disable */ /* eslint-disable */ /** * Fireblocks API * Fireblocks provides a suite of applications to manage digital asset operations and a complete development platform to build your business on the blockchain. - Visit our website for more information: [Fireblocks Website](https://fireblocks.com) - Visit our developer docs: [Fireblocks DevPortal](https://developers.fireblocks.com) * * The version of the OpenAPI document: 1.6.2 * Contact: developers@fireblocks.com * * 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'; import { convertToFireblocksResponse } from "../response/fireblocksResponse"; // URLSearchParams not necessarily used // @ts-ignore import { URL, URLSearchParams } from 'url'; // 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'; import { assertParamExistsAndNotEmpty } from '../utils/validation_utils'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; // @ts-ignore import { ErrorSchema } from '../models'; // @ts-ignore import { GetScreeningResultResponse } from '../models'; // @ts-ignore import { GetWorkflowResponse } from '../models'; // @ts-ignore import { TriggerScreeningRequest } from '../models'; // @ts-ignore import { TriggerScreeningResponse } from '../models'; // @ts-ignore import { UpdateWorkflowStatusRequest } from '../models'; // @ts-ignore import { UpdateWorkflowStatusResponse } from '../models'; /** * ComplianceOrchestratorBetaApi - axios parameter creator * @export */ export const ComplianceOrchestratorBetaApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * Returns the result of a screening started by `POST /v1/compliance/orchestrator/screenings`, with a result per workflow step and an audit log. Safe to poll: a screening still in flight reports `PENDING` or `RUNNING`. Only screenings owned by the requesting tenant are returned. * @summary Get a Compliance Orchestrator screening\'s result * @param {string} screeningId The screening\'s identifier, returned by `POST /v1/compliance/orchestrator/screenings`. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getScreeningResult: async (screeningId: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExistsAndNotEmpty('getScreeningResult', 'screeningId', screeningId) const localVarPath = `/compliance/orchestrator/screenings/{screeningId}` .replace(`{${"screeningId"}}`, encodeURIComponent(String(screeningId))); // 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}; // Stamped onto the request config (not the headers, so it never goes on // the wire) so the response interceptor can name the operation in the // lifecycle warning. Key must match OPERATION_ID_CONFIG_KEY in utils/lifecycleWarning. (localVarRequestOptions as any).fireblocksOperationId = 'getScreeningResult'; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Returns a workflow\'s status and its steps in execution order. Read it to see what a given `workflowId` will screen, and which fields its rules may reference. * @summary Get a Compliance Orchestrator workflow * @param {string} workflowId The workflow\'s identifier. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getWorkflow: async (workflowId: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExistsAndNotEmpty('getWorkflow', 'workflowId', workflowId) const localVarPath = `/compliance/orchestrator/workflows/{workflowId}` .replace(`{${"workflowId"}}`, encodeURIComponent(String(workflowId))); // 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}; // Stamped onto the request config (not the headers, so it never goes on // the wire) so the response interceptor can name the operation in the // lifecycle warning. Key must match OPERATION_ID_CONFIG_KEY in utils/lifecycleWarning. (localVarRequestOptions as any).fireblocksOperationId = 'getWorkflow'; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Starts a compliance screening against an active workflow and returns a `screeningId`. The screening runs asynchronously — poll `GET /v1/compliance/orchestrator/screenings/{screeningId}` for the result. Unlike the screening that applies automatically to submitted transactions under `/v1/screening`, this is called on demand, before anything exists on-chain. * @summary Trigger a Compliance Orchestrator screening * @param {TriggerScreeningRequest} triggerScreeningRequest * @param {string} [idempotencyKey] A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours. * @param {*} [options] Override http request option. * @throws {RequiredError} */ triggerScreening: async (triggerScreeningRequest: TriggerScreeningRequest, idempotencyKey?: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExists('triggerScreening', 'triggerScreeningRequest', triggerScreeningRequest) const localVarPath = `/compliance/orchestrator/screenings`; // 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}; // Stamped onto the request config (not the headers, so it never goes on // the wire) so the response interceptor can name the operation in the // lifecycle warning. Key must match OPERATION_ID_CONFIG_KEY in utils/lifecycleWarning. (localVarRequestOptions as any).fireblocksOperationId = 'triggerScreening'; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; if (idempotencyKey != null) { localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey); } localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(triggerScreeningRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Moves a workflow between `DRAFT` and `ACTIVE`. A workflow must be `ACTIVE` before `POST /v1/compliance/orchestrator/screenings` will accept a screening against it. Returns the workflow\'s id and new status, not its full configuration. * @summary Update a Compliance Orchestrator workflow\'s status * @param {UpdateWorkflowStatusRequest} updateWorkflowStatusRequest * @param {string} workflowId The workflow\'s identifier. * @param {string} [idempotencyKey] A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours. * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateWorkflowStatus: async (updateWorkflowStatusRequest: UpdateWorkflowStatusRequest, workflowId: string, idempotencyKey?: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExists('updateWorkflowStatus', 'updateWorkflowStatusRequest', updateWorkflowStatusRequest) assertParamExistsAndNotEmpty('updateWorkflowStatus', 'workflowId', workflowId) const localVarPath = `/compliance/orchestrator/workflows/{workflowId}/status` .replace(`{${"workflowId"}}`, encodeURIComponent(String(workflowId))); // 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: 'PATCH', ...baseOptions, ...options}; // Stamped onto the request config (not the headers, so it never goes on // the wire) so the response interceptor can name the operation in the // lifecycle warning. Key must match OPERATION_ID_CONFIG_KEY in utils/lifecycleWarning. (localVarRequestOptions as any).fireblocksOperationId = 'updateWorkflowStatus'; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; if (idempotencyKey != null) { localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey); } localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(updateWorkflowStatusRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, } }; /** * ComplianceOrchestratorBetaApi - functional programming interface * @export */ export const ComplianceOrchestratorBetaApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = ComplianceOrchestratorBetaApiAxiosParamCreator(configuration) return { /** * Returns the result of a screening started by `POST /v1/compliance/orchestrator/screenings`, with a result per workflow step and an audit log. Safe to poll: a screening still in flight reports `PENDING` or `RUNNING`. Only screenings owned by the requesting tenant are returned. * @summary Get a Compliance Orchestrator screening\'s result * @param {string} screeningId The screening\'s identifier, returned by `POST /v1/compliance/orchestrator/screenings`. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getScreeningResult(screeningId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getScreeningResult(screeningId, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['ComplianceOrchestratorBetaApi.getScreeningResult']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Returns a workflow\'s status and its steps in execution order. Read it to see what a given `workflowId` will screen, and which fields its rules may reference. * @summary Get a Compliance Orchestrator workflow * @param {string} workflowId The workflow\'s identifier. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getWorkflow(workflowId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getWorkflow(workflowId, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['ComplianceOrchestratorBetaApi.getWorkflow']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Starts a compliance screening against an active workflow and returns a `screeningId`. The screening runs asynchronously — poll `GET /v1/compliance/orchestrator/screenings/{screeningId}` for the result. Unlike the screening that applies automatically to submitted transactions under `/v1/screening`, this is called on demand, before anything exists on-chain. * @summary Trigger a Compliance Orchestrator screening * @param {TriggerScreeningRequest} triggerScreeningRequest * @param {string} [idempotencyKey] A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async triggerScreening(triggerScreeningRequest: TriggerScreeningRequest, idempotencyKey?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.triggerScreening(triggerScreeningRequest, idempotencyKey, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['ComplianceOrchestratorBetaApi.triggerScreening']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Moves a workflow between `DRAFT` and `ACTIVE`. A workflow must be `ACTIVE` before `POST /v1/compliance/orchestrator/screenings` will accept a screening against it. Returns the workflow\'s id and new status, not its full configuration. * @summary Update a Compliance Orchestrator workflow\'s status * @param {UpdateWorkflowStatusRequest} updateWorkflowStatusRequest * @param {string} workflowId The workflow\'s identifier. * @param {string} [idempotencyKey] A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async updateWorkflowStatus(updateWorkflowStatusRequest: UpdateWorkflowStatusRequest, workflowId: string, idempotencyKey?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.updateWorkflowStatus(updateWorkflowStatusRequest, workflowId, idempotencyKey, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['ComplianceOrchestratorBetaApi.updateWorkflowStatus']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, } }; /** * ComplianceOrchestratorBetaApi - factory interface * @export */ export const ComplianceOrchestratorBetaApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = ComplianceOrchestratorBetaApiFp(configuration) return { /** * Returns the result of a screening started by `POST /v1/compliance/orchestrator/screenings`, with a result per workflow step and an audit log. Safe to poll: a screening still in flight reports `PENDING` or `RUNNING`. Only screenings owned by the requesting tenant are returned. * @summary Get a Compliance Orchestrator screening\'s result * @param {ComplianceOrchestratorBetaApiGetScreeningResultRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getScreeningResult(requestParameters: ComplianceOrchestratorBetaApiGetScreeningResultRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getScreeningResult(requestParameters.screeningId, options).then((request) => request(axios, basePath)); }, /** * Returns a workflow\'s status and its steps in execution order. Read it to see what a given `workflowId` will screen, and which fields its rules may reference. * @summary Get a Compliance Orchestrator workflow * @param {ComplianceOrchestratorBetaApiGetWorkflowRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getWorkflow(requestParameters: ComplianceOrchestratorBetaApiGetWorkflowRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getWorkflow(requestParameters.workflowId, options).then((request) => request(axios, basePath)); }, /** * Starts a compliance screening against an active workflow and returns a `screeningId`. The screening runs asynchronously — poll `GET /v1/compliance/orchestrator/screenings/{screeningId}` for the result. Unlike the screening that applies automatically to submitted transactions under `/v1/screening`, this is called on demand, before anything exists on-chain. * @summary Trigger a Compliance Orchestrator screening * @param {ComplianceOrchestratorBetaApiTriggerScreeningRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ triggerScreening(requestParameters: ComplianceOrchestratorBetaApiTriggerScreeningRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.triggerScreening(requestParameters.triggerScreeningRequest, requestParameters.idempotencyKey, options).then((request) => request(axios, basePath)); }, /** * Moves a workflow between `DRAFT` and `ACTIVE`. A workflow must be `ACTIVE` before `POST /v1/compliance/orchestrator/screenings` will accept a screening against it. Returns the workflow\'s id and new status, not its full configuration. * @summary Update a Compliance Orchestrator workflow\'s status * @param {ComplianceOrchestratorBetaApiUpdateWorkflowStatusRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateWorkflowStatus(requestParameters: ComplianceOrchestratorBetaApiUpdateWorkflowStatusRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.updateWorkflowStatus(requestParameters.updateWorkflowStatusRequest, requestParameters.workflowId, requestParameters.idempotencyKey, options).then((request) => request(axios, basePath)); }, }; }; /** * Request parameters for getScreeningResult operation in ComplianceOrchestratorBetaApi. * @export * @interface ComplianceOrchestratorBetaApiGetScreeningResultRequest */ export interface ComplianceOrchestratorBetaApiGetScreeningResultRequest { /** * The screening\'s identifier, returned by `POST /v1/compliance/orchestrator/screenings`. * @type {string} * @memberof ComplianceOrchestratorBetaApiGetScreeningResult */ readonly screeningId: string } /** * Request parameters for getWorkflow operation in ComplianceOrchestratorBetaApi. * @export * @interface ComplianceOrchestratorBetaApiGetWorkflowRequest */ export interface ComplianceOrchestratorBetaApiGetWorkflowRequest { /** * The workflow\'s identifier. * @type {string} * @memberof ComplianceOrchestratorBetaApiGetWorkflow */ readonly workflowId: string } /** * Request parameters for triggerScreening operation in ComplianceOrchestratorBetaApi. * @export * @interface ComplianceOrchestratorBetaApiTriggerScreeningRequest */ export interface ComplianceOrchestratorBetaApiTriggerScreeningRequest { /** * * @type {TriggerScreeningRequest} * @memberof ComplianceOrchestratorBetaApiTriggerScreening */ readonly triggerScreeningRequest: TriggerScreeningRequest /** * A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours. * @type {string} * @memberof ComplianceOrchestratorBetaApiTriggerScreening */ readonly idempotencyKey?: string } /** * Request parameters for updateWorkflowStatus operation in ComplianceOrchestratorBetaApi. * @export * @interface ComplianceOrchestratorBetaApiUpdateWorkflowStatusRequest */ export interface ComplianceOrchestratorBetaApiUpdateWorkflowStatusRequest { /** * * @type {UpdateWorkflowStatusRequest} * @memberof ComplianceOrchestratorBetaApiUpdateWorkflowStatus */ readonly updateWorkflowStatusRequest: UpdateWorkflowStatusRequest /** * The workflow\'s identifier. * @type {string} * @memberof ComplianceOrchestratorBetaApiUpdateWorkflowStatus */ readonly workflowId: string /** * A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours. * @type {string} * @memberof ComplianceOrchestratorBetaApiUpdateWorkflowStatus */ readonly idempotencyKey?: string } /** * ComplianceOrchestratorBetaApi - object-oriented interface * @export * @class ComplianceOrchestratorBetaApi * @extends {BaseAPI} */ export class ComplianceOrchestratorBetaApi extends BaseAPI { /** * Returns the result of a screening started by `POST /v1/compliance/orchestrator/screenings`, with a result per workflow step and an audit log. Safe to poll: a screening still in flight reports `PENDING` or `RUNNING`. Only screenings owned by the requesting tenant are returned. * @summary Get a Compliance Orchestrator screening\'s result * @param {ComplianceOrchestratorBetaApiGetScreeningResultRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ComplianceOrchestratorBetaApi */ public getScreeningResult(requestParameters: ComplianceOrchestratorBetaApiGetScreeningResultRequest) { return ComplianceOrchestratorBetaApiFp(this.configuration).getScreeningResult(requestParameters.screeningId).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Returns a workflow\'s status and its steps in execution order. Read it to see what a given `workflowId` will screen, and which fields its rules may reference. * @summary Get a Compliance Orchestrator workflow * @param {ComplianceOrchestratorBetaApiGetWorkflowRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ComplianceOrchestratorBetaApi */ public getWorkflow(requestParameters: ComplianceOrchestratorBetaApiGetWorkflowRequest) { return ComplianceOrchestratorBetaApiFp(this.configuration).getWorkflow(requestParameters.workflowId).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Starts a compliance screening against an active workflow and returns a `screeningId`. The screening runs asynchronously — poll `GET /v1/compliance/orchestrator/screenings/{screeningId}` for the result. Unlike the screening that applies automatically to submitted transactions under `/v1/screening`, this is called on demand, before anything exists on-chain. * @summary Trigger a Compliance Orchestrator screening * @param {ComplianceOrchestratorBetaApiTriggerScreeningRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ComplianceOrchestratorBetaApi */ public triggerScreening(requestParameters: ComplianceOrchestratorBetaApiTriggerScreeningRequest) { return ComplianceOrchestratorBetaApiFp(this.configuration).triggerScreening(requestParameters.triggerScreeningRequest, requestParameters.idempotencyKey).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Moves a workflow between `DRAFT` and `ACTIVE`. A workflow must be `ACTIVE` before `POST /v1/compliance/orchestrator/screenings` will accept a screening against it. Returns the workflow\'s id and new status, not its full configuration. * @summary Update a Compliance Orchestrator workflow\'s status * @param {ComplianceOrchestratorBetaApiUpdateWorkflowStatusRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ComplianceOrchestratorBetaApi */ public updateWorkflowStatus(requestParameters: ComplianceOrchestratorBetaApiUpdateWorkflowStatusRequest) { return ComplianceOrchestratorBetaApiFp(this.configuration).updateWorkflowStatus(requestParameters.updateWorkflowStatusRequest, requestParameters.workflowId, requestParameters.idempotencyKey).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } }