Skip to content

Commit d666f29

Browse files
vikaspatil0021hariombalhara
andauthoredJun 14, 2024··
feat: umami app added (#14783)
Co-authored-by: Hariom <hariombalhara@gmail.com>
1 parent 745f0b0 commit d666f29

16 files changed

+123
-0
lines changed
 

‎packages/app-store/apps.browser.generated.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ export const EventTypeAddonMap = {
4646
import("./templates/event-type-app-card/components/EventTypeAppCardInterface")
4747
),
4848
twipla: dynamic(() => import("./twipla/components/EventTypeAppCardInterface")),
49+
umami: dynamic(() => import("./umami/components/EventTypeAppCardInterface")),
4950
"zoho-bigin": dynamic(() => import("./zoho-bigin/components/EventTypeAppCardInterface")),
5051
zohocrm: dynamic(() => import("./zohocrm/components/EventTypeAppCardInterface")),
5152
};

‎packages/app-store/apps.keys-schemas.generated.ts

+2
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ import { appKeysSchema as tandemvideo_zod_ts } from "./tandemvideo/zod";
3737
import { appKeysSchema as booking_pages_tag_zod_ts } from "./templates/booking-pages-tag/zod";
3838
import { appKeysSchema as event_type_app_card_zod_ts } from "./templates/event-type-app-card/zod";
3939
import { appKeysSchema as twipla_zod_ts } from "./twipla/zod";
40+
import { appKeysSchema as umami_zod_ts } from "./umami/zod";
4041
import { appKeysSchema as vital_zod_ts } from "./vital/zod";
4142
import { appKeysSchema as webex_zod_ts } from "./webex/zod";
4243
import { appKeysSchema as wordpress_zod_ts } from "./wordpress/zod";
@@ -82,6 +83,7 @@ export const appKeysSchemas = {
8283
"booking-pages-tag": booking_pages_tag_zod_ts,
8384
"event-type-app-card": event_type_app_card_zod_ts,
8485
twipla: twipla_zod_ts,
86+
umami: umami_zod_ts,
8587
vital: vital_zod_ts,
8688
webex: webex_zod_ts,
8789
wordpress: wordpress_zod_ts,

‎packages/app-store/apps.metadata.generated.ts

+2
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ import general_app_settings_config_json from "./templates/general-app-settings/c
7777
import link_as_an_app_config_json from "./templates/link-as-an-app/config.json";
7878
import twipla_config_json from "./twipla/config.json";
7979
import typeform_config_json from "./typeform/config.json";
80+
import umami_config_json from "./umami/config.json";
8081
import vimcal_config_json from "./vimcal/config.json";
8182
import { metadata as vital__metadata_ts } from "./vital/_metadata";
8283
import weather_in_your_calendar_config_json from "./weather_in_your_calendar/config.json";
@@ -167,6 +168,7 @@ export const appStoreMetadata = {
167168
"link-as-an-app": link_as_an_app_config_json,
168169
twipla: twipla_config_json,
169170
typeform: typeform_config_json,
171+
umami: umami_config_json,
170172
vimcal: vimcal_config_json,
171173
vital: vital__metadata_ts,
172174
weather_in_your_calendar: weather_in_your_calendar_config_json,

‎packages/app-store/apps.schemas.generated.ts

+2
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ import { appDataSchema as tandemvideo_zod_ts } from "./tandemvideo/zod";
3737
import { appDataSchema as booking_pages_tag_zod_ts } from "./templates/booking-pages-tag/zod";
3838
import { appDataSchema as event_type_app_card_zod_ts } from "./templates/event-type-app-card/zod";
3939
import { appDataSchema as twipla_zod_ts } from "./twipla/zod";
40+
import { appDataSchema as umami_zod_ts } from "./umami/zod";
4041
import { appDataSchema as vital_zod_ts } from "./vital/zod";
4142
import { appDataSchema as webex_zod_ts } from "./webex/zod";
4243
import { appDataSchema as wordpress_zod_ts } from "./wordpress/zod";
@@ -82,6 +83,7 @@ export const appDataSchemas = {
8283
"booking-pages-tag": booking_pages_tag_zod_ts,
8384
"event-type-app-card": event_type_app_card_zod_ts,
8485
twipla: twipla_zod_ts,
86+
umami: umami_zod_ts,
8587
vital: vital_zod_ts,
8688
webex: webex_zod_ts,
8789
wordpress: wordpress_zod_ts,

‎packages/app-store/apps.server.generated.ts

+1
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ export const apiHandlers = {
7777
"link-as-an-app": import("./templates/link-as-an-app/api"),
7878
twipla: import("./twipla/api"),
7979
typeform: import("./typeform/api"),
80+
umami: import("./umami/api"),
8081
vimcal: import("./vimcal/api"),
8182
vital: import("./vital/api"),
8283
weather_in_your_calendar: import("./weather_in_your_calendar/api"),

‎packages/app-store/bookerApps.metadata.generated.ts

+2
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import telegram_config_json from "./telegram/config.json";
3636
import booking_pages_tag_config_json from "./templates/booking-pages-tag/config.json";
3737
import event_type_location_video_static_config_json from "./templates/event-type-location-video-static/config.json";
3838
import twipla_config_json from "./twipla/config.json";
39+
import umami_config_json from "./umami/config.json";
3940
import webex_config_json from "./webex/config.json";
4041
import whatsapp_config_json from "./whatsapp/config.json";
4142
import whereby_config_json from "./whereby/config.json";
@@ -76,6 +77,7 @@ export const appStoreMetadata = {
7677
"booking-pages-tag": booking_pages_tag_config_json,
7778
"event-type-location-video-static": event_type_location_video_static_config_json,
7879
twipla: twipla_config_json,
80+
umami: umami_config_json,
7981
webex: webex_config_json,
8082
whatsapp: whatsapp_config_json,
8183
whereby: whereby_config_json,
+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
items:
3+
- 1.png
4+
---
5+
6+
{DESCRIPTION}

‎packages/app-store/umami/api/add.ts

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { createDefaultInstallation } from "@calcom/app-store/_utils/installation";
2+
import type { AppDeclarativeHandler } from "@calcom/types/AppHandler";
3+
4+
import appConfig from "../config.json";
5+
6+
const handler: AppDeclarativeHandler = {
7+
appType: appConfig.type,
8+
variant: appConfig.variant,
9+
slug: appConfig.slug,
10+
supportsMultipleInstalls: false,
11+
handlerType: "add",
12+
createCredential: ({ appType, user, slug, teamId }) =>
13+
createDefaultInstallation({ appType, user: user, slug, key: {}, teamId }),
14+
};
15+
16+
export default handler;

‎packages/app-store/umami/api/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default as add } from "./add";
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import { useAppContextWithSchema } from "@calcom/app-store/EventTypeAppContext";
2+
import AppCard from "@calcom/app-store/_components/AppCard";
3+
import useIsAppEnabled from "@calcom/app-store/_utils/useIsAppEnabled";
4+
import type { EventTypeAppCardComponent } from "@calcom/app-store/types";
5+
import { TextField } from "@calcom/ui";
6+
7+
import type { appDataSchema } from "../zod";
8+
9+
const EventTypeAppCard: EventTypeAppCardComponent = function EventTypeAppCard({ app, eventType }) {
10+
const { getAppData, setAppData, disabled } = useAppContextWithSchema<typeof appDataSchema>();
11+
const siteId = getAppData("SITE_ID");
12+
const { enabled, updateEnabled } = useIsAppEnabled(app);
13+
14+
return (
15+
<AppCard
16+
app={app}
17+
switchOnClick={(e) => {
18+
updateEnabled(e);
19+
}}
20+
switchChecked={enabled}
21+
teamId={eventType.team?.id || undefined}>
22+
<TextField
23+
disabled={disabled}
24+
name="Site ID"
25+
value={siteId}
26+
placeholder="Enter your Site ID"
27+
onChange={(e) => {
28+
setAppData("SITE_ID", e.target.value);
29+
}}
30+
/>
31+
</AppCard>
32+
);
33+
};
34+
35+
export default EventTypeAppCard;

‎packages/app-store/umami/config.json

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"name": "Umami",
3+
"slug": "umami",
4+
"type": "umami_analytics",
5+
"logo": "icon.svg",
6+
"url": "https://cal.com/",
7+
"variant": "analytics",
8+
"categories": ["analytics"],
9+
"publisher": "Cal.com, Inc.",
10+
"email": "help@cal.com",
11+
"description": "Umami makes it easy to collect, analyze, and understand your web data — while maintaining visitor privacy and data ownership.",
12+
"extendsFeature": "EventType",
13+
"appData": {
14+
"tag": {
15+
"scripts": [
16+
{
17+
"src": "https://us.umami.is/script.js",
18+
"attrs": {
19+
"data-website-id": "{SITE_ID}"
20+
}
21+
}
22+
]
23+
}
24+
},
25+
"isTemplate": false,
26+
"__createdUsingCli": true,
27+
"__template": "booking-pages-tag"
28+
}

‎packages/app-store/umami/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * as api from "./api";

‎packages/app-store/umami/package.json

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"$schema": "https://json.schemastore.org/package.json",
3+
"private": true,
4+
"name": "@calcom/umami",
5+
"version": "0.0.0",
6+
"main": "./index.ts",
7+
"dependencies": {
8+
"@calcom/lib": "*"
9+
},
10+
"devDependencies": {
11+
"@calcom/types": "*"
12+
},
13+
"description": "Umami makes it easy to collect, analyze, and understand your web data — while maintaining visitor privacy and data ownership."
14+
}

‎packages/app-store/umami/static/1.png

107 KB
Loading
+1
Loading

‎packages/app-store/umami/zod.ts

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { z } from "zod";
2+
3+
import { eventTypeAppCardZod } from "@calcom/app-store/eventTypeAppCardZod";
4+
5+
export const appDataSchema = eventTypeAppCardZod.merge(
6+
z.object({
7+
SITE_ID: z.string().optional(),
8+
})
9+
);
10+
11+
export const appKeysSchema = z.object({});

0 commit comments

Comments
 (0)
Please sign in to comment.