@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.
- package/CHANGELOG.md +33 -0
- package/README.md +4 -2
- package/dist/{AccessGate.vue_vue_type_script_setup_true_lang-CzQbD2Pc.js → AccessGate.vue_vue_type_script_setup_true_lang-DEzXovsY.js} +1 -1
- package/dist/{Activity-CdkJW68R.js → Activity-ChfxdvXf.js} +24 -23
- package/dist/{AdaptivePageShell.vue_vue_type_script_setup_true_lang-D5i77H6S.js → AdaptivePageShell.vue_vue_type_script_setup_true_lang-lPj9hPqV.js} +33 -33
- package/dist/{Changes-DxK_QfiB.js → Changes-BCa43_mO.js} +18 -17
- package/dist/{CollectionPage.vue_vue_type_script_setup_true_lang-x0jyJ01f.js → CollectionPage.vue_vue_type_script_setup_true_lang-C1GCvyZx.js} +6 -6
- 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
- package/dist/{DateField.vue_vue_type_script_setup_true_lang-CeNwBbJT.js → DateField.vue_vue_type_script_setup_true_lang-B5UUY1OO.js} +2 -2
- package/dist/{DeadLetters-DnA7LP1w.js → DeadLetters-wFTqhISU.js} +5 -5
- package/dist/{General-2matxl2Y.js → General-jW7u4MjH.js} +16 -15
- package/dist/{IncidentRecord-Bt3G4HlX.js → IncidentRecord-zTemLz2R.js} +6 -6
- package/dist/{IncidentsList-2iwgqp9J.js → IncidentsList-yu0xSMrH.js} +6 -6
- package/dist/{NewRolePage-DhGFwvk3.js → NewRolePage-CQ5UVaHs.js} +3 -3
- package/dist/{NumberField.vue_vue_type_script_setup_true_lang-B3UrXNqH.js → NumberField.vue_vue_type_script_setup_true_lang-YVgf5CP6.js} +1 -1
- 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
- package/dist/{ProfilePage-CpuyDBAv.js → ProfilePage-Ca3x3UAH.js} +79 -77
- 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
- package/dist/{ResourcePage.vue_vue_type_script_setup_true_lang-DljhsTU4.js → ResourcePage.vue_vue_type_script_setup_true_lang-Coz91xht.js} +1 -1
- 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
- package/dist/{RolePage-DaNv049g.js → RolePage-BUj1w1m1.js} +5 -5
- package/dist/{RolesPage-6hlzJes_.js → RolesPage-NKzBUsrM.js} +3 -3
- package/dist/{SectionNavigator.vue_vue_type_script_setup_true_lang-Dh3sXUt_.js → SectionNavigator.vue_vue_type_script_setup_true_lang-DfKEhTFv.js} +2 -2
- package/dist/{ServiceAccountDialog.vue_vue_type_script_setup_true_lang-FJbWxME_.js → ServiceAccountDialog.vue_vue_type_script_setup_true_lang-4nbhEpv_.js} +10 -9
- package/dist/{ServiceAccountRecord-0-JF5lRx.js → ServiceAccountRecord-ClbyeLhL.js} +8 -8
- package/dist/{ServiceAccountsList-DcsnOcf-.js → ServiceAccountsList-B2VDnYxD.js} +5 -5
- package/dist/{Sessions-DgWhpk-i.js → Sessions-BjkciyHH.js} +23 -21
- package/dist/{SettingsPage-BXPWATYU.js → SettingsPage-Csb14qsx.js} +7 -7
- package/dist/{SignIn-DPoUwHZd.js → SignIn-DPFMv4C7.js} +14 -12
- package/dist/{SignInPage-OyrVemro.js → SignInPage-DukoFqkt.js} +2 -2
- package/dist/{SignIns-BMDrZVVp.js → SignIns-DvdpNkiS.js} +23 -22
- 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
- package/dist/{Timestamp.vue_vue_type_script_setup_true_lang-ClZAAUMd.js → Timestamp.vue_vue_type_script_setup_true_lang-DlEUKWra.js} +1 -1
- package/dist/{UserRecord-BW-gdCqi.js → UserRecord-B9SeSWQh.js} +57 -55
- package/dist/{UsersList-B3ZF_1Dj.js → UsersList-CREG8q3l.js} +4 -4
- package/dist/access/index.js +4 -4
- package/dist/app/application.d.ts +14 -6
- package/dist/app/current.d.ts +11 -0
- package/dist/app/environment.d.ts +8 -0
- package/dist/app/index.d.ts +1 -0
- package/dist/app/index.js +14 -12
- package/dist/application-DomS6sbx.js +435 -0
- package/dist/collection/http.d.ts +16 -1
- package/dist/collection/index.d.ts +1 -1
- package/dist/collection/index.js +34 -32
- package/dist/content/Money.vue.d.ts +1 -1
- package/dist/content/index.js +151 -158
- package/dist/{contributions-CeG4bszd.js → contributions-obnyn03x.js} +1 -1
- package/dist/current-B0lHKTWr.js +17 -0
- package/dist/form/DateField.vue.d.ts +2 -2
- package/dist/form/DateTimeField.vue.d.ts +2 -2
- package/dist/form/MoneyField.vue.d.ts +1 -1
- package/dist/form/NumberField.vue.d.ts +1 -1
- package/dist/form/date/MonthYearPanel.vue.d.ts +1 -1
- package/dist/form/date/days.d.ts +3 -3
- package/dist/form/index.d.ts +2 -0
- package/dist/form/index.js +1111 -1081
- package/dist/form/zodErrorMap.d.ts +35 -0
- package/dist/format/format.d.ts +51 -6
- package/dist/format/index.d.ts +1 -1
- package/dist/format/index.js +1 -1
- package/dist/format-DoKs29bZ.js +118 -0
- package/dist/{guards-Biv_SlGn.js → guards-DGcSfTEh.js} +1 -1
- package/dist/http-DOEfFCDA.js +107 -0
- package/dist/i18n/index.js +15 -15
- package/dist/identity/index.d.ts +2 -0
- package/dist/identity/index.js +43 -40
- package/dist/identity/usePreferences.d.ts +19 -0
- package/dist/incidents/clientErrorReporter.d.ts +2 -1
- package/dist/incidents/index.js +1 -1
- package/dist/{index-kEHY7hcG.js → index-Be9Q1PB_.js} +78 -76
- package/dist/{index-Cq9TuOqH.js → index-DZikGJ8L.js} +457 -511
- package/dist/{index-ClJeyW3F.js → index-D_yyd4C2.js} +4 -4
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/internal/intlLocale.d.ts +5 -2
- package/dist/modules/identity/entities.d.ts +4 -0
- package/dist/modules/identity/routes.d.ts +5 -2
- package/dist/modules/identity/schemas.d.ts +6 -2
- package/dist/modules/incident/routes.d.ts +2 -0
- package/dist/modules/incident/schemas.d.ts +2 -0
- package/dist/{navigation-TnVFYRaX.js → navigation-CctcxT51.js} +1 -1
- package/dist/{neighbors-OyvGi233.js → neighbors-Csfan8Ho.js} +1 -1
- package/dist/notifications/index.js +1 -1
- package/dist/onboarding/Tip.vue.d.ts +41 -0
- package/dist/onboarding/index.d.ts +1 -0
- package/dist/onboarding/index.js +145 -0
- package/dist/onboarding/tips.d.ts +5 -0
- package/dist/page/index.js +3 -3
- package/dist/phone/index.js +74 -74
- package/dist/phone/phone.d.ts +3 -3
- package/dist/platform/httpSession.d.ts +1 -1
- package/dist/platform/index.d.ts +2 -0
- package/dist/platform/index.js +16 -13
- package/dist/platform/preferences.d.ts +35 -0
- package/dist/platform/session.d.ts +6 -1
- package/dist/platform-DtISOEt7.js +284 -0
- package/dist/playwright/session.d.ts +2 -0
- package/dist/preferences-hYhrw8Uy.js +91 -0
- package/dist/resource/index.d.ts +1 -0
- package/dist/resource/index.js +24 -8
- package/dist/resource/read.d.ts +16 -0
- package/dist/router/index.js +3 -3
- package/dist/{rowLayout-BsKEzEME.js → rowLayout-y1IB_h2r.js} +2 -2
- package/dist/{sections-CvUwZ-S1.js → sections-fkW_IJLc.js} +1 -1
- package/dist/{serverMessages-B6GHgi40.js → serverMessages-Ddghrewh.js} +1 -1
- package/dist/shell/darkMode.d.ts +13 -8
- package/dist/shell/index.js +396 -384
- package/dist/{state-6KSYsVw0.js → state-CXMexi0l.js} +1 -1
- package/dist/styles.css +1 -1
- package/dist/testing/app.d.ts +11 -0
- package/dist/testing/format.d.ts +4 -2
- package/dist/testing/index.d.ts +1 -1
- package/dist/testing/index.js +96 -89
- package/dist/testing/platform.d.ts +2 -0
- package/dist/usePreferences-B8LIZp_f.js +47 -0
- package/dist/{useTypedEntry-C_Bk4sI0.js → useTypedEntry-DKs8I1yP.js} +279 -280
- package/package.json +6 -2
- package/src/styles/components.css +17 -0
- package/dist/application-CuzT-0vW.js +0 -420
- package/dist/format-D8KUBmbS.js +0 -87
- package/dist/http-Dm0uXY9O.js +0 -95
- package/dist/intlLocale-CeRU44qJ.js +0 -4
- package/dist/platform-BQOX_Ntw.js +0 -283
package/dist/testing/index.js
CHANGED
|
@@ -1,92 +1,98 @@
|
|
|
1
|
-
import { nextTick as
|
|
2
|
-
import { createMemoryHistory as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
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,
|
|
10
|
-
e = s, t =
|
|
10
|
+
return { promise: new Promise((s, o) => {
|
|
11
|
+
e = s, t = o;
|
|
11
12
|
}), resolve: e, reject: t };
|
|
12
13
|
}
|
|
13
|
-
async function
|
|
14
|
+
async function Y(e = 5) {
|
|
14
15
|
for (let t = 0; t < e; t++)
|
|
15
|
-
await new Promise((n) => setTimeout(n, 0)), await
|
|
16
|
+
await new Promise((n) => setTimeout(n, 0)), await A();
|
|
16
17
|
}
|
|
17
|
-
const
|
|
18
|
-
function
|
|
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,
|
|
21
|
+
for (const [s, o] of Object.entries(t)) {
|
|
21
22
|
const a = n[s];
|
|
22
|
-
n[s] =
|
|
23
|
+
n[s] = h(o) && h(a) ? v(a, o) : o;
|
|
23
24
|
}
|
|
24
25
|
return n;
|
|
25
26
|
}
|
|
26
|
-
function
|
|
27
|
-
const t = { ...
|
|
28
|
-
for (const [n, s] of Object.entries(e.messages ?? {})) t[n] =
|
|
29
|
-
return
|
|
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
|
|
32
|
-
|
|
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
|
|
35
|
-
const
|
|
36
|
-
return { scope:
|
|
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
|
|
39
|
-
const { permissions: t = [] } = e, n = Array.isArray(t) ? Object.fromEntries(t.map((
|
|
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
|
|
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
|
|
51
|
-
const { user: t, permissions: n, unavailable: s, root:
|
|
52
|
-
} }, d =
|
|
53
|
-
...
|
|
54
|
-
config: { apiBase: "", locale: "en", appName: "Test app", capabilities: [], ...
|
|
55
|
-
transport:
|
|
56
|
-
session:
|
|
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 !
|
|
61
|
+
return !f && p && d.session.establish(p), d;
|
|
59
62
|
}
|
|
60
|
-
const
|
|
61
|
-
function
|
|
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:
|
|
64
|
-
return
|
|
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
|
|
68
|
-
const t = e.platform ??
|
|
70
|
+
function N(e = {}) {
|
|
71
|
+
const t = e.platform ?? T();
|
|
69
72
|
let n = e.router;
|
|
70
73
|
if (!n) {
|
|
71
|
-
const a =
|
|
72
|
-
a.replace(e.location ?? "/"), n =
|
|
74
|
+
const a = w();
|
|
75
|
+
a.replace(e.location ?? "/"), n = $({ history: a, routes: [...e.routes ?? [{ path: "/:pathMatch(.*)*", component: H }]] });
|
|
73
76
|
}
|
|
74
|
-
const s =
|
|
75
|
-
return { plugins: [n, 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
|
|
80
|
+
function Z(e, t = N()) {
|
|
78
81
|
let n;
|
|
79
|
-
const s =
|
|
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
|
|
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
|
|
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
|
|
107
|
+
function te(e) {
|
|
102
108
|
const t = [];
|
|
103
|
-
return { load: (s,
|
|
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
|
|
106
|
-
const t = { compact: !1, narrow: !1, reducedMotion: !1, standalone: !1, ...e }, n = window.matchMedia, s = /* @__PURE__ */ new Set(),
|
|
107
|
-
return window.matchMedia = ((
|
|
108
|
-
const c = { query:
|
|
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:
|
|
116
|
+
media: r,
|
|
111
117
|
get matches() {
|
|
112
|
-
return a(
|
|
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(
|
|
120
|
-
Object.assign(t,
|
|
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
|
|
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
|
|
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
|
|
147
|
+
function re(...e) {
|
|
142
148
|
const t = [], n = [...e];
|
|
143
|
-
return { transport: async (
|
|
144
|
-
const
|
|
145
|
-
t.push(
|
|
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
|
|
154
|
+
return y(c, r);
|
|
149
155
|
}, calls: t };
|
|
150
156
|
}
|
|
151
|
-
function
|
|
157
|
+
function oe(e) {
|
|
152
158
|
const t = [];
|
|
153
|
-
return { transport: async (s,
|
|
154
|
-
const a =
|
|
159
|
+
return { transport: async (s, o) => {
|
|
160
|
+
const a = b(s, o);
|
|
155
161
|
t.push(a);
|
|
156
|
-
const { pathname:
|
|
157
|
-
if (i === void 0) throw new Error(`routedTransport: no route for ${a.method} ${
|
|
158
|
-
return
|
|
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
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
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
|
+
};
|