UNPKG

@neynar/nodejs-sdk

Version:

SDK to interact with Neynar APIs (https://docs.neynar.com/reference/quickstart)

808 lines (807 loc) 117 kB
"use strict"; /* tslint:disable */ /* eslint-disable */ /** * Neynar API * The Neynar API allows you to interact with the Farcaster protocol among other things. See the [Neynar docs](https://docs.neynar.com/reference) for more details. * * The version of the OpenAPI document: 3.115.0 * Contact: team@neynar.com * * 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.StudioApi = exports.StudioApiFactory = exports.StudioApiFp = exports.StudioApiAxiosParamCreator = void 0; const axios_1 = __importDefault(require("axios")); // Some imports not used depending on template conditions // @ts-ignore const common_1 = require("../common"); // @ts-ignore const base_1 = require("../base"); /** * StudioApi - axios parameter creator * @export */ const StudioApiAxiosParamCreator = function (configuration) { return { /** * Associates a generated miniapp with a Farcaster account using a JFS-signed domain association. Requires API key authentication. * @summary Set account association * @param {AssociateDeploymentRequest} associateDeploymentRequest * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<AssociateDeployment200Response>} A promise that resolves to a `AssociateDeployment200Response` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/associate-deployment) * */ associateDeployment: async (associateDeploymentRequest, options = {}) => { // verify required parameter 'associateDeploymentRequest' is not null or undefined (0, common_1.assertParamExists)('associateDeployment', 'associateDeploymentRequest', associateDeploymentRequest); const localVarPath = `/v2/studio/deployment/account-association`; // 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 ApiKeyAuth required await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-key", 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)(associateDeploymentRequest, localVarRequestOptions, configuration); return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Runs Next.js build process for the generated app. If build fails, automatically calls a build-fixer agent to resolve errors. Streams build output and agent responses via Server-Sent Events. Requires API key authentication. * @summary Build generated app with automatic error fixing * @param {BuildRequest} buildRequest * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<>} A promise that resolves to a `` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/build) * */ build: async (buildRequest, options = {}) => { // verify required parameter 'buildRequest' is not null or undefined (0, common_1.assertParamExists)('build', 'buildRequest', buildRequest); const localVarPath = `/v2/studio/deployment/build`; // 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 ApiKeyAuth required await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-key", 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)(buildRequest, localVarRequestOptions, configuration); return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Creates and deploys an instance of the miniapp generator for a user. Requires authentication via API key in the request header. * @summary Create a miniapp generator deployment * @param {CreateDeploymentRequest} createDeploymentRequest * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<ListDeployments200ResponseInner>} A promise that resolves to a `ListDeployments200ResponseInner` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/create-deployment) * */ createDeployment: async (createDeploymentRequest, options = {}) => { // verify required parameter 'createDeploymentRequest' is not null or undefined (0, common_1.assertParamExists)('createDeployment', 'createDeploymentRequest', createDeploymentRequest); const localVarPath = `/v2/studio/deployment/`; // 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 ApiKeyAuth required await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-key", 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)(createDeploymentRequest, localVarRequestOptions, configuration); return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Deletes a specific miniapp generator deployment or all deployments for a FID. If name is provided, deletes single deployment. If only FID is provided, deletes all deployments for that FID. Requires API key authentication. * @summary Delete deployment(s) * @param {DeleteDeploymentRequest} deleteDeploymentRequest * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<DeleteDeployment200Response>} A promise that resolves to a `DeleteDeployment200Response` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/delete-deployment) * */ deleteDeployment: async (deleteDeploymentRequest, options = {}) => { // verify required parameter 'deleteDeploymentRequest' is not null or undefined (0, common_1.assertParamExists)('deleteDeployment', 'deleteDeploymentRequest', deleteDeploymentRequest); const localVarPath = `/v2/studio/deployment/`; // 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 ApiKeyAuth required await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-key", 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)(deleteDeploymentRequest, localVarRequestOptions, configuration); return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Publishes the generated miniapp to Vercel via GitHub. Creates a GitHub repository, pushes code, creates a Vercel project linked to GitHub, and triggers deployment. Requires API key authentication. * @summary Deploy miniapp to Vercel * @param {DeployToVercelRequest} deployToVercelRequest * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<DeployToVercel200Response>} A promise that resolves to a `DeployToVercel200Response` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/deploy-to-vercel) * */ deployToVercel: async (deployToVercelRequest, options = {}) => { // verify required parameter 'deployToVercelRequest' is not null or undefined (0, common_1.assertParamExists)('deployToVercel', 'deployToVercelRequest', deployToVercelRequest); const localVarPath = `/v2/studio/vercel/`; // 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 ApiKeyAuth required await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-key", 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)(deployToVercelRequest, localVarRequestOptions, configuration); return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Retrieves all messages in a specific conversation. Requires API key authentication. * @summary Get messages in a conversation * @param {string} name Kubernetes deployment name * @param {string} conversationId Conversation ID * @param {number | null} [fid] Farcaster ID of the user; if not provided, namespace must be provided * @param {string} [namespace] Optional Kubernetes namespace. If not provided, will query for the active namespace for the given FID. * @param {boolean | null} [includeDeleted] Include deleted messages in the response. Defaults to false. * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<GetConversationMessages200Response>} A promise that resolves to a `GetConversationMessages200Response` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/get-conversation-messages) * */ getConversationMessages: async (name, conversationId, fid, namespace, includeDeleted, options = {}) => { // verify required parameter 'name' is not null or undefined (0, common_1.assertParamExists)('getConversationMessages', 'name', name); // verify required parameter 'conversationId' is not null or undefined (0, common_1.assertParamExists)('getConversationMessages', 'conversationId', conversationId); const localVarPath = `/v2/studio/deployment/conversations/messages`; // 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 ApiKeyAuth required await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-key", configuration); if (fid !== undefined) { localVarQueryParameter['fid'] = fid; } if (name !== undefined) { localVarQueryParameter['name'] = name; } if (namespace !== undefined) { localVarQueryParameter['namespace'] = namespace; } if (conversationId !== undefined) { localVarQueryParameter['conversation_id'] = conversationId; } if (includeDeleted !== undefined) { localVarQueryParameter['include_deleted'] = includeDeleted; } (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, }; }, /** * Fetches info about a miniapp generator deployment by its name and creator\'s Farcaster ID. Requires API key authentication. * @summary Get deployment info * @param {string} name Kubernetes deployment name * @param {number | null} [fid] Farcaster ID of the user; if not provided, namespace must be provided * @param {string} [namespace] Optional Kubernetes namespace. If not provided, will query for the active namespace for the given FID. * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<ListDeployments200ResponseInner>} A promise that resolves to a `ListDeployments200ResponseInner` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/get-deployment) * */ getDeployment: async (name, fid, namespace, options = {}) => { // verify required parameter 'name' is not null or undefined (0, common_1.assertParamExists)('getDeployment', 'name', name); const localVarPath = `/v2/studio/deployment/by-name-and-fid`; // 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 ApiKeyAuth required await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-key", configuration); if (fid !== undefined) { localVarQueryParameter['fid'] = fid; } if (name !== undefined) { localVarQueryParameter['name'] = name; } if (namespace !== undefined) { localVarQueryParameter['namespace'] = namespace; } (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, }; }, /** * Retrieves the contents of a specific file from the generated app. Requires Studio admin authentication. * @summary Get deployment file contents * @param {string} name Kubernetes deployment name * @param {string} filePath File path relative to gen/ * @param {number | null} [fid] Farcaster ID of the user; if not provided, namespace must be provided * @param {string} [namespace] Optional Kubernetes namespace. If not provided, will query for the active namespace for the given FID. * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<GetDeploymentFile200Response>} A promise that resolves to a `GetDeploymentFile200Response` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/get-deployment-file) * */ getDeploymentFile: async (name, filePath, fid, namespace, options = {}) => { // verify required parameter 'name' is not null or undefined (0, common_1.assertParamExists)('getDeploymentFile', 'name', name); // verify required parameter 'filePath' is not null or undefined (0, common_1.assertParamExists)('getDeploymentFile', 'filePath', filePath); const localVarPath = `/v2/studio/deployment/file`; // 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 ApiKeyAuth required await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-key", configuration); if (fid !== undefined) { localVarQueryParameter['fid'] = fid; } if (name !== undefined) { localVarQueryParameter['name'] = name; } if (namespace !== undefined) { localVarQueryParameter['namespace'] = namespace; } if (filePath !== undefined) { localVarQueryParameter['file_path'] = filePath; } (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, }; }, /** * Retrieves the dev-status.json file from a miniapp deployment, which tracks the progress of app development phases. Requires API key authentication. * @summary Get dev status of a miniapp * @param {string} namespace Kubernetes namespace name * @param {string} name Kubernetes deployment name * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<GetDevStatus200Response>} A promise that resolves to a `GetDevStatus200Response` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/get-dev-status) * */ getDevStatus: async (namespace, name, options = {}) => { // verify required parameter 'namespace' is not null or undefined (0, common_1.assertParamExists)('getDevStatus', 'namespace', namespace); // verify required parameter 'name' is not null or undefined (0, common_1.assertParamExists)('getDevStatus', 'name', name); const localVarPath = `/v2/studio/deployment/dev-status`; // 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 ApiKeyAuth required await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-key", configuration); if (namespace !== undefined) { localVarQueryParameter['namespace'] = namespace; } if (name !== undefined) { localVarQueryParameter['name'] = name; } (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, }; }, /** * Lists all conversations for a specific deployment. Requires API key authentication. * @summary List conversations for a deployment * @param {number | null} [fid] Farcaster ID of the user. Required for non-admin users. Studio admins can omit to query all conversations. * @param {string} [name] Kubernetes deployment name. If provided, filters conversations to this deployment only. * @param {boolean | null} [includeDeleted] Include deleted conversations in the response. Defaults to false. * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<ListConversations200Response>} A promise that resolves to a `ListConversations200Response` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/list-conversations) * */ listConversations: async (fid, name, includeDeleted, options = {}) => { const localVarPath = `/v2/studio/deployment/conversations`; // 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 ApiKeyAuth required await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-key", configuration); if (fid !== undefined) { localVarQueryParameter['fid'] = fid; } if (name !== undefined) { localVarQueryParameter['name'] = name; } if (includeDeleted !== undefined) { localVarQueryParameter['include_deleted'] = includeDeleted; } (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, }; }, /** * Lists files in a directory of the generated app. Requires Studio admin authentication. * @summary List deployment files * @param {string} name Kubernetes deployment name * @param {number | null} [fid] Farcaster ID of the user; if not provided, namespace must be provided * @param {string} [namespace] Optional Kubernetes namespace. If not provided, will query for the active namespace for the given FID. * @param {string} [directory] Directory path relative to gen/ (defaults to root) * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<ListDeploymentFiles200Response>} A promise that resolves to a `ListDeploymentFiles200Response` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/list-deployment-files) * */ listDeploymentFiles: async (name, fid, namespace, directory, options = {}) => { // verify required parameter 'name' is not null or undefined (0, common_1.assertParamExists)('listDeploymentFiles', 'name', name); const localVarPath = `/v2/studio/deployment/files`; // 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 ApiKeyAuth required await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-key", configuration); if (fid !== undefined) { localVarQueryParameter['fid'] = fid; } if (name !== undefined) { localVarQueryParameter['name'] = name; } if (namespace !== undefined) { localVarQueryParameter['namespace'] = namespace; } if (directory !== undefined) { localVarQueryParameter['directory'] = directory; } (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, }; }, /** * Lists all miniapp generator deployments for a user. Requires API key authentication. * @summary List deployments * @param {number | null} [fid] Farcaster ID of the user. Required for non-admin users. Studio admins can omit to query all deployments. * @param {number} [limit] Maximum number of deployments to return. Defaults to 50, max 1000. (Default: 50, Maximum: 1000) * @param {number | null} [offset] Number of deployments to skip for pagination. Defaults to 0. * @param {boolean | null} [includeDeleted] Include deleted deployments in the response. Defaults to false. * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<Array<ListDeployments200ResponseInner>>} A promise that resolves to a `Array<ListDeployments200ResponseInner>` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/list-deployments) * */ listDeployments: async (fid, limit, offset, includeDeleted, options = {}) => { const localVarPath = `/v2/studio/deployment/`; // 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 ApiKeyAuth required await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-key", configuration); if (fid !== undefined) { localVarQueryParameter['fid'] = fid; } if (limit !== undefined) { localVarQueryParameter['limit'] = limit; } if (offset !== undefined) { localVarQueryParameter['offset'] = offset; } if (includeDeleted !== undefined) { localVarQueryParameter['include_deleted'] = includeDeleted; } (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, }; }, /** * Sends a prompt to a specific miniapp generator deployment and returns a streaming response using Server-Sent Events. The response is a continuous stream of Server-Sent Events, not a single JSON payload. Each event contains a JSON object with type, message, and other fields specific to the message type. Requires authentication via API key in the request header. * @summary Prompt a deployment with streaming response * @param {PromptDeploymentStreamRequest} promptDeploymentStreamRequest * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<>} A promise that resolves to a `` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/prompt-deployment-stream) * */ promptDeploymentStream: async (promptDeploymentStreamRequest, options = {}) => { // verify required parameter 'promptDeploymentStreamRequest' is not null or undefined (0, common_1.assertParamExists)('promptDeploymentStream', 'promptDeploymentStreamRequest', promptDeploymentStreamRequest); const localVarPath = `/v2/studio/deployment/prompt/stream`; // 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 ApiKeyAuth required await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-key", 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)(promptDeploymentStreamRequest, localVarRequestOptions, configuration); return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Starts the Next.js development server for the generated miniapp. Requires Studio admin authentication. * @summary Start generated miniapp * @param {StartAppRequest} startAppRequest * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<StartApp200Response>} A promise that resolves to a `StartApp200Response` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/start-app) * */ startApp: async (startAppRequest, options = {}) => { // verify required parameter 'startAppRequest' is not null or undefined (0, common_1.assertParamExists)('startApp', 'startAppRequest', startAppRequest); const localVarPath = `/v2/studio/deployment/start`; // 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 ApiKeyAuth required await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-key", 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)(startAppRequest, localVarRequestOptions, configuration); return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Stops the Next.js development server for the generated miniapp. Requires Studio admin authentication. * @summary Stop generated miniapp * @param {StartAppRequest} startAppRequest * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<StartApp200Response>} A promise that resolves to a `StartApp200Response` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/stop-app) * */ stopApp: async (startAppRequest, options = {}) => { // verify required parameter 'startAppRequest' is not null or undefined (0, common_1.assertParamExists)('stopApp', 'startAppRequest', startAppRequest); const localVarPath = `/v2/studio/deployment/stop`; // 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 ApiKeyAuth required await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-key", 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)(startAppRequest, localVarRequestOptions, configuration); return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Uploads an image file to the generated miniapp public folder. The image will be accessible as a static asset on the deployed miniapp. Requires API key authentication. * @summary Upload image to deployment * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<UploadImage200Response>} A promise that resolves to a `UploadImage200Response` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/upload-image) * */ uploadImage: async (options = {}) => { const localVarPath = `/v2/studio/deployment/upload-image`; // 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 ApiKeyAuth required await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-key", 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, }; }, /** * Downloads an image from the provided URL and saves it to the generated miniapp public folder. The image will be accessible as a static asset on the deployed miniapp. Requires API key authentication. * @summary Upload image from URL to deployment * @param {UploadImageUrlRequest} uploadImageUrlRequest * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<UploadImage200Response>} A promise that resolves to a `UploadImage200Response` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/upload-image-url) * */ uploadImageUrl: async (uploadImageUrlRequest, options = {}) => { // verify required parameter 'uploadImageUrlRequest' is not null or undefined (0, common_1.assertParamExists)('uploadImageUrl', 'uploadImageUrlRequest', uploadImageUrlRequest); const localVarPath = `/v2/studio/deployment/upload-image-url`; // 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 ApiKeyAuth required await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-key", 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)(uploadImageUrlRequest, localVarRequestOptions, configuration); return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Retrieves the build logs for a Vercel deployment. Useful for debugging failed deployments. Requires Studio admin authentication. * @summary Get Vercel deployment build logs * @param {string} name Deployment name used to identify the Vercel project * @param {number | null} [fid] Farcaster ID of the user * @param {string} [namespace] K8s Namespace name * @param {number} [limit] Maximum number of log events to return. Defaults to 100. * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<VercelDeploymentLogs200Response>} A promise that resolves to a `VercelDeploymentLogs200Response` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/vercel-deployment-logs) * */ vercelDeploymentLogs: async (name, fid, namespace, limit, options = {}) => { // verify required parameter 'name' is not null or undefined (0, common_1.assertParamExists)('vercelDeploymentLogs', 'name', name); const localVarPath = `/v2/studio/vercel/logs`; // 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 ApiKeyAuth required await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-key", configuration); if (fid !== undefined) { localVarQueryParameter['fid'] = fid; } if (namespace !== undefined) { localVarQueryParameter['namespace'] = namespace; } if (name !== undefined) { localVarQueryParameter['name'] = name; } if (limit !== undefined) { localVarQueryParameter['limit'] = limit; } (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, }; }, /** * Retrieves the status of a Vercel deployment for a miniapp. Looks up the Vercel project ID from the deployment and queries Vercel API for deployment status. Requires API key authentication. * @summary Get Vercel deployment status * @param {string} name Deployment name used to identify the Vercel project * @param {number | null} [fid] Farcaster ID of the user; if not provided, namespace must be provided * @param {string} [namespace] K8s Namespace name * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<VercelDeploymentStatus200Response>} A promise that resolves to a `VercelDeploymentStatus200Response` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/vercel-deployment-status) * */ vercelDeploymentStatus: async (name, fid, namespace, options = {}) => { // verify required parameter 'name' is not null or undefined (0, common_1.assertParamExists)('vercelDeploymentStatus', 'name', name); const localVarPath = `/v2/studio/vercel/status`; // 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 ApiKeyAuth required await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-key", configuration); if (fid !== undefined) { localVarQueryParameter['fid'] = fid; } if (namespace !== undefined) { localVarQueryParameter['namespace'] = namespace; } if (name !== undefined) { localVarQueryParameter['name'] = name; } (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};