@agent-native/scheduling 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/react/components/booking-links/ConferencingSelector.d.ts.map +1 -1
- package/dist/react/components/booking-links/ConferencingSelector.js +20 -16
- package/dist/react/components/booking-links/ConferencingSelector.js.map +1 -1
- package/package.json +7 -3
- package/src/react/components/_shadcn-shims.d.ts +1 -0
- package/src/react/components/booking-links/ConferencingSelector.tsx +80 -55
- package/dist/server/providers/cal-video.d.ts +0 -12
- package/dist/server/providers/cal-video.d.ts.map +0 -1
- package/dist/server/providers/cal-video.js +0 -50
- package/dist/server/providers/cal-video.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConferencingSelector.d.ts","sourceRoot":"","sources":["../../../../src/react/components/booking-links/ConferencingSelector.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ConferencingSelector.d.ts","sourceRoot":"","sources":["../../../../src/react/components/booking-links/ConferencingSelector.tsx"],"names":[],"mappings":"AA4CA,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,aAAa,GAAG,MAAM,GAAG,QAAQ,CAAC;AAE1E,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,gBAAgB,CAAC;IACvB,+EAA+E;IAC/E,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,MAAM,MAAM,cAAc,GAAG,WAAW,GAAG,cAAc,GAAG,gBAAgB,CAAC;AAE7E,MAAM,WAAW,yBAAyB;IACxC,KAAK,EAAE,iBAAiB,CAAC;IACzB,QAAQ,EAAE,CAAC,IAAI,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC5C,UAAU,CAAC,EAAE,cAAc,CAAC;IAC5B,YAAY,CAAC,EAAE,cAAc,CAAC;IAC9B,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;IAC7B,gFAAgF;IAChF,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAkCD,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,yBAAyB,2CAsLpE"}
|
|
@@ -29,6 +29,7 @@ import { Button } from "@/components/ui/button";
|
|
|
29
29
|
import { Input } from "@/components/ui/input";
|
|
30
30
|
import { Label } from "@/components/ui/label";
|
|
31
31
|
import { Badge } from "@/components/ui/badge";
|
|
32
|
+
import { Select, SelectContent, SelectItem, SelectTrigger, } from "@/components/ui/select";
|
|
32
33
|
const OPTIONS = [
|
|
33
34
|
{
|
|
34
35
|
type: "none",
|
|
@@ -55,9 +56,6 @@ const OPTIONS = [
|
|
|
55
56
|
Icon: IconLink,
|
|
56
57
|
},
|
|
57
58
|
];
|
|
58
|
-
function cls(...parts) {
|
|
59
|
-
return parts.filter(Boolean).join(" ");
|
|
60
|
-
}
|
|
61
59
|
export function ConferencingSelector(props) {
|
|
62
60
|
const id = useId();
|
|
63
61
|
const { value, onChange, zoomStatus = "disconnected", googleStatus = "disconnected", onConnectZoom, onConnectGoogle, hideLabel, } = props;
|
|
@@ -68,19 +66,25 @@ export function ConferencingSelector(props) {
|
|
|
68
66
|
return googleStatus;
|
|
69
67
|
return "connected";
|
|
70
68
|
};
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
69
|
+
const selectedOption = OPTIONS.find((opt) => opt.type === value.type) ?? OPTIONS[0];
|
|
70
|
+
const selectedStatus = statusFor(selectedOption.type);
|
|
71
|
+
const SelectedIcon = selectedOption.Icon;
|
|
72
|
+
return (_jsxs("div", { className: "space-y-3", children: [!hideLabel && (_jsxs(Label, { className: "flex items-center gap-1.5", children: [_jsx(IconVideo, { className: "h-4 w-4" }), "Conferencing"] })), _jsxs(Select, { value: value.type, onValueChange: (type) => onChange({
|
|
73
|
+
type: type,
|
|
74
|
+
url: type === "custom" ? value.url : undefined,
|
|
75
|
+
}), children: [_jsx(SelectTrigger, { className: "h-auto min-h-11 py-2", children: _jsxs("div", { className: "flex min-w-0 items-center gap-2 text-left", children: [_jsx(SelectedIcon, { className: "h-4 w-4 shrink-0" }), _jsxs("div", { className: "min-w-0", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("span", { className: "truncate font-medium", children: selectedOption.label }), selectedStatus === "connected" &&
|
|
76
|
+
selectedOption.type !== "none" &&
|
|
77
|
+
selectedOption.type !== "custom" && (_jsxs(Badge, { variant: "secondary", className: "h-5 gap-1 text-[10px] font-normal", children: [_jsx(IconCheck, { className: "h-3 w-3" }), "Connected"] }))] }), _jsx("p", { className: "truncate text-xs text-muted-foreground", children: selectedStatus === "not-configured"
|
|
78
|
+
? `${selectedOption.label} is not configured on this server.`
|
|
79
|
+
: selectedOption.description })] })] }) }), _jsx(SelectContent, { children: OPTIONS.map((opt) => {
|
|
80
|
+
const status = statusFor(opt.type);
|
|
81
|
+
const isUnavailable = status === "not-configured";
|
|
82
|
+
return (_jsx(SelectItem, { value: opt.type, disabled: isUnavailable, className: "py-2", children: _jsxs("div", { className: "flex min-w-0 items-start gap-2", children: [_jsx(opt.Icon, { className: "mt-0.5 h-4 w-4 shrink-0" }), _jsxs("div", { className: "min-w-0", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("span", { className: "font-medium", children: opt.label }), status === "connected" &&
|
|
83
|
+
opt.type !== "none" &&
|
|
84
|
+
opt.type !== "custom" && (_jsx("span", { className: "text-[10px] text-muted-foreground", children: "Connected" }))] }), _jsx("p", { className: "text-xs text-muted-foreground", children: isUnavailable
|
|
85
|
+
? `${opt.label} needs server OAuth credentials before it can be used.`
|
|
86
|
+
: opt.description })] })] }) }, opt.type));
|
|
87
|
+
}) })] }), value.type === "zoom" && zoomStatus !== "connected" && onConnectZoom && (_jsxs("div", { className: "rounded-md border border-border/60 bg-muted/30 p-3", children: [_jsxs("div", { className: "flex flex-wrap items-center justify-between gap-2", children: [_jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("p", { className: "text-sm font-medium", children: "Connect your Zoom account" }), _jsx("p", { className: "text-xs text-muted-foreground", children: "We'll create a real Zoom meeting for every booking \u2014 no need to paste a personal link." })] }), _jsxs(Button, { type: "button", size: "sm", onClick: onConnectZoom, disabled: zoomStatus === "not-configured", children: [_jsx(IconBrandZoom, { className: "mr-1.5 h-4 w-4" }), "Connect Zoom"] })] }), zoomStatus === "not-configured" && (_jsxs("p", { className: "mt-2 text-[11px] text-muted-foreground", children: ["Ask your admin to set ", _jsx("code", { children: "ZOOM_CLIENT_ID" }), " and", " ", _jsx("code", { children: "ZOOM_CLIENT_SECRET" }), " to enable Zoom OAuth."] }))] })), value.type === "google_meet" &&
|
|
84
88
|
googleStatus !== "connected" &&
|
|
85
89
|
onConnectGoogle && (_jsx("div", { className: "rounded-md border border-border/60 bg-muted/30 p-3", children: _jsxs("div", { className: "flex flex-wrap items-center justify-between gap-2", children: [_jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("p", { className: "text-sm font-medium", children: "Connect Google Calendar" }), _jsx("p", { className: "text-xs text-muted-foreground", children: "Meet links are auto-generated when the calendar event is created." })] }), _jsxs(Button, { type: "button", size: "sm", variant: "outline", onClick: onConnectGoogle, disabled: googleStatus === "not-configured", children: [_jsx(IconBrandGoogle, { className: "mr-1.5 h-4 w-4" }), "Connect Google"] })] }) })), value.type === "custom" && (_jsxs("div", { className: "space-y-1.5", children: [_jsx(Label, { htmlFor: `${id}-url`, className: "text-xs", children: "Meeting URL" }), _jsx(Input, { id: `${id}-url`, type: "url", value: value.url ?? "", onChange: (e) => onChange({ type: "custom", url: e.currentTarget.value }), placeholder: "https://meet.example.com/room", className: "h-8 text-sm" })] }))] }));
|
|
86
90
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConferencingSelector.js","sourceRoot":"","sources":["../../../../src/react/components/booking-links/ConferencingSelector.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,EAAE,KAAK,EAAsB,MAAM,OAAO,CAAC;AAClD,OAAO,EACL,eAAe,EACf,aAAa,EACb,SAAS,EACT,QAAQ,EACR,SAAS,EACT,YAAY,GACb,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"ConferencingSelector.js","sourceRoot":"","sources":["../../../../src/react/components/booking-links/ConferencingSelector.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,EAAE,KAAK,EAAsB,MAAM,OAAO,CAAC;AAClD,OAAO,EACL,eAAe,EACf,aAAa,EACb,SAAS,EACT,QAAQ,EACR,SAAS,EACT,YAAY,GACb,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EACL,MAAM,EACN,aAAa,EACb,UAAU,EACV,aAAa,GACd,MAAM,wBAAwB,CAAC;AAuBhC,MAAM,OAAO,GAKP;IACJ;QACE,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,iBAAiB;QACxB,WAAW,EAAE,oBAAoB;QACjC,IAAI,EAAE,YAAY;KACnB;IACD;QACE,IAAI,EAAE,aAAa;QACnB,KAAK,EAAE,aAAa;QACpB,WAAW,EAAE,2BAA2B;QACxC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AAS,EAAC,gBAAgB,aAC7B,YAAG,SAAS,EAAC,qBAAqB,wCAA4B,EAC9D,YAAG,SAAS,EAAC,+BAA+B,kFAGxC,IACA,EACN,MAAC,MAAM,IACL,IAAI,EAAC,QAAQ,EACb,IAAI,EAAC,IAAI,EACT,OAAO,EAAC,SAAS,EACjB,OAAO,EAAE,eAAe,EACxB,QAAQ,EAAE,YAAY,KAAK,gBAAgB,aAE3C,KAAC,eAAe,IAAC,SAAS,EAAC,gBAAgB,GAAG,sBAEvC,IACL,GACF,CACP,EAGF,KAAK,CAAC,IAAI,KAAK,QAAQ,IAAI,CAC1B,eAAK,SAAS,EAAC,aAAa,aAC1B,KAAC,KAAK,IAAC,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,SAAS,EAAC,SAAS,4BAExC,EACR,KAAC,KAAK,IACJ,EAAE,EAAE,GAAG,EAAE,MAAM,EACf,IAAI,EAAC,KAAK,EACV,KAAK,EAAE,KAAK,CAAC,GAAG,IAAI,EAAE,EACtB,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CACd,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC,EAE1D,WAAW,EAAC,+BAA+B,EAC3C,SAAS,EAAC,aAAa,GACvB,IACE,CACP,IACG,CACP,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agent-native/scheduling",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Scheduling primitives for agent-native apps — event types, availability, bookings, team scheduling, workflows, routing forms. Powers the scheduling and calendar templates.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -13,6 +13,10 @@
|
|
|
13
13
|
"url": "https://github.com/BuilderIO/agent-native/issues"
|
|
14
14
|
},
|
|
15
15
|
"homepage": "https://github.com/BuilderIO/agent-native#readme",
|
|
16
|
+
"publishConfig": {
|
|
17
|
+
"access": "public",
|
|
18
|
+
"provenance": true
|
|
19
|
+
},
|
|
16
20
|
"exports": {
|
|
17
21
|
".": "./dist/index.js",
|
|
18
22
|
"./schema": "./dist/schema/index.js",
|
|
@@ -50,7 +54,7 @@
|
|
|
50
54
|
"zod": "^4.3.6"
|
|
51
55
|
},
|
|
52
56
|
"peerDependencies": {
|
|
53
|
-
"@agent-native/core": ">=0.
|
|
57
|
+
"@agent-native/core": ">=0.8.0",
|
|
54
58
|
"@tabler/icons-react": ">=3",
|
|
55
59
|
"drizzle-orm": ">=0.45",
|
|
56
60
|
"react": ">=18",
|
|
@@ -75,7 +79,7 @@
|
|
|
75
79
|
"react": "^19.2.5",
|
|
76
80
|
"typescript": "^6.0.3",
|
|
77
81
|
"vitest": "^4.1.5",
|
|
78
|
-
"@agent-native/core": "0.
|
|
82
|
+
"@agent-native/core": "0.8.0"
|
|
79
83
|
},
|
|
80
84
|
"scripts": {
|
|
81
85
|
"build": "tsc && node scripts/build-llms-full.mjs",
|
|
@@ -35,6 +35,12 @@ import { Button } from "@/components/ui/button";
|
|
|
35
35
|
import { Input } from "@/components/ui/input";
|
|
36
36
|
import { Label } from "@/components/ui/label";
|
|
37
37
|
import { Badge } from "@/components/ui/badge";
|
|
38
|
+
import {
|
|
39
|
+
Select,
|
|
40
|
+
SelectContent,
|
|
41
|
+
SelectItem,
|
|
42
|
+
SelectTrigger,
|
|
43
|
+
} from "@/components/ui/select";
|
|
38
44
|
|
|
39
45
|
export type ConferencingType = "none" | "google_meet" | "zoom" | "custom";
|
|
40
46
|
|
|
@@ -89,10 +95,6 @@ const OPTIONS: {
|
|
|
89
95
|
},
|
|
90
96
|
];
|
|
91
97
|
|
|
92
|
-
function cls(...parts: (string | false | null | undefined)[]) {
|
|
93
|
-
return parts.filter(Boolean).join(" ");
|
|
94
|
-
}
|
|
95
|
-
|
|
96
98
|
export function ConferencingSelector(props: ConferencingSelectorProps) {
|
|
97
99
|
const id = useId();
|
|
98
100
|
const {
|
|
@@ -110,6 +112,10 @@ export function ConferencingSelector(props: ConferencingSelectorProps) {
|
|
|
110
112
|
if (type === "google_meet") return googleStatus;
|
|
111
113
|
return "connected";
|
|
112
114
|
};
|
|
115
|
+
const selectedOption =
|
|
116
|
+
OPTIONS.find((opt) => opt.type === value.type) ?? OPTIONS[0];
|
|
117
|
+
const selectedStatus = statusFor(selectedOption.type);
|
|
118
|
+
const SelectedIcon = selectedOption.Icon;
|
|
113
119
|
|
|
114
120
|
return (
|
|
115
121
|
<div className="space-y-3">
|
|
@@ -120,60 +126,79 @@ export function ConferencingSelector(props: ConferencingSelectorProps) {
|
|
|
120
126
|
</Label>
|
|
121
127
|
)}
|
|
122
128
|
|
|
123
|
-
<
|
|
124
|
-
{
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
})
|
|
137
|
-
}
|
|
138
|
-
disabled={isUnavailable}
|
|
139
|
-
title={
|
|
140
|
-
isUnavailable
|
|
141
|
-
? `${opt.label} is not configured on this server.`
|
|
142
|
-
: undefined
|
|
143
|
-
}
|
|
144
|
-
className={cls(
|
|
145
|
-
"flex flex-col gap-1 rounded-lg border px-3 py-2.5 text-left text-xs transition-colors",
|
|
146
|
-
isSelected
|
|
147
|
-
? "border-primary bg-primary/10"
|
|
148
|
-
: "border-border/60 hover:border-primary/30 hover:bg-accent/60",
|
|
149
|
-
isUnavailable && "opacity-50 cursor-not-allowed",
|
|
150
|
-
)}
|
|
151
|
-
>
|
|
129
|
+
<Select
|
|
130
|
+
value={value.type}
|
|
131
|
+
onValueChange={(type) =>
|
|
132
|
+
onChange({
|
|
133
|
+
type: type as ConferencingType,
|
|
134
|
+
url: type === "custom" ? value.url : undefined,
|
|
135
|
+
})
|
|
136
|
+
}
|
|
137
|
+
>
|
|
138
|
+
<SelectTrigger className="h-auto min-h-11 py-2">
|
|
139
|
+
<div className="flex min-w-0 items-center gap-2 text-left">
|
|
140
|
+
<SelectedIcon className="h-4 w-4 shrink-0" />
|
|
141
|
+
<div className="min-w-0">
|
|
152
142
|
<div className="flex items-center gap-2">
|
|
153
|
-
<
|
|
154
|
-
|
|
155
|
-
className={cls("font-medium", isSelected && "text-primary")}
|
|
156
|
-
>
|
|
157
|
-
{opt.label}
|
|
143
|
+
<span className="truncate font-medium">
|
|
144
|
+
{selectedOption.label}
|
|
158
145
|
</span>
|
|
159
|
-
{
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
)}
|
|
146
|
+
{selectedStatus === "connected" &&
|
|
147
|
+
selectedOption.type !== "none" &&
|
|
148
|
+
selectedOption.type !== "custom" && (
|
|
149
|
+
<Badge
|
|
150
|
+
variant="secondary"
|
|
151
|
+
className="h-5 gap-1 text-[10px] font-normal"
|
|
152
|
+
>
|
|
153
|
+
<IconCheck className="h-3 w-3" />
|
|
154
|
+
Connected
|
|
155
|
+
</Badge>
|
|
156
|
+
)}
|
|
171
157
|
</div>
|
|
172
|
-
<p className="text-muted-foreground">
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
158
|
+
<p className="truncate text-xs text-muted-foreground">
|
|
159
|
+
{selectedStatus === "not-configured"
|
|
160
|
+
? `${selectedOption.label} is not configured on this server.`
|
|
161
|
+
: selectedOption.description}
|
|
162
|
+
</p>
|
|
163
|
+
</div>
|
|
164
|
+
</div>
|
|
165
|
+
</SelectTrigger>
|
|
166
|
+
<SelectContent>
|
|
167
|
+
{OPTIONS.map((opt) => {
|
|
168
|
+
const status = statusFor(opt.type);
|
|
169
|
+
const isUnavailable = status === "not-configured";
|
|
170
|
+
return (
|
|
171
|
+
<SelectItem
|
|
172
|
+
key={opt.type}
|
|
173
|
+
value={opt.type}
|
|
174
|
+
disabled={isUnavailable}
|
|
175
|
+
className="py-2"
|
|
176
|
+
>
|
|
177
|
+
<div className="flex min-w-0 items-start gap-2">
|
|
178
|
+
<opt.Icon className="mt-0.5 h-4 w-4 shrink-0" />
|
|
179
|
+
<div className="min-w-0">
|
|
180
|
+
<div className="flex items-center gap-2">
|
|
181
|
+
<span className="font-medium">{opt.label}</span>
|
|
182
|
+
{status === "connected" &&
|
|
183
|
+
opt.type !== "none" &&
|
|
184
|
+
opt.type !== "custom" && (
|
|
185
|
+
<span className="text-[10px] text-muted-foreground">
|
|
186
|
+
Connected
|
|
187
|
+
</span>
|
|
188
|
+
)}
|
|
189
|
+
</div>
|
|
190
|
+
<p className="text-xs text-muted-foreground">
|
|
191
|
+
{isUnavailable
|
|
192
|
+
? `${opt.label} needs server OAuth credentials before it can be used.`
|
|
193
|
+
: opt.description}
|
|
194
|
+
</p>
|
|
195
|
+
</div>
|
|
196
|
+
</div>
|
|
197
|
+
</SelectItem>
|
|
198
|
+
);
|
|
199
|
+
})}
|
|
200
|
+
</SelectContent>
|
|
201
|
+
</Select>
|
|
177
202
|
|
|
178
203
|
{/* Zoom: OAuth connect button */}
|
|
179
204
|
{value.type === "zoom" && zoomStatus !== "connected" && onConnectZoom && (
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Cal Video (Daily.co) provider — zero-OAuth video provider driven by a
|
|
3
|
-
* server-to-server API key. Creates a Daily.co room per booking.
|
|
4
|
-
*/
|
|
5
|
-
import type { VideoProvider } from "./types.js";
|
|
6
|
-
export interface DailyVideoProviderConfig {
|
|
7
|
-
apiKey: string;
|
|
8
|
-
/** Prefix for Daily room names; defaults to "cal-" */
|
|
9
|
-
roomPrefix?: string;
|
|
10
|
-
}
|
|
11
|
-
export declare function createDailyVideoProvider(config: DailyVideoProviderConfig): VideoProvider;
|
|
12
|
-
//# sourceMappingURL=cal-video.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cal-video.d.ts","sourceRoot":"","sources":["../../../src/server/providers/cal-video.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD,MAAM,WAAW,wBAAwB;IACvC,MAAM,EAAE,MAAM,CAAC;IACf,sDAAsD;IACtD,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,wBAAwB,GAC/B,aAAa,CA+Cf"}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
export function createDailyVideoProvider(config) {
|
|
2
|
-
const prefix = config.roomPrefix ?? "cal-";
|
|
3
|
-
async function apiCall(path, init) {
|
|
4
|
-
const res = await fetch(`https://api.daily.co/v1${path}`, {
|
|
5
|
-
...init,
|
|
6
|
-
headers: {
|
|
7
|
-
...(init?.headers ?? {}),
|
|
8
|
-
authorization: `Bearer ${config.apiKey}`,
|
|
9
|
-
"content-type": "application/json",
|
|
10
|
-
},
|
|
11
|
-
});
|
|
12
|
-
if (!res.ok) {
|
|
13
|
-
throw new Error(`Daily.co ${res.status}: ${await res.text()}`);
|
|
14
|
-
}
|
|
15
|
-
if (res.status === 204)
|
|
16
|
-
return undefined;
|
|
17
|
-
return (await res.json());
|
|
18
|
-
}
|
|
19
|
-
return {
|
|
20
|
-
kind: "cal_video",
|
|
21
|
-
label: "Cal Video",
|
|
22
|
-
async createMeeting({ booking }) {
|
|
23
|
-
const roomName = `${prefix}${booking.uid}`.slice(0, 40);
|
|
24
|
-
const resp = await apiCall("/rooms", {
|
|
25
|
-
method: "POST",
|
|
26
|
-
body: JSON.stringify({
|
|
27
|
-
name: roomName,
|
|
28
|
-
properties: {
|
|
29
|
-
nbf: Math.floor(new Date(booking.startTime).getTime() / 1000),
|
|
30
|
-
exp: Math.floor(new Date(booking.endTime).getTime() / 1000) + 3600,
|
|
31
|
-
enable_prejoin_ui: true,
|
|
32
|
-
enable_chat: true,
|
|
33
|
-
enable_knocking: true,
|
|
34
|
-
eject_at_room_exp: true,
|
|
35
|
-
},
|
|
36
|
-
}),
|
|
37
|
-
});
|
|
38
|
-
return {
|
|
39
|
-
meetingUrl: resp.url,
|
|
40
|
-
meetingId: resp.name,
|
|
41
|
-
};
|
|
42
|
-
},
|
|
43
|
-
async deleteMeeting({ meetingId }) {
|
|
44
|
-
await apiCall(`/rooms/${encodeURIComponent(meetingId)}`, {
|
|
45
|
-
method: "DELETE",
|
|
46
|
-
});
|
|
47
|
-
},
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
//# sourceMappingURL=cal-video.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cal-video.js","sourceRoot":"","sources":["../../../src/server/providers/cal-video.ts"],"names":[],"mappings":"AAYA,MAAM,UAAU,wBAAwB,CACtC,MAAgC;IAEhC,MAAM,MAAM,GAAG,MAAM,CAAC,UAAU,IAAI,MAAM,CAAC;IAC3C,KAAK,UAAU,OAAO,CAAI,IAAY,EAAE,IAAkB;QACxD,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,0BAA0B,IAAI,EAAE,EAAE;YACxD,GAAG,IAAI;YACP,OAAO,EAAE;gBACP,GAAG,CAAC,IAAI,EAAE,OAAO,IAAI,EAAE,CAAC;gBACxB,aAAa,EAAE,UAAU,MAAM,CAAC,MAAM,EAAE;gBACxC,cAAc,EAAE,kBAAkB;aACnC;SACF,CAAC,CAAC;QACH,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;YACZ,MAAM,IAAI,KAAK,CAAC,YAAY,GAAG,CAAC,MAAM,KAAK,MAAM,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QACjE,CAAC;QACD,IAAI,GAAG,CAAC,MAAM,KAAK,GAAG;YAAE,OAAO,SAAyB,CAAC;QACzD,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,C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