@neynar/nodejs-sdk
Version:
SDK to interact with Neynar APIs (https://docs.neynar.com/reference/quickstart)
798 lines • 193 kB
JavaScript
"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.137.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. Note: Studio CU is tracked based on LLM token usage, not per API call.
* @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. Note: Studio CU is tracked based on LLM token usage, not per API call.
* @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. Note: Studio CU is tracked based on LLM token usage, not per API call.
* @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 deployment_id or name is provided, deletes single deployment. If only FID is provided, deletes all deployments for that FID. Requires API key authentication. Note: Studio CU is tracked based on LLM token usage, not per API call.
* @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,
};
},
/**
* Deletes rows matching the WHERE conditions. WHERE clause is required to prevent accidental bulk deletes.
* @summary Delete rows from table
* @param {string} tableName
* @param {DeleteRowsRequest} deleteRowsRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<DeleteRows200Response>} A promise that resolves to a `DeleteRows200Response` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/delete-rows)
*
*/
deleteRows: async (tableName, deleteRowsRequest, options = {}) => {
// verify required parameter 'tableName' is not null or undefined
(0, common_1.assertParamExists)('deleteRows', 'tableName', tableName);
// verify required parameter 'deleteRowsRequest' is not null or undefined
(0, common_1.assertParamExists)('deleteRows', 'deleteRowsRequest', deleteRowsRequest);
const localVarPath = `/v2/studio/deployment/database/tables/{table_name}/rows`
.replace(`{${"table_name"}}`, encodeURIComponent(String(tableName)));
// 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)(deleteRowsRequest, localVarRequestOptions, configuration);
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Deletes environment variables (secrets) from a deployment.
* @summary Delete deployment secrets
* @param {DeleteSecretsRequest} deleteSecretsRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<UpsertSecrets200Response>} A promise that resolves to a `UpsertSecrets200Response` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/delete-secrets)
*
*/
deleteSecrets: async (deleteSecretsRequest, options = {}) => {
// verify required parameter 'deleteSecretsRequest' is not null or undefined
(0, common_1.assertParamExists)('deleteSecrets', 'deleteSecretsRequest', deleteSecretsRequest);
const localVarPath = `/v2/studio/deployment/secrets/`;
// 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)(deleteSecretsRequest, 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. Note: Studio CU is tracked based on LLM token usage, not per API call.
* @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,
};
},
/**
* Executes a raw SQL query against the deployment database. Only SELECT, WITH, and EXPLAIN queries are allowed. Admin access required.
* @summary Execute raw SQL query (admin only)
* @param {ExecuteSqlRequest} executeSqlRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<ExecuteSql200Response>} A promise that resolves to a `ExecuteSql200Response` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/execute-sql)
*
*/
executeSql: async (executeSqlRequest, options = {}) => {
// verify required parameter 'executeSqlRequest' is not null or undefined
(0, common_1.assertParamExists)('executeSql', 'executeSqlRequest', executeSqlRequest);
const localVarPath = `/v2/studio/deployment/database/sql`;
// 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)(executeSqlRequest, localVarRequestOptions, configuration);
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Retrieves the account-association.json file from a miniapp deployment, which contains the JFS-signed domain association. Requires API key authentication.
* @summary Get account association of a miniapp
* @param {string} [deploymentId] Deployment ID
* @param {string} [namespace] Kubernetes namespace name
* @param {string} [name] Kubernetes deployment name
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<GetAccountAssociation200Response>} A promise that resolves to a `GetAccountAssociation200Response` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/get-account-association)
*
*/
getAccountAssociation: async (deploymentId, namespace, name, options = {}) => {
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: 'GET' }, baseOptions), options);
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ApiKeyAuth required
await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-key", configuration);
if (deploymentId !== undefined) {
localVarQueryParameter['deployment_id'] = deploymentId;
}
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,
};
},
/**
* Retrieves all messages in a specific conversation. Requires API key authentication. Note: Studio CU is tracked based on LLM token usage, not per API call.
* @summary Get messages in a conversation
* @param {string} conversationId Conversation ID
* @param {string} [deploymentId] Deployment ID (UUID). Required if name not provided.
* @param {number | null} [fid] Farcaster ID of the user; if not provided, namespace must be provided
* @param {string} [name] Kubernetes deployment name. Required if deployment_id not 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 (conversationId, deploymentId, fid, name, namespace, includeDeleted, options = {}) => {
// 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 (deploymentId !== undefined) {
localVarQueryParameter['deployment_id'] = deploymentId;
}
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 deployment_id or name and creator\'s Farcaster ID. Requires API key authentication. Note: Studio CU is tracked based on LLM token usage, not per API call.
* @summary Get deployment info
* @param {string} [deploymentId] Deployment ID (UUID). Required if name not provided.
* @param {number | null} [fid] Farcaster ID of the user; if not provided, namespace must be provided
* @param {string} [name] Kubernetes deployment name. Required if deployment_id not 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 (deploymentId, fid, name, namespace, options = {}) => {
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 (deploymentId !== undefined) {
localVarQueryParameter['deployment_id'] = deploymentId;
}
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 or FID ownership validation. Note: Studio CU is tracked based on LLM token usage, not per API call.
* @summary Get deployment file contents
* @param {string} filePath File path relative to gen/
* @param {string} [deploymentId] Deployment ID (UUID). Required if name not provided.
* @param {number | null} [fid] Farcaster ID of the user; if not provided, namespace must be provided
* @param {string} [name] Kubernetes deployment name. Required if deployment_id not 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 (filePath, deploymentId, fid, name, namespace, options = {}) => {
// 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 (deploymentId !== undefined) {
localVarQueryParameter['deployment_id'] = deploymentId;
}
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. Note: Studio CU is tracked based on LLM token usage, not per API call.
* @summary Get dev status of a miniapp
* @param {string} [deploymentId] Deployment ID
* @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 (deploymentId, namespace, name, options = {}) => {
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 (deploymentId !== undefined) {
localVarQueryParameter['deployment_id'] = deploymentId;
}
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,
};
},
/**
* Retrieves the complete schema for a table including columns, indexes, and foreign keys.
* @summary Get table schema
* @param {string} tableName
* @param {string} deploymentId Deployment ID (UUID)
* @param {number | null} [fid] Farcaster ID of the user. Required for non-admin users.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<GetTableSchema200Response>} A promise that resolves to a `GetTableSchema200Response` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/get-table-schema)
*
*/
getTableSchema: async (tableName, deploymentId, fid, options = {}) => {
// verify required parameter 'tableName' is not null or undefined
(0, common_1.assertParamExists)('getTableSchema', 'tableName', tableName);
// verify required parameter 'deploymentId' is not null or undefined
(0, common_1.assertParamExists)('getTableSchema', 'deploymentId', deploymentId);
const localVarPath = `/v2/studio/deployment/database/tables/{table_name}/schema`
.replace(`{${"table_name"}}`, encodeURIComponent(String(tableName)));
// 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 (deploymentId !== undefined) {
localVarQueryParameter['deployment_id'] = deploymentId;
}
if (fid !== undefined) {
localVarQueryParameter['fid'] = fid;
}
(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,
};
},
/**
* Inserts one or more rows into the specified table. Returns the inserted rows with generated values.
* @summary Insert rows into table
* @param {string} tableName
* @param {InsertRowsRequest} insertRowsRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @returns {Promise<InsertRows200Response>} A promise that resolves to a `InsertRows200Response` object
*
* For more information, refer to the [API documentation](https://docs.neynar.com/reference/insert-rows)
*
*/
insertRows: async (tableName, insertRowsRequest, options = {}) => {
// verify required parameter 'tableName' is not null or undefined
(0, common_1.assertParamExists)('insertRows', 'tableName', tableName);
// verify required parameter 'insertRowsRequest' is not null or undefined
(0, common_1.assertParamExists)('insertRows', 'insertRowsRequest', insertRowsRequest);
const localVarPath = `/v2/studio/deployment/database/tables/{table_name}/rows`
.replace(`{${"table_name"}}`, encodeURIComponent(String(tableName)));
// 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)(insertRowsRequest, localVarRequestOptions, configuration);
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Lists all conversations for a specific deployment. Requires API key authentication. Note: Studio CU is tracked based on LLM token usage, not per API call.
* @summary List conversations for a deployment
* @param {string} [deploymentId] Deployment ID (UUID). If provided, filters conversations to this deployment only.
* @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 (deploymentId, 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 (deploymentId !== undefined) {
localVarQueryParameter['deployment_id'] = deploymentId;
}
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 or FID ownership validation. Note: Studio CU is tracked based on LLM token usage, not per API call.
* @summary List deployment files
* @param {string} [deploymentId] Deployment ID (UUID). Required if name not provided.
* @param {number | null} [fid] Farcaster ID of the user; if not provided, namespace must be provided
* @param {string} [name] Kubernetes deployment name. Required if deployment_id not 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 (deploymentId, fid, name, namespace, directory, options = {}) => {
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 (deploymentId !== undefined) {
localVarQueryParameter['deployment_id'] = deploymentId;
}
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. Note: Studio CU is tracked based on LLM token usage, not per API call.
* @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,
};
},
/**
* Retrieves a