@agent-native/scheduling 0.2.1 → 0.2.2-nightly-20260927013707
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/actions/_helpers.d.ts +0 -13
- package/dist/actions/_helpers.d.ts.map +1 -1
- package/dist/actions/_helpers.js +0 -16
- package/dist/actions/_helpers.js.map +1 -1
- package/dist/actions/create-team.js +0 -1
- package/dist/actions/create-team.js.map +1 -1
- package/dist/actions/list-bookings.js +0 -4
- package/dist/actions/list-bookings.js.map +1 -1
- package/dist/actions/refresh-busy-times.js +0 -1
- package/dist/actions/refresh-busy-times.js.map +1 -1
- package/dist/actions/revoke-private-link.js +0 -2
- package/dist/actions/revoke-private-link.js.map +1 -1
- package/dist/actions/update-profile.js +0 -5
- package/dist/actions/update-profile.js.map +1 -1
- package/dist/core/buffers.d.ts +0 -18
- package/dist/core/buffers.d.ts.map +1 -1
- package/dist/core/buffers.js +0 -6
- package/dist/core/buffers.js.map +1 -1
- package/dist/core/conflicts.d.ts +0 -4
- package/dist/core/conflicts.d.ts.map +1 -1
- package/dist/core/conflicts.js +0 -1
- package/dist/core/conflicts.js.map +1 -1
- package/dist/core/limits.d.ts +0 -8
- package/dist/core/limits.d.ts.map +1 -1
- package/dist/core/limits.js.map +1 -1
- package/dist/core/round-robin.d.ts +0 -17
- package/dist/core/round-robin.d.ts.map +1 -1
- package/dist/core/round-robin.js.map +1 -1
- package/dist/core/rrule.d.ts.map +1 -1
- package/dist/core/rrule.js +0 -7
- package/dist/core/rrule.js.map +1 -1
- package/dist/core/rules.d.ts +0 -17
- package/dist/core/rules.d.ts.map +1 -1
- package/dist/core/rules.js +0 -8
- package/dist/core/rules.js.map +1 -1
- package/dist/core/slots.d.ts +0 -31
- package/dist/core/slots.d.ts.map +1 -1
- package/dist/core/slots.js +0 -9
- package/dist/core/slots.js.map +1 -1
- package/dist/core/time.d.ts +0 -24
- package/dist/core/time.d.ts.map +1 -1
- package/dist/core/time.js +0 -37
- package/dist/core/time.js.map +1 -1
- package/dist/index.d.ts +0 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -10
- package/dist/index.js.map +1 -1
- package/dist/manifest.d.ts +0 -9
- package/dist/manifest.d.ts.map +1 -1
- package/dist/manifest.js +0 -18
- package/dist/manifest.js.map +1 -1
- package/dist/react/components/SlotPicker.d.ts +0 -8
- package/dist/react/components/SlotPicker.d.ts.map +1 -1
- package/dist/react/components/SlotPicker.js.map +1 -1
- package/dist/react/components/TimezoneSelect.d.ts.map +1 -1
- package/dist/react/components/TimezoneSelect.js +0 -2
- package/dist/react/components/TimezoneSelect.js.map +1 -1
- package/dist/react/components/booking-links/AvailabilityEditor.d.ts +0 -4
- package/dist/react/components/booking-links/AvailabilityEditor.d.ts.map +1 -1
- package/dist/react/components/booking-links/AvailabilityEditor.js +0 -15
- package/dist/react/components/booking-links/AvailabilityEditor.js.map +1 -1
- package/dist/react/components/booking-links/BookingLinkCreateDialog.d.ts +0 -6
- package/dist/react/components/booking-links/BookingLinkCreateDialog.d.ts.map +1 -1
- package/dist/react/components/booking-links/BookingLinkCreateDialog.js +0 -16
- package/dist/react/components/booking-links/BookingLinkCreateDialog.js.map +1 -1
- package/dist/react/components/booking-links/ConferencingSelector.d.ts +0 -2
- package/dist/react/components/booking-links/ConferencingSelector.d.ts.map +1 -1
- package/dist/react/components/booking-links/ConferencingSelector.js +0 -24
- package/dist/react/components/booking-links/ConferencingSelector.js.map +1 -1
- package/dist/react/components/booking-links/CustomFieldsEditor.d.ts +0 -1
- package/dist/react/components/booking-links/CustomFieldsEditor.d.ts.map +1 -1
- package/dist/react/components/booking-links/CustomFieldsEditor.js +0 -14
- package/dist/react/components/booking-links/CustomFieldsEditor.js.map +1 -1
- package/dist/react/components/booking-links/DurationPicker.d.ts +0 -1
- package/dist/react/components/booking-links/DurationPicker.d.ts.map +1 -1
- package/dist/react/components/booking-links/DurationPicker.js +1 -11
- package/dist/react/components/booking-links/DurationPicker.js.map +1 -1
- package/dist/react/components/booking-links/SlugEditor.d.ts +0 -3
- package/dist/react/components/booking-links/SlugEditor.d.ts.map +1 -1
- package/dist/react/components/booking-links/SlugEditor.js +0 -11
- package/dist/react/components/booking-links/SlugEditor.js.map +1 -1
- package/dist/react/components/booking-links/index.d.ts +0 -9
- package/dist/react/components/booking-links/index.d.ts.map +1 -1
- package/dist/react/components/booking-links/index.js +0 -9
- package/dist/react/components/booking-links/index.js.map +1 -1
- package/dist/react/components/index.d.ts +0 -10
- package/dist/react/components/index.d.ts.map +1 -1
- package/dist/react/components/index.js +0 -10
- package/dist/react/components/index.js.map +1 -1
- package/dist/react/hooks/useBookingFlow.d.ts.map +1 -1
- package/dist/react/hooks/useBookingFlow.js +0 -10
- package/dist/react/hooks/useBookingFlow.js.map +1 -1
- package/dist/react/hooks/useEventType.d.ts.map +1 -1
- package/dist/react/hooks/useEventType.js +0 -4
- package/dist/react/hooks/useEventType.js.map +1 -1
- package/dist/react/hooks/useReschedule.d.ts.map +1 -1
- package/dist/react/hooks/useReschedule.js +0 -4
- package/dist/react/hooks/useReschedule.js.map +1 -1
- package/dist/react/hooks/useSlots.d.ts +0 -2
- package/dist/react/hooks/useSlots.d.ts.map +1 -1
- package/dist/react/hooks/useSlots.js +0 -8
- package/dist/react/hooks/useSlots.js.map +1 -1
- package/dist/react/hooks/useTimezone.d.ts.map +1 -1
- package/dist/react/hooks/useTimezone.js +0 -4
- package/dist/react/hooks/useTimezone.js.map +1 -1
- package/dist/react/index.d.ts +0 -5
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +0 -5
- package/dist/react/index.js.map +1 -1
- package/dist/schema/bookings.d.ts +0 -7
- package/dist/schema/bookings.d.ts.map +1 -1
- package/dist/schema/bookings.js +0 -29
- package/dist/schema/bookings.js.map +1 -1
- package/dist/schema/calendar-cache.d.ts.map +1 -1
- package/dist/schema/calendar-cache.js +0 -11
- package/dist/schema/calendar-cache.js.map +1 -1
- package/dist/schema/credentials.d.ts +0 -8
- package/dist/schema/credentials.d.ts.map +1 -1
- package/dist/schema/credentials.js +0 -28
- package/dist/schema/credentials.js.map +1 -1
- package/dist/schema/event-types.d.ts +0 -10
- package/dist/schema/event-types.d.ts.map +1 -1
- package/dist/schema/event-types.js +0 -42
- package/dist/schema/event-types.js.map +1 -1
- package/dist/schema/index.d.ts +0 -11
- package/dist/schema/index.d.ts.map +1 -1
- package/dist/schema/index.js +0 -11
- package/dist/schema/index.js.map +1 -1
- package/dist/schema/routing-forms.d.ts.map +1 -1
- package/dist/schema/routing-forms.js +0 -17
- package/dist/schema/routing-forms.js.map +1 -1
- package/dist/schema/schedules.d.ts +0 -12
- package/dist/schema/schedules.d.ts.map +1 -1
- package/dist/schema/schedules.js +0 -25
- package/dist/schema/schedules.js.map +1 -1
- package/dist/schema/teams.d.ts.map +1 -1
- package/dist/schema/teams.js +0 -7
- package/dist/schema/teams.js.map +1 -1
- package/dist/schema/workflows.d.ts +0 -7
- package/dist/schema/workflows.d.ts.map +1 -1
- package/dist/schema/workflows.js +0 -19
- package/dist/schema/workflows.js.map +1 -1
- package/dist/server/availability-engine.d.ts +0 -12
- package/dist/server/availability-engine.d.ts.map +1 -1
- package/dist/server/availability-engine.js +0 -20
- package/dist/server/availability-engine.js.map +1 -1
- package/dist/server/booking-service.d.ts +0 -14
- package/dist/server/booking-service.d.ts.map +1 -1
- package/dist/server/booking-service.js +0 -8
- package/dist/server/booking-service.js.map +1 -1
- package/dist/server/bookings-repo.d.ts +0 -7
- package/dist/server/bookings-repo.d.ts.map +1 -1
- package/dist/server/bookings-repo.js +0 -3
- package/dist/server/bookings-repo.js.map +1 -1
- package/dist/server/context.d.ts +0 -16
- package/dist/server/context.d.ts.map +1 -1
- package/dist/server/context.js.map +1 -1
- package/dist/server/db-types.d.ts +0 -11
- package/dist/server/db-types.d.ts.map +1 -1
- package/dist/server/event-types-repo.d.ts +0 -10
- package/dist/server/event-types-repo.d.ts.map +1 -1
- package/dist/server/event-types-repo.js +0 -21
- package/dist/server/event-types-repo.js.map +1 -1
- package/dist/server/hooks.d.ts.map +1 -1
- package/dist/server/hooks.js +0 -11
- package/dist/server/hooks.js.map +1 -1
- package/dist/server/ics.d.ts +0 -7
- package/dist/server/ics.d.ts.map +1 -1
- package/dist/server/ics.js.map +1 -1
- package/dist/server/providers/builtin-video.d.ts +0 -5
- package/dist/server/providers/builtin-video.d.ts.map +1 -1
- package/dist/server/providers/builtin-video.js.map +1 -1
- package/dist/server/providers/google-calendar.d.ts +0 -3
- package/dist/server/providers/google-calendar.d.ts.map +1 -1
- package/dist/server/providers/google-calendar.js +0 -2
- package/dist/server/providers/google-calendar.js.map +1 -1
- package/dist/server/providers/google-meet.d.ts +0 -7
- package/dist/server/providers/google-meet.d.ts.map +1 -1
- package/dist/server/providers/google-meet.js.map +1 -1
- package/dist/server/providers/office365.d.ts +0 -6
- package/dist/server/providers/office365.d.ts.map +1 -1
- package/dist/server/providers/office365.js.map +1 -1
- package/dist/server/providers/registry.d.ts +0 -4
- package/dist/server/providers/registry.d.ts.map +1 -1
- package/dist/server/providers/registry.js.map +1 -1
- package/dist/server/providers/teams.d.ts +0 -6
- package/dist/server/providers/teams.d.ts.map +1 -1
- package/dist/server/providers/teams.js +0 -2
- package/dist/server/providers/teams.js.map +1 -1
- package/dist/server/providers/types.d.ts +0 -27
- package/dist/server/providers/types.d.ts.map +1 -1
- package/dist/server/providers/zoom.d.ts +0 -19
- package/dist/server/providers/zoom.d.ts.map +1 -1
- package/dist/server/providers/zoom.js +0 -2
- package/dist/server/providers/zoom.js.map +1 -1
- package/dist/server/schedules-repo.d.ts.map +1 -1
- package/dist/server/schedules-repo.js +0 -4
- package/dist/server/schedules-repo.js.map +1 -1
- package/dist/server/video-oauth-state.d.ts +0 -5
- package/dist/server/video-oauth-state.d.ts.map +1 -1
- package/dist/server/video-oauth-state.js +1 -9
- package/dist/server/video-oauth-state.js.map +1 -1
- package/dist/server/video-oauth.d.ts +0 -4
- package/dist/server/video-oauth.d.ts.map +1 -1
- package/dist/server/video-oauth.js +0 -23
- package/dist/server/video-oauth.js.map +1 -1
- package/dist/shared/index.d.ts +0 -37
- package/dist/shared/index.d.ts.map +1 -1
- package/dist/shared/index.js +0 -4
- package/dist/shared/index.js.map +1 -1
- package/package.json +4 -4
- package/src/actions/_helpers.ts +0 -16
- package/src/actions/booking-authz.spec.ts +0 -6
- package/src/actions/create-team.ts +0 -1
- package/src/actions/event-type-authz.spec.ts +0 -11
- package/src/actions/list-bookings.ts +0 -4
- package/src/actions/refresh-busy-times.ts +0 -1
- package/src/actions/revoke-private-link.ts +0 -2
- package/src/actions/update-profile.ts +0 -5
- package/src/core/buffers.ts +0 -18
- package/src/core/conflicts.ts +0 -4
- package/src/core/limits.ts +0 -8
- package/src/core/round-robin.test.ts +0 -1
- package/src/core/round-robin.ts +0 -17
- package/src/core/rrule.ts +0 -7
- package/src/core/rules.ts +0 -17
- package/src/core/slots.test.ts +1 -11
- package/src/core/slots.ts +0 -40
- package/src/core/time.ts +0 -37
- package/src/index.ts +0 -11
- package/src/manifest.ts +0 -19
- package/src/react/components/SlotPicker.tsx +0 -8
- package/src/react/components/TimezoneSelect.tsx +0 -2
- package/src/react/components/_shadcn-shims.d.ts +0 -35
- package/src/react/components/booking-links/AvailabilityEditor.tsx +0 -15
- package/src/react/components/booking-links/BookingLinkCreateDialog.tsx +0 -22
- package/src/react/components/booking-links/ConferencingSelector.tsx +0 -26
- package/src/react/components/booking-links/CustomFieldsEditor.tsx +0 -15
- package/src/react/components/booking-links/DurationPicker.tsx +1 -12
- package/src/react/components/booking-links/SlugEditor.tsx +0 -14
- package/src/react/components/booking-links/index.ts +0 -9
- package/src/react/components/index.ts +0 -10
- package/src/react/hooks/useBookingFlow.ts +0 -10
- package/src/react/hooks/useEventType.ts +0 -4
- package/src/react/hooks/useReschedule.ts +0 -4
- package/src/react/hooks/useSlots.ts +0 -10
- package/src/react/hooks/useTimezone.ts +0 -4
- package/src/react/index.ts +0 -5
- package/src/schema/bookings.ts +0 -29
- package/src/schema/calendar-cache.ts +0 -11
- package/src/schema/credentials.ts +0 -28
- package/src/schema/event-types.ts +0 -42
- package/src/schema/index.ts +0 -11
- package/src/schema/routing-forms.ts +0 -17
- package/src/schema/schedules.ts +0 -25
- package/src/schema/teams.ts +0 -7
- package/src/schema/workflows.ts +0 -19
- package/src/server/availability-engine.test.ts +0 -1
- package/src/server/availability-engine.ts +0 -22
- package/src/server/booking-service.spec.ts +0 -15
- package/src/server/booking-service.ts +0 -22
- package/src/server/bookings-repo.ts +0 -10
- package/src/server/context.ts +0 -16
- package/src/server/db-types.ts +0 -11
- package/src/server/event-types-repo.ts +0 -31
- package/src/server/hooks.ts +0 -11
- package/src/server/ics.ts +0 -7
- package/src/server/providers/builtin-video.ts +0 -5
- package/src/server/providers/google-calendar.ts +0 -5
- package/src/server/providers/google-meet.ts +0 -7
- package/src/server/providers/office365.ts +0 -6
- package/src/server/providers/registry.ts +0 -4
- package/src/server/providers/teams.ts +0 -8
- package/src/server/providers/types.ts +0 -27
- package/src/server/providers/zoom.ts +0 -21
- package/src/server/schedules-repo.ts +0 -4
- package/src/server/video-oauth-state.ts +1 -10
- package/src/server/video-oauth.ts +0 -23
- package/src/shared/index.ts +0 -38
package/dist/schema/bookings.js
CHANGED
|
@@ -1,58 +1,37 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Bookings — the materialized appointments created when someone books an
|
|
3
|
-
* event type.
|
|
4
|
-
*
|
|
5
|
-
* Each Booking may have multiple attendees (seated events), multiple
|
|
6
|
-
* references (one per external system: Google Calendar event id, Zoom
|
|
7
|
-
* meeting id, etc.), and a recurring parent (for recurring series).
|
|
8
|
-
*/
|
|
9
1
|
import { table, text, integer, ownableColumns, createSharesTable, } from "@agent-native/core/db/schema";
|
|
10
2
|
import { boolean } from "drizzle-orm/pg-core";
|
|
11
3
|
export const bookings = table("bookings", {
|
|
12
4
|
id: text("id").primaryKey(),
|
|
13
|
-
/** Public booking uid used in URLs like /booking/:uid and /reschedule/:uid */
|
|
14
5
|
uid: text("uid").notNull().unique(),
|
|
15
6
|
eventTypeId: text("event_type_id").notNull(),
|
|
16
|
-
/** Organizer email (assigned host for round-robin) */
|
|
17
7
|
hostEmail: text("host_email").notNull(),
|
|
18
8
|
title: text("title").notNull(),
|
|
19
9
|
description: text("description"),
|
|
20
|
-
/** ISO 8601 UTC */
|
|
21
10
|
startTime: text("start_time").notNull(),
|
|
22
11
|
endTime: text("end_time").notNull(),
|
|
23
|
-
/** Timezone in which the organizer/attendees originally picked the slot */
|
|
24
12
|
timezone: text("timezone").notNull().default("UTC"),
|
|
25
13
|
status: text("status", {
|
|
26
14
|
enum: ["pending", "confirmed", "cancelled", "rejected", "rescheduled"],
|
|
27
15
|
})
|
|
28
16
|
.notNull()
|
|
29
17
|
.default("confirmed"),
|
|
30
|
-
/** JSON Location — see shared types */
|
|
31
18
|
location: text("location"),
|
|
32
|
-
/** JSON object of custom field responses */
|
|
33
19
|
customResponses: text("custom_responses"),
|
|
34
|
-
/** Reschedule/cancel tokens for public magic links */
|
|
35
20
|
cancelToken: text("cancel_token"),
|
|
36
21
|
rescheduleToken: text("reschedule_token"),
|
|
37
|
-
/** uid of the booking this one replaced (reschedule chain) */
|
|
38
22
|
fromReschedule: text("from_reschedule"),
|
|
39
23
|
cancellationReason: text("cancellation_reason"),
|
|
40
24
|
reschedulingReason: text("rescheduling_reason"),
|
|
41
|
-
/** Calendar invite iCal UID (stable across reschedules for RFC 5545 compliance) */
|
|
42
25
|
iCalUid: text("ical_uid").notNull(),
|
|
43
26
|
iCalSequence: integer("ical_sequence").notNull().default(0),
|
|
44
|
-
/** Recurring series parent id; null for non-recurring */
|
|
45
27
|
recurringEventId: text("recurring_event_id"),
|
|
46
|
-
/** Payment state (Tier 2) */
|
|
47
28
|
paid: boolean("paid").notNull().default(false),
|
|
48
|
-
/** Whether the host marked themselves a no-show */
|
|
49
29
|
noShowHost: boolean("no_show_host").notNull().default(false),
|
|
50
30
|
metadata: text("metadata"),
|
|
51
31
|
createdAt: text("created_at").notNull(),
|
|
52
32
|
updatedAt: text("updated_at").notNull(),
|
|
53
33
|
...ownableColumns(),
|
|
54
34
|
});
|
|
55
|
-
/** Attendees attached to a booking (N for seated events, 1 for personal). */
|
|
56
35
|
export const bookingAttendees = table("booking_attendees", {
|
|
57
36
|
id: text("id").primaryKey(),
|
|
58
37
|
bookingId: text("booking_id").notNull(),
|
|
@@ -63,14 +42,9 @@ export const bookingAttendees = table("booking_attendees", {
|
|
|
63
42
|
noShow: boolean("no_show").notNull().default(false),
|
|
64
43
|
createdAt: text("created_at").notNull(),
|
|
65
44
|
});
|
|
66
|
-
/**
|
|
67
|
-
* External system references — Google Calendar event ids, Zoom meeting ids,
|
|
68
|
-
* ICS UIDs, etc. One booking → many references.
|
|
69
|
-
*/
|
|
70
45
|
export const bookingReferences = table("booking_references", {
|
|
71
46
|
id: text("id").primaryKey(),
|
|
72
47
|
bookingId: text("booking_id").notNull(),
|
|
73
|
-
/** Provider kind: "google_calendar", "office365_calendar", "zoom_video", … */
|
|
74
48
|
type: text("type").notNull(),
|
|
75
49
|
externalId: text("external_id").notNull(),
|
|
76
50
|
meetingUrl: text("meeting_url"),
|
|
@@ -78,16 +52,13 @@ export const bookingReferences = table("booking_references", {
|
|
|
78
52
|
credentialId: text("credential_id"),
|
|
79
53
|
createdAt: text("created_at").notNull(),
|
|
80
54
|
});
|
|
81
|
-
/** Seat reservations — one per attendee on a seated event. */
|
|
82
55
|
export const bookingSeats = table("booking_seats", {
|
|
83
56
|
id: text("id").primaryKey(),
|
|
84
57
|
bookingId: text("booking_id").notNull(),
|
|
85
58
|
attendeeId: text("attendee_id").notNull(),
|
|
86
|
-
/** Opaque reference string used for attendee self-manage links */
|
|
87
59
|
referenceUid: text("reference_uid").notNull().unique(),
|
|
88
60
|
createdAt: text("created_at").notNull(),
|
|
89
61
|
});
|
|
90
|
-
/** Internal notes on a booking (host-only). */
|
|
91
62
|
export const bookingNotes = table("booking_notes", {
|
|
92
63
|
id: text("id").primaryKey(),
|
|
93
64
|
bookingId: text("booking_id").notNull(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bookings.js","sourceRoot":"","sources":["../../src/schema/bookings.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"bookings.js","sourceRoot":"","sources":["../../src/schema/bookings.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,IAAI,EACJ,OAAO,EACP,cAAc,EACd,iBAAiB,GAClB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAE9C,MAAM,CAAC,MAAM,QAAQ,GAAG,KAAK,CAAC,UAAU,EAAE;IACxC,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE;IAC3B,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC,MAAM,EAAE;IACnC,WAAW,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC,OAAO,EAAE;IAC5C,SAAS,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE;IAEvC,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE;IAC9B,WAAW,EAAE,IAAI,CAAC,aAAa,CAAC;IAEhC,SAAS,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE;IACvC,OAAO,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC,OAAO,EAAE;IACnC,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;IAEnD,MAAM,EAAE,IAAI,CAAC,QAAQ,EAAE;QACrB,IAAI,EAAE,CAAC,SAAS,EAAE,WAAW,EAAE,WAAW,EAAE,UAAU,EAAE,aAAa,CAAC;KACvE,CAAC;SACC,OAAO,EAAE;SACT,OAAO,CAAC,WAAW,CAAC;IAEvB,QAAQ,EAAE,IAA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CAAC,CAAC,UAAU,EAAE;IAC3B,SAAS,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE;IACvC,WAAW,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC,OAAO,EAAE;IAC3C,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC,OAAO,EAAE;IAClC,SAAS,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE;CACxC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,aAAa,GAAG,iBAAiB,CAAC,gBAAgB,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calendar-cache.d.ts","sourceRoot":"","sources":["../../src/schema/calendar-cache.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"calendar-cache.d.ts","sourceRoot":"","sources":["../../src/schema/calendar-cache.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASxB,CAAC"}
|
|
@@ -1,21 +1,10 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Calendar cache — short-TTL cache of busy intervals fetched from external
|
|
3
|
-
* calendars. Keyed by (credentialId, selected-calendars-hash, time-window).
|
|
4
|
-
*
|
|
5
|
-
* Booking the same slot twice at 3:00pm is the worst UX in a scheduling
|
|
6
|
-
* product, so this cache has a short TTL (default 5 min) and is explicitly
|
|
7
|
-
* busted on every booking create/update/cancel.
|
|
8
|
-
*/
|
|
9
1
|
import { table, text } from "@agent-native/core/db/schema";
|
|
10
2
|
export const calendarCache = table("calendar_cache", {
|
|
11
3
|
id: text("id").primaryKey(),
|
|
12
4
|
credentialId: text("credential_id").notNull(),
|
|
13
|
-
/** Hash of (credentialId + sorted selected calendar ids + time range) */
|
|
14
5
|
cacheKey: text("cache_key").notNull().unique(),
|
|
15
|
-
/** ISO 8601 start of the queried window */
|
|
16
6
|
windowStart: text("window_start").notNull(),
|
|
17
7
|
windowEnd: text("window_end").notNull(),
|
|
18
|
-
/** JSON array of {start, end} busy intervals */
|
|
19
8
|
busyJson: text("busy_json").notNull(),
|
|
20
9
|
expiresAt: text("expires_at").notNull(),
|
|
21
10
|
createdAt: text("created_at").notNull(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calendar-cache.js","sourceRoot":"","sources":["../../src/schema/calendar-cache.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"calendar-cache.js","sourceRoot":"","sources":["../../src/schema/calendar-cache.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AAE3D,MAAM,CAAC,MAAM,aAAa,GAAG,KAAK,CAAC,gBAAgB,EAAE;IACnD,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE;IAC3B,YAAY,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC,OAAO,EAAE;IAC7C,QAAQ,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC,OAAO,EAAE,CAAC,MAAM,EAAE;IAC9C,WAAW,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC,OAAO,EAAE;IAC3C,SAAS,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE;IACvC,QAAQ,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC,OAAO,EAAE;IACrC,SAAS,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE;IACvC,SAAS,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE;CACxC,CAAC,CAAC"}
|
|
@@ -209,12 +209,6 @@ export declare const schedulingCredentials: import("drizzle-orm/pg-core").PgTabl
|
|
|
209
209
|
};
|
|
210
210
|
dialect: 'pg';
|
|
211
211
|
}>;
|
|
212
|
-
/**
|
|
213
|
-
* Which external calendars a credential reads "busy" times from.
|
|
214
|
-
* A single credential (e.g. a Google account) may expose multiple calendars
|
|
215
|
-
* (primary, vacation, shared). Users pick a subset to check for conflicts,
|
|
216
|
-
* plus exactly one as the destination for new events.
|
|
217
|
-
*/
|
|
218
212
|
export declare const selectedCalendars: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
219
213
|
name: "selected_calendars";
|
|
220
214
|
schema: undefined;
|
|
@@ -484,7 +478,6 @@ export declare const destinationCalendars: import("drizzle-orm/pg-core").PgTable
|
|
|
484
478
|
};
|
|
485
479
|
dialect: 'pg';
|
|
486
480
|
}>;
|
|
487
|
-
/** Verified sender emails for workflows sending from a custom address. */
|
|
488
481
|
export declare const verifiedEmails: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
489
482
|
name: "verified_emails";
|
|
490
483
|
schema: undefined;
|
|
@@ -577,7 +570,6 @@ export declare const verifiedEmails: import("drizzle-orm/pg-core").PgTableWithCo
|
|
|
577
570
|
};
|
|
578
571
|
dialect: 'pg';
|
|
579
572
|
}>;
|
|
580
|
-
/** Verified phone numbers for workflows sending SMS. */
|
|
581
573
|
export declare const verifiedNumbers: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
582
574
|
name: "verified_numbers";
|
|
583
575
|
schema: undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../../src/schema/credentials.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../../src/schema/credentials.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAahC,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQ5B,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAS/B,CAAC;AAEH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMzB,CAAC;AAEH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAM1B,CAAC"}
|
|
@@ -1,49 +1,25 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Credentials — thin view over framework `oauth_tokens` that records which
|
|
3
|
-
* calendar / video integrations a user has connected. The actual OAuth
|
|
4
|
-
* tokens live in core's `oauth_tokens` table; this table stores display
|
|
5
|
-
* metadata and flags needed by the scheduling UI (display name, invalid
|
|
6
|
-
* flag, app icon, default-for-type).
|
|
7
|
-
*/
|
|
8
1
|
import { table, text } from "@agent-native/core/db/schema";
|
|
9
2
|
import { boolean } from "drizzle-orm/pg-core";
|
|
10
3
|
export const schedulingCredentials = table("scheduling_credentials", {
|
|
11
4
|
id: text("id").primaryKey(),
|
|
12
|
-
/** Provider slug: "google_calendar", "office365_calendar", "zoom_video", "daily_video", … */
|
|
13
5
|
type: text("type").notNull(),
|
|
14
|
-
/** Owner (user) — for team credentials, use teamId too */
|
|
15
6
|
userEmail: text("user_email"),
|
|
16
7
|
teamId: text("team_id"),
|
|
17
|
-
/** App id from framework app store */
|
|
18
8
|
appId: text("app_id"),
|
|
19
|
-
/** Core `oauth_tokens.id` if applicable */
|
|
20
9
|
oauthTokenId: text("oauth_token_id"),
|
|
21
|
-
/** Human-friendly label shown in UI */
|
|
22
10
|
displayName: text("display_name"),
|
|
23
|
-
/** External account email (e.g. Google account email) */
|
|
24
11
|
externalEmail: text("external_email"),
|
|
25
|
-
/** True after a 401/403 — UI prompts re-connect */
|
|
26
12
|
invalid: boolean("invalid").notNull().default(false),
|
|
27
|
-
/** Whether this is the user's default for its category (e.g. default video) */
|
|
28
13
|
isDefault: boolean("is_default").notNull().default(false),
|
|
29
14
|
createdAt: text("created_at").notNull(),
|
|
30
15
|
updatedAt: text("updated_at").notNull(),
|
|
31
16
|
});
|
|
32
|
-
/**
|
|
33
|
-
* Which external calendars a credential reads "busy" times from.
|
|
34
|
-
* A single credential (e.g. a Google account) may expose multiple calendars
|
|
35
|
-
* (primary, vacation, shared). Users pick a subset to check for conflicts,
|
|
36
|
-
* plus exactly one as the destination for new events.
|
|
37
|
-
*/
|
|
38
17
|
export const selectedCalendars = table("selected_calendars", {
|
|
39
18
|
id: text("id").primaryKey(),
|
|
40
19
|
credentialId: text("credential_id").notNull(),
|
|
41
20
|
userEmail: text("user_email").notNull(),
|
|
42
|
-
/** External calendar id from the provider */
|
|
43
21
|
externalId: text("external_id").notNull(),
|
|
44
|
-
/** Provider name for this entry */
|
|
45
22
|
integration: text("integration").notNull(),
|
|
46
|
-
/** Optional event-type-level override (only check this calendar for that event) */
|
|
47
23
|
eventTypeId: text("event_type_id"),
|
|
48
24
|
createdAt: text("created_at").notNull(),
|
|
49
25
|
});
|
|
@@ -51,15 +27,12 @@ export const destinationCalendars = table("destination_calendars", {
|
|
|
51
27
|
id: text("id").primaryKey(),
|
|
52
28
|
credentialId: text("credential_id").notNull(),
|
|
53
29
|
userEmail: text("user_email").notNull(),
|
|
54
|
-
/** Provider name */
|
|
55
30
|
integration: text("integration").notNull(),
|
|
56
31
|
externalId: text("external_id").notNull(),
|
|
57
32
|
primaryEmail: text("primary_email"),
|
|
58
|
-
/** Optional event-type-level override */
|
|
59
33
|
eventTypeId: text("event_type_id"),
|
|
60
34
|
createdAt: text("created_at").notNull(),
|
|
61
35
|
});
|
|
62
|
-
/** Verified sender emails for workflows sending from a custom address. */
|
|
63
36
|
export const verifiedEmails = table("verified_emails", {
|
|
64
37
|
id: text("id").primaryKey(),
|
|
65
38
|
email: text("email").notNull(),
|
|
@@ -67,7 +40,6 @@ export const verifiedEmails = table("verified_emails", {
|
|
|
67
40
|
teamId: text("team_id"),
|
|
68
41
|
verifiedAt: text("verified_at").notNull(),
|
|
69
42
|
});
|
|
70
|
-
/** Verified phone numbers for workflows sending SMS. */
|
|
71
43
|
export const verifiedNumbers = table("verified_numbers", {
|
|
72
44
|
id: text("id").primaryKey(),
|
|
73
45
|
phoneNumber: text("phone_number").notNull(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credentials.js","sourceRoot":"","sources":["../../src/schema/credentials.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"credentials.js","sourceRoot":"","sources":["../../src/schema/credentials.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAE9C,MAAM,CAAC,MAAM,qBAAqB,GAAG,KAAK,CAAC,wBAAwB,EAAE;IACnE,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE;IAC3B,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE;IAC5B,SAAS,EAAE,IAAI,CAAC,YAAY,CAAC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E,IAAI,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE;IACvC,WAAW,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC,OAAO,EAAE;IAC1C,UAAU,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC,OAAO,EAAE;IACzC,YAAY,EAAE,IAAI,CAAC,eAAe,CAAC;IACnC,WAAW,EAAE,IAAI,CAAC,eAAe,CAAC;IAClC,SAAS,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE;CACxC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,cAAc,GAAG,KAAK,CAAC,iBAAiB,EAAE;IACrD,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE;IAC3B,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE;IAC9B,SAAS,EAAE,IAAI,CAAC,YAAY,CAAC;IAC7B,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC;IACvB,UAAU,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC,OAAO,EAAE;CAC1C,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,CAAC,kBAAkB,EAAE;IACvD,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE;IAC3B,WAAW,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC,OAAO,EAAE;IAC3C,SAAS,EAAE,IAAI,CAAC,YAAY,CAAC;IAC7B,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC;IACvB,UAAU,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC,OAAO,EAAE;CAC1C,CAAC,CAAC"}
|
|
@@ -634,10 +634,6 @@ export declare const eventTypes: import("drizzle-orm/pg-core").PgTableWithColumn
|
|
|
634
634
|
};
|
|
635
635
|
dialect: 'pg';
|
|
636
636
|
}>;
|
|
637
|
-
/**
|
|
638
|
-
* Host assignments for team / round-robin / collective event types.
|
|
639
|
-
* Composite key (userEmail, eventTypeId).
|
|
640
|
-
*/
|
|
641
637
|
export declare const eventTypeHosts: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
642
638
|
name: "event_type_hosts";
|
|
643
639
|
schema: undefined;
|
|
@@ -781,7 +777,6 @@ export declare const eventTypeHosts: import("drizzle-orm/pg-core").PgTableWithCo
|
|
|
781
777
|
};
|
|
782
778
|
dialect: 'pg';
|
|
783
779
|
}>;
|
|
784
|
-
/** Host groups — collective assignment within a round-robin group. */
|
|
785
780
|
export declare const eventTypeHostGroups: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
786
781
|
name: "event_type_host_groups";
|
|
787
782
|
schema: undefined;
|
|
@@ -857,10 +852,6 @@ export declare const eventTypeHostGroups: import("drizzle-orm/pg-core").PgTableW
|
|
|
857
852
|
};
|
|
858
853
|
dialect: 'pg';
|
|
859
854
|
}>;
|
|
860
|
-
/**
|
|
861
|
-
* Rename history — e.g. `/me/old-slug` → `/me/new-slug`.
|
|
862
|
-
* Public booker redirects the old slug to the new one.
|
|
863
|
-
*/
|
|
864
855
|
export declare const eventTypeSlugRedirects: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
865
856
|
name: "event_type_slug_redirects";
|
|
866
857
|
schema: undefined;
|
|
@@ -936,7 +927,6 @@ export declare const eventTypeSlugRedirects: import("drizzle-orm/pg-core").PgTab
|
|
|
936
927
|
};
|
|
937
928
|
dialect: 'pg';
|
|
938
929
|
}>;
|
|
939
|
-
/** Hashed private links (`/d/:hash/:slug`) — shareable tokens that don't expose the owner's username. */
|
|
940
930
|
export declare const hashedLinks: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
941
931
|
name: "hashed_links";
|
|
942
932
|
schema: undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-types.d.ts","sourceRoot":"","sources":["../../src/schema/event-types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"event-types.d.ts","sourceRoot":"","sources":["../../src/schema/event-types.ts"],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;;;;;;;;;;;;;;;;;;;;;;;;EAKjC,CAAC;AAEH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQtB,CAAC;AAEH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAyC,CAAC"}
|
|
@@ -1,50 +1,28 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Event types — the top-level bookable definition.
|
|
3
|
-
*
|
|
4
|
-
* An EventType represents "a 30-minute intro call", "a team round-robin sales
|
|
5
|
-
* demo", or "a managed internal 1:1". It is the primary resource users create,
|
|
6
|
-
* edit, and share booking links for.
|
|
7
|
-
*
|
|
8
|
-
* Ownership: personal event types are owned by a user (ownerEmail);
|
|
9
|
-
* team event types are owned by a team (teamId). Sharing is via the framework
|
|
10
|
-
* sharing system (`event_type_shares`).
|
|
11
|
-
*/
|
|
12
1
|
import { table, text, integer, ownableColumns, createSharesTable, } from "@agent-native/core/db/schema";
|
|
13
2
|
import { boolean } from "drizzle-orm/pg-core";
|
|
14
3
|
export const eventTypes = table("event_types", {
|
|
15
4
|
id: text("id").primaryKey(),
|
|
16
|
-
// Identity
|
|
17
5
|
title: text("title").notNull(),
|
|
18
6
|
slug: text("slug").notNull(),
|
|
19
7
|
description: text("description"),
|
|
20
|
-
/** Default duration in minutes */
|
|
21
8
|
length: integer("length").notNull().default(30),
|
|
22
|
-
/** JSON array of additional duration choices, e.g. [15, 30, 60] */
|
|
23
9
|
durations: text("durations"),
|
|
24
10
|
position: integer("position").notNull().default(0),
|
|
25
11
|
hidden: boolean("hidden").notNull().default(false),
|
|
26
12
|
color: text("color"),
|
|
27
|
-
// Scheduling model
|
|
28
13
|
schedulingType: text("scheduling_type", {
|
|
29
14
|
enum: ["personal", "collective", "round-robin", "managed"],
|
|
30
15
|
})
|
|
31
16
|
.notNull()
|
|
32
17
|
.default("personal"),
|
|
33
|
-
/** Team id if this is a team event type; null for personal */
|
|
34
18
|
teamId: text("team_id"),
|
|
35
|
-
// Locations (JSON array of Location objects)
|
|
36
19
|
locations: text("locations"),
|
|
37
|
-
// Custom fields (JSON array of CustomField objects)
|
|
38
20
|
customFields: text("custom_fields"),
|
|
39
|
-
// Default schedule reference
|
|
40
21
|
scheduleId: text("schedule_id"),
|
|
41
|
-
// Buffers & notice
|
|
42
22
|
minimumBookingNotice: integer("minimum_booking_notice").notNull().default(0),
|
|
43
23
|
beforeEventBuffer: integer("before_event_buffer").notNull().default(0),
|
|
44
24
|
afterEventBuffer: integer("after_event_buffer").notNull().default(0),
|
|
45
|
-
/** Slot granularity in minutes; null = use duration */
|
|
46
25
|
slotInterval: integer("slot_interval"),
|
|
47
|
-
// Booking window
|
|
48
26
|
periodType: text("period_type", {
|
|
49
27
|
enum: ["unlimited", "rolling", "range"],
|
|
50
28
|
})
|
|
@@ -53,7 +31,6 @@ export const eventTypes = table("event_types", {
|
|
|
53
31
|
periodDays: integer("period_days").default(60),
|
|
54
32
|
periodStartDate: text("period_start_date"),
|
|
55
33
|
periodEndDate: text("period_end_date"),
|
|
56
|
-
// Capacity & policies
|
|
57
34
|
seatsPerTimeSlot: integer("seats_per_time_slot"),
|
|
58
35
|
requiresConfirmation: boolean("requires_confirmation")
|
|
59
36
|
.notNull()
|
|
@@ -62,55 +39,36 @@ export const eventTypes = table("event_types", {
|
|
|
62
39
|
hideCalendarNotes: boolean("hide_calendar_notes").notNull().default(false),
|
|
63
40
|
successRedirectUrl: text("success_redirect_url"),
|
|
64
41
|
bookingLimits: text("booking_limits"),
|
|
65
|
-
/** Lock timezone on Booker (for in-person or local-only events) */
|
|
66
42
|
lockTimeZoneToggle: boolean("lock_time_zone_toggle").notNull().default(false),
|
|
67
|
-
// Recurring (JSON RecurringEventRule) — Tier 2
|
|
68
43
|
recurringEvent: text("recurring_event"),
|
|
69
|
-
// Templated event name: "{name} + {host}"
|
|
70
44
|
eventName: text("event_name"),
|
|
71
|
-
// Misc
|
|
72
45
|
metadata: text("metadata"),
|
|
73
46
|
createdAt: text("created_at").notNull(),
|
|
74
47
|
updatedAt: text("updated_at").notNull(),
|
|
75
48
|
...ownableColumns(),
|
|
76
49
|
});
|
|
77
|
-
/**
|
|
78
|
-
* Host assignments for team / round-robin / collective event types.
|
|
79
|
-
* Composite key (userEmail, eventTypeId).
|
|
80
|
-
*/
|
|
81
50
|
export const eventTypeHosts = table("event_type_hosts", {
|
|
82
51
|
eventTypeId: text("event_type_id").notNull(),
|
|
83
52
|
userEmail: text("user_email").notNull(),
|
|
84
|
-
/** Fixed hosts always attend; non-fixed hosts rotate in round-robin */
|
|
85
53
|
isFixed: boolean("is_fixed").notNull().default(false),
|
|
86
|
-
/** Relative weight for weighted round-robin (default 1) */
|
|
87
54
|
weight: integer("weight").notNull().default(1),
|
|
88
|
-
/** Lower number = higher priority in round-robin tiebreak */
|
|
89
55
|
priority: integer("priority").notNull().default(2),
|
|
90
|
-
/** Host-specific schedule override; null = use host's default */
|
|
91
56
|
scheduleId: text("schedule_id"),
|
|
92
57
|
groupId: text("group_id"),
|
|
93
58
|
createdAt: text("created_at").notNull(),
|
|
94
59
|
});
|
|
95
|
-
/** Host groups — collective assignment within a round-robin group. */
|
|
96
60
|
export const eventTypeHostGroups = table("event_type_host_groups", {
|
|
97
61
|
id: text("id").primaryKey(),
|
|
98
62
|
eventTypeId: text("event_type_id").notNull(),
|
|
99
63
|
name: text("name").notNull(),
|
|
100
64
|
createdAt: text("created_at").notNull(),
|
|
101
65
|
});
|
|
102
|
-
/**
|
|
103
|
-
* Rename history — e.g. `/me/old-slug` → `/me/new-slug`.
|
|
104
|
-
* Public booker redirects the old slug to the new one.
|
|
105
|
-
*/
|
|
106
66
|
export const eventTypeSlugRedirects = table("event_type_slug_redirects", {
|
|
107
|
-
/** Composite: "ownerEmail:slug" or "team:teamId:slug" — unique across ownership scope */
|
|
108
67
|
oldKey: text("old_key").primaryKey(),
|
|
109
68
|
newKey: text("new_key").notNull(),
|
|
110
69
|
eventTypeId: text("event_type_id"),
|
|
111
70
|
createdAt: text("created_at").notNull(),
|
|
112
71
|
});
|
|
113
|
-
/** Hashed private links (`/d/:hash/:slug`) — shareable tokens that don't expose the owner's username. */
|
|
114
72
|
export const hashedLinks = table("hashed_links", {
|
|
115
73
|
id: text("id").primaryKey(),
|
|
116
74
|
hash: text("hash").notNull().unique(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-types.js","sourceRoot":"","sources":["../../src/schema/event-types.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"event-types.js","sourceRoot":"","sources":["../../src/schema/event-types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,IAAI,EACJ,OAAO,EACP,cAAc,EACd,iBAAiB,GAClB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAE9C,MAAM,CAAC,MAAM,UAAU,GAAG,KAAK,CAAC,aAAa,EAAE;IAC7C,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE;IAE3B,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE;IAC9B,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE;IAC5B,WAAW,EAAE,IAAI,CAAC,aAAa,CAAC;IAChC,MAAM,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;IAC/C,SAAS,EAAE,IAAI,CAAC,WAAW,CAAC;IAC5B,QAAQ,EAAE,OAAO,CAAC,UAAU,C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AAC;IACvB,SAAS,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE;CACxC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,eAAe,GAAG,iBAAiB,CAAC,mBAAmB,CAAC,CAAC"}
|
package/dist/schema/index.d.ts
CHANGED
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Barrel export for all scheduling schema tables.
|
|
3
|
-
*
|
|
4
|
-
* Consumer apps compose this with their own schema:
|
|
5
|
-
*
|
|
6
|
-
* // server/db/schema.ts
|
|
7
|
-
* export * from "@agent-native/scheduling/schema";
|
|
8
|
-
* export * from "./local-tables.js";
|
|
9
|
-
*
|
|
10
|
-
* Drizzle's schema scanner picks up all tables from the combined namespace.
|
|
11
|
-
*/
|
|
12
1
|
export * from "./event-types.js";
|
|
13
2
|
export * from "./schedules.js";
|
|
14
3
|
export * from "./bookings.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schema/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schema/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC"}
|
package/dist/schema/index.js
CHANGED
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Barrel export for all scheduling schema tables.
|
|
3
|
-
*
|
|
4
|
-
* Consumer apps compose this with their own schema:
|
|
5
|
-
*
|
|
6
|
-
* // server/db/schema.ts
|
|
7
|
-
* export * from "@agent-native/scheduling/schema";
|
|
8
|
-
* export * from "./local-tables.js";
|
|
9
|
-
*
|
|
10
|
-
* Drizzle's schema scanner picks up all tables from the combined namespace.
|
|
11
|
-
*/
|
|
12
1
|
export * from "./event-types.js";
|
|
13
2
|
export * from "./schedules.js";
|
|
14
3
|
export * from "./bookings.js";
|
package/dist/schema/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schema/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schema/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routing-forms.d.ts","sourceRoot":"","sources":["../../src/schema/routing-forms.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"routing-forms.d.ts","sourceRoot":"","sources":["../../src/schema/routing-forms.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAYvB,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAU/B,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAA2C,CAAC"}
|
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Routing forms — ChiliPiper-style pre-booking forms that route prospects to
|
|
3
|
-
* the right event type based on their answers.
|
|
4
|
-
*
|
|
5
|
-
* A form has fields (text/select/multi), rules (match conditions → action),
|
|
6
|
-
* and a fallback. Public form URL is `/forms/:formId`; on submit we evaluate
|
|
7
|
-
* rules in order and either redirect to an event-type booker, open an
|
|
8
|
-
* external URL, or show a custom message.
|
|
9
|
-
*/
|
|
10
1
|
import { table, text, ownableColumns, createSharesTable, } from "@agent-native/core/db/schema";
|
|
11
2
|
import { boolean } from "drizzle-orm/pg-core";
|
|
12
3
|
export const routingForms = table("routing_forms", {
|
|
@@ -15,11 +6,8 @@ export const routingForms = table("routing_forms", {
|
|
|
15
6
|
description: text("description"),
|
|
16
7
|
teamId: text("team_id"),
|
|
17
8
|
disabled: boolean("disabled").notNull().default(false),
|
|
18
|
-
/** JSON array of RoutingFormField */
|
|
19
9
|
fields: text("fields").notNull().default("[]"),
|
|
20
|
-
/** JSON array of RoutingFormRule */
|
|
21
10
|
rules: text("rules").notNull().default("[]"),
|
|
22
|
-
/** JSON RoutingFormRule action object for when no rules match */
|
|
23
11
|
fallback: text("fallback"),
|
|
24
12
|
createdAt: text("created_at").notNull(),
|
|
25
13
|
updatedAt: text("updated_at").notNull(),
|
|
@@ -28,15 +16,10 @@ export const routingForms = table("routing_forms", {
|
|
|
28
16
|
export const routingFormResponses = table("routing_form_responses", {
|
|
29
17
|
id: text("id").primaryKey(),
|
|
30
18
|
formId: text("form_id").notNull(),
|
|
31
|
-
/** JSON object of fieldId → value */
|
|
32
19
|
response: text("response").notNull(),
|
|
33
|
-
/** Booking id if the response resulted in a booking */
|
|
34
20
|
bookingId: text("booking_id"),
|
|
35
|
-
/** Which rule matched (null if fallback) */
|
|
36
21
|
matchedRuleId: text("matched_rule_id"),
|
|
37
|
-
/** Resulting action description for quick filtering */
|
|
38
22
|
routedTo: text("routed_to"),
|
|
39
|
-
/** Submitter context */
|
|
40
23
|
submitterEmail: text("submitter_email"),
|
|
41
24
|
submitterIp: text("submitter_ip"),
|
|
42
25
|
createdAt: text("created_at").notNull(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routing-forms.js","sourceRoot":"","sources":["../../src/schema/routing-forms.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"routing-forms.js","sourceRoot":"","sources":["../../src/schema/routing-forms.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,IAAI,EACJ,cAAc,EACd,iBAAiB,GAClB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAE9C,MAAM,CAAC,MAAM,YAAY,GAAG,KAAK,CAAC,eAAe,EAAE;IACjD,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE;IAC3B,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE;IAC5B,WAAW,EAAE,IAAI,CAAC,aAAa,CAAC;IAChC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC;IACvB,QAAQ,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;IACtD,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;IAC9C,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;IAC5C,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC;IAC1B,SAAS,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE;IACvC,SAAS,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE;IACvC,GAAG,cAAc,EAAE;CACpB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,oBAAoB,GAAG,KAAK,CAAC,wBAAwB,EAAE;IAClE,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE;IAC3B,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC,OAAO,EAAE;IACjC,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC,OAAO,EAAE;IACpC,SAAS,EAAE,IAAI,CAAC,YAAY,CAAC;IAC7B,aAAa,EAAE,IAAI,CAAC,iBAAiB,CAAC;IACtC,QAAQ,EAAE,IAAI,CAAC,WAAW,CAAC;IAC3B,cAAc,EAAE,IAAI,CAAC,iBAAiB,CAAC;IACvC,WAAW,EAAE,IAAI,CAAC,cAAc,CAAC;IACjC,SAAS,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE;CACxC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,iBAAiB,GAAG,iBAAiB,CAAC,qBAAqB,CAAC,CAAC"}
|
|
@@ -158,11 +158,6 @@ export declare const schedules: import("drizzle-orm/pg-core").PgTableWithColumns
|
|
|
158
158
|
};
|
|
159
159
|
dialect: 'pg';
|
|
160
160
|
}>;
|
|
161
|
-
/**
|
|
162
|
-
* Weekly availability rules.
|
|
163
|
-
* Each row is one interval on one day-of-week for one schedule.
|
|
164
|
-
* Example: scheduleId=X, day=1 (Mon), startTime="09:00", endTime="12:00".
|
|
165
|
-
*/
|
|
166
161
|
export declare const scheduleAvailability: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
167
162
|
name: "schedule_availability";
|
|
168
163
|
schema: undefined;
|
|
@@ -272,11 +267,6 @@ export declare const scheduleAvailability: import("drizzle-orm/pg-core").PgTable
|
|
|
272
267
|
};
|
|
273
268
|
dialect: 'pg';
|
|
274
269
|
}>;
|
|
275
|
-
/**
|
|
276
|
-
* Date-specific overrides.
|
|
277
|
-
* Example: scheduleId=X, date="2026-04-25", intervals=[] (fully blocked).
|
|
278
|
-
* Or intervals=[{"09:00"-"11:00"}] (only 9-11 on that day).
|
|
279
|
-
*/
|
|
280
270
|
export declare const dateOverrides: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
281
271
|
name: "date_overrides";
|
|
282
272
|
schema: undefined;
|
|
@@ -369,7 +359,6 @@ export declare const dateOverrides: import("drizzle-orm/pg-core").PgTableWithCol
|
|
|
369
359
|
};
|
|
370
360
|
dialect: 'pg';
|
|
371
361
|
}>;
|
|
372
|
-
/** Time-zoned travel windows that override the user's default timezone. */
|
|
373
362
|
export declare const travelSchedules: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
374
363
|
name: "travel_schedules";
|
|
375
364
|
schema: undefined;
|
|
@@ -479,7 +468,6 @@ export declare const travelSchedules: import("drizzle-orm/pg-core").PgTableWithC
|
|
|
479
468
|
};
|
|
480
469
|
dialect: 'pg';
|
|
481
470
|
}>;
|
|
482
|
-
/** Out of office — blocks bookings and optionally redirects to a coworker. */
|
|
483
471
|
export declare const outOfOfficeEntries: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
484
472
|
name: "out_of_office_entries";
|
|
485
473
|
schema: undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schedules.d.ts","sourceRoot":"","sources":["../../src/schema/schedules.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"schedules.d.ts","sourceRoot":"","sources":["../../src/schema/schedules.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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