@msm-platform/customer-sdk 0.3.1 → 0.4.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 CHANGED
@@ -4,6 +4,33 @@ All notable changes to `@msm-platform/customer-sdk`. The format follows [Keep a
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.4.0] - 2026-11-20
8
+
9
+ ### Added
10
+
11
+ - Each event type `GET /web/businesses/{businessId}/event-types` returns has `tags`: its partner's tags in the event type's order, the first the most important, each `{ id, slug, name, colour }`. `colour` is a palette name (`red`, `orange`, `amber`, `lime`, `green`, `teal`, `cyan`, `blue`, `indigo`, `purple`, `pink` or `slate`) for a site to style with its own values.
12
+ - Each of an availability item's `resources` in `GET /web/businesses/{businessId}/availability` has `presentedAs`, `{ label, name }`: how the business's staff present the resource on the event. Show `label` before `name`, or `name` alone when `label` is null, in `resources`' order. `label` and `name` are the resource's own (`name` its `displayName`) unless staff set others for the event type, or for the event or its series, which comes first.
13
+ - `GET /web/businesses/{businessId}/availability`, `GET /web/businesses/{businessId}/event-types` and `GET /web/businesses` take a repeatable `tag` query parameter of tag slugs (`tag=yoga&tag=pilates`): availability and event types keep only the event types that carry any of the business's partner's tags with those slugs, combined with the other filters, and the business list keeps the client's partner's businesses with an event type that does. A slug the partner does not have gives an empty result, not an error.
14
+ - `reserveCandidate` and `confirmReservation` can answer 403 `BookingBanned` when the business's no-show ban policy bars the customer from booking online, with `bannedUntil`, the date-time the ban ends, in the error body (`BookingBannedErrorResponse`). Staff can still book the customer.
15
+
16
+ ### Changed
17
+
18
+ - A tag's `colour` in an event type's `tags` is now per business: the colour the event type's business shows the tag in, its own when it set one and the partner's otherwise. Two businesses of one partner can show the same tag in different colours.
19
+
20
+ ### Removed
21
+
22
+ - **Breaking:** an event type's `categoryId` in `GET /web/businesses/{businessId}/event-types` is gone, with the platform's global categories; its `tags` replace it.
23
+
24
+ ## [0.3.2] - 2026-11-20
25
+
26
+ ### Added
27
+
28
+ - Each item `GET /web/businesses/{businessId}/availability` returns has `resources`: the event's resources in its order, or a slot's resource when the query names one (empty otherwise), each `{ id, displayName, person }`. `person` is true for a resource linked to staff, such as an instructor, and false for a place, such as a room. An event can now have several resources: its first person is its instructor, its places are its room, and its other people are guest instructors.
29
+
30
+ ### Changed
31
+
32
+ - An event's `resource` in `GET /web/businesses/{businessId}/availability` is now its first resource, the first of `resources`, instead of null; a slot's is unchanged.
33
+
7
34
  ## [0.3.1] - 2026-11-16
8
35
 
9
36
  ### Added
package/README.md CHANGED
@@ -146,4 +146,4 @@ To run it against a local engine, see the example's README.
146
146
 
147
147
  ## Inside msm-platform
148
148
 
149
- `pnpm generate` writes `src/generated/api.ts` from the customer contract, `contracts/openapi/customer.json`, and `pnpm generate:check` fails when it is stale. Never edit it by hand. Publishing is manual and only Daníel does it: [docs/runbooks/customer-sdk.md](../../docs/runbooks/customer-sdk.md). Every changelog entry says its `Web impact:` on this package's users.
149
+ `pnpm generate` writes `src/generated/api.ts` from the customer contract, `contracts/openapi/customer.json`, and `pnpm generate:check` fails when it is stale. Never edit it by hand. Publishing is manual and only Daníel does it: [docs/runbooks/customer-sdk.md](../../docs/runbooks/customer-sdk.md). A pull request that changes this package or the customer contract adds an entry to its `CHANGELOG.md`, or says `Web impact: none` in its description.
@@ -6,7 +6,7 @@ export interface paths {
6
6
  path?: never;
7
7
  cookie?: never;
8
8
  };
9
- /** List the calling client's partner's public businesses */
9
+ /** List the calling client's partner's public businesses, only those with a live event type with any of the tags when `tag` is given */
10
10
  get: operations["listPublicBusinesses"];
11
11
  put?: never;
12
12
  post?: never;
@@ -91,7 +91,7 @@ export interface paths {
91
91
  path?: never;
92
92
  cookie?: never;
93
93
  };
94
- /** List public event types */
94
+ /** List a public business's event types, only those with any of the tags when `tag` is given */
95
95
  get: operations["listPublicEventTypes"];
96
96
  put?: never;
97
97
  post?: never;
@@ -110,7 +110,7 @@ export interface paths {
110
110
  };
111
111
  get?: never;
112
112
  put?: never;
113
- /** Hold a booking candidate for yourself for the platform hold duration: a seat in a scheduled event (409 EventFull when none is free) or an open time slot (422 NotATimeSlot, 409 SlotTaken). A customer holds at most 5 active reservations at once across the businesses this client reaches (409 ReservationLimitReached) */
113
+ /** Hold a booking candidate for yourself for the platform hold duration: a seat in a scheduled event (409 EventFull when none is free) or an open time slot (422 NotATimeSlot, 409 SlotTaken). A customer holds at most 5 active reservations at once across the businesses this client reaches (409 ReservationLimitReached). A customer the business's no-show ban policy bans is 403 BookingBanned with `bannedUntil` */
114
114
  post: operations["reserveCandidate"];
115
115
  delete?: never;
116
116
  options?: never;
@@ -127,7 +127,7 @@ export interface paths {
127
127
  };
128
128
  get?: never;
129
129
  put?: never;
130
- /** Confirm your own reservation into exactly one booking, spending one pass credit when a pass covers the event type; a retry returns the same booking, 409 ReservationExpired after its deadline, 403 NotAuthorized without access at the event's start or when the passes for an event type that requires access have run out of credits */
130
+ /** Confirm your own reservation into exactly one booking, spending one pass credit when a pass covers the event type; a retry returns the same booking, 409 ReservationExpired after its deadline, 403 NotAuthorized without access at the event's start or when the passes for an event type that requires access have run out of credits, 403 BookingBanned with `bannedUntil` when the business's no-show ban policy bans you */
131
131
  post: operations["confirmReservation"];
132
132
  delete?: never;
133
133
  options?: never;
@@ -293,6 +293,12 @@ export interface paths {
293
293
  export type webhooks = Record<string, never>;
294
294
  export interface components {
295
295
  schemas: {
296
+ BookingBannedErrorResponse: {
297
+ /** Format: date-time */
298
+ bannedUntil?: string;
299
+ code: string;
300
+ message: string;
301
+ };
296
302
  ErrorResponse: {
297
303
  code: string;
298
304
  message: string;
@@ -319,6 +325,8 @@ export interface operations {
319
325
  query?: {
320
326
  cursor?: string;
321
327
  limit?: number;
328
+ /** @description Tag slugs, repeated as tag=yoga&tag=pilates: only event types that carry any of the partner's tags with these slugs. A slug the partner does not have matches nothing */
329
+ tag?: string[];
322
330
  };
323
331
  header?: never;
324
332
  path?: never;
@@ -572,6 +580,8 @@ export interface operations {
572
580
  eventTypeId?: string;
573
581
  from?: string;
574
582
  resourceId?: string;
583
+ /** @description Tag slugs, repeated as tag=yoga&tag=pilates: only event types that carry any of the partner's tags with these slugs. A slug the partner does not have matches nothing */
584
+ tag?: string[];
575
585
  to?: string;
576
586
  };
577
587
  header?: never;
@@ -605,6 +615,16 @@ export interface operations {
605
615
  /** Format: uuid */
606
616
  id: string;
607
617
  } | null;
618
+ resources: {
619
+ displayName: string;
620
+ /** Format: uuid */
621
+ id: string;
622
+ person: boolean;
623
+ presentedAs: {
624
+ label: string | null;
625
+ name: string;
626
+ };
627
+ }[];
608
628
  seatsLeft: number;
609
629
  /** Format: date-time */
610
630
  startsAt: string;
@@ -1031,7 +1051,10 @@ export interface operations {
1031
1051
  };
1032
1052
  listPublicEventTypes: {
1033
1053
  parameters: {
1034
- query?: never;
1054
+ query?: {
1055
+ /** @description Tag slugs, repeated as tag=yoga&tag=pilates: only event types that carry any of the partner's tags with these slugs. A slug the partner does not have matches nothing */
1056
+ tag?: string[];
1057
+ };
1035
1058
  header?: never;
1036
1059
  path: {
1037
1060
  businessId: string;
@@ -1049,8 +1072,6 @@ export interface operations {
1049
1072
  "application/json": {
1050
1073
  items: {
1051
1074
  cancellationCutoffMinutes: number | null;
1052
- /** Format: uuid */
1053
- categoryId: string | null;
1054
1075
  description: string | null;
1055
1076
  displayName: string;
1056
1077
  durationMinutes: number;
@@ -1089,6 +1110,18 @@ export interface operations {
1089
1110
  width: number;
1090
1111
  } | null;
1091
1112
  }[];
1113
+ tags: {
1114
+ /**
1115
+ * @description The palette name the event type's business shows the tag in: its own colour for the tag when it set one, else the partner's
1116
+ * @enum {string}
1117
+ */
1118
+ colour: "red" | "orange" | "amber" | "lime" | "green" | "teal" | "cyan" | "blue" | "indigo" | "purple" | "pink" | "slate";
1119
+ /** Format: uuid */
1120
+ id: string;
1121
+ name: string;
1122
+ /** @description Lower-case letters and digits in words joined by single hyphens; unique within the partner */
1123
+ slug: string;
1124
+ }[];
1092
1125
  timeSlotBooking: boolean;
1093
1126
  }[];
1094
1127
  };
@@ -1252,7 +1285,8 @@ export interface operations {
1252
1285
  };
1253
1286
  };
1254
1287
  /**
1255
- * @description - `NotAuthorized`: The actor is not permitted to perform this operation
1288
+ * @description - `BookingBanned`: The customer's no-shows at the business ban them from booking online until `bannedUntil`; staff can still book them
1289
+ * - `NotAuthorized`: The actor is not permitted to perform this operation
1256
1290
  * - `OutsideClientScope`: The application client serves only its own partner's businesses
1257
1291
  */
1258
1292
  403: {
@@ -1260,9 +1294,9 @@ export interface operations {
1260
1294
  [name: string]: unknown;
1261
1295
  };
1262
1296
  content: {
1263
- "application/json": components["schemas"]["ErrorResponse"] & {
1297
+ "application/json": components["schemas"]["BookingBannedErrorResponse"] & {
1264
1298
  /** @enum {string} */
1265
- code: "NotAuthorized" | "OutsideClientScope";
1299
+ code: "BookingBanned" | "NotAuthorized" | "OutsideClientScope";
1266
1300
  };
1267
1301
  };
1268
1302
  };
@@ -1444,7 +1478,8 @@ export interface operations {
1444
1478
  };
1445
1479
  };
1446
1480
  /**
1447
- * @description - `NotAuthorized`: The actor is not permitted to perform this operation
1481
+ * @description - `BookingBanned`: The customer's no-shows at the business ban them from booking online until `bannedUntil`; staff can still book them
1482
+ * - `NotAuthorized`: The actor is not permitted to perform this operation
1448
1483
  * - `OutsideClientScope`: The application client serves only its own partner's businesses
1449
1484
  */
1450
1485
  403: {
@@ -1452,9 +1487,9 @@ export interface operations {
1452
1487
  [name: string]: unknown;
1453
1488
  };
1454
1489
  content: {
1455
- "application/json": components["schemas"]["ErrorResponse"] & {
1490
+ "application/json": components["schemas"]["BookingBannedErrorResponse"] & {
1456
1491
  /** @enum {string} */
1457
- code: "NotAuthorized" | "OutsideClientScope";
1492
+ code: "BookingBanned" | "NotAuthorized" | "OutsideClientScope";
1458
1493
  };
1459
1494
  };
1460
1495
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@msm-platform/customer-sdk",
3
- "version": "0.3.1",
3
+ "version": "0.4.0",
4
4
  "description": "Typed server-side client for MSM's customer API (/web)",
5
5
  "license": "MIT",
6
6
  "repository": {