@acms-subir/client 0.1.27 → 0.1.28

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/dist/index.d.ts CHANGED
@@ -36,8 +36,15 @@ export interface EventOptions extends ListOptions {
36
36
  tag?: string | string[];
37
37
  /** leave out events with any of these public tags (a name in any case, or a slug) */
38
38
  excludeTag?: string | string[];
39
- /** only events held in one of these rooms (slugs of rooms the site shows on public events) */
39
+ /** only events held in one of these rooms (slugs of rooms the site shows on public events); narrows `bookings` too */
40
40
  room?: string | string[];
41
+ /**
42
+ * Also the confirmed bookings of rooms the site shows on the calendar, as
43
+ * `bookings` (with the first page): each named by its booking link in the
44
+ * client's language ("Rehearsal", "Ensayo"), with its time and room, never
45
+ * who booked. `calendar`, `tag` and `excludeTag` don't narrow them. Needs core 0.3.63 or later.
46
+ */
47
+ bookings?: boolean;
41
48
  }
42
49
  export interface SearchOptions extends RequestOptions {
43
50
  /** Which groups to search; default all three. */
package/dist/index.js CHANGED
@@ -39,11 +39,11 @@ export const endpoints = {
39
39
  };
40
40
  // site: its legal links; pushTopics: topic names; form: its questions;
41
41
  // submitForm: the receipt's thank-you (any site ignores it on that POST);
42
- // requestOptions: the kinds and the site's words
43
- const localized = new Set(['home', 'page', 'content', 'contentById', 'search', 'events', 'rsvpStatus', 'site', 'pushTopics', 'announcements', 'announcement', 'eventDetail', 'form', 'submitForm', 'requestOptions']);
42
+ // requestOptions: the kinds and the site's words; resources: room and booking link names
43
+ const localized = new Set(['home', 'page', 'content', 'contentById', 'search', 'events', 'rsvpStatus', 'site', 'pushTopics', 'announcements', 'announcement', 'eventDetail', 'form', 'submitForm', 'requestOptions', 'resources']);
44
44
  // localized later (site, pushTopics: core 0.3.32; form: with form
45
- // translations); older sites answer ?locale= with a 400, so ask them again without it
46
- const lateLocalized = new Set(['site', 'pushTopics', 'form']);
45
+ // translations; resources: core 0.3.63); older sites answer ?locale= with a 400, so ask them again without it
46
+ const lateLocalized = new Set(['site', 'pushTopics', 'form', 'resources']);
47
47
  function uuid() {
48
48
  if (globalThis.crypto?.randomUUID)
49
49
  return globalThis.crypto.randomUUID();
@@ -245,7 +245,7 @@ export function createClient(options) {
245
245
  const pages = (o = {}) => content({ ...o, kind: 'page' });
246
246
  // several values travel comma-separated: tag=Class,Youth
247
247
  const list = (v) => (Array.isArray(v) ? (v.length ? v.join(',') : undefined) : v);
248
- const events = (o = {}) => request('events', o, { ...paging(o), from: o.from, to: o.to, calendar: list(o.calendar), tag: list(o.tag), excludeTag: list(o.excludeTag), room: list(o.room), q: o.q });
248
+ const events = (o = {}) => request('events', o, { ...paging(o), from: o.from, to: o.to, calendar: list(o.calendar), tag: list(o.tag), excludeTag: list(o.excludeTag), room: list(o.room), bookings: o.bookings ? '1' : undefined, q: o.q });
249
249
  const resources = (o = {}) => request('resources', o, paging(o));
250
250
  const announcements = (o = {}) => request('announcements', o, { ...paging(o), kind: o.kind, pinned: o.pinned ? 'true' : undefined });
251
251
  const paginate = {
package/dist/types.d.ts CHANGED
@@ -347,6 +347,18 @@ export type Event = {
347
347
  "changes": Array<string>;
348
348
  };
349
349
  };
350
+ export type ScheduleBooking = {
351
+ "id": string;
352
+ "title": string;
353
+ "start": string;
354
+ "end": string;
355
+ "allDay": boolean;
356
+ "rooms": Array<{
357
+ "slug": string;
358
+ "name": string;
359
+ "color": string | null;
360
+ }>;
361
+ };
350
362
  export type Events = {
351
363
  "locale": string | null;
352
364
  "timezone": string;
@@ -510,6 +522,18 @@ export type Events = {
510
522
  };
511
523
  };
512
524
  }>;
525
+ "bookings"?: Array<{
526
+ "id": string;
527
+ "title": string;
528
+ "start": string;
529
+ "end": string;
530
+ "allDay": boolean;
531
+ "rooms": Array<{
532
+ "slug": string;
533
+ "name": string;
534
+ "color": string | null;
535
+ }>;
536
+ }>;
513
537
  };
514
538
  export type EventDetail = {
515
539
  "locale": string | null;
@@ -1146,7 +1170,7 @@ export type Resources = {
1146
1170
  "name": string;
1147
1171
  "kind": string;
1148
1172
  "description": string;
1149
- "capacity": number;
1173
+ "capacity": number | null;
1150
1174
  "amenities": Array<string>;
1151
1175
  "photo": string;
1152
1176
  "timezone": string;
@@ -2079,6 +2103,12 @@ export type EditorBookingLink = {
2079
2103
  "confirmMessage": string;
2080
2104
  "redirectUrl": string;
2081
2105
  "active": boolean;
2106
+ "translations": {
2107
+ [key: string]: {
2108
+ "name": string;
2109
+ "description": string;
2110
+ };
2111
+ };
2082
2112
  "order": number;
2083
2113
  "createdAt": string;
2084
2114
  "updatedAt": string;
@@ -2218,6 +2248,12 @@ export type EditorResource = {
2218
2248
  "confirmMessage": string;
2219
2249
  "redirectUrl": string;
2220
2250
  "active": boolean;
2251
+ "translations": {
2252
+ [key: string]: {
2253
+ "name": string;
2254
+ "description": string;
2255
+ };
2256
+ };
2221
2257
  "order": number;
2222
2258
  "createdAt": string;
2223
2259
  "updatedAt": string;
@@ -2360,6 +2396,12 @@ export type EditorResourceList = {
2360
2396
  "confirmMessage": string;
2361
2397
  "redirectUrl": string;
2362
2398
  "active": boolean;
2399
+ "translations": {
2400
+ [key: string]: {
2401
+ "name": string;
2402
+ "description": string;
2403
+ };
2404
+ };
2363
2405
  "order": number;
2364
2406
  "createdAt": string;
2365
2407
  "updatedAt": string;
@@ -2905,6 +2947,12 @@ export type EditorLinkInput = {
2905
2947
  "redirectUrl"?: string;
2906
2948
  "active"?: boolean;
2907
2949
  "changeCutoff"?: number;
2950
+ "translations"?: {
2951
+ [key: string]: {
2952
+ "name"?: string;
2953
+ "description"?: string;
2954
+ };
2955
+ };
2908
2956
  };
2909
2957
  export type EditorLinkPatch = {
2910
2958
  "name"?: string;
@@ -2973,6 +3021,12 @@ export type EditorLinkPatch = {
2973
3021
  "redirectUrl"?: string;
2974
3022
  "active"?: boolean;
2975
3023
  "changeCutoff"?: number;
3024
+ "translations"?: {
3025
+ [key: string]: {
3026
+ "name"?: string;
3027
+ "description"?: string;
3028
+ };
3029
+ };
2976
3030
  };
2977
3031
  export type EditorBlockInput = {
2978
3032
  "start": string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acms-subir/client",
3
- "version": "0.1.27",
3
+ "version": "0.1.28",
4
4
  "description": "Typed, dependency-free client for the ACMS public mobile API.",
5
5
  "type": "module",
6
6
  "license": "MIT",