@openzeppelin/relayer-sdk
Version:
OpenZeppelin Relayer SDK
424 lines (423 loc) • 22.4 kB
JavaScript
/* tslint:disable */
/* eslint-disable */
/**
* OpenZeppelin Relayer API
* OpenZeppelin Relayer API
*
* 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.
*/
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
import globalAxios from 'axios';
// Some imports not used depending on template conditions
// @ts-ignore
import { DUMMY_BASE_URL, assertParamExists, setBearerAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common';
// @ts-ignore
import { BASE_PATH, BaseAPI, operationServerMap } from '../base';
/**
* SignersApi - axios parameter creator
* @export
*/
export const SignersApiAxiosParamCreator = function (configuration) {
return {
/**
*
* @summary Creates a new signer.
* @param {SignerCreateRequest} signerCreateRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createSigner: (signerCreateRequest_1, ...args_1) => __awaiter(this, [signerCreateRequest_1, ...args_1], void 0, function* (signerCreateRequest, options = {}) {
// verify required parameter 'signerCreateRequest' is not null or undefined
assertParamExists('createSigner', 'signerCreateRequest', signerCreateRequest);
const localVarPath = `/api/v1/signers`;
// 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 = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication bearer_auth required
// http bearer authentication required
yield setBearerAuthToObject(localVarHeaderParameter, configuration);
localVarHeaderParameter['Content-Type'] = 'application/json';
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
localVarRequestOptions.data = serializeDataIfNeeded(signerCreateRequest, localVarRequestOptions, configuration);
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
}),
/**
*
* @summary Deletes a signer by ID.
* @param {string} signerId Signer ID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
deleteSigner: (signerId_1, ...args_1) => __awaiter(this, [signerId_1, ...args_1], void 0, function* (signerId, options = {}) {
// verify required parameter 'signerId' is not null or undefined
assertParamExists('deleteSigner', 'signerId', signerId);
const localVarPath = `/api/v1/signers/{signer_id}`
.replace(`{${"signer_id"}}`, encodeURIComponent(String(signerId)));
// 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 = Object.assign(Object.assign({ method: 'DELETE' }, baseOptions), options);
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication bearer_auth required
// http bearer authentication required
yield setBearerAuthToObject(localVarHeaderParameter, configuration);
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
}),
/**
*
* @summary Retrieves details of a specific signer by ID.
* @param {string} signerId Signer ID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getSigner: (signerId_1, ...args_1) => __awaiter(this, [signerId_1, ...args_1], void 0, function* (signerId, options = {}) {
// verify required parameter 'signerId' is not null or undefined
assertParamExists('getSigner', 'signerId', signerId);
const localVarPath = `/api/v1/signers/{signer_id}`
.replace(`{${"signer_id"}}`, encodeURIComponent(String(signerId)));
// 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 = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication bearer_auth required
// http bearer authentication required
yield setBearerAuthToObject(localVarHeaderParameter, configuration);
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
}),
/**
* Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Lists all signers with pagination support.
* @summary Signer routes implementation
* @param {number} [page] Page number for pagination (starts at 1)
* @param {number} [perPage] Number of items per page (default: 10)
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
listSigners: (page_1, perPage_1, ...args_1) => __awaiter(this, [page_1, perPage_1, ...args_1], void 0, function* (page, perPage, options = {}) {
const localVarPath = `/api/v1/signers`;
// 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 = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication bearer_auth required
// http bearer authentication required
yield setBearerAuthToObject(localVarHeaderParameter, configuration);
if (page !== undefined) {
localVarQueryParameter['page'] = page;
}
if (perPage !== undefined) {
localVarQueryParameter['per_page'] = perPage;
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
}),
/**
*
* @summary Updates an existing signer.
* @param {string} signerId Signer ID
* @param {object} body
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
updateSigner: (signerId_1, body_1, ...args_1) => __awaiter(this, [signerId_1, body_1, ...args_1], void 0, function* (signerId, body, options = {}) {
// verify required parameter 'signerId' is not null or undefined
assertParamExists('updateSigner', 'signerId', signerId);
// verify required parameter 'body' is not null or undefined
assertParamExists('updateSigner', 'body', body);
const localVarPath = `/api/v1/signers/{signer_id}`
.replace(`{${"signer_id"}}`, encodeURIComponent(String(signerId)));
// 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 = Object.assign(Object.assign({ method: 'PATCH' }, baseOptions), options);
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication bearer_auth required
// http bearer authentication required
yield setBearerAuthToObject(localVarHeaderParameter, configuration);
localVarHeaderParameter['Content-Type'] = 'application/json';
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration);
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
}),
};
};
/**
* SignersApi - functional programming interface
* @export
*/
export const SignersApiFp = function (configuration) {
const localVarAxiosParamCreator = SignersApiAxiosParamCreator(configuration);
return {
/**
*
* @summary Creates a new signer.
* @param {SignerCreateRequest} signerCreateRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createSigner(signerCreateRequest, options) {
return __awaiter(this, void 0, void 0, function* () {
var _a, _b, _c;
const localVarAxiosArgs = yield localVarAxiosParamCreator.createSigner(signerCreateRequest, options);
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
const localVarOperationServerBasePath = (_c = (_b = operationServerMap['SignersApi.createSigner']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
});
},
/**
*
* @summary Deletes a signer by ID.
* @param {string} signerId Signer ID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
deleteSigner(signerId, options) {
return __awaiter(this, void 0, void 0, function* () {
var _a, _b, _c;
const localVarAxiosArgs = yield localVarAxiosParamCreator.deleteSigner(signerId, options);
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
const localVarOperationServerBasePath = (_c = (_b = operationServerMap['SignersApi.deleteSigner']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
});
},
/**
*
* @summary Retrieves details of a specific signer by ID.
* @param {string} signerId Signer ID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getSigner(signerId, options) {
return __awaiter(this, void 0, void 0, function* () {
var _a, _b, _c;
const localVarAxiosArgs = yield localVarAxiosParamCreator.getSigner(signerId, options);
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
const localVarOperationServerBasePath = (_c = (_b = operationServerMap['SignersApi.getSigner']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
});
},
/**
* Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Lists all signers with pagination support.
* @summary Signer routes implementation
* @param {number} [page] Page number for pagination (starts at 1)
* @param {number} [perPage] Number of items per page (default: 10)
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
listSigners(page, perPage, options) {
return __awaiter(this, void 0, void 0, function* () {
var _a, _b, _c;
const localVarAxiosArgs = yield localVarAxiosParamCreator.listSigners(page, perPage, options);
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
const localVarOperationServerBasePath = (_c = (_b = operationServerMap['SignersApi.listSigners']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
});
},
/**
*
* @summary Updates an existing signer.
* @param {string} signerId Signer ID
* @param {object} body
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
updateSigner(signerId, body, options) {
return __awaiter(this, void 0, void 0, function* () {
var _a, _b, _c;
const localVarAxiosArgs = yield localVarAxiosParamCreator.updateSigner(signerId, body, options);
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
const localVarOperationServerBasePath = (_c = (_b = operationServerMap['SignersApi.updateSigner']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
});
},
};
};
/**
* SignersApi - factory interface
* @export
*/
export const SignersApiFactory = function (configuration, basePath, axios) {
const localVarFp = SignersApiFp(configuration);
return {
/**
*
* @summary Creates a new signer.
* @param {SignerCreateRequest} signerCreateRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createSigner(signerCreateRequest, options) {
return localVarFp.createSigner(signerCreateRequest, options).then((request) => request(axios, basePath));
},
/**
*
* @summary Deletes a signer by ID.
* @param {string} signerId Signer ID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
deleteSigner(signerId, options) {
return localVarFp.deleteSigner(signerId, options).then((request) => request(axios, basePath));
},
/**
*
* @summary Retrieves details of a specific signer by ID.
* @param {string} signerId Signer ID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getSigner(signerId, options) {
return localVarFp.getSigner(signerId, options).then((request) => request(axios, basePath));
},
/**
* Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Lists all signers with pagination support.
* @summary Signer routes implementation
* @param {number} [page] Page number for pagination (starts at 1)
* @param {number} [perPage] Number of items per page (default: 10)
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
listSigners(page, perPage, options) {
return localVarFp.listSigners(page, perPage, options).then((request) => request(axios, basePath));
},
/**
*
* @summary Updates an existing signer.
* @param {string} signerId Signer ID
* @param {object} body
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
updateSigner(signerId, body, options) {
return localVarFp.updateSigner(signerId, body, options).then((request) => request(axios, basePath));
},
};
};
/**
* SignersApi - object-oriented interface
* @export
* @class SignersApi
* @extends {BaseAPI}
*/
export class SignersApi extends BaseAPI {
/**
*
* @summary Creates a new signer.
* @param {SignerCreateRequest} signerCreateRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SignersApi
*/
createSigner(signerCreateRequest, options) {
return SignersApiFp(this.configuration).createSigner(signerCreateRequest, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @summary Deletes a signer by ID.
* @param {string} signerId Signer ID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SignersApi
*/
deleteSigner(signerId, options) {
return SignersApiFp(this.configuration).deleteSigner(signerId, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @summary Retrieves details of a specific signer by ID.
* @param {string} signerId Signer ID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SignersApi
*/
getSigner(signerId, options) {
return SignersApiFp(this.configuration).getSigner(signerId, options).then((request) => request(this.axios, this.basePath));
}
/**
* Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Lists all signers with pagination support.
* @summary Signer routes implementation
* @param {number} [page] Page number for pagination (starts at 1)
* @param {number} [perPage] Number of items per page (default: 10)
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SignersApi
*/
listSigners(page, perPage, options) {
return SignersApiFp(this.configuration).listSigners(page, perPage, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @summary Updates an existing signer.
* @param {string} signerId Signer ID
* @param {object} body
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SignersApi
*/
updateSigner(signerId, body, options) {
return SignersApiFp(this.configuration).updateSigner(signerId, body, options).then((request) => request(this.axios, this.basePath));
}
}