* wip * WIP * restore event * testing without instrument client * Add conditional for botID init * Bump BotID version + pass in header * botID yarn lock changes * feat: Add feature flag checks + tidy up into service * rely on env var also * use eventType repo instead of passing in prisma * remove slug from audit * rename botId feature to botid * add unit tests for bot service
42 lines
1.1 KiB
TypeScript
42 lines
1.1 KiB
TypeScript
import type { AppFlags } from "@calcom/features/flags/config";
|
|
import { trpc } from "@calcom/trpc/react";
|
|
|
|
const initialData: AppFlags = {
|
|
organizations: false,
|
|
teams: false,
|
|
"calendar-cache": false,
|
|
"calendar-cache-serve": false,
|
|
emails: false,
|
|
insights: false,
|
|
webhooks: false,
|
|
workflows: false,
|
|
"email-verification": false,
|
|
"google-workspace-directory": false,
|
|
"disable-signup": false,
|
|
attributes: false,
|
|
"organizer-request-email-v2": false,
|
|
"delegation-credential": false,
|
|
"salesforce-crm-tasker": false,
|
|
"workflow-smtp-emails": false,
|
|
"cal-video-log-in-overlay": false,
|
|
"use-api-v2-for-team-slots": false,
|
|
pbac: false,
|
|
"restriction-schedule": false,
|
|
"team-booking-page-cache": false,
|
|
"cal-ai-voice-agents": false,
|
|
"tiered-support-chat": false,
|
|
"calendar-subscription-cache": false,
|
|
"calendar-subscription-sync": false,
|
|
"booker-botid": false,
|
|
};
|
|
|
|
if (process.env.NEXT_PUBLIC_IS_E2E) {
|
|
initialData.organizations = true;
|
|
initialData.teams = true;
|
|
}
|
|
|
|
export function useFlags(): Partial<AppFlags> {
|
|
const query = trpc.viewer.features.map.useQuery();
|
|
return query.data ?? initialData;
|
|
}
|