@medalsocial/sdk 1.8.0 → 1.9.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.
@@ -324,14 +324,75 @@ var BookingsManage = class {
324
324
  );
325
325
  }
326
326
  };
327
+ var BookingsPersons = class {
328
+ constructor(client) {
329
+ this.client = client;
330
+ }
331
+ client;
332
+ /** Persons a contact books for. Active-only unless `include_inactive`. */
333
+ async list(contactId, options) {
334
+ const params = { contact_id: contactId };
335
+ if (options?.include_inactive !== void 0) {
336
+ params.include_inactive = String(options.include_inactive);
337
+ }
338
+ return this.client.get("/api/v1/bookings/persons", params);
339
+ }
340
+ /** Add a person under a contact. */
341
+ async create(input, options) {
342
+ return this.client.postOnce("/api/v1/bookings/persons", input, options);
343
+ }
344
+ };
345
+ var BookingsRelations = class {
346
+ constructor(client) {
347
+ this.client = client;
348
+ }
349
+ client;
350
+ /** Relations a contact holds, split into outgoing and incoming. */
351
+ async list(contactId) {
352
+ return this.client.get("/api/v1/bookings/relations", { contact_id: contactId });
353
+ }
354
+ /** Create a relation from one contact to another. */
355
+ async create(input, options) {
356
+ return this.client.postOnce("/api/v1/bookings/relations", input, options);
357
+ }
358
+ };
359
+ var BookingsEvents = class {
360
+ constructor(client) {
361
+ this.client = client;
362
+ }
363
+ client;
364
+ /** Arrangementer in a date range (`yyyy-mm-dd`, inclusive). */
365
+ async list(options) {
366
+ const params = { from: options.from, to: options.to };
367
+ if (options.status) params.status = options.status;
368
+ return this.client.get("/api/v1/bookings/events", params);
369
+ }
370
+ /** Get an arrangement by ID. */
371
+ async get(id) {
372
+ return this.client.get(`/api/v1/bookings/events/${encodeURIComponent(id)}`);
373
+ }
374
+ /** Create an arrangement from a template. */
375
+ async create(input, options) {
376
+ return this.client.postOnce("/api/v1/bookings/events", input, options);
377
+ }
378
+ };
327
379
  var Bookings = class {
328
380
  constructor(client) {
329
381
  this.client = client;
330
382
  this.manage = new BookingsManage(client);
383
+ this.persons = new BookingsPersons(client);
384
+ this.relations = new BookingsRelations(client);
385
+ this.events = new BookingsEvents(client);
331
386
  }
332
387
  client;
333
388
  /** Customer-side actions addressed by manage token. */
334
389
  manage;
390
+ /** Persons a contact books for — children, pets, employees. */
391
+ persons;
392
+ /** Directional relations between contacts. */
393
+ relations;
394
+ /** Arrangementer — scheduled group sessions bookings register against. */
395
+ events;
335
396
  /** List the bookable service catalogue. Active-only unless asked otherwise. */
336
397
  async listServices(options) {
337
398
  const params = {};