-
Notifications
You must be signed in to change notification settings - Fork 9
chore(lint): restore green lint via scoped rules + meaningful JSDoc #435
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
e46c354
12a1bd7
9c83deb
c3e07d3
bc1dd9e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,6 +7,8 @@ import { disconnectConnectorHandler } from "@/lib/composio/connectors/disconnect | |
|
|
||
| /** | ||
| * OPTIONS handler for CORS preflight requests. | ||
| * | ||
| * @returns A 200 NextResponse carrying the CORS headers. | ||
| */ | ||
| export async function OPTIONS() { | ||
| return new NextResponse(null, { | ||
|
|
@@ -18,15 +20,15 @@ export async function OPTIONS() { | |
| /** | ||
| * GET /api/connectors | ||
| * | ||
| * List all available connectors and their connection status. | ||
| * | ||
| * Query params: | ||
| * - account_id (optional): Entity ID for entity-specific connections (e.g., artist ID) | ||
| * Lists every available Composio connector with its connection status for the caller. | ||
| * When `account_id` is supplied, the statuses are scoped to that account (e.g. an | ||
| * artist) instead of the authenticated caller. Requires `x-api-key` or | ||
| * `Authorization: Bearer`. | ||
| * | ||
| * Authentication: x-api-key OR Authorization Bearer token required. | ||
| * | ||
| * @param request | ||
| * @returns List of connectors with connection status | ||
| * @param request - The incoming request. Optional query parameter: `account_id` — an | ||
| * account UUID (e.g. artist) to scope the connection status lookup to. | ||
| * @returns A 200 NextResponse with `{ connectors: Array<{ slug, connected, ... }> }`, | ||
| * 401 when unauthenticated, or 403 when the caller cannot access `account_id`. | ||
| */ | ||
|
Comment on lines
+24
to
32
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove These docs formalize Suggested doc-level correction- * When `account_id` is supplied, the statuses are scoped to that account (e.g. an
- * artist) instead of the authenticated caller. Requires `x-api-key` or
+ * Statuses are scoped to the authenticated account context. Requires `x-api-key` or
* `Authorization: Bearer`.
...
- * `@param` request - The incoming request. Optional query parameter: `account_id` — an
- * account UUID (e.g. artist) to scope the connection status lookup to.
+ * `@param` request - The incoming request. No account selector is accepted; account scope
+ * is derived from authenticated context.
...
- * `account_id` (optional — the account to associate the connection with).
+ * account scope is derived from authenticated context.
...
- * unauthenticated, or 403 when the caller cannot access `account_id`.
+ * unauthenticated, or 403 when the caller is not allowed to perform the action.
...
- * — the Composio connected-account id to remove); `account_id` (optional — used to
- * verify ownership of the connected account).
+ * — the Composio connected-account id to remove).Also applies to: 44-50, 61-66 🤖 Prompt for AI Agents |
||
| export async function GET(request: NextRequest) { | ||
| return getConnectorsHandler(request); | ||
|
|
@@ -35,17 +37,16 @@ export async function GET(request: NextRequest) { | |
| /** | ||
| * POST /api/connectors | ||
| * | ||
| * Generate an OAuth authorization URL for a specific connector. | ||
| * | ||
| * Authentication: x-api-key OR Authorization Bearer token required. | ||
| * Generates a Composio OAuth authorization URL for a single connector. The caller | ||
| * completes OAuth in the browser and is redirected to `callback_url` (or a default). | ||
| * Requires `x-api-key` or `Authorization: Bearer`. | ||
| * | ||
| * Request body: | ||
| * - connector: The connector slug, e.g., "googlesheets" or "tiktok" (required) | ||
| * - callback_url: Optional custom callback URL after OAuth | ||
| * - account_id: Optional account ID for account-specific connections | ||
| * | ||
| * @param request | ||
| * @returns The redirect URL for OAuth authorization | ||
| * @param request - The incoming request. JSON body: `connector` (required slug, e.g. | ||
| * `"googlesheets"` or `"tiktok"`); `callback_url` (optional post-OAuth redirect); | ||
| * `account_id` (optional — the account to associate the connection with). | ||
| * @returns A 200 NextResponse with `{ redirectUrl }` pointing the caller at the | ||
| * provider's OAuth consent page, 400 on a missing/invalid `connector`, 401 when | ||
| * unauthenticated, or 403 when the caller cannot access `account_id`. | ||
| */ | ||
| export async function POST(request: NextRequest) { | ||
| return authorizeConnectorHandler(request); | ||
|
|
@@ -54,15 +55,15 @@ export async function POST(request: NextRequest) { | |
| /** | ||
| * DELETE /api/connectors | ||
| * | ||
| * Disconnect a connected account from Composio. | ||
| * | ||
| * Body: | ||
| * - connected_account_id (required): The connected account ID to disconnect | ||
| * - account_id (optional): Entity ID for ownership verification (e.g., artist ID) | ||
| * | ||
| * Authentication: x-api-key OR Authorization Bearer token required. | ||
| * Disconnects a previously-connected Composio account so it can no longer be used for | ||
| * tool calls. Requires `x-api-key` or `Authorization: Bearer`. | ||
| * | ||
| * @param request | ||
| * @param request - The incoming request. JSON body: `connected_account_id` (required | ||
| * — the Composio connected-account id to remove); `account_id` (optional — used to | ||
| * verify ownership of the connected account). | ||
| * @returns A 200 NextResponse on successful disconnect, 400 on a missing | ||
| * `connected_account_id`, 401 when unauthenticated, 403 when the caller does not | ||
| * own the connection, or 404 when the connected account does not exist. | ||
| */ | ||
| export async function DELETE(request: NextRequest) { | ||
| return disconnectConnectorHandler(request); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P1: Custom agent: Flag AI Slop and Fabricated Changes
The updated JSDoc documents
updatingas a 200 response status, but this endpoint never returns{"status":"updating"}. Remove it from the documented response outcomes to avoid publishing a fabricated API contract.Prompt for AI agents