@acms-subir/client 0.1.27 → 0.1.29

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;
@@ -2131,6 +2161,8 @@ export type EditorResource = {
2131
2161
  "end": string;
2132
2162
  }>;
2133
2163
  "label": string;
2164
+ "kind"?: "closed" | "limit" | "open";
2165
+ "linkIds"?: Array<string>;
2134
2166
  }>;
2135
2167
  "busyFeeds": Array<string>;
2136
2168
  "notifyEmails": Array<string>;
@@ -2218,6 +2250,12 @@ export type EditorResource = {
2218
2250
  "confirmMessage": string;
2219
2251
  "redirectUrl": string;
2220
2252
  "active": boolean;
2253
+ "translations": {
2254
+ [key: string]: {
2255
+ "name": string;
2256
+ "description": string;
2257
+ };
2258
+ };
2221
2259
  "order": number;
2222
2260
  "createdAt": string;
2223
2261
  "updatedAt": string;
@@ -2273,6 +2311,8 @@ export type EditorResourceList = {
2273
2311
  "end": string;
2274
2312
  }>;
2275
2313
  "label": string;
2314
+ "kind"?: "closed" | "limit" | "open";
2315
+ "linkIds"?: Array<string>;
2276
2316
  }>;
2277
2317
  "busyFeeds": Array<string>;
2278
2318
  "notifyEmails": Array<string>;
@@ -2360,6 +2400,12 @@ export type EditorResourceList = {
2360
2400
  "confirmMessage": string;
2361
2401
  "redirectUrl": string;
2362
2402
  "active": boolean;
2403
+ "translations": {
2404
+ [key: string]: {
2405
+ "name": string;
2406
+ "description": string;
2407
+ };
2408
+ };
2363
2409
  "order": number;
2364
2410
  "createdAt": string;
2365
2411
  "updatedAt": string;
@@ -2761,6 +2807,8 @@ export type EditorResourceInput = {
2761
2807
  "end": string;
2762
2808
  }>;
2763
2809
  "label"?: string;
2810
+ "kind"?: "closed" | "limit" | "open";
2811
+ "linkIds"?: Array<string>;
2764
2812
  }>;
2765
2813
  "visibility"?: "public" | "unlisted";
2766
2814
  "showOnCalendar"?: boolean;
@@ -2823,6 +2871,8 @@ export type EditorResourcePatch = {
2823
2871
  "end": string;
2824
2872
  }>;
2825
2873
  "label"?: string;
2874
+ "kind"?: "closed" | "limit" | "open";
2875
+ "linkIds"?: Array<string>;
2826
2876
  }>;
2827
2877
  "visibility"?: "public" | "unlisted";
2828
2878
  "showOnCalendar"?: boolean;
@@ -2905,6 +2955,12 @@ export type EditorLinkInput = {
2905
2955
  "redirectUrl"?: string;
2906
2956
  "active"?: boolean;
2907
2957
  "changeCutoff"?: number;
2958
+ "translations"?: {
2959
+ [key: string]: {
2960
+ "name"?: string;
2961
+ "description"?: string;
2962
+ };
2963
+ };
2908
2964
  };
2909
2965
  export type EditorLinkPatch = {
2910
2966
  "name"?: string;
@@ -2973,6 +3029,12 @@ export type EditorLinkPatch = {
2973
3029
  "redirectUrl"?: string;
2974
3030
  "active"?: boolean;
2975
3031
  "changeCutoff"?: number;
3032
+ "translations"?: {
3033
+ [key: string]: {
3034
+ "name"?: string;
3035
+ "description"?: string;
3036
+ };
3037
+ };
2976
3038
  };
2977
3039
  export type EditorBlockInput = {
2978
3040
  "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.29",
4
4
  "description": "Typed, dependency-free client for the ACMS public mobile API.",
5
5
  "type": "module",
6
6
  "license": "MIT",