UNPKG

@openzeppelin/relayer-sdk

Version:
431 lines (430 loc) 23.2 kB
"use strict"; /* 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()); }); }; Object.defineProperty(exports, "__esModule", { value: true }); exports.SignersApi = exports.SignersApiFactory = exports.SignersApiFp = exports.SignersApiAxiosParamCreator = void 0; const axios_1 = require("axios"); // Some imports not used depending on template conditions // @ts-ignore const common_1 = require("../common"); // @ts-ignore const base_1 = require("../base"); /** * SignersApi - axios parameter creator * @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 (0, common_1.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, common_1.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 (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); localVarHeaderParameter['Content-Type'] = 'application/json'; (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(signerCreateRequest, localVarRequestOptions, configuration); return { url: (0, common_1.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 (0, common_1.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, common_1.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 (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); return { url: (0, common_1.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 (0, common_1.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, common_1.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 (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); return { url: (0, common_1.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, common_1.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 (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); if (page !== undefined) { localVarQueryParameter['page'] = page; } if (perPage !== undefined) { localVarQueryParameter['per_page'] = perPage; } (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); return { url: (0, common_1.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 (0, common_1.assertParamExists)('updateSigner', 'signerId', signerId); // verify required parameter 'body' is not null or undefined (0, common_1.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, common_1.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 (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); localVarHeaderParameter['Content-Type'] = 'application/json'; (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(body, localVarRequestOptions, configuration); return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }), }; }; exports.SignersApiAxiosParamCreator = SignersApiAxiosParamCreator; /** * SignersApi - functional programming interface * @export */ const SignersApiFp = function (configuration) { const localVarAxiosParamCreator = (0, exports.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 = base_1.operationServerMap['SignersApi.createSigner']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.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 = base_1.operationServerMap['SignersApi.deleteSigner']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.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 = base_1.operationServerMap['SignersApi.getSigner']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.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 = base_1.operationServerMap['SignersApi.listSigners']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.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 = base_1.operationServerMap['SignersApi.updateSigner']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }); }, }; }; exports.SignersApiFp = SignersApiFp; /** * SignersApi - factory interface * @export */ const SignersApiFactory = function (configuration, basePath, axios) { const localVarFp = (0, exports.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)); }, }; }; exports.SignersApiFactory = SignersApiFactory; /** * SignersApi - object-oriented interface * @export * @class SignersApi * @extends {BaseAPI} */ class SignersApi extends base_1.BaseAPI { /** * * @summary Creates a new signer. * @param {SignerCreateRequest} signerCreateRequest * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof SignersApi */ createSigner(signerCreateRequest, options) { return (0, exports.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 (0, exports.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 (0, exports.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 (0, exports.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 (0, exports.SignersApiFp)(this.configuration).updateSigner(signerId, body, options).then((request) => request(this.axios, this.basePath)); } } exports.SignersApi = SignersApi;