Api keys and webhook migration to core (#13011)

TODO: check Zapier trigger records work as expected

---------

Co-authored-by: Weiko <corentin@twenty.com>
This commit is contained in:
nitin
2025-07-09 20:33:54 +05:30
committed by GitHub
parent 18792f9f74
commit 484c267aa6
113 changed files with 4563 additions and 1060 deletions

View File

@ -4,6 +4,8 @@ import { TypedReflect } from 'src/utils/typed-reflect';
export interface WorkspaceGateOptions {
featureFlag: string;
excludeFromDatabase?: boolean;
excludeFromGraphQL?: boolean;
}
export function WorkspaceGate(options: WorkspaceGateOptions) {
@ -16,19 +18,25 @@ export function WorkspaceGate(options: WorkspaceGateOptions) {
);
}
const gateOptions = {
featureFlag: options.featureFlag,
excludeFromDatabase: options.excludeFromDatabase ?? true,
excludeFromGraphQL: options.excludeFromGraphQL ?? true,
};
// eslint-disable-next-line @typescript-eslint/no-explicit-any
return (target: any, propertyKey?: string | symbol) => {
if (propertyKey !== undefined) {
TypedReflect.defineMetadata(
'workspace:gate-metadata-args',
options,
gateOptions,
target,
propertyKey.toString(),
);
} else {
TypedReflect.defineMetadata(
'workspace:gate-metadata-args',
options,
gateOptions,
target,
);
}

View File

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