1 parent
2af27170cd
commit
0d1dd036eb
49 files changed
+1720
No files matched your search
@@ -11,6 +11,7 @@ export const InstallAppButtonMap = {
|
||||
vital: dynamic(() => import("./vital/components/InstallAppButton")),
|
||||
};
|
||||
export const AppSettingsComponentsMap = {
|
||||
"cal-ai": dynamic(() => import("./cal-ai/components/AppSettingsInterface")),
|
||||
"general-app-settings": dynamic(() =>
|
||||
import("./templates/general-app-settings/components/AppSettingsInterface")
|
||||
),
|
||||
|
||||
@@ -9,6 +9,7 @@ import around_config_json from "./around/config.json";
|
||||
import autocheckin_config_json from "./autocheckin/config.json";
|
||||
import baa_for_hipaa_config_json from "./baa-for-hipaa/config.json";
|
||||
import basecamp3_config_json from "./basecamp3/config.json";
|
||||
import cal_ai_config_json from "./cal-ai/config.json";
|
||||
import { metadata as caldavcalendar__metadata_ts } from "./caldavcalendar/_metadata";
|
||||
import campfire_config_json from "./campfire/config.json";
|
||||
import campsite_config_json from "./campsite/config.json";
|
||||
@@ -100,6 +101,7 @@ export const appStoreMetadata = {
|
||||
autocheckin: autocheckin_config_json,
|
||||
"baa-for-hipaa": baa_for_hipaa_config_json,
|
||||
basecamp3: basecamp3_config_json,
|
||||
"cal-ai": cal_ai_config_json,
|
||||
caldavcalendar: caldavcalendar__metadata_ts,
|
||||
campfire: campfire_config_json,
|
||||
campsite: campsite_config_json,
|
||||
|
||||
@@ -10,6 +10,7 @@ export const apiHandlers = {
|
||||
autocheckin: import("./autocheckin/api"),
|
||||
"baa-for-hipaa": import("./baa-for-hipaa/api"),
|
||||
basecamp3: import("./basecamp3/api"),
|
||||
"cal-ai": import("./cal-ai/api"),
|
||||
caldavcalendar: import("./caldavcalendar/api"),
|
||||
campfire: import("./campfire/api"),
|
||||
campsite: import("./campsite/api"),
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
---
|
||||
items:
|
||||
- 1.jpg
|
||||
- 2.jpg
|
||||
- 3.jpg
|
||||
- 4.jpg
|
||||
- 5.jpg
|
||||
---
|
||||
|
||||
{DESCRIPTION}
|
||||
|
||||
## Example questions:
|
||||
|
||||
- "Book a meeting with @cal-user this week at a good time"
|
||||
- "Find a time to meet with not-a-cal-user@gmail.com this week"
|
||||
- "Move my meeting with [Someone's Name] to next week"
|
||||
- "What does my week look like?"
|
||||
- "When is my next meeting?"
|
||||
- "What is my least busy day next week?"
|
||||
- "Cancel the meeting with [Someone's Name]"
|
||||
- "Reschedule the meeting with not-a-cal-user@gmail.com"
|
||||
- "Is @cal-user busy on Friday at noon?"
|
||||
- "Move my meeting at 2pm tomorrow to next week on Friday at 5pm"
|
||||
|
||||
### Or, any of that in a thread:
|
||||
- What meetings do I have this week?
|
||||
- Meeting 1, Meeting 2
|
||||
- Cancel that first meeting
|
||||
|
||||
|
||||
### Or, doing multiple things:
|
||||
- Cancel all my meetings tomorrow then book a quick chat with @joe at noon, a long meeting with @jane at 1 (both tomorrow). Also see if Toby is down to grab dinner this week (toby@gmail.com). Finally send me my updated agenda of everything I have coming up in the next couple days.
|
||||
@@ -0,0 +1,26 @@
|
||||
import type { NextApiRequest, NextApiResponse } from "next";
|
||||
|
||||
import { defaultResponder } from "@calcom/lib/server";
|
||||
|
||||
import checkSession from "../../_utils/auth";
|
||||
import { withPaidAppRedirect } from "../../_utils/paid-apps";
|
||||
import appConfig from "../config.json";
|
||||
|
||||
export async function getHandler(req: NextApiRequest, res: NextApiResponse) {
|
||||
const session = checkSession(req);
|
||||
|
||||
const redirectUrl = await withPaidAppRedirect({
|
||||
appPaidMode: appConfig.paid.mode,
|
||||
appSlug: appConfig.slug,
|
||||
userId: session.user.id,
|
||||
priceId: appConfig.paid.priceId,
|
||||
});
|
||||
|
||||
if (!redirectUrl) {
|
||||
return res.status(500).json({ message: "Failed to create Stripe checkout session" });
|
||||
}
|
||||
|
||||
return { url: redirectUrl };
|
||||
}
|
||||
|
||||
export default defaultResponder(getHandler);
|
||||
@@ -0,0 +1,65 @@
|
||||
import type { NextApiRequest, NextApiResponse } from "next";
|
||||
|
||||
import { defaultResponder } from "@calcom/lib/server";
|
||||
import { createContext } from "@calcom/trpc/server/createContext";
|
||||
import { apiKeysRouter } from "@calcom/trpc/server/routers/viewer/apiKeys/_router";
|
||||
|
||||
import checkSession from "../../_utils/auth";
|
||||
import getInstalledAppPath from "../../_utils/getInstalledAppPath";
|
||||
import { checkInstalled, createDefaultInstallation } from "../../_utils/installation";
|
||||
import { withStripeCallback } from "../../_utils/paid-apps";
|
||||
import appConfig from "../config.json";
|
||||
|
||||
export async function getHandler(req: NextApiRequest, res: NextApiResponse) {
|
||||
const session = checkSession(req);
|
||||
const slug = appConfig.slug;
|
||||
const appType = appConfig.type;
|
||||
|
||||
const { checkoutId } = req.query as { checkoutId: string };
|
||||
if (!checkoutId) {
|
||||
return { url: `/apps/installed?error=${JSON.stringify({ message: "No Stripe Checkout Session ID" })}` };
|
||||
}
|
||||
|
||||
const { url } = await withStripeCallback(checkoutId, slug, async ({ checkoutSession }) => {
|
||||
const ctx = await createContext({ req, res });
|
||||
const caller = apiKeysRouter.createCaller(ctx);
|
||||
|
||||
const apiKey = await caller.create({
|
||||
note: "Cal.ai",
|
||||
expiresAt: null,
|
||||
appId: "cal-ai",
|
||||
});
|
||||
|
||||
await checkInstalled(slug, session.user.id);
|
||||
await createDefaultInstallation({
|
||||
appType,
|
||||
user: session.user,
|
||||
slug,
|
||||
key: {
|
||||
apiKey,
|
||||
},
|
||||
subscriptionId: checkoutSession.subscription?.toString(),
|
||||
billingCycleStart: new Date().getDate(),
|
||||
paymentStatus: "active",
|
||||
});
|
||||
|
||||
await fetch(
|
||||
`${process.env.NODE_ENV === "development" ? "http://localhost:3005" : "https://cal.ai"}/api/onboard`,
|
||||
{
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify({
|
||||
userId: session.user.id,
|
||||
}),
|
||||
}
|
||||
);
|
||||
|
||||
return { url: getInstalledAppPath({ variant: appConfig.variant, slug: "cal-ai" }) };
|
||||
});
|
||||
|
||||
return res.redirect(url);
|
||||
}
|
||||
|
||||
export default defaultResponder(getHandler);
|
||||
@@ -0,0 +1,5 @@
|
||||
import { defaultHandler } from "@calcom/lib/server";
|
||||
|
||||
export default defaultHandler({
|
||||
GET: import("./_getAdd"),
|
||||
});
|
||||
@@ -0,0 +1,5 @@
|
||||
import { defaultHandler } from "@calcom/lib/server";
|
||||
|
||||
export default defaultHandler({
|
||||
GET: import("./_getCallback"),
|
||||
});
|
||||
@@ -0,0 +1,2 @@
|
||||
export { default as add } from "./add";
|
||||
export { default as callback } from "./callback";
|
||||
@@ -0,0 +1,73 @@
|
||||
import { useSession } from "next-auth/react";
|
||||
|
||||
export function MailLink({ subject, body }: { subject: string; body?: string }) {
|
||||
const { data } = useSession();
|
||||
|
||||
return (
|
||||
<a href={`mailto:${data?.user?.username}@cal.ai?subject=${subject}&body=${body ? body : ""}`}>
|
||||
{subject ? subject : body}
|
||||
</a>
|
||||
);
|
||||
}
|
||||
export default function AppSettings() {
|
||||
return (
|
||||
<>
|
||||
<div className="prose-sm prose prose-a:text-default prose-headings:text-emphasis prose-code:text-default prose-strong:text-default text-default">
|
||||
<h2>Example questions:</h2>
|
||||
<ul>
|
||||
<li>
|
||||
<MailLink subject="Book a meeting with @cal-user this week at a good time" />
|
||||
</li>
|
||||
<li>
|
||||
<MailLink subject="Find a time to meet with [email protected] this week" />
|
||||
</li>
|
||||
<li>
|
||||
<MailLink subject="Move my meeting with [Someone's Name] to next week" />
|
||||
</li>
|
||||
<li>
|
||||
<MailLink subject="What does my week look like?" />
|
||||
</li>
|
||||
<li>
|
||||
<MailLink subject="When is my next meeting?" />
|
||||
</li>
|
||||
<li>
|
||||
<MailLink subject="What is my least busy day next week?" />
|
||||
</li>
|
||||
<li>
|
||||
<MailLink subject="Cancel the meeting with [Someone's Name]" />
|
||||
</li>
|
||||
<li>
|
||||
<MailLink subject="Reschedule the meeting with [email protected]" />
|
||||
</li>
|
||||
<li>
|
||||
<MailLink subject="Is @cal-user busy on Friday at noon?" />
|
||||
</li>
|
||||
<li>
|
||||
<MailLink subject="Move my meeting at 2pm tomorrow to next week on Friday at 5pm" />
|
||||
</li>
|
||||
</ul>
|
||||
<h3>Or, any of that in a thread:</h3>
|
||||
<ul>
|
||||
<li>
|
||||
What meetings do I have this week?
|
||||
<ul>
|
||||
<li>Meeting 1, Meeting 2</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Cancel that first meeting</li>
|
||||
</ul>
|
||||
<h3>Or, doing multiple things:</h3>
|
||||
<ul>
|
||||
<li>
|
||||
<MailLink
|
||||
subject=""
|
||||
body="Cancel all my meetings tomorrow then book a quick chat with @joe at noon, a long meeting with
|
||||
@jane at 1 (both tomorrow). Also see if Toby is down to grab dinner this week ([email protected]).
|
||||
Finally send me my updated agenda of everything I have coming up in the next couple days."
|
||||
/>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"/*": "Don't modify slug - If required, do it using cli edit command",
|
||||
"name": "Cal.ai",
|
||||
"slug": "cal-ai",
|
||||
"type": "cal-ai_automation",
|
||||
"logo": "icon.png",
|
||||
"url": "https://cal.ai",
|
||||
"variant": "automation",
|
||||
"categories": ["automation"],
|
||||
"publisher": "Cal.com, Inc.",
|
||||
"email": "[email protected]",
|
||||
"description": "Cal.ai is your AI scheduling assistant. Get your personal email assistant ([email protected]) that you can forward emails to or have a conversation with. Cal.ai will automatically schedule meetings for you.",
|
||||
"isTemplate": false,
|
||||
"__createdUsingCli": true,
|
||||
"__template": "basic",
|
||||
"dirName": "cal-ai",
|
||||
"isOAuth": false,
|
||||
"paid": {
|
||||
"priceInUsd": 8,
|
||||
"priceId": "price_1O1ziDH8UDiwIftkDHp3MCTP",
|
||||
"mode": "subscription"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export * as api from "./api";
|
||||
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"$schema": "https://json.schemastore.org/package.json",
|
||||
"private": true,
|
||||
"name": "@calcom/cal-ai",
|
||||
"version": "0.0.0",
|
||||
"main": "./index.ts",
|
||||
"dependencies": {
|
||||
"@calcom/lib": "*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@calcom/types": "*"
|
||||
},
|
||||
"description": "Cal.ai is your AI scheduling assistant. Get your personal email assistant ([email protected]) that you can forward emails to or have a conversation with. Cal.ai will automatically schedule meetings for you."
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 84 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 87 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 128 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 131 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 130 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 63 KiB |
Reference in new issue
Block a user