@standard-crypto/farcaster-js-warpcast
Version:
A tool for interacting with the private APIs of the Warpcast client.
263 lines • 12.9 kB
JavaScript
;
/* tslint:disable */
/* eslint-disable */
/**
* Warpcast API
* Private API used by the Warpcast client
*
* The version of the OpenAPI document: 1.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 __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.DirectCastsApi = exports.DirectCastsApiFactory = exports.DirectCastsApiFp = exports.DirectCastsApiAxiosParamCreator = void 0;
const axios_1 = __importDefault(require("axios"));
// Some imports not used depending on template conditions
// @ts-ignore
const common_js_1 = require("../common.js");
// @ts-ignore
const base_js_1 = require("../base.js");
/**
* DirectCastsApi - axios parameter creator
* @export
*/
const DirectCastsApiAxiosParamCreator = function (configuration) {
return {
/**
*
* @param {string} conversationId
* @param {number} [limit] Maximum number of items to return in a single response
* @param {string} [cursor] Cursor to paginate through results
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
v2DirectCastConversationDetailsGet: async (conversationId, limit, cursor, options = {}) => {
// verify required parameter 'conversationId' is not null or undefined
(0, common_js_1.assertParamExists)('v2DirectCastConversationDetailsGet', 'conversationId', conversationId);
const localVarPath = `/v2/direct-cast-conversation-details`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_js_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication TokenCredentials required
// http bearer authentication required
await (0, common_js_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
if (conversationId !== undefined) {
localVarQueryParameter['conversationId'] = conversationId;
}
if (limit !== undefined) {
localVarQueryParameter['limit'] = limit;
}
if (cursor !== undefined) {
localVarQueryParameter['cursor'] = cursor;
}
(0, common_js_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: (0, common_js_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @param {string} conversationId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
v2DirectCastConversationGet: async (conversationId, options = {}) => {
// verify required parameter 'conversationId' is not null or undefined
(0, common_js_1.assertParamExists)('v2DirectCastConversationGet', 'conversationId', conversationId);
const localVarPath = `/v2/direct-cast-conversation`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_js_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication TokenCredentials required
// http bearer authentication required
await (0, common_js_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
if (conversationId !== undefined) {
localVarQueryParameter['conversationId'] = conversationId;
}
(0, common_js_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: (0, common_js_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @param {number} [limit] Maximum number of items to return in a single response
* @param {string} [cursor] Cursor to paginate through results
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
v2DirectCastConversationListGet: async (limit, cursor, options = {}) => {
const localVarPath = `/v2/direct-cast-conversation-list`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_js_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication TokenCredentials required
// http bearer authentication required
await (0, common_js_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
if (limit !== undefined) {
localVarQueryParameter['limit'] = limit;
}
if (cursor !== undefined) {
localVarQueryParameter['cursor'] = cursor;
}
(0, common_js_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: (0, common_js_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
};
};
exports.DirectCastsApiAxiosParamCreator = DirectCastsApiAxiosParamCreator;
/**
* DirectCastsApi - functional programming interface
* @export
*/
const DirectCastsApiFp = function (configuration) {
const localVarAxiosParamCreator = (0, exports.DirectCastsApiAxiosParamCreator)(configuration);
return {
/**
*
* @param {string} conversationId
* @param {number} [limit] Maximum number of items to return in a single response
* @param {string} [cursor] Cursor to paginate through results
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async v2DirectCastConversationDetailsGet(conversationId, limit, cursor, options) {
const localVarAxiosArgs = await localVarAxiosParamCreator.v2DirectCastConversationDetailsGet(conversationId, limit, cursor, options);
return (0, common_js_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_js_1.BASE_PATH, configuration);
},
/**
*
* @param {string} conversationId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async v2DirectCastConversationGet(conversationId, options) {
const localVarAxiosArgs = await localVarAxiosParamCreator.v2DirectCastConversationGet(conversationId, options);
return (0, common_js_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_js_1.BASE_PATH, configuration);
},
/**
*
* @param {number} [limit] Maximum number of items to return in a single response
* @param {string} [cursor] Cursor to paginate through results
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async v2DirectCastConversationListGet(limit, cursor, options) {
const localVarAxiosArgs = await localVarAxiosParamCreator.v2DirectCastConversationListGet(limit, cursor, options);
return (0, common_js_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_js_1.BASE_PATH, configuration);
},
};
};
exports.DirectCastsApiFp = DirectCastsApiFp;
/**
* DirectCastsApi - factory interface
* @export
*/
const DirectCastsApiFactory = function (configuration, basePath, axios) {
const localVarFp = (0, exports.DirectCastsApiFp)(configuration);
return {
/**
*
* @param {DirectCastsApiV2DirectCastConversationDetailsGetRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
v2DirectCastConversationDetailsGet(requestParameters, options) {
return localVarFp.v2DirectCastConversationDetailsGet(requestParameters.conversationId, requestParameters.limit, requestParameters.cursor, options).then((request) => request(axios, basePath));
},
/**
*
* @param {DirectCastsApiV2DirectCastConversationGetRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
v2DirectCastConversationGet(requestParameters, options) {
return localVarFp.v2DirectCastConversationGet(requestParameters.conversationId, options).then((request) => request(axios, basePath));
},
/**
*
* @param {DirectCastsApiV2DirectCastConversationListGetRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
v2DirectCastConversationListGet(requestParameters = {}, options) {
return localVarFp.v2DirectCastConversationListGet(requestParameters.limit, requestParameters.cursor, options).then((request) => request(axios, basePath));
},
};
};
exports.DirectCastsApiFactory = DirectCastsApiFactory;
/**
* DirectCastsApi - object-oriented interface
* @export
* @class DirectCastsApi
* @extends {BaseAPI}
*/
class DirectCastsApi extends base_js_1.BaseAPI {
/**
*
* @param {DirectCastsApiV2DirectCastConversationDetailsGetRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof DirectCastsApi
*/
v2DirectCastConversationDetailsGet(requestParameters, options) {
return (0, exports.DirectCastsApiFp)(this.configuration).v2DirectCastConversationDetailsGet(requestParameters.conversationId, requestParameters.limit, requestParameters.cursor, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @param {DirectCastsApiV2DirectCastConversationGetRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof DirectCastsApi
*/
v2DirectCastConversationGet(requestParameters, options) {
return (0, exports.DirectCastsApiFp)(this.configuration).v2DirectCastConversationGet(requestParameters.conversationId, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @param {DirectCastsApiV2DirectCastConversationListGetRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof DirectCastsApi
*/
v2DirectCastConversationListGet(requestParameters = {}, options) {
return (0, exports.DirectCastsApiFp)(this.configuration).v2DirectCastConversationListGet(requestParameters.limit, requestParameters.cursor, options).then((request) => request(this.axios, this.basePath));
}
}
exports.DirectCastsApi = DirectCastsApi;
//# sourceMappingURL=direct-casts-api.js.map