@7365admin1/layer-common 4.166.0 → 4.167.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # @iservice365/layer-common
2
2
 
3
+ ## 4.167.1
4
+
5
+ ### Patch Changes
6
+
7
+ - c984ac5: Document Management: a search now goes back to page 1, so searching while on a later page shows the matches instead of an empty table.
8
+ - 23be9b1: Access cards: say which EntryPass part failed (DV-0887)
9
+
10
+ Add Access Card stays open when its EntryPass lists cannot load and says
11
+ whether EntryPass is not set up for the site, did not respond, or answered with
12
+ an error, with Try again. A site with no EntryPass address shows "not set up"
13
+ there instead of using the default host. Assign to Unit and the card Preview
14
+ name the failure too instead of one "EntryPass server is unavailable" message.
15
+
16
+ ## 4.167.0
17
+
18
+ ### Minor Changes
19
+
20
+ - 6114c1a: CCTV Engine Engines & health: read-only camera settings (Settings button per camera for engine managers).
21
+
3
22
  ## 4.166.0
4
23
 
5
24
  ### Minor Changes
@@ -3766,11 +3785,11 @@ Monthly report: a month that had patrols opens the list of that month's patrol r
3766
3785
  `utils/console-tier.ts` + `composables/useConsoleTier.ts` mirror the server's
3767
3786
  own rule from two endpoints the console already calls, unprojected:
3768
3787
 
3769
- GET /api/members/user/:user/app/admin the Seven365 staff membership
3770
- GET /api/roles/id/:role that membership's role document
3788
+ GET /api/members/user/:user/app/admin the Seven365 staff membership
3789
+ GET /api/roles/id/:role that membership's role document
3771
3790
 
3772
- owner = member.type === "admin" && role.type === "admin" && role.default === true
3773
- staff = member.type === "admin" && role.type === "admin"
3791
+ owner = member.type === "admin" && role.type === "admin" && role.default === true
3792
+ staff = member.type === "admin" && role.type === "admin"
3774
3793
 
3775
3794
  `role.default` is the marker because it is the only property of a platform
3776
3795
  staff role no API caller can set - `role.controller.ts` validates create and
@@ -121,6 +121,26 @@
121
121
  <!-- Single Add Mode -->
122
122
  <v-form v-if="uploadMode === 'single'" v-model="validForm" :disabled="disable">
123
123
  <v-row no-gutters class="px-6 pt-4">
124
+ <v-col v-if="entryPassFailure" cols="12" class="px-1 pb-4">
125
+ <v-alert
126
+ :type="entryPassFailure.kind === 'not-set-up' ? 'warning' : 'error'"
127
+ variant="tonal"
128
+ density="comfortable"
129
+ data-test="entrypass-failure"
130
+ >
131
+ <div class="font-weight-bold">{{ entryPassFailure.title }}</div>
132
+ <div class="mt-1">{{ entryPassFailure.body }}</div>
133
+ <v-btn
134
+ class="mt-3 text-none"
135
+ size="small"
136
+ variant="outlined"
137
+ :loading="entryPassLoading"
138
+ @click="loadEntryPassLists"
139
+ >
140
+ Try again
141
+ </v-btn>
142
+ </v-alert>
143
+ </v-col>
124
144
  <v-col cols="12" class="px-1">
125
145
  <InputLabel
126
146
  class="text-capitalize font-weight-bold"
@@ -213,6 +233,8 @@
213
233
  item-value="no"
214
234
  hide-details
215
235
  :rules="[requiredRule]"
236
+ :loading="entryPassLoading"
237
+ :placeholder="entryPassLoading ? 'Loading from EntryPass…' : accessLevelItems.length ? '' : 'Not available'"
216
238
  >
217
239
  </v-select>
218
240
  </v-col>
@@ -231,6 +253,8 @@
231
253
  hide-details
232
254
  :rules="[requiredRule]"
233
255
  multiple
256
+ :loading="entryPassLoading"
257
+ :placeholder="entryPassLoading ? 'Loading from EntryPass…' : accessGroupItems.length ? '' : 'Not available'"
234
258
  >
235
259
  </v-select>
236
260
  </v-col>
@@ -407,6 +431,8 @@
407
431
  </v-card>
408
432
  </template>
409
433
  <script setup lang="ts">
434
+ import { describeEntryPassFailure, type EntryPassFailure } from "../utils/entrypass-failure";
435
+
410
436
  const prop = defineProps({
411
437
  mode: {
412
438
  type: String,
@@ -589,23 +615,57 @@ watch(uploadMode, (mode) => {
589
615
  if (mode === "bulk") fetchEntryPassTemplate();
590
616
  });
591
617
 
592
- onMounted(async () => {
618
+ // DV-0887: the dialog stays open and says which part failed (not set up, did
619
+ // not respond, or what EntryPass answered), with Try again, instead of one
620
+ // generic toast. A site with no EntryPass address is "not set up" here rather
621
+ // than using the default host. Lists that did load are kept.
622
+ const entryPassLoading = ref(true);
623
+ const entryPassFailure = ref<EntryPassFailure | null>(null);
624
+
625
+ async function loadEntryPassLists() {
626
+ entryPassLoading.value = true;
627
+ entryPassFailure.value = null;
593
628
  try {
594
- const acmUrl = await _getEncryptedAcmUrl(siteId);
629
+ let acmUrl = "";
630
+ try {
631
+ acmUrl = await _getEncryptedAcmUrl(siteId, { requireSiteUrl: true });
632
+ } catch (error) {
633
+ console.error("Failed to resolve the EntryPass address:", error);
634
+ entryPassFailure.value = describeEntryPassFailure(error);
635
+ return;
636
+ }
595
637
  encryptedAcmUrl.value = acmUrl;
596
- const [doorLevels, liftLevels, groups] = await Promise.all([
638
+
639
+ const [doorLevels, liftLevels, groups] = await Promise.allSettled([
597
640
  _getDoorAccessLevels(acmUrl),
598
641
  _getLiftAccessLevels(acmUrl),
599
642
  _getAccessGroups(acmUrl),
600
643
  ]);
601
- accessLevelItems.value = doorLevels.data ?? [];
602
- liftAccessLevelItems.value = liftLevels.data ?? [];
603
- accessGroupItems.value = groups.data ?? [];
604
- } catch (error) {
605
- console.error("Failed to fetch access management data:", error);
606
- emit("error", "EntryPass server is unavailable. Please contact your administrator.");
644
+ if (doorLevels.status === "fulfilled") accessLevelItems.value = doorLevels.value.data ?? [];
645
+ if (liftLevels.status === "fulfilled") liftAccessLevelItems.value = liftLevels.value.data ?? [];
646
+ if (groups.status === "fulfilled") accessGroupItems.value = groups.value.data ?? [];
647
+
648
+ const failed = (
649
+ [
650
+ [doorLevels, "door locations"],
651
+ [liftLevels, "lift access levels"],
652
+ [groups, "access groups"],
653
+ ] as const
654
+ ).filter(([result]) => result.status === "rejected");
655
+ if (!failed.length) return;
656
+
657
+ const firstError = (failed[0][0] as PromiseRejectedResult).reason;
658
+ console.error("Failed to fetch access management data:", firstError);
659
+ entryPassFailure.value = describeEntryPassFailure(
660
+ firstError,
661
+ failed.map(([, list]) => list),
662
+ );
663
+ } finally {
664
+ entryPassLoading.value = false;
607
665
  }
608
- });
666
+ }
667
+
668
+ onMounted(loadEntryPassLists);
609
669
 
610
670
  function limitCardNumber() {
611
671
  if (card.value.cardNumber && card.value.cardNumber.toString().length > cardNoMaxLength.value) {
@@ -187,6 +187,8 @@
187
187
  </v-card>
188
188
  </template>
189
189
  <script setup lang="ts">
190
+ import { describeEntryPassFailure, entryPassFailureToast } from "../utils/entrypass-failure";
191
+
190
192
  const props = defineProps({
191
193
  siteId: {
192
194
  type: String,
@@ -318,17 +320,17 @@ onMounted(async () => {
318
320
  ]);
319
321
  accessLevelItems.value = [NO_SELECTION, ...(doorLevels.data ?? [])];
320
322
  liftAccessLevelItems.value = [NO_SELECTION, ...(liftLevels.data ?? [])];
321
- } catch {
323
+ } catch (error) {
324
+ // DV-0887: say what failed rather than one generic message.
322
325
  emit(
323
326
  "error",
324
- "EntryPass server is unavailable. Please contact your administrator."
327
+ entryPassFailureToast(
328
+ describeEntryPassFailure(error, ["door locations", "lift access levels"])
329
+ )
325
330
  );
326
331
  }
327
332
  } else {
328
- emit(
329
- "error",
330
- "EntryPass server is unavailable. Please contact your administrator."
331
- );
333
+ emit("error", entryPassFailureToast(describeEntryPassFailure(acmResult.reason)));
332
334
  }
333
335
  levelsLoading.value = false;
334
336
  });
@@ -756,8 +756,9 @@ async function confirmAssign() {
756
756
  emit("refresh");
757
757
  } catch (e: any) {
758
758
  const rawMsg = e?.data?.message ?? "";
759
+ // DV-0887: EntryPass's own answer is shown rather than one generic message.
759
760
  const msg = rawMsg.includes("500")
760
- ? "EntryPass server is unavailable. Please contact your administrator."
761
+ ? `EntryPass could not assign the card. It answered: "${rawMsg}".`
761
762
  : rawMsg || "Failed to assign. Please try again.";
762
763
  assignError.value = msg;
763
764
  showToast(msg, "error");
@@ -0,0 +1,69 @@
1
+ <!--
2
+ Read-only settings of one engine camera (what it detects, how often, zones, snapshots, motion sensitivity).
3
+ The server sends only these safe fields; stream addresses and passwords never reach the browser. Nothing can be saved here.
4
+ -->
5
+ <template>
6
+ <v-dialog :model-value="!!camera" max-width="560" scrollable @update:model-value="(v: boolean) => !v && emit('close')">
7
+ <v-card>
8
+ <v-card-title>Camera settings - {{ camera }}</v-card-title>
9
+ <v-card-text>
10
+ <p class="hero-muted">These are the settings the engine is using for this camera. They are shown for checking only; changes are made on the engine by Seven365.</p>
11
+ <v-progress-linear v-if="loading" indeterminate />
12
+ <CctvEngineNotice v-else-if="error" :error="error" retry @retry="load" />
13
+ <v-table v-else-if="s" density="compact" data-test="camera-settings">
14
+ <tbody>
15
+ <tr><th>Camera</th><td>{{ onOff(s.enabled) }}</td></tr>
16
+ <tr><th>Object detection</th><td>{{ onOff(s.detect?.enabled) }}</td></tr>
17
+ <tr><th>Pictures checked</th><td>{{ s.detect?.fps == null ? NOT_SET : `${s.detect.fps} per second` }}</td></tr>
18
+ <tr><th>Picture size checked</th><td>{{ s.detect?.width && s.detect?.height ? `${s.detect.width} x ${s.detect.height}` : NOT_SET }}</td></tr>
19
+ <tr><th>Objects watched</th><td>{{ list(s.trackedObjects) }}</td></tr>
20
+ <tr><th>Objects that are alerts</th><td>{{ list(s.alertObjects) }}</td></tr>
21
+ <tr><th>Zones</th><td>{{ list(s.zones) }}</td></tr>
22
+ <tr><th>Snapshots</th><td>{{ onOff(s.snapshots?.enabled) }}<template v-if="s.snapshots?.keepDays != null"> (kept {{ s.snapshots.keepDays }} days on the engine)</template></td></tr>
23
+ <tr><th>Motion sensitivity</th><td>{{ s.motion?.threshold == null ? NOT_SET : `${s.motion.threshold} (lower = more sensitive)` }}</td></tr>
24
+ <tr><th>Smallest movement noticed</th><td>{{ s.motion?.contourArea ?? NOT_SET }}</td></tr>
25
+ <tr><th>Face recognition</th><td>{{ onOff(s.faceRecognition) }}</td></tr>
26
+ <tr><th>Number plate reading</th><td>{{ onOff(s.plateReading) }}</td></tr>
27
+ <tr><th>Sound detection</th><td>{{ onOff(s.audio) }}</td></tr>
28
+ </tbody>
29
+ </v-table>
30
+ </v-card-text>
31
+ <v-card-actions>
32
+ <v-spacer />
33
+ <v-btn variant="text" @click="emit('close')">Close</v-btn>
34
+ </v-card-actions>
35
+ </v-card>
36
+ </v-dialog>
37
+ </template>
38
+
39
+ <script setup lang="ts">
40
+ import { ref, watch } from "vue";
41
+
42
+ const props = defineProps<{ engineId: string; camera: string | null }>();
43
+ const emit = defineEmits<{ (e: "close"): void }>();
44
+
45
+ const { getCameraSettings } = useCctvEngine();
46
+ const NOT_SET = "Not reported";
47
+ const onOff = (v: boolean | null | undefined) => (v === true ? "On" : v === false ? "Off" : NOT_SET);
48
+ const list = (v?: string[] | null) => (v?.length ? v.join(", ") : "None");
49
+
50
+ const s = ref<any>(null);
51
+ const loading = ref(false);
52
+ const error = ref<unknown>(null);
53
+
54
+ async function load() {
55
+ s.value = null;
56
+ error.value = null;
57
+ if (!props.camera) return;
58
+ loading.value = true;
59
+ try {
60
+ s.value = await getCameraSettings(props.engineId, props.camera);
61
+ } catch (e) {
62
+ error.value = e;
63
+ } finally {
64
+ loading.value = false;
65
+ }
66
+ }
67
+
68
+ watch(() => [props.engineId, props.camera], load, { immediate: true });
69
+ </script>
@@ -42,14 +42,15 @@
42
42
  <v-col cols="6" sm="3"><div class="hero-muted">Storage</div><strong>{{ storageText(health[e._id].data.storage) }}</strong></v-col>
43
43
  </v-row>
44
44
  <v-table density="compact" class="mt-3">
45
- <thead><tr><th>Camera</th><th>Picture rate</th><th>Detection rate</th><th>State</th></tr></thead>
45
+ <thead><tr><th>Camera</th><th>Picture rate</th><th>Detection rate</th><th>State</th><th v-if="canEdit"><span class="d-sr-only">Settings</span></th></tr></thead>
46
46
  <tbody>
47
- <tr v-if="!health[e._id].data.cameras.length"><td colspan="4" class="hero-muted">The engine has not reported any cameras yet. Reports come every minute while it is Online.</td></tr>
47
+ <tr v-if="!health[e._id].data.cameras.length"><td :colspan="canEdit ? 5 : 4" class="hero-muted">The engine has not reported any cameras yet. Reports come every minute while it is Online.</td></tr>
48
48
  <tr v-for="c in health[e._id].data.cameras" :key="c.name">
49
49
  <td>{{ c.name }}</td>
50
50
  <td>{{ c.fps == null ? "Not reported" : `${c.fps} fps` }}</td>
51
51
  <td>{{ c.detectFps == null ? "Not reported" : `${c.detectFps} fps` }}</td>
52
52
  <td><v-chip v-if="c.online != null" size="x-small" label :color="c.online ? 'success' : 'error'">{{ c.online ? "Receiving" : "No picture" }}</v-chip></td>
53
+ <td v-if="canEdit"><v-btn size="x-small" variant="text" prepend-icon="mdi-cog-outline" :data-test="`camera-settings-${c.name}`" @click="settingsFor = { engine: e._id, camera: c.name }">Settings</v-btn></td>
53
54
  </tr>
54
55
  </tbody>
55
56
  </v-table>
@@ -62,6 +63,8 @@
62
63
  </v-expansion-panel>
63
64
  </v-expansion-panels>
64
65
 
66
+ <CctvEngineCameraSettings :engine-id="settingsFor?.engine ?? ''" :camera="settingsFor?.camera ?? null" @close="settingsFor = null" />
67
+
65
68
  <!-- Add-engine wizard -->
66
69
  <v-dialog v-model="wizard" max-width="640" persistent scrollable>
67
70
  <v-card>
@@ -153,6 +156,8 @@ const storageText = (s?: { usedMb: number; totalMb: number } | null) =>
153
156
  !s || !(s.totalMb > 0) ? "Not reported" : `${Math.round((s.usedMb / s.totalMb) * 100)}% full`;
154
157
 
155
158
  const engines = ref<any[]>([]);
159
+ /** The camera whose read-only settings are open. */
160
+ const settingsFor = ref<{ engine: string; camera: string } | null>(null);
156
161
  const loading = ref(false);
157
162
  const error = ref<unknown>(null);
158
163
  const open = ref<string | undefined>();
@@ -903,6 +903,12 @@ watch(activeTab, () => {
903
903
  page.value = 1;
904
904
  });
905
905
 
906
+ // Same for a search: typed on page 21 of the full list, it would ask for page
907
+ // 21 of the matches and show an empty table, as if nothing matched.
908
+ watch(headerSearch, () => {
909
+ page.value = 1;
910
+ });
911
+
906
912
  const loading = computed(() => getAllReqStatus.value === "pending");
907
913
 
908
914
  // The page totals are the server's count of the WHOLE list, read through the
@@ -93,6 +93,8 @@ export default function useCctvEngine() {
93
93
  const getZones = (engineId: string, camera: string) => api(`${cam(engineId, camera)}/zones`, { method: "GET" });
94
94
  const saveZones = (engineId: string, camera: string, body: TZonesBody) =>
95
95
  api(`${cam(engineId, camera)}/zones`, { method: "PUT", body });
96
+ /** Read-only camera settings (allow-listed by the server). */
97
+ const getCameraSettings = (engineId: string, camera: string) => api(`${cam(engineId, camera)}/settings`, { method: "GET" });
96
98
  const listWrongWayRules = (site: string) => api("/api/cctv-wrong-way-rules", { method: "GET", query: { site } });
97
99
  const createWrongWayRule = (body: Record<string, any>) => api("/api/cctv-wrong-way-rules", { method: "POST", body });
98
100
  // The server reads the site from `?site=` on every call by id and checks the caller against it.
@@ -135,7 +137,7 @@ export default function useCctvEngine() {
135
137
  searchEvents,
136
138
  listClassifiers, createClassifier, updateClassifier, deleteClassifier, classifierPhotos, classifierPhoto,
137
139
  sortClassifierPhoto, discardClassifierPhotos, trainClassifier,
138
- getZones, saveZones, listWrongWayRules, createWrongWayRule, updateWrongWayRule, deleteWrongWayRule,
140
+ getZones, saveZones, getCameraSettings, listWrongWayRules, createWrongWayRule, updateWrongWayRule, deleteWrongWayRule,
139
141
  listPlates, createPlate, updatePlate, deletePlate,
140
142
  listFaces, enrolFace, deleteFace,
141
143
  getAlertSettings, saveAlertSettings,
@@ -1,3 +1,5 @@
1
+ import { EntryPassNotSetUpError } from "../utils/entrypass-failure";
2
+
1
3
  export default function useSiteEntryPassSettings() {
2
4
  function getBySiteId(siteId: string) {
3
5
  return useNuxtApp().$api<Record<string, any>>(
@@ -37,8 +39,14 @@ export default function useSiteEntryPassSettings() {
37
39
  * levels and access groups came from the route's hardcoded default host
38
40
  * whatever the site had configured. A site with no URL set, or whose
39
41
  * settings cannot be read, still gets that default.
42
+ *
43
+ * `requireSiteUrl` (Add Access Card, DV-0887): no default. A site with no
44
+ * URL set throws `EntryPassNotSetUpError`, so the screen can say so.
40
45
  */
41
- async function getEncryptedAcmUrl(siteId: string): Promise<string> {
46
+ async function getEncryptedAcmUrl(
47
+ siteId: string,
48
+ options: { requireSiteUrl?: boolean } = {},
49
+ ): Promise<string> {
42
50
  let rawUrl = "";
43
51
  try {
44
52
  const settings: any = await getBySiteId(siteId);
@@ -46,6 +54,7 @@ export default function useSiteEntryPassSettings() {
46
54
  } catch {
47
55
  // No entry pass settings for this site yet - the default host applies.
48
56
  }
57
+ if (!rawUrl && options.requireSiteUrl) throw new EntryPassNotSetUpError();
49
58
  const { encrypted } = await $fetch<{ encrypted: string }>(
50
59
  `/api/encrypt-acm-url${rawUrl ? `?url=${encodeURIComponent(rawUrl)}` : ""}`,
51
60
  );
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@7365admin1/layer-common",
3
3
  "license": "MIT",
4
4
  "type": "module",
5
- "version": "4.166.0",
5
+ "version": "4.167.1",
6
6
  "author": "7365admin1",
7
7
  "main": "./nuxt.config.ts",
8
8
  "//files": "What a consumer extending this layer actually loads. Without this npm ships the whole working tree - the changesets, the CI workflows, the render harness in tools/ and any scratch directory that happened to exist at publish time. Nuxt resolves a layer by directory, so every runtime directory below has to stay listed; adding a new top-level runtime directory means adding it here too.",
@@ -0,0 +1,94 @@
1
+ /**
2
+ * What went wrong when an access-card screen asked EntryPass for its lists
3
+ * (door locations, lift access levels, access groups), in words a site admin
4
+ * can act on.
5
+ *
6
+ * API-core answers every EntryPass failure with a 400 whose `message` is the
7
+ * underlying error, e.g. "Request failed with status code 500" when the
8
+ * EntryPass host itself errors. The screens used to replace all of these with
9
+ * one "EntryPass server is unavailable" toast (DV-0887).
10
+ *
11
+ * - not-set-up the site has no EntryPass address saved
12
+ * - no-response the request never got an answer (timeout, refused, offline)
13
+ * - error EntryPass, or the API in front of it, answered with an error
14
+ */
15
+ export type EntryPassFailureKind = "not-set-up" | "no-response" | "error";
16
+
17
+ export type EntryPassFailure = {
18
+ kind: EntryPassFailureKind;
19
+ title: string;
20
+ body: string;
21
+ /** The server's own message, when there is one. */
22
+ detail: string;
23
+ };
24
+
25
+ /** Thrown when a screen requires the site's own EntryPass address and it has none. */
26
+ export class EntryPassNotSetUpError extends Error {
27
+ constructor() {
28
+ super("EntryPass is not set up for this site.");
29
+ this.name = "EntryPassNotSetUpError";
30
+ }
31
+ }
32
+
33
+ const NO_RESPONSE =
34
+ /timeout|timed out|ECONNREFUSED|ECONNRESET|ENOTFOUND|EAI_AGAIN|socket hang up|network ?error|fetch failed|failed to fetch/i;
35
+
36
+ /** The server's message for a failed request, or the error's own. */
37
+ export function entryPassErrorMessage(error: unknown): string {
38
+ const e = error as any;
39
+ return String(e?.data?.message ?? e?.message ?? "").trim();
40
+ }
41
+
42
+ function listText(lists: string[]): string {
43
+ if (lists.length <= 1) return lists[0] ?? "the lists";
44
+ return `${lists.slice(0, -1).join(", ")} and ${lists[lists.length - 1]}`;
45
+ }
46
+
47
+ /**
48
+ * @param lists the lists that could not be loaded, e.g. ["access groups"]
49
+ */
50
+ export function describeEntryPassFailure(
51
+ error: unknown,
52
+ lists: string[] = ["door locations", "access groups"],
53
+ ): EntryPassFailure {
54
+ const e = error as any;
55
+
56
+ if (e instanceof EntryPassNotSetUpError || e?.name === "EntryPassNotSetUpError") {
57
+ return {
58
+ kind: "not-set-up",
59
+ title: "EntryPass is not set up for this site.",
60
+ body: "Door locations and access groups come from EntryPass, so a physical card can't be added yet. Ask an administrator to set the EntryPass address in Access Management settings.",
61
+ detail: "",
62
+ };
63
+ }
64
+
65
+ const detail = entryPassErrorMessage(error);
66
+ const status = e?.statusCode ?? e?.status ?? e?.response?.status;
67
+ // No status and no body: the request itself never got an answer.
68
+ const noAnswer = !status && !e?.data;
69
+
70
+ if (noAnswer || NO_RESPONSE.test(detail)) {
71
+ return {
72
+ kind: "no-response",
73
+ title: "EntryPass did not respond.",
74
+ body: "Door locations and access groups could not be loaded. Try again in a moment. If it keeps happening, contact your administrator.",
75
+ detail,
76
+ };
77
+ }
78
+
79
+ return {
80
+ kind: "error",
81
+ title: `EntryPass could not load the ${listText(lists)}.`,
82
+ body: detail
83
+ ? `It answered: "${detail}". Try again, or contact your administrator with this message.`
84
+ : "Try again, or contact your administrator.",
85
+ detail,
86
+ };
87
+ }
88
+
89
+ /** One line for a toast: the title, plus the server's message when there is one. */
90
+ export function entryPassFailureToast(failure: EntryPassFailure): string {
91
+ return failure.kind === "error" && failure.detail
92
+ ? `${failure.title} It answered: "${failure.detail}".`
93
+ : failure.title;
94
+ }