@semics-tech/emdash-events 0.0.0-bootstrap.0 → 1.0.0-rc.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 (50) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +82 -2
  3. package/dist/index.d.mts +5 -0
  4. package/dist/index.mjs +392 -0
  5. package/dist/manifest.json +401 -0
  6. package/dist/plugin.d.mts +11 -0
  7. package/dist/plugin.mjs +7 -0
  8. package/dist/ts/astro/lib/call.d.ts +54 -0
  9. package/dist/ts/astro/lib/call.js +121 -0
  10. package/dist/ts/integration/index.d.ts +48 -0
  11. package/dist/ts/integration/index.js +76 -0
  12. package/dist/ts/ui/index.d.ts +6 -0
  13. package/dist/ts/ui/index.js +46 -0
  14. package/emdash-plugin.jsonc +206 -0
  15. package/package.json +79 -10
  16. package/src/astro/AddToCalendar.astro +47 -0
  17. package/src/astro/BookingBlock.astro +30 -0
  18. package/src/astro/BookingPage.astro +193 -0
  19. package/src/astro/BookingStatus.astro +106 -0
  20. package/src/astro/BookingWidget.astro +581 -0
  21. package/src/astro/CheckIn.astro +186 -0
  22. package/src/astro/DoorSignPage.astro +62 -0
  23. package/src/astro/EventCard.astro +81 -0
  24. package/src/astro/EventList.astro +83 -0
  25. package/src/astro/OptOutPage.astro +58 -0
  26. package/src/astro/PaymentReturn.astro +96 -0
  27. package/src/astro/TicketPass.astro +95 -0
  28. package/src/astro/checkout-endpoint.ts +11 -0
  29. package/src/astro/index.js +18 -0
  30. package/src/astro/lib/call.ts +185 -0
  31. package/src/astro/lib/checkout-form.ts +271 -0
  32. package/src/astro/lib/list.ts +99 -0
  33. package/src/astro/lib/opt-out.ts +49 -0
  34. package/src/astro/lib/pass.ts +35 -0
  35. package/src/astro/lib/payment.ts +73 -0
  36. package/src/astro/lib/promo.ts +162 -0
  37. package/src/astro/lib/questions.ts +107 -0
  38. package/src/astro/lib/receipt.ts +132 -0
  39. package/src/astro/lib/waitlist.ts +72 -0
  40. package/src/astro/lib/widget.ts +278 -0
  41. package/src/astro/promo-endpoint.ts +11 -0
  42. package/src/astro/virtual.d.ts +16 -0
  43. package/src/astro/waitlist-endpoint.ts +12 -0
  44. package/src/client/booking.ts +188 -0
  45. package/src/client/checkin.ts +260 -0
  46. package/src/client/payment.ts +76 -0
  47. package/src/client/receipt.ts +75 -0
  48. package/src/i18n/ar.ts +213 -0
  49. package/src/i18n/en.ts +219 -0
  50. package/src/i18n/index.ts +121 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 semics
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,83 @@
1
- # @semics-tech/emdash-events
1
+ # semics Events
2
2
 
3
- Placeholder; no code. See https://github.com/semics-uk/emdash-plugins.
3
+ Event bookings and ticketing for [EmDash CMS](https://emdashcms.com): events from your own collection,
4
+ ticket types, capacity, holds, a booking page, confirmation emails, calendar files, a waitlist, recurring
5
+ events and check-in. MIT licensed.
6
+
7
+ The package holds the sandboxed core `semics-events` (its default export) and the UI kit (`/ui`,
8
+ `/integration`, and the Astro components under `/astro/*.astro`).
9
+
10
+ **Documentation** (in `apps/docs/pages` of the repository):
11
+ [install](https://github.com/semics-uk/emdash-plugins/blob/main/apps/docs/pages/install.md),
12
+ [configure](https://github.com/semics-uk/emdash-plugins/blob/main/apps/docs/pages/configure.md), the
13
+ [Events guide](https://github.com/semics-uk/emdash-plugins/blob/main/apps/docs/pages/events.md),
14
+ [pages and components](https://github.com/semics-uk/emdash-plugins/blob/main/apps/docs/pages/site-pages.md),
15
+ [data and retention](https://github.com/semics-uk/emdash-plugins/blob/main/apps/docs/pages/privacy.md).
16
+
17
+ ## Install
18
+
19
+ ```sh
20
+ pnpm add @semics-tech/emdash-events @emdash-cms/sandbox-workerd
21
+ ```
22
+
23
+ ```js
24
+ // astro.config.mjs
25
+ import semicsEvents from "@semics-tech/emdash-events";
26
+ import { eventsIntegration } from "@semics-tech/emdash-events/integration";
27
+ import { eventsUi } from "@semics-tech/emdash-events/ui";
28
+ import { defineConfig } from "astro/config";
29
+ import emdash from "emdash/astro";
30
+
31
+ export default defineConfig({
32
+ output: "server",
33
+ integrations: [
34
+ eventsIntegration(),
35
+ emdash({
36
+ siteUrl: "https://events.example.com",
37
+ sandboxRunner: "@emdash-cms/sandbox-workerd/sandbox",
38
+ sandboxed: [semicsEvents],
39
+ plugins: [eventsUi()],
40
+ }),
41
+ ],
42
+ });
43
+ ```
44
+
45
+ With E-sign on the same site, use `@semics-tech/emdash-events-suite` instead.
46
+
47
+ ## Develop
48
+
49
+ ```sh
50
+ pnpm install
51
+ pnpm run validate
52
+ pnpm run typecheck
53
+ pnpm run test
54
+ pnpm run build
55
+ ```
56
+
57
+ `pnpm run test` builds the plugin and runs its tests through Worker Loader using EmDash's production sandbox
58
+ wrapper and host bridge. To try it on a site, run `pnpm run dev` here (rebuilds on save) and link this folder
59
+ into the site.
60
+
61
+ ## Publish
62
+
63
+ ```sh
64
+ pnpm run login -- alice.example.com
65
+ pnpm run publish # builds and uploads artifacts to your PDS
66
+ ```
67
+
68
+ To publish from GitHub Actions, run `pnpm run release:setup`. The command creates one shared workflow at the
69
+ Git repository root.
70
+
71
+ The registry listing (name, keywords, the description, installation, FAQ and security sections, icon, banner
72
+ and screenshots) is declared in `emdash-plugin.jsonc` and kept in `listing/`. The images are made by the
73
+ playground's `e2e/t103-screenshots.spec.ts`.
74
+
75
+ ## Version bumps
76
+
77
+ Bump `version` in `package.json` when you ship a release. The scaffold's `emdash-plugin.jsonc` deliberately
78
+ omits `version`: the build reads it from `package.json` so there's a single source of truth. **Bump major** for
79
+ breaking changes, **bump minor** for new routes or hooks, **bump patch** for fixes.
80
+
81
+ You MUST bump version whenever you change `capabilities`, `allowedHosts`, or `storage` in the manifest.
82
+ Installed users have consented to the old trust contract; a change without a version bump would let new
83
+ behaviour slip past consent.
@@ -0,0 +1,5 @@
1
+ // Auto-generated by emdash-plugin build. Do not edit.
2
+ import type { PluginDescriptor } from "emdash";
3
+
4
+ declare const descriptor: PluginDescriptor;
5
+ export default descriptor;
package/dist/index.mjs ADDED
@@ -0,0 +1,392 @@
1
+ // Auto-generated by emdash-plugin build. Do not edit.
2
+ // Source: emdash-plugin.jsonc + package.json
3
+ //
4
+ // Default-exports a sandboxed plugin descriptor. Pass it directly into
5
+ // emdash's `plugins:` or `sandboxed:` array — no factory call needed.
6
+
7
+ /** @type {import("emdash").PluginDescriptor} */
8
+ const descriptor = Object.freeze({
9
+ "id": "semics-events",
10
+ "version": "1.0.0-rc.0",
11
+ "format": "standard",
12
+ "entrypoint": "@semics-tech/emdash-events/sandbox",
13
+ "capabilities": [
14
+ "content:read",
15
+ "schema:read",
16
+ "network:request",
17
+ "email:send"
18
+ ],
19
+ "allowedHosts": [
20
+ "challenges.cloudflare.com"
21
+ ],
22
+ "storage": {
23
+ "event_configs": {
24
+ "indexes": [
25
+ "status",
26
+ "salesEnd"
27
+ ]
28
+ },
29
+ "occurrences": {
30
+ "indexes": [
31
+ [
32
+ "eventId",
33
+ "startsAt"
34
+ ],
35
+ "startsAt",
36
+ "status"
37
+ ]
38
+ },
39
+ "ticket_types": {
40
+ "indexes": [
41
+ "eventId"
42
+ ]
43
+ },
44
+ "bookings": {
45
+ "indexes": [
46
+ "eventId",
47
+ "status",
48
+ "email",
49
+ "createdAt",
50
+ [
51
+ "status",
52
+ "holdExpiresAt"
53
+ ],
54
+ [
55
+ "eventId",
56
+ "status"
57
+ ],
58
+ [
59
+ "ipHash",
60
+ "createdAt"
61
+ ]
62
+ ],
63
+ "uniqueIndexes": [
64
+ "ref"
65
+ ]
66
+ },
67
+ "payments": {
68
+ "indexes": [
69
+ "bookingId"
70
+ ]
71
+ },
72
+ "attendees": {
73
+ "indexes": [
74
+ "bookingId",
75
+ "eventId",
76
+ "email",
77
+ [
78
+ "eventId",
79
+ "checkedInAt"
80
+ ]
81
+ ],
82
+ "uniqueIndexes": [
83
+ "code"
84
+ ]
85
+ },
86
+ "waitlist": {
87
+ "indexes": [
88
+ [
89
+ "eventId",
90
+ "status"
91
+ ],
92
+ "offerExpiresAt",
93
+ "email"
94
+ ]
95
+ },
96
+ "promo_codes": {
97
+ "indexes": [
98
+ "eventId"
99
+ ],
100
+ "uniqueIndexes": [
101
+ "code"
102
+ ]
103
+ },
104
+ "outbox": {
105
+ "indexes": [
106
+ [
107
+ "status",
108
+ "nextAttemptAt"
109
+ ],
110
+ "to"
111
+ ]
112
+ }
113
+ },
114
+ "hooks": [
115
+ "plugin:activate",
116
+ "content:afterSave",
117
+ "content:afterPublish",
118
+ "content:afterUnpublish",
119
+ "content:beforeDelete",
120
+ "content:afterDelete",
121
+ "page:metadata",
122
+ "cron"
123
+ ],
124
+ "routes": [
125
+ "config/get",
126
+ "config/save",
127
+ "admin",
128
+ {
129
+ "name": "attendees/export",
130
+ "methods": [
131
+ "GET"
132
+ ],
133
+ "response": "raw"
134
+ },
135
+ "editor/tickets",
136
+ {
137
+ "name": "public/events",
138
+ "methods": [
139
+ "GET"
140
+ ],
141
+ "public": true,
142
+ "cacheControl": "public, max-age=60, stale-while-revalidate=300"
143
+ },
144
+ {
145
+ "name": "public/event",
146
+ "methods": [
147
+ "GET"
148
+ ],
149
+ "public": true
150
+ },
151
+ {
152
+ "name": "public/checkout/reserve",
153
+ "methods": [
154
+ "POST"
155
+ ],
156
+ "public": true
157
+ },
158
+ {
159
+ "name": "public/checkout/continue",
160
+ "methods": [
161
+ "POST"
162
+ ],
163
+ "public": true
164
+ },
165
+ {
166
+ "name": "public/booking",
167
+ "methods": [
168
+ "POST"
169
+ ],
170
+ "public": true
171
+ },
172
+ {
173
+ "name": "public/booking/cancel",
174
+ "methods": [
175
+ "POST"
176
+ ],
177
+ "public": true
178
+ },
179
+ {
180
+ "name": "public/booking/redeem",
181
+ "methods": [
182
+ "POST"
183
+ ],
184
+ "public": true
185
+ },
186
+ {
187
+ "name": "public/booking/ics",
188
+ "methods": [
189
+ "GET"
190
+ ],
191
+ "response": "raw",
192
+ "public": true
193
+ },
194
+ {
195
+ "name": "public/event/ics",
196
+ "methods": [
197
+ "GET"
198
+ ],
199
+ "response": "raw",
200
+ "public": true,
201
+ "cacheControl": "public, max-age=300"
202
+ },
203
+ {
204
+ "name": "public/waitlist/join",
205
+ "methods": [
206
+ "POST"
207
+ ],
208
+ "public": true
209
+ },
210
+ {
211
+ "name": "public/waitlist/claim",
212
+ "methods": [
213
+ "POST"
214
+ ],
215
+ "public": true
216
+ },
217
+ {
218
+ "name": "webhooks/stripe",
219
+ "methods": [
220
+ "POST"
221
+ ],
222
+ "request": {
223
+ "body": "text",
224
+ "headers": [
225
+ "stripe-signature"
226
+ ]
227
+ },
228
+ "response": "raw",
229
+ "public": true
230
+ },
231
+ {
232
+ "name": "signatures/receipt",
233
+ "methods": [
234
+ "POST"
235
+ ],
236
+ "public": true
237
+ }
238
+ ],
239
+ "adminPages": [
240
+ {
241
+ "path": "/bookings",
242
+ "label": "Bookings",
243
+ "icon": "ticket"
244
+ },
245
+ {
246
+ "path": "/attendees",
247
+ "label": "Attendees",
248
+ "icon": "users"
249
+ },
250
+ {
251
+ "path": "/events",
252
+ "label": "Event editor",
253
+ "icon": "calendar"
254
+ },
255
+ {
256
+ "path": "/setup",
257
+ "label": "Setup check",
258
+ "icon": "gear"
259
+ }
260
+ ],
261
+ "adminWidgets": [
262
+ {
263
+ "id": "sales",
264
+ "title": "Ticket sales",
265
+ "size": "half"
266
+ }
267
+ ],
268
+ "settingsSchema": {
269
+ "eventsCollection": {
270
+ "label": "Events collection",
271
+ "description": "Slug of the collection that holds your events.",
272
+ "type": "string",
273
+ "default": "events"
274
+ },
275
+ "fieldStartsAt": {
276
+ "label": "Start field",
277
+ "description": "Field that holds the start date and time.",
278
+ "type": "string",
279
+ "default": "starts_at"
280
+ },
281
+ "fieldEndsAt": {
282
+ "label": "End field",
283
+ "description": "Field that holds the end date and time.",
284
+ "type": "string",
285
+ "default": "ends_at"
286
+ },
287
+ "fieldTimezone": {
288
+ "label": "Timezone field",
289
+ "description": "Field that holds the IANA timezone, for example Europe/London.",
290
+ "type": "string",
291
+ "default": "timezone"
292
+ },
293
+ "fieldVenue": {
294
+ "label": "Venue field",
295
+ "description": "Field that holds the venue name or address.",
296
+ "type": "string",
297
+ "default": "venue"
298
+ },
299
+ "holdMinutesFree": {
300
+ "label": "Hold time, free tickets (minutes)",
301
+ "description": "How long a seat is held while a buyer completes a free checkout.",
302
+ "type": "number",
303
+ "default": 15,
304
+ "min": 5,
305
+ "max": 60
306
+ },
307
+ "holdMinutesPaid": {
308
+ "label": "Hold time, paid tickets (minutes)",
309
+ "description": "How long a seat is held during a paid checkout. Card processors need at least 30 minutes.",
310
+ "type": "number",
311
+ "default": 35,
312
+ "min": 30,
313
+ "max": 60
314
+ },
315
+ "holdCeilingMinutes": {
316
+ "label": "Maximum total hold (minutes)",
317
+ "description": "Each checkout step extends the hold, but never beyond this many minutes from the first hold.",
318
+ "type": "number",
319
+ "default": 60,
320
+ "min": 15,
321
+ "max": 120
322
+ },
323
+ "cancelCutoffHours": {
324
+ "label": "Self-service cancel cutoff (hours before start)",
325
+ "description": "Buyers can cancel a confirmed booking up to this many hours before the event starts.",
326
+ "type": "number",
327
+ "default": 24,
328
+ "min": 0,
329
+ "max": 720
330
+ },
331
+ "currency": {
332
+ "label": "Default currency",
333
+ "description": "Three-letter ISO 4217 code, for example GBP.",
334
+ "type": "string",
335
+ "default": "GBP"
336
+ },
337
+ "turnstileSiteKey": {
338
+ "label": "Turnstile site key",
339
+ "description": "Public site key of your Cloudflare Turnstile widget.",
340
+ "type": "string"
341
+ },
342
+ "turnstileSecretKey": {
343
+ "label": "Turnstile secret key",
344
+ "description": "Secret key used to verify bot checks. Stored encrypted.",
345
+ "type": "secret"
346
+ },
347
+ "esignPairing": {
348
+ "label": "E-sign pairing string",
349
+ "description": "Pairing string from the e-sign plugin, for events that require signed waivers. Stored encrypted.",
350
+ "type": "secret"
351
+ },
352
+ "licenceKey": {
353
+ "label": "Licence key (Pro)",
354
+ "description": "Used by Events Pro only; the Free edition ignores it. Stored encrypted.",
355
+ "type": "secret"
356
+ },
357
+ "stripeSecretKey": {
358
+ "label": "Stripe secret key (Pro)",
359
+ "description": "Used by Events Pro only, for paid tickets; the Free edition ignores it. Stored encrypted.",
360
+ "type": "secret"
361
+ },
362
+ "stripeWebhookSecret": {
363
+ "label": "Stripe webhook signing secret (Pro)",
364
+ "description": "Used by Events Pro only, for paid tickets; the Free edition ignores it. Stored encrypted.",
365
+ "type": "secret"
366
+ },
367
+ "retentionDays": {
368
+ "label": "Keep booking data (days)",
369
+ "description": "Personal data of past events is erased after this many days.",
370
+ "type": "number",
371
+ "default": 365,
372
+ "min": 30
373
+ },
374
+ "emailSenderName": {
375
+ "label": "Email sender name",
376
+ "description": "Name shown on booking emails. Defaults to the site name.",
377
+ "type": "string"
378
+ }
379
+ },
380
+ "editorPanels": [
381
+ {
382
+ "id": "tickets",
383
+ "title": "Tickets & booking",
384
+ "route": "editor/tickets",
385
+ "collections": [
386
+ "events"
387
+ ]
388
+ }
389
+ ]
390
+ });
391
+
392
+ export default descriptor;