@acms-subir/client 0.1.26 → 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 +8 -1
- package/dist/index.js +5 -5
- package/dist/types.d.ts +75 -1
- package/package.json +1 -1
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;
|
|
@@ -2139,6 +2169,11 @@ export type EditorResource = {
|
|
|
2139
2169
|
"color": string;
|
|
2140
2170
|
"showOnEvents": boolean;
|
|
2141
2171
|
"requestable": boolean;
|
|
2172
|
+
"translations": {
|
|
2173
|
+
[key: string]: {
|
|
2174
|
+
"name": string;
|
|
2175
|
+
};
|
|
2176
|
+
};
|
|
2142
2177
|
"placeId": string;
|
|
2143
2178
|
"order": number;
|
|
2144
2179
|
"createdAt": string;
|
|
@@ -2213,6 +2248,12 @@ export type EditorResource = {
|
|
|
2213
2248
|
"confirmMessage": string;
|
|
2214
2249
|
"redirectUrl": string;
|
|
2215
2250
|
"active": boolean;
|
|
2251
|
+
"translations": {
|
|
2252
|
+
[key: string]: {
|
|
2253
|
+
"name": string;
|
|
2254
|
+
"description": string;
|
|
2255
|
+
};
|
|
2256
|
+
};
|
|
2216
2257
|
"order": number;
|
|
2217
2258
|
"createdAt": string;
|
|
2218
2259
|
"updatedAt": string;
|
|
@@ -2276,6 +2317,11 @@ export type EditorResourceList = {
|
|
|
2276
2317
|
"color": string;
|
|
2277
2318
|
"showOnEvents": boolean;
|
|
2278
2319
|
"requestable": boolean;
|
|
2320
|
+
"translations": {
|
|
2321
|
+
[key: string]: {
|
|
2322
|
+
"name": string;
|
|
2323
|
+
};
|
|
2324
|
+
};
|
|
2279
2325
|
"placeId": string;
|
|
2280
2326
|
"order": number;
|
|
2281
2327
|
"createdAt": string;
|
|
@@ -2350,6 +2396,12 @@ export type EditorResourceList = {
|
|
|
2350
2396
|
"confirmMessage": string;
|
|
2351
2397
|
"redirectUrl": string;
|
|
2352
2398
|
"active": boolean;
|
|
2399
|
+
"translations": {
|
|
2400
|
+
[key: string]: {
|
|
2401
|
+
"name": string;
|
|
2402
|
+
"description": string;
|
|
2403
|
+
};
|
|
2404
|
+
};
|
|
2353
2405
|
"order": number;
|
|
2354
2406
|
"createdAt": string;
|
|
2355
2407
|
"updatedAt": string;
|
|
@@ -2758,6 +2810,11 @@ export type EditorResourceInput = {
|
|
|
2758
2810
|
"color"?: ("") | (string);
|
|
2759
2811
|
"showOnEvents"?: boolean;
|
|
2760
2812
|
"requestable"?: boolean;
|
|
2813
|
+
"translations"?: {
|
|
2814
|
+
[key: string]: {
|
|
2815
|
+
"name": string;
|
|
2816
|
+
};
|
|
2817
|
+
};
|
|
2761
2818
|
"busyFeeds"?: Array<string>;
|
|
2762
2819
|
"notifyEmails"?: Array<string>;
|
|
2763
2820
|
};
|
|
@@ -2815,6 +2872,11 @@ export type EditorResourcePatch = {
|
|
|
2815
2872
|
"color"?: ("") | (string);
|
|
2816
2873
|
"showOnEvents"?: boolean;
|
|
2817
2874
|
"requestable"?: boolean;
|
|
2875
|
+
"translations"?: {
|
|
2876
|
+
[key: string]: {
|
|
2877
|
+
"name": string;
|
|
2878
|
+
};
|
|
2879
|
+
};
|
|
2818
2880
|
"busyFeeds"?: Array<string>;
|
|
2819
2881
|
"notifyEmails"?: Array<string>;
|
|
2820
2882
|
};
|
|
@@ -2885,6 +2947,12 @@ export type EditorLinkInput = {
|
|
|
2885
2947
|
"redirectUrl"?: string;
|
|
2886
2948
|
"active"?: boolean;
|
|
2887
2949
|
"changeCutoff"?: number;
|
|
2950
|
+
"translations"?: {
|
|
2951
|
+
[key: string]: {
|
|
2952
|
+
"name"?: string;
|
|
2953
|
+
"description"?: string;
|
|
2954
|
+
};
|
|
2955
|
+
};
|
|
2888
2956
|
};
|
|
2889
2957
|
export type EditorLinkPatch = {
|
|
2890
2958
|
"name"?: string;
|
|
@@ -2953,6 +3021,12 @@ export type EditorLinkPatch = {
|
|
|
2953
3021
|
"redirectUrl"?: string;
|
|
2954
3022
|
"active"?: boolean;
|
|
2955
3023
|
"changeCutoff"?: number;
|
|
3024
|
+
"translations"?: {
|
|
3025
|
+
[key: string]: {
|
|
3026
|
+
"name"?: string;
|
|
3027
|
+
"description"?: string;
|
|
3028
|
+
};
|
|
3029
|
+
};
|
|
2956
3030
|
};
|
|
2957
3031
|
export type EditorBlockInput = {
|
|
2958
3032
|
"start": string;
|