@ordinatio/scheduling-api 0.4.0 → 0.5.0
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/CHANGELOG.md +72 -0
- package/README.md +9 -5
- package/dist/agent/index.js +1861 -79
- package/dist/agent/index.mjs +1861 -79
- package/dist/index.js +83 -43
- package/dist/index.mjs +83 -43
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,77 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.5.0 (prepared 2026-11-10)
|
|
4
|
+
|
|
5
|
+
- **New agent tools for the waitlist, data export and erasure, and booking analytics (6 more), which completes the agent tools.** Every staff-facing
|
|
6
|
+
route of the scheduling API now has an agent tool or a documented reason it has none. The new tools list the waitlist and take someone off it,
|
|
7
|
+
export or erase everything held about one person (erasing previews unless `confirm` is true, and cannot be undone), read the log of such
|
|
8
|
+
requests, and read booking analytics. The client-facing waitlist routes (join, leave, see and accept an offer) are not tools: they run from a
|
|
9
|
+
client's own private link.
|
|
10
|
+
- **New agent tools for webhooks and routing forms (12 more).** `createSchedulingAgentTools()` now also covers listing, adding, removing and
|
|
11
|
+
testing webhook endpoints, reading their delivery log and retrying a dead-lettered delivery; and listing, reading, creating, changing,
|
|
12
|
+
deleting and testing routing forms. Everything that is not a read carries an approval request. The webhook tool text warns that the
|
|
13
|
+
signing secret is shown once. Routing form questions, rules and fallback are taken as `json-array` and `json-object` parameters, and the
|
|
14
|
+
text lists every operator each question type allows. Both sets need the host to turn the feature on; otherwise the routes answer 501.
|
|
15
|
+
- **New agent tools for coupons, packages and package purchases (11 more).** `createSchedulingAgentTools()` now also covers listing, creating,
|
|
16
|
+
changing and deleting coupons and packages, and listing, giving, cancelling and correcting package purchases. Everything that changes
|
|
17
|
+
something carries an approval request. The text says plainly that giving a client a package records it and takes no payment. The public
|
|
18
|
+
coupon check (`POST /coupons/validate`) is not a tool: it is a POST that changes nothing, and only GET tools run without approval.
|
|
19
|
+
- **Fix: a package linked to an appointment type can now only be used to book that type.** `POST /appointments` with a `packagePurchaseId`
|
|
20
|
+
never compared the package's type with the booked one, so a package bought for one service could pay for any other. It now answers 409
|
|
21
|
+
("This package cannot be used for this appointment type"). A package linked to no type still covers any type. If you relied on the old behaviour,
|
|
22
|
+
unlink the package from its type.
|
|
23
|
+
- **New agent tools for the cancellation policy (2 more).** `createSchedulingAgentTools()` now also covers reading the policy and saving
|
|
24
|
+
it. Saving asks a person first, takes the fees and the no-show rule as `json-object` parameters, and replaces the whole policy.
|
|
25
|
+
The tool text says plainly that this API stores the fees and the card-on-file switch but does not charge them. Needs the
|
|
26
|
+
`@ordinatio/scheduling` release that adds the organization `settings` column.
|
|
27
|
+
- **Fix: a coupon can no longer be edited into a percentage over 100.** `PUT /admin/coupons/[id]` checked nothing about the value after the edit, so
|
|
28
|
+
sending a new value of 150 for a percentage coupon, or changing a flat coupon of 500 to a percentage, was accepted and would make every
|
|
29
|
+
booking free. It now answers 400, as creating one already did.
|
|
30
|
+
- **Fix: renaming a coupon to a code that is already taken now answers 409 in plain words.** `PUT /admin/coupons/[id]` answered 500 with the database's message.
|
|
31
|
+
- **Fix: a package can only be linked to an appointment type of its own organization.** `POST /admin/packages` and `PUT /admin/packages/[id]`
|
|
32
|
+
accepted any type id, and the answer then named that type. They now answer 404.
|
|
33
|
+
- **Fix: `GET` and `PUT /admin/policy` need the next `@ordinatio/scheduling` release.** On a database built from the packaged schema they
|
|
34
|
+
answered 500, because the organization table had no `settings` or `updatedAt` column. The engine now has a migration that adds
|
|
35
|
+
them; run `prisma migrate deploy` after upgrading it. No change to this package was needed.
|
|
36
|
+
- **Changing a calendar's timezone now clears its stored free times.** `PUT /admin/calendars/[id]` already did this when the slot size
|
|
37
|
+
changed. After a timezone change, the booking page and `scheduling_check_availability` could keep offering the old times for up to a minute.
|
|
38
|
+
|
|
39
|
+
- **New agent tools for repeating bookings and group sessions (5 more).** `createSchedulingAgentTools()` now also covers listing and
|
|
40
|
+
reading repeating series, creating a series, cancelling one visit, the rest of a series or all of it, and listing group sessions with
|
|
41
|
+
their seats taken. Creating and cancelling carry an approval request.
|
|
42
|
+
- **Fix: a repeating series with a visit at exactly the time of an existing booking now answers 409 in plain words.**
|
|
43
|
+
`POST /admin/recurring` used to answer 500 with the database's own message. Nothing is saved either way.
|
|
44
|
+
- **New agent tools for categories, message templates and the brand (11 more).** `createSchedulingAgentTools()` now also covers
|
|
45
|
+
listing, creating, renaming and deleting appointment categories; listing, creating, changing and deleting the email and text
|
|
46
|
+
message templates; and reading, saving and removing the brand. Everything that changes something carries an approval request.
|
|
47
|
+
The template tools list every `{{value}}` a message can use.
|
|
48
|
+
- **Fix: an email template whose subject is only tags (such as `<b></b>`) is now refused as having no subject.**
|
|
49
|
+
`POST /admin/templates` used to save it with an empty subject; the update route already refused it.
|
|
50
|
+
|
|
51
|
+
## 0.4.1 (2026-11-07)
|
|
52
|
+
|
|
53
|
+
This release adds 20 agent tools and one fix. The tools that take a list of objects (weekly hours, intake form) need an agent runner
|
|
54
|
+
that offers the `json-array` type, which `@ordinatio/agent` 2.2.0 provides.
|
|
55
|
+
|
|
56
|
+
- **New agent tools for calendars (11 more).** `createSchedulingAgentTools()` now also covers the staff options list, listing,
|
|
57
|
+
reading, creating, changing and archiving calendars, reading and saving a calendar's booking page, disconnecting the Google and
|
|
58
|
+
Outlook connections, and the recently used places of a calendar. Everything that changes something carries an approval request.
|
|
59
|
+
The booking page tool takes its theme and config as `json-object` parameters.
|
|
60
|
+
- **New agent tools for appointment types and opening hours (9 more).** `createSchedulingAgentTools()` now also covers listing every
|
|
61
|
+
appointment type (switched-off ones too), creating, changing and deleting a type, restarting a team type's rotation, listing a
|
|
62
|
+
calendar's hours, setting the weekly hours, and adding or removing date exceptions (a closed day, a blocked part of a day, or
|
|
63
|
+
custom hours). Everything that changes something carries an approval request. Setting the weekly hours and an intake form take
|
|
64
|
+
`json-array` parameters (a list of objects), which needs a runner that offers that type; the agent package supports it from the
|
|
65
|
+
version that added `json-array`.
|
|
66
|
+
- **Fix to the calendar tool text.** The create-calendar tool said a calendar with no opening hours offers no times. It is the
|
|
67
|
+
opposite: until weekly hours are set, such a calendar is open around the clock. The text now says so and points to the new tool.
|
|
68
|
+
- **Fix: a change to a calendar's opening hours now shows on the booking page at once.** Setting the weekly hours
|
|
69
|
+
(`PUT /admin/availability/[calendarId]`), adding a blocked day, a blocked time range or custom hours, and removing one
|
|
70
|
+
(`POST` and `DELETE` on the same route) did not clear the availability cache, so with the built-in cache the public times for that
|
|
71
|
+
calendar and day stayed as they were for up to a minute. All three now clear the calendar's cached times after the change is
|
|
72
|
+
saved. A cache that fails is logged and does not turn the answer into an error. Hosts that supply their own `availabilityCache`
|
|
73
|
+
need no change: its `invalidate(calendarId)` is simply called more often.
|
|
74
|
+
|
|
3
75
|
## 0.4.0 (2026-10-31)
|
|
4
76
|
|
|
5
77
|
This release carries a security fix (the first entry) and a new export. It is a minor version because two answers lose fields and
|
package/README.md
CHANGED
|
@@ -356,12 +356,16 @@ const tools = createSchedulingAgentTools({ basePath: '/api/scheduling' }); // re
|
|
|
356
356
|
|
|
357
357
|
Each tool maps to a route, says when to use it, lists its parameters and gives an example. Reads run freely. Every tool that
|
|
358
358
|
changes something, sends a message or moves money carries an `requiresApproval` entry, so the runner asks a person first. The tools
|
|
359
|
-
call your routes. Tools on staff routes use the signed-in person's session, so the usual sign-in, role and organization checks apply. Tools on the public booking routes (`auth: 'none'`: availability, appointment types, capacity and booking) behave exactly like the public widget: no staff sign-in, rate limited by address, and without the staff member's calendar visibility. Give those to an agent only if that is what you want. Parameter types are `string`, `number`, `boolean`, `string[]` and `json-
|
|
359
|
+
call your routes. Tools on staff routes use the signed-in person's session, so the usual sign-in, role and organization checks apply. Tools on the public booking routes (`auth: 'none'`: availability, appointment types, capacity and booking) behave exactly like the public widget: no staff sign-in, rate limited by address, and without the staff member's calendar visibility. Give those to an agent only if that is what you want. Parameter types are `string`, `number`, `boolean`, `string[]`, `json-object` and `json-array`. The booking tool's `intakeResponses` is a `json-object` (and the routing-form and cancellation-policy tools take objects and arrays too): a runner that turns types it does not know into text cannot pass them, so it needs to offer those types to the model as objects and arrays (`@ordinatio/agent` does, except for Gemini, where booking with intake answers does not work yet).
|
|
360
360
|
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
361
|
+
Every staff-facing route has a tool: appointments, calendars, appointment types, opening hours, recurring series, settings,
|
|
362
|
+
cancellation policy, coupons, packages, webhooks, routing forms, waitlist, data export and erasure, and analytics. Tools for
|
|
363
|
+
webhooks, routing forms, waitlist and privacy need the host to turn that feature on; otherwise the route answers 501. Analytics is on unless
|
|
364
|
+
the host's `bookingAnalyticsEnabled` says no.
|
|
365
|
+
|
|
366
|
+
Some routes are left out on purpose, such as the public booking widget, client-link self-service (including the client-facing waitlist
|
|
367
|
+
routes), the public coupon check, worker entry points and browser sign-in steps; `SCHEDULING_AGENT_EXCLUDED` gives the reason for each.
|
|
368
|
+
`SCHEDULING_AGENT_PENDING` is empty, and a test fails if a new route is in neither the tools nor the excluded list.
|
|
365
369
|
|
|
366
370
|
## Serving the routes
|
|
367
371
|
|