@zimmerstack/connect 0.5.0 → 0.7.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/AGENTS.md +11 -5
- package/README.md +37 -10
- package/dist/cjs/client.d.ts +4 -4
- package/dist/cjs/client.js +4 -4
- package/dist/cjs/generated.d.ts +95 -7
- package/dist/cjs/generated.js +4 -2
- package/dist/cjs/webhooks.d.ts +21 -11
- package/dist/cjs/webhooks.js +13 -6
- package/dist/esm/client.d.ts +4 -4
- package/dist/esm/client.js +4 -4
- package/dist/esm/generated.d.ts +95 -7
- package/dist/esm/generated.js +4 -2
- package/dist/esm/mcp/reference.generated.js +25 -23
- package/dist/esm/webhooks.d.ts +21 -11
- package/dist/esm/webhooks.js +13 -6
- package/package.json +6 -1
package/dist/esm/webhooks.d.ts
CHANGED
|
@@ -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
|
|
10
|
-
*
|
|
11
|
-
* the
|
|
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
|
-
/**
|
|
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
|
|
70
|
-
* website. A PMS that pushes room counts must put it in its own calendar before its
|
|
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. */
|
package/dist/esm/webhooks.js
CHANGED
|
@@ -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
|
|
9
|
-
*
|
|
10
|
-
* the
|
|
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
|
|
18
|
-
* website. A PMS that pushes room counts must put it in its own calendar before its
|
|
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,10 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zimmerstack/connect",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
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
|
+
},
|
|
7
11
|
"bugs": {
|
|
12
|
+
"url": "https://github.com/zimmerstack/connect-node/issues",
|
|
8
13
|
"email": "support@zimmerstack.com"
|
|
9
14
|
},
|
|
10
15
|
"keywords": [
|