@agent-native/scheduling 0.1.1
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/README.md +58 -0
- package/dist/actions/_helpers.d.ts +12 -0
- package/dist/actions/_helpers.d.ts.map +1 -0
- package/dist/actions/_helpers.js +49 -0
- package/dist/actions/_helpers.js.map +1 -0
- package/dist/actions/accept-team-invite.d.ts +3 -0
- package/dist/actions/accept-team-invite.d.ts.map +1 -0
- package/dist/actions/accept-team-invite.js +27 -0
- package/dist/actions/accept-team-invite.js.map +1 -0
- package/dist/actions/add-booking-attendee.d.ts +3 -0
- package/dist/actions/add-booking-attendee.d.ts.map +1 -0
- package/dist/actions/add-booking-attendee.js +33 -0
- package/dist/actions/add-booking-attendee.js.map +1 -0
- package/dist/actions/add-booking-note.d.ts +3 -0
- package/dist/actions/add-booking-note.d.ts.map +1 -0
- package/dist/actions/add-booking-note.js +26 -0
- package/dist/actions/add-booking-note.js.map +1 -0
- package/dist/actions/add-date-override.d.ts +3 -0
- package/dist/actions/add-date-override.d.ts.map +1 -0
- package/dist/actions/add-date-override.js +16 -0
- package/dist/actions/add-date-override.js.map +1 -0
- package/dist/actions/add-private-link.d.ts +3 -0
- package/dist/actions/add-private-link.d.ts.map +1 -0
- package/dist/actions/add-private-link.js +31 -0
- package/dist/actions/add-private-link.js.map +1 -0
- package/dist/actions/assign-round-robin-host.d.ts +3 -0
- package/dist/actions/assign-round-robin-host.d.ts.map +1 -0
- package/dist/actions/assign-round-robin-host.js +48 -0
- package/dist/actions/assign-round-robin-host.js.map +1 -0
- package/dist/actions/cancel-booking.d.ts +3 -0
- package/dist/actions/cancel-booking.d.ts.map +1 -0
- package/dist/actions/cancel-booking.js +34 -0
- package/dist/actions/cancel-booking.js.map +1 -0
- package/dist/actions/check-availability.d.ts +3 -0
- package/dist/actions/check-availability.d.ts.map +1 -0
- package/dist/actions/check-availability.js +43 -0
- package/dist/actions/check-availability.js.map +1 -0
- package/dist/actions/confirm-booking.d.ts +3 -0
- package/dist/actions/confirm-booking.d.ts.map +1 -0
- package/dist/actions/confirm-booking.js +12 -0
- package/dist/actions/confirm-booking.js.map +1 -0
- package/dist/actions/connect-calendar.d.ts +3 -0
- package/dist/actions/connect-calendar.d.ts.map +1 -0
- package/dist/actions/connect-calendar.js +26 -0
- package/dist/actions/connect-calendar.js.map +1 -0
- package/dist/actions/connect-video.d.ts +3 -0
- package/dist/actions/connect-video.d.ts.map +1 -0
- package/dist/actions/connect-video.js +54 -0
- package/dist/actions/connect-video.js.map +1 -0
- package/dist/actions/create-booking.d.ts +3 -0
- package/dist/actions/create-booking.d.ts.map +1 -0
- package/dist/actions/create-booking.js +60 -0
- package/dist/actions/create-booking.js.map +1 -0
- package/dist/actions/create-event-type.d.ts +3 -0
- package/dist/actions/create-event-type.d.ts.map +1 -0
- package/dist/actions/create-event-type.js +45 -0
- package/dist/actions/create-event-type.js.map +1 -0
- package/dist/actions/create-host-group.d.ts +3 -0
- package/dist/actions/create-host-group.d.ts.map +1 -0
- package/dist/actions/create-host-group.js +25 -0
- package/dist/actions/create-host-group.js.map +1 -0
- package/dist/actions/create-routing-form.d.ts +3 -0
- package/dist/actions/create-routing-form.d.ts.map +1 -0
- package/dist/actions/create-routing-form.js +39 -0
- package/dist/actions/create-routing-form.js.map +1 -0
- package/dist/actions/create-schedule.d.ts +3 -0
- package/dist/actions/create-schedule.d.ts.map +1 -0
- package/dist/actions/create-schedule.js +32 -0
- package/dist/actions/create-schedule.js.map +1 -0
- package/dist/actions/create-team.d.ts +3 -0
- package/dist/actions/create-team.d.ts.map +1 -0
- package/dist/actions/create-team.js +44 -0
- package/dist/actions/create-team.js.map +1 -0
- package/dist/actions/create-workflow.d.ts +3 -0
- package/dist/actions/create-workflow.d.ts.map +1 -0
- package/dist/actions/create-workflow.js +81 -0
- package/dist/actions/create-workflow.js.map +1 -0
- package/dist/actions/delete-event-type.d.ts +3 -0
- package/dist/actions/delete-event-type.d.ts.map +1 -0
- package/dist/actions/delete-event-type.js +14 -0
- package/dist/actions/delete-event-type.js.map +1 -0
- package/dist/actions/delete-routing-form.d.ts +3 -0
- package/dist/actions/delete-routing-form.d.ts.map +1 -0
- package/dist/actions/delete-routing-form.js +21 -0
- package/dist/actions/delete-routing-form.js.map +1 -0
- package/dist/actions/delete-schedule.d.ts +3 -0
- package/dist/actions/delete-schedule.d.ts.map +1 -0
- package/dist/actions/delete-schedule.js +14 -0
- package/dist/actions/delete-schedule.js.map +1 -0
- package/dist/actions/delete-workflow.d.ts +3 -0
- package/dist/actions/delete-workflow.d.ts.map +1 -0
- package/dist/actions/delete-workflow.js +21 -0
- package/dist/actions/delete-workflow.js.map +1 -0
- package/dist/actions/disconnect-calendar.d.ts +3 -0
- package/dist/actions/disconnect-calendar.d.ts.map +1 -0
- package/dist/actions/disconnect-calendar.js +22 -0
- package/dist/actions/disconnect-calendar.js.map +1 -0
- package/dist/actions/duplicate-event-type.d.ts +3 -0
- package/dist/actions/duplicate-event-type.d.ts.map +1 -0
- package/dist/actions/duplicate-event-type.js +34 -0
- package/dist/actions/duplicate-event-type.js.map +1 -0
- package/dist/actions/export-bookings-csv.d.ts +3 -0
- package/dist/actions/export-bookings-csv.d.ts.map +1 -0
- package/dist/actions/export-bookings-csv.js +53 -0
- package/dist/actions/export-bookings-csv.js.map +1 -0
- package/dist/actions/find-available-slot.d.ts +3 -0
- package/dist/actions/find-available-slot.d.ts.map +1 -0
- package/dist/actions/find-available-slot.js +39 -0
- package/dist/actions/find-available-slot.js.map +1 -0
- package/dist/actions/get-availability.d.ts +3 -0
- package/dist/actions/get-availability.d.ts.map +1 -0
- package/dist/actions/get-availability.js +20 -0
- package/dist/actions/get-availability.js.map +1 -0
- package/dist/actions/get-booking.d.ts +3 -0
- package/dist/actions/get-booking.d.ts.map +1 -0
- package/dist/actions/get-booking.js +9 -0
- package/dist/actions/get-booking.js.map +1 -0
- package/dist/actions/get-event-type.d.ts +3 -0
- package/dist/actions/get-event-type.d.ts.map +1 -0
- package/dist/actions/get-event-type.js +27 -0
- package/dist/actions/get-event-type.js.map +1 -0
- package/dist/actions/install-conferencing-app.d.ts +3 -0
- package/dist/actions/install-conferencing-app.d.ts.map +1 -0
- package/dist/actions/install-conferencing-app.js +28 -0
- package/dist/actions/install-conferencing-app.js.map +1 -0
- package/dist/actions/invite-team-member.d.ts +3 -0
- package/dist/actions/invite-team-member.d.ts.map +1 -0
- package/dist/actions/invite-team-member.js +30 -0
- package/dist/actions/invite-team-member.js.map +1 -0
- package/dist/actions/list-bookings.d.ts +3 -0
- package/dist/actions/list-bookings.d.ts.map +1 -0
- package/dist/actions/list-bookings.js +35 -0
- package/dist/actions/list-bookings.js.map +1 -0
- package/dist/actions/list-calendar-integrations.d.ts +3 -0
- package/dist/actions/list-calendar-integrations.d.ts.map +1 -0
- package/dist/actions/list-calendar-integrations.js +26 -0
- package/dist/actions/list-calendar-integrations.js.map +1 -0
- package/dist/actions/list-event-types.d.ts +3 -0
- package/dist/actions/list-event-types.d.ts.map +1 -0
- package/dist/actions/list-event-types.js +31 -0
- package/dist/actions/list-event-types.js.map +1 -0
- package/dist/actions/list-routing-form-responses.d.ts +3 -0
- package/dist/actions/list-routing-form-responses.d.ts.map +1 -0
- package/dist/actions/list-routing-form-responses.js +24 -0
- package/dist/actions/list-routing-form-responses.js.map +1 -0
- package/dist/actions/list-routing-forms.d.ts +3 -0
- package/dist/actions/list-routing-forms.d.ts.map +1 -0
- package/dist/actions/list-routing-forms.js +29 -0
- package/dist/actions/list-routing-forms.js.map +1 -0
- package/dist/actions/list-schedules.d.ts +3 -0
- package/dist/actions/list-schedules.d.ts.map +1 -0
- package/dist/actions/list-schedules.js +16 -0
- package/dist/actions/list-schedules.js.map +1 -0
- package/dist/actions/list-selected-calendars.d.ts +3 -0
- package/dist/actions/list-selected-calendars.d.ts.map +1 -0
- package/dist/actions/list-selected-calendars.js +42 -0
- package/dist/actions/list-selected-calendars.js.map +1 -0
- package/dist/actions/list-workflows.d.ts +3 -0
- package/dist/actions/list-workflows.d.ts.map +1 -0
- package/dist/actions/list-workflows.js +29 -0
- package/dist/actions/list-workflows.js.map +1 -0
- package/dist/actions/mark-no-show.d.ts +3 -0
- package/dist/actions/mark-no-show.d.ts.map +1 -0
- package/dist/actions/mark-no-show.js +15 -0
- package/dist/actions/mark-no-show.js.map +1 -0
- package/dist/actions/refresh-busy-times.d.ts +3 -0
- package/dist/actions/refresh-busy-times.d.ts.map +1 -0
- package/dist/actions/refresh-busy-times.js +25 -0
- package/dist/actions/refresh-busy-times.js.map +1 -0
- package/dist/actions/remove-booking-attendee.d.ts +3 -0
- package/dist/actions/remove-booking-attendee.d.ts.map +1 -0
- package/dist/actions/remove-booking-attendee.js +20 -0
- package/dist/actions/remove-booking-attendee.js.map +1 -0
- package/dist/actions/remove-date-override.d.ts +3 -0
- package/dist/actions/remove-date-override.d.ts.map +1 -0
- package/dist/actions/remove-date-override.js +15 -0
- package/dist/actions/remove-date-override.js.map +1 -0
- package/dist/actions/remove-team-member.d.ts +3 -0
- package/dist/actions/remove-team-member.d.ts.map +1 -0
- package/dist/actions/remove-team-member.js +18 -0
- package/dist/actions/remove-team-member.js.map +1 -0
- package/dist/actions/reorder-event-types.d.ts +3 -0
- package/dist/actions/reorder-event-types.d.ts.map +1 -0
- package/dist/actions/reorder-event-types.js +18 -0
- package/dist/actions/reorder-event-types.js.map +1 -0
- package/dist/actions/reschedule-booking.d.ts +3 -0
- package/dist/actions/reschedule-booking.d.ts.map +1 -0
- package/dist/actions/reschedule-booking.js +38 -0
- package/dist/actions/reschedule-booking.js.map +1 -0
- package/dist/actions/revoke-private-link.d.ts +3 -0
- package/dist/actions/revoke-private-link.d.ts.map +1 -0
- package/dist/actions/revoke-private-link.js +16 -0
- package/dist/actions/revoke-private-link.js.map +1 -0
- package/dist/actions/send-reschedule-link.d.ts +3 -0
- package/dist/actions/send-reschedule-link.d.ts.map +1 -0
- package/dist/actions/send-reschedule-link.js +18 -0
- package/dist/actions/send-reschedule-link.js.map +1 -0
- package/dist/actions/set-appearance.d.ts +3 -0
- package/dist/actions/set-appearance.d.ts.map +1 -0
- package/dist/actions/set-appearance.js +23 -0
- package/dist/actions/set-appearance.js.map +1 -0
- package/dist/actions/set-default-conferencing-app.d.ts +3 -0
- package/dist/actions/set-default-conferencing-app.d.ts.map +1 -0
- package/dist/actions/set-default-conferencing-app.js +25 -0
- package/dist/actions/set-default-conferencing-app.js.map +1 -0
- package/dist/actions/set-default-schedule.d.ts +3 -0
- package/dist/actions/set-default-schedule.d.ts.map +1 -0
- package/dist/actions/set-default-schedule.js +15 -0
- package/dist/actions/set-default-schedule.js.map +1 -0
- package/dist/actions/set-destination-calendar.d.ts +3 -0
- package/dist/actions/set-destination-calendar.d.ts.map +1 -0
- package/dist/actions/set-destination-calendar.js +39 -0
- package/dist/actions/set-destination-calendar.js.map +1 -0
- package/dist/actions/set-event-type-hosts.d.ts +3 -0
- package/dist/actions/set-event-type-hosts.d.ts.map +1 -0
- package/dist/actions/set-event-type-hosts.js +41 -0
- package/dist/actions/set-event-type-hosts.js.map +1 -0
- package/dist/actions/set-event-type-location.d.ts +3 -0
- package/dist/actions/set-event-type-location.d.ts.map +1 -0
- package/dist/actions/set-event-type-location.js +18 -0
- package/dist/actions/set-event-type-location.js.map +1 -0
- package/dist/actions/set-host-availability-override.d.ts +3 -0
- package/dist/actions/set-host-availability-override.d.ts.map +1 -0
- package/dist/actions/set-host-availability-override.js +21 -0
- package/dist/actions/set-host-availability-override.js.map +1 -0
- package/dist/actions/set-team-branding.d.ts +3 -0
- package/dist/actions/set-team-branding.d.ts.map +1 -0
- package/dist/actions/set-team-branding.js +28 -0
- package/dist/actions/set-team-branding.js.map +1 -0
- package/dist/actions/submit-routing-form-response.d.ts +3 -0
- package/dist/actions/submit-routing-form-response.d.ts.map +1 -0
- package/dist/actions/submit-routing-form-response.js +46 -0
- package/dist/actions/submit-routing-form-response.js.map +1 -0
- package/dist/actions/toggle-event-type-hidden.d.ts +3 -0
- package/dist/actions/toggle-event-type-hidden.d.ts.map +1 -0
- package/dist/actions/toggle-event-type-hidden.js +19 -0
- package/dist/actions/toggle-event-type-hidden.js.map +1 -0
- package/dist/actions/toggle-selected-calendar.d.ts +3 -0
- package/dist/actions/toggle-selected-calendar.d.ts.map +1 -0
- package/dist/actions/toggle-selected-calendar.js +40 -0
- package/dist/actions/toggle-selected-calendar.js.map +1 -0
- package/dist/actions/toggle-workflow.d.ts +3 -0
- package/dist/actions/toggle-workflow.d.ts.map +1 -0
- package/dist/actions/toggle-workflow.js +26 -0
- package/dist/actions/toggle-workflow.js.map +1 -0
- package/dist/actions/update-event-type.d.ts +3 -0
- package/dist/actions/update-event-type.d.ts.map +1 -0
- package/dist/actions/update-event-type.js +54 -0
- package/dist/actions/update-event-type.js.map +1 -0
- package/dist/actions/update-member-role.d.ts +3 -0
- package/dist/actions/update-member-role.d.ts.map +1 -0
- package/dist/actions/update-member-role.js +23 -0
- package/dist/actions/update-member-role.js.map +1 -0
- package/dist/actions/update-profile.d.ts +3 -0
- package/dist/actions/update-profile.d.ts.map +1 -0
- package/dist/actions/update-profile.js +34 -0
- package/dist/actions/update-profile.js.map +1 -0
- package/dist/actions/update-routing-form.d.ts +3 -0
- package/dist/actions/update-routing-form.d.ts.map +1 -0
- package/dist/actions/update-routing-form.js +40 -0
- package/dist/actions/update-routing-form.js.map +1 -0
- package/dist/actions/update-schedule.d.ts +3 -0
- package/dist/actions/update-schedule.d.ts.map +1 -0
- package/dist/actions/update-schedule.js +44 -0
- package/dist/actions/update-schedule.js.map +1 -0
- package/dist/actions/update-workflow.d.ts +3 -0
- package/dist/actions/update-workflow.d.ts.map +1 -0
- package/dist/actions/update-workflow.js +89 -0
- package/dist/actions/update-workflow.js.map +1 -0
- package/dist/core/buffers.d.ts +25 -0
- package/dist/core/buffers.d.ts.map +1 -0
- package/dist/core/buffers.js +21 -0
- package/dist/core/buffers.js.map +1 -0
- package/dist/core/conflicts.d.ts +11 -0
- package/dist/core/conflicts.d.ts.map +1 -0
- package/dist/core/conflicts.js +42 -0
- package/dist/core/conflicts.js.map +1 -0
- package/dist/core/index.d.ts +9 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +9 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/limits.d.ts +23 -0
- package/dist/core/limits.d.ts.map +1 -0
- package/dist/core/limits.js +28 -0
- package/dist/core/limits.js.map +1 -0
- package/dist/core/round-robin.d.ts +31 -0
- package/dist/core/round-robin.d.ts.map +1 -0
- package/dist/core/round-robin.js +57 -0
- package/dist/core/round-robin.js.map +1 -0
- package/dist/core/rrule.d.ts +2 -0
- package/dist/core/rrule.d.ts.map +1 -0
- package/dist/core/rrule.js +14 -0
- package/dist/core/rrule.js.map +1 -0
- package/dist/core/rules.d.ts +26 -0
- package/dist/core/rules.d.ts.map +1 -0
- package/dist/core/rules.js +40 -0
- package/dist/core/rules.js.map +1 -0
- package/dist/core/slots.d.ts +58 -0
- package/dist/core/slots.d.ts.map +1 -0
- package/dist/core/slots.js +98 -0
- package/dist/core/slots.js.map +1 -0
- package/dist/core/time.d.ts +52 -0
- package/dist/core/time.d.ts.map +1 -0
- package/dist/core/time.js +109 -0
- package/dist/core/time.js.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -0
- package/dist/manifest.d.ts +28 -0
- package/dist/manifest.d.ts.map +1 -0
- package/dist/manifest.js +160 -0
- package/dist/manifest.js.map +1 -0
- package/dist/react/components/SlotPicker.d.ts +21 -0
- package/dist/react/components/SlotPicker.d.ts.map +1 -0
- package/dist/react/components/SlotPicker.js +15 -0
- package/dist/react/components/SlotPicker.js.map +1 -0
- package/dist/react/components/TimezoneSelect.d.ts +7 -0
- package/dist/react/components/TimezoneSelect.d.ts.map +1 -0
- package/dist/react/components/TimezoneSelect.js +31 -0
- package/dist/react/components/TimezoneSelect.js.map +1 -0
- package/dist/react/components/booking-links/AvailabilityEditor.d.ts +21 -0
- package/dist/react/components/booking-links/AvailabilityEditor.d.ts.map +1 -0
- package/dist/react/components/booking-links/AvailabilityEditor.js +102 -0
- package/dist/react/components/booking-links/AvailabilityEditor.js.map +1 -0
- package/dist/react/components/booking-links/BookingLinkCreateDialog.d.ts +22 -0
- package/dist/react/components/booking-links/BookingLinkCreateDialog.d.ts.map +1 -0
- package/dist/react/components/booking-links/BookingLinkCreateDialog.js +75 -0
- package/dist/react/components/booking-links/BookingLinkCreateDialog.js.map +1 -0
- package/dist/react/components/booking-links/ConferencingSelector.d.ts +19 -0
- package/dist/react/components/booking-links/ConferencingSelector.d.ts.map +1 -0
- package/dist/react/components/booking-links/ConferencingSelector.js +87 -0
- package/dist/react/components/booking-links/ConferencingSelector.js.map +1 -0
- package/dist/react/components/booking-links/CustomFieldsEditor.d.ts +19 -0
- package/dist/react/components/booking-links/CustomFieldsEditor.d.ts.map +1 -0
- package/dist/react/components/booking-links/CustomFieldsEditor.js +117 -0
- package/dist/react/components/booking-links/CustomFieldsEditor.js.map +1 -0
- package/dist/react/components/booking-links/DurationPicker.d.ts +9 -0
- package/dist/react/components/booking-links/DurationPicker.d.ts.map +1 -0
- package/dist/react/components/booking-links/DurationPicker.js +56 -0
- package/dist/react/components/booking-links/DurationPicker.js.map +1 -0
- package/dist/react/components/booking-links/SlugEditor.d.ts +15 -0
- package/dist/react/components/booking-links/SlugEditor.d.ts.map +1 -0
- package/dist/react/components/booking-links/SlugEditor.js +64 -0
- package/dist/react/components/booking-links/SlugEditor.js.map +1 -0
- package/dist/react/components/booking-links/index.d.ts +16 -0
- package/dist/react/components/booking-links/index.d.ts.map +1 -0
- package/dist/react/components/booking-links/index.js +16 -0
- package/dist/react/components/booking-links/index.js.map +1 -0
- package/dist/react/components/index.d.ts +14 -0
- package/dist/react/components/index.d.ts.map +1 -0
- package/dist/react/components/index.js +14 -0
- package/dist/react/components/index.js.map +1 -0
- package/dist/react/hooks/useBookingFlow.d.ts +33 -0
- package/dist/react/hooks/useBookingFlow.d.ts.map +1 -0
- package/dist/react/hooks/useBookingFlow.js +51 -0
- package/dist/react/hooks/useBookingFlow.js.map +1 -0
- package/dist/react/hooks/useEventType.d.ts +21 -0
- package/dist/react/hooks/useEventType.d.ts.map +1 -0
- package/dist/react/hooks/useEventType.js +38 -0
- package/dist/react/hooks/useEventType.js.map +1 -0
- package/dist/react/hooks/useReschedule.d.ts +13 -0
- package/dist/react/hooks/useReschedule.d.ts.map +1 -0
- package/dist/react/hooks/useReschedule.js +33 -0
- package/dist/react/hooks/useReschedule.js.map +1 -0
- package/dist/react/hooks/useSlots.d.ts +32 -0
- package/dist/react/hooks/useSlots.d.ts.map +1 -0
- package/dist/react/hooks/useSlots.js +59 -0
- package/dist/react/hooks/useSlots.js.map +1 -0
- package/dist/react/hooks/useTimezone.d.ts +3 -0
- package/dist/react/hooks/useTimezone.d.ts.map +1 -0
- package/dist/react/hooks/useTimezone.js +30 -0
- package/dist/react/hooks/useTimezone.js.map +1 -0
- package/dist/react/index.d.ts +11 -0
- package/dist/react/index.d.ts.map +1 -0
- package/dist/react/index.js +11 -0
- package/dist/react/index.js.map +1 -0
- package/dist/schema/bookings.d.ts +1201 -0
- package/dist/schema/bookings.d.ts.map +1 -0
- package/dist/schema/bookings.js +100 -0
- package/dist/schema/bookings.js.map +1 -0
- package/dist/schema/calendar-cache.d.ts +160 -0
- package/dist/schema/calendar-cache.d.ts.map +1 -0
- package/dist/schema/calendar-cache.js +23 -0
- package/dist/schema/calendar-cache.js.map +1 -0
- package/dist/schema/credentials.d.ts +743 -0
- package/dist/schema/credentials.d.ts.map +1 -0
- package/dist/schema/credentials.js +79 -0
- package/dist/schema/credentials.js.map +1 -0
- package/dist/schema/event-types.d.ts +1292 -0
- package/dist/schema/event-types.d.ts.map +1 -0
- package/dist/schema/event-types.js +131 -0
- package/dist/schema/event-types.js.map +1 -0
- package/dist/schema/index.d.ts +20 -0
- package/dist/schema/index.d.ts.map +1 -0
- package/dist/schema/index.js +20 -0
- package/dist/schema/index.js.map +1 -0
- package/dist/schema/routing-forms.d.ts +571 -0
- package/dist/schema/routing-forms.d.ts.map +1 -0
- package/dist/schema/routing-forms.js +44 -0
- package/dist/schema/routing-forms.js.map +1 -0
- package/dist/schema/schedules.d.ts +830 -0
- package/dist/schema/schedules.d.ts.map +1 -0
- package/dist/schema/schedules.js +72 -0
- package/dist/schema/schedules.js.map +1 -0
- package/dist/schema/teams.d.ts +569 -0
- package/dist/schema/teams.d.ts.map +1 -0
- package/dist/schema/teams.js +38 -0
- package/dist/schema/teams.js.map +1 -0
- package/dist/schema/workflows.d.ts +1367 -0
- package/dist/schema/workflows.d.ts.map +1 -0
- package/dist/schema/workflows.js +116 -0
- package/dist/schema/workflows.js.map +1 -0
- package/dist/server/availability-engine.d.ts +21 -0
- package/dist/server/availability-engine.d.ts.map +1 -0
- package/dist/server/availability-engine.js +135 -0
- package/dist/server/availability-engine.js.map +1 -0
- package/dist/server/booking-service.d.ts +46 -0
- package/dist/server/booking-service.d.ts.map +1 -0
- package/dist/server/booking-service.js +198 -0
- package/dist/server/booking-service.js.map +1 -0
- package/dist/server/bookings-repo.d.ts +48 -0
- package/dist/server/bookings-repo.d.ts.map +1 -0
- package/dist/server/bookings-repo.js +244 -0
- package/dist/server/bookings-repo.js.map +1 -0
- package/dist/server/context.d.ts +33 -0
- package/dist/server/context.d.ts.map +1 -0
- package/dist/server/context.js +11 -0
- package/dist/server/context.js.map +1 -0
- package/dist/server/db-types.d.ts +15 -0
- package/dist/server/db-types.d.ts.map +1 -0
- package/dist/server/db-types.js +2 -0
- package/dist/server/db-types.js.map +1 -0
- package/dist/server/event-types-repo.d.ts +46 -0
- package/dist/server/event-types-repo.d.ts.map +1 -0
- package/dist/server/event-types-repo.js +320 -0
- package/dist/server/event-types-repo.js.map +1 -0
- package/dist/server/hooks.d.ts +6 -0
- package/dist/server/hooks.d.ts.map +1 -0
- package/dist/server/hooks.js +173 -0
- package/dist/server/hooks.js.map +1 -0
- package/dist/server/ics.d.ts +12 -0
- package/dist/server/ics.d.ts.map +1 -0
- package/dist/server/ics.js +81 -0
- package/dist/server/ics.js.map +1 -0
- package/dist/server/index.d.ts +12 -0
- package/dist/server/index.d.ts.map +1 -0
- package/dist/server/index.js +12 -0
- package/dist/server/index.js.map +1 -0
- package/dist/server/providers/builtin-video.d.ts +12 -0
- package/dist/server/providers/builtin-video.d.ts.map +1 -0
- package/dist/server/providers/builtin-video.js +50 -0
- package/dist/server/providers/builtin-video.js.map +1 -0
- package/dist/server/providers/cal-video.d.ts +12 -0
- package/dist/server/providers/cal-video.d.ts.map +1 -0
- package/dist/server/providers/cal-video.js +50 -0
- package/dist/server/providers/cal-video.js.map +1 -0
- package/dist/server/providers/google-calendar.d.ts +28 -0
- package/dist/server/providers/google-calendar.d.ts.map +1 -0
- package/dist/server/providers/google-calendar.js +163 -0
- package/dist/server/providers/google-calendar.js.map +1 -0
- package/dist/server/providers/google-meet.d.ts +10 -0
- package/dist/server/providers/google-meet.d.ts.map +1 -0
- package/dist/server/providers/google-meet.js +14 -0
- package/dist/server/providers/google-meet.js.map +1 -0
- package/dist/server/providers/index.d.ts +8 -0
- package/dist/server/providers/index.d.ts.map +1 -0
- package/dist/server/providers/index.js +8 -0
- package/dist/server/providers/index.js.map +1 -0
- package/dist/server/providers/office365.d.ts +21 -0
- package/dist/server/providers/office365.d.ts.map +1 -0
- package/dist/server/providers/office365.js +146 -0
- package/dist/server/providers/office365.js.map +1 -0
- package/dist/server/providers/registry.d.ts +14 -0
- package/dist/server/providers/registry.d.ts.map +1 -0
- package/dist/server/providers/registry.js +28 -0
- package/dist/server/providers/registry.js.map +1 -0
- package/dist/server/providers/types.d.ts +133 -0
- package/dist/server/providers/types.d.ts.map +1 -0
- package/dist/server/providers/types.js +2 -0
- package/dist/server/providers/types.js.map +1 -0
- package/dist/server/providers/zoom.d.ts +34 -0
- package/dist/server/providers/zoom.d.ts.map +1 -0
- package/dist/server/providers/zoom.js +111 -0
- package/dist/server/providers/zoom.js.map +1 -0
- package/dist/server/schedules-repo.d.ts +26 -0
- package/dist/server/schedules-repo.d.ts.map +1 -0
- package/dist/server/schedules-repo.js +223 -0
- package/dist/server/schedules-repo.js.map +1 -0
- package/dist/server/video-oauth-state.d.ts +28 -0
- package/dist/server/video-oauth-state.d.ts.map +1 -0
- package/dist/server/video-oauth-state.js +101 -0
- package/dist/server/video-oauth-state.js.map +1 -0
- package/dist/server/video-oauth.d.ts +18 -0
- package/dist/server/video-oauth.d.ts.map +1 -0
- package/dist/server/video-oauth.js +82 -0
- package/dist/server/video-oauth.js.map +1 -0
- package/dist/shared/index.d.ts +298 -0
- package/dist/shared/index.d.ts.map +1 -0
- package/dist/shared/index.js +6 -0
- package/dist/shared/index.js.map +1 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +2 -0
- package/dist/version.js.map +1 -0
- package/docs/UI_UNIFICATION.md +78 -0
- package/docs/actions.md +64 -0
- package/docs/eject.md +18 -0
- package/docs/llms-full.txt +1022 -0
- package/docs/llms.txt +89 -0
- package/docs/providers.md +68 -0
- package/docs/schema.md +86 -0
- package/docs/skills/availability/SKILL.md +44 -0
- package/docs/skills/booker/SKILL.md +51 -0
- package/docs/skills/bookings/SKILL.md +43 -0
- package/docs/skills/embeds/SKILL.md +49 -0
- package/docs/skills/event-types/SKILL.md +40 -0
- package/docs/skills/integrations/SKILL.md +52 -0
- package/docs/skills/routing-forms/SKILL.md +39 -0
- package/docs/skills/scheduling-basics/SKILL.md +51 -0
- package/docs/skills/slot-engine/SKILL.md +52 -0
- package/docs/skills/team-scheduling/SKILL.md +54 -0
- package/docs/skills/workflows/SKILL.md +55 -0
- package/package.json +87 -0
- package/src/actions/_helpers.ts +62 -0
- package/src/actions/accept-team-invite.ts +26 -0
- package/src/actions/add-booking-attendee.ts +32 -0
- package/src/actions/add-booking-note.ts +25 -0
- package/src/actions/add-date-override.ts +23 -0
- package/src/actions/add-private-link.ts +31 -0
- package/src/actions/assign-round-robin-host.ts +54 -0
- package/src/actions/cancel-booking.ts +39 -0
- package/src/actions/check-availability.ts +46 -0
- package/src/actions/confirm-booking.ts +15 -0
- package/src/actions/connect-calendar.ts +27 -0
- package/src/actions/connect-video.ts +57 -0
- package/src/actions/create-booking.ts +62 -0
- package/src/actions/create-event-type.ts +45 -0
- package/src/actions/create-host-group.ts +25 -0
- package/src/actions/create-routing-form.ts +39 -0
- package/src/actions/create-schedule.ts +36 -0
- package/src/actions/create-team.ts +44 -0
- package/src/actions/create-workflow.ts +83 -0
- package/src/actions/delete-event-type.ts +14 -0
- package/src/actions/delete-routing-form.ts +21 -0
- package/src/actions/delete-schedule.ts +14 -0
- package/src/actions/delete-workflow.ts +21 -0
- package/src/actions/disconnect-calendar.ts +22 -0
- package/src/actions/duplicate-event-type.ts +36 -0
- package/src/actions/export-bookings-csv.ts +54 -0
- package/src/actions/find-available-slot.ts +40 -0
- package/src/actions/get-availability.ts +20 -0
- package/src/actions/get-booking.ts +9 -0
- package/src/actions/get-event-type.ts +29 -0
- package/src/actions/install-conferencing-app.ts +29 -0
- package/src/actions/invite-team-member.ts +30 -0
- package/src/actions/list-bookings.ts +36 -0
- package/src/actions/list-calendar-integrations.ts +26 -0
- package/src/actions/list-event-types.ts +31 -0
- package/src/actions/list-routing-form-responses.ts +24 -0
- package/src/actions/list-routing-forms.ts +34 -0
- package/src/actions/list-schedules.ts +16 -0
- package/src/actions/list-selected-calendars.ts +41 -0
- package/src/actions/list-workflows.ts +34 -0
- package/src/actions/mark-no-show.ts +15 -0
- package/src/actions/refresh-busy-times.ts +26 -0
- package/src/actions/remove-booking-attendee.ts +24 -0
- package/src/actions/remove-date-override.ts +15 -0
- package/src/actions/remove-team-member.ts +23 -0
- package/src/actions/reorder-event-types.ts +18 -0
- package/src/actions/reschedule-booking.ts +45 -0
- package/src/actions/revoke-private-link.ts +16 -0
- package/src/actions/send-reschedule-link.ts +18 -0
- package/src/actions/set-appearance.ts +24 -0
- package/src/actions/set-default-conferencing-app.ts +25 -0
- package/src/actions/set-default-schedule.ts +15 -0
- package/src/actions/set-destination-calendar.ts +39 -0
- package/src/actions/set-event-type-hosts.ts +43 -0
- package/src/actions/set-event-type-location.ts +18 -0
- package/src/actions/set-host-availability-override.ts +27 -0
- package/src/actions/set-team-branding.ts +28 -0
- package/src/actions/submit-routing-form-response.ts +47 -0
- package/src/actions/toggle-event-type-hidden.ts +21 -0
- package/src/actions/toggle-selected-calendar.ts +43 -0
- package/src/actions/toggle-workflow.ts +25 -0
- package/src/actions/update-event-type.ts +54 -0
- package/src/actions/update-member-role.ts +28 -0
- package/src/actions/update-profile.ts +36 -0
- package/src/actions/update-routing-form.ts +36 -0
- package/src/actions/update-schedule.ts +53 -0
- package/src/actions/update-workflow.ts +89 -0
- package/src/core/buffers.ts +46 -0
- package/src/core/conflicts.ts +49 -0
- package/src/core/index.ts +8 -0
- package/src/core/limits.ts +60 -0
- package/src/core/round-robin.test.ts +95 -0
- package/src/core/round-robin.ts +103 -0
- package/src/core/rrule.ts +20 -0
- package/src/core/rules.ts +66 -0
- package/src/core/slots.test.ts +246 -0
- package/src/core/slots.ts +223 -0
- package/src/core/time.ts +136 -0
- package/src/index.ts +14 -0
- package/src/manifest.ts +174 -0
- package/src/react/components/SlotPicker.tsx +72 -0
- package/src/react/components/TimezoneSelect.tsx +55 -0
- package/src/react/components/_shadcn-shims.d.ts +251 -0
- package/src/react/components/booking-links/AvailabilityEditor.tsx +177 -0
- package/src/react/components/booking-links/BookingLinkCreateDialog.tsx +189 -0
- package/src/react/components/booking-links/ConferencingSelector.tsx +255 -0
- package/src/react/components/booking-links/CustomFieldsEditor.tsx +420 -0
- package/src/react/components/booking-links/DurationPicker.tsx +115 -0
- package/src/react/components/booking-links/SlugEditor.tsx +149 -0
- package/src/react/components/booking-links/index.ts +15 -0
- package/src/react/components/index.ts +13 -0
- package/src/react/hooks/useBookingFlow.ts +113 -0
- package/src/react/hooks/useEventType.ts +52 -0
- package/src/react/hooks/useReschedule.ts +39 -0
- package/src/react/hooks/useSlots.ts +88 -0
- package/src/react/hooks/useTimezone.ts +29 -0
- package/src/react/index.ts +10 -0
- package/src/schema/bookings.ts +124 -0
- package/src/schema/calendar-cache.ts +23 -0
- package/src/schema/credentials.ts +83 -0
- package/src/schema/event-types.ts +154 -0
- package/src/schema/index.ts +19 -0
- package/src/schema/routing-forms.ts +52 -0
- package/src/schema/schedules.ts +83 -0
- package/src/schema/teams.ts +46 -0
- package/src/schema/workflows.ts +128 -0
- package/src/server/availability-engine.ts +193 -0
- package/src/server/booking-service.ts +264 -0
- package/src/server/bookings-repo.ts +330 -0
- package/src/server/context.ts +49 -0
- package/src/server/db-types.ts +16 -0
- package/src/server/event-types-repo.ts +385 -0
- package/src/server/hooks.ts +213 -0
- package/src/server/ics.ts +99 -0
- package/src/server/index.ts +11 -0
- package/src/server/providers/builtin-video.ts +62 -0
- package/src/server/providers/google-calendar.ts +237 -0
- package/src/server/providers/google-meet.ts +22 -0
- package/src/server/providers/index.ts +7 -0
- package/src/server/providers/office365.ts +208 -0
- package/src/server/providers/registry.ts +43 -0
- package/src/server/providers/types.ts +126 -0
- package/src/server/providers/zoom.ts +173 -0
- package/src/server/schedules-repo.ts +279 -0
- package/src/server/video-oauth-state.test.ts +120 -0
- package/src/server/video-oauth-state.ts +116 -0
- package/src/server/video-oauth.ts +99 -0
- package/src/shared/index.ts +366 -0
- package/src/version.ts +1 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Built-in video provider (Daily.co) — 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
|
+
|
|
7
|
+
export interface DailyVideoProviderConfig {
|
|
8
|
+
apiKey: string;
|
|
9
|
+
/** Prefix for Daily room names; defaults to "room-" */
|
|
10
|
+
roomPrefix?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function createDailyVideoProvider(
|
|
14
|
+
config: DailyVideoProviderConfig,
|
|
15
|
+
): VideoProvider {
|
|
16
|
+
const prefix = config.roomPrefix ?? "room-";
|
|
17
|
+
async function apiCall<T>(path: string, init?: RequestInit): Promise<T> {
|
|
18
|
+
const res = await fetch(`https://api.daily.co/v1${path}`, {
|
|
19
|
+
...init,
|
|
20
|
+
headers: {
|
|
21
|
+
...(init?.headers ?? {}),
|
|
22
|
+
authorization: `Bearer ${config.apiKey}`,
|
|
23
|
+
"content-type": "application/json",
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
if (!res.ok) {
|
|
27
|
+
throw new Error(`Daily.co ${res.status}: ${await res.text()}`);
|
|
28
|
+
}
|
|
29
|
+
if (res.status === 204) return undefined as unknown as T;
|
|
30
|
+
return (await res.json()) as T;
|
|
31
|
+
}
|
|
32
|
+
return {
|
|
33
|
+
kind: "builtin_video",
|
|
34
|
+
label: "Built-in video",
|
|
35
|
+
async createMeeting({ booking }) {
|
|
36
|
+
const roomName = `${prefix}${booking.uid}`.slice(0, 40);
|
|
37
|
+
const resp = await apiCall<{ url: string; name: string }>("/rooms", {
|
|
38
|
+
method: "POST",
|
|
39
|
+
body: JSON.stringify({
|
|
40
|
+
name: roomName,
|
|
41
|
+
properties: {
|
|
42
|
+
nbf: Math.floor(new Date(booking.startTime).getTime() / 1000),
|
|
43
|
+
exp: Math.floor(new Date(booking.endTime).getTime() / 1000) + 3600,
|
|
44
|
+
enable_prejoin_ui: true,
|
|
45
|
+
enable_chat: true,
|
|
46
|
+
enable_knocking: true,
|
|
47
|
+
eject_at_room_exp: true,
|
|
48
|
+
},
|
|
49
|
+
}),
|
|
50
|
+
});
|
|
51
|
+
return {
|
|
52
|
+
meetingUrl: resp.url,
|
|
53
|
+
meetingId: resp.name,
|
|
54
|
+
};
|
|
55
|
+
},
|
|
56
|
+
async deleteMeeting({ meetingId }) {
|
|
57
|
+
await apiCall(`/rooms/${encodeURIComponent(meetingId)}`, {
|
|
58
|
+
method: "DELETE",
|
|
59
|
+
});
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
}
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Google Calendar provider.
|
|
3
|
+
*
|
|
4
|
+
* Thin adapter over the Google Calendar API. Consumers wire it up by
|
|
5
|
+
* calling `createGoogleCalendarProvider()` with accessors that return
|
|
6
|
+
* OAuth tokens from their preferred store (typically core's oauth_tokens).
|
|
7
|
+
*
|
|
8
|
+
* This lives in the package rather than the template because the logic is
|
|
9
|
+
* the same for every scheduling consumer. Custom token stores are supported
|
|
10
|
+
* via the `getAccessToken` callback.
|
|
11
|
+
*/
|
|
12
|
+
import type { CalendarProvider } from "./types.js";
|
|
13
|
+
import type { BusyInterval, Booking } from "../../shared/index.js";
|
|
14
|
+
|
|
15
|
+
export interface GoogleCalendarProviderConfig {
|
|
16
|
+
clientId: string;
|
|
17
|
+
clientSecret: string;
|
|
18
|
+
/** Resolve a fresh access token for a given credentialId (refresh if needed). */
|
|
19
|
+
getAccessToken: (credentialId: string) => Promise<string>;
|
|
20
|
+
/** Persist updated refresh/access tokens after a refresh. */
|
|
21
|
+
updateTokens?: (
|
|
22
|
+
credentialId: string,
|
|
23
|
+
tokens: { accessToken: string; refreshToken?: string; expiresAt?: Date },
|
|
24
|
+
) => Promise<void>;
|
|
25
|
+
/** Called when the API returns 401/403; the consumer should mark the credential invalid. */
|
|
26
|
+
markInvalid?: (credentialId: string) => Promise<void>;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const SCOPES = [
|
|
30
|
+
"https://www.googleapis.com/auth/calendar",
|
|
31
|
+
"https://www.googleapis.com/auth/calendar.events",
|
|
32
|
+
];
|
|
33
|
+
|
|
34
|
+
export function createGoogleCalendarProvider(
|
|
35
|
+
config: GoogleCalendarProviderConfig,
|
|
36
|
+
): CalendarProvider {
|
|
37
|
+
async function apiCall<T>(
|
|
38
|
+
credentialId: string,
|
|
39
|
+
url: string,
|
|
40
|
+
init?: RequestInit,
|
|
41
|
+
): Promise<T> {
|
|
42
|
+
const token = await config.getAccessToken(credentialId);
|
|
43
|
+
const res = await fetch(url, {
|
|
44
|
+
...init,
|
|
45
|
+
headers: {
|
|
46
|
+
...(init?.headers ?? {}),
|
|
47
|
+
authorization: `Bearer ${token}`,
|
|
48
|
+
"content-type": "application/json",
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
if (res.status === 401 || res.status === 403) {
|
|
52
|
+
await config.markInvalid?.(credentialId);
|
|
53
|
+
throw new Error(`Google Calendar: credential invalid (${res.status})`);
|
|
54
|
+
}
|
|
55
|
+
if (!res.ok) {
|
|
56
|
+
const body = await res.text();
|
|
57
|
+
throw new Error(`Google Calendar API ${res.status}: ${body}`);
|
|
58
|
+
}
|
|
59
|
+
if (res.status === 204) return undefined as unknown as T;
|
|
60
|
+
return (await res.json()) as T;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return {
|
|
64
|
+
kind: "google_calendar",
|
|
65
|
+
label: "Google Calendar",
|
|
66
|
+
|
|
67
|
+
async startOAuth({ redirectUri, state }) {
|
|
68
|
+
const params = new URLSearchParams({
|
|
69
|
+
client_id: config.clientId,
|
|
70
|
+
redirect_uri: redirectUri,
|
|
71
|
+
response_type: "code",
|
|
72
|
+
scope: SCOPES.join(" "),
|
|
73
|
+
access_type: "offline",
|
|
74
|
+
include_granted_scopes: "true",
|
|
75
|
+
prompt: "consent",
|
|
76
|
+
state,
|
|
77
|
+
});
|
|
78
|
+
return {
|
|
79
|
+
authUrl: `https://accounts.google.com/o/oauth2/v2/auth?${params}`,
|
|
80
|
+
};
|
|
81
|
+
},
|
|
82
|
+
|
|
83
|
+
async completeOAuth({ code, redirectUri, credentialId, userEmail }) {
|
|
84
|
+
const body = new URLSearchParams({
|
|
85
|
+
code,
|
|
86
|
+
client_id: config.clientId,
|
|
87
|
+
client_secret: config.clientSecret,
|
|
88
|
+
redirect_uri: redirectUri,
|
|
89
|
+
grant_type: "authorization_code",
|
|
90
|
+
});
|
|
91
|
+
const tokenRes = await fetch("https://oauth2.googleapis.com/token", {
|
|
92
|
+
method: "POST",
|
|
93
|
+
headers: { "content-type": "application/x-www-form-urlencoded" },
|
|
94
|
+
body,
|
|
95
|
+
});
|
|
96
|
+
if (!tokenRes.ok) {
|
|
97
|
+
throw new Error(
|
|
98
|
+
`Google token exchange failed: ${tokenRes.status} ${await tokenRes.text()}`,
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
const tokens = await tokenRes.json();
|
|
102
|
+
await config.updateTokens?.(credentialId, {
|
|
103
|
+
accessToken: tokens.access_token,
|
|
104
|
+
refreshToken: tokens.refresh_token,
|
|
105
|
+
expiresAt: new Date(Date.now() + (tokens.expires_in ?? 3600) * 1000),
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
// Discover external email + calendar list
|
|
109
|
+
const calendars = await apiCall<{
|
|
110
|
+
items: { id: string; summary: string; primary?: boolean }[];
|
|
111
|
+
}>(
|
|
112
|
+
credentialId,
|
|
113
|
+
"https://www.googleapis.com/calendar/v3/users/me/calendarList",
|
|
114
|
+
);
|
|
115
|
+
const primary = calendars.items.find((c) => c.primary);
|
|
116
|
+
return {
|
|
117
|
+
externalEmail: primary?.id ?? userEmail,
|
|
118
|
+
calendars: calendars.items.map((c) => ({
|
|
119
|
+
externalId: c.id,
|
|
120
|
+
name: c.summary,
|
|
121
|
+
primary: Boolean(c.primary),
|
|
122
|
+
})),
|
|
123
|
+
};
|
|
124
|
+
},
|
|
125
|
+
|
|
126
|
+
async listCalendars({ credentialId }) {
|
|
127
|
+
const resp = await apiCall<{
|
|
128
|
+
items: { id: string; summary: string; primary?: boolean }[];
|
|
129
|
+
}>(
|
|
130
|
+
credentialId,
|
|
131
|
+
"https://www.googleapis.com/calendar/v3/users/me/calendarList",
|
|
132
|
+
);
|
|
133
|
+
return resp.items.map((c) => ({
|
|
134
|
+
externalId: c.id,
|
|
135
|
+
name: c.summary,
|
|
136
|
+
primary: Boolean(c.primary),
|
|
137
|
+
}));
|
|
138
|
+
},
|
|
139
|
+
|
|
140
|
+
async getBusy({ credentialId, calendarExternalIds, start, end }) {
|
|
141
|
+
const resp = await apiCall<{
|
|
142
|
+
calendars: Record<string, { busy: { start: string; end: string }[] }>;
|
|
143
|
+
}>(credentialId, "https://www.googleapis.com/calendar/v3/freeBusy", {
|
|
144
|
+
method: "POST",
|
|
145
|
+
body: JSON.stringify({
|
|
146
|
+
timeMin: start.toISOString(),
|
|
147
|
+
timeMax: end.toISOString(),
|
|
148
|
+
items: calendarExternalIds.map((id) => ({ id })),
|
|
149
|
+
}),
|
|
150
|
+
});
|
|
151
|
+
const out: BusyInterval[] = [];
|
|
152
|
+
for (const [calId, data] of Object.entries(resp.calendars)) {
|
|
153
|
+
for (const b of data.busy) {
|
|
154
|
+
out.push({ start: b.start, end: b.end, source: calId });
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
return out;
|
|
158
|
+
},
|
|
159
|
+
|
|
160
|
+
async createEvent({
|
|
161
|
+
credentialId,
|
|
162
|
+
calendarExternalId,
|
|
163
|
+
booking,
|
|
164
|
+
includeConference,
|
|
165
|
+
}) {
|
|
166
|
+
const body: any = {
|
|
167
|
+
summary: booking.title,
|
|
168
|
+
description: booking.description,
|
|
169
|
+
start: { dateTime: booking.startTime, timeZone: booking.timezone },
|
|
170
|
+
end: { dateTime: booking.endTime, timeZone: booking.timezone },
|
|
171
|
+
attendees: [
|
|
172
|
+
{ email: booking.hostEmail, organizer: true },
|
|
173
|
+
...booking.attendees.map((a) => ({
|
|
174
|
+
email: a.email,
|
|
175
|
+
displayName: a.name,
|
|
176
|
+
})),
|
|
177
|
+
],
|
|
178
|
+
iCalUID: booking.iCalUid,
|
|
179
|
+
sequence: booking.iCalSequence,
|
|
180
|
+
};
|
|
181
|
+
if (booking.location) {
|
|
182
|
+
if (booking.location.address) body.location = booking.location.address;
|
|
183
|
+
else if (booking.location.link) body.location = booking.location.link;
|
|
184
|
+
}
|
|
185
|
+
let query = "?sendUpdates=all";
|
|
186
|
+
if (includeConference) {
|
|
187
|
+
body.conferenceData = {
|
|
188
|
+
createRequest: {
|
|
189
|
+
requestId: booking.uid,
|
|
190
|
+
conferenceSolutionKey: { type: "hangoutsMeet" },
|
|
191
|
+
},
|
|
192
|
+
};
|
|
193
|
+
query += "&conferenceDataVersion=1";
|
|
194
|
+
}
|
|
195
|
+
const resp = await apiCall<any>(
|
|
196
|
+
credentialId,
|
|
197
|
+
`https://www.googleapis.com/calendar/v3/calendars/${encodeURIComponent(calendarExternalId)}/events${query}`,
|
|
198
|
+
{ method: "POST", body: JSON.stringify(body) },
|
|
199
|
+
);
|
|
200
|
+
return {
|
|
201
|
+
externalId: resp.id,
|
|
202
|
+
meetingUrl:
|
|
203
|
+
resp.hangoutLink ??
|
|
204
|
+
resp.conferenceData?.entryPoints?.find(
|
|
205
|
+
(e: any) => e.entryPointType === "video",
|
|
206
|
+
)?.uri,
|
|
207
|
+
icalUid: resp.iCalUID,
|
|
208
|
+
};
|
|
209
|
+
},
|
|
210
|
+
|
|
211
|
+
async updateEvent({ credentialId, externalId, booking }) {
|
|
212
|
+
// Bump sequence for RFC 5545 compliance
|
|
213
|
+
const newSeq = booking.iCalSequence + 1;
|
|
214
|
+
const body = {
|
|
215
|
+
summary: booking.title,
|
|
216
|
+
description: booking.description,
|
|
217
|
+
start: { dateTime: booking.startTime, timeZone: booking.timezone },
|
|
218
|
+
end: { dateTime: booking.endTime, timeZone: booking.timezone },
|
|
219
|
+
sequence: newSeq,
|
|
220
|
+
};
|
|
221
|
+
await apiCall(
|
|
222
|
+
credentialId,
|
|
223
|
+
`https://www.googleapis.com/calendar/v3/calendars/primary/events/${encodeURIComponent(externalId)}?sendUpdates=all`,
|
|
224
|
+
{ method: "PATCH", body: JSON.stringify(body) },
|
|
225
|
+
);
|
|
226
|
+
return { iCalSequence: newSeq };
|
|
227
|
+
},
|
|
228
|
+
|
|
229
|
+
async deleteEvent({ credentialId, externalId }) {
|
|
230
|
+
await apiCall(
|
|
231
|
+
credentialId,
|
|
232
|
+
`https://www.googleapis.com/calendar/v3/calendars/primary/events/${encodeURIComponent(externalId)}?sendUpdates=all`,
|
|
233
|
+
{ method: "DELETE" },
|
|
234
|
+
);
|
|
235
|
+
},
|
|
236
|
+
};
|
|
237
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Google Meet — piggy-backs on Google Calendar credentials. The meeting link
|
|
3
|
+
* is created as part of the calendar event (conferenceData). This provider
|
|
4
|
+
* exists so we can list Google Meet as an installable conferencing option in
|
|
5
|
+
* the UI; the actual meeting creation happens in `google-calendar.createEvent`
|
|
6
|
+
* when `includeConference` is true.
|
|
7
|
+
*/
|
|
8
|
+
import type { VideoProvider } from "./types.js";
|
|
9
|
+
|
|
10
|
+
export const googleMeetProvider: VideoProvider = {
|
|
11
|
+
kind: "google_meet",
|
|
12
|
+
label: "Google Meet",
|
|
13
|
+
async createMeeting({ booking }) {
|
|
14
|
+
// Meeting URL is generated by Google Calendar. If the consumer calls this
|
|
15
|
+
// directly rather than via google_calendar.createEvent, return a
|
|
16
|
+
// placeholder to signal that the event creation flow should handle it.
|
|
17
|
+
return {
|
|
18
|
+
meetingUrl: "",
|
|
19
|
+
meetingId: `meet_${booking.uid}`,
|
|
20
|
+
};
|
|
21
|
+
},
|
|
22
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from "./types.js";
|
|
2
|
+
export * from "./registry.js";
|
|
3
|
+
export { createGoogleCalendarProvider } from "./google-calendar.js";
|
|
4
|
+
export { createOffice365Provider } from "./office365.js";
|
|
5
|
+
export { createZoomProvider } from "./zoom.js";
|
|
6
|
+
export { createDailyVideoProvider } from "./builtin-video.js";
|
|
7
|
+
export { googleMeetProvider } from "./google-meet.js";
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Office 365 / Outlook calendar provider via Microsoft Graph.
|
|
3
|
+
*
|
|
4
|
+
* Token flow is identical to Google but against login.microsoftonline.com.
|
|
5
|
+
* Uses Microsoft Graph API for calendars and events.
|
|
6
|
+
*/
|
|
7
|
+
import type { CalendarProvider } from "./types.js";
|
|
8
|
+
import type { BusyInterval } from "../../shared/index.js";
|
|
9
|
+
|
|
10
|
+
export interface Office365ProviderConfig {
|
|
11
|
+
clientId: string;
|
|
12
|
+
clientSecret: string;
|
|
13
|
+
tenant?: string;
|
|
14
|
+
getAccessToken: (credentialId: string) => Promise<string>;
|
|
15
|
+
updateTokens?: (
|
|
16
|
+
credentialId: string,
|
|
17
|
+
tokens: { accessToken: string; refreshToken?: string; expiresAt?: Date },
|
|
18
|
+
) => Promise<void>;
|
|
19
|
+
markInvalid?: (credentialId: string) => Promise<void>;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const SCOPES = ["offline_access", "Calendars.ReadWrite", "User.Read"];
|
|
23
|
+
|
|
24
|
+
export function createOffice365Provider(
|
|
25
|
+
config: Office365ProviderConfig,
|
|
26
|
+
): CalendarProvider {
|
|
27
|
+
const tenant = config.tenant ?? "common";
|
|
28
|
+
async function graph<T>(
|
|
29
|
+
credentialId: string,
|
|
30
|
+
path: string,
|
|
31
|
+
init?: RequestInit,
|
|
32
|
+
): Promise<T> {
|
|
33
|
+
const token = await config.getAccessToken(credentialId);
|
|
34
|
+
const res = await fetch(`https://graph.microsoft.com/v1.0${path}`, {
|
|
35
|
+
...init,
|
|
36
|
+
headers: {
|
|
37
|
+
...(init?.headers ?? {}),
|
|
38
|
+
authorization: `Bearer ${token}`,
|
|
39
|
+
"content-type": "application/json",
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
if (res.status === 401 || res.status === 403) {
|
|
43
|
+
await config.markInvalid?.(credentialId);
|
|
44
|
+
throw new Error(`Office 365 credential invalid (${res.status})`);
|
|
45
|
+
}
|
|
46
|
+
if (!res.ok) {
|
|
47
|
+
throw new Error(`Graph ${res.status}: ${await res.text()}`);
|
|
48
|
+
}
|
|
49
|
+
if (res.status === 204) return undefined as unknown as T;
|
|
50
|
+
return (await res.json()) as T;
|
|
51
|
+
}
|
|
52
|
+
return {
|
|
53
|
+
kind: "office365_calendar",
|
|
54
|
+
label: "Outlook / Office 365",
|
|
55
|
+
async startOAuth({ redirectUri, state }) {
|
|
56
|
+
const params = new URLSearchParams({
|
|
57
|
+
client_id: config.clientId,
|
|
58
|
+
redirect_uri: redirectUri,
|
|
59
|
+
response_type: "code",
|
|
60
|
+
scope: SCOPES.join(" "),
|
|
61
|
+
response_mode: "query",
|
|
62
|
+
prompt: "consent",
|
|
63
|
+
state,
|
|
64
|
+
});
|
|
65
|
+
return {
|
|
66
|
+
authUrl: `https://login.microsoftonline.com/${tenant}/oauth2/v2.0/authorize?${params}`,
|
|
67
|
+
};
|
|
68
|
+
},
|
|
69
|
+
async completeOAuth({ code, redirectUri, credentialId, userEmail }) {
|
|
70
|
+
const body = new URLSearchParams({
|
|
71
|
+
client_id: config.clientId,
|
|
72
|
+
client_secret: config.clientSecret,
|
|
73
|
+
code,
|
|
74
|
+
redirect_uri: redirectUri,
|
|
75
|
+
grant_type: "authorization_code",
|
|
76
|
+
scope: SCOPES.join(" "),
|
|
77
|
+
});
|
|
78
|
+
const res = await fetch(
|
|
79
|
+
`https://login.microsoftonline.com/${tenant}/oauth2/v2.0/token`,
|
|
80
|
+
{
|
|
81
|
+
method: "POST",
|
|
82
|
+
headers: { "content-type": "application/x-www-form-urlencoded" },
|
|
83
|
+
body,
|
|
84
|
+
},
|
|
85
|
+
);
|
|
86
|
+
if (!res.ok) {
|
|
87
|
+
throw new Error(
|
|
88
|
+
`Office 365 token exchange failed: ${res.status} ${await res.text()}`,
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
const tokens = await res.json();
|
|
92
|
+
await config.updateTokens?.(credentialId, {
|
|
93
|
+
accessToken: tokens.access_token,
|
|
94
|
+
refreshToken: tokens.refresh_token,
|
|
95
|
+
expiresAt: new Date(Date.now() + (tokens.expires_in ?? 3600) * 1000),
|
|
96
|
+
});
|
|
97
|
+
const me = await graph<{ mail: string; userPrincipalName: string }>(
|
|
98
|
+
credentialId,
|
|
99
|
+
"/me",
|
|
100
|
+
);
|
|
101
|
+
const calendars = await graph<{
|
|
102
|
+
value: { id: string; name: string; isDefaultCalendar: boolean }[];
|
|
103
|
+
}>(credentialId, "/me/calendars");
|
|
104
|
+
return {
|
|
105
|
+
externalEmail: me.mail ?? me.userPrincipalName ?? userEmail,
|
|
106
|
+
calendars: calendars.value.map((c) => ({
|
|
107
|
+
externalId: c.id,
|
|
108
|
+
name: c.name,
|
|
109
|
+
primary: c.isDefaultCalendar,
|
|
110
|
+
})),
|
|
111
|
+
};
|
|
112
|
+
},
|
|
113
|
+
async listCalendars({ credentialId }) {
|
|
114
|
+
const resp = await graph<{
|
|
115
|
+
value: { id: string; name: string; isDefaultCalendar: boolean }[];
|
|
116
|
+
}>(credentialId, "/me/calendars");
|
|
117
|
+
return resp.value.map((c) => ({
|
|
118
|
+
externalId: c.id,
|
|
119
|
+
name: c.name,
|
|
120
|
+
primary: c.isDefaultCalendar,
|
|
121
|
+
}));
|
|
122
|
+
},
|
|
123
|
+
async getBusy({ credentialId, calendarExternalIds, start, end }) {
|
|
124
|
+
const resp = await graph<{
|
|
125
|
+
value: {
|
|
126
|
+
scheduleId: string;
|
|
127
|
+
scheduleItems: {
|
|
128
|
+
start: { dateTime: string };
|
|
129
|
+
end: { dateTime: string };
|
|
130
|
+
status: string;
|
|
131
|
+
}[];
|
|
132
|
+
}[];
|
|
133
|
+
}>(credentialId, "/me/calendar/getSchedule", {
|
|
134
|
+
method: "POST",
|
|
135
|
+
body: JSON.stringify({
|
|
136
|
+
schedules: calendarExternalIds,
|
|
137
|
+
startTime: { dateTime: start.toISOString(), timeZone: "UTC" },
|
|
138
|
+
endTime: { dateTime: end.toISOString(), timeZone: "UTC" },
|
|
139
|
+
availabilityViewInterval: 30,
|
|
140
|
+
}),
|
|
141
|
+
});
|
|
142
|
+
const out: BusyInterval[] = [];
|
|
143
|
+
for (const entry of resp.value) {
|
|
144
|
+
for (const item of entry.scheduleItems) {
|
|
145
|
+
if (item.status === "free") continue;
|
|
146
|
+
out.push({
|
|
147
|
+
start: item.start.dateTime + "Z",
|
|
148
|
+
end: item.end.dateTime + "Z",
|
|
149
|
+
source: entry.scheduleId,
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
return out;
|
|
154
|
+
},
|
|
155
|
+
async createEvent({ credentialId, calendarExternalId, booking }) {
|
|
156
|
+
const body = {
|
|
157
|
+
subject: booking.title,
|
|
158
|
+
body: { contentType: "HTML", content: booking.description ?? "" },
|
|
159
|
+
start: { dateTime: booking.startTime, timeZone: booking.timezone },
|
|
160
|
+
end: { dateTime: booking.endTime, timeZone: booking.timezone },
|
|
161
|
+
attendees: booking.attendees.map((a) => ({
|
|
162
|
+
emailAddress: { address: a.email, name: a.name },
|
|
163
|
+
type: "required",
|
|
164
|
+
})),
|
|
165
|
+
transactionId: booking.uid,
|
|
166
|
+
};
|
|
167
|
+
const resp = await graph<{
|
|
168
|
+
id: string;
|
|
169
|
+
iCalUId: string;
|
|
170
|
+
onlineMeeting?: { joinUrl: string };
|
|
171
|
+
}>(
|
|
172
|
+
credentialId,
|
|
173
|
+
`/me/calendars/${encodeURIComponent(calendarExternalId)}/events`,
|
|
174
|
+
{ method: "POST", body: JSON.stringify(body) },
|
|
175
|
+
);
|
|
176
|
+
return {
|
|
177
|
+
externalId: resp.id,
|
|
178
|
+
meetingUrl: resp.onlineMeeting?.joinUrl,
|
|
179
|
+
icalUid: resp.iCalUId,
|
|
180
|
+
};
|
|
181
|
+
},
|
|
182
|
+
async updateEvent({ credentialId, externalId, booking }) {
|
|
183
|
+
const newSeq = booking.iCalSequence + 1;
|
|
184
|
+
await graph(
|
|
185
|
+
credentialId,
|
|
186
|
+
`/me/events/${encodeURIComponent(externalId)}`,
|
|
187
|
+
{
|
|
188
|
+
method: "PATCH",
|
|
189
|
+
body: JSON.stringify({
|
|
190
|
+
subject: booking.title,
|
|
191
|
+
start: { dateTime: booking.startTime, timeZone: booking.timezone },
|
|
192
|
+
end: { dateTime: booking.endTime, timeZone: booking.timezone },
|
|
193
|
+
}),
|
|
194
|
+
},
|
|
195
|
+
);
|
|
196
|
+
return { iCalSequence: newSeq };
|
|
197
|
+
},
|
|
198
|
+
async deleteEvent({ credentialId, externalId }) {
|
|
199
|
+
await graph(
|
|
200
|
+
credentialId,
|
|
201
|
+
`/me/events/${encodeURIComponent(externalId)}`,
|
|
202
|
+
{
|
|
203
|
+
method: "DELETE",
|
|
204
|
+
},
|
|
205
|
+
);
|
|
206
|
+
},
|
|
207
|
+
};
|
|
208
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Provider registry — consumers register calendar/video/SMS providers at
|
|
3
|
+
* startup. Actions look up providers by kind.
|
|
4
|
+
*/
|
|
5
|
+
import type { CalendarProvider, VideoProvider, SmsProvider } from "./types.js";
|
|
6
|
+
|
|
7
|
+
const calendarProviders = new Map<string, CalendarProvider>();
|
|
8
|
+
const videoProviders = new Map<string, VideoProvider>();
|
|
9
|
+
const smsProviders = new Map<string, SmsProvider>();
|
|
10
|
+
|
|
11
|
+
export function registerCalendarProvider(p: CalendarProvider): void {
|
|
12
|
+
calendarProviders.set(p.kind, p);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function registerVideoProvider(p: VideoProvider): void {
|
|
16
|
+
videoProviders.set(p.kind, p);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function registerSmsProvider(p: SmsProvider): void {
|
|
20
|
+
smsProviders.set(p.kind, p);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function getCalendarProvider(
|
|
24
|
+
kind: string,
|
|
25
|
+
): CalendarProvider | undefined {
|
|
26
|
+
return calendarProviders.get(kind);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function getVideoProvider(kind: string): VideoProvider | undefined {
|
|
30
|
+
return videoProviders.get(kind);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export function getSmsProvider(kind: string): SmsProvider | undefined {
|
|
34
|
+
return smsProviders.get(kind);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function listCalendarProviders(): CalendarProvider[] {
|
|
38
|
+
return Array.from(calendarProviders.values());
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function listVideoProviders(): VideoProvider[] {
|
|
42
|
+
return Array.from(videoProviders.values());
|
|
43
|
+
}
|