@acms-subir/client 0.1.23 → 0.1.24

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
@@ -325,9 +325,13 @@ export interface AcmsClient {
325
325
  announcements(o?: AnnouncementOptions): Promise<Announcements>;
326
326
  /** One announcement that is up; 404 once it came down. */
327
327
  announcement(id: string, o?: RequestOptions): Promise<AnnouncementDetail>;
328
- /** A published form's questions. 410 when it stopped accepting responses. Requires `site.features.forms`. */
328
+ /**
329
+ * A published form's questions, in the client's `locale` where the form has
330
+ * its words (older sites: the main language). 410 when it stopped accepting
331
+ * responses. Requires `site.features.forms`. A `time` answer is HH:mm (24-hour).
332
+ */
329
333
  form(id: string, o?: RequestOptions): Promise<Form>;
330
- /** Send answers (checkbox groups as arrays). Retries reuse the same Idempotency-Key, so they never duplicate. */
334
+ /** Send answers (checkbox groups as arrays; a choice as it was shown). Retries reuse the same Idempotency-Key, so they never duplicate. The receipt's `confirmation` is in the client's `locale`. */
331
335
  submitForm(id: string, input: FormResponseInput & {
332
336
  idempotencyKey?: string;
333
337
  }, o?: RequestOptions): Promise<FormReceipt>;
package/dist/index.js CHANGED
@@ -35,10 +35,12 @@ export const endpoints = {
35
35
  requestGuestCode: { method: 'POST', path: '/guest/code' }, guestSignIn: { method: 'POST', path: '/guest/token' },
36
36
  guestBookings: { method: 'GET', path: '/guest/bookings' }, guestSignOut: { method: 'POST', path: '/guest/revoke' },
37
37
  };
38
- // site: its legal links; pushTopics: topic names
39
- const localized = new Set(['home', 'page', 'content', 'contentById', 'search', 'events', 'rsvpStatus', 'site', 'pushTopics', 'announcements', 'announcement', 'eventDetail']);
40
- // localized since core 0.3.32; older sites answer ?locale= with a 400, so ask them again without it
41
- const lateLocalized = new Set(['site', 'pushTopics']);
38
+ // site: its legal links; pushTopics: topic names; form: its questions;
39
+ // submitForm: the receipt's thank-you (any site ignores it on that POST)
40
+ const localized = new Set(['home', 'page', 'content', 'contentById', 'search', 'events', 'rsvpStatus', 'site', 'pushTopics', 'announcements', 'announcement', 'eventDetail', 'form', 'submitForm']);
41
+ // localized later (site, pushTopics: core 0.3.32; form: with form
42
+ // translations); older sites answer ?locale= with a 400, so ask them again without it
43
+ const lateLocalized = new Set(['site', 'pushTopics', 'form']);
42
44
  function uuid() {
43
45
  if (globalThis.crypto?.randomUUID)
44
46
  return globalThis.crypto.randomUUID();
package/dist/types.d.ts CHANGED
@@ -248,7 +248,7 @@ export type Event = {
248
248
  "confirmation": string;
249
249
  "fields": Array<{
250
250
  "id": string;
251
- "type": "text" | "textarea" | "email" | "phone" | "number" | "select" | "checkbox" | "date" | "radio" | "checkboxes" | "url" | "consent" | "heading";
251
+ "type": "text" | "textarea" | "email" | "phone" | "number" | "select" | "checkbox" | "date" | "radio" | "checkboxes" | "url" | "consent" | "heading" | "time";
252
252
  "label": string;
253
253
  "required": boolean;
254
254
  "help": string;
@@ -256,7 +256,23 @@ export type Event = {
256
256
  "placeholder"?: string;
257
257
  "width"?: "full" | "half";
258
258
  "allowOther"?: boolean;
259
+ "translations"?: {
260
+ [key: string]: {
261
+ "label"?: string;
262
+ "help"?: string;
263
+ "placeholder"?: string;
264
+ "options"?: Array<string>;
265
+ };
266
+ };
259
267
  }>;
268
+ "translations"?: {
269
+ [key: string]: {
270
+ "title"?: string;
271
+ "intro"?: string;
272
+ "submitLabel"?: string;
273
+ "confirmation"?: string;
274
+ };
275
+ };
260
276
  };
261
277
  };
262
278
  "url": string;
@@ -370,7 +386,7 @@ export type Events = {
370
386
  "confirmation": string;
371
387
  "fields": Array<{
372
388
  "id": string;
373
- "type": "text" | "textarea" | "email" | "phone" | "number" | "select" | "checkbox" | "date" | "radio" | "checkboxes" | "url" | "consent" | "heading";
389
+ "type": "text" | "textarea" | "email" | "phone" | "number" | "select" | "checkbox" | "date" | "radio" | "checkboxes" | "url" | "consent" | "heading" | "time";
374
390
  "label": string;
375
391
  "required": boolean;
376
392
  "help": string;
@@ -378,7 +394,23 @@ export type Events = {
378
394
  "placeholder"?: string;
379
395
  "width"?: "full" | "half";
380
396
  "allowOther"?: boolean;
397
+ "translations"?: {
398
+ [key: string]: {
399
+ "label"?: string;
400
+ "help"?: string;
401
+ "placeholder"?: string;
402
+ "options"?: Array<string>;
403
+ };
404
+ };
381
405
  }>;
406
+ "translations"?: {
407
+ [key: string]: {
408
+ "title"?: string;
409
+ "intro"?: string;
410
+ "submitLabel"?: string;
411
+ "confirmation"?: string;
412
+ };
413
+ };
382
414
  };
383
415
  };
384
416
  "url": string;
@@ -487,7 +519,7 @@ export type EventDetail = {
487
519
  "confirmation": string;
488
520
  "fields": Array<{
489
521
  "id": string;
490
- "type": "text" | "textarea" | "email" | "phone" | "number" | "select" | "checkbox" | "date" | "radio" | "checkboxes" | "url" | "consent" | "heading";
522
+ "type": "text" | "textarea" | "email" | "phone" | "number" | "select" | "checkbox" | "date" | "radio" | "checkboxes" | "url" | "consent" | "heading" | "time";
491
523
  "label": string;
492
524
  "required": boolean;
493
525
  "help": string;
@@ -495,7 +527,23 @@ export type EventDetail = {
495
527
  "placeholder"?: string;
496
528
  "width"?: "full" | "half";
497
529
  "allowOther"?: boolean;
530
+ "translations"?: {
531
+ [key: string]: {
532
+ "label"?: string;
533
+ "help"?: string;
534
+ "placeholder"?: string;
535
+ "options"?: Array<string>;
536
+ };
537
+ };
498
538
  }>;
539
+ "translations"?: {
540
+ [key: string]: {
541
+ "title"?: string;
542
+ "intro"?: string;
543
+ "submitLabel"?: string;
544
+ "confirmation"?: string;
545
+ };
546
+ };
499
547
  };
500
548
  };
501
549
  "url": string;
@@ -657,7 +705,7 @@ export type SearchResults = {
657
705
  "confirmation": string;
658
706
  "fields": Array<{
659
707
  "id": string;
660
- "type": "text" | "textarea" | "email" | "phone" | "number" | "select" | "checkbox" | "date" | "radio" | "checkboxes" | "url" | "consent" | "heading";
708
+ "type": "text" | "textarea" | "email" | "phone" | "number" | "select" | "checkbox" | "date" | "radio" | "checkboxes" | "url" | "consent" | "heading" | "time";
661
709
  "label": string;
662
710
  "required": boolean;
663
711
  "help": string;
@@ -665,7 +713,23 @@ export type SearchResults = {
665
713
  "placeholder"?: string;
666
714
  "width"?: "full" | "half";
667
715
  "allowOther"?: boolean;
716
+ "translations"?: {
717
+ [key: string]: {
718
+ "label"?: string;
719
+ "help"?: string;
720
+ "placeholder"?: string;
721
+ "options"?: Array<string>;
722
+ };
723
+ };
668
724
  }>;
725
+ "translations"?: {
726
+ [key: string]: {
727
+ "title"?: string;
728
+ "intro"?: string;
729
+ "submitLabel"?: string;
730
+ "confirmation"?: string;
731
+ };
732
+ };
669
733
  };
670
734
  };
671
735
  "url": string;
@@ -799,7 +863,7 @@ export type Form = {
799
863
  "confirmation": string;
800
864
  "fields": Array<{
801
865
  "id": string;
802
- "type": "text" | "textarea" | "email" | "phone" | "number" | "select" | "checkbox" | "date" | "radio" | "checkboxes" | "url" | "consent" | "heading";
866
+ "type": "text" | "textarea" | "email" | "phone" | "number" | "select" | "checkbox" | "date" | "radio" | "checkboxes" | "url" | "consent" | "heading" | "time";
803
867
  "label": string;
804
868
  "required": boolean;
805
869
  "help": string;
@@ -843,7 +907,7 @@ export type RsvpStatus = {
843
907
  "confirmation": string;
844
908
  "fields": Array<{
845
909
  "id": string;
846
- "type": "text" | "textarea" | "email" | "phone" | "number" | "select" | "checkbox" | "date" | "radio" | "checkboxes" | "url" | "consent" | "heading";
910
+ "type": "text" | "textarea" | "email" | "phone" | "number" | "select" | "checkbox" | "date" | "radio" | "checkboxes" | "url" | "consent" | "heading" | "time";
847
911
  "label": string;
848
912
  "required": boolean;
849
913
  "help": string;
@@ -1041,7 +1105,7 @@ export type BookingResult = {
1041
1105
  "confirmation": string;
1042
1106
  "fields": Array<{
1043
1107
  "id": string;
1044
- "type": "text" | "textarea" | "email" | "phone" | "number" | "select" | "checkbox" | "date" | "radio" | "checkboxes" | "url" | "consent" | "heading";
1108
+ "type": "text" | "textarea" | "email" | "phone" | "number" | "select" | "checkbox" | "date" | "radio" | "checkboxes" | "url" | "consent" | "heading" | "time";
1045
1109
  "label": string;
1046
1110
  "required": boolean;
1047
1111
  "help": string;
@@ -1049,7 +1113,23 @@ export type BookingResult = {
1049
1113
  "placeholder"?: string;
1050
1114
  "width"?: "full" | "half";
1051
1115
  "allowOther"?: boolean;
1116
+ "translations"?: {
1117
+ [key: string]: {
1118
+ "label"?: string;
1119
+ "help"?: string;
1120
+ "placeholder"?: string;
1121
+ "options"?: Array<string>;
1122
+ };
1123
+ };
1052
1124
  }>;
1125
+ "translations"?: {
1126
+ [key: string]: {
1127
+ "title"?: string;
1128
+ "intro"?: string;
1129
+ "submitLabel"?: string;
1130
+ "confirmation"?: string;
1131
+ };
1132
+ };
1053
1133
  };
1054
1134
  "answers": {
1055
1135
  [key: string]: string;
@@ -1412,7 +1492,7 @@ export type EditorDocument = {
1412
1492
  "confirmation": string;
1413
1493
  "fields": Array<{
1414
1494
  "id": string;
1415
- "type": "text" | "textarea" | "email" | "phone" | "number" | "select" | "checkbox" | "date" | "radio" | "checkboxes" | "url" | "consent" | "heading";
1495
+ "type": "text" | "textarea" | "email" | "phone" | "number" | "select" | "checkbox" | "date" | "radio" | "checkboxes" | "url" | "consent" | "heading" | "time";
1416
1496
  "label": string;
1417
1497
  "required": boolean;
1418
1498
  "help": string;
@@ -1420,7 +1500,23 @@ export type EditorDocument = {
1420
1500
  "placeholder"?: string;
1421
1501
  "width"?: "full" | "half";
1422
1502
  "allowOther"?: boolean;
1503
+ "translations"?: {
1504
+ [key: string]: {
1505
+ "label"?: string;
1506
+ "help"?: string;
1507
+ "placeholder"?: string;
1508
+ "options"?: Array<string>;
1509
+ };
1510
+ };
1423
1511
  }>;
1512
+ "translations"?: {
1513
+ [key: string]: {
1514
+ "title"?: string;
1515
+ "intro"?: string;
1516
+ "submitLabel"?: string;
1517
+ "confirmation"?: string;
1518
+ };
1519
+ };
1424
1520
  };
1425
1521
  };
1426
1522
  }) | (null);
@@ -1615,7 +1711,7 @@ export type EditorBooking = {
1615
1711
  "confirmation": string;
1616
1712
  "fields": Array<{
1617
1713
  "id": string;
1618
- "type": "text" | "textarea" | "email" | "phone" | "number" | "select" | "checkbox" | "date" | "radio" | "checkboxes" | "url" | "consent" | "heading";
1714
+ "type": "text" | "textarea" | "email" | "phone" | "number" | "select" | "checkbox" | "date" | "radio" | "checkboxes" | "url" | "consent" | "heading" | "time";
1619
1715
  "label": string;
1620
1716
  "required": boolean;
1621
1717
  "help": string;
@@ -1623,7 +1719,23 @@ export type EditorBooking = {
1623
1719
  "placeholder"?: string;
1624
1720
  "width"?: "full" | "half";
1625
1721
  "allowOther"?: boolean;
1722
+ "translations"?: {
1723
+ [key: string]: {
1724
+ "label"?: string;
1725
+ "help"?: string;
1726
+ "placeholder"?: string;
1727
+ "options"?: Array<string>;
1728
+ };
1729
+ };
1626
1730
  }>;
1731
+ "translations"?: {
1732
+ [key: string]: {
1733
+ "title"?: string;
1734
+ "intro"?: string;
1735
+ "submitLabel"?: string;
1736
+ "confirmation"?: string;
1737
+ };
1738
+ };
1627
1739
  };
1628
1740
  "answers": {
1629
1741
  [key: string]: string;
@@ -1662,7 +1774,7 @@ export type EditorBookingList = {
1662
1774
  "confirmation": string;
1663
1775
  "fields": Array<{
1664
1776
  "id": string;
1665
- "type": "text" | "textarea" | "email" | "phone" | "number" | "select" | "checkbox" | "date" | "radio" | "checkboxes" | "url" | "consent" | "heading";
1777
+ "type": "text" | "textarea" | "email" | "phone" | "number" | "select" | "checkbox" | "date" | "radio" | "checkboxes" | "url" | "consent" | "heading" | "time";
1666
1778
  "label": string;
1667
1779
  "required": boolean;
1668
1780
  "help": string;
@@ -1670,7 +1782,23 @@ export type EditorBookingList = {
1670
1782
  "placeholder"?: string;
1671
1783
  "width"?: "full" | "half";
1672
1784
  "allowOther"?: boolean;
1785
+ "translations"?: {
1786
+ [key: string]: {
1787
+ "label"?: string;
1788
+ "help"?: string;
1789
+ "placeholder"?: string;
1790
+ "options"?: Array<string>;
1791
+ };
1792
+ };
1673
1793
  }>;
1794
+ "translations"?: {
1795
+ [key: string]: {
1796
+ "title"?: string;
1797
+ "intro"?: string;
1798
+ "submitLabel"?: string;
1799
+ "confirmation"?: string;
1800
+ };
1801
+ };
1674
1802
  };
1675
1803
  "answers": {
1676
1804
  [key: string]: string;
@@ -2353,7 +2481,7 @@ export type EditorSaveInput = {
2353
2481
  "confirmation"?: string;
2354
2482
  "fields"?: Array<{
2355
2483
  "id": string;
2356
- "type": "text" | "textarea" | "email" | "phone" | "number" | "select" | "checkbox" | "date" | "radio" | "checkboxes" | "url" | "consent" | "heading";
2484
+ "type": "text" | "textarea" | "email" | "phone" | "number" | "select" | "checkbox" | "date" | "radio" | "checkboxes" | "url" | "consent" | "heading" | "time";
2357
2485
  "label": string;
2358
2486
  "required"?: boolean;
2359
2487
  "help"?: string;
@@ -2361,7 +2489,23 @@ export type EditorSaveInput = {
2361
2489
  "placeholder"?: string;
2362
2490
  "width"?: "full" | "half";
2363
2491
  "allowOther"?: boolean;
2492
+ "translations"?: {
2493
+ [key: string]: {
2494
+ "label"?: string;
2495
+ "help"?: string;
2496
+ "placeholder"?: string;
2497
+ "options"?: Array<string>;
2498
+ };
2499
+ };
2364
2500
  }>;
2501
+ "translations"?: {
2502
+ [key: string]: {
2503
+ "title"?: string;
2504
+ "intro"?: string;
2505
+ "submitLabel"?: string;
2506
+ "confirmation"?: string;
2507
+ };
2508
+ };
2365
2509
  };
2366
2510
  };
2367
2511
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acms-subir/client",
3
- "version": "0.1.23",
3
+ "version": "0.1.24",
4
4
  "description": "Typed, dependency-free client for the ACMS public mobile API.",
5
5
  "type": "module",
6
6
  "license": "MIT",