@wssto2/vue-core 0.12.1 → 0.13.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.
Files changed (124) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/README.md +4 -2
  3. package/dist/{AccessGate.vue_vue_type_script_setup_true_lang-CzQbD2Pc.js → AccessGate.vue_vue_type_script_setup_true_lang-DEzXovsY.js} +1 -1
  4. package/dist/{Activity-CdkJW68R.js → Activity-ChfxdvXf.js} +24 -23
  5. package/dist/{AdaptivePageShell.vue_vue_type_script_setup_true_lang-D5i77H6S.js → AdaptivePageShell.vue_vue_type_script_setup_true_lang-lPj9hPqV.js} +33 -33
  6. package/dist/{Changes-DxK_QfiB.js → Changes-BCa43_mO.js} +18 -17
  7. package/dist/{CollectionPage.vue_vue_type_script_setup_true_lang-x0jyJ01f.js → CollectionPage.vue_vue_type_script_setup_true_lang-C1GCvyZx.js} +6 -6
  8. package/dist/{DataTable.vue_vue_type_script_setup_true_lang-C_ZytnW-.js → DataTable.vue_vue_type_script_setup_true_lang-B9r9M5Gt.js} +1 -1
  9. package/dist/{DateField.vue_vue_type_script_setup_true_lang-CeNwBbJT.js → DateField.vue_vue_type_script_setup_true_lang-B5UUY1OO.js} +2 -2
  10. package/dist/{DeadLetters-DnA7LP1w.js → DeadLetters-wFTqhISU.js} +5 -5
  11. package/dist/{General-2matxl2Y.js → General-jW7u4MjH.js} +16 -15
  12. package/dist/{IncidentRecord-Bt3G4HlX.js → IncidentRecord-zTemLz2R.js} +6 -6
  13. package/dist/{IncidentsList-2iwgqp9J.js → IncidentsList-yu0xSMrH.js} +6 -6
  14. package/dist/{NewRolePage-DhGFwvk3.js → NewRolePage-CQ5UVaHs.js} +3 -3
  15. package/dist/{NumberField.vue_vue_type_script_setup_true_lang-B3UrXNqH.js → NumberField.vue_vue_type_script_setup_true_lang-YVgf5CP6.js} +1 -1
  16. package/dist/{PersonAccess.vue_vue_type_script_setup_true_lang-DbGZSNQc.js → PersonAccess.vue_vue_type_script_setup_true_lang-CWCt9_dM.js} +2 -2
  17. package/dist/{ProfilePage-CpuyDBAv.js → ProfilePage-Ca3x3UAH.js} +79 -77
  18. package/dist/{RecordHeader.vue_vue_type_script_setup_true_lang-DqGc3Jyo.js → RecordHeader.vue_vue_type_script_setup_true_lang-Do_ATJwT.js} +1 -1
  19. package/dist/{ResourcePage.vue_vue_type_script_setup_true_lang-DljhsTU4.js → ResourcePage.vue_vue_type_script_setup_true_lang-Coz91xht.js} +1 -1
  20. package/dist/{RoleEditor.vue_vue_type_script_setup_true_lang-C0FIotFA.js → RoleEditor.vue_vue_type_script_setup_true_lang-d_aaeXTT.js} +2 -2
  21. package/dist/{RolePage-DaNv049g.js → RolePage-BUj1w1m1.js} +5 -5
  22. package/dist/{RolesPage-6hlzJes_.js → RolesPage-NKzBUsrM.js} +3 -3
  23. package/dist/{SectionNavigator.vue_vue_type_script_setup_true_lang-Dh3sXUt_.js → SectionNavigator.vue_vue_type_script_setup_true_lang-DfKEhTFv.js} +2 -2
  24. package/dist/{ServiceAccountDialog.vue_vue_type_script_setup_true_lang-FJbWxME_.js → ServiceAccountDialog.vue_vue_type_script_setup_true_lang-4nbhEpv_.js} +10 -9
  25. package/dist/{ServiceAccountRecord-0-JF5lRx.js → ServiceAccountRecord-ClbyeLhL.js} +8 -8
  26. package/dist/{ServiceAccountsList-DcsnOcf-.js → ServiceAccountsList-B2VDnYxD.js} +5 -5
  27. package/dist/{Sessions-DgWhpk-i.js → Sessions-BjkciyHH.js} +23 -21
  28. package/dist/{SettingsPage-BXPWATYU.js → SettingsPage-Csb14qsx.js} +7 -7
  29. package/dist/{SignIn-DPoUwHZd.js → SignIn-DPFMv4C7.js} +14 -12
  30. package/dist/{SignInPage-OyrVemro.js → SignInPage-DukoFqkt.js} +2 -2
  31. package/dist/{SignIns-BMDrZVVp.js → SignIns-DvdpNkiS.js} +23 -22
  32. package/dist/{TimeField.vue_vue_type_script_setup_true_lang-D-Em4glH.js → TimeField.vue_vue_type_script_setup_true_lang-DpDXHH7u.js} +2 -2
  33. package/dist/{Timestamp.vue_vue_type_script_setup_true_lang-ClZAAUMd.js → Timestamp.vue_vue_type_script_setup_true_lang-DlEUKWra.js} +1 -1
  34. package/dist/{UserRecord-BW-gdCqi.js → UserRecord-B9SeSWQh.js} +57 -55
  35. package/dist/{UsersList-B3ZF_1Dj.js → UsersList-CREG8q3l.js} +4 -4
  36. package/dist/access/index.js +4 -4
  37. package/dist/app/application.d.ts +14 -6
  38. package/dist/app/current.d.ts +11 -0
  39. package/dist/app/environment.d.ts +8 -0
  40. package/dist/app/index.d.ts +1 -0
  41. package/dist/app/index.js +14 -12
  42. package/dist/application-DomS6sbx.js +435 -0
  43. package/dist/collection/http.d.ts +16 -1
  44. package/dist/collection/index.d.ts +1 -1
  45. package/dist/collection/index.js +34 -32
  46. package/dist/content/Money.vue.d.ts +1 -1
  47. package/dist/content/index.js +151 -158
  48. package/dist/{contributions-CeG4bszd.js → contributions-obnyn03x.js} +1 -1
  49. package/dist/current-B0lHKTWr.js +17 -0
  50. package/dist/form/DateField.vue.d.ts +2 -2
  51. package/dist/form/DateTimeField.vue.d.ts +2 -2
  52. package/dist/form/MoneyField.vue.d.ts +1 -1
  53. package/dist/form/NumberField.vue.d.ts +1 -1
  54. package/dist/form/date/MonthYearPanel.vue.d.ts +1 -1
  55. package/dist/form/date/days.d.ts +3 -3
  56. package/dist/form/index.d.ts +2 -0
  57. package/dist/form/index.js +1111 -1081
  58. package/dist/form/zodErrorMap.d.ts +35 -0
  59. package/dist/format/format.d.ts +51 -6
  60. package/dist/format/index.d.ts +1 -1
  61. package/dist/format/index.js +1 -1
  62. package/dist/format-DoKs29bZ.js +118 -0
  63. package/dist/{guards-Biv_SlGn.js → guards-DGcSfTEh.js} +1 -1
  64. package/dist/http-DOEfFCDA.js +107 -0
  65. package/dist/i18n/index.js +15 -15
  66. package/dist/identity/index.d.ts +2 -0
  67. package/dist/identity/index.js +43 -40
  68. package/dist/identity/usePreferences.d.ts +19 -0
  69. package/dist/incidents/clientErrorReporter.d.ts +2 -1
  70. package/dist/incidents/index.js +1 -1
  71. package/dist/{index-kEHY7hcG.js → index-Be9Q1PB_.js} +78 -76
  72. package/dist/{index-Cq9TuOqH.js → index-DZikGJ8L.js} +457 -511
  73. package/dist/{index-ClJeyW3F.js → index-D_yyd4C2.js} +4 -4
  74. package/dist/index.d.ts +1 -1
  75. package/dist/index.js +1 -1
  76. package/dist/internal/intlLocale.d.ts +5 -2
  77. package/dist/modules/identity/entities.d.ts +4 -0
  78. package/dist/modules/identity/routes.d.ts +5 -2
  79. package/dist/modules/identity/schemas.d.ts +6 -2
  80. package/dist/modules/incident/routes.d.ts +2 -0
  81. package/dist/modules/incident/schemas.d.ts +2 -0
  82. package/dist/{navigation-TnVFYRaX.js → navigation-CctcxT51.js} +1 -1
  83. package/dist/{neighbors-OyvGi233.js → neighbors-Csfan8Ho.js} +1 -1
  84. package/dist/notifications/index.js +1 -1
  85. package/dist/onboarding/Tip.vue.d.ts +41 -0
  86. package/dist/onboarding/index.d.ts +1 -0
  87. package/dist/onboarding/index.js +145 -0
  88. package/dist/onboarding/tips.d.ts +5 -0
  89. package/dist/page/index.js +3 -3
  90. package/dist/phone/index.js +74 -74
  91. package/dist/phone/phone.d.ts +3 -3
  92. package/dist/platform/httpSession.d.ts +1 -1
  93. package/dist/platform/index.d.ts +2 -0
  94. package/dist/platform/index.js +16 -13
  95. package/dist/platform/preferences.d.ts +35 -0
  96. package/dist/platform/session.d.ts +6 -1
  97. package/dist/platform-DtISOEt7.js +284 -0
  98. package/dist/playwright/session.d.ts +2 -0
  99. package/dist/preferences-hYhrw8Uy.js +91 -0
  100. package/dist/resource/index.d.ts +1 -0
  101. package/dist/resource/index.js +24 -8
  102. package/dist/resource/read.d.ts +16 -0
  103. package/dist/router/index.js +3 -3
  104. package/dist/{rowLayout-BsKEzEME.js → rowLayout-y1IB_h2r.js} +2 -2
  105. package/dist/{sections-CvUwZ-S1.js → sections-fkW_IJLc.js} +1 -1
  106. package/dist/{serverMessages-B6GHgi40.js → serverMessages-Ddghrewh.js} +1 -1
  107. package/dist/shell/darkMode.d.ts +13 -8
  108. package/dist/shell/index.js +396 -384
  109. package/dist/{state-6KSYsVw0.js → state-CXMexi0l.js} +1 -1
  110. package/dist/styles.css +1 -1
  111. package/dist/testing/app.d.ts +11 -0
  112. package/dist/testing/format.d.ts +4 -2
  113. package/dist/testing/index.d.ts +1 -1
  114. package/dist/testing/index.js +96 -89
  115. package/dist/testing/platform.d.ts +2 -0
  116. package/dist/usePreferences-B8LIZp_f.js +47 -0
  117. package/dist/{useTypedEntry-C_Bk4sI0.js → useTypedEntry-DKs8I1yP.js} +279 -280
  118. package/package.json +6 -2
  119. package/src/styles/components.css +17 -0
  120. package/dist/application-CuzT-0vW.js +0 -420
  121. package/dist/format-D8KUBmbS.js +0 -87
  122. package/dist/http-Dm0uXY9O.js +0 -95
  123. package/dist/intlLocale-CeRU44qJ.js +0 -4
  124. package/dist/platform-BQOX_Ntw.js +0 -283
@@ -1,92 +1,98 @@
1
- import { nextTick as b, createApp as j, defineComponent as m, h as u } from "vue";
2
- import { createMemoryHistory as P, createRouter as E, RouterView as $ } from "vue-router";
3
- import { a as A, i as O } from "../platform-BQOX_Ntw.js";
4
- import { createI18n as k } from "vue-i18n";
5
- import { coreMessages as M } from "../i18n/index.js";
6
- import { i as R, c as S } from "../format-D8KUBmbS.js";
7
- function K() {
1
+ import { nextTick as A, createApp as E, defineComponent as m, h as u } from "vue";
2
+ import { createMemoryHistory as w, createRouter as $, RouterView as O } from "vue-router";
3
+ import { c as k } from "../application-DomS6sbx.js";
4
+ import { a as M, i as R } from "../platform-DtISOEt7.js";
5
+ import { createI18n as S } from "vue-i18n";
6
+ import { coreMessages as x } from "../i18n/index.js";
7
+ import { i as L, c as C } from "../format-DoKs29bZ.js";
8
+ function X() {
8
9
  let e, t;
9
- return { promise: new Promise((s, r) => {
10
- e = s, t = r;
10
+ return { promise: new Promise((s, o) => {
11
+ e = s, t = o;
11
12
  }), resolve: e, reject: t };
12
13
  }
13
- async function Q(e = 5) {
14
+ async function Y(e = 5) {
14
15
  for (let t = 0; t < e; t++)
15
- await new Promise((n) => setTimeout(n, 0)), await b();
16
+ await new Promise((n) => setTimeout(n, 0)), await A();
16
17
  }
17
- const f = (e) => typeof e == "object" && e !== null && !Array.isArray(e);
18
- function g(e, t) {
18
+ const h = (e) => typeof e == "object" && e !== null && !Array.isArray(e);
19
+ function v(e, t) {
19
20
  const n = { ...e };
20
- for (const [s, r] of Object.entries(t)) {
21
+ for (const [s, o] of Object.entries(t)) {
21
22
  const a = n[s];
22
- n[s] = f(r) && f(a) ? g(a, r) : r;
23
+ n[s] = h(o) && h(a) ? v(a, o) : o;
23
24
  }
24
25
  return n;
25
26
  }
26
- function x(e = {}) {
27
- const t = { ...M };
28
- for (const [n, s] of Object.entries(e.messages ?? {})) t[n] = g(t[n] ?? {}, s);
29
- return k({ legacy: !1, locale: e.locale ?? "en", fallbackLocale: "en", messages: t });
27
+ function B(e = {}) {
28
+ const t = { ...x };
29
+ for (const [n, s] of Object.entries(e.messages ?? {})) t[n] = v(t[n] ?? {}, s);
30
+ return S({ legacy: !1, locale: e.locale ?? "en", fallbackLocale: "en", messages: t });
30
31
  }
31
- function L(e) {
32
- return { install: (t) => R(t, S({ locale: () => e.global.locale.value })) };
32
+ function F(e, t = {}) {
33
+ const n = e.global.t && ((s) => e.global.t(s));
34
+ return { install: (s) => L(s, C({ locale: () => e.global.locale.value, translate: n, ...t })) };
33
35
  }
34
- function C(e, t, n = "all", s) {
35
- const r = t === void 0 ? { level: e } : { level: e, id: t };
36
- return { scope: r, qualifier: n, clauses: s ?? [{ scope: r, qualifier: n }] };
36
+ function U(e, t, n = "all", s) {
37
+ const o = t === void 0 ? { level: e } : { level: e, id: t };
38
+ return { scope: o, qualifier: n, clauses: s ?? [{ scope: o, qualifier: n }] };
37
39
  }
38
- function B(e = {}) {
39
- const { permissions: t = [] } = e, n = Array.isArray(t) ? Object.fromEntries(t.map((r) => [r, C("organization")])) : { ...t }, s = { root: e.root ?? !1, permissions: n, unavailable: e.unavailable ?? [] };
40
+ function z(e = {}) {
41
+ const { permissions: t = [] } = e, n = Array.isArray(t) ? Object.fromEntries(t.map((o) => [o, U("organization")])) : { ...t }, s = { root: e.root ?? !1, permissions: n, unavailable: e.unavailable ?? [] };
40
42
  return {
41
43
  user: e.user ?? { id: 1 },
42
44
  expiresAt: e.expiresAt ?? null,
43
45
  access: s,
44
- ...e.navigation ? { navigation: e.navigation } : {}
46
+ ...e.navigation ? { navigation: e.navigation } : {},
47
+ ...e.preferences ? { preferences: e.preferences } : {}
45
48
  };
46
49
  }
47
- const F = async (e, t) => {
50
+ const G = async (e, t) => {
48
51
  throw new Error(`createTestPlatform: an unexpected request ${(t.method ?? "GET").toUpperCase()} ${e}. Pass a \`transport\` that answers it (scriptedTransport or routedTransport).`);
49
52
  };
50
- function U(e = {}) {
51
- const { user: t, permissions: n, unavailable: s, root: r, navigation: a, expiresAt: o, transport: c, config: i, session: l, ...T } = e, p = t === null ? null : B({ user: t, permissions: n, unavailable: s, root: r, navigation: a, expiresAt: o }), y = l ?? { load: async () => p, signOut: async () => {
52
- } }, d = A({
53
- ...T,
54
- config: { apiBase: "", locale: "en", appName: "Test app", capabilities: [], ...i },
55
- transport: c ?? F,
56
- session: y
53
+ function T(e = {}) {
54
+ const { user: t, permissions: n, unavailable: s, root: o, navigation: a, expiresAt: r, preferences: c, transport: i, config: l, session: f, ...j } = e, p = t === null ? null : z({ user: t, permissions: n, unavailable: s, root: o, navigation: a, expiresAt: r, preferences: c }), P = f ?? { load: async () => p, signOut: async () => {
55
+ } }, d = M({
56
+ ...j,
57
+ config: { apiBase: "", locale: "en", appName: "Test app", capabilities: [], ...l },
58
+ transport: i ?? G,
59
+ session: P
57
60
  });
58
- return !l && p && d.session.establish(p), d;
61
+ return !f && p && d.session.establish(p), d;
59
62
  }
60
- const z = m({ name: "TestBlankPage", render: () => u("div") }), h = m({ name: "TestRouteStub", render: () => u("div", [u($)]) });
61
- function G(e) {
63
+ const H = m({ name: "TestBlankPage", render: () => u("div") }), g = m({ name: "TestRouteStub", render: () => u("div", [u(O)]) });
64
+ function I(e) {
62
65
  return e.map((t) => {
63
- const { component: n, components: s, children: r, ...a } = t, o = { ...a };
64
- return r && (o.children = G(r)), s ? o.components = Object.fromEntries(Object.keys(s).map((c) => [c, h])) : n !== void 0 && (o.component = h), o;
66
+ const { component: n, components: s, children: o, ...a } = t, r = { ...a };
67
+ return o && (r.children = I(o)), s ? r.components = Object.fromEntries(Object.keys(s).map((c) => [c, g])) : n !== void 0 && (r.component = g), r;
65
68
  });
66
69
  }
67
- function H(e = {}) {
68
- const t = e.platform ?? U();
70
+ function N(e = {}) {
71
+ const t = e.platform ?? T();
69
72
  let n = e.router;
70
73
  if (!n) {
71
- const a = P();
72
- a.replace(e.location ?? "/"), n = E({ history: a, routes: [...e.routes ?? [{ path: "/:pathMatch(.*)*", component: z }]] });
74
+ const a = w();
75
+ a.replace(e.location ?? "/"), n = $({ history: a, routes: [...e.routes ?? [{ path: "/:pathMatch(.*)*", component: H }]] });
73
76
  }
74
- const s = x({ locale: e.locale, messages: e.messages });
75
- return { plugins: [n, s, L(s), { install: (a) => O(a, t) }, ...e.plugins ?? []], platform: t, router: n, i18n: s };
77
+ const s = B({ locale: e.locale, messages: e.messages });
78
+ return { plugins: [n, s, F(s), { install: (a) => R(a, t) }, ...e.plugins ?? []], platform: t, router: n, i18n: s };
76
79
  }
77
- function W(e, t = H()) {
80
+ function Z(e, t = N()) {
78
81
  let n;
79
- const s = j(
82
+ const s = E(
80
83
  m({
81
84
  setup() {
82
85
  return n = e(), () => u("div");
83
86
  }
84
87
  })
85
88
  );
86
- for (const r of t.plugins) s.use(r);
89
+ for (const o of t.plugins) s.use(o);
87
90
  return s.mount(document.createElement("div")), { result: n, app: s, unmount: () => s.unmount() };
88
91
  }
89
- function X(e, t = {}) {
92
+ function q(e = {}) {
93
+ return k({ platform: T(), features: [], router: { history: w() }, i18n: { missingWarn: !1 }, ...e });
94
+ }
95
+ function ee(e, t = {}) {
90
96
  return {
91
97
  rows: e,
92
98
  total: e.length,
@@ -98,26 +104,26 @@ function X(e, t = {}) {
98
104
  ...t
99
105
  };
100
106
  }
101
- function Y(e) {
107
+ function te(e) {
102
108
  const t = [];
103
- return { load: (s, r) => (t.push({ query: s, signal: r.signal }), Promise.resolve(e(s, r, t.length))), calls: t };
109
+ return { load: (s, o) => (t.push({ query: s, signal: o.signal }), Promise.resolve(e(s, o, t.length))), calls: t };
104
110
  }
105
- function Z(e = {}) {
106
- const t = { compact: !1, narrow: !1, reducedMotion: !1, standalone: !1, ...e }, n = window.matchMedia, s = /* @__PURE__ */ new Set(), r = (o) => o.includes("prefers-reduced-motion") ? t.reducedMotion : o.includes("display-mode: standalone") ? t.standalone : o.includes("min-width: 48rem") ? !t.compact : o.includes("max-width: 1023px") ? t.narrow || t.compact : o.includes("pointer: coarse") || o.includes("max-width: 47.999rem") ? t.compact : !1, a = (o) => o.split(",").some(r);
107
- return window.matchMedia = ((o) => {
108
- const c = { query: o, last: a(o), listeners: /* @__PURE__ */ new Set() };
111
+ function ne(e = {}) {
112
+ const t = { compact: !1, narrow: !1, reducedMotion: !1, standalone: !1, ...e }, n = window.matchMedia, s = /* @__PURE__ */ new Set(), o = (r) => r.includes("prefers-reduced-motion") ? t.reducedMotion : r.includes("display-mode: standalone") ? t.standalone : r.includes("min-width: 48rem") ? !t.compact : r.includes("max-width: 1023px") ? t.narrow || t.compact : r.includes("pointer: coarse") || r.includes("max-width: 47.999rem") ? t.compact : !1, a = (r) => r.split(",").some(o);
113
+ return window.matchMedia = ((r) => {
114
+ const c = { query: r, last: a(r), listeners: /* @__PURE__ */ new Set() };
109
115
  return s.add(c), {
110
- media: o,
116
+ media: r,
111
117
  get matches() {
112
- return a(o);
118
+ return a(r);
113
119
  },
114
120
  addEventListener: (i, l) => c.listeners.add(l),
115
121
  removeEventListener: (i, l) => c.listeners.delete(l)
116
122
  };
117
123
  }), {
118
124
  state: t,
119
- set(o) {
120
- Object.assign(t, o);
125
+ set(r) {
126
+ Object.assign(t, r);
121
127
  for (const c of s) {
122
128
  const i = a(c.query);
123
129
  i !== c.last && (c.last = i, c.listeners.forEach((l) => l()));
@@ -128,51 +134,52 @@ function Z(e = {}) {
128
134
  }
129
135
  };
130
136
  }
131
- const q = (e, t, n = {}) => new Response(t === void 0 ? null : JSON.stringify(t), { status: e, headers: { "Content-Type": "application/json", ...n } }), w = (e, t) => ({
137
+ const se = (e, t, n = {}) => new Response(t === void 0 ? null : JSON.stringify(t), { status: e, headers: { "Content-Type": "application/json", ...n } }), b = (e, t) => ({
132
138
  url: e,
133
139
  method: (t.method ?? "GET").toUpperCase(),
134
140
  headers: new Headers(t.headers),
135
141
  init: t
136
142
  });
137
- async function v(e, t) {
143
+ async function y(e, t) {
138
144
  if (e instanceof Error) throw e;
139
145
  return typeof e == "function" ? e(t) : e.clone();
140
146
  }
141
- function ee(...e) {
147
+ function re(...e) {
142
148
  const t = [], n = [...e];
143
- return { transport: async (r, a) => {
144
- const o = w(r, a);
145
- t.push(o);
149
+ return { transport: async (o, a) => {
150
+ const r = b(o, a);
151
+ t.push(r);
146
152
  const c = n.length > 1 ? n.shift() : n[0];
147
153
  if (c === void 0) throw new Error("scriptedTransport: no answer left");
148
- return v(c, o);
154
+ return y(c, r);
149
155
  }, calls: t };
150
156
  }
151
- function te(e) {
157
+ function oe(e) {
152
158
  const t = [];
153
- return { transport: async (s, r) => {
154
- const a = w(s, r);
159
+ return { transport: async (s, o) => {
160
+ const a = b(s, o);
155
161
  t.push(a);
156
- const { pathname: o, search: c } = new URL(s, "http://test.invalid"), i = e[`${a.method} ${o}${c}`] ?? e[`${a.method} ${o}`];
157
- if (i === void 0) throw new Error(`routedTransport: no route for ${a.method} ${o}${c}; it has ${Object.keys(e).join(", ") || "none"}`);
158
- return v(i, a);
162
+ const { pathname: r, search: c } = new URL(s, "http://test.invalid"), i = e[`${a.method} ${r}${c}`] ?? e[`${a.method} ${r}`];
163
+ if (i === void 0) throw new Error(`routedTransport: no route for ${a.method} ${r}${c}; it has ${Object.keys(e).join(", ") || "none"}`);
164
+ return y(i, a);
159
165
  }, calls: t };
160
166
  }
161
167
  export {
162
- H as createTestApp,
163
- x as createTestI18n,
164
- U as createTestPlatform,
165
- B as createTestSession,
166
- K as deferred,
167
- Y as fakeLoader,
168
- C as heldAccess,
169
- q as jsonResponse,
170
- X as listPage,
171
- Z as mockMedia,
172
- te as routedTransport,
173
- ee as scriptedTransport,
174
- Q as settle,
175
- G as stubRoutes,
176
- L as testFormatting,
177
- W as withSetup
168
+ N as createTestApp,
169
+ q as createTestApplication,
170
+ B as createTestI18n,
171
+ T as createTestPlatform,
172
+ z as createTestSession,
173
+ X as deferred,
174
+ te as fakeLoader,
175
+ U as heldAccess,
176
+ se as jsonResponse,
177
+ ee as listPage,
178
+ ne as mockMedia,
179
+ oe as routedTransport,
180
+ re as scriptedTransport,
181
+ Y as settle,
182
+ I as stubRoutes,
183
+ F as testFormatting,
184
+ Z as withSetup
178
185
  };
@@ -17,6 +17,8 @@ export interface TestSessionOptions<U extends SessionUser = RegisteredUser> {
17
17
  root?: boolean;
18
18
  navigation?: readonly NavigationNode[];
19
19
  expiresAt?: Date | null;
20
+ /** The person's stored preferences (`usePreferences`). Default: none stored. */
21
+ preferences?: Readonly<Record<string, unknown>>;
20
22
  }
21
23
  /** What `/auth/me` would say for a user: for `session.establish(...)` mid-test, or an adapter that answers it. */
22
24
  export declare function createTestSession<U extends SessionUser = RegisteredUser>(options?: TestSessionOptions<U>): SessionSnapshot<U>;
@@ -0,0 +1,47 @@
1
+ import { useI18n as u } from "vue-i18n";
2
+ import { u as c } from "./describeError-B-NMa--w.js";
3
+ import { t as f } from "./toast-CqSDTWRX.js";
4
+ import { u as l } from "./platform-DtISOEt7.js";
5
+ import { i as r, p as d } from "./preferences-hYhrw8Uy.js";
6
+ import { a as i } from "./error-CD7x0Jrz.js";
7
+ const p = (e) => i(e) && e.kind === "unauthorized";
8
+ function b(e) {
9
+ if (!i(e) || e.code !== "identity.signin.locked") return null;
10
+ const t = e.params?.locked_until, s = typeof t == "string" ? new Date(t) : null;
11
+ return s && !Number.isNaN(s.getTime()) ? s : null;
12
+ }
13
+ async function k({ http: e, session: t }, s) {
14
+ await e.request(r.login, s, { handleUnauthorized: !1 }), await n({ session: t });
15
+ }
16
+ async function n({ session: e }) {
17
+ const t = await e.refresh();
18
+ if (t.status === "failed") throw t.error;
19
+ if (t.status !== "authenticated") throw new Error("The server accepted the request but reports nobody signed in.");
20
+ }
21
+ async function A(e, t) {
22
+ await e.http.request(r.loginAs, { user_id: t }), await n(e);
23
+ }
24
+ async function E(e) {
25
+ await e.http.request(r.loginAsReturn), await n(e);
26
+ }
27
+ function q() {
28
+ const e = d(l()), t = c(), { t: s } = u();
29
+ return {
30
+ value: e.value,
31
+ async save(o) {
32
+ try {
33
+ return await e.save(o), !0;
34
+ } catch (a) {
35
+ return p(a) || f.error(t(a, { fallback: s("core.preferences.save_failed") })), !1;
36
+ }
37
+ }
38
+ };
39
+ }
40
+ export {
41
+ A as a,
42
+ p as i,
43
+ b as l,
44
+ E as r,
45
+ k as s,
46
+ q as u
47
+ };