diff --git a/.gitignore b/.gitignore index 0cab8484..c58ca650 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,6 @@ build # Temporary generated files src/neynar-api/neynar-v1-api/openapi-tmp src/neynar-api/neynar-v2-api/openapi-farcaster-tmp -src/neynar-api/neynar-v2-api/openapi-neynar-tmp \ No newline at end of file +src/neynar-api/neynar-v2-api/openapi-neynar-tmp + +test-sdk.ts \ No newline at end of file diff --git a/package.json b/package.json index 0df50550..e386777b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@neynar/nodejs-sdk", - "version": "1.11.2", + "version": "1.12.0", "description": "SDK to interact with Neynar APIs (https://docs.neynar.com/)", "main": "./build/index.js", "types": "./build/index.d.ts", diff --git a/src/neynar-api/neynar-api-client.ts b/src/neynar-api/neynar-api-client.ts index d689db33..a5fe0354 100644 --- a/src/neynar-api/neynar-api-client.ts +++ b/src/neynar-api/neynar-api-client.ts @@ -40,6 +40,10 @@ import { NeynarFrameCreationRequest, UserFIDResponse, RegisterUserResponse, + DeveloperManagedSigner, + WebhookResponse, + WebhookSubscriptionFilters, + WebhookListResponse, } from "./v2/openapi-farcaster"; import { @@ -798,6 +802,92 @@ export class NeynarAPIClient { ); } + // ------------ Developer Managed Signer ------------ + + /** + * Fetches the status of a developer-managed signer by its public key. + * + * @param {string} publicKey - Ed25519 public key + * + * @returns {Promise} A promise that resolves to a `DeveloperManagedSigner` object, + * containing the details and status of the queried signer. + * + * @example + * // Example: Fetch the status of a developer-managed signer by its public key + * const publicKey = '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef'; // Example public key + * client.lookupDeveloperManagedSigner(publicKey).then(response => { + * console.log('Developer Managed Signer Status:', response); + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/developer-managed-signer). + */ + public async lookupDeveloperManagedSigner( + publicKey: string + ): Promise { + return await this.clients.v2.lookupDeveloperManagedSigner(publicKey); + } + + /** + * Registers an signed key and returns the developer managed signer status with an approval url. + * + * @param {string} publicKey - Ed25519 public key + * @param {string} signature - Signature generated by the custody address of the app. Signed data includes app_fid, deadline, signer’s public key + * @param {number} appFid - Application FID + * @param {number} deadline - A UNIX timestamp in seconds that controls how long the signed key request is valid for. (24 hours from now is recommended) + * + * @returns {Promise} A promise that resolves to a `DeveloperManagedSigner` object. + * + * @example + * // Example: Register a signed key for a developer-managed signer + * const publicKey = '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef'; + * const signature = '0xe5d95c391e165dac8efea373efe301d3ea823e1f41713f8943713cbe2850566672e33ff3e17e19abb89703f650a2597f62b4fda0ce28ca15d59eb6d4e971ee531b'; + * const appFid = 12345; + * const deadline = Math.floor(Date.now() / 1000) + 86400; // 24 hours from now + * client.registerSignedKeyForDeveloperManagedSigner(publicKey, signature, appFid, deadline) + * .then(response => { + * console.log('Signed Key Registration Response:', response); + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/register-signed-key-for-developer-managed-signer). + */ + public async registerSignedKeyForDeveloperManagedSigner( + publicKey: string, + signature: string, + appFid: number, + deadline: number + ): Promise { + return await this.clients.v2.registerSignedKeyForDeveloperManagedSigner( + publicKey, + signature, + appFid, + deadline + ); + } + + /** + * Publish a message to farcaster. + * The message must be signed by a signer managed by the developer. Use the @farcaster/core library to construct and sign the message. + * Use the Message.toJSON method on the signed message and pass the JSON in the body of this POST request. + * + * @param {object} message - The message object to be published to Farcaster. + * + * @returns {Promise} A promise that resolves to an `object`. + * + * @example + * // Example: Publish a message to Farcaster + * const message = {}; + * client.publishMessageToFarcaster(message).then(response => { + * console.log('Message Publication Response:', response); + * }); + * + * Note: Ensure the message is properly signed using a developer-managed signer before publishing. + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/publish-message). + */ + public async publishMessageToFarcaster(message: object): Promise { + return await this.clients.v2.publishMessageToFarcaster(message); + } + // ------------ User ------------ /** @@ -822,7 +912,7 @@ export class NeynarAPIClient { * This API is for Enterprise customers only. Please contact us if you want to try this out. * * Registers a new user account on Farcaster. - * + * * @param {number} fid - The unique FID assigned to the new user. * @param {string} signature - A cryptographic signature proving ownership of the custody address. * @param {string} requested_user_custody_address - The Ethereum custody address associated with the new user. @@ -2144,8 +2234,9 @@ export class NeynarAPIClient { * * @param {string} messageBytesInHex - The message bytes from the Frame Action in hexadecimal format. * @param {Object} [options] - Optional parameters for the validation request. - * @param {boolean} [options.castReactionContext] - Include context about cast reactions in the validation response. - * @param {boolean} [options.followContext] - Include context about follow actions in the validation response. + * @param {boolean} [options.castReactionContext] - Adds viewer_context inside the cast object to indicate whether the interactor reacted to the cast housing the frame. + * @param {boolean} [options.followContext] - Adds viewer_context inside the user (interactor) object to indicate whether the interactor follows or is followed by the cast author. + * @param {boolean} [options.signerContext] - Adds context about the app used by the user inside `frame.action`. * * @returns {Promise} A promise that resolves to a `ValidateFrameActionResponse` object, * indicating the outcome of the frame action validation, potentially enriched with specified contexts. @@ -2153,7 +2244,7 @@ export class NeynarAPIClient { * @example * // Example: Validate a frame action with additional context for cast reactions and follow actions * const messageBytesInHex = '0a49080d1085940118f6a6a32e20018201390a1a86db69b3ffdf6ab8acb6872b69ccbe7eb6a67af7ab71e95aa69f10021a1908ef011214237025b322fd03a9ddc7ec6c078fb9c56d1a72111214e3d88aeb2d0af356024e0c693f31c11b42c76b721801224043cb2f3fcbfb5dafce110e934b9369267cf3d1aef06f51ce653dc01700fc7b778522eb7873fd60dda4611376200076caf26d40a736d3919ce14e78a684e4d30b280132203a66717c82d728beb3511b05975c6603275c7f6a0600370bf637b9ecd2bd231e'; - * client.validateFrameAction(messageBytesInHex, { castReactionContext: false, followContext: true }).then(response => { + * client.validateFrameAction(messageBytesInHex, { castReactionContext: false, followContext: true, signerContext: true }).then(response => { * console.log('Frame Action Validation:', response); * }); * @@ -2164,6 +2255,7 @@ export class NeynarAPIClient { options?: { castReactionContext?: boolean; followContext?: boolean; + signerContext?: boolean; } ): Promise { return await this.clients.v2.validateFrameAction( @@ -2172,6 +2264,178 @@ export class NeynarAPIClient { ); } + // ------------ Webhook ------------ + + /** + * Retrieves details about a specific webhook by its ID. + * + * @param {string} webhookId - The unique identifier of the webhook to be retrieved. + * + * @returns {Promise} A promise that resolves to a `WebhookResponse` object, + * containing detailed information about the requested webhook. + * + * @example + * // Example: Fetch information about a specific webhook by ID + * const webhookId = 'yourWebhookId'; + * client.lookupWebhook(webhookId).then(response => { + * console.log('Webhook Details:', response); + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/lookup-webhook). + */ + public async lookupWebhook(webhookId: string): Promise { + return await this.clients.v2.lookupWebhook(webhookId); + } + + /** + * Creates a new webhook with the specified parameters. This method enables developers to + * programmatically register webhooks for receiving real-time notifications of events that occur + * within Farcaster. + * + * @param {string} name - The name of the webhook. + * @param {string} url - The URL to which the webhook events will be sent. + * @param {Object} [options] - Optional parameters for the webhook creation. + * @param {WebhookSubscriptionFilters} [options.subscription] - A set of filters defining the events the webhook should subscribe to. + * + * @returns {Promise} A promise that resolves to a `WebhookResponse` object, + * containing information about the newly created webhook, including its ID, name, and subscription details. + * + * @example + * // Example: Create a new webhook for user sign-up events + * const name = 'Cast created Webhook'; + * const url = 'https://example.com/webhook'; + * const subscription = { + "cast.created": { + "author_fids": [ + 3, + 196, + 194 + ], + "mentioned_fids": [196], + }, + "user.created": {} + } + * client.publishWebhook(name, url, { subscription }).then(response => { + * console.log('Newly Created Webhook:', response); + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/publish-webhook). + */ + public async publishWebhook( + name: string, + url: string, + options?: { subscription: WebhookSubscriptionFilters } + ): Promise { + return await this.clients.v2.publishWebhook(name, url, options); + } + + /** + * Updates the active status of a specified webhook. + * + * @param {string} webhookId - The unique identifier of the webhook whose active status is being toggled. + * @param {boolean} active - The desired active status of the webhook. Set to `true` to activate the webhook or `false` to deactivate it. + * + * @returns {Promise} A promise that resolves to a `WebhookResponse` object. + * + * @example + * // Example: Deactivate a webhook + * const webhookId = 'yourWebhookId'; + * client.updateWebhookActiveStatus(webhookId, false).then(response => { + * console.log('Webhook Active Status Toggled:', response); + * }); + * + * // Example: Reactivate a webhook + * client.updateWebhookActiveStatus(webhookId, true).then(response => { + * console.log('Webhook Active Status Toggled:', response); + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/toggle-webhook-active-status). + */ + public async updateWebhookActiveStatus( + webhookId: string, + active: boolean + ): Promise { + return await this.clients.v2.updateWebhookActiveStatus(webhookId, active); + } + + /** + * Updates an existing webhook with new parameters, including its name, URL, and event subscriptions. + * + * @param {string} webhookId - The unique identifier of the webhook to be updated. + * @param {string} name - The new name for the webhook. Useful for identification and management purposes. + * @param {string} url - The new URL to which the webhook events will be sent. + * @param {Object} [options] - Optional parameters for updating the webhook. + * @param {WebhookSubscriptionFilters} [options.subscription] - A set of filters defining the events the webhook should subscribe to after the update. + * + * @returns {Promise} A promise that resolves to a `WebhookResponse` object, + * containing the updated information about the webhook, including its ID, name, subscription details, and more. + * + * @example + * // Example: Update an existing webhook with a new URL and subscription filters + * const webhookId = 'existingWebhookId'; + * const newName = 'UpdatedWebhookName'; + * const newUrl = 'https://example.com/new-webhook-url'; + * const subscription = { + "cast.created": { + "author_fids": [ + 2, 4, 6 + ], + "mentioned_fids": [194], + }, + "user.created": {} + } + * client.updateWebhook(webhookId, newName, newUrl, { subscription }).then(response => { + * console.log('Updated Webhook:', response); + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/update-webhook). + */ + public async updateWebhook( + webhookId: string, + name: string, + url: string, + options?: { subscription: WebhookSubscriptionFilters } + ): Promise { + return await this.clients.v2.updateWebhook(webhookId, name, url, options); + } + + /** + * Deletes a specified webhook by its unique identifier. + * + * @param {string} webhookId - The unique identifier of the webhook to be deleted. + * + * @returns {Promise} A promise that resolves to a `WebhookResponse` object. + * + * @example + * // Example: Delete a specific webhook by ID + * const webhookId = 'yourWebhookId'; + * client.deleteWebhook(webhookId).then(response => { + * console.log('Webhook Deletion Response:', response); + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/delete-webhook). + */ + public async deleteWebhook(webhookId: string): Promise { + return await this.clients.v2.deleteWebhook(webhookId); + } + + /** + * Retrieves a list of all webhooks currently associated with the user's account. + * + * @returns {Promise} A promise that resolves to a `WebhookListResponse` object. + * + * @example + * // Example: Fetch a list of all webhooks associated with the user's account + * client.fetchWebhooks().then(response => { + * console.log('List of Webhooks:', response); + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/fetch-webhooks). + */ + public async fetchWebhooks(): Promise { + return await this.clients.v2.fetchWebhooks(); + } + // ------------ Recommendation ------------ /** diff --git a/src/neynar-api/v2/client.ts b/src/neynar-api/v2/client.ts index ca2d99d0..18ea2aa5 100644 --- a/src/neynar-api/v2/client.ts +++ b/src/neynar-api/v2/client.ts @@ -1,6 +1,7 @@ import { CastApi, SignerApi, + SignerDeveloperManagedApi, Signer, Cast, CastParamType, @@ -40,7 +41,7 @@ import { BulkCastsResponse, FnameApi, FnameAvailabilityResponse, - FrameApi, + FramesApi, FrameActionReqBody, FrameAction, ValidateFrameRequest, @@ -49,6 +50,16 @@ import { DeleteNeynarFrameRequest, NeynarFrameUpdateRequest, NeynarFrameCreationRequest, + NeynarFramesApi, + DeveloperManagedSigner, + WebhookApi, + WebhookResponse, + WebhookPostReqBody, + WebhookSubscriptionFilters, + WebhookPutReqBody, + WebhookListResponse, + WebhookPatchReqBody, + WebhookPatchReqBodyActiveEnum, } from "./openapi-farcaster"; import axios, { AxiosError, AxiosInstance } from "axios"; import { silentLogger, Logger } from "../common/logger"; @@ -64,6 +75,7 @@ export class NeynarV2APIClient { public readonly apis: { signer: SignerApi; + developerManagedSigner: SignerDeveloperManagedApi; user: UserApi; cast: CastApi; reaction: ReactionApi; @@ -74,7 +86,9 @@ export class NeynarV2APIClient { storage: StorageApi; nft: NFTApi; fname: FnameApi; - frame: FrameApi; + frames: FramesApi; + neynarFrames: NeynarFramesApi; + webhook: WebhookApi; }; /** @@ -126,6 +140,11 @@ export class NeynarV2APIClient { this.apis = { signer: new SignerApi(config, undefined, axiosInstance), + developerManagedSigner: new SignerDeveloperManagedApi( + config, + undefined, + axiosInstance + ), user: new UserApi(config, undefined, axiosInstance), cast: new CastApi(config, undefined, axiosInstance), reaction: new ReactionApi(config, undefined, axiosInstance), @@ -136,7 +155,9 @@ export class NeynarV2APIClient { storage: new StorageApi(config, undefined, axiosInstance), nft: new NFTApi(config, undefined, axiosInstance), fname: new FnameApi(config, undefined, axiosInstance), - frame: new FrameApi(config, undefined, axiosInstance), + frames: new FramesApi(config, undefined, axiosInstance), + neynarFrames: new NeynarFramesApi(config, undefined, axiosInstance), + webhook: new WebhookApi(config, undefined, axiosInstance), }; } @@ -247,6 +268,107 @@ export class NeynarV2APIClient { return response.data; } + // ------------ Developer Managed Signer ------------ + + /** + * Fetches the status of a developer-managed signer by its public key. + * + * @param {string} publicKey - Ed25519 public key + * + * @returns {Promise} A promise that resolves to a `DeveloperManagedSigner` object, + * containing the details and status of the queried signer. + * + * @example + * // Example: Fetch the status of a developer-managed signer by its public key + * const publicKey = '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef'; // Example public key + * client.lookupDeveloperManagedSigner(publicKey).then(response => { + * console.log('Developer Managed Signer Status:', response); + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/developer-managed-signer). + */ + public async lookupDeveloperManagedSigner( + publicKey: string + ): Promise { + const response = + await this.apis.developerManagedSigner.developerManagedSigner( + this.apiKey, + publicKey + ); + return response.data; + } + + /** + * Registers an signed key and returns the developer managed signer status with an approval url. + * + * @param {string} publicKey - Ed25519 public key + * @param {string} signature - Signature generated by the custody address of the app. Signed data includes app_fid, deadline, signer’s public key + * @param {number} appFid - Application FID + * @param {number} deadline - A UNIX timestamp in seconds that controls how long the signed key request is valid for. (24 hours from now is recommended) + * + * @returns {Promise} A promise that resolves to a `DeveloperManagedSigner` object. + * + * @example + * // Example: Register a signed key for a developer-managed signer + * const publicKey = '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef'; + * const signature = '0xe5d95c391e165dac8efea373efe301d3ea823e1f41713f8943713cbe2850566672e33ff3e17e19abb89703f650a2597f62b4fda0ce28ca15d59eb6d4e971ee531b'; + * const appFid = 12345; + * const deadline = Math.floor(Date.now() / 1000) + 86400; // 24 hours from now + * client.registerSignedKeyForDeveloperManagedSigner(publicKey, signature, appFid, deadline) + * .then(response => { + * console.log('Signed Key Registration Response:', response); + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/register-signed-key-for-developer-managed-signer). + */ + public async registerSignedKeyForDeveloperManagedSigner( + publicKey: string, + signature: string, + appFid: number, + deadline: number + ): Promise { + const registerSignerKeyReqBody = { + public_key: publicKey, + app_fid: appFid, + deadline: deadline, + signature: signature, + }; + const response = + await this.apis.developerManagedSigner.registerSignedKeyForDeveloperManagedSigner( + this.apiKey, + registerSignerKeyReqBody + ); + return response.data; + } + + /** + * Publish a message to farcaster. + * The message must be signed by a signer managed by the developer. Use the @farcaster/core library to construct and sign the message. + * Use the Message.toJSON method on the signed message and pass the JSON in the body of this POST request. + * + * @param {object} message - The message object to be published to Farcaster. + * + * @returns {Promise} A promise that resolves to an `object`. + * + * @example + * // Example: Publish a message to Farcaster + * const message = {}; + * client.publishMessageToFarcaster(message).then(response => { + * console.log('Message Publication Response:', response); + * }); + * + * Note: Ensure the message is properly signed using a developer-managed signer before publishing. + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/publish-message). + */ + public async publishMessageToFarcaster(message: object) { + const response = await this.apis.developerManagedSigner.publishMessage( + this.apiKey, + message + ); + return response.data; + } + // ------------ User ------------ /** @@ -1681,7 +1803,10 @@ export class NeynarV2APIClient { * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/lookup-neynar-frame). */ public async lookupNeynarFrame(uuid: string) { - const response = await this.apis.frame.lookupNeynarFrame(this.apiKey, uuid); + const response = await this.apis.neynarFrames.lookupNeynarFrame( + this.apiKey, + uuid + ); return response.data; } @@ -1708,7 +1833,7 @@ export class NeynarV2APIClient { public async publishNeynarFrame( neynarFrameCreationRequest: NeynarFrameCreationRequest ) { - const response = await this.apis.frame.publishNeynarFrame( + const response = await this.apis.neynarFrames.publishNeynarFrame( this.apiKey, neynarFrameCreationRequest ); @@ -1739,7 +1864,7 @@ export class NeynarV2APIClient { public async updateNeynarFrame( neynarFrameUpdateRequest: NeynarFrameUpdateRequest ) { - const response = await this.apis.frame.updateNeynarFrame( + const response = await this.apis.neynarFrames.updateNeynarFrame( this.apiKey, neynarFrameUpdateRequest ); @@ -1768,7 +1893,7 @@ export class NeynarV2APIClient { const deleteNeynarFrameRequest: DeleteNeynarFrameRequest = { uuid, }; - const response = await this.apis.frame.deleteNeynarFrame( + const response = await this.apis.neynarFrames.deleteNeynarFrame( this.apiKey, deleteNeynarFrameRequest ); @@ -1791,7 +1916,9 @@ export class NeynarV2APIClient { * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/fetch-neynar-frames). */ public async fetchNeynarFrames() { - const response = await this.apis.frame.fetchNeynarFrames(this.apiKey); + const response = await this.apis.neynarFrames.fetchNeynarFrames( + this.apiKey + ); return response.data; } @@ -1834,7 +1961,7 @@ export class NeynarV2APIClient { cast_hash: castHash, action, }; - const response = await this.apis.frame.postFrameAction(this.apiKey, body); + const response = await this.apis.frames.postFrameAction(this.apiKey, body); return response.data; } @@ -1845,8 +1972,9 @@ export class NeynarV2APIClient { * * @param {string} messageBytesInHex - The message bytes from the Frame Action in hexadecimal format. * @param {Object} [options] - Optional parameters for the validation request. - * @param {boolean} [options.castReactionContext] - Include context about cast reactions in the validation response. - * @param {boolean} [options.followContext] - Include context about follow actions in the validation response. + * @param {boolean} [options.castReactionContext] - Adds viewer_context inside the cast object to indicate whether the interactor reacted to the cast housing the frame. + * @param {boolean} [options.followContext] - Adds viewer_context inside the user (interactor) object to indicate whether the interactor follows or is followed by the cast author. + * @param {boolean} [options.signerContext] - Adds context about the app used by the user inside `frame.action`. * * @returns {Promise} A promise that resolves to a `ValidateFrameActionResponse` object, * indicating the outcome of the frame action validation, potentially enriched with specified contexts. @@ -1854,7 +1982,7 @@ export class NeynarV2APIClient { * @example * // Example: Validate a frame action with additional context for cast reactions and follow actions * const messageBytesInHex = '0a49080d1085940118f6a6a32e20018201390a1a86db69b3ffdf6ab8acb6872b69ccbe7eb6a67af7ab71e95aa69f10021a1908ef011214237025b322fd03a9ddc7ec6c078fb9c56d1a72111214e3d88aeb2d0af356024e0c693f31c11b42c76b721801224043cb2f3fcbfb5dafce110e934b9369267cf3d1aef06f51ce653dc01700fc7b778522eb7873fd60dda4611376200076caf26d40a736d3919ce14e78a684e4d30b280132203a66717c82d728beb3511b05975c6603275c7f6a0600370bf637b9ecd2bd231e'; - * client.validateFrameAction(messageBytesInHex, { castReactionContext: false, followContext: true }).then(response => { + * client.validateFrameAction(messageBytesInHex, { castReactionContext: false, followContext: true, signerContext: true }).then(response => { * console.log('Frame Action Validation:', response); * }); * @@ -1865,6 +1993,7 @@ export class NeynarV2APIClient { options?: { castReactionContext?: boolean; followContext?: boolean; + signerContext?: boolean; } ): Promise { const reqBody: ValidateFrameRequest = { @@ -1875,9 +2004,229 @@ export class NeynarV2APIClient { ...(typeof options?.followContext !== "undefined" && { follow_context: options?.followContext, }), + ...(typeof options?.signerContext !== "undefined" && { + signer_context: options?.signerContext, + }), }; - const response = await this.apis.frame.validateFrame(this.apiKey, reqBody); + const response = await this.apis.frames.validateFrame(this.apiKey, reqBody); + return response.data; + } + + // ------------ Webhook ------------ + + /** + * Retrieves details about a specific webhook by its ID. + * + * @param {string} webhookId - The unique identifier of the webhook to be retrieved. + * + * @returns {Promise} A promise that resolves to a `WebhookResponse` object, + * containing detailed information about the requested webhook. + * + * @example + * // Example: Fetch information about a specific webhook by ID + * const webhookId = 'yourWebhookId'; + * client.lookupWebhook(webhookId).then(response => { + * console.log('Webhook Details:', response); + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/lookup-webhook). + */ + public async lookupWebhook(webhookId: string): Promise { + const response = await this.apis.webhook.lookupWebhook( + this.apiKey, + webhookId + ); + return response.data; + } + + /** + * Creates a new webhook with the specified parameters. This method enables developers to + * programmatically register webhooks for receiving real-time notifications of events that occur + * within Farcaster. + * + * @param {string} name - The name of the webhook. + * @param {string} url - The URL to which the webhook events will be sent. + * @param {Object} [options] - Optional parameters for the webhook creation. + * @param {WebhookSubscriptionFilters} [options.subscription] - A set of filters defining the events the webhook should subscribe to. + * + * @returns {Promise} A promise that resolves to a `WebhookResponse` object, + * containing information about the newly created webhook, including its ID, name, and subscription details. + * + * @example + * // Example: Create a new webhook for user sign-up events + * const name = 'Cast created Webhook'; + * const url = 'https://example.com/webhook'; + * const subscription = { + "cast.created": { + "author_fids": [ + 3, + 196, + 194 + ], + "mentioned_fids": [196], + }, + "user.created": {} + } + * client.publishWebhook(name, url, { subscription }).then(response => { + * console.log('Newly Created Webhook:', response); + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/publish-webhook). + */ + public async publishWebhook( + name: string, + url: string, + options?: { + subscription: WebhookSubscriptionFilters; + } + ): Promise { + const webhookPostReqBody: WebhookPostReqBody = { + name, + url, + ...(typeof options?.subscription !== "undefined" && { + subscription: options?.subscription, + }), + }; + + const response = await this.apis.webhook.publishWebhook( + this.apiKey, + webhookPostReqBody + ); + return response.data; + } + + /** + * Updates the active status of a specified webhook. + * + * @param {string} webhookId - The unique identifier of the webhook whose active status is being toggled. + * @param {boolean} active - The desired active status of the webhook. Set to `true` to activate the webhook or `false` to deactivate it. + * + * @returns {Promise} A promise that resolves to a `WebhookResponse` object. + * + * @example + * // Example: Deactivate a webhook + * const webhookId = 'yourWebhookId'; + * client.updateWebhookActiveStatus(webhookId, false).then(response => { + * console.log('Webhook Active Status Toggled:', response); + * }); + * + * // Example: Reactivate a webhook + * client.updateWebhookActiveStatus(webhookId, true).then(response => { + * console.log('Webhook Active Status Toggled:', response); + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/toggle-webhook-active-status). + */ + public async updateWebhookActiveStatus( + webhookId: string, + active: boolean + ): Promise { + const webhookPatchReqBody: WebhookPatchReqBody = { + webhook_id: webhookId, + active: active.toString() as WebhookPatchReqBodyActiveEnum, + }; + + const response = await this.apis.webhook.updateWebhookActiveStatus( + this.apiKey, + webhookPatchReqBody + ); + return response.data; + } + + /** + * Updates an existing webhook with new parameters, including its name, URL, and event subscriptions. + * + * @param {string} webhookId - The unique identifier of the webhook to be updated. + * @param {string} name - The new name for the webhook. Useful for identification and management purposes. + * @param {string} url - The new URL to which the webhook events will be sent. + * @param {Object} [options] - Optional parameters for updating the webhook. + * @param {WebhookSubscriptionFilters} [options.subscription] - A set of filters defining the events the webhook should subscribe to after the update. + * + * @returns {Promise} A promise that resolves to a `WebhookResponse` object, + * containing the updated information about the webhook, including its ID, name, subscription details, and more. + * + * @example + * // Example: Update an existing webhook with a new URL and subscription filters + * const webhookId = 'existingWebhookId'; + * const newName = 'UpdatedWebhookName'; + * const newUrl = 'https://example.com/new-webhook-url'; + * const subscription = { + "cast.created": { + "author_fids": [ + 2, 4, 6 + ], + "mentioned_fids": [194], + }, + "user.created": {} + } + * client.updateWebhook(webhookId, newName, newUrl, { subscription }).then(response => { + * console.log('Updated Webhook:', response); + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/update-webhook). + */ + public async updateWebhook( + webhookId: string, + name: string, + url: string, + options?: { + subscription: WebhookSubscriptionFilters; + } + ): Promise { + const webhookPutReqBody: WebhookPutReqBody = { + name, + url, + webhook_id: webhookId, + ...(typeof options?.subscription !== "undefined" && { + subscription: options?.subscription, + }), + }; + const response = await this.apis.webhook.updateWebhook( + this.apiKey, + webhookPutReqBody + ); + return response.data; + } + + /** + * Deletes a specified webhook by its unique identifier. + * + * @param {string} webhookId - The unique identifier of the webhook to be deleted. + * + * @returns {Promise} A promise that resolves to a `WebhookResponse` object. + * + * @example + * // Example: Delete a specific webhook by ID + * const webhookId = 'yourWebhookId'; + * client.deleteWebhook(webhookId).then(response => { + * console.log('Webhook Deletion Response:', response); + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/delete-webhook). + */ + public async deleteWebhook(webhookId: string): Promise { + const response = await this.apis.webhook.deleteWebhook(this.apiKey, { + webhook_id: webhookId, + }); + return response.data; + } + + /** + * Retrieves a list of all webhooks currently associated with the user's account. + * + * @returns {Promise} A promise that resolves to a `WebhookListResponse` object. + * + * @example + * // Example: Fetch a list of all webhooks associated with the user's account + * client.fetchWebhooks().then(response => { + * console.log('List of Webhooks:', response); + * }); + * + * For more information, refer to the [Neynar documentation](https://docs.neynar.com/reference/fetch-webhooks). + */ + public async fetchWebhooks(): Promise { + const response = await this.apis.webhook.fetchWebhooks(this.apiKey); return response.data; } diff --git a/src/neynar-api/v2/openapi-farcaster/.openapi-generator/FILES b/src/neynar-api/v2/openapi-farcaster/.openapi-generator/FILES index 493bd3e4..8df625a3 100644 --- a/src/neynar-api/v2/openapi-farcaster/.openapi-generator/FILES +++ b/src/neynar-api/v2/openapi-farcaster/.openapi-generator/FILES @@ -7,12 +7,15 @@ apis/channel-api.ts apis/feed-api.ts apis/fname-api.ts apis/follows-api.ts -apis/frame-api.ts +apis/frames-api.ts +apis/neynar-frames-api.ts apis/notifications-api.ts apis/reaction-api.ts apis/signer-api.ts +apis/signer-developer-managed-api.ts apis/storage-api.ts apis/user-api.ts +apis/webhook-api.ts base.ts common.ts configuration.ts @@ -44,6 +47,7 @@ models/dehydrated-follower.ts models/delete-cast-req-body.ts models/delete-frame-response.ts models/delete-neynar-frame-request.ts +models/developer-managed-signer.ts models/embed-cast-id.ts models/embed-url.ts models/embedded-cast.ts @@ -62,6 +66,7 @@ models/frame-action.ts models/frame-button-action-type.ts models/frame-input.ts models/frame-state.ts +models/frame-transaction.ts models/frame.ts models/get-casts-req-body.ts models/hydrated-follower.ts @@ -97,6 +102,7 @@ models/reaction-with-cast-info.ts models/reaction-with-user-info.ts models/reactions-response.ts models/reactions-type.ts +models/register-developer-managed-signed-key-req-body.ts models/register-signer-key-req-body.ts models/register-user-req-body.ts models/register-user-response.ts @@ -123,4 +129,18 @@ models/users-active-channels-response.ts models/users-response.ts models/validate-frame-action-response.ts models/validate-frame-request.ts +models/validated-frame-action-signer.ts models/validated-frame-action.ts +models/webhook-delete-req-body.ts +models/webhook-list-response.ts +models/webhook-patch-req-body.ts +models/webhook-post-req-body.ts +models/webhook-put-req-body-all-of.ts +models/webhook-put-req-body.ts +models/webhook-response.ts +models/webhook-secret.ts +models/webhook-subscription-filters-cast-created.ts +models/webhook-subscription-filters-user-updated.ts +models/webhook-subscription-filters.ts +models/webhook-subscription.ts +models/webhook.ts diff --git a/src/neynar-api/v2/openapi-farcaster/api.ts b/src/neynar-api/v2/openapi-farcaster/api.ts index bbe48498..05587921 100644 --- a/src/neynar-api/v2/openapi-farcaster/api.ts +++ b/src/neynar-api/v2/openapi-farcaster/api.ts @@ -19,10 +19,13 @@ export * from './apis/channel-api'; export * from './apis/feed-api'; export * from './apis/fname-api'; export * from './apis/follows-api'; -export * from './apis/frame-api'; +export * from './apis/frames-api'; +export * from './apis/neynar-frames-api'; export * from './apis/notifications-api'; export * from './apis/reaction-api'; export * from './apis/signer-api'; +export * from './apis/signer-developer-managed-api'; export * from './apis/storage-api'; export * from './apis/user-api'; +export * from './apis/webhook-api'; diff --git a/src/neynar-api/v2/openapi-farcaster/apis/frames-api.ts b/src/neynar-api/v2/openapi-farcaster/apis/frames-api.ts new file mode 100644 index 00000000..557ef124 --- /dev/null +++ b/src/neynar-api/v2/openapi-farcaster/apis/frames-api.ts @@ -0,0 +1,227 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Farcaster API V2 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import type { Configuration } from '../configuration'; +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; +// Some imports not used depending on template conditions +// @ts-ignore +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; +// @ts-ignore +import { ErrorRes } from '../models'; +// @ts-ignore +import { FrameActionReqBody } from '../models'; +// @ts-ignore +import { FrameActionResponse } from '../models'; +// @ts-ignore +import { ValidateFrameActionResponse } from '../models'; +// @ts-ignore +import { ValidateFrameRequest } from '../models'; +/** + * FramesApi - axios parameter creator + * @export + */ +export const FramesApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * Post a frame action \\ (In order to post a frame action, you need to have an approved `signer_uuid`) The POST request to the post_url has a timeout of 5 seconds. + * @summary Posts a frame action + * @param {string} apiKey API key required for authentication. + * @param {FrameActionReqBody} frameActionReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + postFrameAction: async (apiKey: string, frameActionReqBody: FrameActionReqBody, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('postFrameAction', 'apiKey', apiKey) + // verify required parameter 'frameActionReqBody' is not null or undefined + assertParamExists('postFrameAction', 'frameActionReqBody', frameActionReqBody) + const localVarPath = `/farcaster/frame/action`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + if (apiKey != null) { + localVarHeaderParameter['api_key'] = String(apiKey); + } + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(frameActionReqBody, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Validates a frame against by an interacting user against a Farcaster Hub \\ (In order to validate a frame, message bytes from Frame Action must be provided in hex) + * @summary Validates a frame action against Farcaster Hub + * @param {string} apiKey API key required for authentication. + * @param {ValidateFrameRequest} validateFrameRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + validateFrame: async (apiKey: string, validateFrameRequest: ValidateFrameRequest, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('validateFrame', 'apiKey', apiKey) + // verify required parameter 'validateFrameRequest' is not null or undefined + assertParamExists('validateFrame', 'validateFrameRequest', validateFrameRequest) + const localVarPath = `/farcaster/frame/validate`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + if (apiKey != null) { + localVarHeaderParameter['api_key'] = String(apiKey); + } + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(validateFrameRequest, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * FramesApi - functional programming interface + * @export + */ +export const FramesApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = FramesApiAxiosParamCreator(configuration) + return { + /** + * Post a frame action \\ (In order to post a frame action, you need to have an approved `signer_uuid`) The POST request to the post_url has a timeout of 5 seconds. + * @summary Posts a frame action + * @param {string} apiKey API key required for authentication. + * @param {FrameActionReqBody} frameActionReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async postFrameAction(apiKey: string, frameActionReqBody: FrameActionReqBody, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.postFrameAction(apiKey, frameActionReqBody, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Validates a frame against by an interacting user against a Farcaster Hub \\ (In order to validate a frame, message bytes from Frame Action must be provided in hex) + * @summary Validates a frame action against Farcaster Hub + * @param {string} apiKey API key required for authentication. + * @param {ValidateFrameRequest} validateFrameRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async validateFrame(apiKey: string, validateFrameRequest: ValidateFrameRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.validateFrame(apiKey, validateFrameRequest, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + } +}; + +/** + * FramesApi - factory interface + * @export + */ +export const FramesApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = FramesApiFp(configuration) + return { + /** + * Post a frame action \\ (In order to post a frame action, you need to have an approved `signer_uuid`) The POST request to the post_url has a timeout of 5 seconds. + * @summary Posts a frame action + * @param {string} apiKey API key required for authentication. + * @param {FrameActionReqBody} frameActionReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + postFrameAction(apiKey: string, frameActionReqBody: FrameActionReqBody, options?: any): AxiosPromise { + return localVarFp.postFrameAction(apiKey, frameActionReqBody, options).then((request) => request(axios, basePath)); + }, + /** + * Validates a frame against by an interacting user against a Farcaster Hub \\ (In order to validate a frame, message bytes from Frame Action must be provided in hex) + * @summary Validates a frame action against Farcaster Hub + * @param {string} apiKey API key required for authentication. + * @param {ValidateFrameRequest} validateFrameRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + validateFrame(apiKey: string, validateFrameRequest: ValidateFrameRequest, options?: any): AxiosPromise { + return localVarFp.validateFrame(apiKey, validateFrameRequest, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * FramesApi - object-oriented interface + * @export + * @class FramesApi + * @extends {BaseAPI} + */ +export class FramesApi extends BaseAPI { + /** + * Post a frame action \\ (In order to post a frame action, you need to have an approved `signer_uuid`) The POST request to the post_url has a timeout of 5 seconds. + * @summary Posts a frame action + * @param {string} apiKey API key required for authentication. + * @param {FrameActionReqBody} frameActionReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof FramesApi + */ + public postFrameAction(apiKey: string, frameActionReqBody: FrameActionReqBody, options?: AxiosRequestConfig) { + return FramesApiFp(this.configuration).postFrameAction(apiKey, frameActionReqBody, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Validates a frame against by an interacting user against a Farcaster Hub \\ (In order to validate a frame, message bytes from Frame Action must be provided in hex) + * @summary Validates a frame action against Farcaster Hub + * @param {string} apiKey API key required for authentication. + * @param {ValidateFrameRequest} validateFrameRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof FramesApi + */ + public validateFrame(apiKey: string, validateFrameRequest: ValidateFrameRequest, options?: AxiosRequestConfig) { + return FramesApiFp(this.configuration).validateFrame(apiKey, validateFrameRequest, options).then((request) => request(this.axios, this.basePath)); + } +} diff --git a/src/neynar-api/v2/openapi-farcaster/apis/frame-api.ts b/src/neynar-api/v2/openapi-farcaster/apis/neynar-frames-api.ts similarity index 65% rename from src/neynar-api/v2/openapi-farcaster/apis/frame-api.ts rename to src/neynar-api/v2/openapi-farcaster/apis/neynar-frames-api.ts index 88fd1d84..cd282ccf 100644 --- a/src/neynar-api/v2/openapi-farcaster/apis/frame-api.ts +++ b/src/neynar-api/v2/openapi-farcaster/apis/neynar-frames-api.ts @@ -28,24 +28,16 @@ import { DeleteNeynarFrameRequest } from '../models'; // @ts-ignore import { ErrorRes } from '../models'; // @ts-ignore -import { FrameActionReqBody } from '../models'; -// @ts-ignore -import { FrameActionResponse } from '../models'; -// @ts-ignore import { NeynarFrame } from '../models'; // @ts-ignore import { NeynarFrameCreationRequest } from '../models'; // @ts-ignore import { NeynarFrameUpdateRequest } from '../models'; -// @ts-ignore -import { ValidateFrameActionResponse } from '../models'; -// @ts-ignore -import { ValidateFrameRequest } from '../models'; /** - * FrameApi - axios parameter creator + * NeynarFramesApi - axios parameter creator * @export */ -export const FrameApiAxiosParamCreator = function (configuration?: Configuration) { +export const NeynarFramesApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * Delete an existing frame, if it was made by the developer (identified by API key) @@ -171,49 +163,6 @@ export const FrameApiAxiosParamCreator = function (configuration?: Configuration options: localVarRequestOptions, }; }, - /** - * Post a frame action \\ (In order to post a frame action, you need to have an approved `signer_uuid`) The POST request to the post_url has a timeout of 5 seconds. - * @summary Posts a frame action - * @param {string} apiKey API key required for authentication. - * @param {FrameActionReqBody} frameActionReqBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - postFrameAction: async (apiKey: string, frameActionReqBody: FrameActionReqBody, options: AxiosRequestConfig = {}): Promise => { - // verify required parameter 'apiKey' is not null or undefined - assertParamExists('postFrameAction', 'apiKey', apiKey) - // verify required parameter 'frameActionReqBody' is not null or undefined - assertParamExists('postFrameAction', 'frameActionReqBody', frameActionReqBody) - const localVarPath = `/farcaster/frame/action`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - if (apiKey != null) { - localVarHeaderParameter['api_key'] = String(apiKey); - } - - - - localVarHeaderParameter['Content-Type'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(frameActionReqBody, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, /** * Create a new frame with a list of pages. * @summary Create a new frame @@ -295,49 +244,6 @@ export const FrameApiAxiosParamCreator = function (configuration?: Configuration localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(neynarFrameUpdateRequest, localVarRequestOptions, configuration) - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Validates a frame against by an interacting user against a Farcaster Hub \\ (In order to validate a frame, message bytes from Frame Action must be provided in hex) - * @summary Validates a frame action against Farcaster Hub - * @param {string} apiKey API key required for authentication. - * @param {ValidateFrameRequest} validateFrameRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - validateFrame: async (apiKey: string, validateFrameRequest: ValidateFrameRequest, options: AxiosRequestConfig = {}): Promise => { - // verify required parameter 'apiKey' is not null or undefined - assertParamExists('validateFrame', 'apiKey', apiKey) - // verify required parameter 'validateFrameRequest' is not null or undefined - assertParamExists('validateFrame', 'validateFrameRequest', validateFrameRequest) - const localVarPath = `/farcaster/frame/validate`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - if (apiKey != null) { - localVarHeaderParameter['api_key'] = String(apiKey); - } - - - - localVarHeaderParameter['Content-Type'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(validateFrameRequest, localVarRequestOptions, configuration) - return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, @@ -347,11 +253,11 @@ export const FrameApiAxiosParamCreator = function (configuration?: Configuration }; /** - * FrameApi - functional programming interface + * NeynarFramesApi - functional programming interface * @export */ -export const FrameApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = FrameApiAxiosParamCreator(configuration) +export const NeynarFramesApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = NeynarFramesApiAxiosParamCreator(configuration) return { /** * Delete an existing frame, if it was made by the developer (identified by API key) @@ -388,18 +294,6 @@ export const FrameApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.lookupNeynarFrame(apiKey, uuid, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, - /** - * Post a frame action \\ (In order to post a frame action, you need to have an approved `signer_uuid`) The POST request to the post_url has a timeout of 5 seconds. - * @summary Posts a frame action - * @param {string} apiKey API key required for authentication. - * @param {FrameActionReqBody} frameActionReqBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async postFrameAction(apiKey: string, frameActionReqBody: FrameActionReqBody, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.postFrameAction(apiKey, frameActionReqBody, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); - }, /** * Create a new frame with a list of pages. * @summary Create a new frame @@ -424,27 +318,15 @@ export const FrameApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.updateNeynarFrame(apiKey, neynarFrameUpdateRequest, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, - /** - * Validates a frame against by an interacting user against a Farcaster Hub \\ (In order to validate a frame, message bytes from Frame Action must be provided in hex) - * @summary Validates a frame action against Farcaster Hub - * @param {string} apiKey API key required for authentication. - * @param {ValidateFrameRequest} validateFrameRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async validateFrame(apiKey: string, validateFrameRequest: ValidateFrameRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.validateFrame(apiKey, validateFrameRequest, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); - }, } }; /** - * FrameApi - factory interface + * NeynarFramesApi - factory interface * @export */ -export const FrameApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { - const localVarFp = FrameApiFp(configuration) +export const NeynarFramesApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = NeynarFramesApiFp(configuration) return { /** * Delete an existing frame, if it was made by the developer (identified by API key) @@ -478,17 +360,6 @@ export const FrameApiFactory = function (configuration?: Configuration, basePath lookupNeynarFrame(apiKey: string, uuid: string, options?: any): AxiosPromise { return localVarFp.lookupNeynarFrame(apiKey, uuid, options).then((request) => request(axios, basePath)); }, - /** - * Post a frame action \\ (In order to post a frame action, you need to have an approved `signer_uuid`) The POST request to the post_url has a timeout of 5 seconds. - * @summary Posts a frame action - * @param {string} apiKey API key required for authentication. - * @param {FrameActionReqBody} frameActionReqBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - postFrameAction(apiKey: string, frameActionReqBody: FrameActionReqBody, options?: any): AxiosPromise { - return localVarFp.postFrameAction(apiKey, frameActionReqBody, options).then((request) => request(axios, basePath)); - }, /** * Create a new frame with a list of pages. * @summary Create a new frame @@ -511,27 +382,16 @@ export const FrameApiFactory = function (configuration?: Configuration, basePath updateNeynarFrame(apiKey: string, neynarFrameUpdateRequest: NeynarFrameUpdateRequest, options?: any): AxiosPromise { return localVarFp.updateNeynarFrame(apiKey, neynarFrameUpdateRequest, options).then((request) => request(axios, basePath)); }, - /** - * Validates a frame against by an interacting user against a Farcaster Hub \\ (In order to validate a frame, message bytes from Frame Action must be provided in hex) - * @summary Validates a frame action against Farcaster Hub - * @param {string} apiKey API key required for authentication. - * @param {ValidateFrameRequest} validateFrameRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - validateFrame(apiKey: string, validateFrameRequest: ValidateFrameRequest, options?: any): AxiosPromise { - return localVarFp.validateFrame(apiKey, validateFrameRequest, options).then((request) => request(axios, basePath)); - }, }; }; /** - * FrameApi - object-oriented interface + * NeynarFramesApi - object-oriented interface * @export - * @class FrameApi + * @class NeynarFramesApi * @extends {BaseAPI} */ -export class FrameApi extends BaseAPI { +export class NeynarFramesApi extends BaseAPI { /** * Delete an existing frame, if it was made by the developer (identified by API key) * @summary Delete a frame @@ -539,10 +399,10 @@ export class FrameApi extends BaseAPI { * @param {DeleteNeynarFrameRequest} deleteNeynarFrameRequest * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof FrameApi + * @memberof NeynarFramesApi */ public deleteNeynarFrame(apiKey: string, deleteNeynarFrameRequest: DeleteNeynarFrameRequest, options?: AxiosRequestConfig) { - return FrameApiFp(this.configuration).deleteNeynarFrame(apiKey, deleteNeynarFrameRequest, options).then((request) => request(this.axios, this.basePath)); + return NeynarFramesApiFp(this.configuration).deleteNeynarFrame(apiKey, deleteNeynarFrameRequest, options).then((request) => request(this.axios, this.basePath)); } /** @@ -551,10 +411,10 @@ export class FrameApi extends BaseAPI { * @param {string} apiKey API key required for authentication. * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof FrameApi + * @memberof NeynarFramesApi */ public fetchNeynarFrames(apiKey: string, options?: AxiosRequestConfig) { - return FrameApiFp(this.configuration).fetchNeynarFrames(apiKey, options).then((request) => request(this.axios, this.basePath)); + return NeynarFramesApiFp(this.configuration).fetchNeynarFrames(apiKey, options).then((request) => request(this.axios, this.basePath)); } /** @@ -564,23 +424,10 @@ export class FrameApi extends BaseAPI { * @param {string} uuid UUID of the frame to retrieve * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof FrameApi + * @memberof NeynarFramesApi */ public lookupNeynarFrame(apiKey: string, uuid: string, options?: AxiosRequestConfig) { - return FrameApiFp(this.configuration).lookupNeynarFrame(apiKey, uuid, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * Post a frame action \\ (In order to post a frame action, you need to have an approved `signer_uuid`) The POST request to the post_url has a timeout of 5 seconds. - * @summary Posts a frame action - * @param {string} apiKey API key required for authentication. - * @param {FrameActionReqBody} frameActionReqBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof FrameApi - */ - public postFrameAction(apiKey: string, frameActionReqBody: FrameActionReqBody, options?: AxiosRequestConfig) { - return FrameApiFp(this.configuration).postFrameAction(apiKey, frameActionReqBody, options).then((request) => request(this.axios, this.basePath)); + return NeynarFramesApiFp(this.configuration).lookupNeynarFrame(apiKey, uuid, options).then((request) => request(this.axios, this.basePath)); } /** @@ -590,10 +437,10 @@ export class FrameApi extends BaseAPI { * @param {NeynarFrameCreationRequest} neynarFrameCreationRequest * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof FrameApi + * @memberof NeynarFramesApi */ public publishNeynarFrame(apiKey: string, neynarFrameCreationRequest: NeynarFrameCreationRequest, options?: AxiosRequestConfig) { - return FrameApiFp(this.configuration).publishNeynarFrame(apiKey, neynarFrameCreationRequest, options).then((request) => request(this.axios, this.basePath)); + return NeynarFramesApiFp(this.configuration).publishNeynarFrame(apiKey, neynarFrameCreationRequest, options).then((request) => request(this.axios, this.basePath)); } /** @@ -603,22 +450,9 @@ export class FrameApi extends BaseAPI { * @param {NeynarFrameUpdateRequest} neynarFrameUpdateRequest * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof FrameApi + * @memberof NeynarFramesApi */ public updateNeynarFrame(apiKey: string, neynarFrameUpdateRequest: NeynarFrameUpdateRequest, options?: AxiosRequestConfig) { - return FrameApiFp(this.configuration).updateNeynarFrame(apiKey, neynarFrameUpdateRequest, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * Validates a frame against by an interacting user against a Farcaster Hub \\ (In order to validate a frame, message bytes from Frame Action must be provided in hex) - * @summary Validates a frame action against Farcaster Hub - * @param {string} apiKey API key required for authentication. - * @param {ValidateFrameRequest} validateFrameRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof FrameApi - */ - public validateFrame(apiKey: string, validateFrameRequest: ValidateFrameRequest, options?: AxiosRequestConfig) { - return FrameApiFp(this.configuration).validateFrame(apiKey, validateFrameRequest, options).then((request) => request(this.axios, this.basePath)); + return NeynarFramesApiFp(this.configuration).updateNeynarFrame(apiKey, neynarFrameUpdateRequest, options).then((request) => request(this.axios, this.basePath)); } } diff --git a/src/neynar-api/v2/openapi-farcaster/apis/signer-developer-managed-api.ts b/src/neynar-api/v2/openapi-farcaster/apis/signer-developer-managed-api.ts new file mode 100644 index 00000000..208b2064 --- /dev/null +++ b/src/neynar-api/v2/openapi-farcaster/apis/signer-developer-managed-api.ts @@ -0,0 +1,303 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Farcaster API V2 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import type { Configuration } from '../configuration'; +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; +// Some imports not used depending on template conditions +// @ts-ignore +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; +// @ts-ignore +import { DeveloperManagedSigner } from '../models'; +// @ts-ignore +import { ErrorRes } from '../models'; +// @ts-ignore +import { RegisterDeveloperManagedSignedKeyReqBody } from '../models'; +/** + * SignerDeveloperManagedApi - axios parameter creator + * @export + */ +export const SignerDeveloperManagedApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * Fetches the status of a developer managed signer by public key + * @summary Fetches the status of a signer by public key + * @param {string} apiKey API key required for authentication. + * @param {string} publicKey + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + developerManagedSigner: async (apiKey: string, publicKey: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('developerManagedSigner', 'apiKey', apiKey) + // verify required parameter 'publicKey' is not null or undefined + assertParamExists('developerManagedSigner', 'publicKey', publicKey) + const localVarPath = `/farcaster/signer/developer_managed`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + if (publicKey !== undefined) { + localVarQueryParameter['public_key'] = publicKey; + } + + if (apiKey != null) { + localVarHeaderParameter['api_key'] = String(apiKey); + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Publish a message to farcaster.\\ The message must be signed by a signer managed by the developer. Use the @farcaster/core library to construct and sign the message. Use the Message.toJSON method on the signed message and pass the JSON in the body of this POST request. + * @summary Publish a message to farcaster + * @param {string} apiKey API key required for authentication. + * @param {object} body + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + publishMessage: async (apiKey: string, body: object, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('publishMessage', 'apiKey', apiKey) + // verify required parameter 'body' is not null or undefined + assertParamExists('publishMessage', 'body', body) + const localVarPath = `/farcaster/message`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + if (apiKey != null) { + localVarHeaderParameter['api_key'] = String(apiKey); + } + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Registers an signed key and returns the developer managed signer status with an approval url. + * @summary Registers Signed Key + * @param {string} apiKey API key required for authentication. + * @param {RegisterDeveloperManagedSignedKeyReqBody} registerDeveloperManagedSignedKeyReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + registerSignedKeyForDeveloperManagedSigner: async (apiKey: string, registerDeveloperManagedSignedKeyReqBody: RegisterDeveloperManagedSignedKeyReqBody, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('registerSignedKeyForDeveloperManagedSigner', 'apiKey', apiKey) + // verify required parameter 'registerDeveloperManagedSignedKeyReqBody' is not null or undefined + assertParamExists('registerSignedKeyForDeveloperManagedSigner', 'registerDeveloperManagedSignedKeyReqBody', registerDeveloperManagedSignedKeyReqBody) + const localVarPath = `/farcaster/signer/developer_managed/signed_key`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + if (apiKey != null) { + localVarHeaderParameter['api_key'] = String(apiKey); + } + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(registerDeveloperManagedSignedKeyReqBody, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * SignerDeveloperManagedApi - functional programming interface + * @export + */ +export const SignerDeveloperManagedApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = SignerDeveloperManagedApiAxiosParamCreator(configuration) + return { + /** + * Fetches the status of a developer managed signer by public key + * @summary Fetches the status of a signer by public key + * @param {string} apiKey API key required for authentication. + * @param {string} publicKey + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async developerManagedSigner(apiKey: string, publicKey: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.developerManagedSigner(apiKey, publicKey, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Publish a message to farcaster.\\ The message must be signed by a signer managed by the developer. Use the @farcaster/core library to construct and sign the message. Use the Message.toJSON method on the signed message and pass the JSON in the body of this POST request. + * @summary Publish a message to farcaster + * @param {string} apiKey API key required for authentication. + * @param {object} body + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async publishMessage(apiKey: string, body: object, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.publishMessage(apiKey, body, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Registers an signed key and returns the developer managed signer status with an approval url. + * @summary Registers Signed Key + * @param {string} apiKey API key required for authentication. + * @param {RegisterDeveloperManagedSignedKeyReqBody} registerDeveloperManagedSignedKeyReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async registerSignedKeyForDeveloperManagedSigner(apiKey: string, registerDeveloperManagedSignedKeyReqBody: RegisterDeveloperManagedSignedKeyReqBody, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.registerSignedKeyForDeveloperManagedSigner(apiKey, registerDeveloperManagedSignedKeyReqBody, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + } +}; + +/** + * SignerDeveloperManagedApi - factory interface + * @export + */ +export const SignerDeveloperManagedApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = SignerDeveloperManagedApiFp(configuration) + return { + /** + * Fetches the status of a developer managed signer by public key + * @summary Fetches the status of a signer by public key + * @param {string} apiKey API key required for authentication. + * @param {string} publicKey + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + developerManagedSigner(apiKey: string, publicKey: string, options?: any): AxiosPromise { + return localVarFp.developerManagedSigner(apiKey, publicKey, options).then((request) => request(axios, basePath)); + }, + /** + * Publish a message to farcaster.\\ The message must be signed by a signer managed by the developer. Use the @farcaster/core library to construct and sign the message. Use the Message.toJSON method on the signed message and pass the JSON in the body of this POST request. + * @summary Publish a message to farcaster + * @param {string} apiKey API key required for authentication. + * @param {object} body + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + publishMessage(apiKey: string, body: object, options?: any): AxiosPromise { + return localVarFp.publishMessage(apiKey, body, options).then((request) => request(axios, basePath)); + }, + /** + * Registers an signed key and returns the developer managed signer status with an approval url. + * @summary Registers Signed Key + * @param {string} apiKey API key required for authentication. + * @param {RegisterDeveloperManagedSignedKeyReqBody} registerDeveloperManagedSignedKeyReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + registerSignedKeyForDeveloperManagedSigner(apiKey: string, registerDeveloperManagedSignedKeyReqBody: RegisterDeveloperManagedSignedKeyReqBody, options?: any): AxiosPromise { + return localVarFp.registerSignedKeyForDeveloperManagedSigner(apiKey, registerDeveloperManagedSignedKeyReqBody, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * SignerDeveloperManagedApi - object-oriented interface + * @export + * @class SignerDeveloperManagedApi + * @extends {BaseAPI} + */ +export class SignerDeveloperManagedApi extends BaseAPI { + /** + * Fetches the status of a developer managed signer by public key + * @summary Fetches the status of a signer by public key + * @param {string} apiKey API key required for authentication. + * @param {string} publicKey + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof SignerDeveloperManagedApi + */ + public developerManagedSigner(apiKey: string, publicKey: string, options?: AxiosRequestConfig) { + return SignerDeveloperManagedApiFp(this.configuration).developerManagedSigner(apiKey, publicKey, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Publish a message to farcaster.\\ The message must be signed by a signer managed by the developer. Use the @farcaster/core library to construct and sign the message. Use the Message.toJSON method on the signed message and pass the JSON in the body of this POST request. + * @summary Publish a message to farcaster + * @param {string} apiKey API key required for authentication. + * @param {object} body + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof SignerDeveloperManagedApi + */ + public publishMessage(apiKey: string, body: object, options?: AxiosRequestConfig) { + return SignerDeveloperManagedApiFp(this.configuration).publishMessage(apiKey, body, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Registers an signed key and returns the developer managed signer status with an approval url. + * @summary Registers Signed Key + * @param {string} apiKey API key required for authentication. + * @param {RegisterDeveloperManagedSignedKeyReqBody} registerDeveloperManagedSignedKeyReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof SignerDeveloperManagedApi + */ + public registerSignedKeyForDeveloperManagedSigner(apiKey: string, registerDeveloperManagedSignedKeyReqBody: RegisterDeveloperManagedSignedKeyReqBody, options?: AxiosRequestConfig) { + return SignerDeveloperManagedApiFp(this.configuration).registerSignedKeyForDeveloperManagedSigner(apiKey, registerDeveloperManagedSignedKeyReqBody, options).then((request) => request(this.axios, this.basePath)); + } +} diff --git a/src/neynar-api/v2/openapi-farcaster/apis/webhook-api.ts b/src/neynar-api/v2/openapi-farcaster/apis/webhook-api.ts new file mode 100644 index 00000000..d3f0762a --- /dev/null +++ b/src/neynar-api/v2/openapi-farcaster/apis/webhook-api.ts @@ -0,0 +1,539 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Farcaster API V2 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import type { Configuration } from '../configuration'; +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; +// Some imports not used depending on template conditions +// @ts-ignore +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; +// @ts-ignore +import { ErrorRes } from '../models'; +// @ts-ignore +import { WebhookDeleteReqBody } from '../models'; +// @ts-ignore +import { WebhookListResponse } from '../models'; +// @ts-ignore +import { WebhookPatchReqBody } from '../models'; +// @ts-ignore +import { WebhookPostReqBody } from '../models'; +// @ts-ignore +import { WebhookPutReqBody } from '../models'; +// @ts-ignore +import { WebhookResponse } from '../models'; +/** + * WebhookApi - axios parameter creator + * @export + */ +export const WebhookApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * Delete a webhook + * @summary Delete a webhook + * @param {string} apiKey API key required for authentication. + * @param {WebhookDeleteReqBody} webhookDeleteReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteWebhook: async (apiKey: string, webhookDeleteReqBody: WebhookDeleteReqBody, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('deleteWebhook', 'apiKey', apiKey) + // verify required parameter 'webhookDeleteReqBody' is not null or undefined + assertParamExists('deleteWebhook', 'webhookDeleteReqBody', webhookDeleteReqBody) + const localVarPath = `/farcaster/webhook`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + if (apiKey != null) { + localVarHeaderParameter['api_key'] = String(apiKey); + } + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(webhookDeleteReqBody, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Fetch a list of webhooks associated to a user + * @summary Fetch a list of webhooks associated to a user + * @param {string} apiKey API key required for authentication. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + fetchWebhooks: async (apiKey: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('fetchWebhooks', 'apiKey', apiKey) + const localVarPath = `/farcaster/webhook/list`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + if (apiKey != null) { + localVarHeaderParameter['api_key'] = String(apiKey); + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Fetch a webhook + * @summary Fetch a webhook + * @param {string} apiKey API key required for authentication. + * @param {string} webhookId + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + lookupWebhook: async (apiKey: string, webhookId: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('lookupWebhook', 'apiKey', apiKey) + // verify required parameter 'webhookId' is not null or undefined + assertParamExists('lookupWebhook', 'webhookId', webhookId) + const localVarPath = `/farcaster/webhook`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + if (webhookId !== undefined) { + localVarQueryParameter['webhook_id'] = webhookId; + } + + if (apiKey != null) { + localVarHeaderParameter['api_key'] = String(apiKey); + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Create a webhook + * @summary Create a webhook + * @param {string} apiKey API key required for authentication. + * @param {WebhookPostReqBody} webhookPostReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + publishWebhook: async (apiKey: string, webhookPostReqBody: WebhookPostReqBody, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('publishWebhook', 'apiKey', apiKey) + // verify required parameter 'webhookPostReqBody' is not null or undefined + assertParamExists('publishWebhook', 'webhookPostReqBody', webhookPostReqBody) + const localVarPath = `/farcaster/webhook`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + if (apiKey != null) { + localVarHeaderParameter['api_key'] = String(apiKey); + } + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(webhookPostReqBody, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Update a webhook + * @summary Update a webhook + * @param {string} apiKey API key required for authentication. + * @param {WebhookPutReqBody} webhookPutReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateWebhook: async (apiKey: string, webhookPutReqBody: WebhookPutReqBody, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('updateWebhook', 'apiKey', apiKey) + // verify required parameter 'webhookPutReqBody' is not null or undefined + assertParamExists('updateWebhook', 'webhookPutReqBody', webhookPutReqBody) + const localVarPath = `/farcaster/webhook`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + if (apiKey != null) { + localVarHeaderParameter['api_key'] = String(apiKey); + } + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(webhookPutReqBody, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Update webhook active status + * @summary Update webhook active status + * @param {string} apiKey API key required for authentication. + * @param {WebhookPatchReqBody} webhookPatchReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateWebhookActiveStatus: async (apiKey: string, webhookPatchReqBody: WebhookPatchReqBody, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'apiKey' is not null or undefined + assertParamExists('updateWebhookActiveStatus', 'apiKey', apiKey) + // verify required parameter 'webhookPatchReqBody' is not null or undefined + assertParamExists('updateWebhookActiveStatus', 'webhookPatchReqBody', webhookPatchReqBody) + const localVarPath = `/farcaster/webhook`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'PATCH', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + if (apiKey != null) { + localVarHeaderParameter['api_key'] = String(apiKey); + } + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(webhookPatchReqBody, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * WebhookApi - functional programming interface + * @export + */ +export const WebhookApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = WebhookApiAxiosParamCreator(configuration) + return { + /** + * Delete a webhook + * @summary Delete a webhook + * @param {string} apiKey API key required for authentication. + * @param {WebhookDeleteReqBody} webhookDeleteReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async deleteWebhook(apiKey: string, webhookDeleteReqBody: WebhookDeleteReqBody, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteWebhook(apiKey, webhookDeleteReqBody, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Fetch a list of webhooks associated to a user + * @summary Fetch a list of webhooks associated to a user + * @param {string} apiKey API key required for authentication. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async fetchWebhooks(apiKey: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.fetchWebhooks(apiKey, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Fetch a webhook + * @summary Fetch a webhook + * @param {string} apiKey API key required for authentication. + * @param {string} webhookId + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async lookupWebhook(apiKey: string, webhookId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.lookupWebhook(apiKey, webhookId, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Create a webhook + * @summary Create a webhook + * @param {string} apiKey API key required for authentication. + * @param {WebhookPostReqBody} webhookPostReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async publishWebhook(apiKey: string, webhookPostReqBody: WebhookPostReqBody, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.publishWebhook(apiKey, webhookPostReqBody, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Update a webhook + * @summary Update a webhook + * @param {string} apiKey API key required for authentication. + * @param {WebhookPutReqBody} webhookPutReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async updateWebhook(apiKey: string, webhookPutReqBody: WebhookPutReqBody, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateWebhook(apiKey, webhookPutReqBody, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Update webhook active status + * @summary Update webhook active status + * @param {string} apiKey API key required for authentication. + * @param {WebhookPatchReqBody} webhookPatchReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async updateWebhookActiveStatus(apiKey: string, webhookPatchReqBody: WebhookPatchReqBody, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateWebhookActiveStatus(apiKey, webhookPatchReqBody, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + } +}; + +/** + * WebhookApi - factory interface + * @export + */ +export const WebhookApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = WebhookApiFp(configuration) + return { + /** + * Delete a webhook + * @summary Delete a webhook + * @param {string} apiKey API key required for authentication. + * @param {WebhookDeleteReqBody} webhookDeleteReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteWebhook(apiKey: string, webhookDeleteReqBody: WebhookDeleteReqBody, options?: any): AxiosPromise { + return localVarFp.deleteWebhook(apiKey, webhookDeleteReqBody, options).then((request) => request(axios, basePath)); + }, + /** + * Fetch a list of webhooks associated to a user + * @summary Fetch a list of webhooks associated to a user + * @param {string} apiKey API key required for authentication. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + fetchWebhooks(apiKey: string, options?: any): AxiosPromise { + return localVarFp.fetchWebhooks(apiKey, options).then((request) => request(axios, basePath)); + }, + /** + * Fetch a webhook + * @summary Fetch a webhook + * @param {string} apiKey API key required for authentication. + * @param {string} webhookId + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + lookupWebhook(apiKey: string, webhookId: string, options?: any): AxiosPromise { + return localVarFp.lookupWebhook(apiKey, webhookId, options).then((request) => request(axios, basePath)); + }, + /** + * Create a webhook + * @summary Create a webhook + * @param {string} apiKey API key required for authentication. + * @param {WebhookPostReqBody} webhookPostReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + publishWebhook(apiKey: string, webhookPostReqBody: WebhookPostReqBody, options?: any): AxiosPromise { + return localVarFp.publishWebhook(apiKey, webhookPostReqBody, options).then((request) => request(axios, basePath)); + }, + /** + * Update a webhook + * @summary Update a webhook + * @param {string} apiKey API key required for authentication. + * @param {WebhookPutReqBody} webhookPutReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateWebhook(apiKey: string, webhookPutReqBody: WebhookPutReqBody, options?: any): AxiosPromise { + return localVarFp.updateWebhook(apiKey, webhookPutReqBody, options).then((request) => request(axios, basePath)); + }, + /** + * Update webhook active status + * @summary Update webhook active status + * @param {string} apiKey API key required for authentication. + * @param {WebhookPatchReqBody} webhookPatchReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateWebhookActiveStatus(apiKey: string, webhookPatchReqBody: WebhookPatchReqBody, options?: any): AxiosPromise { + return localVarFp.updateWebhookActiveStatus(apiKey, webhookPatchReqBody, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * WebhookApi - object-oriented interface + * @export + * @class WebhookApi + * @extends {BaseAPI} + */ +export class WebhookApi extends BaseAPI { + /** + * Delete a webhook + * @summary Delete a webhook + * @param {string} apiKey API key required for authentication. + * @param {WebhookDeleteReqBody} webhookDeleteReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof WebhookApi + */ + public deleteWebhook(apiKey: string, webhookDeleteReqBody: WebhookDeleteReqBody, options?: AxiosRequestConfig) { + return WebhookApiFp(this.configuration).deleteWebhook(apiKey, webhookDeleteReqBody, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Fetch a list of webhooks associated to a user + * @summary Fetch a list of webhooks associated to a user + * @param {string} apiKey API key required for authentication. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof WebhookApi + */ + public fetchWebhooks(apiKey: string, options?: AxiosRequestConfig) { + return WebhookApiFp(this.configuration).fetchWebhooks(apiKey, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Fetch a webhook + * @summary Fetch a webhook + * @param {string} apiKey API key required for authentication. + * @param {string} webhookId + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof WebhookApi + */ + public lookupWebhook(apiKey: string, webhookId: string, options?: AxiosRequestConfig) { + return WebhookApiFp(this.configuration).lookupWebhook(apiKey, webhookId, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Create a webhook + * @summary Create a webhook + * @param {string} apiKey API key required for authentication. + * @param {WebhookPostReqBody} webhookPostReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof WebhookApi + */ + public publishWebhook(apiKey: string, webhookPostReqBody: WebhookPostReqBody, options?: AxiosRequestConfig) { + return WebhookApiFp(this.configuration).publishWebhook(apiKey, webhookPostReqBody, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Update a webhook + * @summary Update a webhook + * @param {string} apiKey API key required for authentication. + * @param {WebhookPutReqBody} webhookPutReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof WebhookApi + */ + public updateWebhook(apiKey: string, webhookPutReqBody: WebhookPutReqBody, options?: AxiosRequestConfig) { + return WebhookApiFp(this.configuration).updateWebhook(apiKey, webhookPutReqBody, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Update webhook active status + * @summary Update webhook active status + * @param {string} apiKey API key required for authentication. + * @param {WebhookPatchReqBody} webhookPatchReqBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof WebhookApi + */ + public updateWebhookActiveStatus(apiKey: string, webhookPatchReqBody: WebhookPatchReqBody, options?: AxiosRequestConfig) { + return WebhookApiFp(this.configuration).updateWebhookActiveStatus(apiKey, webhookPatchReqBody, options).then((request) => request(this.axios, this.basePath)); + } +} diff --git a/src/neynar-api/v2/openapi-farcaster/models/developer-managed-signer.ts b/src/neynar-api/v2/openapi-farcaster/models/developer-managed-signer.ts new file mode 100644 index 00000000..043bd782 --- /dev/null +++ b/src/neynar-api/v2/openapi-farcaster/models/developer-managed-signer.ts @@ -0,0 +1,57 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Farcaster API V2 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface DeveloperManagedSigner + */ +export interface DeveloperManagedSigner { + /** + * Ed25519 public key + * @type {string} + * @memberof DeveloperManagedSigner + */ + 'public_key': string; + /** + * + * @type {string} + * @memberof DeveloperManagedSigner + */ + 'status': DeveloperManagedSignerStatusEnum; + /** + * + * @type {string} + * @memberof DeveloperManagedSigner + */ + 'signer_approval_url'?: string; + /** + * User identifier (unsigned integer) + * @type {number} + * @memberof DeveloperManagedSigner + */ + 'fid'?: number; +} + +export const DeveloperManagedSignerStatusEnum = { + PendingApproval: 'pending_approval', + Approved: 'approved', + Revoked: 'revoked' +} as const; + +export type DeveloperManagedSignerStatusEnum = typeof DeveloperManagedSignerStatusEnum[keyof typeof DeveloperManagedSignerStatusEnum]; + + diff --git a/src/neynar-api/v2/openapi-farcaster/models/error-res.ts b/src/neynar-api/v2/openapi-farcaster/models/error-res.ts index f6279045..a34fc0c9 100644 --- a/src/neynar-api/v2/openapi-farcaster/models/error-res.ts +++ b/src/neynar-api/v2/openapi-farcaster/models/error-res.ts @@ -15,7 +15,7 @@ /** - * Returns ErrorRes metadata + * Details for the error response * @export * @interface ErrorRes */ diff --git a/src/neynar-api/v2/openapi-farcaster/models/frame-action-button.ts b/src/neynar-api/v2/openapi-farcaster/models/frame-action-button.ts index 9b69a172..8886ef47 100644 --- a/src/neynar-api/v2/openapi-farcaster/models/frame-action-button.ts +++ b/src/neynar-api/v2/openapi-farcaster/models/frame-action-button.ts @@ -40,7 +40,19 @@ export interface FrameActionButton { * @type {FrameButtonActionType} * @memberof FrameActionButton */ - 'action_type'?: FrameButtonActionType; + 'action_type': FrameButtonActionType; + /** + * Target of the button + * @type {string} + * @memberof FrameActionButton + */ + 'target'?: string; + /** + * Used specifically for the tx action type to post a successful transaction hash + * @type {string} + * @memberof FrameActionButton + */ + 'post_url'?: string; } diff --git a/src/neynar-api/v2/openapi-farcaster/models/frame-action.ts b/src/neynar-api/v2/openapi-farcaster/models/frame-action.ts index 1b74daa4..17748def 100644 --- a/src/neynar-api/v2/openapi-farcaster/models/frame-action.ts +++ b/src/neynar-api/v2/openapi-farcaster/models/frame-action.ts @@ -22,6 +22,9 @@ import { FrameInput } from './frame-input'; // May contain unused imports in some cases // @ts-ignore import { FrameState } from './frame-state'; +// May contain unused imports in some cases +// @ts-ignore +import { FrameTransaction } from './frame-transaction'; /** * @@ -65,6 +68,12 @@ export interface FrameAction { * @memberof FrameAction */ 'state'?: FrameState; + /** + * + * @type {FrameTransaction} + * @memberof FrameAction + */ + 'transaction'?: FrameTransaction; /** * URL of the frames * @type {string} diff --git a/src/neynar-api/v2/openapi-farcaster/models/frame-button-action-type.ts b/src/neynar-api/v2/openapi-farcaster/models/frame-button-action-type.ts index 02438d6b..1b701c80 100644 --- a/src/neynar-api/v2/openapi-farcaster/models/frame-button-action-type.ts +++ b/src/neynar-api/v2/openapi-farcaster/models/frame-button-action-type.ts @@ -22,7 +22,8 @@ export const FrameButtonActionType = { Post: 'post', - PostRedirect: 'post_redirect' + PostRedirect: 'post_redirect', + Tx: 'tx' } as const; export type FrameButtonActionType = typeof FrameButtonActionType[keyof typeof FrameButtonActionType]; diff --git a/src/neynar-api/v2/openapi-farcaster/models/frame-state.ts b/src/neynar-api/v2/openapi-farcaster/models/frame-state.ts index c56e0188..107366c1 100644 --- a/src/neynar-api/v2/openapi-farcaster/models/frame-state.ts +++ b/src/neynar-api/v2/openapi-farcaster/models/frame-state.ts @@ -25,6 +25,6 @@ export interface FrameState { * @type {string} * @memberof FrameState */ - 'serialized'?: string; + 'serialized': string; } diff --git a/src/neynar-api/v2/openapi-farcaster/models/frame-transaction.ts b/src/neynar-api/v2/openapi-farcaster/models/frame-transaction.ts new file mode 100644 index 00000000..4be2f205 --- /dev/null +++ b/src/neynar-api/v2/openapi-farcaster/models/frame-transaction.ts @@ -0,0 +1,30 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Farcaster API V2 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface FrameTransaction + */ +export interface FrameTransaction { + /** + * Transaction hash + * @type {string} + * @memberof FrameTransaction + */ + 'hash': string; +} + diff --git a/src/neynar-api/v2/openapi-farcaster/models/index.ts b/src/neynar-api/v2/openapi-farcaster/models/index.ts index aecfeb10..a786eaf0 100644 --- a/src/neynar-api/v2/openapi-farcaster/models/index.ts +++ b/src/neynar-api/v2/openapi-farcaster/models/index.ts @@ -24,6 +24,7 @@ export * from './dehydrated-follower'; export * from './delete-cast-req-body'; export * from './delete-frame-response'; export * from './delete-neynar-frame-request'; +export * from './developer-managed-signer'; export * from './embed-cast-id'; export * from './embed-url'; export * from './embedded-cast'; @@ -43,6 +44,7 @@ export * from './frame-action-response'; export * from './frame-button-action-type'; export * from './frame-input'; export * from './frame-state'; +export * from './frame-transaction'; export * from './get-casts-req-body'; export * from './hydrated-follower'; export * from './individual-hash-obj'; @@ -76,6 +78,7 @@ export * from './reaction-with-cast-info'; export * from './reaction-with-user-info'; export * from './reactions-response'; export * from './reactions-type'; +export * from './register-developer-managed-signed-key-req-body'; export * from './register-signer-key-req-body'; export * from './register-user-req-body'; export * from './register-user-response'; @@ -103,3 +106,17 @@ export * from './users-response'; export * from './validate-frame-action-response'; export * from './validate-frame-request'; export * from './validated-frame-action'; +export * from './validated-frame-action-signer'; +export * from './webhook'; +export * from './webhook-delete-req-body'; +export * from './webhook-list-response'; +export * from './webhook-patch-req-body'; +export * from './webhook-post-req-body'; +export * from './webhook-put-req-body'; +export * from './webhook-put-req-body-all-of'; +export * from './webhook-response'; +export * from './webhook-secret'; +export * from './webhook-subscription'; +export * from './webhook-subscription-filters'; +export * from './webhook-subscription-filters-cast-created'; +export * from './webhook-subscription-filters-user-updated'; diff --git a/src/neynar-api/v2/openapi-farcaster/models/register-developer-managed-signed-key-req-body.ts b/src/neynar-api/v2/openapi-farcaster/models/register-developer-managed-signed-key-req-body.ts new file mode 100644 index 00000000..04a08fa0 --- /dev/null +++ b/src/neynar-api/v2/openapi-farcaster/models/register-developer-managed-signed-key-req-body.ts @@ -0,0 +1,48 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Farcaster API V2 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface RegisterDeveloperManagedSignedKeyReqBody + */ +export interface RegisterDeveloperManagedSignedKeyReqBody { + /** + * Ed25519 public key + * @type {string} + * @memberof RegisterDeveloperManagedSignedKeyReqBody + */ + 'public_key': string; + /** + * Signature generated by the custody address of the app. Signed data includes app_fid, deadline, signer’s public key + * @type {string} + * @memberof RegisterDeveloperManagedSignedKeyReqBody + */ + 'signature': string; + /** + * User identifier (unsigned integer) + * @type {number} + * @memberof RegisterDeveloperManagedSignedKeyReqBody + */ + 'app_fid': number; + /** + * unix timestamp in seconds that controls how long the signed key request is valid for. (24 hours from now is recommended) + * @type {number} + * @memberof RegisterDeveloperManagedSignedKeyReqBody + */ + 'deadline': number; +} + diff --git a/src/neynar-api/v2/openapi-farcaster/models/register-signer-key-req-body.ts b/src/neynar-api/v2/openapi-farcaster/models/register-signer-key-req-body.ts index f32db0b1..cbac6276 100644 --- a/src/neynar-api/v2/openapi-farcaster/models/register-signer-key-req-body.ts +++ b/src/neynar-api/v2/openapi-farcaster/models/register-signer-key-req-body.ts @@ -33,7 +33,7 @@ export interface RegisterSignerKeyReqBody { */ 'signature': string; /** - * Application FID + * User identifier (unsigned integer) * @type {number} * @memberof RegisterSignerKeyReqBody */ diff --git a/src/neynar-api/v2/openapi-farcaster/models/signer.ts b/src/neynar-api/v2/openapi-farcaster/models/signer.ts index 7d09fcd6..d26447fc 100644 --- a/src/neynar-api/v2/openapi-farcaster/models/signer.ts +++ b/src/neynar-api/v2/openapi-farcaster/models/signer.ts @@ -27,7 +27,7 @@ export interface Signer { */ 'signer_uuid': string; /** - * + * Ed25519 public key * @type {string} * @memberof Signer */ diff --git a/src/neynar-api/v2/openapi-farcaster/models/validate-frame-action-response.ts b/src/neynar-api/v2/openapi-farcaster/models/validate-frame-action-response.ts index 3ace4196..5c7f7001 100644 --- a/src/neynar-api/v2/openapi-farcaster/models/validate-frame-action-response.ts +++ b/src/neynar-api/v2/openapi-farcaster/models/validate-frame-action-response.ts @@ -13,15 +13,6 @@ */ -// May contain unused imports in some cases -// @ts-ignore -import { CastWithInteractions } from './cast-with-interactions'; -// May contain unused imports in some cases -// @ts-ignore -import { FrameActionButton } from './frame-action-button'; -// May contain unused imports in some cases -// @ts-ignore -import { User } from './user'; // May contain unused imports in some cases // @ts-ignore import { ValidatedFrameAction } from './validated-frame-action'; @@ -43,24 +34,6 @@ export interface ValidateFrameActionResponse { * @type {ValidatedFrameAction} * @memberof ValidateFrameActionResponse */ - 'action'?: ValidatedFrameAction; - /** - * - * @type {User} - * @memberof ValidateFrameActionResponse - */ - 'interactor'?: User; - /** - * - * @type {FrameActionButton} - * @memberof ValidateFrameActionResponse - */ - 'button'?: FrameActionButton; - /** - * - * @type {CastWithInteractions} - * @memberof ValidateFrameActionResponse - */ - 'cast'?: CastWithInteractions; + 'action': ValidatedFrameAction; } diff --git a/src/neynar-api/v2/openapi-farcaster/models/validate-frame-request.ts b/src/neynar-api/v2/openapi-farcaster/models/validate-frame-request.ts index afa75917..30911867 100644 --- a/src/neynar-api/v2/openapi-farcaster/models/validate-frame-request.ts +++ b/src/neynar-api/v2/openapi-farcaster/models/validate-frame-request.ts @@ -38,5 +38,11 @@ export interface ValidateFrameRequest { * @memberof ValidateFrameRequest */ 'follow_context'?: boolean; + /** + * Adds context about the app used by the user inside `frame.action`. + * @type {boolean} + * @memberof ValidateFrameRequest + */ + 'signer_context'?: boolean; } diff --git a/src/neynar-api/v2/openapi-farcaster/models/validated-frame-action-signer.ts b/src/neynar-api/v2/openapi-farcaster/models/validated-frame-action-signer.ts new file mode 100644 index 00000000..81a7b348 --- /dev/null +++ b/src/neynar-api/v2/openapi-farcaster/models/validated-frame-action-signer.ts @@ -0,0 +1,33 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Farcaster API V2 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +// May contain unused imports in some cases +// @ts-ignore +import { User } from './user'; + +/** + * + * @export + * @interface ValidatedFrameActionSigner + */ +export interface ValidatedFrameActionSigner { + /** + * + * @type {User} + * @memberof ValidatedFrameActionSigner + */ + 'client'?: User; +} + diff --git a/src/neynar-api/v2/openapi-farcaster/models/validated-frame-action.ts b/src/neynar-api/v2/openapi-farcaster/models/validated-frame-action.ts index 20a630ad..c0bec316 100644 --- a/src/neynar-api/v2/openapi-farcaster/models/validated-frame-action.ts +++ b/src/neynar-api/v2/openapi-farcaster/models/validated-frame-action.ts @@ -27,7 +27,13 @@ import { FrameInput } from './frame-input'; import { FrameState } from './frame-state'; // May contain unused imports in some cases // @ts-ignore +import { FrameTransaction } from './frame-transaction'; +// May contain unused imports in some cases +// @ts-ignore import { User } from './user'; +// May contain unused imports in some cases +// @ts-ignore +import { ValidatedFrameActionSigner } from './validated-frame-action-signer'; /** * @@ -77,6 +83,18 @@ export interface ValidatedFrameAction { * @memberof ValidatedFrameAction */ 'timestamp': string; + /** + * + * @type {ValidatedFrameActionSigner} + * @memberof ValidatedFrameAction + */ + 'signer'?: ValidatedFrameActionSigner; + /** + * + * @type {FrameTransaction} + * @memberof ValidatedFrameAction + */ + 'transaction'?: FrameTransaction; } export const ValidatedFrameActionObjectEnum = { diff --git a/src/neynar-api/v2/openapi-farcaster/models/webhook-delete-req-body.ts b/src/neynar-api/v2/openapi-farcaster/models/webhook-delete-req-body.ts new file mode 100644 index 00000000..2ec9e3bf --- /dev/null +++ b/src/neynar-api/v2/openapi-farcaster/models/webhook-delete-req-body.ts @@ -0,0 +1,30 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Farcaster API V2 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface WebhookDeleteReqBody + */ +export interface WebhookDeleteReqBody { + /** + * + * @type {string} + * @memberof WebhookDeleteReqBody + */ + 'webhook_id': string; +} + diff --git a/src/neynar-api/v2/openapi-farcaster/models/webhook-list-response.ts b/src/neynar-api/v2/openapi-farcaster/models/webhook-list-response.ts new file mode 100644 index 00000000..31b58ebc --- /dev/null +++ b/src/neynar-api/v2/openapi-farcaster/models/webhook-list-response.ts @@ -0,0 +1,33 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Farcaster API V2 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +// May contain unused imports in some cases +// @ts-ignore +import { Webhook } from './webhook'; + +/** + * + * @export + * @interface WebhookListResponse + */ +export interface WebhookListResponse { + /** + * + * @type {Array} + * @memberof WebhookListResponse + */ + 'webhooks': Array; +} + diff --git a/src/neynar-api/v2/openapi-farcaster/models/webhook-patch-req-body.ts b/src/neynar-api/v2/openapi-farcaster/models/webhook-patch-req-body.ts new file mode 100644 index 00000000..abbdd491 --- /dev/null +++ b/src/neynar-api/v2/openapi-farcaster/models/webhook-patch-req-body.ts @@ -0,0 +1,44 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Farcaster API V2 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface WebhookPatchReqBody + */ +export interface WebhookPatchReqBody { + /** + * + * @type {string} + * @memberof WebhookPatchReqBody + */ + 'webhook_id': string; + /** + * + * @type {string} + * @memberof WebhookPatchReqBody + */ + 'active': WebhookPatchReqBodyActiveEnum; +} + +export const WebhookPatchReqBodyActiveEnum = { + True: 'true', + False: 'false' +} as const; + +export type WebhookPatchReqBodyActiveEnum = typeof WebhookPatchReqBodyActiveEnum[keyof typeof WebhookPatchReqBodyActiveEnum]; + + diff --git a/src/neynar-api/v2/openapi-farcaster/models/webhook-post-req-body.ts b/src/neynar-api/v2/openapi-farcaster/models/webhook-post-req-body.ts new file mode 100644 index 00000000..273d8548 --- /dev/null +++ b/src/neynar-api/v2/openapi-farcaster/models/webhook-post-req-body.ts @@ -0,0 +1,45 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Farcaster API V2 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +// May contain unused imports in some cases +// @ts-ignore +import { WebhookSubscriptionFilters } from './webhook-subscription-filters'; + +/** + * + * @export + * @interface WebhookPostReqBody + */ +export interface WebhookPostReqBody { + /** + * + * @type {string} + * @memberof WebhookPostReqBody + */ + 'name': string; + /** + * + * @type {string} + * @memberof WebhookPostReqBody + */ + 'url': string; + /** + * + * @type {WebhookSubscriptionFilters} + * @memberof WebhookPostReqBody + */ + 'subscription'?: WebhookSubscriptionFilters; +} + diff --git a/src/neynar-api/v2/openapi-farcaster/models/webhook-put-req-body-all-of.ts b/src/neynar-api/v2/openapi-farcaster/models/webhook-put-req-body-all-of.ts new file mode 100644 index 00000000..e13141df --- /dev/null +++ b/src/neynar-api/v2/openapi-farcaster/models/webhook-put-req-body-all-of.ts @@ -0,0 +1,30 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Farcaster API V2 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface WebhookPutReqBodyAllOf + */ +export interface WebhookPutReqBodyAllOf { + /** + * + * @type {string} + * @memberof WebhookPutReqBodyAllOf + */ + 'webhook_id': string; +} + diff --git a/src/neynar-api/v2/openapi-farcaster/models/webhook-put-req-body.ts b/src/neynar-api/v2/openapi-farcaster/models/webhook-put-req-body.ts new file mode 100644 index 00000000..aaac684f --- /dev/null +++ b/src/neynar-api/v2/openapi-farcaster/models/webhook-put-req-body.ts @@ -0,0 +1,32 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Farcaster API V2 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +// May contain unused imports in some cases +// @ts-ignore +import { WebhookPostReqBody } from './webhook-post-req-body'; +// May contain unused imports in some cases +// @ts-ignore +import { WebhookPutReqBodyAllOf } from './webhook-put-req-body-all-of'; +// May contain unused imports in some cases +// @ts-ignore +import { WebhookSubscriptionFilters } from './webhook-subscription-filters'; + +/** + * @type WebhookPutReqBody + * @export + */ +export type WebhookPutReqBody = WebhookPostReqBody & WebhookPutReqBodyAllOf; + + diff --git a/src/neynar-api/v2/openapi-farcaster/models/webhook-response.ts b/src/neynar-api/v2/openapi-farcaster/models/webhook-response.ts new file mode 100644 index 00000000..00435b70 --- /dev/null +++ b/src/neynar-api/v2/openapi-farcaster/models/webhook-response.ts @@ -0,0 +1,45 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Farcaster API V2 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +// May contain unused imports in some cases +// @ts-ignore +import { Webhook } from './webhook'; + +/** + * + * @export + * @interface WebhookResponse + */ +export interface WebhookResponse { + /** + * + * @type {string} + * @memberof WebhookResponse + */ + 'message'?: string; + /** + * + * @type {boolean} + * @memberof WebhookResponse + */ + 'success'?: boolean; + /** + * + * @type {Webhook} + * @memberof WebhookResponse + */ + 'webhook'?: Webhook; +} + diff --git a/src/neynar-api/v2/openapi-farcaster/models/webhook-secret.ts b/src/neynar-api/v2/openapi-farcaster/models/webhook-secret.ts new file mode 100644 index 00000000..2eccd1cf --- /dev/null +++ b/src/neynar-api/v2/openapi-farcaster/models/webhook-secret.ts @@ -0,0 +1,60 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Farcaster API V2 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface WebhookSecret + */ +export interface WebhookSecret { + /** + * + * @type {string} + * @memberof WebhookSecret + */ + 'uid': string; + /** + * + * @type {string} + * @memberof WebhookSecret + */ + 'value': string; + /** + * + * @type {string} + * @memberof WebhookSecret + */ + 'expires_at': string; + /** + * + * @type {string} + * @memberof WebhookSecret + */ + 'created_at': string; + /** + * + * @type {string} + * @memberof WebhookSecret + */ + 'updated_at': string; + /** + * + * @type {string} + * @memberof WebhookSecret + */ + 'deleted_at': string; +} + diff --git a/src/neynar-api/v2/openapi-farcaster/models/webhook-subscription-filters-cast-created.ts b/src/neynar-api/v2/openapi-farcaster/models/webhook-subscription-filters-cast-created.ts new file mode 100644 index 00000000..46269903 --- /dev/null +++ b/src/neynar-api/v2/openapi-farcaster/models/webhook-subscription-filters-cast-created.ts @@ -0,0 +1,48 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Farcaster API V2 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface WebhookSubscriptionFiltersCastCreated + */ +export interface WebhookSubscriptionFiltersCastCreated { + /** + * + * @type {Array} + * @memberof WebhookSubscriptionFiltersCastCreated + */ + 'author_fids'?: Array; + /** + * + * @type {Array} + * @memberof WebhookSubscriptionFiltersCastCreated + */ + 'mentioned_fids'?: Array; + /** + * + * @type {Array} + * @memberof WebhookSubscriptionFiltersCastCreated + */ + 'parent_urls'?: Array; + /** + * + * @type {Array} + * @memberof WebhookSubscriptionFiltersCastCreated + */ + 'root_parent_urls'?: Array; +} + diff --git a/src/neynar-api/v2/openapi-farcaster/models/webhook-subscription-filters-user-updated.ts b/src/neynar-api/v2/openapi-farcaster/models/webhook-subscription-filters-user-updated.ts new file mode 100644 index 00000000..46d20cd3 --- /dev/null +++ b/src/neynar-api/v2/openapi-farcaster/models/webhook-subscription-filters-user-updated.ts @@ -0,0 +1,30 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Farcaster API V2 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface WebhookSubscriptionFiltersUserUpdated + */ +export interface WebhookSubscriptionFiltersUserUpdated { + /** + * + * @type {Array} + * @memberof WebhookSubscriptionFiltersUserUpdated + */ + 'fids'?: Array; +} + diff --git a/src/neynar-api/v2/openapi-farcaster/models/webhook-subscription-filters.ts b/src/neynar-api/v2/openapi-farcaster/models/webhook-subscription-filters.ts new file mode 100644 index 00000000..25e7b20e --- /dev/null +++ b/src/neynar-api/v2/openapi-farcaster/models/webhook-subscription-filters.ts @@ -0,0 +1,48 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Farcaster API V2 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +// May contain unused imports in some cases +// @ts-ignore +import { WebhookSubscriptionFiltersCastCreated } from './webhook-subscription-filters-cast-created'; +// May contain unused imports in some cases +// @ts-ignore +import { WebhookSubscriptionFiltersUserUpdated } from './webhook-subscription-filters-user-updated'; + +/** + * + * @export + * @interface WebhookSubscriptionFilters + */ +export interface WebhookSubscriptionFilters { + /** + * + * @type {WebhookSubscriptionFiltersCastCreated} + * @memberof WebhookSubscriptionFilters + */ + 'cast.created'?: WebhookSubscriptionFiltersCastCreated; + /** + * + * @type {object} + * @memberof WebhookSubscriptionFilters + */ + 'user.created'?: object; + /** + * + * @type {WebhookSubscriptionFiltersUserUpdated} + * @memberof WebhookSubscriptionFilters + */ + 'user.updated'?: WebhookSubscriptionFiltersUserUpdated; +} + diff --git a/src/neynar-api/v2/openapi-farcaster/models/webhook-subscription.ts b/src/neynar-api/v2/openapi-farcaster/models/webhook-subscription.ts new file mode 100644 index 00000000..6cff7b60 --- /dev/null +++ b/src/neynar-api/v2/openapi-farcaster/models/webhook-subscription.ts @@ -0,0 +1,64 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Farcaster API V2 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +// May contain unused imports in some cases +// @ts-ignore +import { WebhookSubscriptionFilters } from './webhook-subscription-filters'; + +/** + * + * @export + * @interface WebhookSubscription + */ +export interface WebhookSubscription { + /** + * + * @type {string} + * @memberof WebhookSubscription + */ + 'object': WebhookSubscriptionObjectEnum; + /** + * + * @type {string} + * @memberof WebhookSubscription + */ + 'subscription_id': string; + /** + * + * @type {WebhookSubscriptionFilters} + * @memberof WebhookSubscription + */ + 'filters': WebhookSubscriptionFilters; + /** + * + * @type {string} + * @memberof WebhookSubscription + */ + 'created_at': string; + /** + * + * @type {string} + * @memberof WebhookSubscription + */ + 'updated_at': string; +} + +export const WebhookSubscriptionObjectEnum = { + WebhookSubscription: 'webhook_subscription' +} as const; + +export type WebhookSubscriptionObjectEnum = typeof WebhookSubscriptionObjectEnum[keyof typeof WebhookSubscriptionObjectEnum]; + + diff --git a/src/neynar-api/v2/openapi-farcaster/models/webhook.ts b/src/neynar-api/v2/openapi-farcaster/models/webhook.ts new file mode 100644 index 00000000..fab19e8d --- /dev/null +++ b/src/neynar-api/v2/openapi-farcaster/models/webhook.ts @@ -0,0 +1,127 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Farcaster API V2 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +// May contain unused imports in some cases +// @ts-ignore +import { WebhookSecret } from './webhook-secret'; +// May contain unused imports in some cases +// @ts-ignore +import { WebhookSubscription } from './webhook-subscription'; + +/** + * + * @export + * @interface Webhook + */ +export interface Webhook { + /** + * + * @type {string} + * @memberof Webhook + */ + 'object': WebhookObjectEnum; + /** + * + * @type {string} + * @memberof Webhook + */ + 'webhook_id': string; + /** + * + * @type {string} + * @memberof Webhook + */ + 'developer_uuid': string; + /** + * + * @type {string} + * @memberof Webhook + */ + 'target_url': string; + /** + * + * @type {string} + * @memberof Webhook + */ + 'title': string; + /** + * + * @type {Array} + * @memberof Webhook + */ + 'secrets': Array; + /** + * + * @type {string} + * @memberof Webhook + */ + 'description': string; + /** + * + * @type {string} + * @memberof Webhook + */ + 'http_timeout': string; + /** + * + * @type {number} + * @memberof Webhook + */ + 'rate_limit': number; + /** + * + * @type {boolean} + * @memberof Webhook + */ + 'active': boolean; + /** + * + * @type {string} + * @memberof Webhook + */ + 'rate_limit_duration': string; + /** + * + * @type {string} + * @memberof Webhook + */ + 'created_at': string; + /** + * + * @type {string} + * @memberof Webhook + */ + 'updated_at': string; + /** + * + * @type {string} + * @memberof Webhook + */ + 'deleted_at': string; + /** + * + * @type {WebhookSubscription} + * @memberof Webhook + */ + 'subscription'?: WebhookSubscription; +} + +export const WebhookObjectEnum = { + Webhook: 'webhook' +} as const; + +export type WebhookObjectEnum = typeof WebhookObjectEnum[keyof typeof WebhookObjectEnum]; + + diff --git a/src/oas b/src/oas index 83be0d83..aaabaeb1 160000 --- a/src/oas +++ b/src/oas @@ -1 +1 @@ -Subproject commit 83be0d83e75ae591ffd418445207bed1aaefe70e +Subproject commit aaabaeb16641d8064a7bb43e40f457ec110347f5