@zimmerstack/connect 0.4.1 → 0.6.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.
@@ -27,8 +27,10 @@ export function findOperation(input) {
27
27
  if (!wanted)
28
28
  return undefined;
29
29
  if (/^zs\./.test(wanted)) {
30
+ // A method has one first name and may have others (zs.ratePlans.delete, zs.catalog.deleteRatePlan): either finds it.
30
31
  const call = wanted.split("(")[0];
31
- return REFERENCE.operations.find((op) => op.call.split("(")[0] === call);
32
+ const named = (text) => text.split("(")[0] === call;
33
+ return REFERENCE.operations.find((op) => named(op.call)) ?? REFERENCE.operations.find((op) => op.also.some(named));
32
34
  }
33
35
  const [first = "", second] = wanted.split(" ");
34
36
  if (second !== undefined)
@@ -41,6 +43,7 @@ export function describeOperation(op) {
41
43
  `${op.key}: ${op.summary}`,
42
44
  "",
43
45
  `With the package: ${op.call}`,
46
+ ...(op.also.length ? [`Also: ${op.also.join(", ")}`] : []),
44
47
  `Scope: ${op.scope ?? "none (every key may call it)"}`,
45
48
  op.key.startsWith("GET ")
46
49
  ? "A read: safe to repeat."
@@ -106,7 +109,7 @@ export function searchReference(query) {
106
109
  if (words.length === 0)
107
110
  return referenceIndex();
108
111
  const entries = [
109
- ...REFERENCE.operations.map((op) => ({ label: `${op.key}: ${op.summary}`, open: `operation: "${op.key}"`, text: [op.key, op.summary, op.description, op.call, op.scope ?? "", REFERENCE.types[op.body ?? ""] ?? op.body ?? "", ...op.refusals.map((r) => r.description), ...op.query.map((q) => `${q.name} ${q.description}`)].join(" ") })),
112
+ ...REFERENCE.operations.map((op) => ({ label: `${op.key}: ${op.summary}`, open: `operation: "${op.key}"`, text: [op.key, op.summary, op.description, op.call, ...op.also, op.scope ?? "", REFERENCE.types[op.body ?? ""] ?? op.body ?? "", ...op.refusals.map((r) => r.description), ...op.query.map((q) => `${q.name} ${q.description}`)].join(" ") })),
110
113
  ...Object.entries(REFERENCE.topics).map(([name, text]) => ({ label: `topic ${name}`, open: `topic: "${name}"`, text: `${name} ${text}` })),
111
114
  ...Object.entries(REFERENCE.types).map(([name, text]) => ({ label: `type ${name}`, open: `type: "${name}"`, text: `${name} ${text}` })),
112
115
  ];
@@ -6,13 +6,19 @@ import type { ChannelBooking } from "./generated.js";
6
6
  /** An OTA booking arrived, changed or was cancelled (through the channel manager). */
7
7
  export declare const OTA_BOOKING_EVENT_TYPES: readonly ["channel.booking.created", "channel.booking.modified", "channel.booking.cancelled"];
8
8
  /**
9
- * A guest booked, or cancelled, on the hotel's own website through ZimmerStack's booking engine. The same
10
- * booking object as the OTA events, in a family of its own: an endpoint receives these only when it lists
11
- * the two types. There is no modified event.
9
+ * A booking on the hotel's own website through ZimmerStack's booking engine: the guest booked, the hotel
10
+ * recorded that the guest did not arrive (or undid that), or the booking was cancelled. The same booking
11
+ * object as the OTA events, in a family of its own: an endpoint receives each of these only when it lists
12
+ * that type.
13
+ *
14
+ * `direct.booking.modified` (from 0.6.0; the API sends it since 21 Nov 2026) is a no-show and its undo.
15
+ * The booking is not cancelled: `status` stays CONFIRMED and the payment is untouched. Read
16
+ * `data.booking.stayStatus`: NOSHOW means the nights are on sale again (free the room), UPCOMING again
17
+ * means the no-show was undone (hold the room). Nothing else sends it yet.
12
18
  */
13
- export declare const WEBSITE_BOOKING_EVENT_TYPES: readonly ["direct.booking.created", "direct.booking.cancelled"];
19
+ export declare const WEBSITE_BOOKING_EVENT_TYPES: readonly ["direct.booking.created", "direct.booking.modified", "direct.booking.cancelled"];
14
20
  /** Every event whose `data.booking` is a booking, of either family. */
15
- export declare const BOOKING_EVENT_TYPES: readonly ["channel.booking.created", "channel.booking.modified", "channel.booking.cancelled", "direct.booking.created", "direct.booking.cancelled"];
21
+ export declare const BOOKING_EVENT_TYPES: readonly ["channel.booking.created", "channel.booking.modified", "channel.booking.cancelled", "direct.booking.created", "direct.booking.modified", "direct.booking.cancelled"];
16
22
  export type OtaBookingEventType = (typeof OTA_BOOKING_EVENT_TYPES)[number];
17
23
  export type WebsiteBookingEventType = (typeof WEBSITE_BOOKING_EVENT_TYPES)[number];
18
24
  export type BookingEventType = (typeof BOOKING_EVENT_TYPES)[number];
@@ -24,7 +30,7 @@ export interface WebhookEvent {
24
30
  id: string;
25
31
  /**
26
32
  * channel.booking.created · channel.booking.modified · channel.booking.cancelled (an OTA booking) ·
27
- * direct.booking.created · direct.booking.cancelled (a booking on the hotel's own website) ·
33
+ * direct.booking.created · direct.booking.modified · direct.booking.cancelled (a booking on the hotel's own website) ·
28
34
  * channel.sync.* · zimmerstack.ping. Narrow it with `isOtaBookingEvent` and `isWebsiteBookingEvent`.
29
35
  */
30
36
  type: string;
@@ -43,9 +49,9 @@ export interface WebhookEvent {
43
49
  booking?: ChannelBooking;
44
50
  [key: string]: unknown;
45
51
  };
46
- /** Dotted paths that changed, on a modification ("stay.checkOut"). */
52
+ /** Dotted paths that changed, on a modification ("stay.checkOut"; on a website booking's no-show, "stayStatus" and "rooms[0].status"). */
47
53
  changes?: string[] | null;
48
- /** What those fields held before, on a modification. */
54
+ /** What those fields held before, on a modification. A website booking's carries `stayStatus` too. */
49
55
  previous?: Record<string, unknown> | null;
50
56
  truncated?: boolean;
51
57
  }
@@ -57,7 +63,10 @@ export type BookingEvent = WebhookEvent & {
57
63
  [key: string]: unknown;
58
64
  };
59
65
  };
60
- /** A booking a guest made on the hotel's own website. `finance` is null and `changes` and `previous` always are. */
66
+ /**
67
+ * A booking a guest made on the hotel's own website. `finance` is always null; `changes` and `previous`
68
+ * are set on `direct.booking.modified` (a no-show, or its undo) and null on the other two.
69
+ */
61
70
  export type WebsiteBookingEvent = BookingEvent & {
62
71
  type: WebsiteBookingEventType;
63
72
  };
@@ -66,8 +75,9 @@ export type OtaBookingEvent = BookingEvent & {
66
75
  type: OtaBookingEventType;
67
76
  };
68
77
  /**
69
- * True for `direct.booking.created` and `direct.booking.cancelled`: a booking made on the hotel's own
70
- * website. A PMS that pushes room counts must put it in its own calendar before its next push.
78
+ * True for `direct.booking.created`, `direct.booking.modified` and `direct.booking.cancelled`: a booking
79
+ * made on the hotel's own website. A PMS that pushes room counts must put it in its own calendar before its
80
+ * next push, and give the nights back when the booking is cancelled or reads `stayStatus` NOSHOW.
71
81
  */
72
82
  export declare function isWebsiteBookingEvent(event: WebhookEvent): event is WebsiteBookingEvent;
73
83
  /** True for `channel.booking.created`, `.modified` and `.cancelled`: a booking an OTA sent. */
@@ -5,17 +5,24 @@
5
5
  /** An OTA booking arrived, changed or was cancelled (through the channel manager). */
6
6
  export const OTA_BOOKING_EVENT_TYPES = ["channel.booking.created", "channel.booking.modified", "channel.booking.cancelled"];
7
7
  /**
8
- * A guest booked, or cancelled, on the hotel's own website through ZimmerStack's booking engine. The same
9
- * booking object as the OTA events, in a family of its own: an endpoint receives these only when it lists
10
- * the two types. There is no modified event.
8
+ * A booking on the hotel's own website through ZimmerStack's booking engine: the guest booked, the hotel
9
+ * recorded that the guest did not arrive (or undid that), or the booking was cancelled. The same booking
10
+ * object as the OTA events, in a family of its own: an endpoint receives each of these only when it lists
11
+ * that type.
12
+ *
13
+ * `direct.booking.modified` (from 0.6.0; the API sends it since 21 Nov 2026) is a no-show and its undo.
14
+ * The booking is not cancelled: `status` stays CONFIRMED and the payment is untouched. Read
15
+ * `data.booking.stayStatus`: NOSHOW means the nights are on sale again (free the room), UPCOMING again
16
+ * means the no-show was undone (hold the room). Nothing else sends it yet.
11
17
  */
12
- export const WEBSITE_BOOKING_EVENT_TYPES = ["direct.booking.created", "direct.booking.cancelled"];
18
+ export const WEBSITE_BOOKING_EVENT_TYPES = ["direct.booking.created", "direct.booking.modified", "direct.booking.cancelled"];
13
19
  /** Every event whose `data.booking` is a booking, of either family. */
14
20
  export const BOOKING_EVENT_TYPES = [...OTA_BOOKING_EVENT_TYPES, ...WEBSITE_BOOKING_EVENT_TYPES];
15
21
  const isType = (list, event) => typeof event?.type === "string" && list.includes(event.type);
16
22
  /**
17
- * True for `direct.booking.created` and `direct.booking.cancelled`: a booking made on the hotel's own
18
- * website. A PMS that pushes room counts must put it in its own calendar before its next push.
23
+ * True for `direct.booking.created`, `direct.booking.modified` and `direct.booking.cancelled`: a booking
24
+ * made on the hotel's own website. A PMS that pushes room counts must put it in its own calendar before its
25
+ * next push, and give the nights back when the booking is cancelled or reads `stayStatus` NOSHOW.
19
26
  */
20
27
  export function isWebsiteBookingEvent(event) {
21
28
  return isType(WEBSITE_BOOKING_EVENT_TYPES, event) && Boolean(event.data?.booking);
package/package.json CHANGED
@@ -1,20 +1,37 @@
1
1
  {
2
2
  "name": "@zimmerstack/connect",
3
- "version": "0.4.1",
4
- "description": "Official Node.js client for the ZimmerStack Connect API: rates, availability, stay rules, prices per channel and bookings, with pacing, safe retries and idempotency built in. Ships an MCP server for coding agents.",
3
+ "version": "0.6.0",
4
+ "description": "Add a channel manager to your hotel software: send rooms and prices to Booking.com, Airbnb, Expedia and other booking sites, and receive their bookings. The official ZimmerStack Connect API client for Node.js, with safe retries and pacing built in and an MCP server for AI coding agents.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://docs.zimmerstack.com/sdk",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/zimmerstack/connect-node.git"
10
+ },
11
+ "bugs": {
12
+ "url": "https://github.com/zimmerstack/connect-node/issues",
13
+ "email": "support@zimmerstack.com"
14
+ },
7
15
  "keywords": [
8
16
  "zimmerstack",
9
17
  "channel-manager",
18
+ "channel-manager-api",
10
19
  "hotel",
20
+ "vacation-rental",
11
21
  "pms",
22
+ "property-management",
12
23
  "ota",
24
+ "booking.com",
25
+ "airbnb",
26
+ "expedia",
13
27
  "rates",
14
28
  "availability",
29
+ "webhooks",
15
30
  "sdk",
31
+ "typescript",
16
32
  "mcp",
17
- "model-context-protocol"
33
+ "model-context-protocol",
34
+ "ai-agents"
18
35
  ],
19
36
  "type": "module",
20
37
  "sideEffects": false,