Skip to content

Scheduling infrastructure for absolutely everyone.

feat: Alby integration (#11495)

Roland2021b641ceb7
diff --git a/apps/web/components/apps/AppPage.tsx b/apps/web/components/apps/AppPage.tsx
index 992c29fef61..84b4102dbd0 100644
--- a/apps/web/components/apps/AppPage.tsx
+++ b/apps/web/components/apps/AppPage.tsx
@@ -89,6 +89,7 @@ export const AppPage = ({
const [existingCredentials, setExistingCredentials] = useState<number[]>([]);
const [showDisconnectIntegration, setShowDisconnectIntegration] = useState(false);
+
const appDbQuery = trpc.viewer.appCredentialsByType.useQuery(
{ appType: type },
{
diff --git a/apps/web/pages/api/integrations/alby/webhook.ts b/apps/web/pages/api/integrations/alby/webhook.ts
new file mode 100644
index 00000000000..e9862c01107
--- /dev/null
+++ b/apps/web/pages/api/integrations/alby/webhook.ts
@@ -0,0 +1 @@
+export { default, config } from "@calcom/app-store/alby/api/webhook";
diff --git a/apps/web/pages/api/integrations/paypal/webhook.ts b/apps/web/pages/api/integrations/paypal/webhook.ts
index d085cb74cb4..0762f351b33 100644
--- a/apps/web/pages/api/integrations/paypal/webhook.ts
+++ b/apps/web/pages/api/integrations/paypal/webhook.ts
@@ -1 +1 @@
-export { default, config } from "@calcom/features/ee/payments/api/paypal-webhook";
+export { default, config } from "@calcom/app-store/paypal/api/webhook";
diff --git a/apps/web/pages/apps/[slug]/setup.tsx b/apps/web/pages/apps/[slug]/setup.tsx
index 3ffd9d3285a..4942585a4c6 100644
--- a/apps/web/pages/apps/[slug]/setup.tsx
+++ b/apps/web/pages/apps/[slug]/setup.tsx
@@ -1,14 +1,14 @@
-import type { GetStaticPaths, InferGetStaticPropsType } from "next";
+import type { InferGetServerSidePropsType } from "next";
import { useSession } from "next-auth/react";
import { useRouter, useSearchParams } from "next/navigation";
import { AppSetupPage } from "@calcom/app-store/_pages/setup";
-import { getStaticProps } from "@calcom/app-store/_pages/setup/_getStaticProps";
+import { getServerSideProps } from "@calcom/app-store/_pages/setup/_getServerSideProps";
import { HeadSeo } from "@calcom/ui";
import PageWrapper from "@components/PageWrapper";
-export default function SetupInformation(props: InferGetStaticPropsType<typeof getStaticProps>) {
+export default function SetupInformation(props: InferGetServerSidePropsType<typeof getServerSideProps>) {
const searchParams = useSearchParams();
const router = useRouter();
const slug = searchParams?.get("slug") as string;
@@ -36,11 +36,4 @@ export default function SetupInformation(props: InferGetStaticPropsType<typeof g
SetupInformation.PageWrapper = PageWrapper;
-export const getStaticPaths: GetStaticPaths = async () => {
- return {
- paths: [],
- fallback: "blocking",
- };
-};
-
-export { getStaticProps };
+export { getServerSideProps };
diff --git a/apps/web/pages/booking/[uid].tsx b/apps/web/pages/booking/[uid].tsx
index 2c20b71ad70..d96bc65361b 100644
--- a/apps/web/pages/booking/[uid].tsx
+++ b/apps/web/pages/booking/[uid].tsx
@@ -23,6 +23,7 @@ import {
useIsEmbed,
} from "@calcom/embed-core/embed-iframe";
import { getServerSession } from "@calcom/features/auth/lib/getServerSession";
+import { Price } from "@calcom/features/bookings/components/event-meta/Price";
import { SMS_REMINDER_NUMBER_FIELD, SystemField } from "@calcom/features/bookings/lib/SystemField";
import { getBookingWithResponses } from "@calcom/features/bookings/lib/get-booking";
import { getBookingFieldsWithSystemFields } from "@calcom/features/bookings/lib/getBookingFields";
@@ -93,7 +94,7 @@ const querySchema = z.object({
});
export default function Success(props: SuccessProps) {
- const { t, i18n } = useLocale();
+ const { t } = useLocale();
const router = useRouter();
const routerQuery = useRouterQuery();
const pathname = usePathname();
@@ -490,10 +491,7 @@ export default function Success(props: SuccessProps) {
: t("payment")}
</div>
<div className="col-span-2 mb-2 mt-3">
- {new Intl.NumberFormat(i18n.language, {
- style: "currency",
- currency: props.paymentStatus.currency,
- }).format(props.paymentStatus.amount / 100.0)}
+ <Price currency={props.paymentStatus.currency} price={props.paymentStatus.amount} />
</div>
</>
)}
diff --git a/apps/web/playwright/fixtures/users.ts b/apps/web/playwright/fixtures/users.ts
index 58adf7c1ddc..4efc29abda2 100644
--- a/apps/web/playwright/fixtures/users.ts
+++ b/apps/web/playwright/fixtures/users.ts
@@ -556,6 +556,8 @@ export async function apiLogin(
export async function setupEventWithPrice(eventType: Pick<Prisma.EventType, "id">, page: Page) {
await page.goto(`/event-types/${eventType?.id}?tabName=apps`);
await page.locator("div > .ml-auto").first().click();
+ await page.locator(".text-black > .bg-default > div > div:nth-child(2)").first().click();
+ await page.getByTestId("select-option-usd").click();
await page.getByPlaceholder("Price").fill("100");
await page.getByTestId("update-eventtype").click();
}
diff --git a/apps/web/playwright/integrations-stripe.e2e.ts b/apps/web/playwright/integrations-stripe.e2e.ts
index edf81d0bf4a..cd67112bc7f 100644
--- a/apps/web/playwright/integrations-stripe.e2e.ts
+++ b/apps/web/playwright/integrations-stripe.e2e.ts
@@ -174,7 +174,7 @@ test.describe("Stripe integration", () => {
await page.getByTestId("price-input-stripe").fill("200");
// Select currency in dropdown
- await page.locator("div").filter({ hasText: "United States dollar (USD)" }).nth(1).click();
+ await page.locator(".text-black > .bg-default > div > div:nth-child(2)").first().click();
await page.locator("#react-select-2-input").fill("mexi");
await page.locator("#react-select-2-option-81").click();
diff --git a/apps/web/playwright/payment-apps.e2e.ts b/apps/web/playwright/payment-apps.e2e.ts
new file mode 100644
index 00000000000..536aed90e0c
--- /dev/null
+++ b/apps/web/playwright/payment-apps.e2e.ts
@@ -0,0 +1,203 @@
+import { expect } from "@playwright/test";
+
+import prisma from "@calcom/prisma";
+
+import { test } from "./lib/fixtures";
+import { selectFirstAvailableTimeSlotNextMonth } from "./lib/testUtils";
+
+test.describe.configure({ mode: "parallel" });
+test.afterEach(({ users }) => users.deleteAll());
+
+test.describe("Payment app", () => {
+ test("Should be able to edit alby price, currency", async ({ page, users }) => {
+ const user = await users.create();
+ await user.apiLogin();
+ const paymentEvent = user.eventTypes.find((item) => item.slug === "paid");
+ if (!paymentEvent) {
+ throw new Error("No payment event found");
+ }
+ await prisma.credential.create({
+ data: {
+ type: "alby_payment",
+ userId: user.id,
+ key: {
+ account_id: "random",
+ account_email: "[email protected]",
+ webhook_endpoint_id: "ep_randomString",
+ webhook_endpoint_secret: "whsec_randomString",
+ account_lightning_address: "[email protected]",
+ },
+ },
+ });
+
+ await page.goto(`event-types/${paymentEvent.id}?tabName=apps`);
+
+ await page.locator("#event-type-form").getByRole("switch").click();
+ await page.getByPlaceholder("Price").click();
+ await page.getByPlaceholder("Price").fill("200");
+ await page.getByText("SatoshissatsCurrencyBTCPayment optionCollect payment on booking").click();
+ await page.getByTestId("update-eventtype").click();
+
+ await page.goto(`${user.username}/${paymentEvent.slug}`);
+
+ // expect 200 sats to be displayed in page
+ expect(await page.locator("text=200 sats").first()).toBeTruthy();
+
+ await selectFirstAvailableTimeSlotNextMonth(page);
+ expect(await page.locator("text=200 sats").first()).toBeTruthy();
+
+ // go to /event-types and check if the price is 200 sats
+ await page.goto(`event-types/`);
+ expect(await page.locator("text=200 sats").first()).toBeTruthy();
+ });
+
+ test("Should be able to edit stripe price, currency", async ({ page, users }) => {
+ const user = await users.create();
+ await user.apiLogin();
+ const paymentEvent = user.eventTypes.find((item) => item.slug === "paid");
+ if (!paymentEvent) {
+ throw new Error("No payment event found");
+ }
+ await prisma.credential.create({
+ data: {
+ type: "stripe_payment",
+ userId: user.id,
+ key: {
+ scope: "read_write",
+ livemode: false,
+ token_type: "bearer",
+ access_token: "sk_test_randomString",
+ refresh_token: "rt_randomString",
+ stripe_user_id: "acct_randomString",
+ default_currency: "usd",
+ stripe_publishable_key: "pk_test_randomString",
+ },
+ },
+ });
+
+ await page.goto(`event-types/${paymentEvent.id}?tabName=apps`);
+ await page.locator("#event-type-form").getByRole("switch").click();
+ await page.locator(".text-black > .bg-default > div > div:nth-child(2)").first().click();
+ await page.getByTestId("select-option-usd").click();
+
+ await page.getByTestId("price-input-stripe").click();
+ await page.getByTestId("price-input-stripe").fill("350");
+ await page.getByTestId("update-eventtype").click();
+
+ await page.goto(`${user.username}/${paymentEvent.slug}`);
+
+ // expect 200 sats to be displayed in page
+ expect(await page.locator("text=350").first()).toBeTruthy();
+
+ await selectFirstAvailableTimeSlotNextMonth(page);
+ expect(await page.locator("text=350").first()).toBeTruthy();
+
+ // go to /event-types and check if the price is 200 sats
+ await page.goto(`event-types/`);
+ expect(await page.locator("text=350").first()).toBeTruthy();
+ });
+
+ test("Should be able to edit paypal price, currency", async ({ page, users }) => {
+ const user = await users.create();
+ await user.apiLogin();
+ const paymentEvent = user.eventTypes.find((item) => item.slug === "paid");
+ if (!paymentEvent) {
+ throw new Error("No payment event found");
+ }
+ await prisma.credential.create({
+ data: {
+ type: "paypal_payment",
+ userId: user.id,
+ key: {
+ client_id: "randomString",
+ secret_key: "randomString",
+ webhook_id: "randomString",
+ },
+ },
+ });
+
+ await page.goto(`event-types/${paymentEvent.id}?tabName=apps`);
+
+ await page.locator("#event-type-form").getByRole("switch").click();
+
+ await page.getByPlaceholder("Price").click();
+ await page.getByPlaceholder("Price").fill("150");
+
+ await page.locator(".text-black > .bg-default > div > div:nth-child(2)").first().click();
+ await page.locator("#react-select-2-option-13").click();
+
+ await page.locator(".mb-1 > .bg-default > div > div:nth-child(2)").first().click();
+
+ await page.getByText("$MXNCurrencyMexican pesoPayment option").click();
+ await page.getByTestId("update-eventtype").click();
+
+ await page.goto(`${user.username}/${paymentEvent.slug}`);
+
+ // expect 150 to be displayed in page
+ expect(await page.locator("text=MX$150.00").first()).toBeTruthy();
+
+ await selectFirstAvailableTimeSlotNextMonth(page);
+ // expect 150 to be displayed in page
+ expect(await page.locator("text=MX$150.00").first()).toBeTruthy();
+
+ // go to /event-types and check if the price is 150
+ await page.goto(`event-types/`);
+ expect(await page.locator("text=MX$150.00").first()).toBeTruthy();
+ });
+
+ test("Should display App is not setup already for alby", async ({ page, users }) => {
+ const user = await users.create();
+ await user.apiLogin();
+ const paymentEvent = user.eventTypes.find((item) => item.slug === "paid");
+ if (!paymentEvent) {
+ throw new Error("No payment event found");
+ }
+ await prisma.credential.create({
+ data: {
+ type: "alby_payment",
+ userId: user.id,
+ key: {},
+ },
+ });
+
+ await page.goto(`event-types/${paymentEvent.id}?tabName=apps`);
+
+ await page.locator("#event-type-form").getByRole("switch").click();
+
+ // expect text "This app has not been setup yet" to be displayed
+ expect(await page.locator("text=This app has not been setup yet").first()).toBeTruthy();
+
+ await page.getByRole("button", { name: "Setup" }).click();
+
+ // Expect "Connect with Alby" to be displayed
+ expect(await page.locator("text=Connect with Alby").first()).toBeTruthy();
+ });
+
+ test("Should display App is not setup already for paypal", async ({ page, users }) => {
+ const user = await users.create();
+ await user.apiLogin();
+ const paymentEvent = user.eventTypes.find((item) => item.slug === "paid");
+ if (!paymentEvent) {
+ throw new Error("No payment event found");
+ }
+ await prisma.credential.create({
+ data: {
+ type: "paypal_payment",
+ userId: user.id,
+ key: {},
+ },
+ });
+
+ await page.goto(`event-types/${paymentEvent.id}?tabName=apps`);
+
+ await page.locator("#event-type-form").getByRole("switch").click();
+
+ // expect text "This app has not been setup yet" to be displayed
+ expect(await page.locator("text=This app has not been setup yet").first()).toBeTruthy();
+
+ await page.getByRole("button", { name: "Setup" }).click();
+
+ // Expect "Getting started with Paypal APP" to be displayed
+ expect(await page.locator("text=Getting started with Paypal APP").first()).toBeTruthy();
+ });
+});
diff --git a/apps/web/public/static/locales/en/common.json b/apps/web/public/static/locales/en/common.json
index 4a6abe4213a..393a2161dc1 100644
--- a/apps/web/public/static/locales/en/common.json
+++ b/apps/web/public/static/locales/en/common.json
@@ -2059,5 +2059,6 @@
"edit_users_availability":"Edit user's availability: {{username}}",
"resend_invitation": "Resend invitation",
"invitation_resent": "The invitation was resent.",
+ "this_app_is_not_setup_already": "This app has not been setup yet",
"ADD_NEW_STRINGS_ABOVE_THIS_LINE_TO_PREVENT_MERGE_CONFLICTS": "↑↑↑↑↑↑↑↑↑↑↑↑↑ Add your new strings above here ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑"
}
diff --git a/packages/app-store/CONTRIBUTING.md b/packages/app-store/CONTRIBUTING.md
index f3de617bc06..0dd1cb9409f 100644
--- a/packages/app-store/CONTRIBUTING.md
+++ b/packages/app-store/CONTRIBUTING.md
@@ -19,4 +19,4 @@
1. Add API documentation links in comments for files `api`, `lib` and `types`
2. Use [`AppDeclarativeHandler`](../types/AppHandler.d.ts) across all apps. Whatever isn't supported in it, support that.
3. README should be added in the respective app and can be linked in main README [like this](https://github.com/calcom/cal.com/pull/10429/files/155ac84537d12026f595551fe3542e810b029714#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5R509)
-4. Also, no env variables should be added by an app. They should be [added in `zod.ts`](https://github.com/calcom/cal.com/blob/main/packages/app-store/jitsivideo/zod.ts) and then they would be automatically available to be modified by the cal.com app admin.
\ No newline at end of file
+4. Also, no env variables should be added by an app. They should be [added in `zod.ts`](https://github.com/calcom/cal.com/blob/main/packages/app-store/jitsivideo/zod.ts) and then they would be automatically available to be modified by the cal.com app admin. In local development you can open /settings/admin with the admin credentials (see [seed.ts](packages/prisma/seed.ts))
\ No newline at end of file
diff --git a/packages/app-store/_components/AppCard.tsx b/packages/app-store/_components/AppCard.tsx
index 5489c1ea956..4e456369ff4 100644
--- a/packages/app-store/_components/AppCard.tsx
+++ b/packages/app-store/_components/AppCard.tsx
@@ -1,10 +1,12 @@
import { useAutoAnimate } from "@formkit/auto-animate/react";
import Link from "next/link";
+import { useTranslation } from "react-i18next";
import { useAppContextWithSchema } from "@calcom/app-store/EventTypeAppContext";
import { classNames } from "@calcom/lib";
import type { RouterOutputs } from "@calcom/trpc/react";
-import { Switch, Badge, Avatar } from "@calcom/ui";
+import { Switch, Badge, Avatar, Button } from "@calcom/ui";
+import { Settings } from "@calcom/ui/components/icon";
import type { CredentialOwner } from "../types";
import OmniInstallAppButton from "./OmniInstallAppButton";
@@ -27,6 +29,7 @@ export default function AppCard({
teamId?: number;
LockedIcon?: React.ReactNode;
}) {
+ const { t } = useTranslation();
const [animationRef] = useAutoAnimate<HTMLDivElement>();
const { setAppData, LockedIcon, disabled } = useAppContextWithSchema();
@@ -111,8 +114,23 @@ export default function AppCard({
</div>
<div ref={animationRef}>
{app?.isInstalled && switchChecked && <hr className="border-subtle" />}
+
{app?.isInstalled && switchChecked ? (
- <div className="p-4 pt-5 text-sm [&_input]:mb-0 [&_input]:leading-4">{children}</div>
+ app.isSetupAlready ? (
+ <div className="relative p-4 pt-5 text-sm [&_input]:mb-0 [&_input]:leading-4">
+ <Link href={`/apps/${app.slug}/setup`} className="absolute right-4 top-4">
+ <Settings className="text-default h-4 w-4" aria-hidden="true" />
+ </Link>
+ {children}
+ </div>
+ ) : (
+ <div className="flex h-64 w-full flex-col items-center justify-center gap-4 ">
+ <p>{t("this_app_is_not_setup_already")}</p>
+ <Link href={`/apps/${app.slug}/setup`}>
+ <Button StartIcon={Settings}>{t("setup")}</Button>
+ </Link>
+ </div>
+ )
) : null}
</div>
</div>
diff --git a/packages/app-store/_pages/setup/_getServerSideProps.tsx b/packages/app-store/_pages/setup/_getServerSideProps.tsx
new file mode 100644
index 00000000000..39b20bf3983
--- /dev/null
+++ b/packages/app-store/_pages/setup/_getServerSideProps.tsx
@@ -0,0 +1,23 @@
+import type { GetServerSidePropsContext } from "next";
+
+export const AppSetupPageMap = {
+ alby: import("../../alby/pages/setup/_getServerSideProps"),
+ make: import("../../make/pages/setup/_getServerSideProps"),
+ zapier: import("../../zapier/pages/setup/_getServerSideProps"),
+ stripe: import("../../stripepayment/pages/setup/_getServerSideProps"),
+};
+
+export const getServerSideProps = async (ctx: GetServerSidePropsContext) => {
+ const { slug } = ctx.params || {};
+ if (typeof slug !== "string") return { notFound: true } as const;
+
+ if (!(slug in AppSetupPageMap)) return { props: {} };
+
+ const page = await AppSetupPageMap[slug as keyof typeof AppSetupPageMap];
+
+ if (!page.getServerSideProps) return { props: {} };
+
+ const props = await page.getServerSideProps(ctx);
+
+ return props;
+};
diff --git a/packages/app-store/_pages/setup/_getStaticProps.tsx b/packages/app-store/_pages/setup/_getStaticProps.tsx
deleted file mode 100644
index 3a10131c9dd..00000000000
--- a/packages/app-store/_pages/setup/_getStaticProps.tsx
+++ /dev/null
@@ -1,21 +0,0 @@
-import type { GetStaticPropsContext } from "next";
-
-export const AppSetupPageMap = {
- zapier: import("../../zapier/pages/setup/_getStaticProps"),
- make: import("../../make/pages/setup/_getStaticProps"),
-};
-
-export const getStaticProps = async (ctx: GetStaticPropsContext) => {
- const { slug } = ctx.params || {};
- if (typeof slug !== "string") return { notFound: true } as const;
-
- if (!(slug in AppSetupPageMap)) return { props: {} };
-
- const page = await AppSetupPageMap[slug as keyof typeof AppSetupPageMap];
-
- if (!page.getStaticProps) return { props: {} };
-
- const props = await page.getStaticProps(ctx);
-
- return props;
-};
diff --git a/packages/app-store/_pages/setup/index.tsx b/packages/app-store/_pages/setup/index.tsx
index 6438b04a299..e9345f8c907 100644
--- a/packages/app-store/_pages/setup/index.tsx
+++ b/packages/app-store/_pages/setup/index.tsx
@@ -3,6 +3,7 @@ import dynamic from "next/dynamic";
import { DynamicComponent } from "../../_components/DynamicComponent";
export const AppSetupMap = {
+ alby: dynamic(() => import("../../alby/pages/setup")),
"apple-calendar": dynamic(() => import("../../applecalendar/pages/setup")),
exchange: dynamic(() => import("../../exchangecalendar/pages/setup")),
"exchange2013-calendar": dynamic(() => import("../../exchange2013calendar/pages/setup")),
@@ -12,6 +13,7 @@ export const AppSetupMap = {
make: dynamic(() => import("../../make/pages/setup")),
closecom: dynamic(() => import("../../closecom/pages/setup")),
sendgrid: dynamic(() => import("../../sendgrid/pages/setup")),
+ stripe: dynamic(() => import("../../stripepayment/pages/setup")),
paypal: dynamic(() => import("../../paypal/pages/setup")),
};
diff --git a/packages/app-store/alby/api/add.ts b/packages/app-store/alby/api/add.ts
index 6ab31065776..f0f47ff83bc 100644
--- a/packages/app-store/alby/api/add.ts
+++ b/packages/app-store/alby/api/add.ts
@@ -1,16 +1,42 @@
-import { createDefaultInstallation } from "@calcom/app-store/_utils/installation";
-import type { AppDeclarativeHandler } from "@calcom/types/AppHandler";
+import type { NextApiRequest, NextApiResponse } from "next";
-import appConfig from "../config.json";
+import prisma from "@calcom/prisma";
-const handler: AppDeclarativeHandler = {
- appType: appConfig.type,
- variant: appConfig.variant,
- slug: appConfig.slug,
- supportsMultipleInstalls: false,
- handlerType: "add",
- createCredential: ({ appType, user, slug, teamId }) =>
- createDefaultInstallation({ appType, userId: user.id, slug, key: {}, teamId }),
-};
+import config from "../config.json";
-export default handler;
+export default async function handler(req: NextApiRequest, res: NextApiResponse) {
+ if (!req.session?.user?.id) {
+ return res.status(401).json({ message: "You must be logged in to do this" });
+ }
+ const appType = config.type;
+ try {
+ const alreadyInstalled = await prisma.credential.findFirst({
+ where: {
+ type: appType,
+ userId: req.session.user.id,
+ },
+ });
+ if (alreadyInstalled) {
+ throw new Error("Already installed");
+ }
+ const installation = await prisma.credential.create({
+ data: {
+ type: appType,
+ key: {},
+ userId: req.session.user.id,
+ appId: "alby",
+ },
+ });
+
+ if (!installation) {
+ throw new Error("Unable to create user credential for Alby");
+ }
+ } catch (error: unknown) {
+ if (error instanceof Error) {
+ return res.status(500).json({ message: error.message });
+ }
+ return res.status(500);
+ }
+
+ return res.status(200).json({ url: "/apps/alby/setup" });
+}
diff --git a/packages/app-store/alby/api/index.ts b/packages/app-store/alby/api/index.ts
index 4c0d2ead01e..f29c527245d 100644
--- a/packages/app-store/alby/api/index.ts
+++ b/packages/app-store/alby/api/index.ts
@@ -1 +1,2 @@
export { default as add } from "./add";
+export { default as webhook, config } from "@calcom/web/pages/api/integrations/alby/webhook";
diff --git a/packages/app-store/alby/api/webhook.ts b/packages/app-store/alby/api/webhook.ts
new file mode 100644
index 00000000000..4910d7749c4
--- /dev/null
+++ b/packages/app-store/alby/api/webhook.ts
@@ -0,0 +1,125 @@
+import type { NextApiRequest, NextApiResponse } from "next";
+import getRawBody from "raw-body";
+import * as z from "zod";
+
+import { albyCredentialKeysSchema } from "@calcom/app-store/alby/lib";
+import parseInvoice from "@calcom/app-store/alby/lib/parseInvoice";
+import { IS_PRODUCTION } from "@calcom/lib/constants";
+import { getErrorFromUnknown } from "@calcom/lib/errors";
+import { HttpError as HttpCode } from "@calcom/lib/http-error";
+import { handlePaymentSuccess } from "@calcom/lib/payment/handlePaymentSuccess";
+import prisma from "@calcom/prisma";
+
+export const config = {
+ api: {
+ bodyParser: false,
+ },
+};
+
+export default async function handler(req: NextApiRequest, res: NextApiResponse) {
+ try {
+ if (req.method !== "POST") {
+ throw new HttpCode({ statusCode: 405, message: "Method Not Allowed" });
+ }
+
+ const bodyRaw = await getRawBody(req);
+ const headers = req.headers;
+ const bodyAsString = bodyRaw.toString();
+
+ const parseHeaders = webhookHeadersSchema.safeParse(headers);
+ if (!parseHeaders.success) {
+ console.error(parseHeaders.error);
+ throw new HttpCode({ statusCode: 400, message: "Bad Request" });
+ }
+
+ const { data: parsedHeaders } = parseHeaders;
+
+ const parse = eventSchema.safeParse(JSON.parse(bodyAsString));
+ if (!parse.success) {
+ console.error(parse.error);
+ throw new HttpCode({ statusCode: 400, message: "Bad Request" });
+ }
+
+ const { data: parsedPayload } = parse;
+
+ if (parsedPayload.metadata?.payer_data?.appId !== "cal.com") {
+ throw new HttpCode({ statusCode: 204, message: "Payment not for cal.com" });
+ }
+
+ const payment = await prisma.payment.findFirst({
+ where: {
+ uid: parsedPayload.metadata.payer_data.referenceId,
+ },
+ select: {
+ id: true,
+ amount: true,
+ bookingId: true,
+ booking: {
+ select: {
+ user: {
+ select: {
+ credentials: {
+ where: {
+ type: "alby_payment",
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ });
+
+ if (!payment) throw new HttpCode({ statusCode: 204, message: "Payment not found" });
+ const key = payment.booking?.user?.credentials?.[0].key;
+ if (!key) throw new HttpCode({ statusCode: 204, message: "Credentials not found" });
+
+ const parseCredentials = albyCredentialKeysSchema.safeParse(key);
+ if (!parseCredentials.success) {
+ console.error(parseCredentials.error);
+ throw new HttpCode({ statusCode: 500, message: "Credentials not valid" });
+ }
+
+ const credentials = parseCredentials.data;
+
+ const albyInvoice = await parseInvoice(bodyAsString, parsedHeaders, credentials.webhook_endpoint_secret);
+ if (!albyInvoice) throw new HttpCode({ statusCode: 204, message: "Invoice not found" });
+ if (albyInvoice.amount !== payment.amount) {
+ throw new HttpCode({ statusCode: 400, message: "invoice amount does not match payment amount" });
+ }
+
+ return await handlePaymentSuccess(payment.id, payment.bookingId);
+ } catch (_err) {
+ const err = getErrorFromUnknown(_err);
+ console.error(`Webhook Error: ${err.message}`);
+ return res.status(err.statusCode || 500).send({
+ message: err.message,
+ stack: IS_PRODUCTION ? undefined : err.stack,
+ });
+ }
+}
+
+const payerDataSchema = z
+ .object({
+ appId: z.string().optional(),
+ referenceId: z.string().optional(),
+ })
+ .optional();
+
+const metadataSchema = z
+ .object({
+ payer_data: payerDataSchema,
+ })
+ .optional();
+
+const eventSchema = z.object({
+ metadata: metadataSchema,
+});
+
+const webhookHeadersSchema = z
+ .object({
+ "svix-id": z.string(),
+ "svix-timestamp": z.string(),
+ "svix-signature": z.string(),
+ })
+ .passthrough();
diff --git a/packages/app-store/alby/components/AlbyPaymentComponent.tsx b/packages/app-store/alby/components/AlbyPaymentComponent.tsx
new file mode 100644
index 00000000000..7e25fb4469d
--- /dev/null
+++ b/packages/app-store/alby/components/AlbyPaymentComponent.tsx
@@ -0,0 +1,177 @@
+import Link from "next/link";
+import { useSearchParams } from "next/navigation";
+import { useEffect, useState } from "react";
+import QRCode from "react-qr-code";
+import z from "zod";
+
+import type { PaymentPageProps } from "@calcom/features/ee/payments/pages/payment";
+import { useBookingSuccessRedirect } from "@calcom/lib/bookingSuccessRedirect";
+import { useCopy } from "@calcom/lib/hooks/useCopy";
+import { useLocale } from "@calcom/lib/hooks/useLocale";
+import { trpc } from "@calcom/trpc";
+import { Button } from "@calcom/ui";
+import { showToast } from "@calcom/ui";
+import { ClipboardCheck, Clipboard } from "@calcom/ui/components/icon";
+import { Spinner } from "@calcom/ui/components/icon/Spinner";
+
+interface IAlbyPaymentComponentProps {
+ payment: {
+ // Will be parsed on render
+ data: unknown;
+ };
+ paymentPageProps: PaymentPageProps;
+}
+
+// Create zod schema for data
+const PaymentAlbyDataSchema = z.object({
+ invoice: z
+ .object({
+ paymentRequest: z.string(),
+ })
+ .required(),
+});
+
+export const AlbyPaymentComponent = (props: IAlbyPaymentComponentProps) => {
+ const { payment } = props;
+ const { data } = payment;
+ const [showQRCode, setShowQRCode] = useState(window.webln === undefined);
+ const [isPaying, setPaying] = useState(false);
+ const { copyToClipboard, isCopied } = useCopy();
+ const wrongUrl = (
+ <>
+ <p className="mt-3 text-center">Couldn&apos;t obtain payment URL</p>
+ </>
+ );
+
+ const parsedData = PaymentAlbyDataSchema.safeParse(data);
+ if (!parsedData.success || !parsedData.data?.invoice?.paymentRequest) {
+ return wrongUrl;
+ }
+ const paymentRequest = parsedData.data.invoice.paymentRequest;
+
+ return (
+ <div className="mb-4 mt-8 flex h-full w-full flex-col items-center justify-center gap-4">
+ <PaymentChecker {...props.paymentPageProps} />
+ {isPaying && <Spinner className="mt-12 h-8 w-8" />}
+ {!isPaying && (
+ <>
+ {!showQRCode && (
+ <div className="flex gap-4">
+ <Button color="secondary" onClick={() => setShowQRCode(true)}>
+ Show QR
+ </Button>
+ {window.webln && (
+ <Button
+ onClick={async () => {
+ try {
+ if (!window.webln) {
+ throw new Error("webln not found");
+ }
+ setPaying(true);
+ await window.webln.enable();
+ window.webln.sendPayment(paymentRequest);
+ } catch (error) {
+ setPaying(false);
+ alert((error as Error).message);
+ }
+ }}>
+ Pay Now
+ </Button>
+ )}
+ </div>
+ )}
+ {showQRCode && (
+ <>
+ <div className="flex items-center justify-center gap-2">
+ <p className="text-xs">Waiting for payment...</p>
+ <Spinner className="h-4 w-4" />
+ </div>
+ <p className="text-sm">Click or scan the invoice below to pay</p>
+ <Link
+ href={`lightning:${paymentRequest}`}
+ className="inline-flex items-center justify-center rounded-2xl rounded-md border border-transparent p-2
+ font-medium text-black shadow-sm hover:brightness-95 focus:outline-none focus:ring-offset-2">
+ <QRCode size={128} value={paymentRequest} />
+ </Link>
+
+ <Button
+ size="sm"
+ color="secondary"
+ onClick={() => copyToClipboard(paymentRequest)}
+ className="text-subtle rounded-md"
+ StartIcon={isCopied ? ClipboardCheck : Clipboard}>
+ Copy Invoice
+ </Button>
+ <Link target="_blank" href="https://getalby.com" className="link mt-4 text-sm underline">
+ Don&apos;t have a lightning wallet?
+ </Link>
+ </>
+ )}
+ </>
+ )}
+ <Link target="_blank" href="https://getalby.com">
+ <div className="mt-4 flex items-center text-sm">
+ Powered by
+ <img title="Alby" src="/app-store/alby/icon.svg" alt="Alby" className="h-8 w-8" />
+ Alby
+ </div>
+ </Link>
+ </div>
+ );
+};
+
+type PaymentCheckerProps = PaymentPageProps;
+
+function PaymentChecker(props: PaymentCheckerProps) {
+ // TODO: move booking success code to a common lib function
+ // TODO: subscribe rather than polling
+ const searchParams = useSearchParams();
+ const bookingSuccessRedirect = useBookingSuccessRedirect();
+ const utils = trpc.useContext();
+ const { t } = useLocale();
+ useEffect(() => {
+ const interval = setInterval(() => {
+ (async () => {
+ if (props.booking.status === "ACCEPTED") {
+ return;
+ }
+ const { booking: bookingResult } = await utils.viewer.bookings.find.fetch({
+ bookingUid: props.booking.uid,
+ });
+
+ if (bookingResult?.paid) {
+ showToast("Payment successful", "success");
+
+ const params: {
+ uid: string;
+ email: string | null;
+ location: string;
+ } = {
+ uid: props.booking.uid,
+ email: searchParams.get("email"),
+ location: t("web_conferencing_details_to_follow"),
+ };
+
+ bookingSuccessRedirect({
+ successRedirectUrl: props.eventType.successRedirectUrl,
+ query: params,
+ booking: props.booking,
+ });
+ }
+ })();
+ }, 1000);
+ return () => clearInterval(interval);
+ }, [
+ bookingSuccessRedirect,
+ props.booking,
+ props.booking.id,
+ props.booking.status,
+ props.eventType.id,
+ props.eventType.successRedirectUrl,
+ props.payment.success,
+ searchParams,
+ t,
+ utils.viewer.bookings,
+ ]);
+ return null;
+}
diff --git a/packages/app-store/alby/components/AlbyPriceComponent.tsx b/packages/app-store/alby/components/AlbyPriceComponent.tsx
new file mode 100644
index 00000000000..d9e1d1081c2
--- /dev/null
+++ b/packages/app-store/alby/components/AlbyPriceComponent.tsx
@@ -0,0 +1,30 @@
+import { fiat } from "@getalby/lightning-tools";
+import React from "react";
+
+import { Tooltip } from "@calcom/ui";
+import { SatSymbol } from "@calcom/ui/components/icon/SatSymbol";
+
+type AlbyPriceComponentProps = {
+ displaySymbol: boolean;
+ price: number;
+ formattedPrice: string;
+};
+
+export function AlbyPriceComponent({ displaySymbol, price, formattedPrice }: AlbyPriceComponentProps) {
+ const [fiatValue, setFiatValue] = React.useState<string>("loading...");
+ React.useEffect(() => {
+ (async () => {
+ const unformattedFiatValue = await fiat.getFiatValue({ satoshi: price, currency: "USD" });
+ setFiatValue(`$${unformattedFiatValue.toFixed(2)}`);
+ })();
+ }, [price]);
+
+ return (
+ <Tooltip content={fiatValue}>
+ <div className="inline-flex items-center justify-center">
+ {displaySymbol && <SatSymbol className="h-4 w-4" />}
+ {formattedPrice}
+ </div>
+ </Tooltip>
+ );
+}
diff --git a/packages/app-store/alby/components/EventTypeAppCardInterface.tsx b/packages/app-store/alby/components/EventTypeAppCardInterface.tsx
new file mode 100644
index 00000000000..0eb71ba136b
--- /dev/null
+++ b/packages/app-store/alby/components/EventTypeAppCardInterface.tsx
@@ -0,0 +1,127 @@
+import { useRouter } from "next/router";
+import { useState, useEffect } from "react";
+
+import { useAppContextWithSchema } from "@calcom/app-store/EventTypeAppContext";
+import AppCard from "@calcom/app-store/_components/AppCard";
+import { currencyOptions } from "@calcom/app-store/alby/lib/currencyOptions";
+import type { EventTypeAppCardComponent } from "@calcom/app-store/types";
+import { WEBAPP_URL } from "@calcom/lib/constants";
+import { useLocale } from "@calcom/lib/hooks/useLocale";
+import { Alert, Select, TextField } from "@calcom/ui";
+import { SatSymbol } from "@calcom/ui/components/icon/SatSymbol";
+
+import type { appDataSchema } from "../zod";
+import { PaypalPaymentOptions as paymentOptions } from "../zod";
+
+type Option = { value: string; label: string };
+
+const EventTypeAppCard: EventTypeAppCardComponent = function EventTypeAppCard({ app, eventType }) {
+ const { asPath } = useRouter();
+ const { getAppData, setAppData } = useAppContextWithSchema<typeof appDataSchema>();
+ const price = getAppData("price");
+ const currency = getAppData("currency");
+ const [selectedCurrency, setSelectedCurrency] = useState(
+ currencyOptions.find((c) => c.value === currency) || currencyOptions[0]
+ );
+ const paymentOption = getAppData("paymentOption");
+ const paymentOptionSelectValue = paymentOptions?.find((option) => paymentOption === option.value) || {
+ label: paymentOptions[0].label,
+ value: paymentOptions[0].value,
+ };
+ const seatsEnabled = !!eventType.seatsPerTimeSlot;
+ const [requirePayment, setRequirePayment] = useState(getAppData("enabled"));
+ const { t } = useLocale();
+ const recurringEventDefined = eventType.recurringEvent?.count !== undefined;
+
+ // make sure a currency is selected
+ useEffect(() => {
+ if (!currency && requirePayment) {
+ setAppData("currency", selectedCurrency.value);
+ }
+ }, [currency, selectedCurrency, setAppData, requirePayment]);
+
+ return (
+ <AppCard
+ returnTo={WEBAPP_URL + asPath}
+ app={app}
+ switchChecked={requirePayment}
+ switchOnClick={(enabled) => {
+ setRequirePayment(enabled);
+ }}
+ description={<>Add bitcoin lightning payments to your events</>}>
+ <>
+ {recurringEventDefined ? (
+ <Alert className="mt-2" severity="warning" title={t("warning_recurring_event_payment")} />
+ ) : (
+ requirePayment && (
+ <>
+ <div className="mt-2 block items-center sm:flex">
+ <TextField
+ label="Price"
+ labelSrOnly
+ addOnLeading={<SatSymbol className="h-4 w-4" />}
+ addOnSuffix={selectedCurrency.unit || selectedCurrency.value}
+ type="number"
+ required
+ className="block w-full rounded-sm border-gray-300 pl-2 pr-12 text-sm"
+ placeholder="Price"
+ onChange={(e) => {
+ setAppData("price", Number(e.target.value));
+ if (currency) {
+ setAppData("currency", currency);
+ }
+ }}
+ value={price && price > 0 ? price : undefined}
+ />
+ </div>
+ <div className="mt-5 w-60">
+ <label className="text-default block text-sm font-medium" htmlFor="currency">
+ {t("currency")}
+ </label>
+ <Select
+ variant="default"
+ options={currencyOptions}
+ value={selectedCurrency}
+ className="text-black"
+ defaultValue={selectedCurrency}
+ onChange={(e) => {
+ if (e) {
+ setSelectedCurrency(e);
+ setAppData("currency", e.value);
+ }
+ }}
+ />
+ </div>
+
+ <div className="mt-2 w-60">
+ <label className="text-default block text-sm font-medium" htmlFor="currency">
+ Payment option
+ </label>
+ <Select<Option>
+ defaultValue={
+ paymentOptionSelectValue
+ ? { ...paymentOptionSelectValue, label: t(paymentOptionSelectValue.label) }
+ : { ...paymentOptions[0], label: t(paymentOptions[0].label) }
+ }
+ options={paymentOptions.map((option) => {
+ return { ...option, label: t(option.label) || option.label };
+ })}
+ onChange={(input) => {
+ if (input) setAppData("paymentOption", input.value);
+ }}
+ className="mb-1 h-[38px] w-full"
+ isDisabled={seatsEnabled}
+ />
+ </div>
+ {seatsEnabled && paymentOption === "HOLD" && (
+ <Alert className="mt-2" severity="warning" title={t("seats_and_no_show_fee_error")} />
+ )}
+ </>
+ )
+ )}
+ </>
+ </AppCard>
+ );
+};
+
+export default EventTypeAppCard;
diff --git a/packages/app-store/alby/config.json b/packages/app-store/alby/config.json
index 800fd462780..632ef314471 100644
--- a/packages/app-store/alby/config.json
+++ b/packages/app-store/alby/config.json
@@ -4,14 +4,15 @@
"slug": "alby",
"type": "alby_payment",
"logo": "icon.svg",
- "url": "https://example.com/link",
+ "url": "https://getalby.com",
"variant": "payment",
"categories": ["payment"],
"publisher": "Alby",
"email": "[email protected]",
"description": "Your Bitcoin & Nostr companion for the web. Use Alby to charge Satoshi for your Cal.com meetings.\r",
+ "extendsFeature": "EventType",
"isTemplate": false,
"__createdUsingCli": true,
- "__template": "basic",
+ "__template": "event-type-app-card",
"dirName": "alby"
}
diff --git a/packages/app-store/alby/index.ts b/packages/app-store/alby/index.ts
index d7f36022040..e2e9d7b029c 100644
--- a/packages/app-store/alby/index.ts
+++ b/packages/app-store/alby/index.ts
@@ -1 +1,2 @@
export * as api from "./api";
+export * as lib from "./lib";
diff --git a/packages/app-store/alby/lib/PaymentService.ts b/packages/app-store/alby/lib/PaymentService.ts
new file mode 100644
index 00000000000..f008063bd61
--- /dev/null
+++ b/packages/app-store/alby/lib/PaymentService.ts
@@ -0,0 +1,133 @@
+import { LightningAddress } from "@getalby/lightning-tools";
+import type { Booking, Payment, PaymentOption, Prisma } from "@prisma/client";
+import { v4 as uuidv4 } from "uuid";
+import type z from "zod";
+
+import prisma from "@calcom/prisma";
+import type { CalendarEvent } from "@calcom/types/Calendar";
+import type { IAbstractPaymentService } from "@calcom/types/PaymentService";
+
+import { albyCredentialKeysSchema } from "./albyCredentialKeysSchema";
+
+export class PaymentService implements IAbstractPaymentService {
+ private credentials: z.infer<typeof albyCredentialKeysSchema> | null;
+
+ constructor(credentials: { key: Prisma.JsonValue }) {
+ const keyParsing = albyCredentialKeysSchema.safeParse(credentials.key);
+ if (keyParsing.success) {
+ this.credentials = keyParsing.data;
+ } else {
+ this.credentials = null;
+ }
+ }
+
+ async create(
+ payment: Pick<Prisma.PaymentUncheckedCreateInput, "amount" | "currency">,
+ bookingId: Booking["id"]
+ ) {
+ try {
+ const booking = await prisma.booking.findFirst({
+ select: {
+ uid: true,
+ title: true,
+ },
+ where: {
+ id: bookingId,
+ },
+ });
+ if (!booking || !this.credentials?.account_lightning_address) {
+ throw new Error();
+ }
+
+ const uid = uuidv4();
+
+ const lightningAddress = new LightningAddress(this.credentials.account_lightning_address);
+ await lightningAddress.fetch();
+ const invoice = await lightningAddress.requestInvoice({
+ satoshi: payment.amount,
+ payerdata: {
+ appId: "cal.com",
+ referenceId: uid,
+ },
+ });
+ console.log("Created invoice", invoice, uid);
+
+ const paymentData = await prisma.payment.create({
+ data: {
+ uid,
+ app: {
+ connect: {
+ slug: "alby",
+ },
+ },
+ booking: {
+ connect: {
+ id: bookingId,
+ },
+ },
+ amount: payment.amount,
+ externalId: invoice.paymentRequest,
+ currency: payment.currency,
+ data: Object.assign({}, { invoice }) as unknown as Prisma.InputJsonValue,
+ fee: 0,
+ refunded: false,
+ success: false,
+ },
+ });
+
+ if (!paymentData) {
+ throw new Error();
+ }
+ return paymentData;
+ } catch (error) {
+ console.error(error);
+ throw new Error("Payment could not be created");
+ }
+ }
+ async update(): Promise<Payment> {
+ throw new Error("Method not implemented.");
+ }
+ async refund(): Promise<Payment> {
+ throw new Error("Method not implemented.");
+ }
+
+ async collectCard(
+ _payment: Pick<Prisma.PaymentUncheckedCreateInput, "amount" | "currency">,
+ _bookingId: number,
+ _bookerEmail: string,
+ _paymentOption: PaymentOption
+ ): Promise<Payment> {
+ throw new Error("Method not implemented");
+ }
+ chargeCard(
+ _payment: Pick<Prisma.PaymentUncheckedCreateInput, "amount" | "currency">,
+ _bookingId: number
+ ): Promise<Payment> {
+ throw new Error("Method not implemented.");
+ }
+ getPaymentPaidStatus(): Promise<string> {
+ throw new Error("Method not implemented.");
+ }
+ getPaymentDetails(): Promise<Payment> {
+ throw new Error("Method not implemented.");
+ }
+ afterPayment(
+ _event: CalendarEvent,
+ _booking: {
+ user: { email: string | null; name: string | null; timeZone: string } | null;
+ id: number;
+ startTime: { toISOString: () => string };
+ uid: string;
+ },
+ _paymentData: Payment
+ ): Promise<void> {
+ return Promise.resolve();
+ }
+ deletePayment(_paymentId: number): Promise<boolean> {
+ return Promise.resolve(false);
+ }
+
+ isSetupAlready(): boolean {
+ return !!this.credentials;
+ }
+}
diff --git a/packages/app-store/alby/lib/albyCredentialKeysSchema.ts b/packages/app-store/alby/lib/albyCredentialKeysSchema.ts
new file mode 100644
index 00000000000..58dbb757783
--- /dev/null
+++ b/packages/app-store/alby/lib/albyCredentialKeysSchema.ts
@@ -0,0 +1,9 @@
+import z from "zod";
+
+export const albyCredentialKeysSchema = z.object({
+ account_id: z.string(),
+ account_email: z.string(),
+ account_lightning_address: z.string(),
+ webhook_endpoint_id: z.string(),
+ webhook_endpoint_secret: z.string(),
+});
diff --git a/packages/app-store/alby/lib/currencyOptions.ts b/packages/app-store/alby/lib/currencyOptions.ts
new file mode 100644
index 00000000000..d6d8e472a10
--- /dev/null
+++ b/packages/app-store/alby/lib/currencyOptions.ts
@@ -0,0 +1 @@
+export const currencyOptions = [{ label: "BTC", value: "BTC", unit: "sats" }];
diff --git a/packages/app-store/alby/lib/getAlbyKeys.ts b/packages/app-store/alby/lib/getAlbyKeys.ts
new file mode 100644
index 00000000000..94293f77970
--- /dev/null
+++ b/packages/app-store/alby/lib/getAlbyKeys.ts
@@ -0,0 +1,13 @@
+import { z } from "zod";
+
+import getAppKeysFromSlug from "../../_utils/getAppKeysFromSlug";
+
+export const getAlbyKeys = async () => {
+ const appKeys = await getAppKeysFromSlug("alby");
+ return appKeysSchema.parse(appKeys);
+};
+
+const appKeysSchema = z.object({
+ client_id: z.string().min(1),
+ client_secret: z.string().min(1),
+});
diff --git a/packages/app-store/alby/lib/index.ts b/packages/app-store/alby/lib/index.ts
new file mode 100644
index 00000000000..ec09472f512
--- /dev/null
+++ b/packages/app-store/alby/lib/index.ts
@@ -0,0 +1,6 @@
+import type { Invoice as AlbyInvoice } from "@getalby/sdk/dist/types";
+
+export * from "./PaymentService";
+export * from "./albyCredentialKeysSchema";
+
+export type { AlbyInvoice };
diff --git a/packages/app-store/alby/lib/parseInvoice.ts b/packages/app-store/alby/lib/parseInvoice.ts
new file mode 100644
index 00000000000..338b85f5d6b
--- /dev/null
+++ b/packages/app-store/alby/lib/parseInvoice.ts
@@ -0,0 +1,22 @@
+import type { Invoice } from "@getalby/sdk/dist/types";
+import { Webhook } from "svix";
+
+export default function parseInvoice(
+ body: string,
+ headers: {
+ "svix-id": string;
+ "svix-timestamp": string;
+ "svix-signature": string;
+ },
+ webhookEndpointSecret: string
+): Invoice | null {
+ try {
+ const wh = new Webhook(webhookEndpointSecret);
+ return wh.verify(body, headers) as Invoice;
+ } catch (err) {
+ // Looks like alby might sent multiple webhooks for the same invoice but it should only work once
+ // TODO: remove the Alby webhook when uninstalling the Alby app
+ console.error(err);
+ }
+ return null;
+}
diff --git a/packages/app-store/alby/package.json b/packages/app-store/alby/package.json
index 2c6d62a181b..2a5cf43282f 100644
--- a/packages/app-store/alby/package.json
+++ b/packages/app-store/alby/package.json
@@ -5,7 +5,12 @@
"version": "0.0.0",
"main": "./index.ts",
"dependencies": {
- "@calcom/lib": "*"
+ "@calcom/lib": "*",
+ "@getalby/lightning-tools": "^4.0.2",
+ "@getalby/sdk": "^2.4.0",
+ "@webbtc/webln-types": "^2.0.1",
+ "react-qr-code": "^2.0.12",
+ "svix": "^0.85.1"
},
"devDependencies": {
"@calcom/types": "*"
diff --git a/packages/app-store/alby/pages/setup/_getServerSideProps.tsx b/packages/app-store/alby/pages/setup/_getServerSideProps.tsx
new file mode 100644
index 00000000000..ad59c11be3f
--- /dev/null
+++ b/packages/app-store/alby/pages/setup/_getServerSideProps.tsx
@@ -0,0 +1,49 @@
+import type { GetServerSidePropsContext } from "next";
+
+import { getServerSession } from "@calcom/features/auth/lib/getServerSession";
+
+import { getAlbyKeys } from "../../lib/getAlbyKeys";
+import type { IAlbySetupProps } from "./index";
+
+export const getServerSideProps = async (ctx: GetServerSidePropsContext) => {
+ if (typeof ctx.params?.slug !== "string") return { notFound: true } as const;
+
+ const { req, res } = ctx;
+ const session = await getServerSession({ req, res });
+
+ if (!session?.user?.id) {
+ return res.writeHead(401).end();
+ }
+
+ const credentials = await prisma.credential.findFirst({
+ where: {
+ type: "alby_payment",
+ userId: session.user.id,
+ },
+ });
+
+ const { client_id: clientId, client_secret: clientSecret } = await getAlbyKeys();
+
+ const props: IAlbySetupProps = {
+ email: null,
+ lightningAddress: null,
+ clientId,
+ clientSecret,
+ };
+ if (credentials?.key) {
+ const { account_lightning_address, account_email } = credentials.key as {
+ account_lightning_address?: string;
+ account_email?: string;
+ };
+ if (account_lightning_address) {
+ props.lightningAddress = account_lightning_address;
+ }
+ if (account_email) {
+ props.email = account_email;
+ }
+ }
+
+ return {
+ props,
+ };
+};
diff --git a/packages/app-store/alby/pages/setup/index.tsx b/packages/app-store/alby/pages/setup/index.tsx
new file mode 100644
index 00000000000..b87e40875d1
--- /dev/null
+++ b/packages/app-store/alby/pages/setup/index.tsx
@@ -0,0 +1,178 @@
+import { auth, Client, webln } from "@getalby/sdk";
+import Link from "next/link";
+import { useRouter } from "next/navigation";
+import { useSearchParams } from "next/navigation";
+import { useState, useCallback, useEffect } from "react";
+import { Toaster } from "react-hot-toast";
+
+import { useLocale } from "@calcom/lib/hooks/useLocale";
+import { trpc } from "@calcom/trpc";
+import { Badge, Button, showToast } from "@calcom/ui";
+import { Info } from "@calcom/ui/components/icon";
+
+import { albyCredentialKeysSchema } from "../../lib/albyCredentialKeysSchema";
+
+export interface IAlbySetupProps {
+ email: string | null;
+ lightningAddress: string | null;
+ clientId: string;
+ clientSecret: string;
+}
+
+export default function AlbySetup(props: IAlbySetupProps) {
+ const params = useSearchParams();
+ if (params?.get("callback") === "true") {
+ return <AlbySetupCallback />;
+ }
+
+ return <AlbySetupPage {...props} />;
+}
+
+function AlbySetupCallback() {
+ const [error, setError] = useState<string | null>(null);
+ const params = useSearchParams();
+ useEffect(() => {
+ if (!window.opener) {
+ setError("Something went wrong. Opener not available. Please contact [email protected]");
+ return;
+ }
+
+ const code = params.get("code");
+ const error = params.get("error");
+
+ if (!code) {
+ setError("declined");
+ }
+ if (error) {
+ setError(error);
+ alert(error);
+ return;
+ }
+
+ window.opener.postMessage({
+ type: "alby:oauth:success",
+ payload: { code },
+ });
+ window.close();
+ }, []);
+
+ return (
+ <div>
+ {error && <p>Authorization failed: {error}</p>}
+ {!error && <p>Connecting...</p>}
+ </div>
+ );
+}
+
+function AlbySetupPage(props: IAlbySetupProps) {
+ const router = useRouter();
+ const { t } = useLocale();
+ const integrations = trpc.viewer.integrations.useQuery({ variant: "payment", appId: "alby" });
+ const [albyPaymentAppCredentials] = integrations.data?.items || [];
+ const [credentialId] = albyPaymentAppCredentials?.userCredentialIds || [-1];
+ const showContent = !!integrations.data && integrations.isSuccess && !!credentialId;
+ const saveKeysMutation = trpc.viewer.appsRouter.updateAppCredentials.useMutation({
+ onSuccess: () => {
+ showToast(t("keys_have_been_saved"), "success");
+ router.push("/event-types");
+ },
+ onError: (error) => {
+ showToast(error.message, "error");
+ },
+ });
+
+ const connectWithAlby = useCallback(async () => {
+ const authClient = new auth.OAuth2User({
+ client_id: props.clientId,
+ client_secret: props.clientSecret,
+ callback: `${process.env.NEXT_PUBLIC_WEBAPP_URL}/apps/alby/setup?callback=true`,
+ scopes: ["invoices:read", "account:read"],
+ user_agent: "cal.com",
+ });
+
+ const weblnOAuthProvider = new webln.OauthWeblnProvider({
+ auth: authClient,
+ });
+ await weblnOAuthProvider.enable();
+
+ const client = new Client(authClient);
+ const accountInfo = await client.accountInformation({});
+ // TODO: add a way to delete the endpoint when the app is uninstalled
+ const webhookEndpoint = await client.createWebhookEndpoint({
+ filter_types: ["invoice.incoming.settled"],
+ url: `${process.env.NEXT_PUBLIC_WEBAPP_URL}/api/integrations/alby/webhook`,
+ description: "Cal.com",
+ });
+
+ saveKeysMutation.mutate({
+ credentialId,
+ key: albyCredentialKeysSchema.parse({
+ account_id: accountInfo.identifier,
+ account_email: accountInfo.email,
+ account_lightning_address: accountInfo.lightning_address,
+ webhook_endpoint_id: webhookEndpoint.id,
+ webhook_endpoint_secret: webhookEndpoint.endpoint_secret,
+ }),
+ });
+ }, [credentialId, props.clientId, props.clientSecret, saveKeysMutation]);
+
+ if (integrations.isLoading) {
+ return <div className="absolute z-50 flex h-screen w-full items-center bg-gray-200" />;
+ }
+
+ return (
+ <div className="bg-default flex h-screen">
+ {showContent ? (
+ <div className="flex w-full items-center justify-center p-4">
+ <div className="bg-default border-subtle m-auto flex max-w-[43em] flex-col items-center justify-center gap-4 overflow-auto rounded border p-4 md:p-10">
+ {!props.lightningAddress ? (
+ <>
+ <p className="text-default">
+ Create or connect to an existing Alby account to receive lightning payments for your paid
+ bookings.
+ </p>
+ <button
+ className="font-body flex h-10 w-56 items-center justify-center gap-2 rounded-md font-bold text-black shadow transition-all hover:brightness-90 active:scale-95"
+ style={{
+ background: "linear-gradient(180deg, #FFDE6E 63.72%, #F8C455 95.24%)",
+ }}
+ type="button"
+ onClick={connectWithAlby}>
+ <img className="h-8 w-8" src="/api/app-store/alby/icon2.svg" alt="Alby Logo" />
+ <span className="mr-2">Connect with Alby</span>
+ </button>
+ </>
+ ) : (
+ <>
+ <img className="h-16 w-16" src="/api/app-store/alby/icon2.svg" alt="Alby Logo" />
+ <p>Alby Connected!</p>
+ <Badge>Email: {props.email}</Badge>
+ <Badge>Lightning Address: {props.lightningAddress}</Badge>
+ </>
+ )}
+
+ {/* TODO: remove when invoices are generated using user identifier */}
+ <div className="mt-4 rounded bg-blue-50 p-3 text-sm text-blue-700">
+ <Info className="mb-0.5 inline-flex h-4 w-4" /> Your Alby lightning address will be used to
+ generate invoices. If you update your lightning address, please disconnect and setup the Alby
+ app again.
+ </div>
+ <Link href="/apps/alby">
+ <Button color="secondary">Go to App Store Listing</Button>
+ </Link>
+ </div>
+ </div>
+ ) : (
+ <div className="ml-5 mt-5">
+ <div>Alby</div>
+ <div className="mt-3">
+ <Link href="/apps/alby" passHref={true} legacyBehavior>
+ <Button>{t("go_to_app_store")}</Button>
+ </Link>
+ </div>
+ </div>
+ )}
+ <Toaster position="bottom-right" />
+ </div>
+ );
+}
diff --git a/packages/app-store/alby/static/icon2.svg b/packages/app-store/alby/static/icon2.svg
new file mode 100644
index 00000000000..eb0840bfe5a
--- /dev/null
+++ b/packages/app-store/alby/static/icon2.svg
@@ -0,0 +1,11 @@
+<svg width="554" height="554" viewBox="0 0 554 554" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M127.7 202.4C107.431 202.4 90.9999 185.969 90.9999 165.7C90.9999 145.431 107.431 129 127.7 129C147.969 129 164.4 145.431 164.4 165.7C164.4 185.969 147.969 202.4 127.7 202.4Z" fill="black"/>
+<path d="M121.6 160.2L190.1 228.7" stroke="black" stroke-width="18.3"/>
+<path d="M427.2 202.4C447.469 202.4 463.9 185.969 463.9 165.7C463.9 145.431 447.469 129 427.2 129C406.931 129 390.5 145.431 390.5 165.7C390.5 185.969 406.931 202.4 427.2 202.4Z" fill="black"/>
+<path d="M434 160.2L365.5 228.7" stroke="black" stroke-width="18.3"/>
+<path fill-rule="evenodd" clip-rule="evenodd" d="M138.1 384.6C128.451 380.122 120.543 372.597 115.592 363.182C110.641 353.768 108.922 342.987 110.7 332.5C127.3 240 196.2 170.6 278.7 170.6C361.4 170.6 430.5 240.3 446.8 333.2C448.539 343.695 446.779 354.47 441.792 363.867C436.805 373.263 428.866 380.759 419.2 385.2C375.441 405.799 327.664 416.454 279.3 416.4C228.8 416.4 180.9 405 138.1 384.6Z" fill="#FFDF6F"/>
+<path d="M119.8 334.2C135.8 244.7 201.8 179.8 278.8 179.8V161.5C190.6 161.5 118.8 235.3 101.7 330.9L119.7 334.1L119.8 334.2ZM278.8 179.8C355.8 179.8 422 245.1 437.8 334.8L455.8 331.6C439 235.6 367 161.5 278.8 161.5V179.8ZM415.3 376.9C372.76 396.917 326.314 407.265 279.3 407.2V425.5C330.7 425.5 379.4 414 423.1 393.5L415.3 376.9ZM279.3 407.2C230.2 407.2 183.7 396.1 142.1 376.3L134.2 392.9C178.2 413.9 227.4 425.5 279.3 425.5V407.2ZM437.8 334.8C440.8 352.1 431.6 369.3 415.3 376.9L423.1 393.5C446.5 382.5 460.4 357.5 455.8 331.5L437.8 334.8ZM101.7 330.8C99.5558 343.269 101.577 356.098 107.451 367.303C113.325 378.509 122.725 387.47 134.2 392.8L142.1 376.3C134.267 372.688 127.84 366.599 123.81 358.973C119.78 351.347 118.371 342.606 119.8 334.1L101.6 330.9L101.7 330.8Z" fill="black"/>
+<path fill-rule="evenodd" clip-rule="evenodd" d="M173.4 361.6C157.5 355.1 148.1 338.2 153.6 321.9C170.6 271.7 220.2 235.4 278.7 235.4C337.2 235.4 386.8 271.7 403.8 321.9C409.4 338.2 399.9 355.1 384 361.6C350.559 375.19 314.796 382.153 278.7 382.1C241.5 382.1 205.9 374.8 173.4 361.6Z" fill="black"/>
+<path d="M320.9 338.1C337.8 338.1 351.5 327.176 351.5 313.7C351.5 300.224 337.8 289.3 320.9 289.3C304 289.3 290.3 300.224 290.3 313.7C290.3 327.176 304 338.1 320.9 338.1Z" fill="white"/>
+<path d="M233.4 338.1C250.3 338.1 264 327.176 264 313.7C264 300.224 250.3 289.3 233.4 289.3C216.5 289.3 202.8 300.224 202.8 313.7C202.8 327.176 216.5 338.1 233.4 338.1Z" fill="white"/>
+</svg>
diff --git a/packages/app-store/alby/zod.ts b/packages/app-store/alby/zod.ts
new file mode 100644
index 00000000000..0983fe0ce79
--- /dev/null
+++ b/packages/app-store/alby/zod.ts
@@ -0,0 +1,37 @@
+import { z } from "zod";
+
+import { eventTypeAppCardZod } from "@calcom/app-store/eventTypeAppCardZod";
+
+const paymentOptionSchema = z.object({
+ label: z.string(),
+ value: z.string(),
+});
+
+export const paymentOptionsSchema = z.array(paymentOptionSchema);
+
+export const PaypalPaymentOptions = [
+ {
+ label: "on_booking_option",
+ value: "ON_BOOKING",
+ },
+];
+
+type PaymentOption = (typeof PaypalPaymentOptions)[number]["value"];
+const VALUES: [PaymentOption, ...PaymentOption[]] = [
+ PaypalPaymentOptions[0].value,
+ ...PaypalPaymentOptions.slice(1).map((option) => option.value),
+];
+export const paymentOptionEnum = z.enum(VALUES);
+
+export const appDataSchema = eventTypeAppCardZod.merge(
+ z.object({
+ price: z.number(),
+ currency: z.string(),
+ paymentOption: z.string().optional(),
+ enabled: z.boolean().optional(),
+ })
+);
+export const appKeysSchema = z.object({
+ client_id: z.string(),
+ client_secret: z.string(),
+});
diff --git a/packages/app-store/apps.browser.generated.tsx b/packages/app-store/apps.browser.generated.tsx
index eb4c2aee20a..e8d108c2579 100644
--- a/packages/app-store/apps.browser.generated.tsx
+++ b/packages/app-store/apps.browser.generated.tsx
@@ -20,6 +20,7 @@ export const AppSettingsComponentsMap = {
zapier: dynamic(() => import("./zapier/components/AppSettingsInterface")),
};
export const EventTypeAddonMap = {
+ alby: dynamic(() => import("./alby/components/EventTypeAppCardInterface")),
basecamp3: dynamic(() => import("./basecamp3/components/EventTypeAppCardInterface")),
fathom: dynamic(() => import("./fathom/components/EventTypeAppCardInterface")),
ga4: dynamic(() => import("./ga4/components/EventTypeAppCardInterface")),
diff --git a/packages/app-store/apps.keys-schemas.generated.ts b/packages/app-store/apps.keys-schemas.generated.ts
index 8d889090f08..b9b37cb2fef 100644
--- a/packages/app-store/apps.keys-schemas.generated.ts
+++ b/packages/app-store/apps.keys-schemas.generated.ts
@@ -2,6 +2,7 @@
This file is autogenerated using the command `yarn app-store:build --watch`.
Don't modify this file manually.
**/
+import { appKeysSchema as alby_zod_ts } from "./alby/zod";
import { appKeysSchema as basecamp3_zod_ts } from "./basecamp3/zod";
import { appKeysSchema as dailyvideo_zod_ts } from "./dailyvideo/zod";
import { appKeysSchema as fathom_zod_ts } from "./fathom/zod";
@@ -35,6 +36,7 @@ import { appKeysSchema as zohocrm_zod_ts } from "./zohocrm/zod";
import { appKeysSchema as zoomvideo_zod_ts } from "./zoomvideo/zod";
export const appKeysSchemas = {
+ alby: alby_zod_ts,
basecamp3: basecamp3_zod_ts,
dailyvideo: dailyvideo_zod_ts,
fathom: fathom_zod_ts,
diff --git a/packages/app-store/apps.schemas.generated.ts b/packages/app-store/apps.schemas.generated.ts
index d4b15a93be6..030ef8b6da0 100644
--- a/packages/app-store/apps.schemas.generated.ts
+++ b/packages/app-store/apps.schemas.generated.ts
@@ -2,6 +2,7 @@
This file is autogenerated using the command `yarn app-store:build --watch`.
Don't modify this file manually.
**/
+import { appDataSchema as alby_zod_ts } from "./alby/zod";
import { appDataSchema as basecamp3_zod_ts } from "./basecamp3/zod";
import { appDataSchema as dailyvideo_zod_ts } from "./dailyvideo/zod";
import { appDataSchema as fathom_zod_ts } from "./fathom/zod";
@@ -35,6 +36,7 @@ import { appDataSchema as zohocrm_zod_ts } from "./zohocrm/zod";
import { appDataSchema as zoomvideo_zod_ts } from "./zoomvideo/zod";
export const appDataSchemas = {
+ alby: alby_zod_ts,
basecamp3: basecamp3_zod_ts,
dailyvideo: dailyvideo_zod_ts,
fathom: fathom_zod_ts,
diff --git a/packages/app-store/basecamp3/trpc/projects.handler.ts b/packages/app-store/basecamp3/trpc/projects.handler.ts
index c068dc14669..e477a06d594 100644
--- a/packages/app-store/basecamp3/trpc/projects.handler.ts
+++ b/packages/app-store/basecamp3/trpc/projects.handler.ts
@@ -27,6 +27,10 @@ export const projectHandler = async ({ ctx }: ProjectsHandlerOptions) => {
throw new TRPCError({ code: "FORBIDDEN", message: "No credential found for user" });
}
let credentialKey = credential.key as BasecampToken;
+ if (!credentialKey.account) {
+ return;
+ }
+
if (credentialKey.expires_at < Date.now()) {
credentialKey = (await refreshAccessToken(credential)) as BasecampToken;
}
diff --git a/packages/app-store/index.ts b/packages/app-store/index.ts
index 70a0db78170..d75d91c7ef6 100644
--- a/packages/app-store/index.ts
+++ b/packages/app-store/index.ts
@@ -1,5 +1,6 @@
const appStore = {
// example: () => import("./example"),
+ alby: () => import("./alby"),
applecalendar: () => import("./applecalendar"),
aroundvideo: () => import("./around"),
caldavcalendar: () => import("./caldavcalendar"),
diff --git a/packages/app-store/make/pages/setup/_getStaticProps.tsx b/packages/app-store/make/pages/setup/_getServerSideProps.tsx
similarity index 76%
rename from packages/app-store/make/pages/setup/_getStaticProps.tsx
rename to packages/app-store/make/pages/setup/_getServerSideProps.tsx
index 1c6cac0efe2..1582221efd1 100644
--- a/packages/app-store/make/pages/setup/_getStaticProps.tsx
+++ b/packages/app-store/make/pages/setup/_getServerSideProps.tsx
@@ -1,4 +1,4 @@
-import type { GetStaticPropsContext } from "next";
+import type { GetServerSidePropsContext } from "next";
import getAppKeysFromSlug from "../../../_utils/getAppKeysFromSlug";
@@ -6,7 +6,7 @@ export interface IMakeSetupProps {
inviteLink: string;
}
-export const getStaticProps = async (ctx: GetStaticPropsContext) => {
+export const getServerSideProps = async (ctx: GetServerSidePropsContext) => {
if (typeof ctx.params?.slug !== "string") return { notFound: true } as const;
let inviteLink = "";
const appKeys = await getAppKeysFromSlug("make");
diff --git a/packages/app-store/make/pages/setup/index.tsx b/packages/app-store/make/pages/setup/index.tsx
index 73ccd84c6fc..5b6c28bffb9 100644
--- a/packages/app-store/make/pages/setup/index.tsx
+++ b/packages/app-store/make/pages/setup/index.tsx
@@ -1,4 +1,4 @@
-import type { InferGetStaticPropsType } from "next";
+import type { InferGetServerSidePropsType } from "next";
import { Trans } from "next-i18next";
import Link from "next/link";
import { useState } from "react";
@@ -9,11 +9,11 @@ import { trpc } from "@calcom/trpc/react";
import { Button, Tooltip, showToast } from "@calcom/ui";
import { Clipboard } from "@calcom/ui/components/icon";
-import type { getStaticProps } from "./_getStaticProps";
+import type { getServerSideProps } from "./_getServerSideProps";
const MAKE = "make";
-export default function MakeSetup({ inviteLink }: InferGetStaticPropsType<typeof getStaticProps>) {
+export default function MakeSetup({ inviteLink }: InferGetServerSidePropsType<typeof getServerSideProps>) {
const [newApiKeys, setNewApiKeys] = useState<Record<string, string>>({});
const { t } = useLocale();
diff --git a/packages/app-store/paypal/api/capture.ts b/packages/app-store/paypal/api/capture.ts
index 980a7ff315e..fc1964b6b55 100644
--- a/packages/app-store/paypal/api/capture.ts
+++ b/packages/app-store/paypal/api/capture.ts
@@ -1,8 +1,8 @@
import type { NextApiRequest, NextApiResponse } from "next";
import z from "zod";
+import { findPaymentCredentials } from "@calcom/app-store/paypal/api/webhook";
import Paypal from "@calcom/app-store/paypal/lib/Paypal";
-import { findPaymentCredentials } from "@calcom/features/ee/payments/api/paypal-webhook";
import { IS_PRODUCTION } from "@calcom/lib/constants";
import prisma from "@calcom/prisma";
diff --git a/packages/features/ee/payments/api/paypal-webhook.ts b/packages/app-store/paypal/api/webhook.ts
similarity index 54%
rename from packages/features/ee/payments/api/paypal-webhook.ts
rename to packages/app-store/paypal/api/webhook.ts
index 81531745aeb..c48358487c8 100644
--- a/packages/features/ee/payments/api/paypal-webhook.ts
+++ b/packages/app-store/paypal/api/webhook.ts
@@ -1,23 +1,14 @@
-import type { Prisma } from "@prisma/client";
import type { NextApiRequest, NextApiResponse } from "next";
import getRawBody from "raw-body";
import * as z from "zod";
import { paypalCredentialKeysSchema } from "@calcom/app-store/paypal/lib";
import Paypal from "@calcom/app-store/paypal/lib/Paypal";
-import EventManager from "@calcom/core/EventManager";
-import { sendScheduledEmails } from "@calcom/emails";
-import { getCalEventResponses } from "@calcom/features/bookings/lib/getCalEventResponses";
-import { handleConfirmation } from "@calcom/features/bookings/lib/handleConfirmation";
-import { isPrismaObjOrUndefined, parseRecurringEvent } from "@calcom/lib";
import { IS_PRODUCTION } from "@calcom/lib/constants";
import { getErrorFromUnknown } from "@calcom/lib/errors";
import { HttpError as HttpCode } from "@calcom/lib/http-error";
-import { getTranslation } from "@calcom/lib/server/i18n";
-import prisma, { bookingMinimalSelect } from "@calcom/prisma";
-import { BookingStatus } from "@calcom/prisma/enums";
-import { credentialForCalendarServiceSelect } from "@calcom/prisma/selects/credential";
-import type { CalendarEvent } from "@calcom/types/Calendar";
+import { handlePaymentSuccess } from "@calcom/lib/payment/handlePaymentSuccess";
+import prisma from "@calcom/prisma";
export const config = {
api: {
@@ -25,19 +16,7 @@ export const config = {
},
};
-async function getEventType(id: number) {
- return prisma.eventType.findUnique({
- where: {
- id,
- },
- select: {
- recurringEvent: true,
- requiresConfirmation: true,
- },
- });
-}
-
-export async function handlePaymentSuccess(
+export async function handlePaypalPaymentSuccess(
payload: z.infer<typeof eventSchema>,
rawPayload: string,
webhookHeaders: WebHookHeadersType
@@ -49,7 +28,6 @@ export async function handlePaymentSuccess(
select: {
id: true,
bookingId: true,
- success: true,
},
});
@@ -60,31 +38,7 @@ export async function handlePaymentSuccess(
id: payment.bookingId,
},
select: {
- ...bookingMinimalSelect,
- eventType: true,
- smsReminderNumber: true,
- location: true,
- eventTypeId: true,
- userId: true,
- uid: true,
- paid: true,
- destinationCalendar: true,
- status: true,
- responses: true,
- user: {
- select: {
- id: true,
- username: true,
- credentials: {
- select: credentialForCalendarServiceSelect,
- },
- timeZone: true,
- email: true,
- name: true,
- locale: true,
- destinationCalendar: true,
- },
- },
+ id: true,
},
});
@@ -108,106 +62,7 @@ export async function handlePaymentSuccess(
},
});
- type EventTypeRaw = Awaited<ReturnType<typeof getEventType>>;
- let eventTypeRaw: EventTypeRaw | null = null;
- if (booking.eventTypeId) {
- eventTypeRaw = await getEventType(booking.eventTypeId);
- }
-
- const { user } = booking;
-
- if (!user) throw new HttpCode({ statusCode: 204, message: "No user found" });
-
- const t = await getTranslation(user.locale ?? "en", "common");
- const attendeesListPromises = booking.attendees.map(async (attendee) => {
- return {
- name: attendee.name,
- email: attendee.email,
- timeZone: attendee.timeZone,
- language: {
- translate: await getTranslation(attendee.locale ?? "en", "common"),
- locale: attendee.locale ?? "en",
- },
- };
- });
-
- const attendeesList = await Promise.all(attendeesListPromises);
-
- const evt: CalendarEvent = {
- type: booking.title,
- title: booking.title,
- description: booking.description || undefined,
- startTime: booking.startTime.toISOString(),
- endTime: booking.endTime.toISOString(),
- customInputs: isPrismaObjOrUndefined(booking.customInputs),
- ...getCalEventResponses({
- booking: booking,
- bookingFields: booking.eventType?.bookingFields || null,
- }),
- organizer: {
- email: user.email,
- name: user.name!,
- timeZone: user.timeZone,
- language: { translate: t, locale: user.locale ?? "en" },
- },
- attendees: attendeesList,
- uid: booking.uid,
- destinationCalendar: booking.destinationCalendar
- ? [booking.destinationCalendar]
- : user.destinationCalendar
- ? [user.destinationCalendar]
- : [],
- recurringEvent: parseRecurringEvent(eventTypeRaw?.recurringEvent),
- };
-
- if (booking.location) evt.location = booking.location;
-
- const bookingData: Prisma.BookingUpdateInput = {
- paid: true,
- status: BookingStatus.ACCEPTED,
- };
-
- const isConfirmed = booking.status === BookingStatus.ACCEPTED;
- if (isConfirmed) {
- const eventManager = new EventManager(user);
- const scheduleResult = await eventManager.create(evt);
- bookingData.references = { create: scheduleResult.referencesToCreate };
- }
-
- if (eventTypeRaw?.requiresConfirmation) {
- delete bookingData.status;
- }
-
- if (!payment?.success) {
- await prisma.payment.update({
- where: {
- id: payment.id,
- },
- data: {
- success: true,
- },
- });
- }
-
- if (booking.status === "PENDING") {
- await prisma.booking.update({
- where: {
- id: booking.id,
- },
- data: bookingData,
- });
- }
-
- if (!isConfirmed && !eventTypeRaw?.requiresConfirmation) {
- await handleConfirmation({ user, evt, prisma, bookingId: booking.id, booking, paid: true });
- } else {
- await sendScheduledEmails({ ...evt });
- }
-
- throw new HttpCode({
- statusCode: 200,
- message: `Booking with id '${booking.id}' was paid and confirmed.`,
- });
+ return await handlePaymentSuccess(payment.id, payment.bookingId);
}
export default async function handler(req: NextApiRequest, res: NextApiResponse) {
@@ -234,7 +89,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
const { data: parsedPayload } = parse;
if (parsedPayload.event_type === "CHECKOUT.ORDER.APPROVED") {
- return await handlePaymentSuccess(parsedPayload, bodyAsString, parseHeaders.data);
+ return await handlePaypalPaymentSuccess(parsedPayload, bodyAsString, parseHeaders.data);
}
} catch (_err) {
const err = getErrorFromUnknown(_err);
diff --git a/packages/app-store/paypal/components/EventTypeAppCardInterface.tsx b/packages/app-store/paypal/components/EventTypeAppCardInterface.tsx
index c9b92f441bb..c8951f3a5e9 100644
--- a/packages/app-store/paypal/components/EventTypeAppCardInterface.tsx
+++ b/packages/app-store/paypal/components/EventTypeAppCardInterface.tsx
@@ -25,6 +25,7 @@ const EventTypeAppCard: EventTypeAppCardComponent = function EventTypeAppCard({
value: currencyOptions[0].value,
}
);
+
const paymentOption = getAppData("paymentOption");
const paymentOptionSelectValue = paymentOptions?.find((option) => paymentOption === option.value) || {
label: paymentOptions[0].label,
@@ -55,7 +56,7 @@ const EventTypeAppCard: EventTypeAppCardComponent = function EventTypeAppCard({
label="Price"
labelSrOnly
addOnLeading="$"
- addOnSuffix={currency || "No selected currency"}
+ addOnSuffix={selectedCurrency.value || "No selected currency"}
step="0.01"
min="0.5"
type="number"
@@ -64,8 +65,8 @@ const EventTypeAppCard: EventTypeAppCardComponent = function EventTypeAppCard({
placeholder="Price"
onChange={(e) => {
setAppData("price", Number(e.target.value) * 100);
- if (currency) {
- setAppData("currency", currency);
+ if (selectedCurrency) {
+ setAppData("currency", selectedCurrency.value);
}
}}
value={price > 0 ? price / 100 : undefined}
diff --git a/packages/app-store/paypal/lib/PaymentService.ts b/packages/app-store/paypal/lib/PaymentService.ts
index b4a9aa9fa99..4566431acba 100644
--- a/packages/app-store/paypal/lib/PaymentService.ts
+++ b/packages/app-store/paypal/lib/PaymentService.ts
@@ -17,10 +17,15 @@ export const paypalCredentialKeysSchema = z.object({
});
export class PaymentService implements IAbstractPaymentService {
- private credentials: z.infer<typeof paypalCredentialKeysSchema>;
+ private credentials: z.infer<typeof paypalCredentialKeysSchema> | null;
constructor(credentials: { key: Prisma.JsonValue }) {
- this.credentials = paypalCredentialKeysSchema.parse(credentials.key);
+ const keyParsing = paypalCredentialKeysSchema.safeParse(credentials.key);
+ if (keyParsing.success) {
+ this.credentials = keyParsing.data;
+ } else {
+ this.credentials = null;
+ }
}
async create(
@@ -37,7 +42,7 @@ export class PaymentService implements IAbstractPaymentService {
id: bookingId,
},
});
- if (!booking) {
+ if (!booking || !this.credentials) {
throw new Error();
}
@@ -113,7 +118,7 @@ export class PaymentService implements IAbstractPaymentService {
id: bookingId,
},
});
- if (!booking) {
+ if (!booking || !this.credentials) {
throw new Error();
}
@@ -192,4 +197,8 @@ export class PaymentService implements IAbstractPaymentService {
deletePayment(paymentId: number): Promise<boolean> {
return Promise.resolve(false);
}
+
+ isSetupAlready(): boolean {
+ return !!this.credentials;
+ }
}
diff --git a/packages/app-store/paypal/zod.ts b/packages/app-store/paypal/zod.ts
index 32a6956ad35..34363c0d898 100644
--- a/packages/app-store/paypal/zod.ts
+++ b/packages/app-store/paypal/zod.ts
@@ -33,6 +33,7 @@ export const appDataSchema = eventTypeAppCardZod.merge(
price: z.number(),
currency: z.string(),
paymentOption: z.string().optional(),
+ enabled: z.boolean().optional(),
})
);
export const appKeysSchema = z.object({});
diff --git a/packages/app-store/stripepayment/components/EventTypeAppCardInterface.tsx b/packages/app-store/stripepayment/components/EventTypeAppCardInterface.tsx
index 522a07a84e8..fe27437ee92 100644
--- a/packages/app-store/stripepayment/components/EventTypeAppCardInterface.tsx
+++ b/packages/app-store/stripepayment/components/EventTypeAppCardInterface.tsx
@@ -3,7 +3,6 @@ import { useState } from "react";
import { useAppContextWithSchema } from "@calcom/app-store/EventTypeAppContext";
import AppCard from "@calcom/app-store/_components/AppCard";
-import useIsAppEnabled from "@calcom/app-store/_utils/useIsAppEnabled";
import type { EventTypeAppCardComponent } from "@calcom/app-store/types";
import { WEBAPP_URL } from "@calcom/lib/constants";
import { useLocale } from "@calcom/lib/hooks/useLocale";
@@ -11,9 +10,9 @@ import { Alert, Select, TextField } from "@calcom/ui";
import { paymentOptions } from "../lib/constants";
import {
- convertFromSmallestToPresentableCurrencyUnit,
convertToSmallestCurrencyUnit,
-} from "../lib/currencyConvertions";
+ convertFromSmallestToPresentableCurrencyUnit,
+} from "../lib/currencyConversions";
import { currencyOptions } from "../lib/currencyOptions";
import type { appDataSchema } from "../zod";
@@ -26,13 +25,13 @@ const EventTypeAppCard: EventTypeAppCardComponent = function EventTypeAppCard({
const currency = getAppData("currency");
const [selectedCurrency, setSelectedCurrency] = useState(
currencyOptions.find((c) => c.value === currency) || {
- label: currencyOptions[0].label,
- value: currencyOptions[0].value,
+ label: "",
+ value: "",
}
);
const paymentOption = getAppData("paymentOption");
const paymentOptionSelectValue = paymentOptions.find((option) => paymentOption === option.value);
- const { enabled: requirePayment, updateEnabled: setRequirePayment } = useIsAppEnabled(app);
+ const [requirePayment, setRequirePayment] = useState(getAppData("enabled"));
const { t } = useLocale();
const recurringEventDefined = eventType.recurringEvent?.count !== undefined;
diff --git a/packages/app-store/stripepayment/lib/PaymentService.ts b/packages/app-store/stripepayment/lib/PaymentService.ts
index 9d508be5b55..559b8a29083 100644
--- a/packages/app-store/stripepayment/lib/PaymentService.ts
+++ b/packages/app-store/stripepayment/lib/PaymentService.ts
@@ -14,7 +14,7 @@ import { createPaymentLink } from "./client";
import { retrieveOrCreateStripeCustomerByEmail } from "./customer";
import type { StripePaymentData, StripeSetupIntentData } from "./server";
-const stripeCredentialKeysSchema = z.object({
+export const stripeCredentialKeysSchema = z.object({
stripe_user_id: z.string(),
default_currency: z.string(),
stripe_publishable_key: z.string(),
@@ -28,11 +28,15 @@ const stripeAppKeysSchema = z.object({
export class PaymentService implements IAbstractPaymentService {
private stripe: Stripe;
- private credentials: z.infer<typeof stripeCredentialKeysSchema>;
+ private credentials: z.infer<typeof stripeCredentialKeysSchema> | null;
constructor(credentials: { key: Prisma.JsonValue }) {
- // parse credentials key
- this.credentials = stripeCredentialKeysSchema.parse(credentials.key);
+ const keyParsing = stripeCredentialKeysSchema.safeParse(credentials.key);
+ if (keyParsing.success) {
+ this.credentials = keyParsing.data;
+ } else {
+ this.credentials = null;
+ }
this.stripe = new Stripe(process.env.STRIPE_PRIVATE_KEY || "", {
apiVersion: "2020-08-27",
});
@@ -63,15 +67,9 @@ export class PaymentService implements IAbstractPaymentService {
throw new Error("Payment option is not compatible with create method");
}
- // Load stripe keys
- const stripeAppKeys = await prisma.app.findFirst({
- select: {
- keys: true,
- },
- where: {
- slug: "stripe",
- },
- });
+ if (!this.credentials) {
+ throw new Error("Stripe credentials not found");
+ }
const customer = await retrieveOrCreateStripeCustomerByEmail(
bookerEmail,
@@ -142,21 +140,15 @@ export class PaymentService implements IAbstractPaymentService {
paymentOption: PaymentOption
): Promise<Payment> {
try {
+ if (!this.credentials) {
+ throw new Error("Stripe credentials not found");
+ }
+
// Ensure that the payment service can support the passed payment option
if (paymentOptionEnum.parse(paymentOption) !== "HOLD") {
throw new Error("Payment option is not compatible with create method");
}
- // Load stripe keys
- const stripeAppKeys = await prisma.app.findFirst({
- select: {
- keys: true,
- },
- where: {
- slug: "stripe",
- },
- });
-
const customer = await retrieveOrCreateStripeCustomerByEmail(
bookerEmail,
this.credentials.stripe_user_id
@@ -214,6 +206,10 @@ export class PaymentService implements IAbstractPaymentService {
async chargeCard(payment: Payment, _bookingId?: Booking["id"]): Promise<Payment> {
try {
+ if (!this.credentials) {
+ throw new Error("Stripe credentials not found");
+ }
+
const stripeAppKeys = await prisma.app.findFirst({
select: {
keys: true,
@@ -385,4 +381,8 @@ export class PaymentService implements IAbstractPaymentService {
getPaymentDetails(): Promise<Payment> {
throw new Error("Method not implemented.");
}
+
+ isSetupAlready(): boolean {
+ return !!this.credentials;
+ }
}
diff --git a/packages/app-store/stripepayment/lib/currencyConvertions.ts b/packages/app-store/stripepayment/lib/currencyConversions.ts
similarity index 100%
rename from packages/app-store/stripepayment/lib/currencyConvertions.ts
rename to packages/app-store/stripepayment/lib/currencyConversions.ts
diff --git a/packages/app-store/stripepayment/pages/setup/_getServerSideProps.ts b/packages/app-store/stripepayment/pages/setup/_getServerSideProps.ts
new file mode 100644
index 00000000000..788563cb993
--- /dev/null
+++ b/packages/app-store/stripepayment/pages/setup/_getServerSideProps.ts
@@ -0,0 +1,12 @@
+import type { GetServerSidePropsContext } from "next";
+
+export const getServerSideProps = async (ctx: GetServerSidePropsContext) => {
+ if (typeof ctx.params?.slug !== "string") return { notFound: true } as const;
+ const targetUrl = "https://dashboard.stripe.com/settings/connect";
+ return {
+ redirect: {
+ destination: targetUrl,
+ permanent: false,
+ },
+ };
+};
diff --git a/packages/app-store/stripepayment/pages/setup/index.tsx b/packages/app-store/stripepayment/pages/setup/index.tsx
new file mode 100644
index 00000000000..41102bad619
--- /dev/null
+++ b/packages/app-store/stripepayment/pages/setup/index.tsx
@@ -0,0 +1,3 @@
+export default function StripePaymentSetup() {
+ return null;
+}
diff --git a/packages/app-store/stripepayment/zod.ts b/packages/app-store/stripepayment/zod.ts
index 69064502758..efd4c7a37e4 100644
--- a/packages/app-store/stripepayment/zod.ts
+++ b/packages/app-store/stripepayment/zod.ts
@@ -17,6 +17,7 @@ export const appDataSchema = eventTypeAppCardZod.merge(
price: z.number(),
currency: z.string(),
paymentOption: paymentOptionEnum.optional(),
+ enabled: z.boolean().optional(),
})
);
diff --git a/packages/app-store/zapier/pages/setup/_getStaticProps.tsx b/packages/app-store/zapier/pages/setup/_getServerSideProps.tsx
similarity index 76%
rename from packages/app-store/zapier/pages/setup/_getStaticProps.tsx
rename to packages/app-store/zapier/pages/setup/_getServerSideProps.tsx
index 05b728d3fe1..9231c683bd0 100644
--- a/packages/app-store/zapier/pages/setup/_getStaticProps.tsx
+++ b/packages/app-store/zapier/pages/setup/_getServerSideProps.tsx
@@ -1,4 +1,4 @@
-import type { GetStaticPropsContext } from "next";
+import type { GetServerSidePropsContext } from "next";
import getAppKeysFromSlug from "../../../_utils/getAppKeysFromSlug";
@@ -6,7 +6,7 @@ export interface IZapierSetupProps {
inviteLink: string;
}
-export const getStaticProps = async (ctx: GetStaticPropsContext) => {
+export const getServerSideProps = async (ctx: GetServerSidePropsContext) => {
if (typeof ctx.params?.slug !== "string") return { notFound: true } as const;
let inviteLink = "";
const appKeys = await getAppKeysFromSlug("zapier");
diff --git a/packages/app-store/zohocalendar/config.json b/packages/app-store/zohocalendar/config.json
index 918050d9718..6d43249f528 100644
--- a/packages/app-store/zohocalendar/config.json
+++ b/packages/app-store/zohocalendar/config.json
@@ -1,16 +1,14 @@
{
- "name": "Zoho Calendar",
- "description": "Zoho Calendar is an online business calendar that makes scheduling easy for you. You can use it to stay on top of your schedule and also share calendars with your team to keep everyone on the same page.",
- "slug": "zohocalendar",
- "type": "zoho_calendar",
- "title": "Zoho Calendar",
- "variant": "calendar",
- "category": "calendar",
- "categories": [
- "calendar"
- ],
- "logo": "icon.svg",
- "publisher": "Cal.com",
- "url": "https://cal.com/",
- "email": "[email protected]"
-}
\ No newline at end of file
+ "name": "Zoho Calendar",
+ "description": "Zoho Calendar is an online business calendar that makes scheduling easy for you. You can use it to stay on top of your schedule and also share calendars with your team to keep everyone on the same page.",
+ "slug": "zohocalendar",
+ "type": "zoho_calendar",
+ "title": "Zoho Calendar",
+ "variant": "calendar",
+ "category": "calendar",
+ "categories": ["calendar"],
+ "logo": "icon.svg",
+ "publisher": "Cal.com",
+ "url": "https://cal.com/",
+ "email": "[email protected]"
+}
diff --git a/packages/emails/src/templates/BaseScheduledEmail.tsx b/packages/emails/src/templates/BaseScheduledEmail.tsx
index e17c53c23e8..7367325ae07 100644
--- a/packages/emails/src/templates/BaseScheduledEmail.tsx
+++ b/packages/emails/src/templates/BaseScheduledEmail.tsx
@@ -1,6 +1,7 @@
import type { TFunction } from "next-i18next";
import dayjs from "@calcom/dayjs";
+import { formatPrice } from "@calcom/lib/price";
import { TimeFormat } from "@calcom/lib/timeFormat";
import type { CalendarEvent, Person } from "@calcom/types/Calendar";
@@ -87,11 +88,12 @@ export const BaseScheduledEmail = (
<UserFieldsResponses calEvent={props.calEvent} />
{props.calEvent.paymentInfo?.amount && (
<Info
- label={props.calEvent.paymentInfo?.paymentOption === "HOLD" ? t("no_show_fee") : t("price")}
- description={new Intl.NumberFormat(props.attendee.language.locale, {
- style: "currency",
- currency: props.calEvent.paymentInfo?.currency || "USD",
- }).format(props.calEvent.paymentInfo?.amount / 100.0)}
+ label={props.calEvent.paymentInfo.paymentOption === "HOLD" ? t("no_show_fee") : t("price")}
+ description={formatPrice(
+ props.calEvent.paymentInfo.amount,
+ props.calEvent.paymentInfo.currency,
+ props.attendee.language.locale
+ )}
withSpacer
/>
)}
diff --git a/packages/features/bookings/components/event-meta/Details.tsx b/packages/features/bookings/components/event-meta/Details.tsx
index c5eaddc6b42..ee7b9f30174 100644
--- a/packages/features/bookings/components/event-meta/Details.tsx
+++ b/packages/features/bookings/components/event-meta/Details.tsx
@@ -4,14 +4,15 @@ import React from "react";
import classNames from "@calcom/lib/classNames";
import getPaymentAppData from "@calcom/lib/getPaymentAppData";
import { useLocale } from "@calcom/lib/hooks/useLocale";
-import { Clock, CheckSquare, RefreshCcw, CreditCard } from "@calcom/ui/components/icon";
+import { Clock, CheckSquare, RefreshCcw } from "@calcom/ui/components/icon";
import type { PublicEvent } from "../../types";
import { EventDetailBlocks } from "../../types";
import { AvailableEventLocations } from "./AvailableEventLocations";
import { EventDuration } from "./Duration";
import { EventOccurences } from "./Occurences";
-import { EventPrice } from "./Price";
+import { Price } from "./Price";
+import { getPriceIcon } from "./getPriceIcon";
type EventDetailsPropsBase = {
event: PublicEvent;
@@ -156,8 +157,12 @@ export const EventDetails = ({ event, blocks = defaultEventDetailsBlocks }: Even
if (event.price <= 0 || paymentAppData.price <= 0) return null;
return (
- <EventMetaBlock key={block} icon={CreditCard}>
- <EventPrice event={event} />
+ <EventMetaBlock key={block} icon={getPriceIcon(event.currency)}>
+ <Price
+ price={paymentAppData.price}
+ currency={event.currency}
+ displayAlternateSymbol={false}
+ />
</EventMetaBlock>
);
}
diff --git a/packages/features/bookings/components/event-meta/Price.tsx b/packages/features/bookings/components/event-meta/Price.tsx
index 792e88a4441..094df67e407 100644
--- a/packages/features/bookings/components/event-meta/Price.tsx
+++ b/packages/features/bookings/components/event-meta/Price.tsx
@@ -1,18 +1,28 @@
-import getPaymentAppData from "@calcom/lib/getPaymentAppData";
+import dynamic from "next/dynamic";
-import type { PublicEvent } from "../../types";
+import { formatPrice } from "@calcom/lib/price";
-export const EventPrice = ({ event }: { event: PublicEvent }) => {
- const stripeAppData = getPaymentAppData(event);
+import type { EventPrice } from "../../types";
- if (stripeAppData.price === 0) return null;
+const AlbyPriceComponent = dynamic(
+ () => import("@calcom/app-store/alby/components/AlbyPriceComponent").then((m) => m.AlbyPriceComponent),
+ {
+ ssr: false,
+ }
+);
- return (
- <>
- {Intl.NumberFormat("en", {
- style: "currency",
- currency: stripeAppData.currency.toUpperCase(),
- }).format(stripeAppData.price / 100.0)}
- </>
+export const Price = ({ price, currency, displayAlternateSymbol = true }: EventPrice) => {
+ if (price === 0) return null;
+
+ const formattedPrice = formatPrice(price, currency);
+
+ return currency !== "BTC" ? (
+ <>{formattedPrice}</>
+ ) : (
+ <AlbyPriceComponent
+ displaySymbol={displayAlternateSymbol}
+ price={price}
+ formattedPrice={formattedPrice}
+ />
);
};
diff --git a/packages/features/bookings/components/event-meta/getPayIcon.ts b/packages/features/bookings/components/event-meta/getPayIcon.ts
new file mode 100644
index 00000000000..0219b869443
--- /dev/null
+++ b/packages/features/bookings/components/event-meta/getPayIcon.ts
@@ -0,0 +1,5 @@
+import { CreditCard, Zap } from "lucide-react";
+
+export function getPayIcon(currency: string): React.FC<{ className: string }> | string {
+ return currency !== "BTC" ? CreditCard : Zap;
+}
diff --git a/packages/features/bookings/components/event-meta/getPriceIcon.ts b/packages/features/bookings/components/event-meta/getPriceIcon.ts
new file mode 100644
index 00000000000..4e122f59c54
--- /dev/null
+++ b/packages/features/bookings/components/event-meta/getPriceIcon.ts
@@ -0,0 +1,7 @@
+import { CreditCard } from "lucide-react";
+
+import { SatSymbol } from "@calcom/ui/components/icon/SatSymbol";
+
+export function getPriceIcon(currency: string): React.FC<{ className: string }> | string {
+ return currency !== "BTC" ? CreditCard : (SatSymbol as React.FC<{ className: string }>);
+}
diff --git a/packages/features/bookings/components/event-meta/index.ts b/packages/features/bookings/components/event-meta/index.ts
index ca610b80d5e..debcc5a3ac5 100644
--- a/packages/features/bookings/components/event-meta/index.ts
+++ b/packages/features/bookings/components/event-meta/index.ts
@@ -2,3 +2,5 @@ export { EventDetails, EventMetaBlock } from "./Details";
export { EventTitle } from "./Title";
export { EventMetaSkeleton } from "./Skeleton";
export { EventMembers } from "./Members";
+export { getPriceIcon } from "./getPriceIcon";
+export { getPayIcon } from "./getPayIcon";
diff --git a/packages/features/bookings/types.ts b/packages/features/bookings/types.ts
index b21da6d94ae..7c2b0701330 100644
--- a/packages/features/bookings/types.ts
+++ b/packages/features/bookings/types.ts
@@ -7,6 +7,8 @@ import type { AppsStatus } from "@calcom/types/Calendar";
export type PublicEvent = NonNullable<RouterOutputs["viewer"]["public"]["event"]>;
export type ValidationErrors<T extends object> = { key: FieldPath<T>; error: ErrorOption }[];
+export type EventPrice = { currency: string; price: number; displayAlternateSymbol?: boolean };
+
export enum EventDetailBlocks {
// Includes duration select when event has multiple durations.
DURATION,
diff --git a/packages/features/ee/payments/api/webhook.ts b/packages/features/ee/payments/api/webhook.ts
index c3e9701d127..0f9a435d305 100644
--- a/packages/features/ee/payments/api/webhook.ts
+++ b/packages/features/ee/payments/api/webhook.ts
@@ -6,13 +6,13 @@ import type Stripe from "stripe";
import stripe from "@calcom/app-store/stripepayment/lib/server";
import EventManager from "@calcom/core/EventManager";
import dayjs from "@calcom/dayjs";
-import { sendAttendeeRequestEmail, sendOrganizerRequestEmail, sendScheduledEmails } from "@calcom/emails";
-import { getCalEventResponses } from "@calcom/features/bookings/lib/getCalEventResponses";
+import { sendOrganizerRequestEmail, sendAttendeeRequestEmail } from "@calcom/emails";
import { handleConfirmation } from "@calcom/features/bookings/lib/handleConfirmation";
import { isPrismaObjOrUndefined, parseRecurringEvent } from "@calcom/lib";
import { IS_PRODUCTION } from "@calcom/lib/constants";
import { getErrorFromUnknown } from "@calcom/lib/errors";
import { HttpError as HttpCode } from "@calcom/lib/http-error";
+import { handlePaymentSuccess } from "@calcom/lib/payment/handlePaymentSuccess";
import { getTranslation } from "@calcom/lib/server/i18n";
import { getTimeFormatStringFromUserTimeFormat } from "@calcom/lib/timeFormat";
import { bookingMinimalSelect, prisma } from "@calcom/prisma";
@@ -129,7 +129,7 @@ async function getBooking(bookingId: number) {
};
}
-async function handlePaymentSuccess(event: Stripe.Event) {
+async function handleStripePaymentSuccess(event: Stripe.Event) {
const paymentIntent = event.data.object as Stripe.PaymentIntent;
const payment = await prisma.payment.findFirst({
where: {
@@ -145,145 +145,7 @@ async function handlePaymentSuccess(event: Stripe.Event) {
}
if (!payment?.bookingId) throw new HttpCode({ statusCode: 204, message: "Payment not found" });
- const booking = await prisma.booking.findUnique({
- where: {
- id: payment.bookingId,
- },
- select: {
- ...bookingMinimalSelect,
- eventType: true,
- smsReminderNumber: true,
- location: true,
- eventTypeId: true,
- userId: true,
- uid: true,
- paid: true,
- destinationCalendar: true,
- status: true,
- responses: true,
- user: {
- select: {
- id: true,
- username: true,
- credentials: { select: credentialForCalendarServiceSelect },
- timeZone: true,
- timeFormat: true,
- email: true,
- name: true,
- locale: true,
- destinationCalendar: true,
- },
- },
- },
- });
-
- if (!booking) throw new HttpCode({ statusCode: 204, message: "No booking found" });
-
- type EventTypeRaw = Awaited<ReturnType<typeof getEventType>>;
- let eventTypeRaw: EventTypeRaw | null = null;
- if (booking.eventTypeId) {
- eventTypeRaw = await getEventType(booking.eventTypeId);
- }
-
- const { user: userWithCredentials } = booking;
-
- if (!userWithCredentials) throw new HttpCode({ statusCode: 204, message: "No user found" });
-
- const { credentials, ...user } = userWithCredentials;
-
- const t = await getTranslation(user.locale ?? "en", "common");
- const attendeesListPromises = booking.attendees.map(async (attendee) => {
- return {
- name: attendee.name,
- email: attendee.email,
- timeZone: attendee.timeZone,
- language: {
- translate: await getTranslation(attendee.locale ?? "en", "common"),
- locale: attendee.locale ?? "en",
- },
- };
- });
-
- const attendeesList = await Promise.all(attendeesListPromises);
- const selectedDestinationCalendar = booking.destinationCalendar || user.destinationCalendar;
- const evt: CalendarEvent = {
- type: booking.title,
- title: booking.title,
- description: booking.description || undefined,
- startTime: booking.startTime.toISOString(),
- endTime: booking.endTime.toISOString(),
- customInputs: isPrismaObjOrUndefined(booking.customInputs),
- ...getCalEventResponses({
- booking: booking,
- bookingFields: booking.eventType?.bookingFields || null,
- }),
- organizer: {
- email: user.email,
- name: user.name!,
- timeZone: user.timeZone,
- timeFormat: getTimeFormatStringFromUserTimeFormat(user.timeFormat),
- language: { translate: t, locale: user.locale ?? "en" },
- },
- attendees: attendeesList,
- location: booking.location,
- uid: booking.uid,
- destinationCalendar: selectedDestinationCalendar ? [selectedDestinationCalendar] : [],
- recurringEvent: parseRecurringEvent(eventTypeRaw?.recurringEvent),
- };
-
- if (booking.location) evt.location = booking.location;
-
- const bookingData: Prisma.BookingUpdateInput = {
- paid: true,
- status: BookingStatus.ACCEPTED,
- };
-
- const isConfirmed = booking.status === BookingStatus.ACCEPTED;
- if (isConfirmed) {
- const eventManager = new EventManager(userWithCredentials);
- const scheduleResult = await eventManager.create(evt);
- bookingData.references = { create: scheduleResult.referencesToCreate };
- }
-
- if (eventTypeRaw?.requiresConfirmation) {
- delete bookingData.status;
- }
-
- const paymentUpdate = prisma.payment.update({
- where: {
- id: payment.id,
- },
- data: {
- success: true,
- },
- });
-
- const bookingUpdate = prisma.booking.update({
- where: {
- id: booking.id,
- },
- data: bookingData,
- });
-
- await prisma.$transaction([paymentUpdate, bookingUpdate]);
-
- if (!isConfirmed && !eventTypeRaw?.requiresConfirmation) {
- await handleConfirmation({
- user: userWithCredentials,
- evt,
- prisma,
- bookingId: booking.id,
- booking,
- paid: true,
- });
- } else {
- await sendScheduledEmails({ ...evt });
- }
-
- throw new HttpCode({
- statusCode: 200,
- message: `Booking with id '${booking.id}' was paid and confirmed.`,
- });
+ await handlePaymentSuccess(payment.id, payment.bookingId);
}
const handleSetupSuccess = async (event: Stripe.Event) => {
@@ -372,7 +234,7 @@ const handleSetupSuccess = async (event: Stripe.Event) => {
type WebhookHandler = (event: Stripe.Event) => Promise<void>;
const webhookHandlers: Record<string, WebhookHandler | undefined> = {
- "payment_intent.succeeded": handlePaymentSuccess,
+ "payment_intent.succeeded": handleStripePaymentSuccess,
"setup_intent.succeeded": handleSetupSuccess,
};
diff --git a/packages/features/ee/payments/components/PaymentPage.tsx b/packages/features/ee/payments/components/PaymentPage.tsx
index dc80c5fa409..dcccdf8709d 100644
--- a/packages/features/ee/payments/components/PaymentPage.tsx
+++ b/packages/features/ee/payments/components/PaymentPage.tsx
@@ -7,13 +7,14 @@ import { useEffect, useState } from "react";
import { getSuccessPageLocationMessage } from "@calcom/app-store/locations";
import dayjs from "@calcom/dayjs";
import { sdkActionManager, useIsEmbed } from "@calcom/embed-core/embed-iframe";
+import { Price } from "@calcom/features/bookings/components/event-meta/Price";
+import { getPayIcon } from "@calcom/features/bookings/components/event-meta/getPayIcon";
import { APP_NAME, WEBSITE_URL } from "@calcom/lib/constants";
import getPaymentAppData from "@calcom/lib/getPaymentAppData";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import useTheme from "@calcom/lib/hooks/useTheme";
import { getIs24hClockFromLocalStorage, isBrowserLocale24h } from "@calcom/lib/timeFormat";
import { localStorage } from "@calcom/lib/webstorage";
-import { CreditCard } from "@calcom/ui/components/icon";
import type { PaymentPageProps } from "../pages/payment";
@@ -31,6 +32,13 @@ const PaypalPaymentComponent = dynamic(
}
);
+const AlbyPaymentComponent = dynamic(
+ () => import("@calcom/app-store/alby/components/AlbyPaymentComponent").then((m) => m.AlbyPaymentComponent),
+ {
+ ssr: false,
+ }
+);
+
const PaymentPage: FC<PaymentPageProps> = (props) => {
const { t, i18n } = useLocale();
const [is24h, setIs24h] = useState(isBrowserLocale24h());
@@ -66,6 +74,7 @@ const PaymentPage: FC<PaymentPageProps> = (props) => {
}, [isEmbed]);
const eventName = props.booking.title;
+ const PayIcon = getPayIcon(paymentAppData.currency);
return (
<div className="h-screen">
@@ -92,7 +101,7 @@ const PaymentPage: FC<PaymentPageProps> = (props) => {
aria-labelledby="modal-headline">
<div>
<div className="bg-success mx-auto flex h-12 w-12 items-center justify-center rounded-full">
- <CreditCard className="h-8 w-8 text-green-600" />
+ <PayIcon className="h-8 w-8 text-green-600" />
</div>
<div className="mt-3 text-center sm:mt-5">
@@ -121,10 +130,11 @@ const PaymentPage: FC<PaymentPageProps> = (props) => {
{props.payment.paymentOption === "HOLD" ? t("no_show_fee") : t("price")}
</div>
<div className="col-span-2 mb-6 font-semibold">
- {new Intl.NumberFormat(i18n.language, {
- style: "currency",
- currency: paymentAppData.currency,
- }).format(paymentAppData.price / 100.0)}
+ <Price
+ currency={paymentAppData.currency}
+ price={paymentAppData.price}
+ displayAlternateSymbol={false}
+ />
</div>
</div>
</div>
@@ -146,6 +156,9 @@ const PaymentPage: FC<PaymentPageProps> = (props) => {
{props.payment.appId === "paypal" && !props.payment.success && (
<PaypalPaymentComponent payment={props.payment} />
)}
+ {props.payment.appId === "alby" && !props.payment.success && (
+ <AlbyPaymentComponent payment={props.payment} paymentPageProps={props} />
+ )}
{props.payment.refunded && (
<div className="text-default mt-4 text-center dark:text-gray-300">{t("refunded")}</div>
)}
diff --git a/packages/features/eventtypes/components/EventTypeDescription.tsx b/packages/features/eventtypes/components/EventTypeDescription.tsx
index b1a1176ec88..ec8f15cd4c5 100644
--- a/packages/features/eventtypes/components/EventTypeDescription.tsx
+++ b/packages/features/eventtypes/components/EventTypeDescription.tsx
@@ -2,6 +2,8 @@ import type { Prisma } from "@prisma/client";
import { useMemo } from "react";
import type { z } from "zod";
+import { Price } from "@calcom/features/bookings/components/event-meta/Price";
+import { getPriceIcon } from "@calcom/features/bookings/components/event-meta/getPriceIcon";
import { classNames, parseRecurringEvent } from "@calcom/lib";
import getPaymentAppData from "@calcom/lib/getPaymentAppData";
import { useLocale } from "@calcom/lib/hooks/useLocale";
@@ -9,7 +11,7 @@ import type { baseEventTypeSelect } from "@calcom/prisma";
import { SchedulingType } from "@calcom/prisma/enums";
import type { EventTypeModel } from "@calcom/prisma/zod";
import { Badge } from "@calcom/ui";
-import { Clock, Users, RefreshCw, CreditCard, Clipboard, Plus, User, Lock } from "@calcom/ui/components/icon";
+import { Clock, Users, RefreshCw, Clipboard, Plus, User, Lock } from "@calcom/ui/components/icon";
export type EventTypeDescriptionProps = {
eventType: Pick<
@@ -94,11 +96,12 @@ export const EventTypeDescription = ({
)}
{paymentAppData.enabled && (
<li>
- <Badge variant="gray" startIcon={CreditCard}>
- {new Intl.NumberFormat(i18n.language, {
- style: "currency",
- currency: paymentAppData.currency,
- }).format(paymentAppData.price / 100)}
+ <Badge variant="gray" startIcon={getPriceIcon(paymentAppData.currency)}>
+ <Price
+ currency={paymentAppData.currency}
+ price={paymentAppData.price}
+ displayAlternateSymbol={false}
+ />
</Badge>
</li>
)}
diff --git a/packages/lib/apps/getEnabledAppsFromCredentials.ts b/packages/lib/apps/getEnabledAppsFromCredentials.ts
index 62ce8c3452d..18904e5b3be 100644
--- a/packages/lib/apps/getEnabledAppsFromCredentials.ts
+++ b/packages/lib/apps/getEnabledAppsFromCredentials.ts
@@ -47,6 +47,7 @@ const getEnabledAppsFromCredentials = async (
..._where,
...(filterOnIds.credentials.some.OR.length && filterOnIds),
};
+
const enabledApps = await prisma.app.findMany({
where,
select: { slug: true, enabled: true },
diff --git a/packages/lib/getEventTypeById.ts b/packages/lib/getEventTypeById.ts
index cd0bc1acc15..5d4eafed6f9 100644
--- a/packages/lib/getEventTypeById.ts
+++ b/packages/lib/getEventTypeById.ts
@@ -8,7 +8,6 @@ import { getOrgFullDomain } from "@calcom/ee/organizations/lib/orgDomains";
import { getBookingFieldsWithSystemFields } from "@calcom/features/bookings/lib/getBookingFields";
import { parseBookingLimit, parseDurationLimit, parseRecurringEvent } from "@calcom/lib";
import { CAL_URL } from "@calcom/lib/constants";
-import getPaymentAppData from "@calcom/lib/getPaymentAppData";
import { getTranslation } from "@calcom/lib/server/i18n";
import type { PrismaClient } from "@calcom/prisma";
import type { Credential } from "@calcom/prisma/client";
@@ -256,14 +255,9 @@ export default async function getEventTypeById({
const newMetadata = EventTypeMetaDataSchema.parse(metadata || {}) || {};
const apps = newMetadata?.apps || {};
const eventTypeWithParsedMetadata = { ...rawEventType, metadata: newMetadata };
- const stripeMetaData = getPaymentAppData(eventTypeWithParsedMetadata, true);
+
newMetadata.apps = {
...apps,
- stripe: {
- ...stripeMetaData,
- paymentOption: stripeMetaData.paymentOption as string,
- currency: getStripeCurrency(stripeMetaData, credentials),
- },
giphy: getEventTypeAppData(eventTypeWithParsedMetadata, "giphy", true),
};
diff --git a/packages/lib/payment/handlePaymentSuccess.ts b/packages/lib/payment/handlePaymentSuccess.ts
new file mode 100644
index 00000000000..4dfbe2be32b
--- /dev/null
+++ b/packages/lib/payment/handlePaymentSuccess.ts
@@ -0,0 +1,179 @@
+import type { Prisma } from "@prisma/client";
+
+import EventManager from "@calcom/core/EventManager";
+import { sendScheduledEmails } from "@calcom/emails";
+import { getCalEventResponses } from "@calcom/features/bookings/lib/getCalEventResponses";
+import { handleConfirmation } from "@calcom/features/bookings/lib/handleConfirmation";
+import { isPrismaObjOrUndefined, parseRecurringEvent } from "@calcom/lib";
+import { HttpError as HttpCode } from "@calcom/lib/http-error";
+import { getTranslation } from "@calcom/lib/server/i18n";
+import prisma, { bookingMinimalSelect } from "@calcom/prisma";
+import { BookingStatus } from "@calcom/prisma/enums";
+import { credentialForCalendarServiceSelect } from "@calcom/prisma/selects/credential";
+import type { CalendarEvent } from "@calcom/types/Calendar";
+
+import { getTimeFormatStringFromUserTimeFormat } from "../timeFormat";
+
+export async function handlePaymentSuccess(paymentId: number, bookingId: number) {
+ const booking = await prisma.booking.findUnique({
+ where: {
+ id: bookingId,
+ },
+ select: {
+ ...bookingMinimalSelect,
+ eventType: true,
+ smsReminderNumber: true,
+ location: true,
+ eventTypeId: true,
+ userId: true,
+ uid: true,
+ paid: true,
+ destinationCalendar: true,
+ status: true,
+ responses: true,
+ user: {
+ select: {
+ id: true,
+ username: true,
+ credentials: { select: credentialForCalendarServiceSelect },
+ timeZone: true,
+ timeFormat: true,
+ email: true,
+ name: true,
+ locale: true,
+ destinationCalendar: true,
+ },
+ },
+ payment: {
+ select: {
+ amount: true,
+ currency: true,
+ paymentOption: true,
+ },
+ },
+ },
+ });
+
+ if (!booking) throw new HttpCode({ statusCode: 204, message: "No booking found" });
+
+ type EventTypeRaw = Awaited<ReturnType<typeof getEventType>>;
+ let eventTypeRaw: EventTypeRaw | null = null;
+ if (booking.eventTypeId) {
+ eventTypeRaw = await getEventType(booking.eventTypeId);
+ }
+
+ const { user: userWithCredentials } = booking;
+ if (!userWithCredentials) throw new HttpCode({ statusCode: 204, message: "No user found" });
+ const { credentials, ...user } = userWithCredentials;
+
+ const t = await getTranslation(user.locale ?? "en", "common");
+ const attendeesListPromises = booking.attendees.map(async (attendee) => {
+ return {
+ name: attendee.name,
+ email: attendee.email,
+ timeZone: attendee.timeZone,
+ language: {
+ translate: await getTranslation(attendee.locale ?? "en", "common"),
+ locale: attendee.locale ?? "en",
+ },
+ };
+ });
+
+ const attendeesList = await Promise.all(attendeesListPromises);
+ const selectedDestinationCalendar = booking.destinationCalendar || user.destinationCalendar;
+ const evt: CalendarEvent = {
+ type: booking.title,
+ title: booking.title,
+ description: booking.description || undefined,
+ startTime: booking.startTime.toISOString(),
+ endTime: booking.endTime.toISOString(),
+ customInputs: isPrismaObjOrUndefined(booking.customInputs),
+ ...getCalEventResponses({
+ booking: booking,
+ bookingFields: booking.eventType?.bookingFields || null,
+ }),
+ organizer: {
+ email: user.email,
+ name: user.name!,
+ timeZone: user.timeZone,
+ timeFormat: getTimeFormatStringFromUserTimeFormat(user.timeFormat),
+ language: { translate: t, locale: user.locale ?? "en" },
+ },
+ attendees: attendeesList,
+ location: booking.location,
+ uid: booking.uid,
+ destinationCalendar: selectedDestinationCalendar ? [selectedDestinationCalendar] : [],
+ recurringEvent: parseRecurringEvent(eventTypeRaw?.recurringEvent),
+ paymentInfo: booking.payment?.[0] && {
+ amount: booking.payment[0].amount,
+ currency: booking.payment[0].currency,
+ paymentOption: booking.payment[0].paymentOption,
+ },
+ };
+
+ if (booking.location) evt.location = booking.location;
+
+ const bookingData: Prisma.BookingUpdateInput = {
+ paid: true,
+ status: BookingStatus.ACCEPTED,
+ };
+
+ const isConfirmed = booking.status === BookingStatus.ACCEPTED;
+ if (isConfirmed) {
+ const eventManager = new EventManager(userWithCredentials);
+ const scheduleResult = await eventManager.create(evt);
+ bookingData.references = { create: scheduleResult.referencesToCreate };
+ }
+
+ if (eventTypeRaw?.requiresConfirmation) {
+ delete bookingData.status;
+ }
+
+ const paymentUpdate = prisma.payment.update({
+ where: {
+ id: paymentId,
+ },
+ data: {
+ success: true,
+ },
+ });
+
+ const bookingUpdate = prisma.booking.update({
+ where: {
+ id: booking.id,
+ },
+ data: bookingData,
+ });
+
+ await prisma.$transaction([paymentUpdate, bookingUpdate]);
+
+ if (!isConfirmed && !eventTypeRaw?.requiresConfirmation) {
+ await handleConfirmation({
+ user: userWithCredentials,
+ evt,
+ prisma,
+ bookingId: booking.id,
+ booking,
+ paid: true,
+ });
+ } else {
+ await sendScheduledEmails({ ...evt });
+ }
+
+ throw new HttpCode({
+ statusCode: 200,
+ message: `Booking with id '${booking.id}' was paid and confirmed.`,
+ });
+}
+
+async function getEventType(id: number) {
+ return prisma.eventType.findUnique({
+ where: {
+ id,
+ },
+ select: {
+ recurringEvent: true,
+ requiresConfirmation: true,
+ },
+ });
+}
diff --git a/packages/lib/price.ts b/packages/lib/price.ts
new file mode 100644
index 00000000000..54a3f8423e9
--- /dev/null
+++ b/packages/lib/price.ts
@@ -0,0 +1,11 @@
+export const formatPrice = (price: number, currency: string | undefined, locale = "en") => {
+ switch (currency) {
+ case "BTC":
+ return `${price} sats`;
+ default:
+ return `${Intl.NumberFormat(locale, {
+ style: "currency",
+ currency: currency?.toUpperCase() || "USD",
+ }).format(price / 100.0)}`;
+ }
+};
diff --git a/packages/trpc/server/routers/loggedInViewer/integrations.handler.ts b/packages/trpc/server/routers/loggedInViewer/integrations.handler.ts
index 664b04f340b..7cce1075f12 100644
--- a/packages/trpc/server/routers/loggedInViewer/integrations.handler.ts
+++ b/packages/trpc/server/routers/loggedInViewer/integrations.handler.ts
@@ -1,5 +1,6 @@
import type { Prisma } from "@prisma/client";
+import appStore from "@calcom/app-store";
import type { CredentialOwner } from "@calcom/app-store/types";
import getEnabledAppsFromCredentials from "@calcom/lib/apps/getEnabledAppsFromCredentials";
import getInstallCountPerApp from "@calcom/lib/apps/getInstallCountPerApp";
@@ -9,6 +10,7 @@ import { MembershipRole } from "@calcom/prisma/enums";
import { credentialForCalendarServiceSelect } from "@calcom/prisma/selects/credential";
import type { TrpcSessionUser } from "@calcom/trpc/server/trpc";
import type { CredentialPayload } from "@calcom/types/Credential";
+import type { PaymentApp } from "@calcom/types/PaymentService";
import type { TIntegrationsInputSchema } from "./integrations.schema";
@@ -132,34 +134,48 @@ export const integrationsHandler = async ({ ctx, input }: IntegrationsOptions) =
...(appId ? { where: { slug: appId } } : {}),
});
//TODO: Refactor this to pick up only needed fields and prevent more leaking
- let apps = enabledApps.map(
- ({ credentials: _, credential: _1, key: _2 /* don't leak to frontend */, ...app }) => {
+ let apps = await Promise.all(
+ enabledApps.map(async ({ credentials: _, credential, key: _2 /* don't leak to frontend */, ...app }) => {
const userCredentialIds = credentials.filter((c) => c.type === app.type && !c.teamId).map((c) => c.id);
const invalidCredentialIds = credentials
.filter((c) => c.type === app.type && c.invalid)
.map((c) => c.id);
- const teams = credentials
- .filter((c) => c.type === app.type && c.teamId)
- .map((c) => {
- const team = userTeams.find((team) => team.id === c.teamId);
- if (!team) {
- return null;
- }
- return {
- teamId: team.id,
- name: team.name,
- logo: team.logo,
- credentialId: c.id,
- isAdmin:
- team.members[0].role === MembershipRole.ADMIN || team.members[0].role === MembershipRole.OWNER,
- };
- });
+ const teams = await Promise.all(
+ credentials
+ .filter((c) => c.type === app.type && c.teamId)
+ .map(async (c) => {
+ const team = userTeams.find((team) => team.id === c.teamId);
+ if (!team) {
+ return null;
+ }
+ return {
+ teamId: team.id,
+ name: team.name,
+ logo: team.logo,
+ credentialId: c.id,
+ isAdmin:
+ team.members[0].role === MembershipRole.ADMIN ||
+ team.members[0].role === MembershipRole.OWNER,
+ };
+ })
+ );
// type infer as CredentialOwner
const credentialOwner: CredentialOwner = {
name: user.name,
avatar: user.avatar,
};
+ // We need to know if app is payment type
+ let isSetupAlready = false;
+ if (credential && app.categories.includes("payment")) {
+ const paymentApp = (await appStore[app.dirName as keyof typeof appStore]()) as PaymentApp | null;
+ if (paymentApp && "lib" in paymentApp && paymentApp?.lib && "PaymentService" in paymentApp?.lib) {
+ const PaymentService = paymentApp.lib.PaymentService;
+ const paymentInstance = new PaymentService(credential);
+ isSetupAlready = paymentInstance.isSetupAlready();
+ }
+ }
+
return {
...app,
...(teams.length && {
@@ -169,8 +185,9 @@ export const integrationsHandler = async ({ ctx, input }: IntegrationsOptions) =
invalidCredentialIds,
teams,
isInstalled: !!userCredentialIds.length || !!teams.length || app.isGlobal,
+ isSetupAlready,
};
- }
+ })
);
if (variant) {
diff --git a/packages/trpc/server/routers/viewer/bookings/_router.tsx b/packages/trpc/server/routers/viewer/bookings/_router.tsx
index 8e0c15a9a9b..294541b0171 100644
--- a/packages/trpc/server/routers/viewer/bookings/_router.tsx
+++ b/packages/trpc/server/routers/viewer/bookings/_router.tsx
@@ -1,7 +1,9 @@
import authedProcedure from "../../../procedures/authedProcedure";
+import publicProcedure from "../../../procedures/publicProcedure";
import { router } from "../../../trpc";
import { ZConfirmInputSchema } from "./confirm.schema";
import { ZEditLocationInputSchema } from "./editLocation.schema";
+import { ZFindInputSchema } from "./find.schema";
import { ZGetInputSchema } from "./get.schema";
import { ZGetBookingAttendeesInputSchema } from "./getBookingAttendees.schema";
import { ZRequestRescheduleInputSchema } from "./requestReschedule.schema";
@@ -13,6 +15,7 @@ type BookingsRouterHandlerCache = {
editLocation?: typeof import("./editLocation.handler").editLocationHandler;
confirm?: typeof import("./confirm.handler").confirmHandler;
getBookingAttendees?: typeof import("./getBookingAttendees.handler").getBookingAttendeesHandler;
+ find?: typeof import("./find.handler").getHandler;
};
const UNSTABLE_HANDLER_CACHE: BookingsRouterHandlerCache = {};
@@ -105,4 +108,20 @@ export const bookingsRouter = router({
input,
});
}),
+
+ find: publicProcedure.input(ZFindInputSchema).query(async ({ input, ctx }) => {
+ if (!UNSTABLE_HANDLER_CACHE.find) {
+ UNSTABLE_HANDLER_CACHE.find = await import("./find.handler").then((mod) => mod.getHandler);
+ }
+
+ // Unreachable code but required for type safety
+ if (!UNSTABLE_HANDLER_CACHE.find) {
+ throw new Error("Failed to load handler");
+ }
+
+ return UNSTABLE_HANDLER_CACHE.find({
+ ctx,
+ input,
+ });
+ }),
});
diff --git a/packages/trpc/server/routers/viewer/bookings/find.handler.ts b/packages/trpc/server/routers/viewer/bookings/find.handler.ts
new file mode 100644
index 00000000000..c3bf39a574e
--- /dev/null
+++ b/packages/trpc/server/routers/viewer/bookings/find.handler.ts
@@ -0,0 +1,36 @@
+import type { PrismaClient } from "@calcom/prisma";
+
+import type { TFindInputSchema } from "./find.schema";
+
+type GetOptions = {
+ ctx: {
+ prisma: PrismaClient;
+ };
+ input: TFindInputSchema;
+};
+
+export const getHandler = async ({ ctx, input }: GetOptions) => {
+ const { prisma } = ctx;
+ const { bookingUid } = input;
+
+ const booking = await prisma.booking.findUnique({
+ where: {
+ uid: bookingUid,
+ },
+ select: {
+ id: true,
+ uid: true,
+ startTime: true,
+ endTime: true,
+ description: true,
+ status: true,
+ paid: true,
+ eventTypeId: true,
+ },
+ });
+
+ // Don't leak anything private from the booking
+ return {
+ booking,
+ };
+};
diff --git a/packages/trpc/server/routers/viewer/bookings/find.schema.ts b/packages/trpc/server/routers/viewer/bookings/find.schema.ts
new file mode 100644
index 00000000000..eb4afb1eed5
--- /dev/null
+++ b/packages/trpc/server/routers/viewer/bookings/find.schema.ts
@@ -0,0 +1,9 @@
+import { z } from "zod";
+
+const ZFindInputSchema = z.object({
+ bookingUid: z.string().optional(),
+});
+
+export type TFindInputSchema = z.infer<typeof ZFindInputSchema>;
+
+export { ZFindInputSchema };
diff --git a/packages/trpc/server/routers/viewer/eventTypes/update.handler.ts b/packages/trpc/server/routers/viewer/eventTypes/update.handler.ts
index d9f4fe76675..1f5fb9e13b5 100644
--- a/packages/trpc/server/routers/viewer/eventTypes/update.handler.ts
+++ b/packages/trpc/server/routers/viewer/eventTypes/update.handler.ts
@@ -245,12 +245,26 @@ export const updateHandler = async ({ ctx, input }: UpdateOptions) => {
* but the real detail will be inside app metadata, so with this you can have different prices in different apps
* So the price and currency inside eventType will be deprecated soon or just keep as reference.
*/
- if (input?.metadata?.apps?.stripe?.price || input?.metadata?.apps?.paypal?.price) {
- data.price = input.metadata.apps.stripe?.price || input.metadata.apps.paypal?.price;
+ if (
+ input.metadata?.apps?.alby?.price ||
+ input?.metadata?.apps?.paypal?.price ||
+ input?.metadata?.apps?.stripe?.price
+ ) {
+ data.price =
+ input.metadata?.apps?.alby?.price ||
+ input.metadata.apps.paypal?.price ||
+ input.metadata.apps.stripe?.price;
}
- if (input?.metadata?.apps?.stripe?.currency || input?.metadata?.apps?.paypal?.currency) {
- data.currency = input.metadata.apps.stripe?.currency || input.metadata.apps.paypal?.currency;
+ if (
+ input.metadata?.apps?.alby?.currency ||
+ input?.metadata?.apps?.paypal?.currency ||
+ input?.metadata?.apps?.stripe?.currency
+ ) {
+ data.currency =
+ input.metadata?.apps?.alby?.currency ||
+ input.metadata.apps.paypal?.currency ||
+ input.metadata.apps.stripe?.currency;
}
const connectedLink = await ctx.prisma.hashedLink.findFirst({
diff --git a/packages/types/PaymentService.d.ts b/packages/types/PaymentService.d.ts
index 0e89669a476..c0bc52316bb 100644
--- a/packages/types/PaymentService.d.ts
+++ b/packages/types/PaymentService.d.ts
@@ -1,10 +1,11 @@
import type { Payment, Prisma, Booking, PaymentOption } from "@prisma/client";
+import type { PaymentService } from "@calcom/app-store/paypal/lib/PaymentService";
import type { CalendarEvent } from "@calcom/types/Calendar";
export interface PaymentApp {
lib?: {
- PaymentService: IAbstractPaymentService;
+ PaymentService: typeof PaymentService;
};
}
@@ -32,6 +33,7 @@ export interface IAbstractPaymentService {
payment: Pick<Prisma.PaymentUncheckedCreateInput, "amount" | "currency">,
bookingId?: Booking["id"]
): Promise<Payment>;
+
update(paymentId: Payment["id"], data: Partial<Prisma.PaymentUncheckedCreateInput>): Promise<Payment>;
refund(paymentId: Payment["id"]): Promise<Payment>;
getPaymentPaidStatus(): Promise<string>;
@@ -47,4 +49,5 @@ export interface IAbstractPaymentService {
paymentData: Payment
): Promise<void>;
deletePayment(paymentId: Payment["id"]): Promise<boolean>;
+ isSetupAlready(): boolean;
}
diff --git a/packages/ui/components/icon/SatSymbol.tsx b/packages/ui/components/icon/SatSymbol.tsx
new file mode 100644
index 00000000000..157c8d156db
--- /dev/null
+++ b/packages/ui/components/icon/SatSymbol.tsx
@@ -0,0 +1,55 @@
+import React, { forwardRef } from "react";
+
+export const SatSymbol = forwardRef<SVGSVGElement, React.SVGProps<SVGSVGElement>>(function SatSymbol(props) {
+ return (
+ <svg
+ className={props.className}
+ id="Layer_1"
+ data-name="Layer 1"
+ xmlns="http://www.w3.org/2000/svg"
+ viewBox="0 0 360 360">
+ <title>Satoshis</title>
+
+ <rect
+ fill="currentColor"
+ x="201.48"
+ y="37.16"
+ width="23.49"
+ height="40.14"
+ transform="translate(21.82 -52.79) rotate(14.87)"
+ />
+ <rect
+ fill="currentColor"
+ x="135.03"
+ y="287.5"
+ width="23.49"
+ height="40.14"
+ transform="translate(83.82 -27.36) rotate(14.87)"
+ />
+ <rect
+ fill="currentColor"
+ x="184.27"
+ y="38.29"
+ width="23.49"
+ height="167.49"
+ transform="translate(364.26 -36.11) rotate(104.87)"
+ />
+ <rect
+ fill="currentColor"
+ x="168.36"
+ y="98.26"
+ width="23.49"
+ height="167.49"
+ transform="translate(402.22 54.61) rotate(104.87)"
+ />
+ <rect
+ fill="currentColor"
+ x="152.89"
+ y="156.52"
+ width="23.49"
+ height="167.49"
+ transform="translate(439.1 142.78) rotate(104.87)"
+ />
+ </svg>
+ );
+});
diff --git a/packages/ui/components/icon/Spinner.tsx b/packages/ui/components/icon/Spinner.tsx
new file mode 100644
index 00000000000..689748ed499
--- /dev/null
+++ b/packages/ui/components/icon/Spinner.tsx
@@ -0,0 +1,22 @@
+import React, { forwardRef } from "react";
+
+export const Spinner = forwardRef<SVGSVGElement, React.SVGProps<SVGSVGElement>>(function Spinner(props) {
+ return (
+ <svg
+ className={props.className}
+ id="Layer_1"
+ data-name="Layer 1"
+ viewBox="0 0 24 24"
+ xmlns="http://www.w3.org/2000/svg">
+ <path
+ className="fill-default"
+ d="M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z"
+ opacity=".25"
+ />
+ <path
+ className="animate-spinning fill-emphasis origin-center"
+ d="M10.14,1.16a11,11,0,0,0-9,8.92A1.59,1.59,0,0,0,2.46,12,1.52,1.52,0,0,0,4.11,10.7a8,8,0,0,1,6.66-6.61A1.42,1.42,0,0,0,12,2.69h0A1.57,1.57,0,0,0,10.14,1.16Z"
+ />
+ </svg>
+ );
+});
diff --git a/packages/ui/package.json b/packages/ui/package.json
index f4731faa780..7e44b2f922e 100644
--- a/packages/ui/package.json
+++ b/packages/ui/package.json
@@ -8,7 +8,9 @@
".": "./index.tsx",
"./components/toast": "./components/toast/index.tsx",
"./components/icon": "./components/icon/index.ts",
- "./components/icon/Discord": "./components/icon/Discord.tsx"
+ "./components/icon/Discord": "./components/icon/Discord.tsx",
+ "./components/icon/SatSymbol": "./components/icon/SatSymbol.tsx",
+ "./components/icon/Spinner": "./components/icon/Spinner.tsx"
},
"types": "./index.tsx",
"license": "MIT",
diff --git a/yarn.lock b/yarn.lock
index b983921e19f..c76e9a427be 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1283,7 +1283,7 @@ __metadata:
languageName: node
linkType: hard
-"@babel/code-frame@npm:^7.0.0, @babel/code-frame@npm:^7.10.4, @babel/code-frame@npm:^7.12.13, @babel/code-frame@npm:^7.16.7, @babel/code-frame@npm:^7.18.6, @babel/code-frame@npm:^7.22.10, @babel/code-frame@npm:^7.22.5, @babel/code-frame@npm:^7.5.5, @babel/code-frame@npm:^7.8.3":
+"@babel/code-frame@npm:^7.0.0, @babel/code-frame@npm:^7.10.4, @babel/code-frame@npm:^7.12.13, @babel/code-frame@npm:^7.16.7, @babel/code-frame@npm:^7.18.6, @babel/code-frame@npm:^7.22.10, @babel/code-frame@npm:^7.22.13, @babel/code-frame@npm:^7.22.5, @babel/code-frame@npm:^7.5.5, @babel/code-frame@npm:^7.8.3":
version: 7.22.13
resolution: "@babel/code-frame@npm:7.22.13"
dependencies:
@@ -1324,7 +1324,7 @@ __metadata:
languageName: node
linkType: hard
-"@babel/core@npm:^7.1.0, @babel/core@npm:^7.12.10, @babel/core@npm:^7.12.3, @babel/core@npm:^7.14.0, @babel/core@npm:^7.18.10, @babel/core@npm:^7.19.6, @babel/core@npm:^7.22.9, @babel/core@npm:^7.7.5":
+"@babel/core@npm:^7.1.0, @babel/core@npm:^7.12.10, @babel/core@npm:^7.12.3, @babel/core@npm:^7.18.10, @babel/core@npm:^7.19.6, @babel/core@npm:^7.7.5":
version: 7.22.11
resolution: "@babel/core@npm:7.22.11"
dependencies:
@@ -1347,6 +1347,29 @@ __metadata:
languageName: node
linkType: hard
+"@babel/core@npm:^7.14.0, @babel/core@npm:^7.22.9":
+ version: 7.23.0
+ resolution: "@babel/core@npm:7.23.0"
+ dependencies:
+ "@ampproject/remapping": ^2.2.0
+ "@babel/code-frame": ^7.22.13
+ "@babel/generator": ^7.23.0
+ "@babel/helper-compilation-targets": ^7.22.15
+ "@babel/helper-module-transforms": ^7.23.0
+ "@babel/helpers": ^7.23.0
+ "@babel/parser": ^7.23.0
+ "@babel/template": ^7.22.15
+ "@babel/traverse": ^7.23.0
+ "@babel/types": ^7.23.0
+ convert-source-map: ^2.0.0
+ debug: ^4.1.0
+ gensync: ^1.0.0-beta.2
+ json5: ^2.2.3
+ semver: ^6.3.1
+ checksum: cebd9b48dbc970a7548522f207f245c69567e5ea17ebb1a4e4de563823cf20a01177fe8d2fe19b6e1461361f92fa169fd0b29f8ee9d44eeec84842be1feee5f2
+ languageName: node
+ linkType: hard
+
"@babel/generator@npm:7.17.7":
version: 7.17.7
resolution: "@babel/generator@npm:7.17.7"
@@ -1358,7 +1381,7 @@ __metadata:
languageName: node
linkType: hard
-"@babel/generator@npm:^7.12.11, @babel/generator@npm:^7.12.5, @babel/generator@npm:^7.14.0, @babel/generator@npm:^7.17.3, @babel/generator@npm:^7.18.13, @babel/generator@npm:^7.22.10":
+"@babel/generator@npm:^7.12.11, @babel/generator@npm:^7.12.5, @babel/generator@npm:^7.17.3, @babel/generator@npm:^7.22.10":
version: 7.22.10
resolution: "@babel/generator@npm:7.22.10"
dependencies:
@@ -1370,6 +1393,18 @@ __metadata:
languageName: node
linkType: hard
+"@babel/generator@npm:^7.14.0, @babel/generator@npm:^7.18.13, @babel/generator@npm:^7.23.0":
+ version: 7.23.0
+ resolution: "@babel/generator@npm:7.23.0"
+ dependencies:
+ "@babel/types": ^7.23.0
+ "@jridgewell/gen-mapping": ^0.3.2
+ "@jridgewell/trace-mapping": ^0.3.17
+ jsesc: ^2.5.1
+ checksum: 8efe24adad34300f1f8ea2add420b28171a646edc70f2a1b3e1683842f23b8b7ffa7e35ef0119294e1901f45bfea5b3dc70abe1f10a1917ccdfb41bed69be5f1
+ languageName: node
+ linkType: hard
+
"@babel/helper-annotate-as-pure@npm:^7.18.6, @babel/helper-annotate-as-pure@npm:^7.22.5":
version: 7.22.5
resolution: "@babel/helper-annotate-as-pure@npm:7.22.5"
@@ -1401,6 +1436,19 @@ __metadata:
languageName: node
linkType: hard
+"@babel/helper-compilation-targets@npm:^7.22.15":
+ version: 7.22.15
+ resolution: "@babel/helper-compilation-targets@npm:7.22.15"
+ dependencies:
+ "@babel/compat-data": ^7.22.9
+ "@babel/helper-validator-option": ^7.22.15
+ browserslist: ^4.21.9
+ lru-cache: ^5.1.1
+ semver: ^6.3.1
+ checksum: ce85196769e091ae54dd39e4a80c2a9df1793da8588e335c383d536d54f06baf648d0a08fc873044f226398c4ded15c4ae9120ee18e7dfd7c639a68e3cdc9980
+ languageName: node
+ linkType: hard
+
"@babel/helper-create-class-features-plugin@npm:^7.18.6, @babel/helper-create-class-features-plugin@npm:^7.21.0, @babel/helper-create-class-features-plugin@npm:^7.22.10, @babel/helper-create-class-features-plugin@npm:^7.22.11, @babel/helper-create-class-features-plugin@npm:^7.22.5":
version: 7.22.11
resolution: "@babel/helper-create-class-features-plugin@npm:7.22.11"
@@ -1473,6 +1521,13 @@ __metadata:
languageName: node
linkType: hard
+"@babel/helper-environment-visitor@npm:^7.22.20":
+ version: 7.22.20
+ resolution: "@babel/helper-environment-visitor@npm:7.22.20"
+ checksum: d80ee98ff66f41e233f36ca1921774c37e88a803b2f7dca3db7c057a5fea0473804db9fb6729e5dbfd07f4bed722d60f7852035c2c739382e84c335661590b69
+ languageName: node
+ linkType: hard
+
"@babel/helper-function-name@npm:^7.16.7, @babel/helper-function-name@npm:^7.22.5":
version: 7.22.5
resolution: "@babel/helper-function-name@npm:7.22.5"
@@ -1483,6 +1538,16 @@ __metadata:
languageName: node
linkType: hard
+"@babel/helper-function-name@npm:^7.23.0":
+ version: 7.23.0
+ resolution: "@babel/helper-function-name@npm:7.23.0"
+ dependencies:
+ "@babel/template": ^7.22.15
+ "@babel/types": ^7.23.0
+ checksum: e44542257b2d4634a1f979244eb2a4ad8e6d75eb6761b4cfceb56b562f7db150d134bc538c8e6adca3783e3bc31be949071527aa8e3aab7867d1ad2d84a26e10
+ languageName: node
+ linkType: hard
+
"@babel/helper-hoist-variables@npm:^7.16.7, @babel/helper-hoist-variables@npm:^7.22.5":
version: 7.22.5
resolution: "@babel/helper-hoist-variables@npm:7.22.5"
@@ -1510,6 +1575,15 @@ __metadata:
languageName: node
linkType: hard
+"@babel/helper-module-imports@npm:^7.22.15":
+ version: 7.22.15
+ resolution: "@babel/helper-module-imports@npm:7.22.15"
+ dependencies:
+ "@babel/types": ^7.22.15
+ checksum: ecd7e457df0a46f889228f943ef9b4a47d485d82e030676767e6a2fdcbdaa63594d8124d4b55fd160b41c201025aec01fc27580352b1c87a37c9c6f33d116702
+ languageName: node
+ linkType: hard
+
"@babel/helper-module-transforms@npm:^7.12.1, @babel/helper-module-transforms@npm:^7.22.5, @babel/helper-module-transforms@npm:^7.22.9":
version: 7.22.9
resolution: "@babel/helper-module-transforms@npm:7.22.9"
@@ -1525,6 +1599,21 @@ __metadata:
languageName: node
linkType: hard
+"@babel/helper-module-transforms@npm:^7.23.0":
+ version: 7.23.0
+ resolution: "@babel/helper-module-transforms@npm:7.23.0"
+ dependencies:
+ "@babel/helper-environment-visitor": ^7.22.20
+ "@babel/helper-module-imports": ^7.22.15
+ "@babel/helper-simple-access": ^7.22.5
+ "@babel/helper-split-export-declaration": ^7.22.6
+ "@babel/helper-validator-identifier": ^7.22.20
+ peerDependencies:
+ "@babel/core": ^7.0.0
+ checksum: 6e2afffb058cf3f8ce92f5116f710dda4341c81cfcd872f9a0197ea594f7ce0ab3cb940b0590af2fe99e60d2e5448bfba6bca8156ed70a2ed4be2adc8586c891
+ languageName: node
+ linkType: hard
+
"@babel/helper-optimise-call-expression@npm:^7.22.5":
version: 7.22.5
resolution: "@babel/helper-optimise-call-expression@npm:7.22.5"
@@ -1615,6 +1704,20 @@ __metadata:
languageName: node
linkType: hard
+"@babel/helper-validator-identifier@npm:^7.22.20":
+ version: 7.22.20
+ resolution: "@babel/helper-validator-identifier@npm:7.22.20"
+ checksum: 136412784d9428266bcdd4d91c32bcf9ff0e8d25534a9d94b044f77fe76bc50f941a90319b05aafd1ec04f7d127cd57a179a3716009ff7f3412ef835ada95bdc
+ languageName: node
+ linkType: hard
+
+"@babel/helper-validator-option@npm:^7.22.15":
+ version: 7.22.15
+ resolution: "@babel/helper-validator-option@npm:7.22.15"
+ checksum: 68da52b1e10002a543161494c4bc0f4d0398c8fdf361d5f7f4272e95c45d5b32d974896d44f6a0ea7378c9204988879d73613ca683e13bd1304e46d25ff67a8d
+ languageName: node
+ linkType: hard
+
"@babel/helper-validator-option@npm:^7.22.5":
version: 7.22.5
resolution: "@babel/helper-validator-option@npm:7.22.5"
@@ -1644,6 +1747,17 @@ __metadata:
languageName: node
linkType: hard
+"@babel/helpers@npm:^7.23.0":
+ version: 7.23.1
+ resolution: "@babel/helpers@npm:7.23.1"
+ dependencies:
+ "@babel/template": ^7.22.15
+ "@babel/traverse": ^7.23.0
+ "@babel/types": ^7.23.0
+ checksum: acfc345102045c24ea2a4d60e00dcf8220e215af3add4520e2167700661338e6a80bd56baf44bb764af05ec6621101c9afc315dc107e18c61fa6da8acbdbb893
+ languageName: node
+ linkType: hard
+
"@babel/highlight@npm:^7.22.13":
version: 7.22.13
resolution: "@babel/highlight@npm:7.22.13"
@@ -1655,7 +1769,7 @@ __metadata:
languageName: node
linkType: hard
-"@babel/parser@npm:^7.12.11, @babel/parser@npm:^7.12.7, @babel/parser@npm:^7.14.0, @babel/parser@npm:^7.14.7, @babel/parser@npm:^7.16.8, @babel/parser@npm:^7.17.3, @babel/parser@npm:^7.20.5, @babel/parser@npm:^7.22.11, @babel/parser@npm:^7.22.5":
+"@babel/parser@npm:^7.12.11, @babel/parser@npm:^7.12.7, @babel/parser@npm:^7.14.7, @babel/parser@npm:^7.17.3, @babel/parser@npm:^7.20.5, @babel/parser@npm:^7.22.11, @babel/parser@npm:^7.22.5":
version: 7.22.14
resolution: "@babel/parser@npm:7.22.14"
bin:
@@ -1664,6 +1778,15 @@ __metadata:
languageName: node
linkType: hard
+"@babel/parser@npm:^7.14.0, @babel/parser@npm:^7.16.8, @babel/parser@npm:^7.22.15, @babel/parser@npm:^7.23.0":
+ version: 7.23.0
+ resolution: "@babel/parser@npm:7.23.0"
+ bin:
+ parser: ./bin/babel-parser.js
+ checksum: 453fdf8b9e2c2b7d7b02139e0ce003d1af21947bbc03eb350fb248ee335c9b85e4ab41697ddbdd97079698de825a265e45a0846bb2ed47a2c7c1df833f42a354
+ languageName: node
+ linkType: hard
+
"@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@npm:^7.22.5":
version: 7.22.5
resolution: "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@npm:7.22.5"
@@ -2129,7 +2252,18 @@ __metadata:
languageName: node
linkType: hard
-"@babel/plugin-transform-block-scoping@npm:^7.0.0, @babel/plugin-transform-block-scoping@npm:^7.12.12, @babel/plugin-transform-block-scoping@npm:^7.22.10":
+"@babel/plugin-transform-block-scoping@npm:^7.0.0":
+ version: 7.23.0
+ resolution: "@babel/plugin-transform-block-scoping@npm:7.23.0"
+ dependencies:
+ "@babel/helper-plugin-utils": ^7.22.5
+ peerDependencies:
+ "@babel/core": ^7.0.0-0
+ checksum: 0cfe925cc3b5a3ad407e2253fab3ceeaa117a4b291c9cb245578880872999bca91bd83ffa0128ae9ca356330702e1ef1dcb26804f28d2cef678239caf629f73e
+ languageName: node
+ linkType: hard
+
+"@babel/plugin-transform-block-scoping@npm:^7.12.12, @babel/plugin-transform-block-scoping@npm:^7.22.10":
version: 7.22.10
resolution: "@babel/plugin-transform-block-scoping@npm:7.22.10"
dependencies:
@@ -2165,7 +2299,26 @@ __metadata:
languageName: node
linkType: hard
-"@babel/plugin-transform-classes@npm:^7.0.0, @babel/plugin-transform-classes@npm:^7.12.1, @babel/plugin-transform-classes@npm:^7.22.6":
+"@babel/plugin-transform-classes@npm:^7.0.0":
+ version: 7.22.15
+ resolution: "@babel/plugin-transform-classes@npm:7.22.15"
+ dependencies:
+ "@babel/helper-annotate-as-pure": ^7.22.5
+ "@babel/helper-compilation-targets": ^7.22.15
+ "@babel/helper-environment-visitor": ^7.22.5
+ "@babel/helper-function-name": ^7.22.5
+ "@babel/helper-optimise-call-expression": ^7.22.5
+ "@babel/helper-plugin-utils": ^7.22.5
+ "@babel/helper-replace-supers": ^7.22.9
+ "@babel/helper-split-export-declaration": ^7.22.6
+ globals: ^11.1.0
+ peerDependencies:
+ "@babel/core": ^7.0.0-0
+ checksum: d3f4d0c107dd8a3557ea3575cc777fab27efa92958b41e4a9822f7499725c1f554beae58855de16ddec0a7b694e45f59a26cea8fbde4275563f72f09c6e039a0
+ languageName: node
+ linkType: hard
+
+"@babel/plugin-transform-classes@npm:^7.12.1, @babel/plugin-transform-classes@npm:^7.22.6":
version: 7.22.6
resolution: "@babel/plugin-transform-classes@npm:7.22.6"
dependencies:
@@ -2196,7 +2349,18 @@ __metadata:
languageName: node
linkType: hard
-"@babel/plugin-transform-destructuring@npm:^7.0.0, @babel/plugin-transform-destructuring@npm:^7.12.1, @babel/plugin-transform-destructuring@npm:^7.22.10":
+"@babel/plugin-transform-destructuring@npm:^7.0.0":
+ version: 7.23.0
+ resolution: "@babel/plugin-transform-destructuring@npm:7.23.0"
+ dependencies:
+ "@babel/helper-plugin-utils": ^7.22.5
+ peerDependencies:
+ "@babel/core": ^7.0.0-0
+ checksum: cd6dd454ccc2766be551e4f8a04b1acc2aa539fa19e5c7501c56cc2f8cc921dd41a7ffb78455b4c4b2f954fcab8ca4561ba7c9c7bd5af9f19465243603d18cc3
+ languageName: node
+ linkType: hard
+
+"@babel/plugin-transform-destructuring@npm:^7.12.1, @babel/plugin-transform-destructuring@npm:^7.22.10":
version: 7.22.10
resolution: "@babel/plugin-transform-destructuring@npm:7.22.10"
dependencies:
@@ -2278,7 +2442,18 @@ __metadata:
languageName: node
linkType: hard
-"@babel/plugin-transform-for-of@npm:^7.0.0, @babel/plugin-transform-for-of@npm:^7.12.1, @babel/plugin-transform-for-of@npm:^7.22.5":
+"@babel/plugin-transform-for-of@npm:^7.0.0":
+ version: 7.22.15
+ resolution: "@babel/plugin-transform-for-of@npm:7.22.15"
+ dependencies:
+ "@babel/helper-plugin-utils": ^7.22.5
+ peerDependencies:
+ "@babel/core": ^7.0.0-0
+ checksum: f395ae7bce31e14961460f56cf751b5d6e37dd27d7df5b1f4e49fec1c11b6f9cf71991c7ffbe6549878591e87df0d66af798cf26edfa4bfa6b4c3dba1fb2f73a
+ languageName: node
+ linkType: hard
+
+"@babel/plugin-transform-for-of@npm:^7.12.1, @babel/plugin-transform-for-of@npm:^7.22.5":
version: 7.22.5
resolution: "@babel/plugin-transform-for-of@npm:7.22.5"
dependencies:
@@ -2360,7 +2535,20 @@ __metadata:
languageName: node
linkType: hard
-"@babel/plugin-transform-modules-commonjs@npm:^7.0.0, @babel/plugin-transform-modules-commonjs@npm:^7.22.11":
+"@babel/plugin-transform-modules-commonjs@npm:^7.0.0":
+ version: 7.23.0
+ resolution: "@babel/plugin-transform-modules-commonjs@npm:7.23.0"
+ dependencies:
+ "@babel/helper-module-transforms": ^7.23.0
+ "@babel/helper-plugin-utils": ^7.22.5
+ "@babel/helper-simple-access": ^7.22.5
+ peerDependencies:
+ "@babel/core": ^7.0.0-0
+ checksum: 7fb25997194053e167c4207c319ff05362392da841bd9f42ddb3caf9c8798a5d203bd926d23ddf5830fdf05eddc82c2810f40d1287e3a4f80b07eff13d1024b5
+ languageName: node
+ linkType: hard
+
+"@babel/plugin-transform-modules-commonjs@npm:^7.22.11":
version: 7.22.11
resolution: "@babel/plugin-transform-modules-commonjs@npm:7.22.11"
dependencies:
@@ -2498,7 +2686,18 @@ __metadata:
languageName: node
linkType: hard
-"@babel/plugin-transform-parameters@npm:^7.0.0, @babel/plugin-transform-parameters@npm:^7.12.1, @babel/plugin-transform-parameters@npm:^7.20.7, @babel/plugin-transform-parameters@npm:^7.22.5":
+"@babel/plugin-transform-parameters@npm:^7.0.0":
+ version: 7.22.15
+ resolution: "@babel/plugin-transform-parameters@npm:7.22.15"
+ dependencies:
+ "@babel/helper-plugin-utils": ^7.22.5
+ peerDependencies:
+ "@babel/core": ^7.0.0-0
+ checksum: 541188bb7d1876cad87687b5c7daf90f63d8208ae83df24acb1e2b05020ad1c78786b2723ca4054a83fcb74fb6509f30c4cacc5b538ee684224261ad5fb047c1
+ languageName: node
+ linkType: hard
+
+"@babel/plugin-transform-parameters@npm:^7.12.1, @babel/plugin-transform-parameters@npm:^7.20.7, @babel/plugin-transform-parameters@npm:^7.22.5":
version: 7.22.5
resolution: "@babel/plugin-transform-parameters@npm:7.22.5"
dependencies:
@@ -2590,7 +2789,22 @@ __metadata:
languageName: node
linkType: hard
-"@babel/plugin-transform-react-jsx@npm:^7.0.0, @babel/plugin-transform-react-jsx@npm:^7.12.12, @babel/plugin-transform-react-jsx@npm:^7.18.10, @babel/plugin-transform-react-jsx@npm:^7.19.0, @babel/plugin-transform-react-jsx@npm:^7.22.5":
+"@babel/plugin-transform-react-jsx@npm:^7.0.0":
+ version: 7.22.15
+ resolution: "@babel/plugin-transform-react-jsx@npm:7.22.15"
+ dependencies:
+ "@babel/helper-annotate-as-pure": ^7.22.5
+ "@babel/helper-module-imports": ^7.22.15
+ "@babel/helper-plugin-utils": ^7.22.5
+ "@babel/plugin-syntax-jsx": ^7.22.5
+ "@babel/types": ^7.22.15
+ peerDependencies:
+ "@babel/core": ^7.0.0-0
+ checksum: 3899054e89550c3a0ef041af7c47ee266e2e934f498ee80fefeda778a6aa177b48aa8b4d2a8bf5848de977fec564571699ab952d9fa089c4c19b45ddb121df09
+ languageName: node
+ linkType: hard
+
+"@babel/plugin-transform-react-jsx@npm:^7.12.12, @babel/plugin-transform-react-jsx@npm:^7.18.10, @babel/plugin-transform-react-jsx@npm:^7.19.0, @babel/plugin-transform-react-jsx@npm:^7.22.5":
version: 7.22.5
resolution: "@babel/plugin-transform-react-jsx@npm:7.22.5"
dependencies:
@@ -2945,7 +3159,7 @@ __metadata:
languageName: node
linkType: hard
-"@babel/runtime@npm:^7.0.0, @babel/runtime@npm:^7.1.2, @babel/runtime@npm:^7.10.2, @babel/runtime@npm:^7.11.2, @babel/runtime@npm:^7.12.0, @babel/runtime@npm:^7.12.5, @babel/runtime@npm:^7.13.10, @babel/runtime@npm:^7.14.8, @babel/runtime@npm:^7.15.4, @babel/runtime@npm:^7.16.3, @babel/runtime@npm:^7.17.8, @babel/runtime@npm:^7.20.1, @babel/runtime@npm:^7.20.13, @babel/runtime@npm:^7.20.6, @babel/runtime@npm:^7.21.0, @babel/runtime@npm:^7.22.5, @babel/runtime@npm:^7.3.1, @babel/runtime@npm:^7.5.0, @babel/runtime@npm:^7.5.5, @babel/runtime@npm:^7.7.2, @babel/runtime@npm:^7.7.6, @babel/runtime@npm:^7.8.4, @babel/runtime@npm:^7.8.7, @babel/runtime@npm:^7.9.2":
+"@babel/runtime@npm:^7.0.0, @babel/runtime@npm:^7.1.2, @babel/runtime@npm:^7.10.2, @babel/runtime@npm:^7.11.2, @babel/runtime@npm:^7.12.0, @babel/runtime@npm:^7.12.5, @babel/runtime@npm:^7.13.10, @babel/runtime@npm:^7.14.8, @babel/runtime@npm:^7.15.4, @babel/runtime@npm:^7.16.3, @babel/runtime@npm:^7.17.8, @babel/runtime@npm:^7.20.1, @babel/runtime@npm:^7.20.13, @babel/runtime@npm:^7.20.6, @babel/runtime@npm:^7.22.5, @babel/runtime@npm:^7.3.1, @babel/runtime@npm:^7.5.0, @babel/runtime@npm:^7.5.5, @babel/runtime@npm:^7.7.2, @babel/runtime@npm:^7.7.6, @babel/runtime@npm:^7.8.4, @babel/runtime@npm:^7.8.7, @babel/runtime@npm:^7.9.2":
version: 7.22.11
resolution: "@babel/runtime@npm:7.22.11"
dependencies:
@@ -2954,6 +3168,15 @@ __metadata:
languageName: node
linkType: hard
+"@babel/runtime@npm:^7.21.0":
+ version: 7.23.1
+ resolution: "@babel/runtime@npm:7.23.1"
+ dependencies:
+ regenerator-runtime: ^0.14.0
+ checksum: 0cd0d43e6e7dc7f9152fda8c8312b08321cda2f56ef53d6c22ebdd773abdc6f5d0a69008de90aa41908d00e2c1facb24715ff121274e689305c858355ff02c70
+ languageName: node
+ linkType: hard
+
"@babel/runtime@npm:~7.5.4":
version: 7.5.5
resolution: "@babel/runtime@npm:7.5.5"
@@ -2963,7 +3186,7 @@ __metadata:
languageName: node
linkType: hard
-"@babel/template@npm:^7.12.7, @babel/template@npm:^7.18.10, @babel/template@npm:^7.22.5":
+"@babel/template@npm:^7.12.7, @babel/template@npm:^7.22.5":
version: 7.22.5
resolution: "@babel/template@npm:7.22.5"
dependencies:
@@ -2974,6 +3197,17 @@ __metadata:
languageName: node
linkType: hard
+"@babel/template@npm:^7.18.10, @babel/template@npm:^7.22.15":
+ version: 7.22.15
+ resolution: "@babel/template@npm:7.22.15"
+ dependencies:
+ "@babel/code-frame": ^7.22.13
+ "@babel/parser": ^7.22.15
+ "@babel/types": ^7.22.15
+ checksum: 1f3e7dcd6c44f5904c184b3f7fe280394b191f2fed819919ffa1e529c259d5b197da8981b6ca491c235aee8dbad4a50b7e31304aa531271cb823a4a24a0dd8fd
+ languageName: node
+ linkType: hard
+
"@babel/traverse@npm:7.17.3":
version: 7.17.3
resolution: "@babel/traverse@npm:7.17.3"
@@ -2992,7 +3226,7 @@ __metadata:
languageName: node
linkType: hard
-"@babel/traverse@npm:^7.1.6, @babel/traverse@npm:^7.12.11, @babel/traverse@npm:^7.12.9, @babel/traverse@npm:^7.13.0, @babel/traverse@npm:^7.14.0, @babel/traverse@npm:^7.16.8, @babel/traverse@npm:^7.22.11":
+"@babel/traverse@npm:^7.1.6, @babel/traverse@npm:^7.12.11, @babel/traverse@npm:^7.12.9, @babel/traverse@npm:^7.13.0, @babel/traverse@npm:^7.22.11":
version: 7.22.11
resolution: "@babel/traverse@npm:7.22.11"
dependencies:
@@ -3010,6 +3244,24 @@ __metadata:
languageName: node
linkType: hard
+"@babel/traverse@npm:^7.14.0, @babel/traverse@npm:^7.16.8, @babel/traverse@npm:^7.23.0":
+ version: 7.23.0
+ resolution: "@babel/traverse@npm:7.23.0"
+ dependencies:
+ "@babel/code-frame": ^7.22.13
+ "@babel/generator": ^7.23.0
+ "@babel/helper-environment-visitor": ^7.22.20
+ "@babel/helper-function-name": ^7.23.0
+ "@babel/helper-hoist-variables": ^7.22.5
+ "@babel/helper-split-export-declaration": ^7.22.6
+ "@babel/parser": ^7.23.0
+ "@babel/types": ^7.23.0
+ debug: ^4.1.0
+ globals: ^11.1.0
+ checksum: 0b17fae53269e1af2cd3edba00892bc2975ad5df9eea7b84815dab07dfec2928c451066d51bc65b4be61d8499e77db7e547ce69ef2a7b0eca3f96269cb43a0b0
+ languageName: node
+ linkType: hard
+
"@babel/types@npm:7.17.0":
version: 7.17.0
resolution: "@babel/types@npm:7.17.0"
@@ -3020,7 +3272,18 @@ __metadata:
languageName: node
linkType: hard
-"@babel/types@npm:^7.0.0, @babel/types@npm:^7.12.11, @babel/types@npm:^7.12.7, @babel/types@npm:^7.16.8, @babel/types@npm:^7.17.0, @babel/types@npm:^7.18.13, @babel/types@npm:^7.2.0, @babel/types@npm:^7.22.10, @babel/types@npm:^7.22.11, @babel/types@npm:^7.22.5, @babel/types@npm:^7.4.4, @babel/types@npm:^7.8.3":
+"@babel/types@npm:^7.0.0, @babel/types@npm:^7.16.8, @babel/types@npm:^7.18.13, @babel/types@npm:^7.22.15, @babel/types@npm:^7.23.0":
+ version: 7.23.0
+ resolution: "@babel/types@npm:7.23.0"
+ dependencies:
+ "@babel/helper-string-parser": ^7.22.5
+ "@babel/helper-validator-identifier": ^7.22.20
+ to-fast-properties: ^2.0.0
+ checksum: 215fe04bd7feef79eeb4d33374b39909ce9cad1611c4135a4f7fdf41fe3280594105af6d7094354751514625ea92d0875aba355f53e86a92600f290e77b0e604
+ languageName: node
+ linkType: hard
+
+"@babel/types@npm:^7.12.11, @babel/types@npm:^7.12.7, @babel/types@npm:^7.17.0, @babel/types@npm:^7.2.0, @babel/types@npm:^7.22.10, @babel/types@npm:^7.22.11, @babel/types@npm:^7.22.5, @babel/types@npm:^7.4.4, @babel/types@npm:^7.8.3":
version: 7.22.11
resolution: "@babel/types@npm:7.22.11"
dependencies:
@@ -3115,6 +3378,11 @@ __metadata:
dependencies:
"@calcom/lib": "*"
"@calcom/types": "*"
+ "@getalby/lightning-tools": ^4.0.2
+ "@getalby/sdk": ^2.4.0
+ "@webbtc/webln-types": ^2.0.1
+ react-qr-code: ^2.0.12
+ svix: ^0.85.1
languageName: unknown
linkType: soft
@@ -3354,7 +3622,7 @@ __metadata:
"@calcom/ui": "*"
"@headlessui/react": ^1.5.0
"@heroicons/react": ^1.0.6
- "@prisma/client": ^5.3.0
+ "@prisma/client": ^5.0.0
"@tailwindcss/forms": ^0.5.2
"@types/node": 16.9.1
"@types/react": 18.0.26
@@ -3366,7 +3634,7 @@ __metadata:
next-auth: ^4.22.1
next-i18next: ^13.2.2
postcss: ^8.4.18
- prisma: ^5.3.0
+ prisma: ^5.0.0
prisma-field-encryption: ^1.4.0
react: ^18.2.0
react-chartjs-2: ^4.0.1
@@ -5747,6 +6015,27 @@ __metadata:
languageName: node
linkType: hard
+"@getalby/lightning-tools@npm:^4.0.2":
+ version: 4.0.2
+ resolution: "@getalby/lightning-tools@npm:4.0.2"
+ dependencies:
+ crypto-js: ^4.1.1
+ light-bolt11-decoder: ^3.0.0
+ checksum: 661fe1efe2478a2e747f1f9206dda61cd786b76d4aac15fd27d69772ad7d32f4dc898b3352cc6e99372cee9d3d31c63d0beb5bdf948baa85a5a2b8b4947e6cf2
+ languageName: node
+ linkType: hard
+
+"@getalby/sdk@npm:^2.4.0":
+ version: 2.4.0
+ resolution: "@getalby/sdk@npm:2.4.0"
+ dependencies:
+ crypto-js: ^4.1.1
+ events: ^3.3.0
+ nostr-tools: 1.13.1
+ checksum: 70441646784a51f9664a5e929c1db30f62e54907ec637ce9874f43df9064096a0b348ec11bed11f1dcfbd3920eda684f4a7c1ab1c81fc5eecf17495a9d931a5e
+ languageName: node
+ linkType: hard
+
"@glidejs/glide@npm:^3.5.2":
version: 3.5.2
resolution: "@glidejs/glide@npm:3.5.2"
@@ -5958,9 +6247,9 @@ __metadata:
languageName: node
linkType: hard
-"@graphql-tools/delegate@npm:^10.0.0":
- version: 10.0.2
- resolution: "@graphql-tools/delegate@npm:10.0.2"
+"@graphql-tools/delegate@npm:^10.0.0, @graphql-tools/delegate@npm:^10.0.3":
+ version: 10.0.3
+ resolution: "@graphql-tools/delegate@npm:10.0.3"
dependencies:
"@graphql-tools/batch-execute": ^9.0.1
"@graphql-tools/executor": ^1.0.0
@@ -5970,7 +6259,7 @@ __metadata:
tslib: ^2.5.0
peerDependencies:
graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0
- checksum: 3641dd03b241234cc0bc15221e1bd7e82f003f0bdb59a04cfaba23b5dc43d3aed1f068cc79d526dd731f6e4acfd90c9e20287feb565b9c881ed441c5008e32db
+ checksum: 999b04ebcf92bb0978b1d1c059a8b152bd42a4d6aaa47441305fd662d40dcd27f2a2b5b35e3c4da96661a2f15178bee4235af8f918db0788c0f1454555a667b2
languageName: node
linkType: hard
@@ -6008,17 +6297,17 @@ __metadata:
linkType: hard
"@graphql-tools/executor-legacy-ws@npm:^1.0.0":
- version: 1.0.1
- resolution: "@graphql-tools/executor-legacy-ws@npm:1.0.1"
+ version: 1.0.3
+ resolution: "@graphql-tools/executor-legacy-ws@npm:1.0.3"
dependencies:
"@graphql-tools/utils": ^10.0.0
"@types/ws": ^8.0.0
isomorphic-ws: 5.0.0
tslib: ^2.4.0
- ws: 8.13.0
+ ws: 8.14.1
peerDependencies:
graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0
- checksum: 80dc7dfa2e3288d624dac101551d8b0ba79b1cdb5114f8188abea18d2644ebcef02c044fbe780113e50e8ddb6525ce9a32c6625a4eadf07dab3b3eef4135fe04
+ checksum: 037f488a5e51181557c3e32e702ddf82cebb7d5f50727ba83bfe9930dbfa363ed40ec4d83e9d7778d116bce9b761d0d77862da260788e1bd03601f31541a8efb
languageName: node
linkType: hard
@@ -6245,30 +6534,30 @@ __metadata:
linkType: hard
"@graphql-tools/utils@npm:^10.0.0, @graphql-tools/utils@npm:^10.0.2, @graphql-tools/utils@npm:^10.0.5":
- version: 10.0.5
- resolution: "@graphql-tools/utils@npm:10.0.5"
+ version: 10.0.6
+ resolution: "@graphql-tools/utils@npm:10.0.6"
dependencies:
"@graphql-typed-document-node/core": ^3.1.1
dset: ^3.1.2
tslib: ^2.4.0
peerDependencies:
graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0
- checksum: 600eb668b0a80264a56d1bfc2b431073a620de8ffea959362a1d13c4e0dd5738b627cc508ead8ecdbd7c1a2da05d5664e43443e15d3b221a809fa1a0e2740193
+ checksum: 1eae5ff2056930edf1b5a6aa38a2b28c2b3da0260d4d6babbd3fb25f8638b04c7ea8a481b3e1d4d965d81f2123b577646afb0fe20da87e76362d6f7f099e4be9
languageName: node
linkType: hard
"@graphql-tools/wrap@npm:^10.0.0":
- version: 10.0.0
- resolution: "@graphql-tools/wrap@npm:10.0.0"
+ version: 10.0.1
+ resolution: "@graphql-tools/wrap@npm:10.0.1"
dependencies:
- "@graphql-tools/delegate": ^10.0.0
+ "@graphql-tools/delegate": ^10.0.3
"@graphql-tools/schema": ^10.0.0
"@graphql-tools/utils": ^10.0.0
tslib: ^2.4.0
value-or-promise: ^1.0.12
peerDependencies:
graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0
- checksum: f7ce366cdd479c3f73c3c98f66fa13c528c63e2f791083e78ca14e010ebcd359b5c9bd78e2e8bd437a705418b87584eb6512f1eeb1971b81560c79c6fb3a4a6e
+ checksum: e94d63301c045688cd7bfd6cff4375de42b344eea3c4e604b9e98d29c3544d2222435e2e3f5ada0c0db690e364af630246ccc56f2b299addc93c2e77d6dd72d1
languageName: node
linkType: hard
@@ -7536,6 +7825,29 @@ __metadata:
languageName: node
linkType: hard
+"@noble/curves@npm:1.1.0, @noble/curves@npm:~1.1.0":
+ version: 1.1.0
+ resolution: "@noble/curves@npm:1.1.0"
+ dependencies:
+ "@noble/hashes": 1.3.1
+ checksum: 2658cdd3f84f71079b4e3516c47559d22cf4b55c23ac8ee9d2b1f8e5b72916d9689e59820e0f9d9cb4a46a8423af5b56dc6bb7782405c88be06a015180508db5
+ languageName: node
+ linkType: hard
+
+"@noble/hashes@npm:1.3.1":
+ version: 1.3.1
+ resolution: "@noble/hashes@npm:1.3.1"
+ checksum: 7fdefc0f7a0c1ec27acc6ff88841793e3f93ec4ce6b8a6a12bfc0dd70ae6b7c4c82fe305fdfeda1735d5ad4a9eebe761e6693b3d355689c559e91242f4bc95b1
+ languageName: node
+ linkType: hard
+
+"@noble/hashes@npm:~1.3.0, @noble/hashes@npm:~1.3.1":
+ version: 1.3.2
+ resolution: "@noble/hashes@npm:1.3.2"
+ checksum: fe23536b436539d13f90e4b9be843cc63b1b17666a07634a2b1259dded6f490be3d050249e6af98076ea8f2ea0d56f578773c2197f2aa0eeaa5fba5bc18ba474
+ languageName: node
+ linkType: hard
+
"@node-ipc/js-queue@npm:2.0.3":
version: 2.0.3
resolution: "@node-ipc/js-queue@npm:2.0.3"
@@ -7804,31 +8116,31 @@ __metadata:
languageName: node
linkType: hard
-"@prisma/client@npm:^5.2.0":
- version: 5.2.0
- resolution: "@prisma/client@npm:5.2.0"
+"@prisma/client@npm:^5.0.0":
+ version: 5.3.1
+ resolution: "@prisma/client@npm:5.3.1"
dependencies:
- "@prisma/engines-version": 5.2.0-25.2804dc98259d2ea960602aca6b8e7fdc03c1758f
+ "@prisma/engines-version": 5.3.1-2.61e140623197a131c2a6189271ffee05a7aa9a59
peerDependencies:
prisma: "*"
peerDependenciesMeta:
prisma:
optional: true
- checksum: ad523b7a54e31d365ecac7bdb89f5a89f62e616f5f567f5dd5060e86b122253a4652ea778c0ccbab31906e2170110e808839fbae7ee91a4fd16a8282ee86f5f1
+ checksum: 8017b721a231ab7b2b0f932507b02bf075aae2c6f6e630a69d7089ff33bab44fa50b50dd8a81655b7202092ffc19717d484ae5f183fc4f2a1822b0d228991a7c
languageName: node
linkType: hard
-"@prisma/client@npm:^5.3.0":
- version: 5.3.0
- resolution: "@prisma/client@npm:5.3.0"
+"@prisma/client@npm:^5.2.0":
+ version: 5.2.0
+ resolution: "@prisma/client@npm:5.2.0"
dependencies:
- "@prisma/engines-version": 5.3.0-36.e90b936d84779543cbe0e494bc8b9d7337fad8e4
+ "@prisma/engines-version": 5.2.0-25.2804dc98259d2ea960602aca6b8e7fdc03c1758f
peerDependencies:
prisma: "*"
peerDependenciesMeta:
prisma:
optional: true
- checksum: 7c12db57dfd07e86841876a7e91ee2307071b6b9e7afed061acac1171ef1f12599fd65ca144abd09ab1e00123304d2103adc9106c73cef61a366cd234ccc9683
+ checksum: ad523b7a54e31d365ecac7bdb89f5a89f62e616f5f567f5dd5060e86b122253a4652ea778c0ccbab31906e2170110e808839fbae7ee91a4fd16a8282ee86f5f1
languageName: node
linkType: hard
@@ -7843,25 +8155,25 @@ __metadata:
languageName: node
linkType: hard
-"@prisma/debug@npm:5.1.1":
- version: 5.1.1
- resolution: "@prisma/debug@npm:5.1.1"
+"@prisma/debug@npm:5.2.0":
+ version: 5.2.0
+ resolution: "@prisma/debug@npm:5.2.0"
dependencies:
"@types/debug": 4.1.8
debug: 4.3.4
strip-ansi: 6.0.1
- checksum: ab073c70aac7f8240b70c6021b7f46b34a0bbbe6a220fe503cd34bfd6c7b9890916f42c6bc7b7345a3225f8ea9d9744064e716fe39fb2d40e44c752689ee3415
+ checksum: 49b71106afb9666fc3c95cd4368bc7664a6deb9b9be15e9de98af5e78b56c6d7df1ff8a8a2dcdceac330f6d32f94d10c503ee55d60b5b9b4df36ac438da66004
languageName: node
linkType: hard
-"@prisma/debug@npm:5.2.0":
- version: 5.2.0
- resolution: "@prisma/debug@npm:5.2.0"
+"@prisma/debug@npm:5.3.1":
+ version: 5.3.1
+ resolution: "@prisma/debug@npm:5.3.1"
dependencies:
"@types/debug": 4.1.8
debug: 4.3.4
strip-ansi: 6.0.1
- checksum: 49b71106afb9666fc3c95cd4368bc7664a6deb9b9be15e9de98af5e78b56c6d7df1ff8a8a2dcdceac330f6d32f94d10c503ee55d60b5b9b4df36ac438da66004
+ checksum: 9eaddf4b4d60a1bd41901a9d28b4f37ae369e4b952f53cdd02681eaadfff81222ef29fe73f37a6060746eeb5e457a26d9aa1cbdc217e882aeab7e48dce74e1d5
languageName: node
linkType: hard
@@ -7872,10 +8184,10 @@ __metadata:
languageName: node
linkType: hard
-"@prisma/engines-version@npm:5.3.0-36.e90b936d84779543cbe0e494bc8b9d7337fad8e4":
- version: 5.3.0-36.e90b936d84779543cbe0e494bc8b9d7337fad8e4
- resolution: "@prisma/engines-version@npm:5.3.0-36.e90b936d84779543cbe0e494bc8b9d7337fad8e4"
- checksum: 7c3680bc4e3147755b7efc094d6b0ad11ba1c59eb0436f81016e8f0b1da886cc7a4bce9dccfe9599811cf986558694ec1b0b60f21c1215bd6cc0e42e3a03569f
+"@prisma/engines-version@npm:5.3.1-2.61e140623197a131c2a6189271ffee05a7aa9a59":
+ version: 5.3.1-2.61e140623197a131c2a6189271ffee05a7aa9a59
+ resolution: "@prisma/engines-version@npm:5.3.1-2.61e140623197a131c2a6189271ffee05a7aa9a59"
+ checksum: c1adf540c9330a54a000c3005a4621c5d8355f2e3b159121587d33f82bf5992f567ac453f0ce76dd48fac427ec4dbc55942228fcee10d522b0d2c03bddbe422a
languageName: node
linkType: hard
@@ -7886,10 +8198,10 @@ __metadata:
languageName: node
linkType: hard
-"@prisma/engines@npm:5.3.0":
- version: 5.3.0
- resolution: "@prisma/engines@npm:5.3.0"
- checksum: 4735c7a2b1f01a47f5a870cc4bbfaca5632df8a712d20d371e707e9a8d32f92fb808a2031c78504459bdebc562f67156fa8334c258ea47adf073ef4143b52e7f
+"@prisma/engines@npm:5.3.1":
+ version: 5.3.1
+ resolution: "@prisma/engines@npm:5.3.1"
+ checksum: a231adad60ac42569b560ea9782bc181818d8ad15e65283d1317bda5d7aa754e5b536a3f9365ce1eda8961e1eff4eca5978c456fa9764a867fe4339d123e7371
languageName: node
linkType: hard
@@ -7903,14 +8215,14 @@ __metadata:
linkType: hard
"@prisma/generator-helper@npm:^5.0.0":
- version: 5.1.1
- resolution: "@prisma/generator-helper@npm:5.1.1"
+ version: 5.3.1
+ resolution: "@prisma/generator-helper@npm:5.3.1"
dependencies:
- "@prisma/debug": 5.1.1
+ "@prisma/debug": 5.3.1
"@types/cross-spawn": 6.0.2
cross-spawn: 7.0.3
kleur: 4.1.5
- checksum: e576e0396031e0f90442c5fd37c0ee13894d03d89d4d9c572e787268156fcda960a969773c37030f3d66271c56424c34c988ac15c75be5dde5f71c6be7266bf6
+ checksum: 2cb0cf86c1719db5007d3ac46d2e0a741d1431d26cda032d180b2edbad7a849c2d7b8cb90fbd1638da24de429ac1b6b0c4326eab38d2d97f66f774361ec11206
languageName: node
linkType: hard
@@ -8352,6 +8664,30 @@ __metadata:
languageName: node
linkType: hard
+"@radix-ui/react-dismissable-layer@npm:1.0.5":
+ version: 1.0.5
+ resolution: "@radix-ui/react-dismissable-layer@npm:1.0.5"
+ dependencies:
+ "@babel/runtime": ^7.13.10
+ "@radix-ui/primitive": 1.0.1
+ "@radix-ui/react-compose-refs": 1.0.1
+ "@radix-ui/react-primitive": 1.0.3
+ "@radix-ui/react-use-callback-ref": 1.0.1
+ "@radix-ui/react-use-escape-keydown": 1.0.3
+ peerDependencies:
+ "@types/react": "*"
+ "@types/react-dom": "*"
+ react: ^16.8 || ^17.0 || ^18.0
+ react-dom: ^16.8 || ^17.0 || ^18.0
+ peerDependenciesMeta:
+ "@types/react":
+ optional: true
+ "@types/react-dom":
+ optional: true
+ checksum: e73cf4bd3763f4d55b1bea7486a9700384d7d94dc00b1d5a75e222b2f1e4f32bc667a206ca4ed3baaaf7424dce7a239afd0ba59a6f0d89c3462c4e6e8d029a04
+ languageName: node
+ linkType: hard
+
"@radix-ui/react-dropdown-menu@npm:^2.0.5":
version: 2.0.5
resolution: "@radix-ui/react-dropdown-menu@npm:2.0.5"
@@ -8548,8 +8884,8 @@ __metadata:
linkType: hard
"@radix-ui/react-navigation-menu@npm:^1.0.0":
- version: 1.1.3
- resolution: "@radix-ui/react-navigation-menu@npm:1.1.3"
+ version: 1.1.4
+ resolution: "@radix-ui/react-navigation-menu@npm:1.1.4"
dependencies:
"@babel/runtime": ^7.13.10
"@radix-ui/primitive": 1.0.1
@@ -8557,7 +8893,7 @@ __metadata:
"@radix-ui/react-compose-refs": 1.0.1
"@radix-ui/react-context": 1.0.1
"@radix-ui/react-direction": 1.0.1
- "@radix-ui/react-dismissable-layer": 1.0.4
+ "@radix-ui/react-dismissable-layer": 1.0.5
"@radix-ui/react-id": 1.0.1
"@radix-ui/react-presence": 1.0.1
"@radix-ui/react-primitive": 1.0.3
@@ -8576,7 +8912,7 @@ __metadata:
optional: true
"@types/react-dom":
optional: true
- checksum: 006b3df72fcbad1eb8db7ca157fed6c6517e036c4725c5b5083eadf7046429a5d23fbe4dde7acee5a2bfdcb71ba53ecbf859f1b5a2b33eac93e6e5410bc2d7e1
+ checksum: cdbb2621262597689a173011ec4745c219e5d8fe83965035bd8778c062b11ca7ac731178b8cdfdc33df3fc9d5e35d630dcf6c4a31a55428360f65c89f15e8f74
languageName: node
linkType: hard
@@ -9545,6 +9881,41 @@ __metadata:
languageName: node
linkType: hard
+"@scure/base@npm:1.1.1":
+ version: 1.1.1
+ resolution: "@scure/base@npm:1.1.1"
+ checksum: b4fc810b492693e7e8d0107313ac74c3646970c198bbe26d7332820886fa4f09441991023ec9aa3a2a51246b74409ab5ebae2e8ef148bbc253da79ac49130309
+ languageName: node
+ linkType: hard
+
+"@scure/base@npm:~1.1.0":
+ version: 1.1.3
+ resolution: "@scure/base@npm:1.1.3"
+ checksum: 1606ab8a4db898cb3a1ada16c15437c3bce4e25854fadc8eb03ae93cbbbac1ed90655af4b0be3da37e12056fef11c0374499f69b9e658c9e5b7b3e06353c630c
+ languageName: node
+ linkType: hard
+
+"@scure/bip32@npm:1.3.1":
+ version: 1.3.1
+ resolution: "@scure/bip32@npm:1.3.1"
+ dependencies:
+ "@noble/curves": ~1.1.0
+ "@noble/hashes": ~1.3.1
+ "@scure/base": ~1.1.0
+ checksum: 394d65f77a40651eba21a5096da0f4233c3b50d422864751d373fcf142eeedb94a1149f9ab1dbb078086dab2d0bc27e2b1afec8321bf22d4403c7df2fea5bfe2
+ languageName: node
+ linkType: hard
+
+"@scure/bip39@npm:1.2.1":
+ version: 1.2.1
+ resolution: "@scure/bip39@npm:1.2.1"
+ dependencies:
+ "@noble/hashes": ~1.3.0
+ "@scure/base": ~1.1.0
+ checksum: c5bd6f1328fdbeae2dcdd891825b1610225310e5e62a4942714db51066866e4f7bef242c7b06a1b9dcc8043a4a13412cf5c5df76d3b10aa9e36b82e9b6e3eeaa
+ languageName: node
+ linkType: hard
+
"@selderee/plugin-htmlparser2@npm:^0.11.0":
version: 0.11.0
resolution: "@selderee/plugin-htmlparser2@npm:0.11.0"
@@ -11788,11 +12159,11 @@ __metadata:
linkType: hard
"@trpc/client@npm:^10.0.0":
- version: 10.38.1
- resolution: "@trpc/client@npm:10.38.1"
+ version: 10.38.4
+ resolution: "@trpc/client@npm:10.38.4"
peerDependencies:
- "@trpc/server": 10.38.1
- checksum: b37dab8703582913411a24400c361f019a1f24b3304e77ad3b4c6d700b3aa5e43b8cd2b83e2cd463ccbe12ae45ef42e186c01bbd85b940871adfd05e31553797
+ "@trpc/server": 10.38.4
+ checksum: 017f61d8cea5362d565ba5c935fbf2dcf32e3478bafc52583053685a454a16da6cc8f577454ca3a2fe032eabc472848ba87c3be144c71f19c419a1a6b19a7114
languageName: node
linkType: hard
@@ -11836,9 +12207,9 @@ __metadata:
linkType: hard
"@trpc/server@npm:^10.0.0":
- version: 10.38.1
- resolution: "@trpc/server@npm:10.38.1"
- checksum: f38c74e575400eafcb699dd8846ccecf1449f5d17121e3040d74b88307692fd4693531b855bac7b09fe6d4e2b1b69954646ebf5d1c06ed2e87b27fb98647795c
+ version: 10.38.4
+ resolution: "@trpc/server@npm:10.38.4"
+ checksum: 9cb1ad5395d5ab059a76209f61d6922d1dee3de5fe412417f3fe28c46e29914a20e0342ec3d9798f24a6b37ff7771263bb797be2962f09f1ee6a92f118417c82
languageName: node
linkType: hard
@@ -12103,9 +12474,9 @@ __metadata:
linkType: hard
"@types/debounce@npm:^1.2.1":
- version: 1.2.1
- resolution: "@types/debounce@npm:1.2.1"
- checksum: bea6d414acefbee50adfe87cee10f8a855d033e4778567ab03bdc3cb2648b6bf9237ca53f4ee76fe4be75f77f86d4688411499626fe409bc870f53631d24231f
+ version: 1.2.2
+ resolution: "@types/debounce@npm:1.2.2"
+ checksum: 990d856e5b8f721031e13f8a49865af0b3ffde986a469dea7dfc2bb89bbca00d2b8928b22f99ca78544d98266003804d6bd8b578464c792a6bd8f96456030f66
languageName: node
linkType: hard
@@ -12118,7 +12489,7 @@ __metadata:
languageName: node
linkType: hard
-"@types/debug@npm:4.1.8, @types/debug@npm:^4.0.0":
+"@types/debug@npm:4.1.8":
version: 4.1.8
resolution: "@types/debug@npm:4.1.8"
dependencies:
@@ -12127,6 +12498,15 @@ __metadata:
languageName: node
linkType: hard
+"@types/debug@npm:^4.0.0":
+ version: 4.1.9
+ resolution: "@types/debug@npm:4.1.9"
+ dependencies:
+ "@types/ms": "*"
+ checksum: e88ee8b19d106f33eb0d3bc58bacff9702e98d821fd1ebd1de8942e6b97419e19a1ccf39370f1764a1dc66f79fd4619f3412e1be6eeb9f0b76412f5ffe4ead93
+ languageName: node
+ linkType: hard
+
"@types/detect-port@npm:^1.3.2":
version: 1.3.2
resolution: "@types/detect-port@npm:1.3.2"
@@ -12349,9 +12729,9 @@ __metadata:
linkType: hard
"@types/js-yaml@npm:^4.0.0":
- version: 4.0.5
- resolution: "@types/js-yaml@npm:4.0.5"
- checksum: 7dcac8c50fec31643cc9d6444b5503239a861414cdfaa7ae9a38bc22597c4d850c4b8cec3d82d73b3fbca408348ce223b0408d598b32e094470dfffc6d486b4d
+ version: 4.0.6
+ resolution: "@types/js-yaml@npm:4.0.6"
+ checksum: d4439ec2cc830d355c2a1d7508f49888931b2cfe59d786d27621edd530bf06314b1dceeaa759e21f9b035a0ff623a0ca306752ebb73df9485c02abe045bd962c
languageName: node
linkType: hard
@@ -12465,13 +12845,20 @@ __metadata:
languageName: node
linkType: hard
-"@types/mdurl@npm:*, @types/mdurl@npm:^1.0.0":
+"@types/mdurl@npm:*":
version: 1.0.2
resolution: "@types/mdurl@npm:1.0.2"
checksum: 79c7e523b377f53cf1f5a240fe23d0c6cae856667692bd21bf1d064eafe5ccc40ae39a2aa0a9a51e8c94d1307228c8f6b121e847124591a9a828c3baf65e86e2
languageName: node
linkType: hard
+"@types/mdurl@npm:^1.0.0":
+ version: 1.0.3
+ resolution: "@types/mdurl@npm:1.0.3"
+ checksum: 5bbed4f0eb9f60040fa26be77aa2158ca468b6423876cec0d2043e7f8298e83b8e5b95fb66056327b02d747c4d376aed16c11ff3fdc4cb3dca327a6931a71f18
+ languageName: node
+ linkType: hard
+
"@types/memory-cache@npm:^0.2.2":
version: 0.2.2
resolution: "@types/memory-cache@npm:0.2.2"
@@ -12950,20 +13337,20 @@ __metadata:
linkType: hard
"@types/ws@npm:^8.0.0":
- version: 8.5.5
- resolution: "@types/ws@npm:8.5.5"
+ version: 8.5.6
+ resolution: "@types/ws@npm:8.5.6"
dependencies:
"@types/node": "*"
- checksum: d00bf8070e6938e3ccf933010921c6ce78ac3606696ce37a393b27a9a603f7bd93ea64f3c5fa295a2f743575ba9c9a9fdb904af0f5fe2229bf2adf0630386e4a
+ checksum: 7addb0c5fa4e7713d5209afb8a90f1852b12c02cb537395adf7a05fbaf21205dc5f7c110fd5ad6f3dbf147112cbff33fb11d8633059cb344f0c14f595b1ea1fb
languageName: node
linkType: hard
"@types/xml2js@npm:^0.4.11":
- version: 0.4.11
- resolution: "@types/xml2js@npm:0.4.11"
+ version: 0.4.12
+ resolution: "@types/xml2js@npm:0.4.12"
dependencies:
"@types/node": "*"
- checksum: d0e7d2a8c7e0a53147c777a6756bdea0eb26a3de0d3c1f42c17e63332e4e2dc532f687c19ca26a0518336f5de60e1ec4345d7ef71e7ba0656fcf3390c9388eb5
+ checksum: 6197f6d51d70ba7e6d3169ef6d58adacfeddeb2d8cfe4d2bb24eda86223c7dd77c82896c3aa3c636b3b1442cebc6d05959d1e65fa206dac2caeb99aa2c943716
languageName: node
linkType: hard
@@ -13678,6 +14065,13 @@ __metadata:
languageName: node
linkType: hard
+"@webbtc/webln-types@npm:^2.0.1":
+ version: 2.0.1
+ resolution: "@webbtc/webln-types@npm:2.0.1"
+ checksum: c9fc0e3b4ad37f6b1a14f3a681dae8bd74bc53104bdf8b8bda99d35a08057649abc5a9248916f648a277d9ccf60aa0a8a2138d5827dad5702be6f32307f6c824
+ languageName: node
+ linkType: hard
+
"@whatwg-node/events@npm:^0.0.3":
version: 0.0.3
resolution: "@whatwg-node/events@npm:0.0.3"
@@ -13722,12 +14116,12 @@ __metadata:
linkType: hard
"@whatwg-node/fetch@npm:^0.9.0":
- version: 0.9.9
- resolution: "@whatwg-node/fetch@npm:0.9.9"
+ version: 0.9.13
+ resolution: "@whatwg-node/fetch@npm:0.9.13"
dependencies:
- "@whatwg-node/node-fetch": ^0.4.8
+ "@whatwg-node/node-fetch": ^0.4.17
urlpattern-polyfill: ^9.0.0
- checksum: d77127d264ce3dd99880520c54cf5fad3db1ab3c62c37ab81a3983e9dbc1b349a16aafc003232e7f093cce55129fa07a20e0d5c8585ec8ddb6fd9c22c09cd669
+ checksum: ba46887d9ab6e486066d4cf3911dcfaa7d76ee458abfa6d039e5a34415c8be2383fcbb56b2488f97edb941d9d58d3285c4c293def094f1caac8aed06b7a56da9
languageName: node
linkType: hard
@@ -13744,16 +14138,16 @@ __metadata:
languageName: node
linkType: hard
-"@whatwg-node/node-fetch@npm:^0.4.8":
- version: 0.4.14
- resolution: "@whatwg-node/node-fetch@npm:0.4.14"
+"@whatwg-node/node-fetch@npm:^0.4.17":
+ version: 0.4.19
+ resolution: "@whatwg-node/node-fetch@npm:0.4.19"
dependencies:
"@whatwg-node/events": ^0.1.0
busboy: ^1.6.0
fast-querystring: ^1.1.1
fast-url-parser: ^1.1.3
tslib: ^2.3.1
- checksum: 316e68b0e868f600077627c5a72a5f4e04250b39961cfd333063d697bebebc9bcdad1808b36d1374a068bb31cf2597b9ee08c121ae751cb61e5498fde3ea82e9
+ checksum: 51f6520075d14a4456c773c4105d9b91cbcc1ba819faf5f26e9bf821255a1cd278bf0690e0f323768e54d5389a5b0d0beb0d81fb0ff9f5ab4f877ffb4cf40c2b
languageName: node
linkType: hard
@@ -17256,6 +17650,13 @@ __metadata:
languageName: node
linkType: hard
+"convert-source-map@npm:^2.0.0":
+ version: 2.0.0
+ resolution: "convert-source-map@npm:2.0.0"
+ checksum: 63ae9933be5a2b8d4509daca5124e20c14d023c820258e484e32dc324d34c2754e71297c94a05784064ad27615037ef677e3f0c00469fb55f409d2bb21261035
+ languageName: node
+ linkType: hard
+
"convert-to-spaces@npm:^1.0.1":
version: 1.0.2
resolution: "convert-to-spaces@npm:1.0.2"
@@ -17444,14 +17845,19 @@ __metadata:
linkType: hard
"cosmiconfig@npm:^8.1.0, cosmiconfig@npm:^8.1.3":
- version: 8.2.0
- resolution: "cosmiconfig@npm:8.2.0"
+ version: 8.3.6
+ resolution: "cosmiconfig@npm:8.3.6"
dependencies:
- import-fresh: ^3.2.1
+ import-fresh: ^3.3.0
js-yaml: ^4.1.0
- parse-json: ^5.0.0
+ parse-json: ^5.2.0
path-type: ^4.0.0
- checksum: 836d5d8efa750f3fb17b03d6ca74cd3154ed025dffd045304b3ef59637f662bde1e5dc88f8830080d180ec60841719cf4ea2ce73fb21ec694b16865c478ff297
+ peerDependencies:
+ typescript: ">=4.9.5"
+ peerDependenciesMeta:
+ typescript:
+ optional: true
+ checksum: dc339ebea427898c9e03bf01b56ba7afbac07fc7d2a2d5a15d6e9c14de98275a9565da949375aee1809591c152c0a3877bb86dbeaf74d5bd5aaa79955ad9e7a0
languageName: node
linkType: hard
@@ -17648,6 +18054,13 @@ __metadata:
languageName: node
linkType: hard
+"crypto-js@npm:^4.1.1":
+ version: 4.1.1
+ resolution: "crypto-js@npm:4.1.1"
+ checksum: b3747c12ee3a7632fab3b3e171ea50f78b182545f0714f6d3e7e2858385f0f4101a15f2517e033802ce9d12ba50a391575ff4638c9de3dd9b2c4bc47768d5425
+ languageName: node
+ linkType: hard
+
"crypto@npm:^1.0.1":
version: 1.0.1
resolution: "crypto@npm:1.0.1"
@@ -22201,9 +22614,9 @@ __metadata:
linkType: hard
"graphql@npm:^16.8.0":
- version: 16.8.0
- resolution: "graphql@npm:16.8.0"
- checksum: d853d4085b0c911a7e2a926c3b0d379934ec61cd4329e70cdf281763102f024fd80a97db7a505b8b04fed9050cb4875f8f518150ea854557a500a0b41dcd7f4e
+ version: 16.8.1
+ resolution: "graphql@npm:16.8.1"
+ checksum: 8d304b7b6f708c8c5cc164b06e92467dfe36aff6d4f2cf31dd19c4c2905a0e7b89edac4b7e225871131fd24e21460836b369de0c06532644d15b461d55b1ccc0
languageName: node
linkType: hard
@@ -23040,12 +23453,12 @@ __metadata:
linkType: hard
"https-proxy-agent@npm:^7.0.0":
- version: 7.0.1
- resolution: "https-proxy-agent@npm:7.0.1"
+ version: 7.0.2
+ resolution: "https-proxy-agent@npm:7.0.2"
dependencies:
agent-base: ^7.0.2
debug: 4
- checksum: 2d765c31865071373771f53abdd72912567b76015a4eff61094f586194192950cd89257d50f0e621807a16c083bc8cad5852e3885c6ba154d2ce721a18fac248
+ checksum: 088969a0dd476ea7a0ed0a2cf1283013682b08f874c3bc6696c83fa061d2c157d29ef0ad3eb70a2046010bb7665573b2388d10fdcb3e410a66995e5248444292
languageName: node
linkType: hard
@@ -23227,9 +23640,9 @@ __metadata:
linkType: hard
"iframe-resizer@npm:^4.3.0":
- version: 4.3.6
- resolution: "iframe-resizer@npm:4.3.6"
- checksum: 9ef4178bc1e15335d28adb65686b5b4d784d416558fe02a255b6c77876f2da7c08ef878569eb2bb50be84b33db52927e24134faea7d43b9b3081bb61d2adeef8
+ version: 4.3.7
+ resolution: "iframe-resizer@npm:4.3.7"
+ checksum: 252f459d0350223f3db6ec01649f79c51088653cf2d8edf932542fe92fab79b2a968403cc685af253ea168097f102dbc5ac8c579ece772e05be83fa39a6026bc
languageName: node
linkType: hard
@@ -23302,7 +23715,7 @@ __metadata:
languageName: node
linkType: hard
-"import-fresh@npm:^3.0.0, import-fresh@npm:^3.1.0, import-fresh@npm:^3.2.1":
+"import-fresh@npm:^3.0.0, import-fresh@npm:^3.1.0, import-fresh@npm:^3.2.1, import-fresh@npm:^3.3.0":
version: 3.3.0
resolution: "import-fresh@npm:3.3.0"
dependencies:
@@ -24714,11 +25127,11 @@ __metadata:
linkType: hard
"jiti@npm:^1.17.1, jiti@npm:^1.18.2":
- version: 1.19.3
- resolution: "jiti@npm:1.19.3"
+ version: 1.20.0
+ resolution: "jiti@npm:1.20.0"
bin:
jiti: bin/jiti.js
- checksum: de3dacdfe30948d96b69712b04cc28127c17f43d5233a5aa069933e04ac4c9aaf265bef4cdf2b0c2a6f5af236a58aea9bfea83e8e289e2490802bdff7f99bff7
+ checksum: 7924062b5675142e3e272a27735be84b7bfc0a0eb73217fc2dcafa034f37c4f7b4b9ffc07dd98bcff0f739a8811ce1544db205ae7e97b1c86f0df92c65ce3c72
languageName: node
linkType: hard
@@ -24732,15 +25145,15 @@ __metadata:
linkType: hard
"joi@npm:^17.7.0":
- version: 17.10.0
- resolution: "joi@npm:17.10.0"
+ version: 17.10.2
+ resolution: "joi@npm:17.10.2"
dependencies:
"@hapi/hoek": ^9.0.0
"@hapi/topo": ^5.0.0
"@sideway/address": ^4.1.3
"@sideway/formula": ^3.0.1
"@sideway/pinpoint": ^2.0.0
- checksum: 1a5a0e14e93f40d76e43409348bed222e9d3d6b4547a780a29d1a325e7c9aed820d725ac3ce5826f7a0675979c5fb4bd7a0c7d74219ed3eac83af06c148ed321
+ checksum: 2fac59e83b35465d04ffcd33a937c39795264bdd3d392bebee8034710f84631a400cd320a3bb0bb736e70ce930abb1ea551bc3ffbeca023b53417d864eb216a4
languageName: node
linkType: hard
@@ -25863,6 +26276,15 @@ __metadata:
languageName: node
linkType: hard
+"light-bolt11-decoder@npm:^3.0.0":
+ version: 3.0.0
+ resolution: "light-bolt11-decoder@npm:3.0.0"
+ dependencies:
+ "@scure/base": 1.1.1
+ checksum: 027c2f3be7369f7cf0f1eb566002b5fbbd6132875a678867411bad3162403db52bfc3e9ed30afc19bdae8bd970642efe1b84006cf087ebdb9071effa6c3cbe53
+ languageName: node
+ linkType: hard
+
"lilconfig@npm:2.0.5, lilconfig@npm:^2.0.5":
version: 2.0.5
resolution: "lilconfig@npm:2.0.5"
@@ -28725,6 +29147,19 @@ __metadata:
languageName: node
linkType: hard
+"nostr-tools@npm:1.13.1":
+ version: 1.13.1
+ resolution: "nostr-tools@npm:1.13.1"
+ dependencies:
+ "@noble/curves": 1.1.0
+ "@noble/hashes": 1.3.1
+ "@scure/base": 1.1.1
+ "@scure/bip32": 1.3.1
+ "@scure/bip39": 1.2.1
+ checksum: 49695f94b5d399a29c9d7173fa2927c24247e365a7b17586434c4b442b99b6a35b6b015c01736b12fcaaba5b88884e25c1af1367880111403ea0718db85d5467
+ languageName: node
+ linkType: hard
+
"npm-run-all@npm:^4.1.5":
version: 4.1.5
resolution: "npm-run-all@npm:4.1.5"
@@ -29706,7 +30141,7 @@ __metadata:
languageName: node
linkType: hard
-"parse-json@npm:^5.0.0":
+"parse-json@npm:^5.0.0, parse-json@npm:^5.2.0":
version: 5.2.0
resolution: "parse-json@npm:5.2.0"
dependencies:
@@ -30256,23 +30691,27 @@ __metadata:
languageName: node
linkType: hard
-"playwright-core@npm:1.37.1":
- version: 1.37.1
- resolution: "playwright-core@npm:1.37.1"
+"playwright-core@npm:1.38.1":
+ version: 1.38.1
+ resolution: "playwright-core@npm:1.38.1"
bin:
playwright-core: cli.js
- checksum: 69f818da2230057584140d5b3af7778a4f4a822b5b18d133abfc5d259128becb943c343a2ddf6b0635277a69f28983e83e2bc3fce23595ececb1e410475b6368
+ checksum: 66e83fe040f309b13ad94ba39dea40ac207bfcbbc22de13141af88dbdedd64e1c4e3ce1d0cb070d4efd8050d7e579953ec3681dd8a0acf2c1cc738d9c50e545e
languageName: node
linkType: hard
"playwright@npm:^1.31.2":
- version: 1.37.1
- resolution: "playwright@npm:1.37.1"
+ version: 1.38.1
+ resolution: "playwright@npm:1.38.1"
dependencies:
- playwright-core: 1.37.1
+ fsevents: 2.3.2
+ playwright-core: 1.38.1
+ dependenciesMeta:
+ fsevents:
+ optional: true
bin:
playwright: cli.js
- checksum: 99406ef3e15b83a659cb23ef1d92d9935789aad430580d1e0371087dfdf266891483c6f97cfa06bf5f49f081eacd44245d05d20714f98531edef4cc317044d6b
+ checksum: 4e01d4ee52d9ccf75a80d8492829106802590721d56bff7c5957ff1f21eb3c328ee5bc3c1784a59c4b515df1b98d08ef92e4a35a807f454cd00dc481d30fadc2
languageName: node
linkType: hard
@@ -30882,25 +31321,25 @@ __metadata:
languageName: node
linkType: hard
-"prisma@npm:^5.2.0":
- version: 5.2.0
- resolution: "prisma@npm:5.2.0"
+"prisma@npm:^5.0.0":
+ version: 5.3.1
+ resolution: "prisma@npm:5.3.1"
dependencies:
- "@prisma/engines": 5.2.0
+ "@prisma/engines": 5.3.1
bin:
prisma: build/index.js
- checksum: 8b99ab5a5f801c72b2eb1809db980bd104dfd699cb14c5d5db5b675566c89e46501267399bb2f02bc3ea8fb86fc2f029cccd7178768109dc4d198bc93552b1da
+ checksum: e825adbcb4eec81de276de5507fb7e5486db7788c8c9de36ba6ed73f9e87d9f56b64d0e183a31dc6b80f6737ae1fbcdb110aac44ab89299af646aeb966655bef
languageName: node
linkType: hard
-"prisma@npm:^5.3.0":
- version: 5.3.0
- resolution: "prisma@npm:5.3.0"
+"prisma@npm:^5.2.0":
+ version: 5.2.0
+ resolution: "prisma@npm:5.2.0"
dependencies:
- "@prisma/engines": 5.3.0
+ "@prisma/engines": 5.2.0
bin:
prisma: build/index.js
- checksum: e33cb0b7cb6f10693131782d82dec178a4f13d9f8ea5ac39c206e41d3c1957c3e41c3a16bab95ef6572fde1e852f68b780b351a11204e989bcee7d1b91276dfb
+ checksum: 8b99ab5a5f801c72b2eb1809db980bd104dfd699cb14c5d5db5b675566c89e46501267399bb2f02bc3ea8fb86fc2f029cccd7178768109dc4d198bc93552b1da
languageName: node
linkType: hard
@@ -31042,9 +31481,9 @@ __metadata:
linkType: hard
"property-information@npm:^6.0.0":
- version: 6.2.0
- resolution: "property-information@npm:6.2.0"
- checksum: 23afce07ba821cbe7d926e63cdd680991961c82be4bbb6c0b17c47f48894359c1be6e51cd74485fc10a9d3fd361b475388e1e39311ed2b53127718f72aab1955
+ version: 6.3.0
+ resolution: "property-information@npm:6.3.0"
+ checksum: bf0a15dec097fd4324a42163cabd96b90819e48ef0d8d98756ef0420b2c579bf33646fe0b6e04aa9e79f5a2b5b5860ef11655a79cd8969d8eda58df23c4f96c9
languageName: node
linkType: hard
@@ -31200,6 +31639,13 @@ __metadata:
languageName: node
linkType: hard
+"qr.js@npm:0.0.0":
+ version: 0.0.0
+ resolution: "qr.js@npm:0.0.0"
+ checksum: 5ac6c393967bdeaa660e7fd3a501a25eb538c1f6008a4d30ab2b97bbe520e5c236530090773f1578aa0a523cdaa6923c866615e21143f9e7cd22abd41c789b69
+ languageName: node
+ linkType: hard
+
"qrcode@npm:^1.5.1":
version: 1.5.1
resolution: "qrcode@npm:1.5.1"
@@ -31703,12 +32149,12 @@ __metadata:
linkType: hard
"react-fast-marquee@npm:^1.3.5":
- version: 1.6.0
- resolution: "react-fast-marquee@npm:1.6.0"
+ version: 1.6.1
+ resolution: "react-fast-marquee@npm:1.6.1"
peerDependencies:
react: ">= 16.8.0 || 18.0.0"
react-dom: ">= 16.8.0 || 18.0.0"
- checksum: f448341d30ef417292d8f7618d4931190a6d4aa353fbd276da4dcecc49bb6a7a32962f9cc74fe0af2ea9617d7b453ed3efccf7a0e8709a8b66e04ec04f4ae18c
+ checksum: 35cb639d516ed87d950757ac80ca1ef84b63b64be8400802514225b4566870ead21a6cddcfe1bdd805724a0e173718dde4a9a4162efbabbfee6b6adc490a6eab
languageName: node
linkType: hard
@@ -31951,6 +32397,22 @@ __metadata:
languageName: node
linkType: hard
+"react-qr-code@npm:^2.0.12":
+ version: 2.0.12
+ resolution: "react-qr-code@npm:2.0.12"
+ dependencies:
+ prop-types: ^15.8.1
+ qr.js: 0.0.0
+ peerDependencies:
+ react: ^16.x || ^17.x || ^18.x
+ react-native-svg: "*"
+ peerDependenciesMeta:
+ react-native-svg:
+ optional: true
+ checksum: b7bad40d7d5f04f7ff336ae499920dd5ea0e7616ed7fec5f849e54f8f26b5e4acd1ba8e69198be8617dc7fecdf36cf4302c99ff74885320b55bb95d19a09de7c
+ languageName: node
+ linkType: hard
+
"react-reconciler@npm:^0.26.2":
version: 0.26.2
resolution: "react-reconciler@npm:0.26.2"
@@ -32875,9 +33337,9 @@ __metadata:
linkType: hard
"remeda@npm:^1.24.1":
- version: 1.25.2
- resolution: "remeda@npm:1.25.2"
- checksum: f3a0659a3ef1942b2b0509b6052b521022051ac98a90fac883863df176d7ff44cab1d5df15505ee8bbfc4b33b4d0cef3619b64103579b42c1745d42f6bb09152
+ version: 1.27.0
+ resolution: "remeda@npm:1.27.0"
+ checksum: 0298aba3ade1d5694bf5a8ca592c735f5ed17325d1f1ee8e4bfc5d80384de47cf6cc42093167f8c512dc4e453896f0ac59685598222328545d7c047c990120a4
languageName: node
linkType: hard
@@ -35350,6 +35812,19 @@ __metadata:
languageName: node
linkType: hard
+"svix@npm:^0.85.1":
+ version: 0.85.1
+ resolution: "svix@npm:0.85.1"
+ dependencies:
+ "@stablelib/base64": ^1.0.0
+ es6-promise: ^4.2.4
+ fast-sha256: ^1.3.0
+ svix-fetch: ^3.0.0
+ url-parse: ^1.4.3
+ checksum: cc1fe601affadff33058b0ed18be7ef92f17e893835ded04db133d9d4930ea0a8836c2d9fe289a1c76c566a3f9eb18d2262f94b715c7055615cc561e7d4e546c
+ languageName: node
+ linkType: hard
+
"swagger-client@npm:^3.18.5":
version: 3.18.5
resolution: "swagger-client@npm:3.18.5"
@@ -36925,9 +37400,9 @@ __metadata:
linkType: hard
"ua-parser-js@npm:^1.0.33, ua-parser-js@npm:^1.0.35":
- version: 1.0.35
- resolution: "ua-parser-js@npm:1.0.35"
- checksum: 02370d38a0c8b586f2503d1c3bbba5cbc0b97d407282f9023201a99e4c03eae4357a2800fdf50cf80d73ec25c0b0cc5bfbaa03975b0add4043d6e4c86712c9c1
+ version: 1.0.36
+ resolution: "ua-parser-js@npm:1.0.36"
+ checksum: 5b2c8a5e3443dfbba7624421805de946457c26ae167cb2275781a2729d1518f7067c9d5c74c3b0acac4b9ff3278cae4eace08ca6eecb63848bc3b2f6a63cc975
languageName: node
linkType: hard
@@ -37000,11 +37475,11 @@ __metadata:
linkType: hard
"undici@npm:^5.12.0":
- version: 5.23.0
- resolution: "undici@npm:5.23.0"
+ version: 5.25.2
+ resolution: "undici@npm:5.25.2"
dependencies:
busboy: ^1.6.0
- checksum: 906ca4fb1d47163d2cee2ecbbc664a1d92508a2cdf1558146621109f525c983a83597910b36e6ba468240e95259be5939cea6babc99fc0c36360b16630f66784
+ checksum: 1177a9c4fc9a1ddb765508d0f69ae61c166559badce8d797aaa92beef70ec5ac8fdc420b643f5d8d40b9a37891ba5536e2070d86a9c54a128aec67ad0c862d06
languageName: node
linkType: hard
@@ -39027,9 +39502,9 @@ __metadata:
languageName: node
linkType: hard
-"ws@npm:8.13.0, ws@npm:^8.12.0, ws@npm:^8.13.0":
- version: 8.13.0
- resolution: "ws@npm:8.13.0"
+"ws@npm:8.14.1":
+ version: 8.14.1
+ resolution: "ws@npm:8.14.1"
peerDependencies:
bufferutil: ^4.0.1
utf-8-validate: ">=5.0.2"
@@ -39038,7 +39513,7 @@ __metadata:
optional: true
utf-8-validate:
optional: true
- checksum: 53e991bbf928faf5dc6efac9b8eb9ab6497c69feeb94f963d648b7a3530a720b19ec2e0ec037344257e05a4f35bd9ad04d9de6f289615ffb133282031b18c61c
+ checksum: 9e310be2b0ff69e1f87d8c6d093ecd17a1ed4c37f281d17c35e8c30e2bd116401775b3d503249651374e6e0e1e9905db62fff096b694371c77561aee06bc3466
languageName: node
linkType: hard
@@ -39083,6 +39558,36 @@ __metadata:
languageName: node
linkType: hard
+"ws@npm:^8.12.0":
+ version: 8.14.2
+ resolution: "ws@npm:8.14.2"
+ peerDependencies:
+ bufferutil: ^4.0.1
+ utf-8-validate: ">=5.0.2"
+ peerDependenciesMeta:
+ bufferutil:
+ optional: true
+ utf-8-validate:
+ optional: true
+ checksum: 3ca0dad26e8cc6515ff392b622a1467430814c463b3368b0258e33696b1d4bed7510bc7030f7b72838b9fdeb8dbd8839cbf808367d6aae2e1d668ce741d4308b
+ languageName: node
+ linkType: hard
+
+"ws@npm:^8.13.0":
+ version: 8.13.0
+ resolution: "ws@npm:8.13.0"
+ peerDependencies:
+ bufferutil: ^4.0.1
+ utf-8-validate: ">=5.0.2"
+ peerDependenciesMeta:
+ bufferutil:
+ optional: true
+ utf-8-validate:
+ optional: true
+ checksum: 53e991bbf928faf5dc6efac9b8eb9ab6497c69feeb94f963d648b7a3530a720b19ec2e0ec037344257e05a4f35bd9ad04d9de6f289615ffb133282031b18c61c
+ languageName: node
+ linkType: hard
+
"ws@npm:^8.2.3":
version: 8.8.0
resolution: "ws@npm:8.8.0"
@@ -39640,4 +40145,4 @@ __metadata:
resolution: "zwitch@npm:2.0.4"
checksum: f22ec5fc2d5f02c423c93d35cdfa83573a3a3bd98c66b927c368ea4d0e7252a500df2a90a6b45522be536a96a73404393c958e945fdba95e6832c200791702b6
languageName: node
- linkType: hard
\ No newline at end of file
+ linkType: hard