@wssto2/vue-core 0.5.0 → 0.5.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 +10 -0
- package/dist/{AccessGate.vue_vue_type_script_setup_true_lang-Nw1IsB8N.js → AccessGate.vue_vue_type_script_setup_true_lang-DZ9GcLC1.js} +1 -1
- package/dist/{Activity-CoGI2_GL.js → Activity-dpY2kIs2.js} +2 -2
- package/dist/{Changes-Cwfe6wbX.js → Changes-CL8F1w8q.js} +2 -2
- package/dist/{CollectionPage.vue_vue_type_script_setup_true_lang-CtvHtFLy.js → CollectionPage.vue_vue_type_script_setup_true_lang-l-e-6WeS.js} +1 -1
- package/dist/{DeadLetters-DyA5Dqn0.js → DeadLetters-BZLyL5lR.js} +4 -4
- package/dist/{General-DTEfxWls.js → General-mrVzi-5R.js} +2 -2
- package/dist/{NewRolePage-CRZoUajV.js → NewRolePage-B2DItwvf.js} +2 -2
- package/dist/{ProfilePage-DLY81mvN.js → ProfilePage-EiTIYzZ5.js} +2 -2
- package/dist/{RoleEditor.vue_vue_type_script_setup_true_lang-gXbxXG2R.js → RoleEditor.vue_vue_type_script_setup_true_lang-BqqilJGF.js} +2 -2
- package/dist/{RolePage-B9t586Q8.js → RolePage-jMHAt9y8.js} +3 -3
- package/dist/{RolesPage-BRdG-OSL.js → RolesPage-B9GaVQBx.js} +2 -2
- package/dist/{SectionNavigator.vue_vue_type_script_setup_true_lang-Cy9Oi0ts.js → SectionNavigator.vue_vue_type_script_setup_true_lang-Ci04hApd.js} +1 -1
- package/dist/{Sessions-vGyUOnPG.js → Sessions-CHLokZ9e.js} +2 -2
- package/dist/{SettingsPage-V8WeADZZ.js → SettingsPage-CudoKdXm.js} +2 -2
- package/dist/{SignIn-C-3i8RG6.js → SignIn-ypRvdmjg.js} +2 -2
- package/dist/{SignInPage-D2NA3VKU.js → SignInPage-CbPeKlAo.js} +2 -2
- package/dist/{SignIns-eoYPB6kB.js → SignIns-BApzbGq-.js} +2 -2
- package/dist/{UserRecord-BaQl2zzQ.js → UserRecord-BCTaBajE.js} +5 -5
- package/dist/{UsersList-BfXWgH5K.js → UsersList-CqSK3cQL.js} +4 -4
- package/dist/access/index.js +1 -1
- package/dist/app/index.js +117 -115
- package/dist/app/keepAlive.d.ts +4 -8
- package/dist/collection/index.js +3 -3
- package/dist/{contributions-DVQPcjJz.js → contributions-fx5q5n1u.js} +1 -1
- package/dist/{guards-DRh4zmxO.js → guards-D4mXf_2X.js} +1 -1
- package/dist/{http-D_pBg22D.js → http-CdQowFlW.js} +1 -1
- package/dist/identity/index.d.ts +1 -1
- package/dist/identity/index.js +6 -7
- package/dist/identity/session.d.ts +10 -7
- package/dist/{index-g-qbUeTk.js → index-BTRv8mcf.js} +3 -3
- package/dist/{index-WkbzC_ee.js → index-VPzJJN6Z.js} +5 -5
- package/dist/{index-kqk7Mclb.js → index-auJqVMWC.js} +90 -92
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/keepAlive-z3IRFkQq.js +46 -0
- package/dist/{navigation-DuQwti76.js → navigation-Bc5EQ_Si.js} +1 -1
- package/dist/{neighbors-IMRQ4rkm.js → neighbors-Bv6vnWlW.js} +1 -1
- package/dist/notifications/index.js +1 -1
- package/dist/page/index.js +1 -1
- package/dist/platform/index.js +3 -3
- package/dist/platform/platform.d.ts +7 -2
- package/dist/platform/session.d.ts +17 -0
- package/dist/platform-Dx6STiwY.js +283 -0
- package/dist/router/index.js +3 -3
- package/dist/{sections-D5rgQ4YB.js → sections-B0HxIOC2.js} +1 -1
- package/dist/shell/index.js +3 -3
- package/dist/{status-C2gHqkj6.js → status-BUFELJz2.js} +2 -2
- package/dist/testing/index.js +1 -1
- package/package.json +1 -1
- package/dist/keepAlive-CDvMQlcJ.js +0 -49
- package/dist/platform-Dl1fbScN.js +0 -268
package/dist/app/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var Se = Object.defineProperty;
|
|
2
2
|
var Re = (e, n, r) => n in e ? Se(e, n, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[n] = r;
|
|
3
3
|
var Z = (e, n, r) => Re(e, typeof n != "symbol" ? n + "" : n, r);
|
|
4
|
-
import { effectScope as P, watch as W, defineComponent as pe, openBlock as Me, createElementBlock as Ae, createVNode as ee, unref as C, withCtx as te, createTextVNode as
|
|
4
|
+
import { effectScope as P, watch as W, defineComponent as pe, openBlock as Me, createElementBlock as Ae, createVNode as ee, unref as C, withCtx as te, createTextVNode as Le, toDisplayString as je, shallowRef as Ne, computed as Ke, h as se, createApp as Oe } from "vue";
|
|
5
5
|
import { useI18n as Ce, createI18n as _e } from "vue-i18n";
|
|
6
6
|
import { createRouter as Fe, isNavigationFailure as Ie } from "vue-router";
|
|
7
7
|
import { i as Te } from "../leaveGuard-Cc8yeLxM.js";
|
|
@@ -10,13 +10,13 @@ import { coreMessages as oe, createMessageRuntime as We } from "../i18n/index.js
|
|
|
10
10
|
import { i as Be, a as He } from "../Icon.vue_vue_type_script_lang-D7oC-d-S.js";
|
|
11
11
|
import { i as Ve, b as Ge } from "../bottomDock-BZEiOPYZ.js";
|
|
12
12
|
import { i as Je, p as ze } from "../chrome-nUcmVu8G.js";
|
|
13
|
-
import { i as Qe, g as Ue } from "../platform-
|
|
13
|
+
import { i as Qe, g as Ue } from "../platform-Dx6STiwY.js";
|
|
14
14
|
import { c as Xe, A as Ye, r as re } from "../access-DmAceEo5.js";
|
|
15
15
|
import { c as Ze, _ as et } from "../NoAccess.vue_vue_type_script_setup_true_lang-DWxq-MTM.js";
|
|
16
|
-
import { i as tt } from "../guards-
|
|
17
|
-
import { b as st, c as ot, n as ae } from "../navigation-
|
|
18
|
-
import { c as rt, s as ne } from "../contributions-
|
|
19
|
-
import { S as Pt } from "../contributions-
|
|
16
|
+
import { i as tt } from "../guards-D4mXf_2X.js";
|
|
17
|
+
import { b as st, c as ot, n as ae } from "../navigation-Bc5EQ_Si.js";
|
|
18
|
+
import { c as rt, s as ne } from "../contributions-fx5q5n1u.js";
|
|
19
|
+
import { S as Pt } from "../contributions-fx5q5n1u.js";
|
|
20
20
|
import { a as ie } from "../environment-Dva-SG8D.js";
|
|
21
21
|
import { u as Bt } from "../environment-Dva-SG8D.js";
|
|
22
22
|
import { b as ce, c as le } from "../describeError-BqGAUZgX.js";
|
|
@@ -24,18 +24,18 @@ import { _ as at } from "../Button.vue_vue_type_script_setup_true_lang-CL9Qh5yq.
|
|
|
24
24
|
import { _ as nt } from "../EmptyState.vue_vue_type_script_setup_true_lang-50p-Mp8I.js";
|
|
25
25
|
import { i as it } from "../feature-DdUAfyi4.js";
|
|
26
26
|
import { d as Vt, p as Gt } from "../feature-DdUAfyi4.js";
|
|
27
|
-
import { k as zt } from "../keepAlive-
|
|
27
|
+
import { k as zt } from "../keepAlive-z3IRFkQq.js";
|
|
28
28
|
function ct(e) {
|
|
29
29
|
const { platform: n } = e, r = P();
|
|
30
|
-
let i = null,
|
|
30
|
+
let i = null, v = null, y = !1;
|
|
31
31
|
function E(l, m) {
|
|
32
32
|
const h = new AbortController(), u = { controller: h, stops: [] };
|
|
33
33
|
for (const k of l)
|
|
34
34
|
try {
|
|
35
|
-
const
|
|
36
|
-
typeof
|
|
37
|
-
} catch (
|
|
38
|
-
e.onError(
|
|
35
|
+
const b = m(k, h.signal);
|
|
36
|
+
typeof b == "function" && u.stops.push({ owned: k, stop: b });
|
|
37
|
+
} catch (b) {
|
|
38
|
+
e.onError(b, k);
|
|
39
39
|
}
|
|
40
40
|
return u;
|
|
41
41
|
}
|
|
@@ -50,24 +50,24 @@ function ct(e) {
|
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
|
-
const
|
|
53
|
+
const L = (l) => e.effects.filter((m) => m.effect.scope === l), M = (l) => l.status !== "authenticated" ? null : e.sessionKey ? e.sessionKey(l) : String(l.user.id);
|
|
54
54
|
return {
|
|
55
55
|
start() {
|
|
56
|
-
if (
|
|
56
|
+
if (y || i) return;
|
|
57
57
|
i = E(
|
|
58
|
-
|
|
58
|
+
L("app"),
|
|
59
59
|
(m, h) => m.effect.start({ signal: h, platform: n, report: (u) => e.onError(u, m) })
|
|
60
60
|
);
|
|
61
|
-
const l =
|
|
61
|
+
const l = L("session");
|
|
62
62
|
r.run(
|
|
63
63
|
() => W(
|
|
64
64
|
() => M(n.session.state.value),
|
|
65
65
|
(m) => {
|
|
66
|
-
R(
|
|
66
|
+
R(v), v = null;
|
|
67
67
|
const h = n.session.state.value;
|
|
68
|
-
m === null || h.status !== "authenticated" || (
|
|
68
|
+
m === null || h.status !== "authenticated" || (v = E(
|
|
69
69
|
l,
|
|
70
|
-
(u, k) => u.effect.start({ signal: k, platform: n, user: h.user, report: (
|
|
70
|
+
(u, k) => u.effect.start({ signal: k, platform: n, user: h.user, report: (b) => e.onError(b, u) })
|
|
71
71
|
));
|
|
72
72
|
},
|
|
73
73
|
{ immediate: !0, flush: "sync" }
|
|
@@ -75,7 +75,7 @@ function ct(e) {
|
|
|
75
75
|
);
|
|
76
76
|
},
|
|
77
77
|
dispose() {
|
|
78
|
-
|
|
78
|
+
y || (y = !0, r.stop(), R(v), R(i), v = i = null);
|
|
79
79
|
}
|
|
80
80
|
};
|
|
81
81
|
}
|
|
@@ -97,10 +97,10 @@ const lt = { class: "mx-auto flex min-h-screen max-w-content items-center justif
|
|
|
97
97
|
ee(C(at), {
|
|
98
98
|
prominence: "primary",
|
|
99
99
|
icon: "refreshLine",
|
|
100
|
-
onClick: i[0] || (i[0] = (
|
|
100
|
+
onClick: i[0] || (i[0] = (v) => r.$emit("retry"))
|
|
101
101
|
}, {
|
|
102
102
|
default: te(() => [
|
|
103
|
-
je(
|
|
103
|
+
Le(je(C(n)("core.actions.retry")), 1)
|
|
104
104
|
]),
|
|
105
105
|
_: 1
|
|
106
106
|
})
|
|
@@ -119,7 +119,7 @@ ${r.map((i) => ` - [${i.owner}] ${i.message}`).join(`
|
|
|
119
119
|
this.name = "ApplicationError", this.issues = r;
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
|
-
const fe = "application",
|
|
122
|
+
const fe = "application", w = (e) => `feature "${e.id}"`;
|
|
123
123
|
function* B(e, n = "") {
|
|
124
124
|
for (const r of e) {
|
|
125
125
|
const i = r.path.startsWith("/") ? r.path : `${n.replace(/\/$/, "")}/${r.path}`;
|
|
@@ -131,81 +131,81 @@ function ft(e) {
|
|
|
131
131
|
e.features.forEach((o, s) => {
|
|
132
132
|
it(o) ? i.push(o) : r(fe, `features[${s}] was not created with defineFeature().`);
|
|
133
133
|
});
|
|
134
|
-
const
|
|
134
|
+
const v = /* @__PURE__ */ new Map();
|
|
135
135
|
for (const o of i)
|
|
136
|
-
|
|
136
|
+
v.has(o.id) ? r(w(o), `the feature id "${o.id}" is used twice in the features list.`) : v.set(o.id, o);
|
|
137
137
|
for (const o of i)
|
|
138
138
|
for (const s of o.requires)
|
|
139
|
-
|
|
140
|
-
const
|
|
139
|
+
v.has(s) || r(w(o), `requires the feature "${s}", which is not in the features list.`);
|
|
140
|
+
const y = [], E = /* @__PURE__ */ new Set(), R = (o) => {
|
|
141
141
|
if (E.has(o.id)) return;
|
|
142
|
-
const s =
|
|
142
|
+
const s = y.indexOf(o.id);
|
|
143
143
|
if (s !== -1) {
|
|
144
|
-
r(
|
|
144
|
+
r(w(o), `requirements form a cycle: ${[...y.slice(s), o.id].join(" -> ")}.`), E.add(o.id);
|
|
145
145
|
return;
|
|
146
146
|
}
|
|
147
|
-
|
|
147
|
+
y.push(o.id);
|
|
148
148
|
for (const c of o.requires) {
|
|
149
|
-
const
|
|
150
|
-
|
|
149
|
+
const f = v.get(c);
|
|
150
|
+
f && R(f);
|
|
151
151
|
}
|
|
152
|
-
|
|
152
|
+
y.pop(), E.add(o.id);
|
|
153
153
|
};
|
|
154
154
|
i.forEach(R);
|
|
155
|
-
const
|
|
155
|
+
const L = new Set(e.platform.config.capabilities);
|
|
156
156
|
for (const o of i)
|
|
157
157
|
for (const s of o.backend)
|
|
158
|
-
|
|
158
|
+
L.has(s) || r(w(o), `needs the backend capability "${s}", which the server does not report.`);
|
|
159
159
|
const M = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map();
|
|
160
160
|
for (const o of i) {
|
|
161
161
|
for (const s of o.routes) {
|
|
162
|
-
const c = s.path.length > 1 ? s.path.replace(/\/$/, "") : s.path,
|
|
163
|
-
|
|
162
|
+
const c = s.path.length > 1 ? s.path.replace(/\/$/, "") : s.path, f = l.get(c);
|
|
163
|
+
f ? r(w(o), `declares the path "${s.path}", which feature "${f.id}" declares too.`) : l.set(c, o);
|
|
164
164
|
}
|
|
165
165
|
for (const { record: s } of B(o.routes)) {
|
|
166
|
-
if (s.meta && "feature" in s.meta && r(
|
|
166
|
+
if (s.meta && "feature" in s.meta && r(w(o), `the route "${String(s.name ?? s.path)}" sets meta.feature, which the runtime owns.`), typeof s.name != "string") continue;
|
|
167
167
|
const c = M.get(s.name);
|
|
168
|
-
c ? r(
|
|
168
|
+
c ? r(w(o), `declares the route name "${s.name}", which feature "${c.id}" declares too.`) : M.set(s.name, o);
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
171
|
const m = new Set(e.reservedContexts), h = /* @__PURE__ */ new Map();
|
|
172
172
|
for (const o of i)
|
|
173
173
|
for (const { key: s } of o.contexts) {
|
|
174
174
|
const c = s.description ?? "a context";
|
|
175
|
-
m.has(s) && r(
|
|
176
|
-
const
|
|
177
|
-
|
|
175
|
+
m.has(s) && r(w(o), `provides the context "${c}", which the runtime provides itself.`);
|
|
176
|
+
const f = h.get(s);
|
|
177
|
+
f ? r(w(o), `provides the context "${c}", which feature "${f.id}" provides too.`) : h.set(s, o);
|
|
178
178
|
}
|
|
179
179
|
const u = /* @__PURE__ */ new Map(), k = (o, s) => {
|
|
180
180
|
for (const c of s) {
|
|
181
|
-
const
|
|
182
|
-
|
|
183
|
-
for (const
|
|
184
|
-
e.supportedLocales.includes(
|
|
181
|
+
const f = u.get(c.namespace);
|
|
182
|
+
f ? r(o, `declares the message namespace "${c.namespace}", which ${f} declares too.`) : u.set(c.namespace, o);
|
|
183
|
+
for (const j of Object.keys(c.loaders))
|
|
184
|
+
e.supportedLocales.includes(j) || r(o, `the namespace "${c.namespace}" has a loader for "${j}", which is not a supported locale (${e.supportedLocales.join(", ")}).`);
|
|
185
185
|
}
|
|
186
186
|
};
|
|
187
|
-
for (const o of i) k(
|
|
187
|
+
for (const o of i) k(w(o), o.messages);
|
|
188
188
|
k(fe, e.messages);
|
|
189
|
-
const
|
|
189
|
+
const b = (o) => u.has(o);
|
|
190
190
|
for (const o of i)
|
|
191
191
|
for (const { record: s } of B(o.routes))
|
|
192
192
|
for (const c of s.meta?.messages ?? [])
|
|
193
|
-
|
|
193
|
+
b(c) || r(w(o), `the route "${String(s.name ?? s.path)}" needs the message namespace "${c}", which nobody declares.`);
|
|
194
194
|
const x = /* @__PURE__ */ new Map();
|
|
195
195
|
for (const o of i)
|
|
196
196
|
for (const s of o.contributions) {
|
|
197
197
|
const c = x.get(s.id);
|
|
198
|
-
c ? r(
|
|
199
|
-
for (const
|
|
200
|
-
|
|
198
|
+
c ? r(w(o), `declares the shell contribution "${s.id}", which feature "${c.id}" declares too.`) : x.set(s.id, o), e.shellSlots && !s.optional && !e.shellSlots.includes(s.slot) && r(w(o), `contributes "${s.id}" to the slot "${s.slot}", which the shell does not render (it renders ${e.shellSlots.join(", ") || "none"}). Mark it optional to leave it out instead.`);
|
|
199
|
+
for (const f of s.messages ?? [])
|
|
200
|
+
b(f) || r(w(o), `the contribution "${s.id}" needs the message namespace "${f}", which nobody declares.`);
|
|
201
201
|
}
|
|
202
202
|
const A = /* @__PURE__ */ new Map();
|
|
203
203
|
for (const o of i)
|
|
204
204
|
for (const s of o.effects) {
|
|
205
205
|
const c = A.get(s.id);
|
|
206
|
-
c ? r(
|
|
207
|
-
const
|
|
208
|
-
|
|
206
|
+
c ? r(w(o), `declares the effect "${s.id}", which feature "${c.id}" declares too.`) : A.set(s.id, o);
|
|
207
|
+
const f = s.scope;
|
|
208
|
+
f !== "app" && f !== "session" && r(w(o), `the effect "${s.id}" has the scope "${f}"; use "app" or "session".`);
|
|
209
209
|
}
|
|
210
210
|
return { features: i, issues: n };
|
|
211
211
|
}
|
|
@@ -226,20 +226,20 @@ function me(e, n) {
|
|
|
226
226
|
}
|
|
227
227
|
const de = (e) => [...new Set(e)];
|
|
228
228
|
function Tt(e) {
|
|
229
|
-
const { platform: n } = e, r = e.locale?.supported ?? Object.keys(oe), i = e.locale?.fallback ?? "en",
|
|
230
|
-
r.includes(i) ||
|
|
229
|
+
const { platform: n } = e, r = e.locale?.supported ?? Object.keys(oe), i = e.locale?.fallback ?? "en", v = e.shell === void 0 ? void 0 : pt(e.shell) ? e.shell : { component: e.shell, slots: void 0, progress: void 0 }, y = [];
|
|
230
|
+
r.includes(i) || y.push({ owner: "application", message: `the fallback locale "${i}" is not among the supported locales (${r.join(", ")}).` });
|
|
231
231
|
for (const t of Object.keys(e.locale?.flags ?? {}))
|
|
232
|
-
r.includes(t) ||
|
|
232
|
+
r.includes(t) || y.push({ owner: "application", message: `locale.flags names the locale "${t}", which is not among the supported locales (${r.join(", ")}).` });
|
|
233
233
|
const E = e.locale?.initial ?? (r.includes(n.config.locale) ? n.config.locale : i);
|
|
234
|
-
r.includes(E) ||
|
|
235
|
-
const R = [Ue, Pe, ze, Ge, He, ae, ne, re, ie, ce, le],
|
|
234
|
+
r.includes(E) || y.push({ owner: "application", message: `the initial locale "${E}" is not among the supported locales (${r.join(", ")}).` });
|
|
235
|
+
const R = [Ue, Pe, ze, Ge, He, ae, ne, re, ie, ce, le], L = ft({
|
|
236
236
|
features: e.features,
|
|
237
237
|
platform: n,
|
|
238
238
|
messages: e.messages ?? [],
|
|
239
239
|
reservedContexts: R,
|
|
240
240
|
supportedLocales: r,
|
|
241
|
-
shellSlots:
|
|
242
|
-
}), M = [...
|
|
241
|
+
shellSlots: v?.slots
|
|
242
|
+
}), M = [...y, ...L.issues], l = L.features, m = st(
|
|
243
243
|
l.flatMap((t) => t.navigation.map((a) => ({ feature: t.id, binding: a }))),
|
|
244
244
|
e.navigation
|
|
245
245
|
);
|
|
@@ -248,9 +248,9 @@ function Tt(e) {
|
|
|
248
248
|
const h = dt(E, i, e.i18n), u = h.global;
|
|
249
249
|
for (const [t, a] of Object.entries(oe)) u.mergeLocaleMessage(t, a);
|
|
250
250
|
for (const [t, a] of Object.entries(e.i18n?.messages ?? {})) u.mergeLocaleMessage(t, a);
|
|
251
|
-
const k = qe({ locale: () => u.locale.value, formatters: e.formatting }),
|
|
251
|
+
const k = qe({ locale: () => u.locale.value, formatters: e.formatting }), b = [...l.flatMap((t) => t.messages), ...e.messages ?? []], x = (t) => (e.onError ?? mt)({ ...t, route: s.currentRoute.value.matched.length > 0 ? s.currentRoute.value.fullPath : null }), A = We({
|
|
252
252
|
target: u,
|
|
253
|
-
namespaces:
|
|
253
|
+
namespaces: b,
|
|
254
254
|
fallback: i,
|
|
255
255
|
supported: r,
|
|
256
256
|
onFailure: (t) => x({ source: "messages", error: t.error, detail: `${t.namespace} (${t.locale})`, feature: o.get(t.namespace) })
|
|
@@ -258,39 +258,39 @@ function Tt(e) {
|
|
|
258
258
|
history: e.router?.history ?? Ze(),
|
|
259
259
|
routes: l.flatMap((t) => me(t.routes, t.id)),
|
|
260
260
|
scrollBehavior: e.router?.scrollBehavior ?? ((t, a) => t.name === a.name ? !1 : { top: 0 })
|
|
261
|
-
}), c = e.router?.login ?? { name: "login" },
|
|
261
|
+
}), c = e.router?.login ?? { name: "login" }, f = e.router?.home ?? { path: "/" }, j = [], H = (t) => {
|
|
262
262
|
try {
|
|
263
263
|
return s.resolve(t).matched.length > 0 ? null : "matches no route";
|
|
264
264
|
} catch (a) {
|
|
265
|
-
const
|
|
266
|
-
return
|
|
265
|
+
const p = a instanceof Error ? a.message : String(a);
|
|
266
|
+
return p.startsWith("No match for") ? "matches no route" : `cannot be resolved (${p})`;
|
|
267
267
|
}
|
|
268
268
|
};
|
|
269
269
|
if (l.some((t) => t.routes.some((a) => a.meta?.public !== !0))) {
|
|
270
270
|
const t = H(c) ?? (s.resolve(c).meta.public === !0 ? null : "is not public (meta.public: true)");
|
|
271
|
-
t &&
|
|
271
|
+
t && j.push({ owner: "application", message: `the login route ${JSON.stringify(c)} ${t.replace("matches no route", "does not exist")}, but protected routes are installed: an anonymous visitor would have nowhere to go. Install a feature with the login route or set router.login.` });
|
|
272
272
|
}
|
|
273
273
|
for (const { feature: t, binding: a } of m.destinations.values()) {
|
|
274
|
-
const
|
|
275
|
-
|
|
274
|
+
const p = H(a.to);
|
|
275
|
+
p && j.push({ owner: `feature "${t}"`, message: `the destination "${a.destination}" is bound to ${JSON.stringify(a.to)}, which ${p}.` });
|
|
276
276
|
}
|
|
277
|
-
if (
|
|
278
|
-
const N = Ne({ status: "idle" }),
|
|
277
|
+
if (j.length > 0) throw new ue(j);
|
|
278
|
+
const N = Ne({ status: "idle" }), _ = {
|
|
279
279
|
state: N,
|
|
280
280
|
locale: Ke(() => u.locale.value),
|
|
281
281
|
locales: r,
|
|
282
282
|
localeFlags: e.locale?.flags ?? {},
|
|
283
283
|
setLocale: async (t) => {
|
|
284
|
-
const a = u.locale.value,
|
|
285
|
-
if (
|
|
286
|
-
const
|
|
284
|
+
const a = u.locale.value, p = await A.setLocale(t);
|
|
285
|
+
if (p && u.locale.value !== a) {
|
|
286
|
+
const g = (O) => x({ source: "locale", error: O, detail: t });
|
|
287
287
|
try {
|
|
288
|
-
Promise.resolve(e.locale?.onChange?.(t)).catch(
|
|
288
|
+
Promise.resolve(e.locale?.onChange?.(t)).catch(g);
|
|
289
289
|
} catch (O) {
|
|
290
|
-
|
|
290
|
+
g(O);
|
|
291
291
|
}
|
|
292
292
|
}
|
|
293
|
-
return
|
|
293
|
+
return p;
|
|
294
294
|
},
|
|
295
295
|
retry: () => D()
|
|
296
296
|
}, I = {
|
|
@@ -303,50 +303,50 @@ function Tt(e) {
|
|
|
303
303
|
onError: (t, a) => x({ source: "effect", error: t, feature: a.feature, detail: a.effect.id })
|
|
304
304
|
}), he = new Map(l.map((t) => [t.id, t.messages.map((a) => a.namespace)])), G = (t) => de(I.contributions.filter(({ contribution: a }) => a.scope === t).flatMap(({ contribution: a }) => a.messages ?? [])), ge = G("always"), we = G("authenticated");
|
|
305
305
|
async function ve(t) {
|
|
306
|
-
const a = t.matched.flatMap((
|
|
307
|
-
await A.load(de([...a, ...ge, ...
|
|
306
|
+
const a = t.matched.flatMap((g) => [...he.get(g.meta.feature ?? "") ?? [], ...g.meta.messages ?? []]), p = n.session.state.value.status === "authenticated";
|
|
307
|
+
await A.load(de([...a, ...ge, ...p ? we : []]));
|
|
308
308
|
}
|
|
309
309
|
let T = null;
|
|
310
310
|
function q(t) {
|
|
311
|
-
const a = t.meta.titleKey,
|
|
312
|
-
|
|
311
|
+
const a = t.meta.titleKey, p = T?.documentTitle.value ?? (a && u.te(a) ? u.t(a) : null), g = (e.router?.documentTitle ?? ht)(p, n.config.appName);
|
|
312
|
+
g !== "" && (document.title = g);
|
|
313
313
|
}
|
|
314
314
|
const ye = ot({ session: n.session, router: s, i18n: u, destinations: m.destinations }), $e = rt(I.contributions, n.session), be = Xe({ router: s, access: n.access, noAccess: e.noAccess ?? et }), Ee = pe({
|
|
315
315
|
name: "ApplicationRoot",
|
|
316
316
|
setup() {
|
|
317
317
|
return () => {
|
|
318
318
|
const t = N.value;
|
|
319
|
-
return t.status === "failed" ? se(ut, { kind: t.kind, onRetry: () => void D() }) : t.status !== "ready" ? null : se(
|
|
319
|
+
return t.status === "failed" ? se(ut, { kind: t.kind, onRetry: () => void D() }) : t.status !== "ready" ? null : se(v?.component ?? Ye);
|
|
320
320
|
};
|
|
321
321
|
}
|
|
322
|
-
}),
|
|
323
|
-
Qe(
|
|
324
|
-
for (const t of l) for (const { key: a, value:
|
|
322
|
+
}), d = Oe(Ee);
|
|
323
|
+
Qe(d, n), d.use(h), De(d, k), T = Je(d), Ve(d), Te(d), e.icons && Be(d, ...Array.isArray(e.icons) ? e.icons : [e.icons]), d.provide(ie, _), e.describeError && d.provide(ce, e.describeError), e.describeFieldError && d.provide(le, e.describeFieldError), d.provide(ae, ye), d.provide(ne, $e), d.provide(re, be);
|
|
324
|
+
for (const t of l) for (const { key: a, value: p } of t.contexts) d.provide(a, p);
|
|
325
325
|
let S = !1, J = !1, z = !1, Q = !1;
|
|
326
326
|
const K = [];
|
|
327
327
|
function ke() {
|
|
328
|
-
const t =
|
|
329
|
-
|
|
330
|
-
x({ source: "vue", error:
|
|
328
|
+
const t = d.config.errorHandler;
|
|
329
|
+
d.config.errorHandler = ($, xe, Y) => {
|
|
330
|
+
x({ source: "vue", error: $, detail: Y }), t?.($, xe, Y);
|
|
331
331
|
};
|
|
332
|
-
const a = (
|
|
333
|
-
|
|
332
|
+
const a = ($) => x({ source: "unhandledrejection", error: $.reason }), p = ($) => {
|
|
333
|
+
$.error && x({ source: "window", error: $.error });
|
|
334
334
|
};
|
|
335
|
-
window.addEventListener("unhandledrejection", a), window.addEventListener("error",
|
|
336
|
-
window.removeEventListener("unhandledrejection", a), window.removeEventListener("error",
|
|
335
|
+
window.addEventListener("unhandledrejection", a), window.addEventListener("error", p), K.push(() => {
|
|
336
|
+
window.removeEventListener("unhandledrejection", a), window.removeEventListener("error", p);
|
|
337
337
|
});
|
|
338
|
-
const
|
|
339
|
-
n.session.holdExpired(
|
|
338
|
+
const g = l.some(($) => $.holdsExpiredSession);
|
|
339
|
+
n.session.holdExpired(g), K.push(() => n.session.holdExpired(!1)), K.push(
|
|
340
340
|
tt({
|
|
341
341
|
router: s,
|
|
342
342
|
session: n.session,
|
|
343
343
|
login: c,
|
|
344
|
-
home:
|
|
345
|
-
holdExpired:
|
|
344
|
+
home: f,
|
|
345
|
+
holdExpired: g,
|
|
346
346
|
prepare: ve,
|
|
347
347
|
afterNavigation: q,
|
|
348
|
-
progress: e.router?.progress ??
|
|
349
|
-
onError: (
|
|
348
|
+
progress: e.router?.progress ?? v?.progress,
|
|
349
|
+
onError: ($) => x({ source: "router", error: $ })
|
|
350
350
|
})
|
|
351
351
|
);
|
|
352
352
|
const O = P();
|
|
@@ -355,54 +355,56 @@ function Tt(e) {
|
|
|
355
355
|
X.run(
|
|
356
356
|
() => W(
|
|
357
357
|
() => u.locale.value,
|
|
358
|
-
(
|
|
359
|
-
document.documentElement.lang =
|
|
358
|
+
($) => {
|
|
359
|
+
document.documentElement.lang = $, q(s.currentRoute.value);
|
|
360
360
|
},
|
|
361
361
|
{ immediate: !0 }
|
|
362
362
|
)
|
|
363
363
|
), K.push(() => X.stop());
|
|
364
364
|
}
|
|
365
|
-
const
|
|
365
|
+
const F = (t, a) => {
|
|
366
366
|
N.value = { status: "failed", kind: t, error: a };
|
|
367
367
|
};
|
|
368
368
|
async function U() {
|
|
369
369
|
N.value = { status: "starting" };
|
|
370
370
|
const t = await n.session.restore();
|
|
371
371
|
if (S) return;
|
|
372
|
-
if (t.status === "failed") return
|
|
373
|
-
const a =
|
|
372
|
+
if (t.status === "failed") return F("session", t.error);
|
|
373
|
+
const a = t.status === "authenticated" ? t.user.locale : void 0;
|
|
374
|
+
if (typeof a == "string" && a !== u.locale.value && r.includes(a) && await _.setLocale(a), S) return;
|
|
375
|
+
const p = await A.loadEssential();
|
|
374
376
|
if (!S) {
|
|
375
|
-
if (
|
|
377
|
+
if (p.length > 0) return F("messages", p[0].error);
|
|
376
378
|
try {
|
|
377
|
-
const
|
|
379
|
+
const g = await s.replace(s.options.history.location);
|
|
378
380
|
if (S) return;
|
|
379
|
-
if (Ie(
|
|
380
|
-
} catch (
|
|
381
|
-
S ||
|
|
381
|
+
if (Ie(g)) return F("startup", g);
|
|
382
|
+
} catch (g) {
|
|
383
|
+
S || F("startup", g);
|
|
382
384
|
return;
|
|
383
385
|
}
|
|
384
|
-
Q || (
|
|
386
|
+
Q || (d.use(s), Q = !0), N.value = { status: "ready" }, V.start();
|
|
385
387
|
}
|
|
386
388
|
}
|
|
387
389
|
async function D() {
|
|
388
390
|
S || N.value.status !== "failed" || (await A.retry(), await U());
|
|
389
391
|
}
|
|
390
392
|
return {
|
|
391
|
-
app:
|
|
393
|
+
app: d,
|
|
392
394
|
router: s,
|
|
393
395
|
i18n: h,
|
|
394
396
|
state: N,
|
|
395
|
-
locale:
|
|
396
|
-
setLocale:
|
|
397
|
+
locale: _.locale,
|
|
398
|
+
setLocale: _.setLocale,
|
|
397
399
|
async mount(t) {
|
|
398
400
|
if (S) throw new Error("This application was disposed; create a new one with createApplication().");
|
|
399
401
|
if (J) throw new Error("This application is already mounted.");
|
|
400
|
-
J = !0, ke(), await U(), !S && (
|
|
402
|
+
J = !0, ke(), await U(), !S && (d.mount(t), z = !0);
|
|
401
403
|
},
|
|
402
404
|
retry: D,
|
|
403
405
|
dispose() {
|
|
404
406
|
if (!S) {
|
|
405
|
-
S = !0, V.dispose(), A.dispose(), z &&
|
|
407
|
+
S = !0, V.dispose(), A.dispose(), z && d.unmount();
|
|
406
408
|
for (const t of K.reverse()) t();
|
|
407
409
|
s.options.history.destroy();
|
|
408
410
|
}
|
package/dist/app/keepAlive.d.ts
CHANGED
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
import type { Platform } from "../platform/platform";
|
|
2
1
|
import type { SessionEffect } from "./feature";
|
|
3
2
|
export interface KeepSessionAliveOptions {
|
|
4
3
|
/** How long before the session expires it is renewed. Default 60 000 ms. */
|
|
5
4
|
margin?: number;
|
|
6
|
-
/**
|
|
7
|
-
* The server call that renews the session (a refresh-token request). After it the session is read
|
|
8
|
-
* again, which brings the new expiry. Without it the session is only read again.
|
|
9
|
-
*/
|
|
10
|
-
renew?: (platform: Platform) => Promise<void>;
|
|
11
5
|
/** When a renewal did not move the expiry, how long to wait before trying again. Default 30 000 ms. */
|
|
12
6
|
retryAfter?: number;
|
|
13
7
|
}
|
|
@@ -16,8 +10,10 @@ export interface KeepSessionAliveOptions {
|
|
|
16
10
|
* when the app comes back to the foreground or the network returns, since timers do not run while a
|
|
17
11
|
* phone sleeps. Skipped while offline. Opt in by listing it in a feature's `effects`:
|
|
18
12
|
*
|
|
19
|
-
* defineFeature({ id: "session", effects: [keepSessionAlive(
|
|
13
|
+
* defineFeature({ id: "session", effects: [keepSessionAlive()] })
|
|
20
14
|
*
|
|
21
|
-
*
|
|
15
|
+
* It renews through `platform.session.renew()`, the platform's `renewSession`, the same single renewal a 401 uses,
|
|
16
|
+
* so a timer and a failed request never present the refresh token twice. A session with no expiry, or one that is
|
|
17
|
+
* not `renewable` (no `renewSession`, or an embed session), has nothing to renew and the effect stays idle.
|
|
22
18
|
*/
|
|
23
19
|
export declare function keepSessionAlive(options?: KeepSessionAliveOptions): SessionEffect;
|
package/dist/collection/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { D as O, L as j, a as U, h as G, l as X, r as Z } from "../http-
|
|
2
|
-
import { _ as H, a as J, u as K } from "../CollectionPage.vue_vue_type_script_setup_true_lang-
|
|
3
|
-
import { u as W, a as Y } from "../neighbors-
|
|
1
|
+
import { D as O, L as j, a as U, h as G, l as X, r as Z } from "../http-CdQowFlW.js";
|
|
2
|
+
import { _ as H, a as J, u as K } from "../CollectionPage.vue_vue_type_script_setup_true_lang-l-e-6WeS.js";
|
|
3
|
+
import { u as W, a as Y } from "../neighbors-Bv6vnWlW.js";
|
|
4
4
|
import { a as te, b as se } from "../rowLayout-BBFyLbOl.js";
|
|
5
5
|
import { _ as ae } from "../DataTable.vue_vue_type_script_setup_true_lang-BEvz5zqo.js";
|
|
6
6
|
import { defineComponent as y, openBlock as c, createElementBlock as d, Fragment as h, renderList as v, createBlock as k, unref as f, withCtx as C, normalizeClass as m, createVNode as p, createCommentVNode as g, computed as w, toValue as E } from "vue";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as i, h as l } from "vue";
|
|
2
2
|
import { d as u } from "./context-Ch1r4fdN.js";
|
|
3
|
-
import { h as a } from "./platform-
|
|
3
|
+
import { h as a } from "./platform-Dx6STiwY.js";
|
|
4
4
|
function h(o, n) {
|
|
5
5
|
const t = o.map(({ contribution: e }) => e).sort((e, r) => (e.order ?? 0) - (r.order ?? 0));
|
|
6
6
|
return {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { hasInjectionContext as $, inject as _, watch as O } from "vue";
|
|
2
|
-
import { g as j } from "./platform-
|
|
2
|
+
import { g as j } from "./platform-Dx6STiwY.js";
|
|
3
3
|
const k = [5, 8, 10, 15, 25, 50, 100], A = 25;
|
|
4
4
|
function X(e) {
|
|
5
5
|
const t = `defineCollection("${e.id}")`;
|
package/dist/identity/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export type * as Inputs from "../modules/identity/schemas";
|
|
|
3
3
|
export { identityRoutes } from "../modules/identity/routes";
|
|
4
4
|
export { identityFeature } from "./feature";
|
|
5
5
|
export type { IdentityFeatureOptions } from "./feature";
|
|
6
|
-
export { identityPlatform, identitySessionAdapter
|
|
6
|
+
export { identityPlatform, identitySessionAdapter } from "./session";
|
|
7
7
|
export type { IdentityPlatformOptions } from "./session";
|
|
8
8
|
export { usersFeature } from "./users/feature";
|
|
9
9
|
export type { UsersFeatureOptions } from "./users/feature";
|
package/dist/identity/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { _ as t, h as n, j as a, i, k as o, d as r, l as d, m as u, n as
|
|
2
|
-
import { _ as
|
|
1
|
+
import { _ as t, h as n, j as a, i, k as o, d as r, l as d, m as u, n as f, r as l, s as p, o as y, q as A, f as c } from "../index-auJqVMWC.js";
|
|
2
|
+
import { _ as I } from "../ActionRow.vue_vue_type_script_setup_true_lang-BCgKzUvG.js";
|
|
3
3
|
export {
|
|
4
|
-
|
|
4
|
+
I as ActionRow,
|
|
5
5
|
t as SignInAsButton,
|
|
6
6
|
n as identityFeature,
|
|
7
7
|
a as identityPlatform,
|
|
@@ -10,11 +10,10 @@ export {
|
|
|
10
10
|
r as isSessionEnded,
|
|
11
11
|
d as lockedUntil,
|
|
12
12
|
u as parseIdentityUser,
|
|
13
|
-
|
|
14
|
-
f as renewIdentityTokens,
|
|
13
|
+
f as profileRoutes,
|
|
15
14
|
l as returnToOwnAccount,
|
|
16
15
|
p as signIn,
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
y as signInAs,
|
|
17
|
+
A as usersFeature,
|
|
19
18
|
c as usersRoutes
|
|
20
19
|
};
|
|
@@ -8,7 +8,14 @@ import { type IdentityUser } from "./user";
|
|
|
8
8
|
*/
|
|
9
9
|
export declare function identitySessionAdapter<U extends SessionUser>(http: HttpClient, parseUser: UserParser<U>): SessionAdapter<U>;
|
|
10
10
|
/** What `createPlatform` is given to run on go-core's identity module. */
|
|
11
|
-
export type IdentityPlatformOptions<U extends SessionUser> = Required<Pick<PlatformOptions<U, BootstrapConfig>, "session" | "renewSession"
|
|
11
|
+
export type IdentityPlatformOptions<U extends SessionUser> = Required<Pick<PlatformOptions<U, BootstrapConfig>, "session" | "renewSession">> & Pick<PlatformOptions<U, BootstrapConfig>, "renewable">;
|
|
12
|
+
/** What `identityPlatform` takes. */
|
|
13
|
+
export interface IdentityPlatformInput<U extends SessionUser> {
|
|
14
|
+
/** The application's own user projection; see `identityPlatform`. */
|
|
15
|
+
parseUser?: UserParser<U>;
|
|
16
|
+
/** False while the session has no refresh token (an embed bearer session): nothing renews it, a 401 ends it. See `PlatformOptions.renewable`. */
|
|
17
|
+
renewable?: () => boolean;
|
|
18
|
+
}
|
|
12
19
|
/**
|
|
13
20
|
* The platform options that wire the session to go-core's identity routes: reading it (`/auth/me`, with one
|
|
14
21
|
* refresh when the access token ran out), ending it, and renewing it when a request is answered 401.
|
|
@@ -18,13 +25,9 @@ export type IdentityPlatformOptions<U extends SessionUser> = Required<Pick<Platf
|
|
|
18
25
|
* The user is go-core's default projection (`IdentityUser`); an application that projects its own passes
|
|
19
26
|
* `parseUser`, which must keep the `id` and the `login` (the prompt for an expired session shows it).
|
|
20
27
|
*/
|
|
21
|
-
export declare function identityPlatform(): IdentityPlatformOptions<IdentityUser>;
|
|
28
|
+
export declare function identityPlatform(options?: Omit<IdentityPlatformInput<IdentityUser>, "parseUser">): IdentityPlatformOptions<IdentityUser>;
|
|
22
29
|
export declare function identityPlatform<U extends SessionUser & {
|
|
23
30
|
readonly login: string;
|
|
24
|
-
}>(options: {
|
|
31
|
+
}>(options: IdentityPlatformInput<U> & {
|
|
25
32
|
parseUser: UserParser<U>;
|
|
26
33
|
}): IdentityPlatformOptions<U>;
|
|
27
|
-
/** Renews the tokens, for `keepSessionAlive({ renew })`: the session is read again afterwards. */
|
|
28
|
-
export declare const renewIdentityTokens: (platform: {
|
|
29
|
-
readonly http: HttpClient;
|
|
30
|
-
}) => Promise<void>;
|
|
@@ -2,7 +2,7 @@ import { route as m } from "./client/index.js";
|
|
|
2
2
|
import { d as pe, p as me } from "./feature-DdUAfyi4.js";
|
|
3
3
|
import { ref as M, readonly as R, defineComponent as O, openBlock as y, createBlock as q, unref as s, shallowRef as W, withCtx as $, createTextVNode as X, toDisplayString as P, mergeProps as Z, computed as D, createElementBlock as S, createElementVNode as C, createCommentVNode as L, createVNode as T, Fragment as z, renderList as ve, normalizeClass as H, useTemplateRef as be, createSlots as he } from "vue";
|
|
4
4
|
import { d as ge } from "./context-Ch1r4fdN.js";
|
|
5
|
-
import { u as ye } from "./platform-
|
|
5
|
+
import { u as ye } from "./platform-Dx6STiwY.js";
|
|
6
6
|
import { d as ee } from "./defineRoutes-BGAdiIrt.js";
|
|
7
7
|
import { useI18n as U } from "vue-i18n";
|
|
8
8
|
import { _ as _e } from "./AccountMenuItem.vue_vue_type_script_setup_true_lang-CPeNxh5K.js";
|
|
@@ -135,9 +135,9 @@ function Rt(n = ye().http, t = K()) {
|
|
|
135
135
|
return { state: R(e), hash: R(i), busy: R(o), inspect: c, enable: l, disable: _ };
|
|
136
136
|
}
|
|
137
137
|
const Me = "events.deadletter:view", $t = "events.deadletter:retry", Y = ee({
|
|
138
|
-
index: { name: "events.deadletters", path: "/events/dead-letters", component: () => import("./DeadLetters-
|
|
138
|
+
index: { name: "events.deadletters", path: "/events/dead-letters", component: () => import("./DeadLetters-BZLyL5lR.js"), meta: { access: Me, titleKey: "core.notifications.dead_letters.title" } }
|
|
139
139
|
}), j = ee({
|
|
140
|
-
index: { name: "notifications.settings", path: "/profile/notifications", component: () => import("./SettingsPage-
|
|
140
|
+
index: { name: "notifications.settings", path: "/profile/notifications", component: () => import("./SettingsPage-CudoKdXm.js"), meta: { titleKey: "core.notifications.settings.title" } }
|
|
141
141
|
}), Ne = /* @__PURE__ */ O({
|
|
142
142
|
__name: "SettingsMenuItem",
|
|
143
143
|
setup(n) {
|