@zimmerstack/connect 0.4.0 → 0.5.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 +52 -0
- package/README.md +336 -154
- package/dist/cjs/client.d.ts +135 -6
- package/dist/cjs/client.js +180 -2
- package/dist/cjs/generated.d.ts +113 -4
- package/dist/cjs/generated.js +14 -3
- package/dist/cjs/index.d.ts +1 -1
- package/dist/esm/client.d.ts +135 -6
- package/dist/esm/client.js +179 -2
- package/dist/esm/generated.d.ts +113 -4
- package/dist/esm/generated.js +14 -3
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/mcp/reference.generated.d.ts +2 -0
- package/dist/esm/mcp/reference.generated.js +223 -8
- package/dist/esm/mcp/reference.js +5 -2
- package/package.json +15 -3
package/AGENTS.md
CHANGED
|
@@ -52,6 +52,57 @@ https://docs.zimmerstack.com/llms-full.txt
|
|
|
52
52
|
- Writes may reach 365 days ahead. A write is accepted (202) when it is in ZimmerStack's record; it
|
|
53
53
|
reaches the channels in seconds to minutes. `zs.sync.get()` says how far along it is.
|
|
54
54
|
|
|
55
|
+
## Room types and rate plans
|
|
56
|
+
|
|
57
|
+
- A hotel sells room types ("Deluxe Room") through rate plans ("Bed and breakfast"). Create or change
|
|
58
|
+
one with `zs.roomTypes.save({ ref, name, roomCount, adults })` and
|
|
59
|
+
`zs.ratePlans.save({ ref, roomTypeRef, name, mealPlan, defaultRate })`. `ref` is the person's own
|
|
60
|
+
id for it: sending the same ref again changes that entity, it never makes a second one. Several in
|
|
61
|
+
one request: `zs.catalog.upsertRoomTypes` and `zs.catalog.upsertRatePlans`. All need the scope
|
|
62
|
+
`catalog:write`.
|
|
63
|
+
- Every later write names ZimmerStack's numeric `id`, not the ref: room counts name a room type's
|
|
64
|
+
id, prices and stay rules name a rate plan's id. `zs.roomTypes.list()` and `zs.ratePlans.list()`
|
|
65
|
+
give them, and so does the answer of each `save`.
|
|
66
|
+
- `zs.roomTypes.delete(idOrRef)` and `zs.ratePlans.delete(idOrRef)` delete for good, and a room
|
|
67
|
+
type takes its rate plans with it. Call them only when a person chose to delete that one entity on
|
|
68
|
+
a screen, after a confirmation that names it. Never from a loop, a sync job, a "reset" or a cleanup
|
|
69
|
+
script, and never to repair a mismatch: send the entity again with `save` instead. A hotel may
|
|
70
|
+
delete 60 entities a day.
|
|
71
|
+
- `CATALOG_CONFLICT` or `CHANNEL_MANAGER_ERROR` on a delete means the hotel still uses it: a
|
|
72
|
+
booking site still sells it, an upcoming stay holds one of its rooms, or rooms are still assigned
|
|
73
|
+
to the room type. Nothing was deleted. Show the message and stop; do not try another way round.
|
|
74
|
+
|
|
75
|
+
## Adding and removing a hotel (a software partner's company key)
|
|
76
|
+
|
|
77
|
+
- Only a COMPANY key with the scope `properties:write` can do either; a hotel's own key cannot
|
|
78
|
+
(`COMPANY_KEY_REQUIRED`). The person ticks "Also add and remove hotels" when making the key in the
|
|
79
|
+
partner portal; only the account's owner or an Admin is offered that tick box. Neither call names a
|
|
80
|
+
hotel with `forProperty`.
|
|
81
|
+
- `zs.properties.create({ name, owner, address, roomTypes })` adds a hotel and answers with its `id`:
|
|
82
|
+
act on it with `zs.forProperty(id)`. The owner gets the sign-in details by email, never the caller.
|
|
83
|
+
It joins the partner's monthly invoice. With a `zsk_test_` key the same call makes a sandbox, which
|
|
84
|
+
is never billed. A partner may add 20 hotels an hour.
|
|
85
|
+
- After adding: the hotel is not on the channel manager yet. The first `zs.roomTypes.save` (or
|
|
86
|
+
`zs.catalog.upsertRoomTypes`) with the same refs puts it there; then the rate plans, then room
|
|
87
|
+
counts and prices.
|
|
88
|
+
- `zs.properties.delete(propertyId, { confirm })` (also `zs.properties.remove`) removes a hotel the
|
|
89
|
+
partner added, FOR GOOD: its booking sites are disconnected, its rate plans and then its room types
|
|
90
|
+
are removed from the channel manager, the hotel is closed and it comes off the invoice from the next
|
|
91
|
+
1st. `confirm` is the hotel's exact name from `zs.properties.list()`. There is no undo, and a
|
|
92
|
+
removed hotel cannot be added again by API.
|
|
93
|
+
- Call `delete` only when a person chose to remove that one hotel on a screen, after typing or
|
|
94
|
+
confirming its name. Never from a loop, a timer, a sync job, a "reset", a cleanup or a test against
|
|
95
|
+
a live key, and never to fix a hotel that looks wrong. A partner may remove
|
|
96
|
+
10 hotels a day.
|
|
97
|
+
- The answer's `channelManager.state` is `REMOVED`, or `RETRYING` when one step is still finishing:
|
|
98
|
+
that is success, ZimmerStack retries it, do not call again in a loop. `PROPERTY_NOT_REMOVABLE` means
|
|
99
|
+
this key may not remove that hotel (its owner let the partner in, or it uses more than the channel
|
|
100
|
+
manager): show the message and stop.
|
|
101
|
+
- Both calls take longer than the others (a removal disconnects the booking sites one after another),
|
|
102
|
+
so the client waits up to 95 seconds for them whatever `timeoutMs` is. If `delete` ends in
|
|
103
|
+
`TIMEOUT` or `NETWORK_ERROR`, the person may press Remove again: a hotel already gone answers
|
|
104
|
+
`replay: true`, one still being removed answers `PROPERTY_BUSY`. Never retry it in a loop.
|
|
105
|
+
|
|
55
106
|
## A channel's price modifier
|
|
56
107
|
|
|
57
108
|
- `zs.channels.setModifier(channelId, steps)` moves EVERY price sent to that channel from then on.
|
|
@@ -129,3 +180,4 @@ these tools.
|
|
|
129
180
|
- [ ] Where a modifier is saved, the screen says when it takes effect, and the re-send is its own button.
|
|
130
181
|
- [ ] A PMS that pushes room counts applies every website booking to its own calendar before it pushes.
|
|
131
182
|
- [ ] A website booking is cancelled only from a person's own action, with the refund they chose.
|
|
183
|
+
- [ ] A room type or a rate plan is deleted only from a person's own action, after a confirmation that names it.
|