domma-cms 1.36.0 → 1.37.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.
Files changed (52) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/bin/lib/left-free-tier.js +4 -1
  3. package/bin/update.js +4 -0
  4. package/docs/DommaFeatures.md +8 -6
  5. package/docs/plugin-development.md +2 -2
  6. package/package.json +1 -1
  7. package/plugins/docs/tests/plugin.test.js +2 -0
  8. package/plugins/free-tier.lock.json +2 -50
  9. package/server/services/siteGitignore.js +1 -1
  10. package/plugins/booking/CLAUDE.md +0 -204
  11. package/plugins/booking/admin/css/index.css +0 -192
  12. package/plugins/booking/admin/lib/details.js +0 -58
  13. package/plugins/booking/admin/lib/diary-layout.js +0 -158
  14. package/plugins/booking/admin/lib/drafts.js +0 -139
  15. package/plugins/booking/admin/lib/email.js +0 -191
  16. package/plugins/booking/admin/lib/extension-sections.js +0 -160
  17. package/plugins/booking/admin/lib/kit.js +0 -471
  18. package/plugins/booking/admin/templates/booking.html +0 -1
  19. package/plugins/booking/admin/views/booking.js +0 -216
  20. package/plugins/booking/admin/views/bookings.js +0 -132
  21. package/plugins/booking/admin/views/diary.js +0 -382
  22. package/plugins/booking/admin/views/panels.js +0 -603
  23. package/plugins/booking/admin/views/people.js +0 -318
  24. package/plugins/booking/admin/views/services.js +0 -264
  25. package/plugins/booking/admin/views/settings.js +0 -222
  26. package/plugins/booking/collections/booking-bookables.json +0 -17
  27. package/plugins/booking/collections/booking-bookings.json +0 -18
  28. package/plugins/booking/collections/booking-services.json +0 -17
  29. package/plugins/booking/config.js +0 -36
  30. package/plugins/booking/docs/guide.md +0 -73
  31. package/plugins/booking/inject/body.html +0 -1
  32. package/plugins/booking/lib/call.js +0 -88
  33. package/plugins/booking/lib/extensions.js +0 -169
  34. package/plugins/booking/lib/mail.js +0 -113
  35. package/plugins/booking/lib/store.js +0 -392
  36. package/plugins/booking/plugin.js +0 -905
  37. package/plugins/booking/plugin.json +0 -81
  38. package/plugins/booking/plugin.public.js +0 -175
  39. package/plugins/booking/public/booking.css +0 -159
  40. package/plugins/booking/public/booking.js +0 -808
  41. package/plugins/booking/public/lib/clean.js +0 -141
  42. package/plugins/booking/public/lib/page-format.js +0 -121
  43. package/plugins/booking/public/lib/slots.js +0 -247
  44. package/plugins/booking/public/lib/time.js +0 -131
  45. package/plugins/booking/templates/booking.html +0 -5
  46. package/plugins/booking/tests/admin-diary.test.js +0 -81
  47. package/plugins/booking/tests/admin-drafts.test.js +0 -67
  48. package/plugins/booking/tests/api.test.js +0 -651
  49. package/plugins/booking/tests/email.test.js +0 -69
  50. package/plugins/booking/tests/public.test.js +0 -72
  51. package/plugins/booking/tests/pure.test.js +0 -189
  52. package/plugins/booking/tests/seo.test.js +0 -71
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.37.0] - 2026-11-05
4
+
5
+ - Booking is now included in the Calendar Tool, together with the former Booking Pro features, availability controls and Google Calendar connections. New CMS installations no longer ship a separate Booking plugin.
6
+ - Upgrades retire the old free Booking code while preserving its runtime data and backups. Calendar retains the existing booking collections, settings, customer links and Google authorisations.
7
+
8
+
3
9
  ## [1.36.0] - 2026-11-03
4
10
 
5
11
  - **Media knows about folders.** The list no longer shows a folder as if it were a file, and the screen says when files sit in folders it does not list (they keep working at their addresses). `GET /api/media/_folders` counts them.
@@ -7,6 +7,9 @@
7
7
  * the plugins it ships - so without this step every site would keep its old
8
8
  * free copy forever, runnable without a licence.
9
9
  *
10
+ * Booking joined the paid Calendar in 1.37.0. Its old free copy is retired
11
+ * under the same rule, with runtime files retained for Calendar to migrate.
12
+ *
10
13
  * So the update removes the OLD FREE COPY, and only that:
11
14
  *
12
15
  * - a copy with `.entitlement.json` beside it is a licensed (or gifted) one,
@@ -30,7 +33,7 @@ import {existsSync, lstatSync, readFileSync, readdirSync, rmSync} from 'node:fs'
30
33
  import path from 'node:path';
31
34
 
32
35
  /** Slug -> the version that left the free tier. */
33
- export const LEFT_FREE_TIER = Object.freeze({quiz: '1.3.0', crossword: '1.3.0'});
36
+ export const LEFT_FREE_TIER = Object.freeze({quiz: '1.3.0', crossword: '1.3.0', booking: '1.37.0'});
34
37
 
35
38
  /** Never removed from a copy that goes: runtime state, and a licence (which would have kept the copy anyway). */
36
39
  export const KEEP = Object.freeze(['data', 'backups', '.entitlement.json']);
package/bin/update.js CHANGED
@@ -459,6 +459,10 @@ export default async function update(_positional, flags) {
459
459
  for (const r of left) {
460
460
  if (r.action === 'keep') { info(` → plugins/${r.name}/ kept: ${r.reason}`); continue; }
461
461
  info(` → plugins/${r.name}/ removed: ${r.reason} - it is a paid Tool now${r.kept.length ? ` (${r.kept.join(', ')} kept)` : ''}`);
462
+ if (r.name === 'booking') {
463
+ info(' → Booking is included in Calendar; existing booking records and runtime data are retained.');
464
+ continue;
465
+ }
462
466
  if (enabled[r.name]?.enabled) warn(`${r.name} was switched on here: it stays off until this site is licensed for it (or gifted it).`);
463
467
  }
464
468
  }
@@ -36,9 +36,7 @@ Code was treated as the truth. Where docs disagree with it, the disagreement is
36
36
  | `bingo` | paid (giftable) | 1.0.0 | Bingo for quiz nights, events and classrooms: 75-ball, 90-ball tickets, or word and picture cards. A caller screen with auto-draw and a projector view, players on their phones with server-dealt cards, claims checked against the real calls, and printable numbered cards with a checker. |
37
37
  | `blog` | free | 1.9.6 | Public-facing blog with posts, categories and comments - layouts and listings built from editable blocks. |
38
38
  | `blog-pro` | paid | 0.7.0 | Several blogs on one site, each with its own address, look and settings - dozens of layouts, self-hosted fonts, colours, page transitions, author pages, and privacy-first media: videos, audio, galleries, link cards and maps. |
39
- | `booking` | free | 1.6.3 | Let people book appointments with you or your team, and rooms or equipment, from a booking page on your site (`/booking`, or the `[booking /]` shortcode). Opening hours, days off, buffers and notice; confirmation and reminder emails with a link to move or cancel; a Diary in the admin; an online booking's call chat kept on the booking, and Add people during its call. Book straight from a contact or an email; bookings show in the Calendar. |
40
- | `booking-pro` | paid | 0.4.1 | More for Booking: online appointments as a video call on your site (optional host recording), Call now - open a booking's call at once or call anyone from a contact or an email (switches on the CMS's instant calls), a person and a room together, classes with places and a waiting list that fills a freed place by itself, repeat bookings, questions on the booking form, a daily limit and one booking per customer every N days. A lapse leaves Booking and every booking as they were. |
41
- | `calendar` | paid | 1.15.4 | Events calendar - month, day and list views, online meetings as a video call on your site (with the call's chat kept, and Add people during the call), call anyone now from a contact or an email, all-day and recurring events, sharing with people and roles, RSVPs and an iCal feed. |
39
+ | `calendar` | paid | 2.0.1 | Events, appointments, availability and Google Calendar in one Tool. Includes the former Booking and Booking Pro features: classes, waiting lists, repeat bookings, linked staff and rooms, booking questions and online appointments. |
42
40
  | `campaigns-pro` | paid | 1.6.0 | Marketing campaigns, one paid Tool: compose a message, send it to Contacts groups (read live when it sends) or an audience of its own (shared with Surveys), from the site's sending or your own Email mailbox (small lists), schedule sends, attach an offer that closes by a date or a claim limit. Opens and clicks (cookieless), links tagged for Analytics, a linked Shop discount code, send a survey as a campaign, follow-up sequences, resend to non-openers, A/B subject tests, and a version-1 stats feed other Tools read. |
43
41
  | `media-pro` | paid | 0.2.0 | Media, properly organised: folders inside folders, choose from them anywhere, and move or rename anything without breaking a page. Select several, see where each file is used, find what is unused or duplicated, shrink big pictures, alt text and credits with each file, Trash, and a whole folder as a gallery. Works on the same files as the built-in Tool. |
44
42
  | `contacts-pro` | paid | 0.13.0 | Contacts, with more to them: send a campaign to a group or the selected contacts (with Campaigns Pro), your own custom fields, birthdays and ages with the ones coming up and a reminder in the sidebar, and groups with their own emblem and colours. Share a contact, several, or a whole group with people or roles - to view, or to edit. Call a contact now on a video call on your site. Works over the same contacts as the built-in Tool, so nothing moves and nothing is lost. |
@@ -337,7 +335,7 @@ Fast, file-based and friendly.
337
335
 
338
336
  - **Media library** - upload by button or by dropping files anywhere on the screen (images, documents, audio, video; 10 MB default limit). Tiles with thumbnail, size, age and type; filter All / Images / Video / Audio / Documents / Other; sort newest, oldest, name or largest. Details slideover with rename, Copy address and Copy for a page (Markdown); right-click menu, F2 to rename, Delete key. Replacing a same-named file asks first.
339
337
  - **Files in folders** - the built-in screen lists the top of the library; when there are files in folders it says how many, and they keep working at their addresses (`GET /api/media/_folders`). Managing folders is Media Pro.
340
- - **Media Pro** (paid, `media-pro`, marketplace; dev on dcm) - takes over the Media screen and every image picker. Nested folders that are real folders (`/media/products/shoes/red.jpg`), drag to move, upload a whole folder keeping its shape, select several (move, tag, shrink, zip, Trash). Moving or renaming anything updates pages, collections and settings that use it and adds a redirect in the SEO Tool; blocks, forms, menus, custom.css and other Tools' data are reported and kept working by that redirect. Used-on list per file, Tidy up (unused, duplicates, big pictures, no alt text), alt text, caption, credit and tags with each file, Replace keeping the address, Shrink (optionally to WebP), upload rules (longest side, remove location data, store as WebP), Trash with restore, thumbnails, `[media-gallery folder="…" /]`. 0.2.0: pages offer phones smaller copies (`srcset`), a focal point per picture is kept in crops, and Claude writes alt text for a person to check, included in the plan (the Manager holds the key: site-manager `mediaAltRoutes.js`, `tools/media-alt`; 5,000 per site per month). Over the same files as the built-in Tool: a lapsed licence loses no file and breaks no address. Hooks in core: `BUILT_IN_TOOLS` takes `media`, `admin.mediaPicker` in a manifest, `openImageEditor(file, {api})`, `mediaUploader(zone, {url})`.
338
+ - **Media Pro** (paid, `media-pro`, marketplace; in the Pro bundle since CMS 1.36.0) - takes over the Media screen and every image picker. Nested folders that are real folders (`/media/products/shoes/red.jpg`), drag to move, upload a whole folder keeping its shape, select several (move, tag, shrink, zip, Trash). Moving or renaming anything updates pages, collections and settings that use it and adds a redirect in the SEO Tool; blocks, forms, menus, custom.css and other Tools' data are reported and kept working by that redirect. Used-on list per file, Tidy up (unused, duplicates, big pictures, no alt text), alt text, caption, credit and tags with each file, Replace keeping the address, Shrink (optionally to WebP), upload rules (longest side, remove location data, store as WebP), Trash with restore, thumbnails, `[media-gallery folder="…" /]`. 0.2.0: pages offer phones smaller copies (`srcset`), a focal point per picture is kept in crops, and Claude writes alt text for a person to check, included in the plan (the Manager holds the key: site-manager `mediaAltRoutes.js`, `tools/media-alt`; 5,000 per site per month). Over the same files as the built-in Tool: a lapsed licence loses no file and breaks no address. Hooks in core: `BUILT_IN_TOOLS` takes `media`, `admin.mediaPicker` in a manifest, `openImageEditor(file, {api})`, `mediaUploader(zone, {url})`.
341
339
  - Where: **Content > Media**; `content/media/`; `config/server.json` `uploads.maxFileSize`
342
340
  - Since: 0.5.0
343
341
  - **Image editor** - edit JPEG, PNG, WebP, GIF or TIFF in place: crop (aspect lock), resize, rotate, flip, colour presets (grayscale, sepia, warm, cool, enhance, sharpen, soften, invert), adjustments, watermark (position, scale, opacity), border (solid, mirror, repeat) and output format (JPEG, PNG, WebP with quality). Save as a copy or overwrite.
@@ -2268,7 +2266,9 @@ An add-on for the SEO Tool built into Domma CMS. It brings Google Search Console
2268
2266
 
2269
2267
  **Where:** Tools > SEO (`#/seo/...`) - the Pro tabs appear in the built-in SEO screen, so they follow the core `seo` permission (level 0 and `admin` by default).
2270
2268
 
2271
- ### Booking (`booking`)
2269
+ ### Booking (included in Calendar)
2270
+
2271
+ Since Calendar 2.0, this is a bundled component rather than a standalone Tool. The legacy data and API names below remain compatible.
2272
2272
 
2273
2273
  Tier: free · Version: 1.6.0 · Requires: nothing · Uses: `contacts`, `calendar` · Core 0.103 for Book… on an email; the call chat needs a core with `_lib/call/chatStore.js` (unreleased)
2274
2274
 
@@ -2292,7 +2292,9 @@ Appointments and resources booked from the site. People (appointments) and resou
2292
2292
 
2293
2293
  1.6.0: Add people in an online booking's call - the person booked (host) searches their contacts and the team, or types a name and email; each gets their own link `?b=&g=<pass>` (signed with the session's `callExtraKey`, never the customer's token or the host key), names themselves and knocks; team members also get a notification and a Messages message. When the person booked has no account on the site (the host link may be anyone's), the call offers Copy link only - no directory, no contacts, nothing sent. Needs a core with `_lib/call/invite.js` (unreleased); an older core shows no button. 1.5.0 keeps an online booking's call chat per session (`data/call-chat.json`, `_lib/call/chatStore.js`; a class's shared call has one chat), so the call reopened shows it; the booking panel offers "Call chat (N messages)", read-only, to staff with booking read (`GET /bookings/:id/call-chat`; the host's lines on the right). 1.3.0 serves online bookings' calls (`<bookingPath>/call/<session>`, a class shares one call; emails, .ics and pages carry Join the call / Start the call) - see Booking Pro. 1.1.0 adds the extension registry Booking Pro uses (`lib/extensions.js`, `version: 2`): `rules` (places, companions, daily limit, waiting list), `form` / `answers` (extra questions), `check` (refuse a public booking), admin sections in Booking's own slideovers, extra tabs, and `registry.services` (book, cancel, mail, time helpers). Bookings carry `holds` (every bookable they block) and `alsoNames`. Without an extension every service is plain.
2294
2294
 
2295
- ### Booking Pro (`booking-pro`)
2295
+ ### Advanced booking (included in Calendar)
2296
+
2297
+ Since Calendar 2.0, these features are included in Calendar. There is no separate Booking Pro product or licence. The following describes its retained data and API contracts.
2296
2298
 
2297
2299
  Tier: paid (closed source) · Version: 0.4.0 · Requires: `booking` 1.1+ (1.3+ for online, 1.4+ for Call now) · An add-on that registers into Booking's registry (the Cart / Cart Pro pattern), not a `supersedes`
2298
2300
 
@@ -574,7 +574,7 @@ Tools claim their letters first (`CORE_HOTKEYS` in `admin/js/lib/hotkeys.js`: D
574
574
  M Media, L Collections, F Forms, V Views, U Users, A Analytics, N Notes, T Todo, C Contacts, `,` Site
575
575
  Settings); after that the first Tool in the sidebar to ask for a letter has it, and a later one goes
576
576
  without - the browser console names it. A Pro Tool that supersedes another takes over its entry, so it
577
- asks for the same letter (Blog Pro, like Blog, is B). Ours: E Email, R Mail Reader, B Blog, K Booking,
577
+ asks for the same letter (Blog Pro, like Blog, is B). Ours: E Email, R Mail Reader, B Blog,
578
578
  Y Calendar, C Contacts Pro, O Docs, I Invoices, H Shop, Q Surveys, W Waypoint, J Job Board, S Support.
579
579
 
580
580
 
@@ -703,7 +703,7 @@ shape, so every widget looks like part of the same admin.
703
703
 
704
704
  **You may already have one.** Every sidebar entry with a `countUrl` is offered as a `count` widget
705
705
  automatically - the badge's own answer (`{count, label, tone, details}`) is drawn as a big number with
706
- its `details` rows and items underneath. Email, Booking, Support and the rest arrive this way.
706
+ its `details` rows and items underneath. Email, Calendar, Support and the rest arrive this way.
707
707
 
708
708
  For anything more, list widgets in `plugin.json`:
709
709
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "domma-cms",
3
- "version": "1.36.0",
3
+ "version": "1.37.0",
4
4
  "description": "File-based CMS powered by Domma and Fastify. Run npx domma-cms my-site to create a new project.",
5
5
  "type": "module",
6
6
  "main": "server/server.js",
@@ -541,6 +541,8 @@ test('2.7: the sidebar badge counts your own documents as an inventory - shared
541
541
  assert.equal(before.tone, 'info');
542
542
  assert.ok(before.label, 'never an empty label');
543
543
  const a = await make(owner, {title: 'Badge one'});
544
+ // Newest first is by updatedAt: two saves in the same millisecond have no order (CI, about 1 run in 25).
545
+ await new Promise(r => setTimeout(r, 5));
544
546
  const b = await make(owner, {title: 'Badge two'});
545
547
  let r = await call(owner, 'GET', '/count');
546
548
  assert.equal(r.body.count, before.count + 2, 'a create clears the cached answer');
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "note": "Written by `make sync-free-tier` in dcms-marketplace. Do not edit these plugins here - edit them there and sync.",
3
- "source": "dcms-marketplace@ffeb277",
3
+ "source": "dcms-marketplace@03107ce",
4
4
  "plugins": {
5
5
  "blog": {
6
6
  "version": "1.10.1",
@@ -78,54 +78,6 @@
78
78
  "tests/public.test.js": "cd4cc53da9709d400d082ef6df01b3f49e6fc419e4b020b588464306a5d907e9"
79
79
  }
80
80
  },
81
- "booking": {
82
- "version": "1.7.2",
83
- "files": {
84
- "CLAUDE.md": "13885f82d5d1dfd5e356ac899d703ec0b0aa0c1956ff5b3d45ba7f47ab96daa1",
85
- "admin/css/index.css": "4f7731921c0c5038cb1566a6ab2d43ffc35bf9b161e58f87a0cff423e81b47fa",
86
- "admin/lib/details.js": "8b37536bfa9ccfcc5265cc957ba8266d3f5f777133e7c0946ae49540f1c80e3c",
87
- "admin/lib/diary-layout.js": "d0e36674ff454e5217b02c3ef3b820e4dece97a62df618a6052016dfeefab1c9",
88
- "admin/lib/drafts.js": "90d6c8403ef7c6a01569ad925939ce7634ab0853f7e3097d522c1e850636d6b1",
89
- "admin/lib/email.js": "46e3e24b6be5a4667054a31dc0e73641f763d189129c93457900273ee4c8d5a8",
90
- "admin/lib/extension-sections.js": "0588ad47660e511b0dd8077bb9c3999c775d97597333a75e87ee12d915bbf00b",
91
- "admin/lib/kit.js": "403e792195e95770f6304bafab14ff13295c2bcc68cccda27e019a6739d0e888",
92
- "admin/templates/booking.html": "20b9a3bfe3e5d5bbee613f29be99551b12790fb38f80d119585360cc38e9ec57",
93
- "admin/views/booking.js": "939bf77016880ee091a9ee6cd6633cac0014801426b4c5bff9863d63aecd87a6",
94
- "admin/views/bookings.js": "bbe1068448e78134a5102ad9d7af16892f75a4449f150e92e649e66e7232e56b",
95
- "admin/views/diary.js": "bea962e57fc3be6ed07f5c6588889fffb106bc251193c0c48743f1f2442a6eef",
96
- "admin/views/panels.js": "cf6abeb6fc5f37aa3a30eec98d3b90ece5adab9436a8479899216043b28be07c",
97
- "admin/views/people.js": "55cc6d07b98ed305d577772b921eb8d09b564b099cb8d35441c1b39631e4764a",
98
- "admin/views/services.js": "32a2539391d06ec576c0af6d7aef1bbf71e22d6335c3654acb80491e56f19f41",
99
- "admin/views/settings.js": "dc502a934656fe77fb21c157ed7913df4d5b1acccf300c3bf1bb1edf11479cec",
100
- "collections/booking-bookables.json": "9f1f305eceac3d880413d5477a631e48c1fed7ff389c434f34651f4082ca1a1c",
101
- "collections/booking-bookings.json": "fa0b15cc81b4a2114734a0bc8adc4b4d25049d16cf62549b83634cdbeb543b52",
102
- "collections/booking-services.json": "cecb500a9215a0eba894e6b4c9ae78f5fbeb209830d07d47050c56c75143f66a",
103
- "config.js": "5565fd627481cf809322257cc300a7cbb7ccbf6cae076b4cf8a7453fcf554bd3",
104
- "docs/guide.md": "0d90ae6d3bac0ffce8ca51c0c1ef888b97797dd7423a1033f0b6b8cd6191efaa",
105
- "inject/body.html": "ab55ce945eec2302eb0c836a4626cffa5e091d050c6a59c6f2af332b05570777",
106
- "lib/call.js": "87c11b8531e1a6d247d52d4e03ea8e5aa06a1af49cbd7cbd0af97e2586237f7b",
107
- "lib/extensions.js": "8cec28ff8685daad8083b23f034f1c3bf82fd2322943dd19d46570ccdc311105",
108
- "lib/mail.js": "cad8f409df62d6e42f0f4024ec364bbe018a62b842fa3f7c38786fd4e7f92408",
109
- "lib/store.js": "7aa7967e4694e5a3b85378f60302e5a47394b1d90c7dd86e09578156f1c13e03",
110
- "plugin.js": "4a303855a5a7f746e07e45a937dfeac8984dc9254c2f9b1a60b6f6306912ed84",
111
- "plugin.json": "856f1c48e8e3ecf49fbc78bfb2bf9b52ff90e4cf3dcf8a73733115d8683e706b",
112
- "plugin.public.js": "101f7c1334666a00db43ac6436f94ab3983f48c2c7aecdbd7c6753df64b58091",
113
- "public/booking.css": "8b88989fdd04e50efc1688a2f32fe2e422299d7d13b81bb8fce0cc162fa99df6",
114
- "public/booking.js": "7dfc3d205696967013886567f67a867443c2e370bac29019d69911d695fdbade",
115
- "public/lib/clean.js": "d591be9ea8462705b7bc8806670027fdd4d6d4764777da08e91a010d27ec1651",
116
- "public/lib/page-format.js": "a38454283c2b7256b38ea48578f6df2695a623e0fe2c5d80aae9952e7034a93d",
117
- "public/lib/slots.js": "6472e530f3f521e7a08625ed2ee86802a9065cbf2f97c2c7601229f5f032dc07",
118
- "public/lib/time.js": "48e13a23e3d7a4916e2097e8f87c03a87d37b71c4ef037a5a16143c6a4185c41",
119
- "templates/booking.html": "a4995de46dfdab7e692b56f21347f29c76320cf3b0477889dc3c5d14e0b6dcd7",
120
- "tests/admin-diary.test.js": "6bd117af798e748234c94e4e66339ff1ec3bba9633790a2a5fd291f64c30e484",
121
- "tests/admin-drafts.test.js": "c9e857b2326965b3dbb34e344282d874348f84b5cd9338ced2ca2c7a07713a25",
122
- "tests/api.test.js": "efb3767f7efde08c11c8edcb5753889773b421188798f725aff0e4e533860aff",
123
- "tests/email.test.js": "2190b6dd7cc9afad99d2170f002343fe3dad306aa14ac718428e5df0be54ded1",
124
- "tests/public.test.js": "0b7b626d60df5a3d73d7c0077b73f59b62a9fded98ce84a8d93cd32cd0333159",
125
- "tests/pure.test.js": "8ba0c8f76b4c9efcc422f39ff29509612544d81f760025a4b9a5594af14e7bcf",
126
- "tests/seo.test.js": "8d935319eb21fbb81feb663220384b3a4d52d0fe8597047994652daa8c981489"
127
- }
128
- },
129
81
  "docs": {
130
82
  "version": "2.14.1",
131
83
  "files": {
@@ -165,7 +117,7 @@
165
117
  "tests/convert.test.js": "27dc072e3a5f6fd482560e547048723bc7884aa8f53a3bc2f547758a28c535a4",
166
118
  "tests/drafts.test.js": "209c1691aa321e07c0ab24f747920b15d7bd56c2b3f5a581b116aad73c157d8f",
167
119
  "tests/pdf.test.js": "316c7b32fb4562f42fd59da1df9c8a3bccacb8286db6540b36e10f85c510d68e",
168
- "tests/plugin.test.js": "a76c3a5bab6e525bc201f73f4ed76b604b41331cbeba0c6155253b88b40b5bb0",
120
+ "tests/plugin.test.js": "766ce9418c2285128f74264c62eda013bafda386dba832e261254de26a4d753c",
169
121
  "tests/shortcuts.test.js": "7f96b63e91150e7670eb349a81034ce354f64ea42503d6a8ffcdae4867d7bba1"
170
122
  }
171
123
  },
@@ -49,7 +49,7 @@ const SITE_ROOTS = ['content', 'config', 'plugins'];
49
49
  */
50
50
  export const RETIRED_PLUGINS = [
51
51
  'analytics', 'contacts', 'notes', 'todo', 'demo-viewer', 'theme-switcher', 'site-search',
52
- 'seo', 'seo-pro', 'shopping-cart', 'form-builder', 'calculator'
52
+ 'seo', 'seo-pro', 'shopping-cart', 'form-builder', 'calculator', 'booking', 'booking-pro'
53
53
  ];
54
54
 
55
55
  /**
@@ -1,204 +0,0 @@
1
- # booking - AI Assistant Guide
2
-
3
- ## Purpose
4
-
5
- Appointments and resources booked from the site. 1.0.0 (2026-09-30): people (appointments with you or your team)
6
- and resources (rooms, equipment) with weekly hours, days off and business-wide closed days; services with a length,
7
- buffers before and after, a start step, notice and how far ahead; a public booking page at a configurable address
8
- (`/booking`) and the `[booking /]` shortcode; confirmation, reminder and owner emails with an .ics; a private link for
9
- the customer to move or cancel within the notice; a Diary (day / week), a Bookings list, Services and People & rooms
10
- in the admin; a sidebar badge for bookings still to come today (none left: the next 7 days' bookings, as an inventory).
11
-
12
- Links to other Tools, each absent when that Tool is: customers become contacts (the booked person's address book,
13
- else the settings' owner, else whoever booked); "Book {name}…" on a contact's menu and a Bookings panel on the
14
- contact card (core `registerRelatedItems('contact')`); "Book {name}…" on an email's menu in Email / Mail Reader
15
- (core 0.103 `registerRelatedItems('message')`; an older core ignores it); a Bookings calendar source; a person's own
16
- Calendar events block their times (read from `calendar-occurrences` / `calendar-events` through the collections
17
- service - no import of the Calendar, which is a separate paid Tool).
18
-
19
- `tier: free`, ships with the engine, disabled on arrival. Plan and phases: `dcms-marketplace/docs/booking-plan.md`.
20
- Booking Pro (marketplace `booking-pro`, 0.4.x) is an ADD-ON that registers into this one (`lib/extensions.js`), the
21
- Cart / Cart Pro pattern - it does not supersede it. Neither takes payment yet.
22
-
23
- 1.6.0 (2026-09-30): "Add people" in an online booking's call (core with `server/services/callInvites.js` and
24
- `_lib/call/invite.js`; both imported dynamically - lib/call.js by top-level `await import`, plugin.js beside
25
- `mountCallRoutes` - so an older core simply has no button). The HOST (the person's host link) searches the contacts
26
- of the person's linked ACTIVE account (`hostUserOf`) and the team, and invites contacts, team members or any name +
27
- email. With NO linked account the host link may be held by an outsider (it goes to the person's email address and
28
- the .ics), so resolve answers `inviteOptions: {search: false, typed: false, copyLink: true}` - Copy link only: no
29
- directory, no contacts, nothing sent (the engine and `send` both refuse people). Links use core's `inviteOrigin`
30
- (`site.baseUrl` first).
31
- Each invitee gets their OWN pass `?b=<booking>&g=<nonce>.<hmac>` signed with the session's `callExtraKey` - made on the
32
- first invite and written to EVERY booking of the session (`changeBooking` patch, online only, never replaced; the
33
- stored key is re-read after writing, so two sends at once agree), never the customer's token or the host key (a
34
- customer token carries their name and identity: an invitee would replace them). `whoIsCalling` answers `{host: false,
35
- name: '', identity: '<session>:inv:<nonce>', invited: true}` for a pass; the page asks their name; they knock. Core
36
- sends (Join email, a notification + a DM from the person's user for team members). `adminBooking` strips
37
- `callExtraKey`. Tests: tests/api.test.js "1.6 Add people" (a linked host; a host with no account).
38
-
39
- 1.5.0 (2026-09-30): the call's chat is saved per SESSION (`sessionOf` - a class's shared call has one chat) in
40
- `data/call-chat.json` (`options.dataDir` in tests) through core's `_lib/call/chatStore.js` (dynamic import beside
41
- `mountCallRoutes`; an older core has none and nothing changes), passed as the engine's `chat` - so the call reopened
42
- shows it. `GET /bookings/:id` adds `callChat` (typed messages) on online bookings; `GET /bookings/:id/call-chat`
43
- (booking.read; 404 unless online) answers `{messages, items}` without participant ids, the session's host lines
44
- (`whoOf('<bookingId>:host')` for each booking of the session) marked `mine`. The panel (`openBooking`) shows "Call chat
45
- (N messages)" when N > 0 and opens `/plugins/_lib/admin/ui/transcript.js` (read-only, domma-reactive). The customer
46
- has no admin view of it. Kept: 500 items a session, the 1000 most recent sessions. Tests: tests/api.test.js.
47
-
48
- 1.4.0 (2026-09-30): "Call now" hooks for Booking Pro. Registry `version: 4`: `actions: [{id, icon, title, module}]`
49
- (module under `/plugins/<owner>/`; ids `[a-z0-9-]`, never a screen's or tab's key, first owner keeps an id) ->
50
- `registry.actions()` -> bootstrap `actions` -> a banner button each (`booking-x-<id>`) that imports the module and calls
51
- `run(ctx, prefill)` (ctx = the screen's ctx + `owner`, `api` (sectionApi), `bookables`, `services`, `helpPopovers`).
52
- `#/plugins/booking/<action-id>?contact=|email=&name=` is the Diary + that action with the prefill resolved like `new`
53
- (the address goes back to `diary`). `callOpenedAt` on an online booking (`changeBooking` patch, online only, history
54
- `call-opened`; a move clears it): `callWindow` opens at min(start - 10 min, callOpenedAt) and closes at max(end + 60
55
- min, callOpenedAt + 2 h), so the customer's EXISTING link works at once - Booking (free) honours it after a lapse.
56
- `registry.services` adds `openCall(id, {by})` (every online HOLDING booking of the session; throws `code` none |
57
- not-online | cancelled), `callLinks(b, request?)` (absolute join/host URLs from a RAW booking), `adminBooking`,
58
- `ownContact(id, userId)`, `siteBase(request?)`; `book()` takes `contactId` + `userId` (checked with `ownContact`) and
59
- `request` (for the email links). An older Pro registers no actions; an older Booking ignores them.
60
- Instant calls ("Call Sam now…", not a booking) were Booking Pro 0.3's and MOVED INTO THE CMS in Booking Pro 0.4.0
61
- (core `services/instantCalls.js`, admin `#/calls/new`): Pro's banner action `call-now` now only sends the browser to
62
- `#/calls/new[?contact=|?email=&name=]`, so the deep link `#/plugins/booking/call-now?...` above ends there too. Nothing in
63
- Booking changed for it; `ownContact`/`siteBase` stay for Pro's booking-panel Call now.
64
-
65
- 1.3.0 (2026-09-30): online bookings (plan: `dcms-marketplace/docs/online-meetings-plan.md`). An extension's
66
- `rules()` may say `online` (+ `recordingAllowed`); `placeBooking` then stores `online: true`, `hostKey`,
67
- `recordingAllowed` ON THE BOOKING, so Booking (free) serves the call for it even after Pro lapses. `lib/call.js`:
68
- a room is a SESSION (`sessionOf` = service + start + person, so a class shares one call), `whoIsCalling` (customer
69
- token -> guest, host key -> host, only while HOLDING, window 10 min before to 60 after). The engine is core's
70
- `_lib/call` (dynamic import - an older core has no calls); routes at `/call/...`, page at `<bookingPath>/call/<session>
71
- ?b=&t=|h=` (plugin.public.js). Emails: customer's main button becomes "Join the call" (change/cancel moves into the
72
- text), the owner's copy gets "Start the call"; .ics LOCATION/DESCRIPTION carry the join link. `adminBooking` swaps
73
- `hostKey` for `hostUrl`; `publicBooking` adds `online`, `callUrl`. Staff-made bookings still do not email the owner.
74
-
75
- 1.2.0 (2026-09-30): an email's sender who is already one of the caller's contacts is booked AS that contact:
76
- `GET /contact?email=` (`contactByEmail`, main address or Contacts Pro `emails[]`) fills the slideover (the
77
- sender's own address kept). Without a `contactId`, `POST /bookings` leaves it to `linkContact`, which already finds
78
- the booked person's (else the caller's) contact by email - never the caller's for someone else's booking.
79
-
80
- 1.1.0 (2026-09-30): extension points for Booking Pro - see "Extensions" below. The slot engine now knows places (a
81
- class), companions (a booking that also holds a room), and a daily limit, all OFF unless an extension's `rules`
82
- turn them on; bookings carry `holds` (every bookable they block, first = `bookableId`) and `alsoNames`.
83
-
84
- ## The one rule about time
85
-
86
- Bookings are UTC instants (`startAt`, `endAt`, and the span they BLOCK, `blockStart` / `blockEnd`, buffers
87
- included - stored, so changing a service's buffers never moves what existing bookings hold). Opening hours, days
88
- off and everything a person reads are the business's wall clock in `settings.timeZone`. `public/lib/time.js` is the
89
- only place one becomes the other (`wallClock`, `atWallClock`; Intl, no library; DST-tested: a skipped time is never
90
- offered, a repeated one is the first). Never build a Date from a date string and a time string anywhere else.
91
-
92
- ## The one rule about clashes
93
-
94
- `public/lib/slots.js` `slotsFor` decides what is free - the page, the admin and the server all ask it, and
95
- `lib/store.js` `placeBooking` checks AGAIN inside `withLock` before writing. The public `POST /public/book` also
96
- requires the time to be one the page would offer (in range, on the service's steps, in hours). Staff may book over a
97
- clash with `force: true` after a 409 (`code: 'slot-taken'`). Statuses that hold time: pending, confirmed,
98
- completed, no-show (`HOLDING`); cancelled frees it.
99
-
100
- ## Files
101
-
102
- - `plugin.json`, `config.js` (every setting, documented), `plugin.js` (API, shortcode, emails, reminders, links)
103
- - `plugin.public.js` - the booking pages from ONE onRequest hook on the LIVE `bookingPath` (moving it needs no
104
- restart): `<base>`, `<base>/<service-slug>`, `<base>/manage/<id>?t=<token>`.
105
- - `public/lib/time.js`, `slots.js`, `clean.js` - PURE, shared by server, admin and page (public/ is served; lib/ is not).
106
- - `lib/store.js` - collections I/O, live settings, `withLock`, `placeBooking` / `changeBooking`, Calendar busy time,
107
- contact linking. `shelfNow` / `settingsNow` for the synchronous shortcode.
108
- - `lib/mail.js` - one way out (copied from Waypoint Pro): never throws, not sent without SMTP (`mailReady()`),
109
- `setMailer()` for tests; `icsFor` (stable UID per booking, SEQUENCE = history length, CANCEL on cancel).
110
- - `lib/extensions.js` - the registry (`globalThis[Symbol.for('domma.booking')]`): `on` {made, moved, cancelled,
111
- status}, `tabs`, and `registry.services` (Booking's data functions, `sendReminders`).
112
- - `admin/` - the Tool (tab host `admin/views/booking.js`), `templates/` + `public/booking.js|css` - the page.
113
- - `public/booking.js` - the page in the browser: domma-reactive (`window.M`, Domma is on every public page) - one
114
- template holding every step (shown by `data-bind-hidden` on `step`), one `M.applyBindings`; plain code only fetches,
115
- writes observables, and moves focus / scroll. Without `window.M` the server's page is left as it is.
116
- - `docs/guide.md` - the user guide in the admin Documentation folder.
117
- - `tests/pure.test.js` (time, slots, cleaning), `tests/api.test.js` (the whole API against the real collection
118
- service; restores config/plugins.json and contacts-contacts; registry actions, callOpenedAt), `tests/public.test.js`
119
- (the page's paths; `call-now/<id>` is left to Booking Pro).
120
-
121
- ## Data
122
-
123
- Collections `booking-bookables`, `booking-services`, `booking-bookings` (made at every boot if missing; API access
124
- all off - bookings hold customers' details). Settings: `config/plugins.json` `booking.settings`.
125
-
126
- A booking: `serviceId`, `serviceName`, `duration`, `bookableId`, `bookableName`, `startAt`, `endAt`, `blockStart`,
127
- `blockEnd`, `status`, `name`, `email`, `phone`, `notes`, `staffNote`, `contactId`, `source` (public | admin),
128
- `createdBy`, `token` (the customer's link; never sent to the admin), `reminderSentAt`, `history` [{at, what, by,
129
- from?, reason?}], `cancelledAt`, `ext` (Pro's); online ones also `online`, `hostKey`, `recordingAllowed`, `callOpenedAt`, `callExtraKey` (1.6, the session's key for
130
- Add people passes; never sent to the admin). Services and bookables carry `ext` too (Pro's fields, kept by the
131
- free Tool untouched).
132
-
133
- ## Extensions (Booking Pro)
134
-
135
- `bookingRegistry()` (`lib/extensions.js`, `version: 4`): `register(owner, {rules, form, answers, check, admin, waitlistUrl,
136
- on, tabs, actions})` - every hook optional and guarded (one that throws counts as absent). `rules(service)` ->
137
- {capacity, companions: [[ids]], maxPerDay, waitlist}, resolved to bookable objects by `registry.rules(service,
138
- bookables)` and applied by `slotsFor` / `whoCanTake` / `placeBooking` (same session = same service + start +
139
- primary bookable: shares places, never clashes with itself; a day's limit counts sessions). `form` / `answers`: extra
140
- questions on the page, cleaned into `ext.answers` (errors come back as `errors['answers.<id>']`). `check(ctx)`: a
141
- reason refuses a public booking (409 `code: 'refused'`). `admin`: section modules mounted in Booking's own
142
- slideovers (service editor, new booking, booking panel) - the contract is in `admin/lib/extension-sections.js`.
143
- `registry.services`: Booking's data functions plus `book()` (the whole flow: contacts, emails, notices, events; throws
144
- SlotTaken with `code: 'slot-taken'`), `cancel()`, `mail` {send, compose, mailReady}, `time` helpers and
145
- `timeZone()` - so an extension never imports Booking's files. Without an extension every service is plain; existing
146
- bookings keep blocking what they hold.
147
-
148
- ## Emails
149
-
150
- Customer: confirmation (setting), moved, cancelled, reminder (`reminderHours` before; not for a booking made inside
151
- that window - its confirmation was the reminder), with "Change or cancel" while `customerMayChange`. Owner copy: the
152
- booked person's email, else `notifyAddress`, else the site's. Staff changes email the customer only when the
153
- admin's "email the customer" box is ticked (`notify`). Reminders: a 5-minute `setInterval` (unref'd, cleared on
154
- close) - no engine scheduler exists. Without SMTP nothing is sent; the settings slideover says so.
155
-
156
- ## Permissions
157
-
158
- `booking` (read = see, manage = change), granted to admin; admins give it to other roles in Users & Roles. The
159
- contact and email "Book…" actions carry `permission: {resource: 'booking', action: 'manage'}`, so core shows them
160
- only to roles that hold it.
161
-
162
- ## Gotchas
163
-
164
- - Add `return reply.send(...)` / return a value in every async route (compressed responses come back empty).
165
- - `siteBase()` is `site.baseUrl` or '' - NEVER a request's Host (1.6.3): without a Site URL emails go out with no
166
- links and the log warns once. Before, a booker with a chosen Host header got the owner an email whose "Start the
167
- call" button went to their domain carrying the host key. tests/api.test.js sets `baseUrl` in config/site.json for
168
- the run (restored after) and forges a Host to prove it.
169
- - The API tests create contacts in domma-cms's `content/collections/contacts-contacts/data.json` (tracked) - they
170
- snapshot and restore it; a crashed run can leave it changed: `git checkout` it in domma-cms.
171
-
172
- ## 1.6.4 (2026-10-13 Tool sweep, upgrades)
173
- - The Diary is domma-reactive end to end: heads, hour gutter and columns are keyed `data-each` lists (`HEAD`, `HOUR`,
174
- `COL` in diary.js; each column's open bands and blocks are `{{#each}}` inside it). One `draw` effect works out every
175
- measure as a CSS length (`blockRow`) and the markup only binds; the empty state, "add a service" tip and first-run
176
- checklist (`STEP`) are bound too. Kebab / right-click / Shift+F10 still come from `wireRows(gridBox, {match: '.bk-block'})`
177
- (delegated, so re-rendered blocks need no rewiring). `mergeWindows` moved to admin/lib/diary-layout.js (tested).
178
- - Settings > Closed days (`CLOSURE_ROW`) and a person's opening hours / days off (`DAY_ROW` with a nested
179
- `{{#each windows}}`, `OFF_ROW`) are keyed lists of per-field observables; `hoursOut` / `daysOffOut` / `closuresOut`
180
- turn them back into plain data for the dirty snapshot and the save. A "from" after the "to" still pulls "to" along.
181
- - Icons in rows added after binding are drawn by `I.scan` after a flush (`rescan`), because new rows arrive after
182
- the panel's first scan.
183
-
184
- ## 1.7.0 (2026-10-15 Tool Upgrade, second pass)
185
-
186
- - Slideovers: `openPanel({ctx, release, draft})` - the panel goes with the screen (`ctx.hold`), `claim(key)` stops it
187
- opening twice (released if building the panel throws - it is built inside try/catch), and `methods.save` is locked
188
- while it runs. `draft: {key, label, kind, values, apply(values, panel), was, prefilled, initial}` keeps typed work
189
- per user (`booking.drafts.<user>`, 14 days, rules in `admin/lib/drafts.js`, tests/admin-drafts.test.js); `was` is
190
- `updatedAt`, or `fingerprint()` for settings; a draft taken "as new" from a deleted record starts with `was: ''` and
191
- waits while another new-record draft exists. `ask()` is an E.confirm that answers 'no' when the screen goes.
192
- - Restore questions put Discard on the CONFIRM button: Escape, the backdrop or leaving keep the draft (Domma's confirm
193
- cannot tell Escape from Cancel). Booking Pro's sections are not drafted - the section contract cannot put values back.
194
- - First loads use core skeletons through `kit.whileLoading` (`.bk-loading-slot`) on the host, Bookings and the Diary.
195
- - No ContextMenu-key handler in wireRows: Windows Chrome opens its own menu on that key too. Shift+F10 only.
196
-
197
- ## 1.7.1
198
-
199
- - **Email (openEmail).** Email actions go through `admin/lib/email.js`: `emailTo()` for menu actions (several people always in Bcc), `routeMailLinks(root)` for visible `mailto:` links. Core's `/admin/js/lib/mail-compose.js` (CMS 1.6.61+) opens Email Pro's compose window when the user has a mailbox there; older cores keep a cleaned, capped `mailto:` (over 1800 chars the addresses are copied instead). Stored addresses are encoded into links, or shown as text when invalid. Never set `location.href = 'mailto:…'` directly.
200
-
201
- ## 1.7.2 - a meta description on every booking page (2026-10-22)
202
- `metaDescription(text, fallback)` in plugin.public.js: the Introduction (index) or the service's description,
203
- else "Book an appointment with <site> online: <services>." / "Book <service> (<length>) with <site> online.";
204
- one line, 160 characters at most. The Introduction's help says search engines show it. Test: `tests/seo.test.js`.