chore: update tslog from 3.2.1 to 4.9.2 (#11717)

Co-authored-by: zomars <[email protected]>
This commit is contained in:
Benny Jooandzomars authored and GitHub committed 2023-10-17 19:00:48 +00:00
1 parent 9e927af813
commit 63416d4f33
61 files changed
+441 -105

No files matched your search

+1 -1
View File
@@ -10,7 +10,7 @@ interface CalendarApp {
};
}
const log = logger.getChildLogger({ prefix: ["CalendarManager"] });
const log = logger.getSubLogger({ prefix: ["CalendarManager"] });
/**
* @see [Using type predicates](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates)
@@ -63,7 +63,7 @@ export default class BasecampCalendarService implements Calendar {
this.userAgent = user_agent as string;
});
this.auth = this.basecampAuth(credential).then((c) => c);
this.log = logger.getChildLogger({ prefix: [`[[lib] ${this.integrationName}`] });
this.log = logger.getSubLogger({ prefix: [`[[lib] ${this.integrationName}`] });
}
private basecampAuth = async (credential: CredentialPayload) => {
@@ -58,7 +58,7 @@ export default class CloseComCalendarService implements Calendar {
constructor(credential: CredentialPayload) {
this.integrationName = "closecom_other_calendar";
this.log = logger.getChildLogger({ prefix: [`[[lib] ${this.integrationName}`] });
this.log = logger.getSubLogger({ prefix: [`[[lib] ${this.integrationName}`] });
const parsedCredentialKey = apiKeySchema.safeParse(credential.key);
+1 -1
View File
@@ -2,7 +2,7 @@ import { vi } from "vitest";
vi.mock("@calcom/lib/logger", () => ({
default: {
getChildLogger: () => ({
getSubLogger: () => ({
debug: vi.fn(),
error: vi.fn(),
log: vi.fn(),
@@ -43,7 +43,7 @@ export default class ExchangeCalendarService implements Calendar {
constructor(credential: CredentialPayload) {
this.integrationName = "exchange2013_calendar";
this.log = logger.getChildLogger({ prefix: [`[[lib] ${this.integrationName}`] });
this.log = logger.getSubLogger({ prefix: [`[[lib] ${this.integrationName}`] });
const decryptedCredential = JSON.parse(
symmetricDecrypt(credential.key?.toString() || "", process.env.CALENDSO_ENCRYPTION_KEY || "")
@@ -44,7 +44,7 @@ export default class ExchangeCalendarService implements Calendar {
// this.integrationName = CALENDAR_INTEGRATIONS_TYPES.exchange;
this.integrationName = "exchange2016_calendar";
this.log = logger.getChildLogger({ prefix: [`[[lib] ${this.integrationName}`] });
this.log = logger.getSubLogger({ prefix: [`[[lib] ${this.integrationName}`] });
const decryptedCredential = JSON.parse(
symmetricDecrypt(credential.key?.toString() || "", process.env.CALENDSO_ENCRYPTION_KEY || "")
@@ -48,7 +48,7 @@ export default class ExchangeCalendarService implements Calendar {
constructor(credential: CredentialPayload) {
this.integrationName = "exchange_calendar";
this.log = logger.getChildLogger({ prefix: [`[[lib] ${this.integrationName}`] });
this.log = logger.getSubLogger({ prefix: [`[[lib] ${this.integrationName}`] });
this.payload = JSON.parse(
symmetricDecrypt(credential.key?.toString() || "", process.env.CALENDSO_ENCRYPTION_KEY || "")
);
@@ -68,7 +68,7 @@ export default class GoogleCalendarService implements Calendar {
this.integrationName = "google_calendar";
this.credential = credential;
this.auth = this.googleAuth(credential);
this.log = logger.getChildLogger({ prefix: [`[[lib] ${this.integrationName}`] });
this.log = logger.getSubLogger({ prefix: [`[[lib] ${this.integrationName}`] });
this.credential = credential;
}
@@ -45,7 +45,7 @@ export default class HubspotCalendarService implements Calendar {
this.auth = this.hubspotAuth(credential).then((r) => r);
this.log = logger.getChildLogger({ prefix: [`[[lib] ${this.integrationName}`] });
this.log = logger.getSubLogger({ prefix: [`[[lib] ${this.integrationName}`] });
}
private hubspotContactCreate = async (attendees: Person[]) => {
+1 -1
View File
@@ -9,7 +9,7 @@ import getAppKeysFromSlug from "../../_utils/getAppKeysFromSlug";
import getInstalledAppPath from "../../_utils/getInstalledAppPath";
import createOAuthAppCredential from "../../_utils/oauth/createOAuthAppCredential";
const log = logger.getChildLogger({ prefix: [`[[intercom/api/callback]`] });
const log = logger.getSubLogger({ prefix: [`[[intercom/api/callback]`] });
let client_id = "";
let client_secret = "";
@@ -12,7 +12,7 @@ import { LARK_HOST } from "../common";
import { getAppAccessToken } from "../lib/AppAccessToken";
import type { LarkAuthCredentials } from "../types/LarkCalendar";
const log = logger.getChildLogger({ prefix: [`[[lark/api/callback]`] });
const log = logger.getSubLogger({ prefix: [`[[lark/api/callback]`] });
const callbackQuerySchema = z.object({
code: z.string().min(1),
@@ -8,7 +8,7 @@ import prisma from "@calcom/prisma";
import { getAppKeys } from "../common";
import { sendPostMsg } from "../lib/BotService";
const log = logger.getChildLogger({ prefix: [`[lark/api/events]`] });
const log = logger.getSubLogger({ prefix: [`[lark/api/events]`] });
const larkKeysSchema = z.object({
open_verification_token: z.string(),
@@ -5,7 +5,7 @@ import prisma from "@calcom/prisma";
import { LARK_HOST, getAppKeys, isExpired } from "../common";
const log = logger.getChildLogger({ prefix: [`[[LarkAppCredential]`] });
const log = logger.getSubLogger({ prefix: [`[[LarkAppCredential]`] });
function makePoolingPromise<T>(
promiseCreator: () => Promise<T | null>,
@@ -3,7 +3,7 @@ import logger from "@calcom/lib/logger";
import { LARK_HOST } from "../common";
import { getAppAccessToken } from "./AppAccessToken";
const log = logger.getChildLogger({ prefix: [`[[LarkTenantCredential]`] });
const log = logger.getSubLogger({ prefix: [`[[LarkTenantCredential]`] });
const msg = {
en_us: {
@@ -40,7 +40,7 @@ export default class LarkCalendarService implements Calendar {
constructor(credential: CredentialPayload) {
this.integrationName = "lark_calendar";
this.auth = this.larkAuth(credential);
this.log = logger.getChildLogger({ prefix: [`[[lib] ${this.integrationName}`] });
this.log = logger.getSubLogger({ prefix: [`[[lib] ${this.integrationName}`] });
this.credential = credential;
}
@@ -70,7 +70,7 @@ export default class Office365CalendarService implements Calendar {
this.integrationName = "office365_calendar";
this.auth = this.o365Auth(credential);
this.credential = credential;
this.log = logger.getChildLogger({ prefix: [`[[lib] ${this.integrationName}`] });
this.log = logger.getSubLogger({ prefix: [`[[lib] ${this.integrationName}`] });
}
async createEvent(event: CalendarEvent, credentialId: number): Promise<NewCalendarEventType> {
@@ -15,7 +15,7 @@ import { processRoute } from "../../lib/processRoute";
import transformResponse from "../../lib/transformResponse";
import type { Response } from "../../types/types";
const log = logger.getChildLogger({ prefix: ["[routing-forms]", "[router]"] });
const log = logger.getSubLogger({ prefix: ["[routing-forms]", "[router]"] });
export default function Router({ form, message }: inferSSRProps<typeof getServerSideProps>) {
return (
<>
@@ -16,7 +16,7 @@ interface FormsHandlerOptions {
};
input: TFormSchema;
}
const log = logger.getChildLogger({ prefix: ["[formsHandler]"] });
const log = logger.getSubLogger({ prefix: ["[formsHandler]"] });
export const formsHandler = async ({ ctx, input }: FormsHandlerOptions) => {
const { prisma, user } = ctx;
@@ -57,7 +57,7 @@ export default class SalesforceCalendarService implements Calendar {
constructor(credential: CredentialPayload) {
this.integrationName = "salesforce_other_calendar";
this.conn = this.getClient(credential).then((c) => c);
this.log = logger.getChildLogger({ prefix: [`[[lib] ${this.integrationName}`] });
this.log = logger.getSubLogger({ prefix: [`[[lib] ${this.integrationName}`] });
}
private getClient = async (credential: CredentialPayload) => {
@@ -33,7 +33,7 @@ export default class CloseComCalendarService implements Calendar {
constructor(credential: CredentialPayload) {
this.integrationName = "sendgrid_other_calendar";
this.log = logger.getChildLogger({ prefix: [`[[lib] ${this.integrationName}`] });
this.log = logger.getSubLogger({ prefix: [`[[lib] ${this.integrationName}`] });
const parsedCredentialKey = apiKeySchema.safeParse(credential.key);
@@ -42,7 +42,7 @@ export default class BiginCalendarService implements Calendar {
constructor(credential: CredentialPayload) {
this.auth = this.biginAuth(credential);
this.log = logger.getChildLogger({ prefix: [`[[lib] ${this.integrationName}`] });
this.log = logger.getSubLogger({ prefix: [`[[lib] ${this.integrationName}`] });
}
/***
@@ -14,7 +14,7 @@ import config from "../config.json";
import type { ZohoAuthCredentials } from "../types/ZohoCalendar";
import { appKeysSchema as zohoKeysSchema } from "../zod";
const log = logger.getChildLogger({ prefix: [`[[zohocalendar/api/callback]`] });
const log = logger.getSubLogger({ prefix: [`[[zohocalendar/api/callback]`] });
const OAUTH_BASE_URL = "https://accounts.zoho.com/oauth/v2";
@@ -30,7 +30,7 @@ export default class ZohoCalendarService implements Calendar {
constructor(credential: CredentialPayload) {
this.integrationName = "zoho_calendar";
this.auth = this.zohoAuth(credential);
this.log = logger.getChildLogger({
this.log = logger.getSubLogger({
prefix: [`[[lib] ${this.integrationName}`],
});
}
@@ -61,7 +61,7 @@ export default class ZohoCrmCalendarService implements Calendar {
constructor(credential: CredentialPayload) {
this.integrationName = "zohocrm_other_calendar";
this.auth = this.zohoCrmAuth(credential).then((r) => r);
this.log = logger.getChildLogger({ prefix: [`[[lib] ${this.integrationName}`] });
this.log = logger.getSubLogger({ prefix: [`[[lib] ${this.integrationName}`] });
}
private createContacts = async (attendees: Person[]) => {
+1 -1
View File
@@ -21,7 +21,7 @@ import type { EventResult } from "@calcom/types/EventManager";
import getCalendarsEvents from "./getCalendarsEvents";
const log = logger.getChildLogger({ prefix: ["CalendarManager"] });
const log = logger.getSubLogger({ prefix: ["CalendarManager"] });
export const getCalendarCredentials = (credentials: Array<CredentialPayload>) => {
const calendarCredentials = getApps(credentials, true)
+1 -1
View File
@@ -33,7 +33,7 @@ import type {
import { createEvent, updateEvent, deleteEvent } from "./CalendarManager";
import { createMeeting, updateMeeting, deleteMeeting } from "./videoClient";
const log = logger.getChildLogger({ prefix: ["EventManager"] });
const log = logger.getSubLogger({ prefix: ["EventManager"] });
export const isDedicatedIntegration = (location: string): boolean => {
return location !== MeetLocationType && location.includes("integrations:");
};
+1 -1
View File
@@ -8,7 +8,7 @@ import { performance } from "@calcom/lib/server/perfObserver";
import type { EventBusyDate } from "@calcom/types/Calendar";
import type { CredentialPayload } from "@calcom/types/Credential";
const log = logger.getChildLogger({ prefix: ["getCalendarsEvents"] });
const log = logger.getSubLogger({ prefix: ["getCalendarsEvents"] });
const getCalendarsEvents = async (
withCredentials: CredentialPayload[],
dateFrom: string,
+1 -1
View File
@@ -26,7 +26,7 @@ import type {
import { getBusyTimes, getBusyTimesForLimitChecks } from "./getBusyTimes";
const log = logger.getChildLogger({ prefix: ["getUserAvailability"] });
const log = logger.getSubLogger({ prefix: ["getUserAvailability"] });
const availabilitySchema = z
.object({
dateFrom: stringToDayjs,
+1 -1
View File
@@ -15,7 +15,7 @@ import type { CredentialPayload } from "@calcom/types/Credential";
import type { EventResult, PartialReference } from "@calcom/types/EventManager";
import type { VideoApiAdapter, VideoApiAdapterFactory, VideoCallData } from "@calcom/types/VideoApiAdapter";
const log = logger.getChildLogger({ prefix: ["[lib] videoClient"] });
const log = logger.getSubLogger({ prefix: ["[lib] videoClient"] });
const translator = short();
+1 -1
View File
@@ -9,7 +9,7 @@ import logger from "@calcom/lib/logger";
import { getTranslation } from "@calcom/lib/server/i18n";
import { prisma } from "@calcom/prisma";
const log = logger.getChildLogger({ prefix: [`[[Auth] `] });
const log = logger.getSubLogger({ prefix: [`[[Auth] `] });
interface VerifyEmailType {
username?: string;
@@ -6,7 +6,7 @@ import logger from "@calcom/lib/logger";
import { WebhookTriggerEvents } from "@calcom/prisma/enums";
import type { CalendarEvent } from "@calcom/types/Calendar";
const log = logger.getChildLogger({ prefix: ["[handleBookingRequested] book:user"] });
const log = logger.getSubLogger({ prefix: ["[handleBookingRequested] book:user"] });
/**
* Supposed to do whatever is needed when a booking is requested.
@@ -15,7 +15,7 @@ import { BookingStatus, WebhookTriggerEvents } from "@calcom/prisma/enums";
import { bookingMetadataSchema } from "@calcom/prisma/zod-utils";
import type { AdditionalInformation, CalendarEvent } from "@calcom/types/Calendar";
const log = logger.getChildLogger({ prefix: ["[handleConfirmation] book:user"] });
const log = logger.getSubLogger({ prefix: ["[handleConfirmation] book:user"] });
export async function handleConfirmation(args: {
user: EventManagerUser & { username: string | null };
@@ -96,7 +96,7 @@ import type { EventTypeInfo } from "../../webhooks/lib/sendPayload";
import getBookingResponsesSchema from "./getBookingResponsesSchema";
const translator = short();
const log = logger.getChildLogger({ prefix: ["[api] book:user"] });
const log = logger.getSubLogger({ prefix: ["[api] book:user"] });
type User = Prisma.UserGetPayload<typeof userSelect>;
type BufferedBusyTimes = BufferedBusyTime[];
@@ -685,12 +685,12 @@ async function handler(
eventType,
});
const loggerWithEventDetails = logger.getChildLogger({
const loggerWithEventDetails = logger.getSubLogger({
prefix: ["book:user", `${eventTypeId}:${reqBody.user}/${eventTypeSlug}`],
});
if (isEventTypeLoggingEnabled({ eventTypeId, usernameOrTeamName: reqBody.user })) {
logger.setSettings({ minLevel: "silly" });
logger.settings.minLevel = 0;
}
const fullName = getFullName(bookerName);
+1 -1
View File
@@ -17,7 +17,7 @@ import { handlePaymentSuccess } from "@calcom/lib/payment/handlePaymentSuccess";
import { prisma } from "@calcom/prisma";
import { BookingStatus } from "@calcom/prisma/enums";
const log = logger.getChildLogger({ prefix: ["[paymentWebhook]"] });
const log = logger.getSubLogger({ prefix: ["[paymentWebhook]"] });
export const config = {
api: {
@@ -27,7 +27,7 @@ import emailReminderTemplate from "./templates/emailReminderTemplate";
let sendgridAPIKey, senderEmail: string;
const log = logger.getChildLogger({ prefix: ["[emailReminderManager]"] });
const log = logger.getSubLogger({ prefix: ["[emailReminderManager]"] });
if (process.env.SENDGRID_API_KEY) {
sendgridAPIKey = process.env.SENDGRID_API_KEY as string;
senderEmail = process.env.SENDGRID_EMAIL as string;
@@ -20,7 +20,7 @@ export enum timeUnitLowerCase {
MINUTE = "minute",
YEAR = "year",
}
const log = logger.getChildLogger({ prefix: ["[smsReminderManager]"] });
const log = logger.getSubLogger({ prefix: ["[smsReminderManager]"] });
export type AttendeeInBookingInfo = {
name: string;
@@ -20,7 +20,7 @@ import {
whatsappReminderTemplate,
} from "./templates/whatsapp";
const log = logger.getChildLogger({ prefix: ["[whatsappReminderManager]"] });
const log = logger.getSubLogger({ prefix: ["[whatsappReminderManager]"] });
export const scheduleWhatsappReminder = async (
evt: BookingInfo,
+6 -8
View File
@@ -47,19 +47,17 @@ export const tabs = [
className="text-default bg-default selection:bg-subtle h-[calc(100%-50px)] font-mono"
style={{ resize: "none", overflow: "auto" }}
readOnly
value={
`<!-- Cal ${embedType} embed code begins -->\n` +
(embedType === "inline"
value={`<!-- Cal ${embedType} embed code begins -->\n${
embedType === "inline"
? `<div style="width:${getDimension(previewState.inline.width)};height:${getDimension(
previewState.inline.height
)};overflow:scroll" id="my-cal-inline"></div>\n`
: "") +
`<script type="text/javascript">
: ""
}<script type="text/javascript">
${embedSnippetString}
${getEmbedTypeSpecificString({ embedFramework: "HTML", embedType, calLink, previewState, embedCalOrigin })}
</script>
<!-- Cal ${embedType} embed code ends -->`
}
<!-- Cal ${embedType} embed code ends -->`}
/>
<p className="text-subtle hidden text-sm">{t("need_help_embedding")}</p>
</>
@@ -118,7 +116,7 @@ export const tabs = [
{ calLink: string; embedType: EmbedType; previewState: PreviewState }
>(function Preview({ calLink, embedType }, ref) {
const bookerUrl = useBookerUrl();
const iframeSrc = `${EMBED_PREVIEW_HTML_URL}?embedType=${embedType}&calLink=${calLink}&embedLibUrl=${embedLibUrl}&bookerUrl=${bookerUrl}`
const iframeSrc = `${EMBED_PREVIEW_HTML_URL}?embedType=${embedType}&calLink=${calLink}&embedLibUrl=${embedLibUrl}&bookerUrl=${bookerUrl}`;
if (ref instanceof Function || !ref) {
return null;
}
+2 -2
View File
@@ -440,8 +440,8 @@ class EventsInsights {
if (!data.length) {
return "";
}
const header = Object.keys(data[0]).join(",") + "\n";
const rows = data.map((obj: any) => Object.values(obj).join(",") + "\n");
const header = `${Object.keys(data[0]).join(",")}\n`;
const rows = data.map((obj: any) => `${Object.values(obj).join(",")}\n`);
return header + rows.join("");
}
}
@@ -9,7 +9,7 @@ import prisma from "@calcom/prisma";
import type { ApiKey } from "@calcom/prisma/client";
import { BookingStatus, WebhookTriggerEvents } from "@calcom/prisma/enums";
const log = logger.getChildLogger({ prefix: ["[node-scheduler]"] });
const log = logger.getSubLogger({ prefix: ["[node-scheduler]"] });
export async function addSubscription({
appApiKey,
+1 -1
View File
@@ -121,7 +121,7 @@ export default abstract class BaseCalendarService implements Calendar {
this.headers = getBasicAuthHeaders({ username, password });
this.credential = credential;
this.log = logger.getChildLogger({ prefix: [`[[lib] ${this.integrationName}`] });
this.log = logger.getSubLogger({ prefix: [`[[lib] ${this.integrationName}`] });
}
private getAttendees(event: CalendarEvent) {
+1 -1
View File
@@ -193,7 +193,7 @@ export default class CloseCom {
private log: typeof logger;
constructor(providedApiKey = "") {
this.log = logger.getChildLogger({ prefix: [`[[lib] close.com`] });
this.log = logger.getSubLogger({ prefix: [`[[lib] close.com`] });
if (!providedApiKey && !environmentApiKey) throw Error("Close.com Api Key not present");
this.apiKey = providedApiKey || environmentApiKey;
}
+1 -1
View File
@@ -52,7 +52,7 @@ export default class Sendgrid {
private log: typeof logger;
constructor(providedApiKey = "") {
this.log = logger.getChildLogger({ prefix: [`[[lib] sendgrid`] });
this.log = logger.getSubLogger({ prefix: [`[[lib] sendgrid`] });
if (!providedApiKey && !environmentApiKey) throw Error("Sendgrid Api Key not present");
client.setApiKey(providedApiKey || environmentApiKey);
}
+10 -12
View File
@@ -3,19 +3,17 @@ import { Logger } from "tslog";
import { IS_PRODUCTION } from "./constants";
const logger = new Logger({
minLevel: !!process.env.NEXT_PUBLIC_DEBUG ? "debug" : "warn",
dateTimePattern: "hour:minute:second.millisecond",
displayFunctionName: false,
displayFilePath: "hidden",
dateTimeTimezone: IS_PRODUCTION ? "utc" : Intl.DateTimeFormat().resolvedOptions().timeZone,
prettyInspectHighlightStyles: {
name: "yellow",
number: "blue",
bigint: "blue",
boolean: "blue",
},
minLevel: !!process.env.NEXT_PUBLIC_DEBUG ? 2 : 4,
maskValuesOfKeys: ["password", "passwordConfirmation", "credentials", "credential"],
exposeErrorCodeFrame: !IS_PRODUCTION,
prettyLogTimeZone: IS_PRODUCTION ? "UTC" : "local",
prettyErrorStackTemplate: " • {{fileName}}\t{{method}}\n\t{{filePathWithLine}}", // default
prettyErrorTemplate: "\n{{errorName}} {{errorMessage}}\nerror stack:\n{{errorStack}}", // default
prettyLogTemplate: "{{hh}}:{{MM}}:{{ss}}:{{ms}}\t{{logLevelName}}", // default with exclusion of `{{filePathWithLine}}`
stylePrettyLogs: true,
prettyLogStyles: {
name: "yellow",
dateIsoStr: "blue",
},
});
export default logger;
+1 -1
View File
@@ -27,7 +27,7 @@
"rrule": "^2.7.1",
"tailwind-merge": "^1.13.2",
"tsdav": "2.0.3",
"tslog": "^3.2.1",
"tslog": "^4.9.2",
"uuid": "^8.3.2"
},
"devDependencies": {
+1 -1
View File
@@ -12,7 +12,7 @@ import { BookingStatus } from "@calcom/prisma/enums";
import logger from "../logger";
const log = logger.getChildLogger({ prefix: ["[handlePaymentSuccess]"] });
const log = logger.getSubLogger({ prefix: ["[handlePaymentSuccess]"] });
export async function handlePaymentSuccess(paymentId: number, bookingId: number) {
const { booking, user: userWithCredentials, evt, eventType } = await getBooking(bookingId);
+1 -1
View File
@@ -4,7 +4,7 @@ import { Redis } from "@upstash/redis";
import { isIpInBanListString } from "./getIP";
import logger from "./logger";
const log = logger.getChildLogger({ prefix: ["RateLimit"] });
const log = logger.getSubLogger({ prefix: ["RateLimit"] });
export type RateLimitHelper = {
rateLimitingType?: "core" | "forcedSlowMode" | "common" | "api" | "ai";
+1 -1
View File
@@ -2,7 +2,7 @@ import { Prisma } from "@prisma/client";
import logger from "@calcom/lib/logger";
const log = logger.getChildLogger({ prefix: [`[[redactError]`] });
const log = logger.getSubLogger({ prefix: [`[[redactError]`] });
function shouldRedact<T extends Error>(error: T) {
return (
+1 -1
View File
@@ -6,7 +6,7 @@ import type { ConsoleUserInfoType, TeamInfoType, WebUserInfoType } from "./ISync
import services from "./services";
import CloseComService from "./services/CloseComService";
const log = logger.getChildLogger({ prefix: [`[[SyncServiceManager] `] });
const log = logger.getSubLogger({ prefix: [`[[SyncServiceManager] `] });
export const createConsoleUser = async (user: ConsoleUserInfoType | null | undefined) => {
if (user) {
@@ -25,7 +25,7 @@ export default class CloseComService extends SyncServiceCore implements ISyncSer
protected declare service: CloseCom;
constructor() {
super(serviceName, CloseCom, logger.getChildLogger({ prefix: [`[[sync] ${serviceName}`] }));
super(serviceName, CloseCom, logger.getSubLogger({ prefix: [`[[sync] ${serviceName}`] }));
}
upsertAnyUser = async (
@@ -20,7 +20,7 @@ const serviceName = "sendgrid_service";
export default class SendgridService extends SyncServiceCore implements ISyncService {
protected declare service: Sendgrid;
constructor() {
super(serviceName, Sendgrid, logger.getChildLogger({ prefix: [`[[sync] ${serviceName}`] }));
super(serviceName, Sendgrid, logger.getSubLogger({ prefix: [`[[sync] ${serviceName}`] }));
}
upsert = async (user: WebUserInfoType | ConsoleUserInfoType) => {
+9 -8
View File
@@ -978,20 +978,21 @@ model CalendarCache {
enum RedirectType {
UserEventType @map("user-event-type")
TeamEventType @map("team-event-type")
User @map("user")
Team @map("team")
User @map("user")
Team @map("team")
}
model TempOrgRedirect {
id Int @id @default(autoincrement())
id Int @id @default(autoincrement())
// Better would be to have fromOrgId and toOrgId as well and then we should have just to instead toUrl
from String
// 0 would mean it is non org
fromOrgId Int
fromOrgId Int
type RedirectType
toUrl String
enabled Boolean @default(true)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
enabled Boolean @default(true)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@unique([from, type, fromOrgId])
}
}
@@ -9,7 +9,7 @@ type ResendEmailOptions = {
};
};
const log = logger.getChildLogger({ prefix: [`[[Auth] `] });
const log = logger.getSubLogger({ prefix: [`[[Auth] `] });
export const resendVerifyEmail = async ({ ctx }: ResendEmailOptions) => {
if (ctx.user.emailVerified) {
@@ -1,6 +1,6 @@
import { prisma } from "@calcom/prisma";
import { getBusyCalendarTimes } from "@calcom/core/CalendarManager";
import dayjs from "@calcom/dayjs";
import { prisma } from "@calcom/prisma";
import type { EventBusyDate } from "@calcom/types/Calendar";
import { TRPCError } from "@trpc/server";
@@ -268,7 +268,7 @@ export function getRegularOrDynamicEventType(
export async function getAvailableSlots({ input, ctx }: GetScheduleOptions) {
const orgDetails = orgDomainConfig(ctx?.req?.headers.host ?? "");
if (process.env.INTEGRATION_TEST_MODE === "true") {
logger.setSettings({ minLevel: "silly" });
logger.settings.minLevel = 2;
}
const startPrismaEventTypeGet = performance.now();
const eventType = await getRegularOrDynamicEventType(input, orgDetails);
@@ -279,10 +279,10 @@ export async function getAvailableSlots({ input, ctx }: GetScheduleOptions) {
}
if (isEventTypeLoggingEnabled({ eventTypeId: eventType.id })) {
logger.setSettings({ minLevel: "debug" });
logger.settings.minLevel = 2;
}
const loggerWithEventDetails = logger.getChildLogger({
const loggerWithEventDetails = logger.getSubLogger({
prefix: ["getAvailableSlots", `${eventType.id}:${input.usernameList}/${input.eventTypeSlug}`],
});