refactor: extract dedicated @calcom/i18n package (#28141)
This commit is contained in:
@@ -202,7 +202,7 @@ jobs:
|
||||
- '!.github/CODEOWNERS'
|
||||
- '!docs/**'
|
||||
- '!help/**'
|
||||
- '!apps/web/public/static/locales/**/common.json'
|
||||
- '!packages/i18n/locales/**/common.json'
|
||||
- '!i18n.lock'
|
||||
- name: Check for specific path changes
|
||||
uses: dorny/paths-filter@v3
|
||||
|
||||
@@ -12,7 +12,7 @@ You are a senior Cal.com engineer working in a Yarn/Turbo monorepo. You prioriti
|
||||
- Create PRs in draft mode by default
|
||||
- Run `yarn type-check:ci --force` before concluding CI failures are unrelated to your changes
|
||||
- Import directly from source files, not barrel files (e.g., `@calcom/ui/components/button` not `@calcom/ui`)
|
||||
- Add translations to `apps/web/public/static/locales/en/common.json` for all UI strings
|
||||
- Add translations to `packages/i18n/locales/en/common.json` for all UI strings
|
||||
- Use `date-fns` or native `Date` instead of Day.js when timezone awareness isn't needed
|
||||
- Put permission checks in `page.tsx`, never in `layout.tsx`
|
||||
- Use `ast-grep` for searching if available; otherwise use `rg` (ripgrep), then fall back to `grep`
|
||||
@@ -126,7 +126,7 @@ packages/lib/ # Shared utilities
|
||||
- Routes: `apps/web/app/` (App Router)
|
||||
- Database schema: `packages/prisma/schema.prisma`
|
||||
- tRPC routers: `packages/trpc/server/routers/`
|
||||
- Translations: `apps/web/public/static/locales/en/common.json`
|
||||
- Translations: `packages/i18n/locales/en/common.json`
|
||||
- Workflow constants: `packages/features/ee/workflows/lib/constants.ts`
|
||||
|
||||
## Tech Stack
|
||||
|
||||
@@ -33,7 +33,7 @@ tags: reference, navigation, file-locations
|
||||
|
||||
## Translations
|
||||
|
||||
- English: `apps/web/public/static/locales/en/common.json`
|
||||
- English: `packages/i18n/locales/en/common.json`
|
||||
|
||||
## App Store
|
||||
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
const path = require("node:path");
|
||||
const i18nConfig = require("@calcom/config/next-i18next.config");
|
||||
|
||||
/** @type {import("next-i18next").UserConfig} */
|
||||
const config = {
|
||||
...i18nConfig,
|
||||
localePath: path.resolve("../../web/public/static/locales"),
|
||||
};
|
||||
|
||||
module.exports = config;
|
||||
@@ -173,7 +173,7 @@ vi.mock("@calcom/features/ee/workflows/lib/getAllWorkflowsFromEventType", () =>
|
||||
getAllWorkflowsFromEventType: vi.fn().mockResolvedValue([]),
|
||||
}));
|
||||
|
||||
vi.mock("@calcom/lib/server/i18n", () => {
|
||||
vi.mock("@calcom/i18n/server", () => {
|
||||
const mockT = (key: string, options?: any) => {
|
||||
if (key === "event_between_users") {
|
||||
return `${options?.eventName} between ${options?.host} and ${options?.attendeeName}`;
|
||||
|
||||
@@ -14,7 +14,7 @@ import handler from "../../../pages/api/users/_post";
|
||||
type CustomNextApiRequest = NextApiRequest & Request;
|
||||
type CustomNextApiResponse = NextApiResponse & Response;
|
||||
|
||||
vi.mock("@calcom/lib/server/i18n", () => {
|
||||
vi.mock("@calcom/i18n/server", () => {
|
||||
return {
|
||||
getTranslation: (key: string) => {
|
||||
return () => key;
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
/* eslint-disable @typescript-eslint/no-var-requires */
|
||||
const path = require("node:path");
|
||||
const i18nConfig = require("@calcom/config/next-i18next.config");
|
||||
|
||||
/** @type {import("next-i18next").UserConfig} */
|
||||
const config = {
|
||||
...i18nConfig,
|
||||
localePath: path.resolve("../../web/public/static/locales"),
|
||||
};
|
||||
|
||||
module.exports = config;
|
||||
@@ -3,7 +3,7 @@ import withEmbedSsrAppDir from "app/WithEmbedSSR";
|
||||
import type { PageProps as ServerPageProps } from "app/_types";
|
||||
import { cookies, headers } from "next/headers";
|
||||
|
||||
import { loadTranslations } from "@calcom/lib/server/i18n";
|
||||
import { loadTranslations } from "@calcom/i18n/server";
|
||||
|
||||
import { buildLegacyCtx } from "@lib/buildLegacyCtx";
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import { generateMeetingMetadata } from "app/_utils";
|
||||
import { headers, cookies } from "next/headers";
|
||||
|
||||
import { getOrgFullOrigin } from "@calcom/features/ee/organizations/lib/orgDomains";
|
||||
import { loadTranslations } from "@calcom/lib/server/i18n";
|
||||
import { loadTranslations } from "@calcom/i18n/server";
|
||||
|
||||
import { buildLegacyCtx, decodeParams } from "@lib/buildLegacyCtx";
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import withEmbedSsrAppDir from "app/WithEmbedSSR";
|
||||
import type { PageProps as ServerPageProps } from "app/_types";
|
||||
import { cookies, headers } from "next/headers";
|
||||
|
||||
import { loadTranslations } from "@calcom/lib/server/i18n";
|
||||
import { loadTranslations } from "@calcom/i18n/server";
|
||||
|
||||
import { buildLegacyCtx } from "@lib/buildLegacyCtx";
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import { _generateMetadata } from "app/_utils";
|
||||
import { cookies, headers } from "next/headers";
|
||||
|
||||
import { getOrgFullOrigin } from "@calcom/features/ee/organizations/lib/orgDomains";
|
||||
import { loadTranslations } from "@calcom/lib/server/i18n";
|
||||
import { loadTranslations } from "@calcom/i18n/server";
|
||||
import { BookingStatus } from "@calcom/prisma/enums";
|
||||
|
||||
import { buildLegacyCtx } from "@lib/buildLegacyCtx";
|
||||
|
||||
@@ -3,7 +3,7 @@ import withEmbedSsrAppDir from "app/WithEmbedSSR";
|
||||
import type { PageProps as ServerPageProps } from "app/_types";
|
||||
import { cookies, headers } from "next/headers";
|
||||
|
||||
import { loadTranslations } from "@calcom/lib/server/i18n";
|
||||
import { loadTranslations } from "@calcom/i18n/server";
|
||||
|
||||
import { buildLegacyCtx } from "@lib/buildLegacyCtx";
|
||||
import { getServerSideProps } from "@lib/org/[orgSlug]/[user]/[type]/getServerSideProps";
|
||||
|
||||
@@ -5,7 +5,7 @@ import { generateMeetingMetadata } from "app/_utils";
|
||||
import { cookies, headers } from "next/headers";
|
||||
|
||||
import { getOrgFullOrigin } from "@calcom/features/ee/organizations/lib/orgDomains";
|
||||
import { loadTranslations } from "@calcom/lib/server/i18n";
|
||||
import { loadTranslations } from "@calcom/i18n/server";
|
||||
|
||||
import { buildLegacyCtx, decodeParams } from "@lib/buildLegacyCtx";
|
||||
import { getServerSideProps } from "@lib/org/[orgSlug]/[user]/[type]/getServerSideProps";
|
||||
|
||||
@@ -3,7 +3,7 @@ import withEmbedSsrAppDir from "app/WithEmbedSSR";
|
||||
import type { PageProps as ServerPageProps } from "app/_types";
|
||||
import { cookies, headers } from "next/headers";
|
||||
|
||||
import { loadTranslations } from "@calcom/lib/server/i18n";
|
||||
import { loadTranslations } from "@calcom/i18n/server";
|
||||
|
||||
import { buildLegacyCtx } from "@lib/buildLegacyCtx";
|
||||
import { getServerSideProps } from "@lib/team/[slug]/[type]/getServerSideProps";
|
||||
|
||||
@@ -6,7 +6,7 @@ import { cookies, headers } from "next/headers";
|
||||
|
||||
import { getOrgFullOrigin } from "@calcom/features/ee/organizations/lib/orgDomains";
|
||||
import { FeaturesRepository } from "@calcom/features/flags/features.repository";
|
||||
import { loadTranslations } from "@calcom/lib/server/i18n";
|
||||
import { loadTranslations } from "@calcom/i18n/server";
|
||||
import { prisma } from "@calcom/prisma";
|
||||
|
||||
import { buildLegacyCtx, decodeParams } from "@lib/buildLegacyCtx";
|
||||
|
||||
@@ -11,7 +11,7 @@ import { getOrgFullOrigin, orgDomainConfig } from "@calcom/features/ee/organizat
|
||||
import { getOrganizationSEOSettings } from "@calcom/features/ee/organizations/lib/orgSettings";
|
||||
import type { TeamData } from "@calcom/features/ee/teams/lib/getTeamData";
|
||||
import { shouldHideBrandingForTeamEvent } from "@calcom/features/profile/lib/hideBranding";
|
||||
import { loadTranslations } from "@calcom/lib/server/i18n";
|
||||
import { loadTranslations } from "@calcom/i18n/server";
|
||||
import slugify from "@calcom/lib/slugify";
|
||||
import { BookingStatus, RedirectType } from "@calcom/prisma/enums";
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import { constructAppImage, constructGenericImage, constructMeetingImage } from
|
||||
import { IS_CALCOM, WEBAPP_URL, APP_NAME, SEO_IMG_OGIMG, CAL_URL } from "@calcom/lib/constants";
|
||||
import { getCalcomUrl } from "@calcom/lib/getCalcomUrl";
|
||||
import { buildCanonical } from "@calcom/lib/next-seo.config";
|
||||
import { getTranslation } from "@calcom/lib/server/i18n";
|
||||
import { getTranslation } from "@calcom/i18n/server";
|
||||
import { truncateOnWord } from "@calcom/lib/text";
|
||||
|
||||
import { buildLegacyRequest } from "@lib/buildLegacyCtx";
|
||||
|
||||
@@ -7,7 +7,7 @@ import { sendOrganizerRequestReminderEmail } from "@calcom/emails/email-manager"
|
||||
import { getCalEventResponses } from "@calcom/features/bookings/lib/getCalEventResponses";
|
||||
import { isPrismaObjOrUndefined } from "@calcom/lib/isPrismaObj";
|
||||
import { parseRecurringEvent } from "@calcom/lib/isRecurringEvent";
|
||||
import { getTranslation } from "@calcom/lib/server/i18n";
|
||||
import { getTranslation } from "@calcom/i18n/server";
|
||||
import prisma, { bookingMinimalSelect } from "@calcom/prisma";
|
||||
import { BookingStatus, ReminderType } from "@calcom/prisma/enums";
|
||||
import type { EventTypeMetadata } from "@calcom/prisma/zod-utils";
|
||||
|
||||
@@ -6,7 +6,7 @@ import { z } from "zod";
|
||||
import dayjs from "@calcom/dayjs";
|
||||
import { sendMonthlyDigestEmail } from "@calcom/emails/workflow-email-service";
|
||||
import { EventsInsights } from "@calcom/features/insights/server/events";
|
||||
import { getTranslation } from "@calcom/lib/server/i18n";
|
||||
import { getTranslation } from "@calcom/i18n/server";
|
||||
import prisma from "@calcom/prisma";
|
||||
import type { Prisma } from "@calcom/prisma/client";
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import { NextResponse } from "next/server";
|
||||
|
||||
import renderEmail from "@calcom/emails/src/renderEmail";
|
||||
import { IS_PRODUCTION } from "@calcom/lib/constants";
|
||||
import { getTranslation } from "@calcom/lib/server/i18n";
|
||||
import { getTranslation } from "@calcom/i18n/server";
|
||||
|
||||
/**
|
||||
* This API endpoint is used for development purposes to preview email templates
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { getLocale } from "@calcom/features/auth/lib/getLocale";
|
||||
import { loadTranslations } from "@calcom/lib/server/i18n";
|
||||
import { loadTranslations } from "@calcom/i18n/server";
|
||||
import { IconSprites } from "@calcom/ui/components/icon";
|
||||
import { buildLegacyRequest } from "@lib/buildLegacyCtx";
|
||||
import { dir } from "i18next";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { getTranslation } from "@calcom/lib/server/i18n";
|
||||
import { getTranslation } from "@calcom/i18n/server";
|
||||
import type { CalendarEvent } from "@calcom/types/Calendar";
|
||||
|
||||
import type { getBookingResponse } from "./getBooking";
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
import path from "node:path";
|
||||
|
||||
import i18nConfig from "@calcom/config/next-i18next.config";
|
||||
|
||||
import type { UserConfig } from "next-i18next";
|
||||
|
||||
const config: UserConfig = {
|
||||
...i18nConfig,
|
||||
localePath: path.resolve("./public/static/locales"),
|
||||
};
|
||||
|
||||
export default config;
|
||||
@@ -3,7 +3,7 @@ import { config as dotenvConfig } from "dotenv";
|
||||
import type { NextConfig } from "next";
|
||||
import type { RouteHas } from "next/dist/lib/load-custom-routes";
|
||||
import { withAxiom } from "next-axiom";
|
||||
import i18nConfig from "./next-i18next.config";
|
||||
import i18nConfig from "@calcom/i18n/next-i18next.config";
|
||||
import packageJson from "./package.json";
|
||||
import {
|
||||
nextJsOrgRewriteConfig,
|
||||
|
||||
@@ -2,7 +2,7 @@ import { loadJSON } from "./loadJSON";
|
||||
|
||||
// Provide an standalone localize utility not managed by next-i18n
|
||||
export async function localize(locale: string) {
|
||||
const localeModule = `../../public/static/locales/${locale}/common.json`;
|
||||
const localeModule = `../../../../packages/i18n/locales/${locale}/common.json`;
|
||||
const localeMap = loadJSON(localeModule);
|
||||
return (message: string) => {
|
||||
if (message in localeMap) return localeMap[message];
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
User-agent: *
|
||||
Disallow: /sandbox
|
||||
Disallow: /api
|
||||
Disallow: /static/locales
|
||||
Disallow: /settings
|
||||
Disallow: /settings/my-account
|
||||
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import { readFileSync, readdirSync, writeFileSync } from "node:fs";
|
||||
import { readdirSync, readFileSync, writeFileSync } from "node:fs";
|
||||
import { join } from "node:path";
|
||||
import process from "node:process";
|
||||
|
||||
const TEMPLATE_LANGUAGE = "en";
|
||||
const SPECIFIC_LOCALES = process.argv.slice(2) || [];
|
||||
const LOCALES_PATH = join(__dirname, "../public/static/locales");
|
||||
const LOCALES_PATH = join(__dirname, "../../../packages/i18n/locales");
|
||||
|
||||
const ALL_LOCALES = readdirSync(LOCALES_PATH);
|
||||
|
||||
@@ -11,7 +12,7 @@ const templateJsonPath = join(LOCALES_PATH, `${TEMPLATE_LANGUAGE}/common.json`);
|
||||
const templateJson: { [key: string]: string } = JSON.parse(readFileSync(templateJsonPath, "utf-8"));
|
||||
|
||||
const missingTranslationLocales: string[] = [];
|
||||
// If locales are not specified, then check all folders under `public/static/locales`
|
||||
// If locales are not specified, then check all folders under the locales directory
|
||||
(SPECIFIC_LOCALES.length ? SPECIFIC_LOCALES : ALL_LOCALES).forEach((locale: string) => {
|
||||
if (locale === TEMPLATE_LANGUAGE) return;
|
||||
if (!ALL_LOCALES.includes(locale)) {
|
||||
|
||||
@@ -47,7 +47,7 @@ vi.mock("@calcom/emails/integration-email-service", () => {
|
||||
};
|
||||
});
|
||||
|
||||
vi.mock("@calcom/lib/server/i18n", () => {
|
||||
vi.mock("@calcom/i18n/server", () => {
|
||||
return {
|
||||
getTranslation: async (locale: string, namespace: string) => {
|
||||
const t = (key: string) => key;
|
||||
|
||||
@@ -23,7 +23,7 @@ const translationKeyRegex = /(?<!\w)(?:t\(("[^"]*")(?:,\s*\{[^}]*\})?\)|i18nKey=
|
||||
/** @type {import("i18n-unused/src/types/index.ts").RunOptions} */
|
||||
const config = {
|
||||
// localesPath: localePath, // uncomment to run on all locales (to calculate kb savings)
|
||||
localesPath: path.join("./apps/website", "/public/static/locales", "/en"),
|
||||
localesPath: path.join("./packages/i18n/locales", "/en"),
|
||||
srcPath: "./apps/website",
|
||||
srcExtensions: ["ts", "tsx"],
|
||||
translationContextSeparator: ":",
|
||||
|
||||
@@ -43,10 +43,8 @@
|
||||
},
|
||||
"buckets": {
|
||||
"json": {
|
||||
"include": [
|
||||
"apps/web/public/static/locales/[locale]/common.json"
|
||||
]
|
||||
"include": ["packages/i18n/locales/[locale]/common.json"]
|
||||
}
|
||||
},
|
||||
"$schema": "https://lingo.dev/schema/i18n.json"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
"@calcom/dailyvideo": "workspace:*",
|
||||
"@calcom/dayjs": "workspace:*",
|
||||
"@calcom/features": "workspace:*",
|
||||
"@calcom/i18n": "workspace:*",
|
||||
"@calcom/lib": "workspace:*",
|
||||
"@calcom/office365video": "workspace:*",
|
||||
"@calcom/ui": "workspace:*",
|
||||
|
||||
@@ -6,7 +6,7 @@ import { deleteMeeting } from "@calcom/features/conferencing/lib/videoClient";
|
||||
import { CalendarEventBuilder } from "@calcom/lib/builders/CalendarEvent/builder";
|
||||
import { CalendarEventDirector } from "@calcom/lib/builders/CalendarEvent/director";
|
||||
import logger from "@calcom/lib/logger";
|
||||
import { getTranslation } from "@calcom/lib/server/i18n";
|
||||
import { getTranslation } from "@calcom/i18n/server";
|
||||
import prisma from "@calcom/prisma";
|
||||
import type { Booking, BookingReference, User } from "@calcom/prisma/client";
|
||||
import { BookingStatus } from "@calcom/prisma/enums";
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
"main": "./index.ts",
|
||||
"description": "Connect your health data or wearables to trigger actions on your calendar.",
|
||||
"dependencies": {
|
||||
"@calcom/i18n": "workspace:*",
|
||||
"@calcom/prisma": "workspace:*",
|
||||
"@tryvital/vital-node": "1.4.6",
|
||||
"queue": "6.0.2"
|
||||
|
||||
@@ -6,7 +6,7 @@ import { deleteMeeting } from "@calcom/features/conferencing/lib/videoClient";
|
||||
import { CalendarEventBuilder } from "@calcom/lib/builders/CalendarEvent/builder";
|
||||
import { CalendarEventDirector } from "@calcom/lib/builders/CalendarEvent/director";
|
||||
import logger from "@calcom/lib/logger";
|
||||
import { getTranslation } from "@calcom/lib/server/i18n";
|
||||
import { getTranslation } from "@calcom/i18n/server";
|
||||
import prisma from "@calcom/prisma";
|
||||
import type { Booking, BookingReference, User } from "@calcom/prisma/client";
|
||||
import { BookingStatus } from "@calcom/prisma/enums";
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
"main": "./index.ts",
|
||||
"description": "Wipe My Cal is a Cal.com exclusive app that redefines what it looks like to reschedule multiple meetings at the same time. Simply install the app, and select ‘Wipe’ for whatever date you need to mass reschedule. Handle emergencies, unexpected sick days and last minute events with the simple click of a button.",
|
||||
"dependencies": {
|
||||
"@calcom/i18n": "workspace:*",
|
||||
"@calcom/prisma": "workspace:*",
|
||||
"queue": "6.0.2"
|
||||
},
|
||||
|
||||
@@ -10,7 +10,7 @@ vi.mock("@calcom/features/ee/organizations/lib/getBookerUrlServer", () => ({
|
||||
getBookerBaseUrl: vi.fn(async () => "https://cal.com"),
|
||||
}));
|
||||
|
||||
vi.mock("@calcom/lib/server/i18n", () => ({
|
||||
vi.mock("@calcom/i18n/server", () => ({
|
||||
getTranslation: vi.fn(async () => vi.fn(() => "translated")),
|
||||
}));
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import { getCalEventResponses } from "@calcom/features/bookings/lib/getCalEventR
|
||||
import type { BookingRepository } from "@calcom/features/bookings/repositories/BookingRepository";
|
||||
import { getBookerBaseUrl } from "@calcom/features/ee/organizations/lib/getBookerUrlServer";
|
||||
import { parseRecurringEvent } from "@calcom/lib/isRecurringEvent";
|
||||
import { getTranslation } from "@calcom/lib/server/i18n";
|
||||
import { getTranslation } from "@calcom/i18n/server";
|
||||
import { getTimeFormatStringFromUserTimeFormat, type TimeFormat } from "@calcom/lib/timeFormat";
|
||||
import type { Attendee, BookingSeat, DestinationCalendar, Prisma, User } from "@calcom/prisma/client";
|
||||
import { SchedulingType } from "@calcom/prisma/enums";
|
||||
|
||||
@@ -3,7 +3,7 @@ import { lookup } from "bcp-47-match";
|
||||
import type { GetTokenParams } from "next-auth/jwt";
|
||||
import { getToken } from "next-auth/jwt";
|
||||
|
||||
import { i18n } from "@calcom/config/next-i18next.config";
|
||||
import { i18n } from "@calcom/i18n/next-i18next.config";
|
||||
|
||||
type ReadonlyHeaders = Awaited<ReturnType<typeof import("next/headers").headers>>;
|
||||
type ReadonlyRequestCookies = Awaited<ReturnType<typeof import("next/headers").cookies>>;
|
||||
|
||||
@@ -5,7 +5,7 @@ import { getServerSession } from "@calcom/features/auth/lib/getServerSession";
|
||||
|
||||
type Maybe<T> = T | null | undefined;
|
||||
|
||||
const { i18n } = require("@calcom/config/next-i18next.config");
|
||||
const { i18n } = require("@calcom/i18n/next-i18next.config");
|
||||
|
||||
export async function getLocaleFromRequest(
|
||||
req: NextApiRequest | GetServerSidePropsContext["req"]
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import dayjs from "@calcom/dayjs";
|
||||
import { getTranslation } from "@calcom/lib/server/i18n";
|
||||
import { getTranslation } from "@calcom/i18n/server";
|
||||
import prisma from "@calcom/prisma";
|
||||
import type { User } from "@calcom/prisma/client";
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ import { checkRateLimitAndThrowError } from "@calcom/lib/checkRateLimitAndThrowE
|
||||
import { WEBAPP_URL } from "@calcom/lib/constants";
|
||||
import logger from "@calcom/lib/logger";
|
||||
import { hashEmail } from "@calcom/lib/server/PiiHasher";
|
||||
import { getTranslation } from "@calcom/lib/server/i18n";
|
||||
import { getTranslation } from "@calcom/i18n/server";
|
||||
import { prisma } from "@calcom/prisma";
|
||||
|
||||
const log = logger.getSubLogger({ prefix: [`[[Auth] `] });
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
"main": "index.ts",
|
||||
"dependencies": {
|
||||
"@calcom/dayjs": "workspace:*",
|
||||
"@calcom/i18n": "workspace:*",
|
||||
"@calcom/lib": "workspace:*",
|
||||
"@calcom/prisma": "workspace:*",
|
||||
"@calcom/trpc": "workspace:*",
|
||||
|
||||
@@ -9,7 +9,7 @@ import type {
|
||||
TranslationWithParams,
|
||||
GetDisplayTitleParams,
|
||||
} from "./IAuditActionService";
|
||||
import { getTranslation } from "@calcom/lib/server/i18n";
|
||||
import { getTranslation } from "@calcom/i18n/server";
|
||||
/**
|
||||
* Location Changed Audit Action Service
|
||||
* Handles LOCATION_CHANGED action with per-action versioning
|
||||
|
||||
@@ -8,7 +8,7 @@ import type { BookingType } from "@calcom/features/bookings/lib/handleNewBooking
|
||||
import type { EventNameObjectType } from "@calcom/features/eventtypes/lib/eventNaming";
|
||||
import { getPiiFreeCalendarEvent } from "@calcom/lib/piiFreeData";
|
||||
import { safeStringify } from "@calcom/lib/safeStringify";
|
||||
import { getTranslation } from "@calcom/lib/server/i18n";
|
||||
import { getTranslation } from "@calcom/i18n/server";
|
||||
import { getTimeFormatStringFromUserTimeFormat } from "@calcom/lib/timeFormat";
|
||||
import type { Prisma, User } from "@calcom/prisma/client";
|
||||
import type { SchedulingType } from "@calcom/prisma/enums";
|
||||
|
||||
@@ -41,7 +41,7 @@ import { isPrismaObjOrUndefined } from "@calcom/lib/isPrismaObj";
|
||||
import { parseRecurringEvent } from "@calcom/lib/isRecurringEvent";
|
||||
import logger from "@calcom/lib/logger";
|
||||
import { safeStringify } from "@calcom/lib/safeStringify";
|
||||
import { getTranslation } from "@calcom/lib/server/i18n";
|
||||
import { getTranslation } from "@calcom/i18n/server";
|
||||
import { getTimeFormatStringFromUserTimeFormat } from "@calcom/lib/timeFormat";
|
||||
// TODO: Prisma import would be used from DI in a followup PR when we remove `handler` export
|
||||
import prisma from "@calcom/prisma";
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ import { SchedulingType } from "@calcom/prisma/enums";
|
||||
|
||||
import { buildEventForTeamEventType } from "../../service/RegularBookingService";
|
||||
|
||||
vi.mock("@calcom/lib/server/i18n", () => ({
|
||||
vi.mock("@calcom/i18n/server", () => ({
|
||||
getTranslation: vi.fn().mockResolvedValue("translated"),
|
||||
}));
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ import { getRichDescription } from "@calcom/lib/CalEventParser";
|
||||
import { HttpError } from "@calcom/lib/http-error";
|
||||
import logger from "@calcom/lib/logger";
|
||||
import { safeStringify } from "@calcom/lib/safeStringify";
|
||||
import { getTranslation } from "@calcom/lib/server/i18n";
|
||||
import { getTranslation } from "@calcom/i18n/server";
|
||||
import prisma from "@calcom/prisma";
|
||||
import { WebhookTriggerEvents } from "@calcom/prisma/enums";
|
||||
import type { EventTypeMetadata } from "@calcom/prisma/zod-utils";
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ import { cloneDeep } from "lodash";
|
||||
import { sendRescheduledSeatEmailAndSMS } from "@calcom/emails/email-manager";
|
||||
import type EventManager from "@calcom/features/bookings/lib/EventManager";
|
||||
import { addVideoCallDataToEvent } from "@calcom/features/bookings/lib/handleNewBooking/addVideoCallDataToEvent";
|
||||
import { getTranslation } from "@calcom/lib/server/i18n";
|
||||
import { getTranslation } from "@calcom/i18n/server";
|
||||
import prisma from "@calcom/prisma";
|
||||
import type { Person, CalendarEvent } from "@calcom/types/Calendar";
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import { getBookerBaseUrl } from "@calcom/features/ee/organizations/lib/getBooke
|
||||
import { HttpError as HttpCode } from "@calcom/lib/http-error";
|
||||
import { isPrismaObjOrUndefined } from "@calcom/lib/isPrismaObj";
|
||||
import { parseRecurringEvent } from "@calcom/lib/isRecurringEvent";
|
||||
import { getTranslation } from "@calcom/lib/server/i18n";
|
||||
import { getTranslation } from "@calcom/i18n/server";
|
||||
import { getTimeFormatStringFromUserTimeFormat } from "@calcom/lib/timeFormat";
|
||||
import { bookingMinimalSelect, prisma } from "@calcom/prisma";
|
||||
import { credentialForCalendarServiceSelect } from "@calcom/prisma/selects/credential";
|
||||
|
||||
@@ -6,7 +6,7 @@ import { CredentialRepository } from "@calcom/features/credentials/repositories/
|
||||
import { TeamRepository } from "@calcom/features/ee/teams/repositories/TeamRepository";
|
||||
import { ErrorCode } from "@calcom/lib/errorCodes";
|
||||
import { ErrorWithCode } from "@calcom/lib/errors";
|
||||
import { getTranslation } from "@calcom/lib/server/i18n";
|
||||
import { getTranslation } from "@calcom/i18n/server";
|
||||
|
||||
import { handleNoShowFee } from "./handleNoShowFee";
|
||||
|
||||
@@ -26,7 +26,7 @@ vi.mock("@calcom/emails/billing-email-service", () => ({
|
||||
sendNoShowFeeChargedEmail: vi.fn(),
|
||||
}));
|
||||
|
||||
vi.mock("@calcom/lib/server/i18n", () => ({
|
||||
vi.mock("@calcom/i18n/server", () => ({
|
||||
getTranslation: vi.fn().mockResolvedValue((key: string) => key),
|
||||
}));
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import { MembershipRepository } from "@calcom/features/membership/repositories/M
|
||||
import { ErrorCode } from "@calcom/lib/errorCodes";
|
||||
import { ErrorWithCode } from "@calcom/lib/errors";
|
||||
import logger from "@calcom/lib/logger";
|
||||
import { getTranslation } from "@calcom/lib/server/i18n";
|
||||
import { getTranslation } from "@calcom/i18n/server";
|
||||
import prisma from "@calcom/prisma";
|
||||
import type { Prisma } from "@calcom/prisma/client";
|
||||
import type { CalendarEvent } from "@calcom/types/Calendar";
|
||||
|
||||
@@ -21,7 +21,7 @@ import { WEBAPP_URL } from "@calcom/lib/constants";
|
||||
import getOrgIdFromMemberOrTeamId from "@calcom/lib/getOrgIdFromMemberOrTeamId";
|
||||
import { isPrismaObjOrUndefined } from "@calcom/lib/isPrismaObj";
|
||||
import logger from "@calcom/lib/logger";
|
||||
import { getTranslation } from "@calcom/lib/server/i18n";
|
||||
import { getTranslation } from "@calcom/i18n/server";
|
||||
import type { PrismaClient } from "@calcom/prisma";
|
||||
import { Prisma } from "@calcom/prisma/client";
|
||||
import { BookingStatus, WebhookTriggerEvents } from "@calcom/prisma/enums";
|
||||
|
||||
@@ -78,7 +78,7 @@ import { criticalLogger } from "@calcom/lib/logger.server";
|
||||
import { getPiiFreeCalendarEvent, getPiiFreeEventType } from "@calcom/lib/piiFreeData";
|
||||
import { safeStringify } from "@calcom/lib/safeStringify";
|
||||
import { getServerErrorFromUnknown } from "@calcom/lib/server/getServerErrorFromUnknown";
|
||||
import { getTranslation } from "@calcom/lib/server/i18n";
|
||||
import { getTranslation } from "@calcom/i18n/server";
|
||||
import { getTimeFormatStringFromUserTimeFormat } from "@calcom/lib/timeFormat";
|
||||
import { distributedTracing } from "@calcom/lib/tracing/factory";
|
||||
import type { PrismaClient } from "@calcom/prisma";
|
||||
|
||||
@@ -3,7 +3,7 @@ import getWebhooks from "@calcom/features/webhooks/lib/getWebhooks";
|
||||
import { sendGenericWebhookPayload } from "@calcom/features/webhooks/lib/sendPayload";
|
||||
import { ErrorWithCode } from "@calcom/lib/errors";
|
||||
import logger from "@calcom/lib/logger";
|
||||
import { getTranslation } from "@calcom/lib/server/i18n";
|
||||
import { getTranslation } from "@calcom/i18n/server";
|
||||
import { Prisma } from "@calcom/prisma/client";
|
||||
import { WebhookTriggerEvents } from "@calcom/prisma/enums";
|
||||
import type { WrongAssignmentReportStatus } from "@calcom/prisma/enums";
|
||||
|
||||
@@ -15,7 +15,7 @@ import { deleteWebhookScheduledTriggers } from "@calcom/features/webhooks/lib/sc
|
||||
import { buildNonDelegationCredential } from "@calcom/lib/delegationCredential";
|
||||
import { isPrismaObjOrUndefined } from "@calcom/lib/isPrismaObj";
|
||||
import { parseRecurringEvent } from "@calcom/lib/isRecurringEvent";
|
||||
import { getTranslation } from "@calcom/lib/server/i18n";
|
||||
import { getTranslation } from "@calcom/i18n/server";
|
||||
import { bookingMinimalSelect, prisma } from "@calcom/prisma";
|
||||
import type { Prisma } from "@calcom/prisma/client";
|
||||
import { AppCategories, BookingStatus } from "@calcom/prisma/enums";
|
||||
|
||||
@@ -58,7 +58,7 @@ vi.mock("@calcom/features/ee/payments/server/stripe", () => ({
|
||||
default: mockStripe,
|
||||
}));
|
||||
|
||||
vi.mock("@calcom/lib/server/i18n", () => {
|
||||
vi.mock("@calcom/i18n/server", () => {
|
||||
return {
|
||||
getTranslation: async (locale: string, namespace: string) => {
|
||||
const t = (key: string) => key;
|
||||
|
||||
@@ -512,7 +512,7 @@ export class CreditService {
|
||||
return null; // user has limit already reached or team has already reached limit this month
|
||||
}
|
||||
|
||||
const { getTranslation } = await import("@calcom/lib/server/i18n");
|
||||
const { getTranslation } = await import("@calcom/i18n/server");
|
||||
|
||||
const teamWithAdmins = creditBalance?.team
|
||||
? {
|
||||
|
||||
@@ -2,7 +2,7 @@ import type { TFunction } from "i18next";
|
||||
|
||||
import { TeamRepository } from "@calcom/features/ee/teams/repositories/TeamRepository";
|
||||
import { UserRepository } from "@calcom/features/users/repositories/UserRepository";
|
||||
import { getTranslation } from "@calcom/lib/server/i18n";
|
||||
import { getTranslation } from "@calcom/i18n/server";
|
||||
import type { PrismaClient } from "@calcom/prisma";
|
||||
import { MembershipRole } from "@calcom/prisma/enums";
|
||||
|
||||
|
||||
@@ -4,5 +4,7 @@
|
||||
"authors": "zomars",
|
||||
"version": "1.0.0",
|
||||
"main": "./index.js",
|
||||
"dependencies": {}
|
||||
"dependencies": {
|
||||
"@calcom/i18n": "workspace:*"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import { addNewMembersToEventTypes } from "@calcom/features/ee/teams/lib/queries
|
||||
import { ProfileRepository } from "@calcom/features/profile/repositories/ProfileRepository";
|
||||
import logger from "@calcom/lib/logger";
|
||||
import { safeStringify } from "@calcom/lib/safeStringify";
|
||||
import { getTranslation } from "@calcom/lib/server/i18n";
|
||||
import { getTranslation } from "@calcom/i18n/server";
|
||||
import prisma from "@calcom/prisma";
|
||||
import { IdentityProvider, MembershipRole } from "@calcom/prisma/enums";
|
||||
import createUsersAndConnectToOrg from "./users/createUsersAndConnectToOrg";
|
||||
|
||||
@@ -17,7 +17,7 @@ vi.mock("@calcom/lib/logger", () => ({
|
||||
},
|
||||
}));
|
||||
|
||||
vi.mock("@calcom/lib/server/i18n", () => ({
|
||||
vi.mock("@calcom/i18n/server", () => ({
|
||||
getTranslation: vi.fn().mockResolvedValue((key: string) => key),
|
||||
}));
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
import { UserRepository } from "@calcom/features/users/repositories/UserRepository";
|
||||
import logger from "@calcom/lib/logger";
|
||||
import { safeStringify } from "@calcom/lib/safeStringify";
|
||||
import { getTranslation } from "@calcom/lib/server/i18n";
|
||||
import { getTranslation } from "@calcom/i18n/server";
|
||||
import prisma from "@calcom/prisma";
|
||||
import { IdentityProvider } from "@calcom/prisma/enums";
|
||||
import { assignValueToUserInOrgBulk } from "./assignValueToUser";
|
||||
|
||||
@@ -3,7 +3,7 @@ import type { DeepMockProxy } from "vitest-mock-extended";
|
||||
import { eventTypeMetaDataSchemaWithTypedApps } from "@calcom/app-store/zod-utils";
|
||||
import { sendSlugReplacementEmail } from "@calcom/emails/integration-email-service";
|
||||
import logger from "@calcom/lib/logger";
|
||||
import { getTranslation } from "@calcom/lib/server/i18n";
|
||||
import { getTranslation } from "@calcom/i18n/server";
|
||||
import type { PrismaClient } from "@calcom/prisma";
|
||||
import type { EventType, Prisma } from "@calcom/prisma/client";
|
||||
import { SchedulingType } from "@calcom/prisma/enums";
|
||||
|
||||
+5
-5
@@ -285,7 +285,7 @@ export class ManagedEventManualReassignmentService {
|
||||
throw new Error("Original booking not found");
|
||||
}
|
||||
|
||||
const { getTranslation } = await import("@calcom/lib/server/i18n");
|
||||
const { getTranslation } = await import("@calcom/i18n/server");
|
||||
const newUserT = await getTranslation(newUser.locale ?? "en", "common");
|
||||
const originalUserT = await getTranslation(originalUser.locale ?? "en", "common");
|
||||
|
||||
@@ -351,7 +351,7 @@ export class ManagedEventManualReassignmentService {
|
||||
originalBookingFull: NonNullable<
|
||||
Awaited<ReturnType<BookingRepository["findByIdWithAttendeesPaymentAndReferences"]>>
|
||||
>;
|
||||
originalUserT: Awaited<ReturnType<typeof import("@calcom/lib/server/i18n")["getTranslation"]>>;
|
||||
originalUserT: Awaited<ReturnType<typeof import("@calcom/i18n/server")["getTranslation"]>>;
|
||||
apps: ReturnType<typeof eventTypeAppMetadataOptionalSchema.parse>;
|
||||
logger: ReturnType<typeof loggerType.getSubLogger>;
|
||||
}) {
|
||||
@@ -405,7 +405,7 @@ export class ManagedEventManualReassignmentService {
|
||||
logger,
|
||||
}: {
|
||||
newUser: NonNullable<Awaited<ReturnType<UserRepository["findByIdWithCredentialsAndCalendar"]>>>;
|
||||
newUserT: Awaited<ReturnType<typeof import("@calcom/lib/server/i18n")["getTranslation"]>>;
|
||||
newUserT: Awaited<ReturnType<typeof import("@calcom/i18n/server")["getTranslation"]>>;
|
||||
targetEventTypeDetails: NonNullable<Awaited<ReturnType<typeof getEventTypesFromDB>>>;
|
||||
newBooking: ManagedEventReassignmentCreatedBooking;
|
||||
originalBookingFull: NonNullable<
|
||||
@@ -656,9 +656,9 @@ export class ManagedEventManualReassignmentService {
|
||||
targetEventTypeDetails: NonNullable<Awaited<ReturnType<typeof getEventTypesFromDB>>>;
|
||||
parentEventType: Awaited<ReturnType<typeof findTargetChildEventType>>["parentEventType"];
|
||||
newUser: NonNullable<Awaited<ReturnType<UserRepository["findByIdWithCredentialsAndCalendar"]>>>;
|
||||
newUserT: Awaited<ReturnType<typeof import("@calcom/lib/server/i18n")["getTranslation"]>>;
|
||||
newUserT: Awaited<ReturnType<typeof import("@calcom/i18n/server")["getTranslation"]>>;
|
||||
originalUser: NonNullable<Awaited<ReturnType<UserRepository["findByIdWithCredentialsAndCalendar"]>>>;
|
||||
originalUserT: Awaited<ReturnType<typeof import("@calcom/lib/server/i18n")["getTranslation"]>>;
|
||||
originalUserT: Awaited<ReturnType<typeof import("@calcom/i18n/server")["getTranslation"]>>;
|
||||
bookingLocation: string | null;
|
||||
videoCallData: CalendarEvent["videoCallData"];
|
||||
additionalInformation: AdditionalInformation;
|
||||
|
||||
@@ -16,7 +16,7 @@ interface BuildNewBookingPlanParams {
|
||||
>;
|
||||
targetEventTypeDetails: NonNullable<Awaited<ReturnType<typeof getEventTypesFromDB>>>;
|
||||
newUser: NonNullable<Awaited<ReturnType<UserRepository["findByIdWithCredentialsAndCalendar"]>>>;
|
||||
newUserT: Awaited<ReturnType<typeof import("@calcom/lib/server/i18n")["getTranslation"]>>;
|
||||
newUserT: Awaited<ReturnType<typeof import("@calcom/i18n/server")["getTranslation"]>>;
|
||||
reassignedById: number;
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ import { WEBAPP_URL } from "@calcom/lib/constants";
|
||||
import logger from "@calcom/lib/logger";
|
||||
import { safeStringify } from "@calcom/lib/safeStringify";
|
||||
import { uploadLogo } from "@calcom/lib/server/avatar";
|
||||
import { getTranslation } from "@calcom/lib/server/i18n";
|
||||
import { getTranslation } from "@calcom/i18n/server";
|
||||
import { isBase64Image, resizeBase64Image } from "@calcom/lib/server/resizeBase64Image";
|
||||
import slugify from "@calcom/lib/slugify";
|
||||
import { prisma } from "@calcom/prisma";
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ import { OrganizationOnboardingRepository } from "@calcom/features/organizations
|
||||
import { IS_SELF_HOSTED } from "@calcom/lib/constants";
|
||||
import logger from "@calcom/lib/logger";
|
||||
import { safeStringify } from "@calcom/lib/safeStringify";
|
||||
import { getTranslation } from "@calcom/lib/server/i18n";
|
||||
import { getTranslation } from "@calcom/i18n/server";
|
||||
import type { Team, User } from "@calcom/prisma/client";
|
||||
import { orgOnboardingInvitedMembersSchema, orgOnboardingTeamsSchema } from "@calcom/prisma/zod-utils";
|
||||
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ import { OrganizationOnboardingRepository } from "@calcom/features/organizations
|
||||
import { IS_SELF_HOSTED } from "@calcom/lib/constants";
|
||||
import logger from "@calcom/lib/logger";
|
||||
import { safeStringify } from "@calcom/lib/safeStringify";
|
||||
import { getTranslation } from "@calcom/lib/server/i18n";
|
||||
import { getTranslation } from "@calcom/i18n/server";
|
||||
import { prisma } from "@calcom/prisma";
|
||||
import type { Team, User } from "@calcom/prisma/client";
|
||||
import { BillingPeriod } from "@calcom/prisma/enums";
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ vi.mock("@calcom/lib/domainManager/organization", () => ({
|
||||
createDomain: vi.fn(),
|
||||
}));
|
||||
|
||||
vi.mock("@calcom/lib/server/i18n", () => {
|
||||
vi.mock("@calcom/i18n/server", () => {
|
||||
return {
|
||||
getTranslation: async (locale: string, namespace: string) => {
|
||||
const t = (key: string) => key;
|
||||
|
||||
+1
-1
@@ -40,7 +40,7 @@ vi.mock("@calcom/lib/domainManager/organization", () => ({
|
||||
createDomain: vi.fn(),
|
||||
}));
|
||||
|
||||
vi.mock("@calcom/lib/server/i18n", () => {
|
||||
vi.mock("@calcom/i18n/server", () => {
|
||||
return {
|
||||
getTranslation: async (locale: string, namespace: string) => {
|
||||
const t = (key: string) => key;
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
"license": "See license in LICENSE",
|
||||
"main": "./index.ts",
|
||||
"dependencies": {
|
||||
"@calcom/i18n": "workspace:*",
|
||||
"@calcom/lib": "workspace:*",
|
||||
"@calcom/ui": "workspace:*",
|
||||
"@hookform/error-message": "2.0.0",
|
||||
|
||||
@@ -9,7 +9,7 @@ import type { EventType } from "@calcom/features/bookings/lib/getAllCredentialsF
|
||||
import { getVideoCallDetails } from "@calcom/features/bookings/lib/handleNewBooking/getVideoCallDetails";
|
||||
import { getVideoCallUrlFromCalEvent } from "@calcom/lib/CalEventParser";
|
||||
import logger from "@calcom/lib/logger";
|
||||
import { getTranslation } from "@calcom/lib/server/i18n";
|
||||
import { getTranslation } from "@calcom/i18n/server";
|
||||
import { prisma } from "@calcom/prisma";
|
||||
import type { DestinationCalendar } from "@calcom/prisma/client";
|
||||
import type { Prisma } from "@calcom/prisma/client";
|
||||
|
||||
@@ -32,7 +32,7 @@ import { SENDER_NAME } from "@calcom/lib/constants";
|
||||
import { IdempotencyKeyService } from "@calcom/lib/idempotencyKey/idempotencyKeyService";
|
||||
import { isPrismaObjOrUndefined } from "@calcom/lib/isPrismaObj";
|
||||
import logger from "@calcom/lib/logger";
|
||||
import { getTranslation } from "@calcom/lib/server/i18n";
|
||||
import { getTranslation } from "@calcom/i18n/server";
|
||||
import { getTimeFormatStringFromUserTimeFormat } from "@calcom/lib/timeFormat";
|
||||
import { prisma } from "@calcom/prisma";
|
||||
import { WorkflowActions, WorkflowMethods, WorkflowTriggerEvents } from "@calcom/prisma/enums";
|
||||
|
||||
@@ -30,7 +30,7 @@ import { ErrorCode } from "@calcom/lib/errorCodes";
|
||||
import { IdempotencyKeyService } from "@calcom/lib/idempotencyKey/idempotencyKeyService";
|
||||
import { isPrismaObjOrUndefined } from "@calcom/lib/isPrismaObj";
|
||||
import logger from "@calcom/lib/logger";
|
||||
import { getTranslation } from "@calcom/lib/server/i18n";
|
||||
import { getTranslation } from "@calcom/i18n/server";
|
||||
import { getTimeFormatStringFromUserTimeFormat } from "@calcom/lib/timeFormat";
|
||||
import { prisma } from "@calcom/prisma";
|
||||
import type { EventTypeMetadata, PlatformClientParams } from "@calcom/prisma/zod-utils";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { getEventTypeResponse } from "@calcom/features/bookings/lib/handleNewBooking/getEventTypesFromDB";
|
||||
import type { IsFixedAwareUser } from "@calcom/features/bookings/lib/handleNewBooking/types";
|
||||
import { getTranslation } from "@calcom/lib/server/i18n";
|
||||
import { getTranslation } from "@calcom/i18n/server";
|
||||
|
||||
import type { BookingSelectResult } from "./bookingSelect";
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import { BookingSeatRepository } from "@calcom/features/bookings/repositories/Bo
|
||||
import { getBookerBaseUrl } from "@calcom/features/ee/organizations/lib/getBookerUrlServer";
|
||||
import logger from "@calcom/lib/logger";
|
||||
import { safeStringify } from "@calcom/lib/safeStringify";
|
||||
import { getTranslation } from "@calcom/lib/server/i18n";
|
||||
import { getTranslation } from "@calcom/i18n/server";
|
||||
import { getTimeFormatStringFromUserTimeFormat } from "@calcom/lib/timeFormat";
|
||||
import prisma from "@calcom/prisma";
|
||||
import { SchedulingType, WorkflowActions, WorkflowTemplates } from "@calcom/prisma/enums";
|
||||
|
||||
@@ -10,7 +10,7 @@ import { CreditService } from "@calcom/features/ee/billing/credit-service";
|
||||
import { getBookerBaseUrl } from "@calcom/features/ee/organizations/lib/getBookerUrlServer";
|
||||
import { isAttendeeAction } from "@calcom/features/ee/workflows/lib/actionHelperFunctions";
|
||||
import { scheduleSmsOrFallbackEmail } from "@calcom/features/ee/workflows/lib/reminders/messageDispatcher";
|
||||
import { getTranslation } from "@calcom/lib/server/i18n";
|
||||
import { getTranslation } from "@calcom/i18n/server";
|
||||
import { getTimeFormatStringFromUserTimeFormat } from "@calcom/lib/timeFormat";
|
||||
import prisma from "@calcom/prisma";
|
||||
import { WorkflowActions, WorkflowMethods, WorkflowTemplates } from "@calcom/prisma/enums";
|
||||
|
||||
@@ -5,7 +5,7 @@ import { NextResponse } from "next/server";
|
||||
import dayjs from "@calcom/dayjs";
|
||||
import { BookingSeatRepository } from "@calcom/features/bookings/repositories/BookingSeatRepository";
|
||||
import { CreditService } from "@calcom/features/ee/billing/credit-service";
|
||||
import { getTranslation } from "@calcom/lib/server/i18n";
|
||||
import { getTranslation } from "@calcom/i18n/server";
|
||||
import { getTimeFormatStringFromUserTimeFormat } from "@calcom/lib/timeFormat";
|
||||
import prisma from "@calcom/prisma";
|
||||
import { WorkflowActions, WorkflowMethods } from "@calcom/prisma/enums";
|
||||
|
||||
@@ -17,7 +17,7 @@ vi.mock("@calcom/features/ee/workflows/lib/reminders/providers/emailProvider", (
|
||||
sendOrScheduleWorkflowEmails: vi.fn(),
|
||||
}));
|
||||
|
||||
vi.mock("@calcom/lib/server/i18n", () => {
|
||||
vi.mock("@calcom/i18n/server", () => {
|
||||
return {
|
||||
getTranslation: async (locale: string, namespace: string) => {
|
||||
const t = (key: string) => key;
|
||||
|
||||
@@ -14,7 +14,7 @@ import type { Workflow, WorkflowStep } from "@calcom/features/ee/workflows/lib/t
|
||||
import { WorkflowReminderRepository } from "@calcom/features/ee/workflows/repositories/WorkflowReminderRepository";
|
||||
import { formatCalEventExtended } from "@calcom/lib/formatCalendarEvent";
|
||||
import { withReporting } from "@calcom/lib/sentryWrapper";
|
||||
import { getTranslation } from "@calcom/lib/server/i18n";
|
||||
import { getTranslation } from "@calcom/i18n/server";
|
||||
import { checkSMSRateLimit } from "@calcom/lib/smsLockState";
|
||||
import { prisma } from "@calcom/prisma";
|
||||
import { SchedulingType } from "@calcom/prisma/enums";
|
||||
|
||||
@@ -9,7 +9,7 @@ import { getSubmitterEmail } from "@calcom/features/tasker/tasks/triggerFormSubm
|
||||
import { SENDER_ID } from "@calcom/lib/constants";
|
||||
import logger from "@calcom/lib/logger";
|
||||
import { safeStringify } from "@calcom/lib/safeStringify";
|
||||
import { getTranslation } from "@calcom/lib/server/i18n";
|
||||
import { getTranslation } from "@calcom/i18n/server";
|
||||
import { getTimeFormatStringFromUserTimeFormat } from "@calcom/lib/timeFormat";
|
||||
import type { PrismaClient } from "@calcom/prisma";
|
||||
import prisma from "@calcom/prisma";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import dayjs from "@calcom/dayjs";
|
||||
import logger from "@calcom/lib/logger";
|
||||
import { getTranslation } from "@calcom/lib/server/i18n";
|
||||
import { getTranslation } from "@calcom/i18n/server";
|
||||
import prisma from "@calcom/prisma";
|
||||
import {
|
||||
WorkflowTriggerEvents,
|
||||
|
||||
@@ -22,7 +22,7 @@ vi.mock("@calcom/features/profile/lib/hideBranding", () => ({
|
||||
getHideBranding: vi.fn().mockResolvedValue(false),
|
||||
}));
|
||||
|
||||
vi.mock("@calcom/lib/server/i18n", () => ({
|
||||
vi.mock("@calcom/i18n/server", () => ({
|
||||
getTranslation: vi.fn().mockResolvedValue((key: string) => key),
|
||||
}));
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ import { getVideoCallUrlFromCalEvent } from "@calcom/lib/CalEventParser";
|
||||
import { SENDER_NAME, WEBSITE_URL } from "@calcom/lib/constants";
|
||||
import logger from "@calcom/lib/logger";
|
||||
import { TimeFormat } from "@calcom/lib/timeFormat";
|
||||
import { getTranslation } from "@calcom/lib/server/i18n";
|
||||
import { getTranslation } from "@calcom/i18n/server";
|
||||
import { prisma } from "@calcom/prisma";
|
||||
import { WorkflowActions, WorkflowTemplates } from "@calcom/prisma/enums";
|
||||
import { SchedulingType, WorkflowTriggerEvents } from "@calcom/prisma/enums";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { getTranslation } from "@calcom/lib/server/i18n";
|
||||
import { getTranslation } from "@calcom/i18n/server";
|
||||
|
||||
import { deleteMultipleScheduledSMS } from "../reminders/providers/twilioProvider";
|
||||
import { WorkflowOptOutContactRepository } from "../repository/workflowOptOutContact";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { vi, expect, test, describe } from "vitest";
|
||||
|
||||
import { getTranslation } from "@calcom/lib/server/i18n";
|
||||
import { getTranslation } from "@calcom/i18n/server";
|
||||
import { TimeFormat } from "@calcom/lib/timeFormat";
|
||||
import { WorkflowActions, WorkflowTemplates } from "@calcom/prisma/enums";
|
||||
|
||||
@@ -28,7 +28,7 @@ const tMock = (key: string) => {
|
||||
return mocks[key] || key;
|
||||
};
|
||||
|
||||
vi.mock("@calcom/lib/server/i18n", () => {
|
||||
vi.mock("@calcom/i18n/server", () => {
|
||||
return {
|
||||
getTranslation: async (locale: string, namespace: string) => {
|
||||
const t = tMock as any;
|
||||
|
||||
@@ -18,7 +18,7 @@ export function mockNoTranslations() {
|
||||
});
|
||||
}
|
||||
|
||||
vi.mock("@calcom/lib/server/i18n", () => ({
|
||||
vi.mock("@calcom/i18n/server", () => ({
|
||||
getTranslation: (key: string) => () => key,
|
||||
}));
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ import { parseBookingLimit } from "@calcom/lib/intervalLimits/isBookingLimits";
|
||||
import { parseDurationLimit } from "@calcom/lib/intervalLimits/isDurationLimits";
|
||||
import { parseEventTypeColor } from "@calcom/lib/isEventTypeColor";
|
||||
import { parseRecurringEvent } from "@calcom/lib/isRecurringEvent";
|
||||
import { getTranslation } from "@calcom/lib/server/i18n";
|
||||
import { getTranslation } from "@calcom/i18n/server";
|
||||
import type { PrismaClient } from "@calcom/prisma";
|
||||
import type { Prisma } from "@calcom/prisma/client";
|
||||
import { MembershipRole, SchedulingType } from "@calcom/prisma/enums";
|
||||
|
||||
@@ -113,7 +113,7 @@ vi.mock("@calcom/lib/getOrgIdFromMemberOrTeamId", () => ({
|
||||
default: vi.fn().mockResolvedValue(null),
|
||||
}));
|
||||
|
||||
vi.mock("@calcom/lib/server/i18n", () => ({
|
||||
vi.mock("@calcom/i18n/server", () => ({
|
||||
getTranslation: vi
|
||||
.fn()
|
||||
.mockResolvedValue((key: string, opts?: { x?: string }) => (opts?.x ? `${opts.x} ${key}` : key)),
|
||||
|
||||
@@ -21,7 +21,7 @@ import { WebhookService } from "@calcom/features/webhooks/lib/WebhookService";
|
||||
import getOrgIdFromMemberOrTeamId from "@calcom/lib/getOrgIdFromMemberOrTeamId";
|
||||
import { HttpError } from "@calcom/lib/http-error";
|
||||
import logger from "@calcom/lib/logger";
|
||||
import { getTranslation } from "@calcom/lib/server/i18n";
|
||||
import { getTranslation } from "@calcom/i18n/server";
|
||||
import { getTimeFormatStringFromUserTimeFormat } from "@calcom/lib/timeFormat";
|
||||
import { prisma } from "@calcom/prisma";
|
||||
import { WebhookTriggerEvents, WorkflowTriggerEvents } from "@calcom/prisma/enums";
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
"dependencies": {
|
||||
"@calcom/atoms": "workspace:*",
|
||||
"@calcom/dayjs": "workspace:*",
|
||||
"@calcom/i18n": "workspace:*",
|
||||
"@calcom/lib": "workspace:*",
|
||||
"@calcom/trpc": "workspace:*",
|
||||
"@calcom/ui": "workspace:*",
|
||||
|
||||
@@ -4,7 +4,7 @@ import type { TeamRepository } from "@calcom/features/ee/teams/repositories/Team
|
||||
import type { MembershipRepository } from "@calcom/features/membership/repositories/MembershipRepository";
|
||||
import type { IRedisService } from "@calcom/features/redis/IRedisService";
|
||||
import { IS_PRODUCTION, WEBAPP_URL } from "@calcom/lib/constants";
|
||||
import { getTranslation } from "@calcom/lib/server/i18n";
|
||||
import { getTranslation } from "@calcom/i18n/server";
|
||||
|
||||
type EventDetails = {
|
||||
username: string;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { getCalEventResponses } from "@calcom/features/bookings/lib/getCalEventResponses";
|
||||
import { addVideoCallDataToEvent } from "@calcom/features/bookings/lib/handleNewBooking/addVideoCallDataToEvent";
|
||||
import { getTranslation } from "@calcom/lib/server/i18n";
|
||||
import { getTranslation } from "@calcom/i18n/server";
|
||||
import prisma from "@calcom/prisma";
|
||||
import type { CalendarEvent } from "@calcom/types/Calendar";
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import { scheduleWorkflowNotifications } from "@calcom/features/ee/workflows/lib
|
||||
import { Task } from "@calcom/features/tasker/repository";
|
||||
import { URL_SCANNING_ENABLED } from "@calcom/lib/constants";
|
||||
import logger from "@calcom/lib/logger";
|
||||
import { getTranslation } from "@calcom/lib/server/i18n";
|
||||
import { getTranslation } from "@calcom/i18n/server";
|
||||
import { getTimeFormatStringFromUserTimeFormat } from "@calcom/lib/timeFormat";
|
||||
import prisma from "@calcom/prisma";
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ vi.mock("@calcom/features/ee/workflows/lib/compareReminderBodyToTemplate", () =>
|
||||
}));
|
||||
|
||||
// Mock the i18n
|
||||
vi.mock("@calcom/lib/server/i18n", () => ({
|
||||
vi.mock("@calcom/i18n/server", () => ({
|
||||
getTranslation: vi.fn().mockResolvedValue((key: string) => key),
|
||||
}));
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import { describe, test, vi, expect, beforeEach } from "vitest";
|
||||
import { UserRepository } from "@calcom/features/users/repositories/UserRepository";
|
||||
import { CreationSource } from "@calcom/prisma/enums";
|
||||
|
||||
vi.mock("@calcom/lib/server/i18n", () => {
|
||||
vi.mock("@calcom/i18n/server", () => {
|
||||
return {
|
||||
getTranslation: async (locale: string, namespace: string) => {
|
||||
const t = (key: string) => key;
|
||||
|
||||
@@ -5,7 +5,7 @@ import { DEFAULT_SCHEDULE, getAvailabilityFromSchedule } from "@calcom/lib/avail
|
||||
import { buildNonDelegationCredentials } from "@calcom/lib/delegationCredential";
|
||||
import logger from "@calcom/lib/logger";
|
||||
import { safeStringify } from "@calcom/lib/safeStringify";
|
||||
import { getTranslation } from "@calcom/lib/server/i18n";
|
||||
import { getTranslation } from "@calcom/i18n/server";
|
||||
import { withSelectedCalendars } from "@calcom/lib/server/withSelectedCalendars";
|
||||
import type { PrismaClient } from "@calcom/prisma";
|
||||
import { availabilityUserSelect } from "@calcom/prisma";
|
||||
|
||||
@@ -6,7 +6,7 @@ import { CreationSource } from "@calcom/prisma/enums";
|
||||
|
||||
import { UserCreationService } from "./userCreationService";
|
||||
|
||||
vi.mock("@calcom/lib/server/i18n", () => {
|
||||
vi.mock("@calcom/i18n/server", () => {
|
||||
return {
|
||||
getTranslation: async (locale: string, namespace: string) => {
|
||||
const t = (key: string) => key;
|
||||
|
||||
@@ -8,7 +8,7 @@ import tasker from "@calcom/features/tasker";
|
||||
import logger from "@calcom/lib/logger";
|
||||
import { safeStringify } from "@calcom/lib/safeStringify";
|
||||
import { withReporting } from "@calcom/lib/sentryWrapper";
|
||||
import { getTranslation } from "@calcom/lib/server/i18n";
|
||||
import { getTranslation } from "@calcom/i18n/server";
|
||||
import { prisma } from "@calcom/prisma";
|
||||
import type { Prisma, Webhook, Booking, ApiKey } from "@calcom/prisma/client";
|
||||
import { BookingStatus, WebhookTriggerEvents } from "@calcom/prisma/enums";
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user