@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.
@@ -1,4 +1,4 @@
1
- import { type AvailabilityWrite, type BatchStatus, type Booking, type BookingCancel, type BookingCreate, type Catalog, type ChannelBooking, type DirectBookingCancel, type DirectBookingCancelResult, type ModifierResult, type OperationKey, type Operations, type RatePlansUpsert, type RatesResendAccepted, type RatesWrite, type RestrictionsWrite, type RoomTypesUpsert, type SandboxBookingCreate, type SandboxBookingModify, type WriteAccepted } from "./generated.js";
1
+ import { type AvailabilityWrite, type BatchStatus, type Booking, type BookingCancel, type BookingCreate, type Catalog, type CatalogDeleteResult, type CatalogUpsertResult, type ChannelBooking, type DirectBookingCancel, type DirectBookingCancelResult, type ModifierResult, type OperationKey, type Operations, type PropertyCreate, type PropertyCreated, type PropertyRemoved, type RatePlansUpsert, type RatesResendAccepted, type RatesWrite, type RestrictionsWrite, type RoomTypesUpsert, type SandboxBookingCreate, type SandboxBookingModify, type WriteAccepted } from "./generated.js";
2
2
  import { type Grid, type GridEdits, type ModifierStep } from "./grid.js";
3
3
  export interface ZimmerStackOptions {
4
4
  /**
@@ -12,7 +12,7 @@ export interface ZimmerStackOptions {
12
12
  baseUrl?: string;
13
13
  /** A replacement for the global `fetch`, for tests. */
14
14
  fetch?: typeof fetch;
15
- /** How long one attempt may take. Default 30 s. */
15
+ /** How long one attempt may take. Default 30 s. Adding a hotel and removing one are given at least 95 s. */
16
16
  timeoutMs?: number;
17
17
  /** How many times a request that may pass later is sent again. Default 3 (four attempts in all), at most 5. */
18
18
  maxRetries?: number;
@@ -56,6 +56,18 @@ export interface WriteOptions {
56
56
  export interface ReadOptions {
57
57
  signal?: AbortSignal;
58
58
  }
59
+ /** One room type, as `zs.roomTypes.save` takes it. */
60
+ export type RoomTypeInput = RoomTypesUpsert["roomTypes"][number];
61
+ /** One rate plan, as `zs.ratePlans.save` takes it. */
62
+ export type RatePlanInput = RatePlansUpsert["ratePlans"][number];
63
+ /**
64
+ * What saving one room type or one rate plan answers: its ZimmerStack `id`, what was done (`action`),
65
+ * how far it has travelled (`sync`), anything to know (`notice`), and where the hotel stands on its
66
+ * channels after the save (`channelManager`).
67
+ */
68
+ export type StructureSaved = CatalogUpsertResult["items"][number] & {
69
+ channelManager: CatalogUpsertResult["channelManager"];
70
+ };
59
71
  type Op<K extends OperationKey> = Operations[K];
60
72
  /** What `request` takes for an operation: its path values, its query, its body. */
61
73
  export type RequestArgs<K extends OperationKey> = (Op<K>["path"] extends undefined ? {
@@ -71,6 +83,8 @@ export type RequestArgs<K extends OperationKey> = (Op<K>["path"] extends undefin
71
83
  } : {
72
84
  body: Op<K>["body"];
73
85
  }) & WriteOptions;
86
+ /** How long one attempt of an operation may take: the client's `timeoutMs`, or longer for the slow ones above. */
87
+ export declare function attemptTimeoutMs(operation: string, timeoutMs: number): number;
74
88
  /**
75
89
  * The ZimmerStack Connect API, from your server.
76
90
  *
@@ -115,6 +129,61 @@ export declare class ZimmerStack {
115
129
  readonly properties: {
116
130
  /** The hotels this key may act on. A company key names one of them on every other call (`forProperty`). */
117
131
  list: (options?: ReadOptions) => Promise<import("./generated.js").Properties>;
132
+ /**
133
+ * Add a hotel. Only a software partner's COMPANY key that holds the scope properties:write can; tick
134
+ * "Also add and remove hotels" when you make the key in the partner portal. A hotel's own key is refused.
135
+ *
136
+ * The answer's `id` is the hotel: act on it with `zs.forProperty(id)`. Its owner gets the sign-in details
137
+ * by email; they are never sent to you. `billing.state` says whether it is on your invoice yet, and
138
+ * `channelManager` turns true with your first `roomTypes.save` or `catalog.upsertRoomTypes` for it.
139
+ *
140
+ * With a test key (zsk_test_) the same call makes a sandbox instead: a practice hotel no booking site
141
+ * sees, never billed. Safe to retry: the same `idempotencyKey` answers with the same hotel and
142
+ * `replay: true`, and never makes a second one.
143
+ *
144
+ * @example
145
+ * const hotel = await zs.properties.create({
146
+ * name: "Sea Breeze Apartments",
147
+ * owner: { name: "Nimal Perera", email: "nimal@seabreeze.example", phone: "+94 77 123 4567" },
148
+ * address: { line1: "12 Beach Road", city: "Galle", country: "LK" },
149
+ * roomTypes: [{ ref: "deluxe", name: "Deluxe Room", roomCount: 6, defaultRate: "90.00" }],
150
+ * });
151
+ * const seaBreeze = zs.forProperty(hotel.id);
152
+ */
153
+ create: (hotel: PropertyCreate, options?: WriteOptions) => Promise<PropertyCreated>;
154
+ /**
155
+ * Remove a hotel YOU ADDED, for good. A company key with the scope properties:write.
156
+ *
157
+ * One call does what ZimmerStack does when a hotel's service ends, in this order: its booking sites
158
+ * are disconnected, its rate plans are removed from the channel manager, then its room types, then the
159
+ * hotel is closed (its owner can no longer sign in, and no key reaches it). It comes off your invoice
160
+ * from the next 1st; the month already billed is not refunded. Bookings already made stay with the
161
+ * booking sites and the hotel.
162
+ *
163
+ * THERE IS NO UNDO. Call it when a person chose to remove that hotel; never from a loop, a timer or a
164
+ * sync job. `confirm` is the hotel's exact name, as `zs.properties.list()` prints it, so a wrong id never
165
+ * removes a hotel. Move the hotel's booking sites to its next channel manager first, so it keeps selling.
166
+ *
167
+ * The answer: `channelManager.state` is REMOVED when nothing is left on the channel manager, or
168
+ * RETRYING when the hotel is closed and off your bill but one step there is still finishing (ZimmerStack
169
+ * retries it; you do nothing). Calling it again later answers `replay: true`. A hotel you did not add,
170
+ * or one that uses more than the channel manager, is refused with PROPERTY_NOT_REMOVABLE and who can do
171
+ * it. With a test key it deletes a sandbox.
172
+ *
173
+ * @example
174
+ * const { properties } = await zs.properties.list();
175
+ * const hotel = properties.find((p) => p.id === 61);
176
+ * if (hotel) await zs.properties.delete(hotel.id, { confirm: hotel.name });
177
+ */
178
+ delete: (propertyId: number, options: {
179
+ confirm: string;
180
+ signal?: AbortSignal;
181
+ }) => Promise<PropertyRemoved>;
182
+ /** The same as `delete`, under the word the partner portal uses ("Remove hotel"). */
183
+ remove: (propertyId: number, options: {
184
+ confirm: string;
185
+ signal?: AbortSignal;
186
+ }) => Promise<PropertyRemoved>;
118
187
  };
119
188
  readonly property: {
120
189
  /** The hotel: its timezone and currency, what this key may do, its own limits, what it has used, where it stands. */
@@ -124,12 +193,72 @@ export declare class ZimmerStack {
124
193
  /** Room types and rate plans, with the numeric ids every write uses. */
125
194
  get: (options?: ReadOptions) => Promise<Catalog>;
126
195
  /** Create or change room types by your own `ref`. Needs the scope catalog:write. */
127
- upsertRoomTypes: (body: RoomTypesUpsert, options?: WriteOptions) => Promise<import("./generated.js").CatalogUpsertResult>;
196
+ upsertRoomTypes: (body: RoomTypesUpsert, options?: WriteOptions) => Promise<CatalogUpsertResult>;
128
197
  /** Delete a room type; its rate plans go with it. */
129
- deleteRoomType: (roomTypeId: number, options?: ReadOptions) => Promise<import("./generated.js").CatalogDeleteResult>;
198
+ deleteRoomType: (roomTypeId: number, options?: ReadOptions) => Promise<CatalogDeleteResult>;
130
199
  /** Create or change rate plans by your own `ref`. */
131
- upsertRatePlans: (body: RatePlansUpsert, options?: WriteOptions) => Promise<import("./generated.js").CatalogUpsertResult>;
132
- deleteRatePlan: (ratePlanId: number, options?: ReadOptions) => Promise<import("./generated.js").CatalogDeleteResult>;
200
+ upsertRatePlans: (body: RatePlansUpsert, options?: WriteOptions) => Promise<CatalogUpsertResult>;
201
+ /** Delete a rate plan. Refused while a channel still sells it. */
202
+ deleteRatePlan: (ratePlanId: number, options?: ReadOptions) => Promise<CatalogDeleteResult>;
203
+ };
204
+ readonly roomTypes: {
205
+ /** Every room type of the hotel, each with the numeric `id` that room counts and bookings name. */
206
+ list: (options?: ReadOptions) => Promise<Catalog["roomTypes"]>;
207
+ /**
208
+ * Create a room type, or change it if you sent this `ref` before. `ref` is your own id for it; the
209
+ * answer's `id` is ZimmerStack's, the one every later call names. Needs the scope catalog:write.
210
+ * To send several in one request use `catalog.upsertRoomTypes`.
211
+ *
212
+ * @example
213
+ * const room = await zs.roomTypes.save({ ref: "deluxe", name: "Deluxe Room", roomCount: 8, adults: 2 });
214
+ * room.id; // use it in availability.set and in a rate plan's roomTypeId
215
+ */
216
+ save: (roomType: RoomTypeInput, options?: WriteOptions) => Promise<StructureSaved>;
217
+ /**
218
+ * Delete a room type for good, by its `id` (a number) or by your own `ref` (a string). Its rate
219
+ * plans are deleted with it; the answer's `deletedRatePlanIds` names them. Needs the scope
220
+ * catalog:write.
221
+ *
222
+ * THERE IS NO UNDO. Call it when a person chose to delete; never from a loop, a timer or a sync job.
223
+ * It is refused while a booking site still sells one of its rate plans (unmap the plan on the
224
+ * channel first), while an upcoming stay holds one of its rooms, or while rooms are still assigned
225
+ * to it on a hotel that runs the ZimmerStack PMS: CATALOG_CONFLICT, or CHANNEL_MANAGER_ERROR when
226
+ * the refusal is the channel manager's. Show the message; nothing was deleted. Deletes have a daily
227
+ * budget per hotel (RATE_LIMITED, scope structure-deletes-day).
228
+ *
229
+ * @example
230
+ * await zs.roomTypes.delete("deluxe"); // by your ref
231
+ * await zs.roomTypes.delete(412); // by ZimmerStack's id
232
+ */
233
+ delete: (idOrRef: number | string, options?: ReadOptions) => Promise<CatalogDeleteResult>;
234
+ };
235
+ readonly ratePlans: {
236
+ /** Every rate plan of the hotel, each with the numeric `id` that prices and stay rules name. */
237
+ list: (options?: ReadOptions) => Promise<Catalog["ratePlans"]>;
238
+ /**
239
+ * Create a rate plan, or change it if you sent this `ref` before. Name its room type by
240
+ * `roomTypeRef` (the ref you gave the room type) or by `roomTypeId`. `defaultRate` is its standing
241
+ * price in major units (4500 = 4,500.00). Needs the scope catalog:write. To send several in one
242
+ * request use `catalog.upsertRatePlans`.
243
+ *
244
+ * @example
245
+ * const plan = await zs.ratePlans.save({ ref: "deluxe-bb", roomTypeRef: "deluxe", name: "Bed and breakfast", mealPlan: "CP", defaultRate: 4500 });
246
+ * plan.id; // use it in rates.set and restrictions.set
247
+ */
248
+ save: (ratePlan: RatePlanInput, options?: WriteOptions) => Promise<StructureSaved>;
249
+ /**
250
+ * Delete a rate plan for good, by its `id` (a number) or by your own `ref` (a string). Needs the
251
+ * scope catalog:write.
252
+ *
253
+ * THERE IS NO UNDO. Call it when a person chose to delete; never from a loop, a timer or a sync job.
254
+ * It is refused with CATALOG_CONFLICT while a booking site still sells the plan: unmap it on the
255
+ * channel first. Deletes have a daily budget per hotel (RATE_LIMITED, scope structure-deletes-day).
256
+ *
257
+ * @example
258
+ * await zs.ratePlans.delete("deluxe-bb"); // by your ref
259
+ * await zs.ratePlans.delete(901); // by ZimmerStack's id
260
+ */
261
+ delete: (idOrRef: number | string, options?: ReadOptions) => Promise<CatalogDeleteResult>;
133
262
  };
134
263
  readonly availability: {
135
264
  /** Rooms left to sell per room type per night, as ZimmerStack's record holds them. Up to 500 days. */
@@ -1,6 +1,13 @@
1
1
  import { ZimmerStackError, ZimmerStackUsageError } from "./errors.js";
2
2
  import { API_ORIGIN, API_PREFIX, IDEMPOTENCY_HEADER, OPERATIONS, PROPERTY_HEADER, SDK_VERSION, } from "./generated.js";
3
3
  import { buildGrid, chunk, toRanges } from "./grid.js";
4
+ /** One entity was sent, so the answer names exactly one. */
5
+ function savedOne(result) {
6
+ const item = result.items[0];
7
+ if (!item)
8
+ throw new Error("ZimmerStack's answer named no entity for this save. Read zs.catalog.get() to see what the hotel holds before sending it again.");
9
+ return { ...item, channelManager: result.channelManager };
10
+ }
4
11
  /* ───────────────────────────── the shared core ───────────────────────────── */
5
12
  /** Requests in flight at once. Writes go one at a time on top of that. */
6
13
  const PARALLEL = 4;
@@ -46,6 +53,20 @@ function resolveBase(baseUrl) {
46
53
  }
47
54
  return url.origin;
48
55
  }
56
+ /**
57
+ * Operations that do a long thing while you wait: adding a hotel creates its account, and removing one takes
58
+ * it off its booking sites one step at a time. One attempt of these is given at least this long, however
59
+ * short `timeoutMs` is, because giving up early leaves you not knowing whether a hotel was added or removed.
60
+ * (The API's own edge answers within 100 s.)
61
+ */
62
+ const PATIENCE_MS = {
63
+ "POST /properties": 95_000,
64
+ "DELETE /properties/{propertyId}": 95_000,
65
+ };
66
+ /** How long one attempt of an operation may take: the client's `timeoutMs`, or longer for the slow ones above. */
67
+ export function attemptTimeoutMs(operation, timeoutMs) {
68
+ return Math.max(timeoutMs, PATIENCE_MS[operation] ?? 0);
69
+ }
49
70
  class Core {
50
71
  #key;
51
72
  mode;
@@ -179,7 +200,7 @@ class Core {
179
200
  let res;
180
201
  let json;
181
202
  try {
182
- const timeout = AbortSignal.timeout(this.#timeoutMs);
203
+ const timeout = AbortSignal.timeout(attemptTimeoutMs(wire.operation, this.#timeoutMs));
183
204
  res = await this.#fetch(wire.url, {
184
205
  method: wire.method,
185
206
  headers: wire.headers,
@@ -334,7 +355,10 @@ export class ZimmerStack {
334
355
  if (value !== undefined && value !== null)
335
356
  url.searchParams.set(name, String(value));
336
357
  const headers = { authorization: this.#core.authorization(), accept: "application/json", "user-agent": `zimmerstack-connect-node/${SDK_VERSION}` };
337
- const hotel = this.propertyId ?? (operation === "GET /properties" ? undefined : this.#core.soleSandboxId);
358
+ // Adding a hotel and removing one name no hotel in the header: the one to add does not exist yet, and the
359
+ // one to remove is in the path. Listing them sends the header only when this client was made for one hotel.
360
+ const aboutTheList = operation === "POST /properties" || operation === "DELETE /properties/{propertyId}";
361
+ const hotel = aboutTheList ? undefined : (this.propertyId ?? (operation === "GET /properties" ? undefined : this.#core.soleSandboxId));
338
362
  if (hotel)
339
363
  headers[PROPERTY_HEADER] = String(hotel);
340
364
  const body = args.body === undefined ? undefined : JSON.stringify(args.body);
@@ -393,7 +417,78 @@ export class ZimmerStack {
393
417
  properties = {
394
418
  /** The hotels this key may act on. A company key names one of them on every other call (`forProperty`). */
395
419
  list: (options) => this.request("GET /properties", options),
420
+ /**
421
+ * Add a hotel. Only a software partner's COMPANY key that holds the scope properties:write can; tick
422
+ * "Also add and remove hotels" when you make the key in the partner portal. A hotel's own key is refused.
423
+ *
424
+ * The answer's `id` is the hotel: act on it with `zs.forProperty(id)`. Its owner gets the sign-in details
425
+ * by email; they are never sent to you. `billing.state` says whether it is on your invoice yet, and
426
+ * `channelManager` turns true with your first `roomTypes.save` or `catalog.upsertRoomTypes` for it.
427
+ *
428
+ * With a test key (zsk_test_) the same call makes a sandbox instead: a practice hotel no booking site
429
+ * sees, never billed. Safe to retry: the same `idempotencyKey` answers with the same hotel and
430
+ * `replay: true`, and never makes a second one.
431
+ *
432
+ * @example
433
+ * const hotel = await zs.properties.create({
434
+ * name: "Sea Breeze Apartments",
435
+ * owner: { name: "Nimal Perera", email: "nimal@seabreeze.example", phone: "+94 77 123 4567" },
436
+ * address: { line1: "12 Beach Road", city: "Galle", country: "LK" },
437
+ * roomTypes: [{ ref: "deluxe", name: "Deluxe Room", roomCount: 6, defaultRate: "90.00" }],
438
+ * });
439
+ * const seaBreeze = zs.forProperty(hotel.id);
440
+ */
441
+ create: async (hotel, options) => {
442
+ const created = await this.request("POST /properties", { body: hotel, ...options });
443
+ this.#forgetWhichHotels();
444
+ return created;
445
+ },
446
+ /**
447
+ * Remove a hotel YOU ADDED, for good. A company key with the scope properties:write.
448
+ *
449
+ * One call does what ZimmerStack does when a hotel's service ends, in this order: its booking sites
450
+ * are disconnected, its rate plans are removed from the channel manager, then its room types, then the
451
+ * hotel is closed (its owner can no longer sign in, and no key reaches it). It comes off your invoice
452
+ * from the next 1st; the month already billed is not refunded. Bookings already made stay with the
453
+ * booking sites and the hotel.
454
+ *
455
+ * THERE IS NO UNDO. Call it when a person chose to remove that hotel; never from a loop, a timer or a
456
+ * sync job. `confirm` is the hotel's exact name, as `zs.properties.list()` prints it, so a wrong id never
457
+ * removes a hotel. Move the hotel's booking sites to its next channel manager first, so it keeps selling.
458
+ *
459
+ * The answer: `channelManager.state` is REMOVED when nothing is left on the channel manager, or
460
+ * RETRYING when the hotel is closed and off your bill but one step there is still finishing (ZimmerStack
461
+ * retries it; you do nothing). Calling it again later answers `replay: true`. A hotel you did not add,
462
+ * or one that uses more than the channel manager, is refused with PROPERTY_NOT_REMOVABLE and who can do
463
+ * it. With a test key it deletes a sandbox.
464
+ *
465
+ * @example
466
+ * const { properties } = await zs.properties.list();
467
+ * const hotel = properties.find((p) => p.id === 61);
468
+ * if (hotel) await zs.properties.delete(hotel.id, { confirm: hotel.name });
469
+ */
470
+ delete: (propertyId, options) => this.#removeProperty(propertyId, options),
471
+ /** The same as `delete`, under the word the partner portal uses ("Remove hotel"). */
472
+ remove: (propertyId, options) => this.#removeProperty(propertyId, options),
396
473
  };
474
+ async #removeProperty(propertyId, options) {
475
+ if (!Number.isInteger(propertyId) || propertyId <= 0) {
476
+ throw new ZimmerStackUsageError("zs.properties.delete needs the hotel's numeric id (zs.properties.list() names them)");
477
+ }
478
+ const confirm = typeof options?.confirm === "string" ? options.confirm.trim() : "";
479
+ if (!confirm) {
480
+ throw new ZimmerStackUsageError("zs.properties.delete needs { confirm: <the hotel's exact name> }, as zs.properties.list() prints it. Removing a hotel cannot be undone, so the name is asked for.");
481
+ }
482
+ const removed = await this.request("DELETE /properties/{propertyId}", { path: { propertyId }, query: { confirm }, signal: options.signal });
483
+ this.#core.catalogs.delete(propertyId);
484
+ this.#forgetWhichHotels();
485
+ return removed;
486
+ }
487
+ /** The hotels this key reaches just changed: the one sandbox a test key was assumed to act on is looked up afresh. */
488
+ #forgetWhichHotels() {
489
+ this.#core.soleSandboxProperty = undefined;
490
+ this.#core.soleSandboxId = undefined;
491
+ }
397
492
  property = {
398
493
  /** The hotel: its timezone and currency, what this key may do, its own limits, what it has used, where it stands. */
399
494
  get: (options) => this.request("GET /property", options),
@@ -412,8 +507,90 @@ export class ZimmerStack {
412
507
  deleteRoomType: (roomTypeId, options) => this.#structure("DELETE /catalog/room-types/{roomTypeId}", { path: { roomTypeId }, ...options }),
413
508
  /** Create or change rate plans by your own `ref`. */
414
509
  upsertRatePlans: (body, options) => this.#structure("PUT /catalog/rate-plans", { body, ...options }),
510
+ /** Delete a rate plan. Refused while a channel still sells it. */
415
511
  deleteRatePlan: (ratePlanId, options) => this.#structure("DELETE /catalog/rate-plans/{ratePlanId}", { path: { ratePlanId }, ...options }),
416
512
  };
513
+ /* ── the same room types and rate plans, one at a time, under the names you would look for ── */
514
+ roomTypes = {
515
+ /** Every room type of the hotel, each with the numeric `id` that room counts and bookings name. */
516
+ list: async (options) => (await this.catalog.get(options)).roomTypes,
517
+ /**
518
+ * Create a room type, or change it if you sent this `ref` before. `ref` is your own id for it; the
519
+ * answer's `id` is ZimmerStack's, the one every later call names. Needs the scope catalog:write.
520
+ * To send several in one request use `catalog.upsertRoomTypes`.
521
+ *
522
+ * @example
523
+ * const room = await zs.roomTypes.save({ ref: "deluxe", name: "Deluxe Room", roomCount: 8, adults: 2 });
524
+ * room.id; // use it in availability.set and in a rate plan's roomTypeId
525
+ */
526
+ save: async (roomType, options) => savedOne(await this.catalog.upsertRoomTypes({ roomTypes: [roomType] }, options)),
527
+ /**
528
+ * Delete a room type for good, by its `id` (a number) or by your own `ref` (a string). Its rate
529
+ * plans are deleted with it; the answer's `deletedRatePlanIds` names them. Needs the scope
530
+ * catalog:write.
531
+ *
532
+ * THERE IS NO UNDO. Call it when a person chose to delete; never from a loop, a timer or a sync job.
533
+ * It is refused while a booking site still sells one of its rate plans (unmap the plan on the
534
+ * channel first), while an upcoming stay holds one of its rooms, or while rooms are still assigned
535
+ * to it on a hotel that runs the ZimmerStack PMS: CATALOG_CONFLICT, or CHANNEL_MANAGER_ERROR when
536
+ * the refusal is the channel manager's. Show the message; nothing was deleted. Deletes have a daily
537
+ * budget per hotel (RATE_LIMITED, scope structure-deletes-day).
538
+ *
539
+ * @example
540
+ * await zs.roomTypes.delete("deluxe"); // by your ref
541
+ * await zs.roomTypes.delete(412); // by ZimmerStack's id
542
+ */
543
+ delete: async (idOrRef, options) => this.catalog.deleteRoomType(await this.#structureId("roomTypes", idOrRef, options?.signal), options),
544
+ };
545
+ ratePlans = {
546
+ /** Every rate plan of the hotel, each with the numeric `id` that prices and stay rules name. */
547
+ list: async (options) => (await this.catalog.get(options)).ratePlans,
548
+ /**
549
+ * Create a rate plan, or change it if you sent this `ref` before. Name its room type by
550
+ * `roomTypeRef` (the ref you gave the room type) or by `roomTypeId`. `defaultRate` is its standing
551
+ * price in major units (4500 = 4,500.00). Needs the scope catalog:write. To send several in one
552
+ * request use `catalog.upsertRatePlans`.
553
+ *
554
+ * @example
555
+ * const plan = await zs.ratePlans.save({ ref: "deluxe-bb", roomTypeRef: "deluxe", name: "Bed and breakfast", mealPlan: "CP", defaultRate: 4500 });
556
+ * plan.id; // use it in rates.set and restrictions.set
557
+ */
558
+ save: async (ratePlan, options) => savedOne(await this.catalog.upsertRatePlans({ ratePlans: [ratePlan] }, options)),
559
+ /**
560
+ * Delete a rate plan for good, by its `id` (a number) or by your own `ref` (a string). Needs the
561
+ * scope catalog:write.
562
+ *
563
+ * THERE IS NO UNDO. Call it when a person chose to delete; never from a loop, a timer or a sync job.
564
+ * It is refused with CATALOG_CONFLICT while a booking site still sells the plan: unmap it on the
565
+ * channel first. Deletes have a daily budget per hotel (RATE_LIMITED, scope structure-deletes-day).
566
+ *
567
+ * @example
568
+ * await zs.ratePlans.delete("deluxe-bb"); // by your ref
569
+ * await zs.ratePlans.delete(901); // by ZimmerStack's id
570
+ */
571
+ delete: async (idOrRef, options) => this.catalog.deleteRatePlan(await this.#structureId("ratePlans", idOrRef, options?.signal), options),
572
+ };
573
+ /**
574
+ * The id a delete acts on. A number is ZimmerStack's id already. A string is your own `ref`: it is
575
+ * looked up in a fresh read of the catalog, never a kept copy, because a delete must act on what
576
+ * exists now.
577
+ */
578
+ async #structureId(kind, idOrRef, signal) {
579
+ const what = kind === "roomTypes" ? "room type" : "rate plan";
580
+ if (typeof idOrRef === "number") {
581
+ if (!Number.isInteger(idOrRef) || idOrRef <= 0)
582
+ throw new ZimmerStackUsageError(`A ${what}'s id is a whole number above 0; zs.${kind}.list() names them`);
583
+ return idOrRef;
584
+ }
585
+ if (typeof idOrRef !== "string" || idOrRef.trim() === "") {
586
+ throw new ZimmerStackUsageError(`zs.${kind}.delete takes the ${what}'s id (a number) or your own ref for it (a string)`);
587
+ }
588
+ const hit = (await this.catalog.get({ signal }))[kind].find((entity) => entity.ref === idOrRef);
589
+ if (!hit) {
590
+ throw new ZimmerStackUsageError(`This hotel has no ${what} with the ref "${idOrRef}". zs.${kind}.list() names every one with its id and ref; a ${what} made on ZimmerStack's own screens has no ref, so delete it by its id.`);
591
+ }
592
+ return hit.id;
593
+ }
417
594
  async #structure(operation, args) {
418
595
  try {
419
596
  return await this.request(operation, ...[args]);
@@ -1,5 +1,5 @@
1
1
  /** This package's version, sent as the user agent so ZimmerStack can tell which client a request came from. */
2
- export declare const SDK_VERSION = "0.4.0";
2
+ export declare const SDK_VERSION = "0.5.0";
3
3
  /** Where the API lives. The key is sent nowhere else. */
4
4
  export declare const API_ORIGIN = "https://api.zimmerstack.com";
5
5
  export declare const API_PREFIX = "/api/v1/connect-api/v1";
@@ -27,10 +27,10 @@ export declare const LIMITS: {
27
27
  readonly maxNightsPerBooking: 90;
28
28
  };
29
29
  /** Every stable error code (`error.code`). Messages are for people and may change; branch on these. */
30
- export declare const ERROR_CODES: readonly ["API_KEY_INVALID", "API_KEY_REVOKED", "API_KEY_EXPIRED", "CONNECT_API_NOT_CONFIGURED", "IP_NOT_ALLOWED", "SCOPE_MISSING", "PROPERTY_UNAVAILABLE", "CHANNEL_MANAGER_DISABLED", "PMS_NOT_AVAILABLE", "VALIDATION", "RANGE_INVALID", "HORIZON", "TOO_MANY_UPDATES", "TOO_MANY_CELLS", "UNKNOWN_ROOM_TYPE", "UNKNOWN_RATE_PLAN", "CURRENCY_MISMATCH", "RATE_LIMITED", "NOTHING_ACCEPTED", "BATCH_NOT_FOUND", "IDEMPOTENCY_KEY_INVALID", "IDEMPOTENCY_KEY_REUSED", "IDEMPOTENCY_IN_FLIGHT", "STAY_INVALID", "UNKNOWN_ROOM_TYPE_FOR_PLAN", "OCCUPANCY_EXCEEDED", "NO_AVAILABILITY", "EXTERNAL_REFERENCE_REUSED", "PAYMENT_NOT_ALLOWED", "PAYMENT_EXCEEDS_TOTAL", "BOOKING_NOT_FOUND", "BOOKING_NOT_CANCELLABLE", "MODULE_NOT_ENTITLED", "SANDBOX_ONLY", "ROOM_TYPE_NOT_FOUND", "RATE_PLAN_NOT_FOUND", "CATALOG_CONFLICT", "CATALOG_BUSY", "CHANNEL_MANAGER_ERROR", "PROPERTY_REQUIRED", "PROPERTY_NOT_FOUND", "ARI_NOT_AUTHORITATIVE", "ROUTE_NOT_FOUND", "PAYLOAD_TOO_LARGE", "AUTH_BACKEND_UNAVAILABLE", "BOOKING_NOT_MODIFIABLE", "SANDBOX_NOT_FOUND", "SANDBOX_INCOMPLETE", "WRITES_FROZEN", "WRITES_SUSPENDED", "SHIELD_UNAVAILABLE", "CATALOG_LIMIT_REACHED", "TOO_MANY_NEW_ENTITIES", "RATE_OUT_OF_BAND", "CHANNEL_NOT_FOUND", "CHANNEL_SHARED", "MODIFIER_OUT_OF_BAND"];
30
+ export declare const ERROR_CODES: readonly ["API_KEY_INVALID", "API_KEY_REVOKED", "API_KEY_EXPIRED", "CONNECT_API_NOT_CONFIGURED", "IP_NOT_ALLOWED", "SCOPE_MISSING", "PROPERTY_UNAVAILABLE", "CHANNEL_MANAGER_DISABLED", "PMS_NOT_AVAILABLE", "VALIDATION", "RANGE_INVALID", "HORIZON", "TOO_MANY_UPDATES", "TOO_MANY_CELLS", "UNKNOWN_ROOM_TYPE", "UNKNOWN_RATE_PLAN", "CURRENCY_MISMATCH", "RATE_LIMITED", "NOTHING_ACCEPTED", "BATCH_NOT_FOUND", "IDEMPOTENCY_KEY_INVALID", "IDEMPOTENCY_KEY_REUSED", "IDEMPOTENCY_IN_FLIGHT", "STAY_INVALID", "UNKNOWN_ROOM_TYPE_FOR_PLAN", "OCCUPANCY_EXCEEDED", "NO_AVAILABILITY", "EXTERNAL_REFERENCE_REUSED", "PAYMENT_NOT_ALLOWED", "PAYMENT_EXCEEDS_TOTAL", "BOOKING_NOT_FOUND", "BOOKING_NOT_CANCELLABLE", "MODULE_NOT_ENTITLED", "SANDBOX_ONLY", "ROOM_TYPE_NOT_FOUND", "RATE_PLAN_NOT_FOUND", "CATALOG_CONFLICT", "CATALOG_BUSY", "CHANNEL_MANAGER_ERROR", "PROPERTY_REQUIRED", "PROPERTY_NOT_FOUND", "ARI_NOT_AUTHORITATIVE", "ROUTE_NOT_FOUND", "PAYLOAD_TOO_LARGE", "AUTH_BACKEND_UNAVAILABLE", "BOOKING_NOT_MODIFIABLE", "SANDBOX_NOT_FOUND", "SANDBOX_INCOMPLETE", "WRITES_FROZEN", "WRITES_SUSPENDED", "SHIELD_UNAVAILABLE", "CATALOG_LIMIT_REACHED", "TOO_MANY_NEW_ENTITIES", "RATE_OUT_OF_BAND", "CHANNEL_NOT_FOUND", "CHANNEL_SHARED", "MODIFIER_OUT_OF_BAND", "COMPANY_KEY_REQUIRED", "BILLING_SETUP_REQUIRED", "OWNER_HAS_ACCOUNT", "SANDBOX_LIMIT", "CONFIRMATION_MISMATCH", "PROPERTY_NOT_REMOVABLE", "PROPERTY_BUSY", "PRICE_UNAVAILABLE"];
31
31
  export type ErrorCode = (typeof ERROR_CODES)[number];
32
32
  /** What a key may do. The hotel's owner (or, for a vendor's key, the vendor) chose them when the key was made. */
33
- export declare const SCOPES: readonly ["ari:read", "ari:write", "catalog:write", "channel-modifiers:write", "channel-bookings:read", "direct-bookings:read", "direct-bookings:cancel", "bookings:read", "bookings:write", "bookings:payments"];
33
+ export declare const SCOPES: readonly ["ari:read", "ari:write", "catalog:write", "channel-modifiers:write", "channel-bookings:read", "direct-bookings:read", "direct-bookings:cancel", "bookings:read", "bookings:write", "bookings:payments", "properties:write"];
34
34
  export type Scope = (typeof SCOPES)[number];
35
35
  /** When a channel's price modifier takes effect. Show it where a person saves one. */
36
36
  export declare const MODIFIER_TAKES_EFFECT = "A modifier applies to prices sent to the channel after the change. Prices already on the channel stay as they are until those nights are sent again.";
@@ -39,7 +39,7 @@ export interface Error {
39
39
  /** Human-readable, may change; branch on data.code */
40
40
  message: string;
41
41
  data: {
42
- code: "API_KEY_INVALID" | "API_KEY_REVOKED" | "API_KEY_EXPIRED" | "CONNECT_API_NOT_CONFIGURED" | "IP_NOT_ALLOWED" | "SCOPE_MISSING" | "PROPERTY_UNAVAILABLE" | "CHANNEL_MANAGER_DISABLED" | "PMS_NOT_AVAILABLE" | "VALIDATION" | "RANGE_INVALID" | "HORIZON" | "TOO_MANY_UPDATES" | "TOO_MANY_CELLS" | "UNKNOWN_ROOM_TYPE" | "UNKNOWN_RATE_PLAN" | "CURRENCY_MISMATCH" | "RATE_LIMITED" | "NOTHING_ACCEPTED" | "BATCH_NOT_FOUND" | "IDEMPOTENCY_KEY_INVALID" | "IDEMPOTENCY_KEY_REUSED" | "IDEMPOTENCY_IN_FLIGHT" | "STAY_INVALID" | "UNKNOWN_ROOM_TYPE_FOR_PLAN" | "OCCUPANCY_EXCEEDED" | "NO_AVAILABILITY" | "EXTERNAL_REFERENCE_REUSED" | "PAYMENT_NOT_ALLOWED" | "PAYMENT_EXCEEDS_TOTAL" | "BOOKING_NOT_FOUND" | "BOOKING_NOT_CANCELLABLE" | "MODULE_NOT_ENTITLED" | "SANDBOX_ONLY" | "ROOM_TYPE_NOT_FOUND" | "RATE_PLAN_NOT_FOUND" | "CATALOG_CONFLICT" | "CATALOG_BUSY" | "CHANNEL_MANAGER_ERROR" | "PROPERTY_REQUIRED" | "PROPERTY_NOT_FOUND" | "ARI_NOT_AUTHORITATIVE" | "ROUTE_NOT_FOUND" | "PAYLOAD_TOO_LARGE" | "AUTH_BACKEND_UNAVAILABLE" | "BOOKING_NOT_MODIFIABLE" | "SANDBOX_NOT_FOUND" | "SANDBOX_INCOMPLETE" | "WRITES_FROZEN" | "WRITES_SUSPENDED" | "SHIELD_UNAVAILABLE" | "CATALOG_LIMIT_REACHED" | "TOO_MANY_NEW_ENTITIES" | "RATE_OUT_OF_BAND" | "CHANNEL_NOT_FOUND" | "CHANNEL_SHARED" | "MODIFIER_OUT_OF_BAND";
42
+ code: "API_KEY_INVALID" | "API_KEY_REVOKED" | "API_KEY_EXPIRED" | "CONNECT_API_NOT_CONFIGURED" | "IP_NOT_ALLOWED" | "SCOPE_MISSING" | "PROPERTY_UNAVAILABLE" | "CHANNEL_MANAGER_DISABLED" | "PMS_NOT_AVAILABLE" | "VALIDATION" | "RANGE_INVALID" | "HORIZON" | "TOO_MANY_UPDATES" | "TOO_MANY_CELLS" | "UNKNOWN_ROOM_TYPE" | "UNKNOWN_RATE_PLAN" | "CURRENCY_MISMATCH" | "RATE_LIMITED" | "NOTHING_ACCEPTED" | "BATCH_NOT_FOUND" | "IDEMPOTENCY_KEY_INVALID" | "IDEMPOTENCY_KEY_REUSED" | "IDEMPOTENCY_IN_FLIGHT" | "STAY_INVALID" | "UNKNOWN_ROOM_TYPE_FOR_PLAN" | "OCCUPANCY_EXCEEDED" | "NO_AVAILABILITY" | "EXTERNAL_REFERENCE_REUSED" | "PAYMENT_NOT_ALLOWED" | "PAYMENT_EXCEEDS_TOTAL" | "BOOKING_NOT_FOUND" | "BOOKING_NOT_CANCELLABLE" | "MODULE_NOT_ENTITLED" | "SANDBOX_ONLY" | "ROOM_TYPE_NOT_FOUND" | "RATE_PLAN_NOT_FOUND" | "CATALOG_CONFLICT" | "CATALOG_BUSY" | "CHANNEL_MANAGER_ERROR" | "PROPERTY_REQUIRED" | "PROPERTY_NOT_FOUND" | "ARI_NOT_AUTHORITATIVE" | "ROUTE_NOT_FOUND" | "PAYLOAD_TOO_LARGE" | "AUTH_BACKEND_UNAVAILABLE" | "BOOKING_NOT_MODIFIABLE" | "SANDBOX_NOT_FOUND" | "SANDBOX_INCOMPLETE" | "WRITES_FROZEN" | "WRITES_SUSPENDED" | "SHIELD_UNAVAILABLE" | "CATALOG_LIMIT_REACHED" | "TOO_MANY_NEW_ENTITIES" | "RATE_OUT_OF_BAND" | "CHANNEL_NOT_FOUND" | "CHANNEL_SHARED" | "MODIFIER_OUT_OF_BAND" | "COMPANY_KEY_REQUIRED" | "BILLING_SETUP_REQUIRED" | "OWNER_HAS_ACCOUNT" | "SANDBOX_LIMIT" | "CONFIRMATION_MISMATCH" | "PROPERTY_NOT_REMOVABLE" | "PROPERTY_BUSY" | "PRICE_UNAVAILABLE";
43
43
  details?: unknown;
44
44
  };
45
45
  }
@@ -161,6 +161,97 @@ export interface Properties {
161
161
  sandbox: boolean;
162
162
  }>;
163
163
  }
164
+ export interface PropertyCreate {
165
+ /** The hotel's name, as its guests know it */
166
+ name: string;
167
+ /** The person who owns the hotel's account */
168
+ owner: {
169
+ name: string;
170
+ /** The owner's own address. The sign-in details are sent here, never to you */
171
+ email: string;
172
+ /** Digits, with an optional + and spaces, dots, dashes or brackets */
173
+ phone: string;
174
+ };
175
+ address: {
176
+ line1: string;
177
+ city: string;
178
+ state?: string;
179
+ postalCode?: string;
180
+ /** ISO 3166-1 alpha-2, for example IN, LK, PT */
181
+ country: string;
182
+ };
183
+ /** ISO 4217: what the hotel sells in. Default: the country's own currency. A hotel in India sells in INR */
184
+ currency?: string;
185
+ /** An IANA zone of the hotel's country. Default: the country's main zone */
186
+ timezone?: string;
187
+ /** India only: the hotel's GSTIN when it is registered under GST. Leave it out when it is not, and for a hotel in any other country */
188
+ taxId?: string;
189
+ /** At least one. Each is born with one room-only rate plan at its defaultRate */
190
+ roomTypes: Array<{
191
+ /** Your own id for this room type. Send the same ref to PUT /catalog/room-types later and it updates this one instead of making a second */
192
+ ref?: string;
193
+ /** Shown to the owner and sent to the channel manager as the title; each name once per request */
194
+ name: string;
195
+ /** Sellable rooms of this type */
196
+ roomCount: number;
197
+ /** Most adults one room takes; default 2 */
198
+ adults?: number;
199
+ /** The nightly price new dates open at, in MAJOR units of the hotel's currency (e.g. 4500 or "4500.00") */
200
+ defaultRate: number | string;
201
+ }>;
202
+ }
203
+ export interface PropertyCreated {
204
+ /** The id your company key names in the X-ZS-Property header from now on */
205
+ id: number;
206
+ /** As stored. A sandbox's name ends in (sandbox) and is at most 60 characters */
207
+ name: string;
208
+ timezone: string;
209
+ currency: string;
210
+ /** The property publishes to its channels. false for a new hotel until your first PUT /catalog/room-types puts it on the channel manager; always true for a sandbox */
211
+ channelManager: boolean;
212
+ /** true when a test key made it: everything lands locally, nothing reaches a channel and nothing is billed */
213
+ sandbox: boolean;
214
+ billing: {
215
+ /** ACTIVE: its billing has started, it is on your next monthly invoice · WAITING: the hotel is live, its billing has not started yet · NOT_BILLED: a sandbox */
216
+ state: "ACTIVE" | "WAITING" | "NOT_BILLED";
217
+ /** Why billing waits; null otherwise. SETUP: your billing setup is not complete · OVERDUE: one of your invoices is overdue · UNPAID_LIMIT: you have added as many hotels as you may before your first paid invoice · REVIEW: ZimmerStack starts it */
218
+ reason: "SETUP" | "OVERDUE" | "UNPAID_LIMIT" | "REVIEW" | null;
219
+ /** The same in one sentence, with what to do next; may change, branch on state and reason */
220
+ message: string;
221
+ };
222
+ /** true: an earlier request with this X-Idempotency-Key already added this hotel; nothing new was made */
223
+ replay: boolean;
224
+ }
225
+ export interface PropertyRemoved {
226
+ id: number;
227
+ /** The hotel's name; null only for a sandbox removed before its name was recorded */
228
+ name: string | null;
229
+ removed: true;
230
+ /** true: it was already removed before this request; the rest of the answer is where it stands now */
231
+ replay: boolean;
232
+ sandbox: boolean;
233
+ /** Nobody signs in to the hotel's account any more and no key reaches it */
234
+ access: "CLOSED";
235
+ billing: {
236
+ /** CANCELLED: the hotel's subscription is cancelled · NOT_BILLED: a sandbox, never billed */
237
+ state: "CANCELLED" | "NOT_BILLED";
238
+ /** ISO 8601 instant the subscription was cancelled; null for a sandbox */
239
+ cancelledAt: string | null;
240
+ };
241
+ channelManager: {
242
+ /** REMOVED: its channel connections, rate plans, room types and listing are gone from the channel manager · RETRYING: a step is still pending; ZimmerStack retries it and nothing is needed from you · NOT_CONNECTED: it was never on the channel manager */
243
+ state: "REMOVED" | "RETRYING" | "NOT_CONNECTED";
244
+ /** While RETRYING, the step that is pending, in the order they run: the channel connections, then the rate plans, then the room types, then the property. null otherwise, and on a replay */
245
+ step: "CHANNELS" | "RATE_PLANS" | "ROOM_TYPES" | "PROPERTY" | null;
246
+ /** While RETRYING, what was still on the channel manager when this request ended; null otherwise, and on a replay */
247
+ stillConnected: {
248
+ channels: number;
249
+ ratePlans: number | null;
250
+ roomTypes: number | null;
251
+ property: boolean;
252
+ } | null;
253
+ };
254
+ }
164
255
  export interface RoomTypesUpsert {
165
256
  /** Each ref once per request */
166
257
  roomTypes: Array<{
@@ -1013,6 +1104,24 @@ export interface Operations {
1013
1104
  body: undefined;
1014
1105
  response: Properties;
1015
1106
  };
1107
+ /** Add a hotel (a software partner's company key) */
1108
+ "POST /properties": {
1109
+ path: undefined;
1110
+ query: undefined;
1111
+ body: PropertyCreate;
1112
+ response: PropertyCreated;
1113
+ };
1114
+ /** Remove a hotel you added (a software partner's company key) */
1115
+ "DELETE /properties/{propertyId}": {
1116
+ path: {
1117
+ propertyId: string | number;
1118
+ };
1119
+ query: {
1120
+ confirm: string;
1121
+ };
1122
+ body: undefined;
1123
+ response: PropertyRemoved;
1124
+ };
1016
1125
  /** The property this key is for */
1017
1126
  "GET /property": {
1018
1127
  path: undefined;
@@ -1,7 +1,7 @@
1
1
  // GENERATED by scripts/generate.mjs from the Connect API's public contract (ZimmerStack Connect API v1).
2
2
  // Do not edit: change the contract, then run `pnpm --dir apps/connect-sdk run generate`.
3
3
  /** This package's version, sent as the user agent so ZimmerStack can tell which client a request came from. */
4
- export const SDK_VERSION = "0.4.0";
4
+ export const SDK_VERSION = "0.5.0";
5
5
  /** Where the API lives. The key is sent nowhere else. */
6
6
  export const API_ORIGIN = "https://api.zimmerstack.com";
7
7
  export const API_PREFIX = "/api/v1/connect-api/v1";
@@ -86,7 +86,15 @@ export const ERROR_CODES = [
86
86
  "RATE_OUT_OF_BAND",
87
87
  "CHANNEL_NOT_FOUND",
88
88
  "CHANNEL_SHARED",
89
- "MODIFIER_OUT_OF_BAND"
89
+ "MODIFIER_OUT_OF_BAND",
90
+ "COMPANY_KEY_REQUIRED",
91
+ "BILLING_SETUP_REQUIRED",
92
+ "OWNER_HAS_ACCOUNT",
93
+ "SANDBOX_LIMIT",
94
+ "CONFIRMATION_MISMATCH",
95
+ "PROPERTY_NOT_REMOVABLE",
96
+ "PROPERTY_BUSY",
97
+ "PRICE_UNAVAILABLE"
90
98
  ];
91
99
  /** What a key may do. The hotel's owner (or, for a vendor's key, the vendor) chose them when the key was made. */
92
100
  export const SCOPES = [
@@ -99,13 +107,16 @@ export const SCOPES = [
99
107
  "direct-bookings:cancel",
100
108
  "bookings:read",
101
109
  "bookings:write",
102
- "bookings:payments"
110
+ "bookings:payments",
111
+ "properties:write"
103
112
  ];
104
113
  /** When a channel's price modifier takes effect. Show it where a person saves one. */
105
114
  export const MODIFIER_TAKES_EFFECT = "A modifier applies to prices sent to the channel after the change. Prices already on the channel stay as they are until those nights are sent again.";
106
115
  /** idempotent: the server replays the stored answer when the idempotency key repeats, so the client may resend the request after a network failure. */
107
116
  export const OPERATIONS = {
108
117
  "GET /properties": { idempotent: false, bodyRequired: false },
118
+ "POST /properties": { idempotent: true, bodyRequired: true },
119
+ "DELETE /properties/{propertyId}": { idempotent: false, bodyRequired: false },
109
120
  "GET /property": { idempotent: false, bodyRequired: false },
110
121
  "GET /catalog": { idempotent: false, bodyRequired: false },
111
122
  "PUT /catalog/room-types": { idempotent: true, bodyRequired: true },
@@ -5,7 +5,7 @@
5
5
  * mobile app, a repository or a log line.
6
6
  */
7
7
  export { ZimmerStack } from "./client.js";
8
- export type { ClientEvent, ReadOptions, RequestArgs, WriteOptions, ZimmerStackOptions } from "./client.js";
8
+ export type { ClientEvent, RatePlanInput, ReadOptions, RequestArgs, RoomTypeInput, StructureSaved, WriteOptions, ZimmerStackOptions } from "./client.js";
9
9
  export { ZimmerStackError, ZimmerStackUsageError } from "./errors.js";
10
10
  export type { LocalErrorCode } from "./errors.js";
11
11
  export { addDays, buildGrid, channelPrice, chunk, eachDate, toRanges } from "./grid.js";
@@ -6,6 +6,8 @@ export interface ReferenceOperation {
6
6
  description: string;
7
7
  scope: string | null;
8
8
  call: string;
9
+ /** The client's other names for the same operation. */
10
+ also: string[];
9
11
  path: string[];
10
12
  query: Array<{
11
13
  name: string;