refactor: apply biome formatting to packages/features (#27844)
* refactor: apply biome formatting to packages/features (batch 1 - small subdirs) Format small subdirectories in packages/features: di, flags, holidays, oauth, settings, users, assignment-reason, selectedCalendar, hashedLink, host, form, form-builder, availability, data-table, pbac, schedules, troubleshooter, eventtypes, calendar-subscription, and root-level files. Also includes straggler apps/web BookEventForm.tsx. Co-Authored-By: Claude Opus 4.6 <[email protected]> * refactor: apply biome formatting to packages/features (batch 2 - medium subdirs) Format medium subdirectories in packages/features: auth, credentials, calendars, routing-forms, routing-trace, attributes, watchlist, calAIPhone, tasker, and webhooks. Co-Authored-By: Claude Opus 4.6 <[email protected]> * refactor: apply biome formatting to packages/features (batch 3 - bookings + insights) Format bookings and insights subdirectories in packages/features. Co-Authored-By: Claude Opus 4.6 <[email protected]> * refactor: apply biome formatting to packages/features (batch 4 - ee) Format packages/features/ee subdirectory covering billing, workflows, organizations, teams, managed-event-types, round-robin, dsync, integration-attribute-sync, and payments. Co-Authored-By: Claude Opus 4.6 <[email protected]> * refactor: apply biome formatting to packages/features (batch 5 - booking-audit part 1) Format booking-audit di, actions, common, dto, repository, and types subdirectories in packages/features/booking-audit. Co-Authored-By: Claude Opus 4.6 <[email protected]> * refactor: apply biome formatting to packages/features (batch 6 - booking-audit part 2) Format booking-audit service subdirectory in packages/features/booking-audit. Co-Authored-By: Claude Opus 4.6 <[email protected]> --------- Co-authored-by: Claude Opus 4.6 <[email protected]>
This commit is contained in:
1 parent
bc8ebb9213
commit
98b6d63164
310 files changed
+4309
-4585
No files matched your search
@@ -1,4 +1,4 @@
|
||||
export const ROUTING_FORM_DI_TOKENS = {
|
||||
ROUTING_FORM_RESPONSE_REPOSITORY: Symbol("RoutingFormResponseRepository"),
|
||||
ROUTING_FORM_RESPONSE_REPOSITORY_MODULE: Symbol("RoutingFormResponseRepositoryModule"),
|
||||
ROUTING_FORM_RESPONSE_REPOSITORY: Symbol("RoutingFormResponseRepository"),
|
||||
ROUTING_FORM_RESPONSE_REPOSITORY_MODULE: Symbol("RoutingFormResponseRepositoryModule"),
|
||||
};
|
||||
@@ -18,4 +18,3 @@ export function findFieldValueByIdentifier(
|
||||
|
||||
return { success: true, data: fieldValue ?? null };
|
||||
}
|
||||
|
||||
@@ -479,7 +479,12 @@ export async function findTeamMembersMatchingAttributeLogic(
|
||||
} = {}
|
||||
) {
|
||||
// Higher value of concurrency might not be performant as it might overwhelm the system. So, use a lower value as default.
|
||||
const { enablePerf = false, concurrency = 2, enableTroubleshooter = false, routingFormTraceService } = options;
|
||||
const {
|
||||
enablePerf = false,
|
||||
concurrency = 2,
|
||||
enableTroubleshooter = false,
|
||||
routingFormTraceService,
|
||||
} = options;
|
||||
|
||||
// Any explicit value being passed should cause fallback to be considered. Even undefined
|
||||
const considerFallback = "fallbackAttributesQueryValue" in data;
|
||||
|
||||
@@ -3,4 +3,3 @@ import type { Field } from "./types";
|
||||
const getFieldIdentifier = (field: Field) => field.identifier || field.label;
|
||||
|
||||
export default getFieldIdentifier;
|
||||
|
||||
@@ -2,15 +2,15 @@ import { parseRoutingFormResponse } from "./parseRoutingFormResponse";
|
||||
import { findFieldValueByIdentifier } from "./findFieldValueByIdentifier";
|
||||
|
||||
export const getFieldResponseByIdentifier = ({
|
||||
responsePayload,
|
||||
formFields,
|
||||
identifier,
|
||||
responsePayload,
|
||||
formFields,
|
||||
identifier,
|
||||
}: {
|
||||
responsePayload: unknown;
|
||||
formFields: unknown;
|
||||
identifier: string;
|
||||
responsePayload: unknown;
|
||||
formFields: unknown;
|
||||
identifier: string;
|
||||
}) => {
|
||||
const parsedResponse = parseRoutingFormResponse(responsePayload, formFields);
|
||||
const emailFieldResult = findFieldValueByIdentifier(parsedResponse, identifier);
|
||||
return emailFieldResult;
|
||||
};
|
||||
const parsedResponse = parseRoutingFormResponse(responsePayload, formFields);
|
||||
const emailFieldResult = findFieldValueByIdentifier(parsedResponse, identifier);
|
||||
return emailFieldResult;
|
||||
};
|
||||
@@ -2,8 +2,7 @@ import { zodNonRouterField, routingFormResponseInDbSchema } from "./zod";
|
||||
import type { RoutingFormResponseData } from "./types";
|
||||
|
||||
export function parseRoutingFormResponse(rawResponse: unknown, formFields: unknown): RoutingFormResponseData {
|
||||
const response = routingFormResponseInDbSchema.parse(rawResponse);
|
||||
const fields = zodNonRouterField.array().parse(formFields);
|
||||
return { response, fields };
|
||||
const response = routingFormResponseInDbSchema.parse(rawResponse);
|
||||
const fields = zodNonRouterField.array().parse(formFields);
|
||||
return { response, fields };
|
||||
}
|
||||
|
||||
@@ -19,4 +19,3 @@ export type RoutingFormResponseData = {
|
||||
fields: z.infer<typeof zodNonRouterField>[];
|
||||
response: z.infer<typeof routingFormResponseInDbSchema>;
|
||||
};
|
||||
|
||||
@@ -1,56 +1,55 @@
|
||||
import { z } from "zod";
|
||||
|
||||
export type FieldOption = {
|
||||
label: string;
|
||||
id: string | null;
|
||||
label: string;
|
||||
id: string | null;
|
||||
};
|
||||
|
||||
export type TNonRouterField = {
|
||||
id: string;
|
||||
label: string;
|
||||
identifier?: string;
|
||||
placeholder?: string;
|
||||
type: string;
|
||||
/** @deprecated in favour of `options` */
|
||||
selectText?: string;
|
||||
required?: boolean;
|
||||
deleted?: boolean;
|
||||
options?: FieldOption[];
|
||||
id: string;
|
||||
label: string;
|
||||
identifier?: string;
|
||||
placeholder?: string;
|
||||
type: string;
|
||||
/** @deprecated in favour of `options` */
|
||||
selectText?: string;
|
||||
required?: boolean;
|
||||
deleted?: boolean;
|
||||
options?: FieldOption[];
|
||||
};
|
||||
|
||||
// Note: zodNonRouterField is NOT annotated with z.ZodType because it uses .extend() below
|
||||
// which requires the full ZodObject type to be preserved
|
||||
export const zodNonRouterField = z.object({
|
||||
id: z.string(),
|
||||
label: z.string(),
|
||||
identifier: z.string().optional(),
|
||||
placeholder: z.string().optional(),
|
||||
type: z.string(),
|
||||
/**
|
||||
* @deprecated in favour of `options`
|
||||
*/
|
||||
selectText: z.string().optional(),
|
||||
required: z.boolean().optional(),
|
||||
deleted: z.boolean().optional(),
|
||||
options: z
|
||||
.array(
|
||||
z.object({
|
||||
label: z.string(),
|
||||
// To keep backwards compatibility with the options generated from legacy selectText, we allow saving null as id
|
||||
// It helps in differentiating whether the routing logic should consider the option.label as value or option.id as value.
|
||||
// This is important for legacy routes which has option.label saved in conditions and it must keep matching with the value of the option
|
||||
id: z.string().or(z.null()),
|
||||
})
|
||||
)
|
||||
.optional(),
|
||||
id: z.string(),
|
||||
label: z.string(),
|
||||
identifier: z.string().optional(),
|
||||
placeholder: z.string().optional(),
|
||||
type: z.string(),
|
||||
/**
|
||||
* @deprecated in favour of `options`
|
||||
*/
|
||||
selectText: z.string().optional(),
|
||||
required: z.boolean().optional(),
|
||||
deleted: z.boolean().optional(),
|
||||
options: z
|
||||
.array(
|
||||
z.object({
|
||||
label: z.string(),
|
||||
// To keep backwards compatibility with the options generated from legacy selectText, we allow saving null as id
|
||||
// It helps in differentiating whether the routing logic should consider the option.label as value or option.id as value.
|
||||
// This is important for legacy routes which has option.label saved in conditions and it must keep matching with the value of the option
|
||||
id: z.string().or(z.null()),
|
||||
})
|
||||
)
|
||||
.optional(),
|
||||
});
|
||||
|
||||
// This is different from FormResponse in types.d.ts in that it has label optional. We don't seem to be using label at this point, so we might want to use this only while saving the response when Routing Form is submitted
|
||||
// Record key is formFieldId
|
||||
export const routingFormResponseInDbSchema = z.record(
|
||||
z.object({
|
||||
label: z.string().optional(),
|
||||
value: z.union([z.string(), z.number(), z.array(z.string())]),
|
||||
})
|
||||
z.object({
|
||||
label: z.string().optional(),
|
||||
value: z.union([z.string(), z.number(), z.array(z.string())]),
|
||||
})
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user