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:
@ -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,
|
||||
);
|
||||
}
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
export interface Gate {
|
||||
featureFlag: string;
|
||||
excludeFromDatabase?: boolean;
|
||||
excludeFromGraphQL?: boolean;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user