/* 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 { ApprovalRequestItem } from '../models'; // @ts-ignore import { ApproveApprovalRequest } from '../models'; // @ts-ignore import { DeleteApprovalApiKeyResponse } from '../models'; // @ts-ignore import { ErrorSchema } from '../models'; // @ts-ignore import { ListApprovalApiKeysResponse } from '../models'; // @ts-ignore import { ListApprovalsResponse } from '../models'; // @ts-ignore import { RegisterApprovalApiKeyRequest } from '../models'; // @ts-ignore import { RegisterApprovalApiKeyResponse } from '../models'; /** * ApprovalsBetaApi - axios parameter creator * @export */ export const ApprovalsBetaApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * Approve a pending approval request as the authenticated API user. The caller signs the request\'s signable data with the private key of a registered approval API key and submits the base64url-encoded signature, optionally with the key ID. The server verifies the signature against the registered public key — using the given key ID, or matching against all of the user\'s registered keys when the key ID is omitted — and advances the approval quorum. Endpoint Permission: Owner, Admin, Non-Signing Admin, Approver, Signer, Security Admin. * @summary Approve an approval request * @param {ApproveApprovalRequest} approveApprovalRequest * @param {string} requestId The approval request ID. * @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} */ approveApproval: async (approveApprovalRequest: ApproveApprovalRequest, requestId: string, idempotencyKey?: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExists('approveApproval', 'approveApprovalRequest', approveApprovalRequest) assertParamExistsAndNotEmpty('approveApproval', 'requestId', requestId) const localVarPath = `/approvals/{requestId}/approve` .replace(`{${"requestId"}}`, encodeURIComponent(String(requestId))); // 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 = 'approveApproval'; 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(approveApprovalRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Register an approval public key for an API user, used to sign approval requests. Up to 2 active keys are supported per API user. Returns the server-generated key ID used for deletion. The `userId` must be the authenticated API user\'s own ID. Registering a key for another user is not supported and is rejected. Registration may require approval. In that case the response carries `ccrIdPendingRegistration`, the key reads as `APPROVAL_API_KEY_STATUS_PENDING_REGISTRATION` and cannot sign until the request is approved. A rejected request removes the key. Endpoint Permission: Owner, Admin, Non-Signing Admin, Approver, Signer, Security Admin. * @summary Register an approval key * @param {RegisterApprovalApiKeyRequest} registerApprovalApiKeyRequest * @param {string} userId The ID of the API user to register the approval key for. * @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} */ createApprovalKey: async (registerApprovalApiKeyRequest: RegisterApprovalApiKeyRequest, userId: string, idempotencyKey?: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExists('createApprovalKey', 'registerApprovalApiKeyRequest', registerApprovalApiKeyRequest) assertParamExistsAndNotEmpty('createApprovalKey', 'userId', userId) const localVarPath = `/management/api_users/{userId}/approval_keys` .replace(`{${"userId"}}`, encodeURIComponent(String(userId))); // 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 = 'createApprovalKey'; 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(registerApprovalApiKeyRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Delete (revoke) an approval public key for the specified API user. The deletion may require approval: it always does for the API user\'s last key or another user\'s key. In that case the response carries `ccrIdPendingDeletion`, the key reads as `APPROVAL_API_KEY_STATUS_PENDING_DELETION` and stays active until the request is approved. A rejected request leaves the key enabled. Endpoint Permission: Owner, Admin, Non-Signing Admin, Approver, Signer, Security Admin. * @summary Delete an approval key * @param {string} userId The ID of the API user whose approval key to delete. * @param {string} keyId The ID of the approval key to delete. * @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} */ deleteApprovalKey: async (userId: string, keyId: string, idempotencyKey?: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExistsAndNotEmpty('deleteApprovalKey', 'userId', userId) assertParamExistsAndNotEmpty('deleteApprovalKey', 'keyId', keyId) const localVarPath = `/management/api_users/{userId}/approval_keys/{keyId}` .replace(`{${"userId"}}`, encodeURIComponent(String(userId))) .replace(`{${"keyId"}}`, encodeURIComponent(String(keyId))); // 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: 'DELETE', ...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 = 'deleteApprovalKey'; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; if (idempotencyKey != null) { localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey); } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Retrieve full detail for a single approval request by ID, including the payload to sign and, when requested, the request\'s `quorumStatus`. Because this endpoint addresses one request, it accepts `quorumStatusMode=FULL`, which adds the participating approvers and their individual approval state. `userStatus` reflects the authenticated user by default. Pass `userId` to report it for another user instead. Endpoint Permission: Owner, Admin, Non-Signing Admin, Approver, Signer, Security Admin, Security Auditor. * @summary Get a single approval request * @param {string} requestId The approval request ID. * @param {string} [userId] Report `userStatus` for this user instead of the authenticated user. This selects whose approval state is returned; it does not change which requests can be fetched. Requires an Admin, Non-Signing Admin, Security Admin or Security Auditor role; other roles are rejected with 403. * @param {GetApprovalByIdQuorumStatusModeEnum} [quorumStatusMode] How much quorum detail to include in `quorumStatus`. `NONE` (the default) returns it as `null`. `SUMMARY` returns the approval thresholds, current counts and status. `FULL` adds `users` and the per-group `members` indexes identifying who may approve and who already has. Any other value is rejected with 400; the parameter is case-sensitive. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getApprovalById: async (requestId: string, userId?: string, quorumStatusMode?: GetApprovalByIdQuorumStatusModeEnum, options: RawAxiosRequestConfig = {}): Promise => { assertParamExistsAndNotEmpty('getApprovalById', 'requestId', requestId) const localVarPath = `/approvals/{requestId}` .replace(`{${"requestId"}}`, encodeURIComponent(String(requestId))); // 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 = 'getApprovalById'; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; if (userId !== undefined) { localVarQueryParameter['userId'] = userId; } if (quorumStatusMode !== undefined) { localVarQueryParameter['quorumStatusMode'] = quorumStatusMode; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * List the approval public keys registered for the specified API user. Endpoint Permission: Owner, Admin, Non-Signing Admin, Approver, Signer, Security Admin, Security Auditor. * @summary List approval keys * @param {string} userId The ID of the API user whose approval keys to list. * @param {number} [pageSize] Number of results per page. Maximum 15. Defaults to 10. * @param {string} [pageCursor] Cursor returned from the previous response (the `next` field) to fetch the next page. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getApprovalKeys: async (userId: string, pageSize?: number, pageCursor?: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExistsAndNotEmpty('getApprovalKeys', 'userId', userId) const localVarPath = `/management/api_users/{userId}/approval_keys` .replace(`{${"userId"}}`, encodeURIComponent(String(userId))); // 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 = 'getApprovalKeys'; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; if (pageSize !== undefined) { localVarQueryParameter['pageSize'] = pageSize; } if (pageCursor !== undefined) { localVarQueryParameter['pageCursor'] = pageCursor; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Retrieve the pending approval requests the authenticated API user is eligible to act on, including requests the user has already approved that are still pending overall. The response is scoped to the authenticated user by default. Pass `userId` to read another user\'s queue, or `includeAllUsers=true` to read every pending request in the workspace. Both require an Admin, Non-Signing Admin, Security Admin or Security Auditor role and are rejected with 403 otherwise. Set `quorumStatusMode=SUMMARY` to include each request\'s approval thresholds and counts. The per-approver breakdown is available only when fetching a single request — see `GET /approvals/{requestId}`. Endpoint Permission: Owner, Admin, Non-Signing Admin, Approver, Signer, Security Admin, Security Auditor. * @summary List approval requests * @param {boolean} [includeUserApproved] When true, also include requests the authenticated user has already approved that are still pending overall. Defaults to false (only requests the user has not yet acted on). * @param {string} [userId] Return the pending requests for this user instead of the authenticated user. Requires an Admin, Non-Signing Admin, Security Admin or Security Auditor role; other roles are rejected with 403. Cannot be combined with `includeAllUsers=true` — sending both is rejected with 400. * @param {boolean} [includeAllUsers] When true, return every pending request in the workspace instead of a single user\'s queue. Defaults to false. Requires an Admin, Non-Signing Admin, Security Admin or Security Auditor role; other roles are rejected with 403. In this mode `userStatus` is always `USER_STATUS_NOT_APPLICABLE`, because the response is not scoped to one user, and `includeUserApproved` has no effect. Cannot be combined with `userId`. * @param {GetApprovalsQuorumStatusModeEnum} [quorumStatusMode] How much quorum detail to include in each request\'s `quorumStatus`. `NONE` (the default) returns it as `null`. `SUMMARY` returns the approval thresholds, current counts and status. `FULL` is rejected with 400 on this endpoint because the per-approver breakdown requires a single request — use `GET /approvals/{requestId}` for it. Any other value is rejected with 400; the parameter is case-sensitive. * @param {number} [pageSize] Number of results per page. Maximum 30. Defaults to 20. * @param {string} [pageCursor] Cursor returned from the previous response (the `next` field) to fetch the next page. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getApprovals: async (includeUserApproved?: boolean, userId?: string, includeAllUsers?: boolean, quorumStatusMode?: GetApprovalsQuorumStatusModeEnum, pageSize?: number, pageCursor?: string, options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/approvals`; // 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 = 'getApprovals'; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; if (includeUserApproved !== undefined) { localVarQueryParameter['includeUserApproved'] = includeUserApproved; } if (userId !== undefined) { localVarQueryParameter['userId'] = userId; } if (includeAllUsers !== undefined) { localVarQueryParameter['includeAllUsers'] = includeAllUsers; } if (quorumStatusMode !== undefined) { localVarQueryParameter['quorumStatusMode'] = quorumStatusMode; } if (pageSize !== undefined) { localVarQueryParameter['pageSize'] = pageSize; } if (pageCursor !== undefined) { localVarQueryParameter['pageCursor'] = pageCursor; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Reject a pending approval request as the authenticated API user. No signature is required (unlike approve). The caller must be eligible to act on the request; rejecting finalizes the request as rejected per the approval policy. Endpoint Permission: Owner, Admin, Non-Signing Admin, Approver, Signer, Security Admin. * @summary Reject an approval request * @param {string} requestId The approval request ID. * @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} */ rejectApproval: async (requestId: string, idempotencyKey?: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExistsAndNotEmpty('rejectApproval', 'requestId', requestId) const localVarPath = `/approvals/{requestId}/reject` .replace(`{${"requestId"}}`, encodeURIComponent(String(requestId))); // 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 = 'rejectApproval'; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; if (idempotencyKey != null) { localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey); } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, } }; /** * ApprovalsBetaApi - functional programming interface * @export */ export const ApprovalsBetaApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = ApprovalsBetaApiAxiosParamCreator(configuration) return { /** * Approve a pending approval request as the authenticated API user. The caller signs the request\'s signable data with the private key of a registered approval API key and submits the base64url-encoded signature, optionally with the key ID. The server verifies the signature against the registered public key — using the given key ID, or matching against all of the user\'s registered keys when the key ID is omitted — and advances the approval quorum. Endpoint Permission: Owner, Admin, Non-Signing Admin, Approver, Signer, Security Admin. * @summary Approve an approval request * @param {ApproveApprovalRequest} approveApprovalRequest * @param {string} requestId The approval request ID. * @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 approveApproval(approveApprovalRequest: ApproveApprovalRequest, requestId: string, idempotencyKey?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.approveApproval(approveApprovalRequest, requestId, idempotencyKey, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['ApprovalsBetaApi.approveApproval']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Register an approval public key for an API user, used to sign approval requests. Up to 2 active keys are supported per API user. Returns the server-generated key ID used for deletion. The `userId` must be the authenticated API user\'s own ID. Registering a key for another user is not supported and is rejected. Registration may require approval. In that case the response carries `ccrIdPendingRegistration`, the key reads as `APPROVAL_API_KEY_STATUS_PENDING_REGISTRATION` and cannot sign until the request is approved. A rejected request removes the key. Endpoint Permission: Owner, Admin, Non-Signing Admin, Approver, Signer, Security Admin. * @summary Register an approval key * @param {RegisterApprovalApiKeyRequest} registerApprovalApiKeyRequest * @param {string} userId The ID of the API user to register the approval key for. * @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 createApprovalKey(registerApprovalApiKeyRequest: RegisterApprovalApiKeyRequest, userId: string, idempotencyKey?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.createApprovalKey(registerApprovalApiKeyRequest, userId, idempotencyKey, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['ApprovalsBetaApi.createApprovalKey']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Delete (revoke) an approval public key for the specified API user. The deletion may require approval: it always does for the API user\'s last key or another user\'s key. In that case the response carries `ccrIdPendingDeletion`, the key reads as `APPROVAL_API_KEY_STATUS_PENDING_DELETION` and stays active until the request is approved. A rejected request leaves the key enabled. Endpoint Permission: Owner, Admin, Non-Signing Admin, Approver, Signer, Security Admin. * @summary Delete an approval key * @param {string} userId The ID of the API user whose approval key to delete. * @param {string} keyId The ID of the approval key to delete. * @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 deleteApprovalKey(userId: string, keyId: string, idempotencyKey?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteApprovalKey(userId, keyId, idempotencyKey, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['ApprovalsBetaApi.deleteApprovalKey']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Retrieve full detail for a single approval request by ID, including the payload to sign and, when requested, the request\'s `quorumStatus`. Because this endpoint addresses one request, it accepts `quorumStatusMode=FULL`, which adds the participating approvers and their individual approval state. `userStatus` reflects the authenticated user by default. Pass `userId` to report it for another user instead. Endpoint Permission: Owner, Admin, Non-Signing Admin, Approver, Signer, Security Admin, Security Auditor. * @summary Get a single approval request * @param {string} requestId The approval request ID. * @param {string} [userId] Report `userStatus` for this user instead of the authenticated user. This selects whose approval state is returned; it does not change which requests can be fetched. Requires an Admin, Non-Signing Admin, Security Admin or Security Auditor role; other roles are rejected with 403. * @param {GetApprovalByIdQuorumStatusModeEnum} [quorumStatusMode] How much quorum detail to include in `quorumStatus`. `NONE` (the default) returns it as `null`. `SUMMARY` returns the approval thresholds, current counts and status. `FULL` adds `users` and the per-group `members` indexes identifying who may approve and who already has. Any other value is rejected with 400; the parameter is case-sensitive. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getApprovalById(requestId: string, userId?: string, quorumStatusMode?: GetApprovalByIdQuorumStatusModeEnum, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getApprovalById(requestId, userId, quorumStatusMode, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['ApprovalsBetaApi.getApprovalById']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * List the approval public keys registered for the specified API user. Endpoint Permission: Owner, Admin, Non-Signing Admin, Approver, Signer, Security Admin, Security Auditor. * @summary List approval keys * @param {string} userId The ID of the API user whose approval keys to list. * @param {number} [pageSize] Number of results per page. Maximum 15. Defaults to 10. * @param {string} [pageCursor] Cursor returned from the previous response (the `next` field) to fetch the next page. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getApprovalKeys(userId: string, pageSize?: number, pageCursor?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getApprovalKeys(userId, pageSize, pageCursor, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['ApprovalsBetaApi.getApprovalKeys']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Retrieve the pending approval requests the authenticated API user is eligible to act on, including requests the user has already approved that are still pending overall. The response is scoped to the authenticated user by default. Pass `userId` to read another user\'s queue, or `includeAllUsers=true` to read every pending request in the workspace. Both require an Admin, Non-Signing Admin, Security Admin or Security Auditor role and are rejected with 403 otherwise. Set `quorumStatusMode=SUMMARY` to include each request\'s approval thresholds and counts. The per-approver breakdown is available only when fetching a single request — see `GET /approvals/{requestId}`. Endpoint Permission: Owner, Admin, Non-Signing Admin, Approver, Signer, Security Admin, Security Auditor. * @summary List approval requests * @param {boolean} [includeUserApproved] When true, also include requests the authenticated user has already approved that are still pending overall. Defaults to false (only requests the user has not yet acted on). * @param {string} [userId] Return the pending requests for this user instead of the authenticated user. Requires an Admin, Non-Signing Admin, Security Admin or Security Auditor role; other roles are rejected with 403. Cannot be combined with `includeAllUsers=true` — sending both is rejected with 400. * @param {boolean} [includeAllUsers] When true, return every pending request in the workspace instead of a single user\'s queue. Defaults to false. Requires an Admin, Non-Signing Admin, Security Admin or Security Auditor role; other roles are rejected with 403. In this mode `userStatus` is always `USER_STATUS_NOT_APPLICABLE`, because the response is not scoped to one user, and `includeUserApproved` has no effect. Cannot be combined with `userId`. * @param {GetApprovalsQuorumStatusModeEnum} [quorumStatusMode] How much quorum detail to include in each request\'s `quorumStatus`. `NONE` (the default) returns it as `null`. `SUMMARY` returns the approval thresholds, current counts and status. `FULL` is rejected with 400 on this endpoint because the per-approver breakdown requires a single request — use `GET /approvals/{requestId}` for it. Any other value is rejected with 400; the parameter is case-sensitive. * @param {number} [pageSize] Number of results per page. Maximum 30. Defaults to 20. * @param {string} [pageCursor] Cursor returned from the previous response (the `next` field) to fetch the next page. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getApprovals(includeUserApproved?: boolean, userId?: string, includeAllUsers?: boolean, quorumStatusMode?: GetApprovalsQuorumStatusModeEnum, pageSize?: number, pageCursor?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getApprovals(includeUserApproved, userId, includeAllUsers, quorumStatusMode, pageSize, pageCursor, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['ApprovalsBetaApi.getApprovals']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Reject a pending approval request as the authenticated API user. No signature is required (unlike approve). The caller must be eligible to act on the request; rejecting finalizes the request as rejected per the approval policy. Endpoint Permission: Owner, Admin, Non-Signing Admin, Approver, Signer, Security Admin. * @summary Reject an approval request * @param {string} requestId The approval request ID. * @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 rejectApproval(requestId: string, idempotencyKey?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.rejectApproval(requestId, idempotencyKey, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['ApprovalsBetaApi.rejectApproval']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, } }; /** * ApprovalsBetaApi - factory interface * @export */ export const ApprovalsBetaApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = ApprovalsBetaApiFp(configuration) return { /** * Approve a pending approval request as the authenticated API user. The caller signs the request\'s signable data with the private key of a registered approval API key and submits the base64url-encoded signature, optionally with the key ID. The server verifies the signature against the registered public key — using the given key ID, or matching against all of the user\'s registered keys when the key ID is omitted — and advances the approval quorum. Endpoint Permission: Owner, Admin, Non-Signing Admin, Approver, Signer, Security Admin. * @summary Approve an approval request * @param {ApprovalsBetaApiApproveApprovalRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ approveApproval(requestParameters: ApprovalsBetaApiApproveApprovalRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.approveApproval(requestParameters.approveApprovalRequest, requestParameters.requestId, requestParameters.idempotencyKey, options).then((request) => request(axios, basePath)); }, /** * Register an approval public key for an API user, used to sign approval requests. Up to 2 active keys are supported per API user. Returns the server-generated key ID used for deletion. The `userId` must be the authenticated API user\'s own ID. Registering a key for another user is not supported and is rejected. Registration may require approval. In that case the response carries `ccrIdPendingRegistration`, the key reads as `APPROVAL_API_KEY_STATUS_PENDING_REGISTRATION` and cannot sign until the request is approved. A rejected request removes the key. Endpoint Permission: Owner, Admin, Non-Signing Admin, Approver, Signer, Security Admin. * @summary Register an approval key * @param {ApprovalsBetaApiCreateApprovalKeyRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ createApprovalKey(requestParameters: ApprovalsBetaApiCreateApprovalKeyRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.createApprovalKey(requestParameters.registerApprovalApiKeyRequest, requestParameters.userId, requestParameters.idempotencyKey, options).then((request) => request(axios, basePath)); }, /** * Delete (revoke) an approval public key for the specified API user. The deletion may require approval: it always does for the API user\'s last key or another user\'s key. In that case the response carries `ccrIdPendingDeletion`, the key reads as `APPROVAL_API_KEY_STATUS_PENDING_DELETION` and stays active until the request is approved. A rejected request leaves the key enabled. Endpoint Permission: Owner, Admin, Non-Signing Admin, Approver, Signer, Security Admin. * @summary Delete an approval key * @param {ApprovalsBetaApiDeleteApprovalKeyRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteApprovalKey(requestParameters: ApprovalsBetaApiDeleteApprovalKeyRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.deleteApprovalKey(requestParameters.userId, requestParameters.keyId, requestParameters.idempotencyKey, options).then((request) => request(axios, basePath)); }, /** * Retrieve full detail for a single approval request by ID, including the payload to sign and, when requested, the request\'s `quorumStatus`. Because this endpoint addresses one request, it accepts `quorumStatusMode=FULL`, which adds the participating approvers and their individual approval state. `userStatus` reflects the authenticated user by default. Pass `userId` to report it for another user instead. Endpoint Permission: Owner, Admin, Non-Signing Admin, Approver, Signer, Security Admin, Security Auditor. * @summary Get a single approval request * @param {ApprovalsBetaApiGetApprovalByIdRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getApprovalById(requestParameters: ApprovalsBetaApiGetApprovalByIdRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getApprovalById(requestParameters.requestId, requestParameters.userId, requestParameters.quorumStatusMode, options).then((request) => request(axios, basePath)); }, /** * List the approval public keys registered for the specified API user. Endpoint Permission: Owner, Admin, Non-Signing Admin, Approver, Signer, Security Admin, Security Auditor. * @summary List approval keys * @param {ApprovalsBetaApiGetApprovalKeysRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getApprovalKeys(requestParameters: ApprovalsBetaApiGetApprovalKeysRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getApprovalKeys(requestParameters.userId, requestParameters.pageSize, requestParameters.pageCursor, options).then((request) => request(axios, basePath)); }, /** * Retrieve the pending approval requests the authenticated API user is eligible to act on, including requests the user has already approved that are still pending overall. The response is scoped to the authenticated user by default. Pass `userId` to read another user\'s queue, or `includeAllUsers=true` to read every pending request in the workspace. Both require an Admin, Non-Signing Admin, Security Admin or Security Auditor role and are rejected with 403 otherwise. Set `quorumStatusMode=SUMMARY` to include each request\'s approval thresholds and counts. The per-approver breakdown is available only when fetching a single request — see `GET /approvals/{requestId}`. Endpoint Permission: Owner, Admin, Non-Signing Admin, Approver, Signer, Security Admin, Security Auditor. * @summary List approval requests * @param {ApprovalsBetaApiGetApprovalsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getApprovals(requestParameters: ApprovalsBetaApiGetApprovalsRequest = {}, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getApprovals(requestParameters.includeUserApproved, requestParameters.userId, requestParameters.includeAllUsers, requestParameters.quorumStatusMode, requestParameters.pageSize, requestParameters.pageCursor, options).then((request) => request(axios, basePath)); }, /** * Reject a pending approval request as the authenticated API user. No signature is required (unlike approve). The caller must be eligible to act on the request; rejecting finalizes the request as rejected per the approval policy. Endpoint Permission: Owner, Admin, Non-Signing Admin, Approver, Signer, Security Admin. * @summary Reject an approval request * @param {ApprovalsBetaApiRejectApprovalRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ rejectApproval(requestParameters: ApprovalsBetaApiRejectApprovalRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.rejectApproval(requestParameters.requestId, requestParameters.idempotencyKey, options).then((request) => request(axios, basePath)); }, }; }; /** * Request parameters for approveApproval operation in ApprovalsBetaApi. * @export * @interface ApprovalsBetaApiApproveApprovalRequest */ export interface ApprovalsBetaApiApproveApprovalRequest { /** * * @type {ApproveApprovalRequest} * @memberof ApprovalsBetaApiApproveApproval */ readonly approveApprovalRequest: ApproveApprovalRequest /** * The approval request ID. * @type {string} * @memberof ApprovalsBetaApiApproveApproval */ readonly requestId: 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 ApprovalsBetaApiApproveApproval */ readonly idempotencyKey?: string } /** * Request parameters for createApprovalKey operation in ApprovalsBetaApi. * @export * @interface ApprovalsBetaApiCreateApprovalKeyRequest */ export interface ApprovalsBetaApiCreateApprovalKeyRequest { /** * * @type {RegisterApprovalApiKeyRequest} * @memberof ApprovalsBetaApiCreateApprovalKey */ readonly registerApprovalApiKeyRequest: RegisterApprovalApiKeyRequest /** * The ID of the API user to register the approval key for. * @type {string} * @memberof ApprovalsBetaApiCreateApprovalKey */ readonly userId: 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 ApprovalsBetaApiCreateApprovalKey */ readonly idempotencyKey?: string } /** * Request parameters for deleteApprovalKey operation in ApprovalsBetaApi. * @export * @interface ApprovalsBetaApiDeleteApprovalKeyRequest */ export interface ApprovalsBetaApiDeleteApprovalKeyRequest { /** * The ID of the API user whose approval key to delete. * @type {string} * @memberof ApprovalsBetaApiDeleteApprovalKey */ readonly userId: string /** * The ID of the approval key to delete. * @type {string} * @memberof ApprovalsBetaApiDeleteApprovalKey */ readonly keyId: 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 ApprovalsBetaApiDeleteApprovalKey */ readonly idempotencyKey?: string } /** * Request parameters for getApprovalById operation in ApprovalsBetaApi. * @export * @interface ApprovalsBetaApiGetApprovalByIdRequest */ export interface ApprovalsBetaApiGetApprovalByIdRequest { /** * The approval request ID. * @type {string} * @memberof ApprovalsBetaApiGetApprovalById */ readonly requestId: string /** * Report `userStatus` for this user instead of the authenticated user. This selects whose approval state is returned; it does not change which requests can be fetched. Requires an Admin, Non-Signing Admin, Security Admin or Security Auditor role; other roles are rejected with 403. * @type {string} * @memberof ApprovalsBetaApiGetApprovalById */ readonly userId?: string /** * How much quorum detail to include in `quorumStatus`. `NONE` (the default) returns it as `null`. `SUMMARY` returns the approval thresholds, current counts and status. `FULL` adds `users` and the per-group `members` indexes identifying who may approve and who already has. Any other value is rejected with 400; the parameter is case-sensitive. * @type {'NONE' | 'SUMMARY' | 'FULL'} * @memberof ApprovalsBetaApiGetApprovalById */ readonly quorumStatusMode?: GetApprovalByIdQuorumStatusModeEnum } /** * Request parameters for getApprovalKeys operation in ApprovalsBetaApi. * @export * @interface ApprovalsBetaApiGetApprovalKeysRequest */ export interface ApprovalsBetaApiGetApprovalKeysRequest { /** * The ID of the API user whose approval keys to list. * @type {string} * @memberof ApprovalsBetaApiGetApprovalKeys */ readonly userId: string /** * Number of results per page. Maximum 15. Defaults to 10. * @type {number} * @memberof ApprovalsBetaApiGetApprovalKeys */ readonly pageSize?: number /** * Cursor returned from the previous response (the `next` field) to fetch the next page. * @type {string} * @memberof ApprovalsBetaApiGetApprovalKeys */ readonly pageCursor?: string } /** * Request parameters for getApprovals operation in ApprovalsBetaApi. * @export * @interface ApprovalsBetaApiGetApprovalsRequest */ export interface ApprovalsBetaApiGetApprovalsRequest { /** * When true, also include requests the authenticated user has already approved that are still pending overall. Defaults to false (only requests the user has not yet acted on). * @type {boolean} * @memberof ApprovalsBetaApiGetApprovals */ readonly includeUserApproved?: boolean /** * Return the pending requests for this user instead of the authenticated user. Requires an Admin, Non-Signing Admin, Security Admin or Security Auditor role; other roles are rejected with 403. Cannot be combined with `includeAllUsers=true` — sending both is rejected with 400. * @type {string} * @memberof ApprovalsBetaApiGetApprovals */ readonly userId?: string /** * When true, return every pending request in the workspace instead of a single user\'s queue. Defaults to false. Requires an Admin, Non-Signing Admin, Security Admin or Security Auditor role; other roles are rejected with 403. In this mode `userStatus` is always `USER_STATUS_NOT_APPLICABLE`, because the response is not scoped to one user, and `includeUserApproved` has no effect. Cannot be combined with `userId`. * @type {boolean} * @memberof ApprovalsBetaApiGetApprovals */ readonly includeAllUsers?: boolean /** * How much quorum detail to include in each request\'s `quorumStatus`. `NONE` (the default) returns it as `null`. `SUMMARY` returns the approval thresholds, current counts and status. `FULL` is rejected with 400 on this endpoint because the per-approver breakdown requires a single request — use `GET /approvals/{requestId}` for it. Any other value is rejected with 400; the parameter is case-sensitive. * @type {'NONE' | 'SUMMARY'} * @memberof ApprovalsBetaApiGetApprovals */ readonly quorumStatusMode?: GetApprovalsQuorumStatusModeEnum /** * Number of results per page. Maximum 30. Defaults to 20. * @type {number} * @memberof ApprovalsBetaApiGetApprovals */ readonly pageSize?: number /** * Cursor returned from the previous response (the `next` field) to fetch the next page. * @type {string} * @memberof ApprovalsBetaApiGetApprovals */ readonly pageCursor?: string } /** * Request parameters for rejectApproval operation in ApprovalsBetaApi. * @export * @interface ApprovalsBetaApiRejectApprovalRequest */ export interface ApprovalsBetaApiRejectApprovalRequest { /** * The approval request ID. * @type {string} * @memberof ApprovalsBetaApiRejectApproval */ readonly requestId: 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 ApprovalsBetaApiRejectApproval */ readonly idempotencyKey?: string } /** * ApprovalsBetaApi - object-oriented interface * @export * @class ApprovalsBetaApi * @extends {BaseAPI} */ export class ApprovalsBetaApi extends BaseAPI { /** * Approve a pending approval request as the authenticated API user. The caller signs the request\'s signable data with the private key of a registered approval API key and submits the base64url-encoded signature, optionally with the key ID. The server verifies the signature against the registered public key — using the given key ID, or matching against all of the user\'s registered keys when the key ID is omitted — and advances the approval quorum. Endpoint Permission: Owner, Admin, Non-Signing Admin, Approver, Signer, Security Admin. * @summary Approve an approval request * @param {ApprovalsBetaApiApproveApprovalRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ApprovalsBetaApi */ public approveApproval(requestParameters: ApprovalsBetaApiApproveApprovalRequest) { return ApprovalsBetaApiFp(this.configuration).approveApproval(requestParameters.approveApprovalRequest, requestParameters.requestId, requestParameters.idempotencyKey).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Register an approval public key for an API user, used to sign approval requests. Up to 2 active keys are supported per API user. Returns the server-generated key ID used for deletion. The `userId` must be the authenticated API user\'s own ID. Registering a key for another user is not supported and is rejected. Registration may require approval. In that case the response carries `ccrIdPendingRegistration`, the key reads as `APPROVAL_API_KEY_STATUS_PENDING_REGISTRATION` and cannot sign until the request is approved. A rejected request removes the key. Endpoint Permission: Owner, Admin, Non-Signing Admin, Approver, Signer, Security Admin. * @summary Register an approval key * @param {ApprovalsBetaApiCreateApprovalKeyRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ApprovalsBetaApi */ public createApprovalKey(requestParameters: ApprovalsBetaApiCreateApprovalKeyRequest) { return ApprovalsBetaApiFp(this.configuration).createApprovalKey(requestParameters.registerApprovalApiKeyRequest, requestParameters.userId, requestParameters.idempotencyKey).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Delete (revoke) an approval public key for the specified API user. The deletion may require approval: it always does for the API user\'s last key or another user\'s key. In that case the response carries `ccrIdPendingDeletion`, the key reads as `APPROVAL_API_KEY_STATUS_PENDING_DELETION` and stays active until the request is approved. A rejected request leaves the key enabled. Endpoint Permission: Owner, Admin, Non-Signing Admin, Approver, Signer, Security Admin. * @summary Delete an approval key * @param {ApprovalsBetaApiDeleteApprovalKeyRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ApprovalsBetaApi */ public deleteApprovalKey(requestParameters: ApprovalsBetaApiDeleteApprovalKeyRequest) { return ApprovalsBetaApiFp(this.configuration).deleteApprovalKey(requestParameters.userId, requestParameters.keyId, requestParameters.idempotencyKey).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Retrieve full detail for a single approval request by ID, including the payload to sign and, when requested, the request\'s `quorumStatus`. Because this endpoint addresses one request, it accepts `quorumStatusMode=FULL`, which adds the participating approvers and their individual approval state. `userStatus` reflects the authenticated user by default. Pass `userId` to report it for another user instead. Endpoint Permission: Owner, Admin, Non-Signing Admin, Approver, Signer, Security Admin, Security Auditor. * @summary Get a single approval request * @param {ApprovalsBetaApiGetApprovalByIdRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ApprovalsBetaApi */ public getApprovalById(requestParameters: ApprovalsBetaApiGetApprovalByIdRequest) { return ApprovalsBetaApiFp(this.configuration).getApprovalById(requestParameters.requestId, requestParameters.userId, requestParameters.quorumStatusMode).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * List the approval public keys registered for the specified API user. Endpoint Permission: Owner, Admin, Non-Signing Admin, Approver, Signer, Security Admin, Security Auditor. * @summary List approval keys * @param {ApprovalsBetaApiGetApprovalKeysRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ApprovalsBetaApi */ public getApprovalKeys(requestParameters: ApprovalsBetaApiGetApprovalKeysRequest) { return ApprovalsBetaApiFp(this.configuration).getApprovalKeys(requestParameters.userId, requestParameters.pageSize, requestParameters.pageCursor).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Retrieve the pending approval requests the authenticated API user is eligible to act on, including requests the user has already approved that are still pending overall. The response is scoped to the authenticated user by default. Pass `userId` to read another user\'s queue, or `includeAllUsers=true` to read every pending request in the workspace. Both require an Admin, Non-Signing Admin, Security Admin or Security Auditor role and are rejected with 403 otherwise. Set `quorumStatusMode=SUMMARY` to include each request\'s approval thresholds and counts. The per-approver breakdown is available only when fetching a single request — see `GET /approvals/{requestId}`. Endpoint Permission: Owner, Admin, Non-Signing Admin, Approver, Signer, Security Admin, Security Auditor. * @summary List approval requests * @param {ApprovalsBetaApiGetApprovalsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ApprovalsBetaApi */ public getApprovals(requestParameters: ApprovalsBetaApiGetApprovalsRequest = {}) { return ApprovalsBetaApiFp(this.configuration).getApprovals(requestParameters.includeUserApproved, requestParameters.userId, requestParameters.includeAllUsers, requestParameters.quorumStatusMode, requestParameters.pageSize, requestParameters.pageCursor).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Reject a pending approval request as the authenticated API user. No signature is required (unlike approve). The caller must be eligible to act on the request; rejecting finalizes the request as rejected per the approval policy. Endpoint Permission: Owner, Admin, Non-Signing Admin, Approver, Signer, Security Admin. * @summary Reject an approval request * @param {ApprovalsBetaApiRejectApprovalRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ApprovalsBetaApi */ public rejectApproval(requestParameters: ApprovalsBetaApiRejectApprovalRequest) { return ApprovalsBetaApiFp(this.configuration).rejectApproval(requestParameters.requestId, requestParameters.idempotencyKey).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } } /** * @export */ export const GetApprovalByIdQuorumStatusModeEnum = { None: 'NONE', Summary: 'SUMMARY', Full: 'FULL' } as const; export type GetApprovalByIdQuorumStatusModeEnum = typeof GetApprovalByIdQuorumStatusModeEnum[keyof typeof GetApprovalByIdQuorumStatusModeEnum]; /** * @export */ export const GetApprovalsQuorumStatusModeEnum = { None: 'NONE', Summary: 'SUMMARY' } as const; export type GetApprovalsQuorumStatusModeEnum = typeof GetApprovalsQuorumStatusModeEnum[keyof typeof GetApprovalsQuorumStatusModeEnum];