@acms-subir/client 0.1.21 → 0.1.23

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/README.md CHANGED
@@ -43,7 +43,7 @@ language. Update the site before shipping an app build with a newer client.
43
43
  | `post(slug, opts)` | Scans post summaries, then loads detail by ID; pass `collection` for ambiguous slugs |
44
44
  | `pages(opts)` | Page **summaries**, with pagination; use `page()` for sections |
45
45
  | `search(text, opts)` | Top matches in `posts`, `pages` and `events`, plus `more` per group; `types`, `collection`, `limit` (1–20, default 5). Blank text resolves empty without a request |
46
- | `events(opts)` | Occurrences with `from`, `to`, `calendar`, `tag`, `excludeTag`, `q`, pagination |
46
+ | `events(opts)` | Occurrences with `from`, `to`, `calendar`, `tag`, `excludeTag`, `room`, `q`, pagination. The filters take one value or an array (any of them matches) |
47
47
  | `event(slug, opts)` | One event by slug, whatever its date (`GET /events/{slug}`; on sites older than core 0.3.40, the first match in the requested window) |
48
48
  | `eventDetail(slug, { on? })` | The event and its next occurrence, or the one on `on` (`YYYY-MM-DD`) |
49
49
  | `calendars()` | Public calendars |
package/dist/index.d.ts CHANGED
@@ -29,12 +29,15 @@ export type EventBound = `${number}-${number}-${number}` | `${number}-${number}-
29
29
  export interface EventOptions extends ListOptions {
30
30
  from?: EventBound | (string & {});
31
31
  to?: EventBound | (string & {});
32
- calendar?: string;
33
32
  q?: string;
34
- /** only events with this public tag (its name or slug, any case) */
35
- tag?: string;
36
- /** leave out events with this public tag (its name or slug, any case) */
37
- excludeTag?: string;
33
+ /** only events in these calendars (slugs) */
34
+ calendar?: string | string[];
35
+ /** only events with one of these public tags (a name in any case, or a slug) */
36
+ tag?: string | string[];
37
+ /** leave out events with any of these public tags (a name in any case, or a slug) */
38
+ excludeTag?: string | string[];
39
+ /** only events held in one of these rooms (slugs of rooms the site shows on public events) */
40
+ room?: string | string[];
38
41
  }
39
42
  export interface SearchOptions extends RequestOptions {
40
43
  /** Which groups to search; default all three. */
package/dist/index.js CHANGED
@@ -238,7 +238,9 @@ export function createClient(options) {
238
238
  return { ...result, items: result.items.filter(p => !o.tag || p.tags.includes(o.tag)) };
239
239
  };
240
240
  const pages = (o = {}) => content({ ...o, kind: 'page' });
241
- const events = (o = {}) => request('events', o, { ...paging(o), from: o.from, to: o.to, calendar: o.calendar, tag: o.tag, excludeTag: o.excludeTag, q: o.q });
241
+ // several values travel comma-separated: tag=Class,Youth
242
+ const list = (v) => (Array.isArray(v) ? (v.length ? v.join(',') : undefined) : v);
243
+ 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 });
242
244
  const resources = (o = {}) => request('resources', o, paging(o));
243
245
  const announcements = (o = {}) => request('announcements', o, { ...paging(o), kind: o.kind, pinned: o.pinned ? 'true' : undefined });
244
246
  const paginate = {
package/dist/types.d.ts CHANGED
@@ -186,6 +186,18 @@ export type EventRoom = {
186
186
  "name": string;
187
187
  "color": string | null;
188
188
  };
189
+ export type OccurrenceMoved = ({
190
+ "from": {
191
+ "start": string;
192
+ "end": string;
193
+ };
194
+ "note": string;
195
+ "location": ({
196
+ "name": string;
197
+ "address": string;
198
+ "url": string;
199
+ }) | (null);
200
+ }) | (null);
189
201
  export type Event = {
190
202
  "id": string;
191
203
  "slug": string;
@@ -264,6 +276,13 @@ export type Event = {
264
276
  "name": string;
265
277
  "color": string | null;
266
278
  }>;
279
+ "movedDates": {
280
+ [key: string]: {
281
+ "start": string;
282
+ "end": string;
283
+ "note": string;
284
+ };
285
+ };
267
286
  "notify": {
268
287
  "changes": Array<string>;
269
288
  };
@@ -284,6 +303,18 @@ export type Events = {
284
303
  "end": string;
285
304
  "allDay": boolean;
286
305
  "cancelled": boolean;
306
+ "moved": ({
307
+ "from": {
308
+ "start": string;
309
+ "end": string;
310
+ };
311
+ "note": string;
312
+ "location": ({
313
+ "name": string;
314
+ "address": string;
315
+ "url": string;
316
+ }) | (null);
317
+ }) | (null);
287
318
  "rooms": Array<{
288
319
  "slug": string;
289
320
  "name": string;
@@ -367,6 +398,13 @@ export type Events = {
367
398
  "name": string;
368
399
  "color": string | null;
369
400
  }>;
401
+ "movedDates": {
402
+ [key: string]: {
403
+ "start": string;
404
+ "end": string;
405
+ "note": string;
406
+ };
407
+ };
370
408
  "notify": {
371
409
  "changes": Array<string>;
372
410
  };
@@ -381,6 +419,18 @@ export type EventDetail = {
381
419
  "end": string;
382
420
  "allDay": boolean;
383
421
  "cancelled": boolean;
422
+ "moved": ({
423
+ "from": {
424
+ "start": string;
425
+ "end": string;
426
+ };
427
+ "note": string;
428
+ "location": ({
429
+ "name": string;
430
+ "address": string;
431
+ "url": string;
432
+ }) | (null);
433
+ }) | (null);
384
434
  "rooms": Array<{
385
435
  "slug": string;
386
436
  "name": string;
@@ -465,6 +515,13 @@ export type EventDetail = {
465
515
  "name": string;
466
516
  "color": string | null;
467
517
  }>;
518
+ "movedDates": {
519
+ [key: string]: {
520
+ "start": string;
521
+ "end": string;
522
+ "note": string;
523
+ };
524
+ };
468
525
  "notify": {
469
526
  "changes": Array<string>;
470
527
  };
@@ -532,6 +589,18 @@ export type SearchResults = {
532
589
  "end": string;
533
590
  "allDay": boolean;
534
591
  "cancelled": boolean;
592
+ "moved": ({
593
+ "from": {
594
+ "start": string;
595
+ "end": string;
596
+ };
597
+ "note": string;
598
+ "location": ({
599
+ "name": string;
600
+ "address": string;
601
+ "url": string;
602
+ }) | (null);
603
+ }) | (null);
535
604
  "rooms": Array<{
536
605
  "slug": string;
537
606
  "name": string;
@@ -616,6 +685,13 @@ export type SearchResults = {
616
685
  "name": string;
617
686
  "color": string | null;
618
687
  }>;
688
+ "movedDates": {
689
+ [key: string]: {
690
+ "start": string;
691
+ "end": string;
692
+ "note": string;
693
+ };
694
+ };
619
695
  "notify": {
620
696
  "changes": Array<string>;
621
697
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acms-subir/client",
3
- "version": "0.1.21",
3
+ "version": "0.1.23",
4
4
  "description": "Typed, dependency-free client for the ACMS public mobile API.",
5
5
  "type": "module",
6
6
  "license": "MIT",