fix: migrate webhook and API key REST endpoints to core schema (#13318)

## Problem
After migrating webhooks and API keys from workspace to core level, REST
API endpoints were still creating entities in workspace schema
(`workspace_*`) instead of core schema, causing webhooks to not fire.

## Solution
- Added dedicated REST controllers for webhooks (`/rest/webhooks`) and
API keys (`/rest/apiKeys`)
- Updated dynamic controller to block workspace-gated entities from
being processed
- Fixed OpenAPI documentation to exclude these endpoints from playground
- Ensured return formats match GraphQL resolvers exactly

## Testing
 All endpoints tested with provided auth token - webhooks and API keys
now correctly stored in `core` schema
This commit is contained in:
nitin
2025-07-23 18:41:53 +05:30
committed by GitHub
parent 05a09d7a73
commit 0e561e4ef4
17 changed files with 302 additions and 68 deletions

View File

@ -5,7 +5,7 @@ import { TypedReflect } from 'src/utils/typed-reflect';
export interface WorkspaceGateOptions {
featureFlag: string;
excludeFromDatabase?: boolean;
excludeFromGraphQL?: boolean;
excludeFromWorkspaceApi?: boolean;
}
export function WorkspaceGate(options: WorkspaceGateOptions) {
@ -21,7 +21,7 @@ export function WorkspaceGate(options: WorkspaceGateOptions) {
const gateOptions = {
featureFlag: options.featureFlag,
excludeFromDatabase: options.excludeFromDatabase ?? true,
excludeFromGraphQL: options.excludeFromGraphQL ?? true,
excludeFromWorkspaceApi: options.excludeFromWorkspaceApi ?? true,
};
// eslint-disable-next-line @typescript-eslint/no-explicit-any

View File

@ -1,5 +1,5 @@
export interface Gate {
featureFlag: string;
excludeFromDatabase?: boolean;
excludeFromGraphQL?: boolean;
excludeFromWorkspaceApi?: boolean;
}