Skip to content

Commit 02c86d0

Browse files
feat: cal ai self serve architecture #1 (#22919)
* feat: cal ai self serve architecture * chore: add package * chore: update evnet controller * refactor: improvements * chore: rename * chore: type error and naming * chore: just set it to nul * chore: just set it to nul * chore: some more improvements * chore: packate version * fix: API v2 * chore: change name of files * chore: add select * chore: add missing teamId * chore: save progress * refactor: split into multiple services * refactor: make schema provider agonistic * chore: improvements * chore: * chore: remove duplicate files * chore: semicolon * chore: formatting * refactor: logging and error handling * chore: rename variable * refactor: use trpc error * chore: replace with HttpError * chore: remove from option * We need the enum and not just the type --------- Co-authored-by: Hariom Balhara <[email protected]>
1 parent 49f99d6 commit 02c86d0

File tree

60 files changed

+9351
-20
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+9351
-20
lines changed

apps/api/v2/src/modules/workflows/inputs/workflow-step.input.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export const SMS_ATTENDEE = "sms_attendee";
1010
export const SMS_NUMBER = "sms_number";
1111
export const WHATSAPP_ATTENDEE = "whatsapp_attendee";
1212
export const WHATSAPP_NUMBER = "whatsapp_number";
13+
export const CAL_AI_PHONE_CALL = "cal_ai_phone_call";
1314

1415
export const STEP_ACTIONS = [
1516
EMAIL_HOST,
@@ -19,6 +20,7 @@ export const STEP_ACTIONS = [
1920
SMS_NUMBER,
2021
WHATSAPP_ATTENDEE,
2122
WHATSAPP_NUMBER,
23+
CAL_AI_PHONE_CALL,
2224
] as const;
2325

2426
export const STEP_ACTIONS_TO_ENUM = {
@@ -29,6 +31,7 @@ export const STEP_ACTIONS_TO_ENUM = {
2931
[WHATSAPP_ATTENDEE]: WorkflowActions.WHATSAPP_ATTENDEE,
3032
[WHATSAPP_NUMBER]: WorkflowActions.WHATSAPP_NUMBER,
3133
[SMS_NUMBER]: WorkflowActions.SMS_NUMBER,
34+
[CAL_AI_PHONE_CALL]: WorkflowActions.CAL_AI_PHONE_CALL,
3235
} as const;
3336

3437
export const ENUM_TO_STEP_ACTIONS = {
@@ -39,6 +42,7 @@ export const ENUM_TO_STEP_ACTIONS = {
3942
[WorkflowActions.WHATSAPP_ATTENDEE]: WHATSAPP_ATTENDEE,
4043
[WorkflowActions.WHATSAPP_NUMBER]: WHATSAPP_NUMBER,
4144
[WorkflowActions.SMS_NUMBER]: SMS_NUMBER,
45+
[WorkflowActions.CAL_AI_PHONE_CALL]: CAL_AI_PHONE_CALL,
4246
} as const;
4347

4448
export type StepAction = (typeof STEP_ACTIONS)[number];

apps/web/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@
138138
"react-use-intercom": "1.5.1",
139139
"recoil": "^0.7.7",
140140
"remove-markdown": "^0.5.0",
141+
"retell-sdk": "^4.40.0",
141142
"rrule": "^2.7.1",
142143
"sanitize-html": "^2.10.0",
143144
"schema-dts": "^1.1.0",

apps/web/pages/api/get-inbound-dynamic-variables.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import type { NextApiRequest, NextApiResponse } from "next";
33
import { z } from "zod";
44

55
import dayjs from "@calcom/dayjs";
6-
import { ZGetRetellLLMSchema } from "@calcom/features/ee/cal-ai-phone/zod-utils";
7-
import type { TGetRetellLLMSchema } from "@calcom/features/ee/cal-ai-phone/zod-utils";
6+
import { ZGetRetellLLMSchema } from "@calcom/features/calAIPhone/zod-utils";
7+
import type { TGetRetellLLMSchema } from "@calcom/features/calAIPhone/zod-utils";
88
import { getAvailableSlotsService } from "@calcom/lib/di/containers/available-slots";
99
import { fetcher } from "@calcom/lib/retellAIFetcher";
1010
import { defaultHandler } from "@calcom/lib/server/defaultHandler";

packages/app-store/stripepayment/lib/constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
export const PREMIUM_MONTHLY_PLAN_PRICE = process.env.NEXT_PUBLIC_STRIPE_PREMIUM_PLAN_PRICE_MONTHLY || "";
22
export const PREMIUM_PLAN_PRODUCT_ID = process.env.NEXT_PUBLIC_STRIPE_PREMIUM_PLAN_PRODUCT_ID || "";
33
export const STRIPE_TEAM_MONTHLY_PRICE_ID = process.env.NEXT_PUBLIC_STRIPE_TEAM_MONTHLY_PRICE_ID || "";
4+
export const STRIPE_PHONE_NUMBER_MONTHLY_PRICE_ID = process.env.STRIPE_PHONE_NUMBER_MONTHLY_PRICE_ID || "";
45

56
export const paymentOptions = [
67
{

packages/app-store/stripepayment/lib/utils.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import {
33
PREMIUM_PLAN_PRODUCT_ID,
44
STRIPE_TEAM_MONTHLY_PRICE_ID,
55
PREMIUM_MONTHLY_PLAN_PRICE,
6+
STRIPE_PHONE_NUMBER_MONTHLY_PRICE_ID
67
} from "./constants";
78

89
export const getPremiumMonthlyPlanPriceId = (): string => {
@@ -20,3 +21,8 @@ export function getPerSeatPlanPrice(): string {
2021
export function getPremiumPlanPriceValue() {
2122
return "$29/month";
2223
}
24+
25+
26+
export function getPhoneNumberMonthlyPriceId(){
27+
return STRIPE_PHONE_NUMBER_MONTHLY_PRICE_ID;
28+
}

0 commit comments

Comments
 (0)