@wssto2/vue-core 0.4.28 → 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 +77 -0
- package/dist/{AccessGate.vue_vue_type_script_setup_true_lang-J5HoyGNJ.js → AccessGate.vue_vue_type_script_setup_true_lang-DZ9GcLC1.js} +1 -1
- package/dist/{ActionRow.vue_vue_type_script_setup_true_lang-QPvYudWc.js → ActionRow.vue_vue_type_script_setup_true_lang-BCgKzUvG.js} +1 -1
- package/dist/{Activity-BWkVX1Nx.js → Activity-dpY2kIs2.js} +7 -7
- package/dist/{Changes-MG77TDwz.js → Changes-CL8F1w8q.js} +6 -6
- package/dist/{CollectionPage.vue_vue_type_script_setup_true_lang-Bnpv9TEj.js → CollectionPage.vue_vue_type_script_setup_true_lang-l-e-6WeS.js} +4 -4
- package/dist/{DateField.vue_vue_type_script_setup_true_lang-CpuH0WTl.js → DateField.vue_vue_type_script_setup_true_lang-DRuWzSaX.js} +1 -1
- package/dist/{DeadLetters-CkDE71B3.js → DeadLetters-BZLyL5lR.js} +7 -7
- package/dist/{FormErrors.vue_vue_type_script_setup_true_lang-DGOSc-PS.js → FormErrors.vue_vue_type_script_setup_true_lang-D7edzNTL.js} +2 -2
- package/dist/{FormGroup.vue_vue_type_script_setup_true_lang-DSwSRsA5.js → FormGroup.vue_vue_type_script_setup_true_lang-BPchlRCl.js} +2 -2
- package/dist/{FormView.vue_vue_type_script_setup_true_lang-BUrYkjmF.js → FormView.vue_vue_type_script_setup_true_lang-CPSYV7iQ.js} +2 -2
- package/dist/{General-UTBVEXbN.js → General-mrVzi-5R.js} +10 -10
- package/dist/MenuButton.vue_vue_type_script_setup_true_lang-AGbN9r5q.js +28 -0
- package/dist/{NewRolePage-B7DwFWPk.js → NewRolePage-B2DItwvf.js} +3 -3
- package/dist/{NumberField.vue_vue_type_script_setup_true_lang-DaE5BLm4.js → NumberField.vue_vue_type_script_setup_true_lang-ButMV_sf.js} +1 -1
- package/dist/ProfilePage-EiTIYzZ5.js +764 -0
- package/dist/RoleEditor.vue_vue_type_script_setup_true_lang-BqqilJGF.js +325 -0
- package/dist/RolePage-jMHAt9y8.js +314 -0
- package/dist/{RolesPage-B5RwSZ89.js → RolesPage-B9GaVQBx.js} +6 -6
- package/dist/{SectionNavigator.vue_vue_type_script_setup_true_lang-Dmv6TpCi.js → SectionNavigator.vue_vue_type_script_setup_true_lang-Ci04hApd.js} +1 -1
- package/dist/{SegmentedField.vue_vue_type_script_setup_true_lang-Dg-_ZjgR.js → SegmentedField.vue_vue_type_script_setup_true_lang-BwyMvkis.js} +1 -1
- package/dist/{SelectField.vue_vue_type_script_setup_true_lang-C3FbRQW7.js → SelectField.vue_vue_type_script_setup_true_lang-BzQC1qDQ.js} +11 -12
- package/dist/SessionList.vue_vue_type_script_setup_true_lang-DhoTd5D7.js +133 -0
- package/dist/{Sessions-DWj2OGo0.js → Sessions-CHLokZ9e.js} +5 -5
- package/dist/SettingsPage-CudoKdXm.js +632 -0
- package/dist/{SignIn-COThB9XN.js → SignIn-ypRvdmjg.js} +7 -7
- package/dist/{SignInPage-CdzgSvRm.js → SignInPage-CbPeKlAo.js} +4 -4
- package/dist/SignIns-BApzbGq-.js +121 -0
- package/dist/{SwitchField.vue_vue_type_script_setup_true_lang-ALvJisiP.js → SwitchField.vue_vue_type_script_setup_true_lang-D_-HACqT.js} +1 -1
- package/dist/{TextField.vue_vue_type_script_setup_true_lang-CP2WeU36.js → TextField.vue_vue_type_script_setup_true_lang-DTAQPbW0.js} +2 -2
- package/dist/{TextareaField.vue_vue_type_script_setup_true_lang-BJ4__cvJ.js → TextareaField.vue_vue_type_script_setup_true_lang-DsjK2C9T.js} +1 -1
- package/dist/{TimeField.vue_vue_type_script_setup_true_lang-DBxKAWRo.js → TimeField.vue_vue_type_script_setup_true_lang-Cz7KhUqt.js} +1 -1
- package/dist/{UserRecord-BWMnXz4q.js → UserRecord-BCTaBajE.js} +13 -13
- package/dist/{UsersList-Chq8yM5C.js → UsersList-CqSK3cQL.js} +9 -9
- package/dist/access/RoleCompareDialog.vue.d.ts +1 -1
- package/dist/access/RoleEditor.vue.d.ts +2 -0
- package/dist/access/constraints.d.ts +28 -0
- package/dist/access/context.d.ts +5 -0
- package/dist/access/feature.d.ts +17 -0
- package/dist/access/index.d.ts +3 -1
- package/dist/access/index.js +11 -9
- package/dist/access/refusals.d.ts +20 -2
- package/dist/app/index.js +118 -116
- package/dist/app/keepAlive.d.ts +4 -8
- package/dist/client/index.js +19 -11
- package/dist/{client-k9euDWF4.js → client-BHPFfBj3.js} +20 -20
- package/dist/collection/index.js +3 -3
- package/dist/content/index.js +66 -37
- package/dist/{contributions-BVBZP5Jb.js → contributions-fx5q5n1u.js} +1 -1
- package/dist/{describeError-B-NMa--w.js → describeError-BqGAUZgX.js} +1 -1
- package/dist/{error-CD7x0Jrz.js → error-Bb_dr_Ay.js} +2 -2
- package/dist/{fieldMessages-6HVzSDqG.js → fieldMessages-DTXpWnBd.js} +7 -7
- package/dist/form/index.js +1235 -1412
- package/dist/{guards-BJZjc3FZ.js → guards-D4mXf_2X.js} +1 -1
- package/dist/{http-BFfkA7gN.js → http-CdQowFlW.js} +1 -1
- package/dist/i18n/index.d.ts +2 -2
- package/dist/i18n/index.js +30 -30
- package/dist/identity/index.d.ts +3 -1
- package/dist/identity/index.js +7 -6
- package/dist/identity/profile/DetailsFields.vue.d.ts +8 -0
- package/dist/identity/profile/{DetailsPanel.vue.d.ts → DetailsGroup.vue.d.ts} +4 -1
- package/dist/identity/profile/{EmailPanel.vue.d.ts → EmailGroup.vue.d.ts} +1 -1
- package/dist/identity/profile/SignInsGroup.vue.d.ts +2 -0
- package/dist/identity/profile/profileSections.d.ts +37 -0
- package/dist/identity/session.d.ts +10 -7
- package/dist/identity/shared/SignInList.vue.d.ts +22 -0
- package/dist/identity/shared/deviceLabel.d.ts +7 -0
- package/dist/identity/useReturnToOwnAccount.d.ts +10 -0
- package/dist/identity/users/context.d.ts +3 -0
- package/dist/identity/users/feature.d.ts +3 -0
- package/dist/index-BTRv8mcf.js +630 -0
- package/dist/index-VPzJJN6Z.js +745 -0
- package/dist/index-auJqVMWC.js +478 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/keepAlive-z3IRFkQq.js +46 -0
- package/dist/modules/notification/entities.d.ts +19 -0
- package/dist/modules/notification/routes.d.ts +25 -1
- package/dist/modules/notification/schemas.d.ts +24 -0
- package/dist/{navigation-DpcDF0rX.js → navigation-Bc5EQ_Si.js} +1 -1
- package/dist/{neighbors-RVQ4O3Qv.js → neighbors-Bv6vnWlW.js} +22 -22
- package/dist/notifications/context.d.ts +24 -1
- package/dist/notifications/feature.d.ts +10 -1
- package/dist/notifications/index.d.ts +1 -1
- package/dist/notifications/index.js +1 -1
- package/dist/notifications/push/DevicesSection.vue.d.ts +12 -0
- package/dist/notifications/push/ThisDeviceSection.vue.d.ts +15 -0
- package/dist/notifications/push/browser.d.ts +40 -0
- package/dist/notifications/push/devices.d.ts +15 -0
- package/dist/notifications/push/thisDevice.d.ts +28 -0
- package/dist/notifications/settings/ChannelsSection.vue.d.ts +16 -0
- package/dist/notifications/settings/{QuietHoursPanel.vue.d.ts → QuietHoursSection.vue.d.ts} +3 -1
- package/dist/notifications/settings/SettingsBody.vue.d.ts +17 -0
- package/dist/notifications/settings/settings.d.ts +4 -3
- package/dist/notifications/settings/state.d.ts +4 -2
- package/dist/options-g8RwEhBk.js +366 -0
- package/dist/overlay/index.js +37 -59
- package/dist/page/index.js +1 -1
- package/dist/phone/index.js +10 -11
- 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/push-worker/index.d.ts +91 -0
- package/dist/push-worker/index.js +54 -0
- package/dist/resource/index.js +1 -1
- package/dist/{routeResource-DlTsGTg_.js → routeResource-CcYA75T2.js} +2 -2
- package/dist/router/index.js +3 -3
- package/dist/{sections-CeZl-Jxg.js → sections-B0HxIOC2.js} +1 -1
- package/dist/shell/index.js +3 -3
- package/dist/signInEvents-DWShrJox.js +30 -0
- package/dist/state/index.js +1 -1
- package/dist/{status-dGvfh1TP.js → status-BUFELJz2.js} +2 -2
- package/dist/styles.css +1 -1
- package/dist/{suggestions-DHJFKB26.js → suggestions-CfFTHi8y.js} +2 -2
- package/dist/testing/index.js +1 -1
- package/dist/{useCommand-Cj-APj-P.js → useCommand-CtqheKUv.js} +2 -2
- package/dist/useGroupSheet-ATvc0IiM.js +278 -0
- package/dist/{useLoad-M7V-AVwR.js → useLoad-W4tfxmm5.js} +1 -1
- package/dist/{useResourceForm-tGYTfKhH.js → useResourceForm-CJfl8rj_.js} +1 -1
- package/package.json +6 -2
- package/dist/KeyValue.vue_vue_type_script_setup_true_lang-wcZcvnow.js +0 -35
- package/dist/OtpInput.vue_vue_type_script_setup_true_lang-gp4FfWAH.js +0 -95
- package/dist/PanelActions.vue_vue_type_script_setup_true_lang-E9VdIGkf.js +0 -46
- package/dist/ProfilePage-C8VhiKIh.js +0 -654
- package/dist/RoleEditor.vue_vue_type_script_setup_true_lang-DRHmjA9w.js +0 -300
- package/dist/RolePage-ODFu68Ce.js +0 -315
- package/dist/SessionList.vue_vue_type_script_setup_true_lang-D5qm77Zo.js +0 -111
- package/dist/SettingsPage-C3fPSmi7.js +0 -255
- package/dist/SignInTable.vue_vue_type_script_setup_true_lang-Bs0yTi2E.js +0 -79
- package/dist/SignIns-cztICmqt.js +0 -66
- package/dist/control-B4SdblL6.js +0 -350
- package/dist/identity/profile/PanelActions.vue.d.ts +0 -17
- package/dist/index-BhtJR4c_.js +0 -459
- package/dist/index-C3E6DcO0.js +0 -706
- package/dist/index-sTBBHqNG.js +0 -504
- package/dist/keepAlive-CDvMQlcJ.js +0 -49
- package/dist/notifications/settings/EmailPanel.vue.d.ts +0 -14
- package/dist/options-Ba_0uLWN.js +0 -18
- package/dist/platform-PZpUkkMS.js +0 -268
- package/dist/route-goWMxDUN.js +0 -13
- package/dist/transport-BnP7WC0Y.js +0 -4
- /package/dist/identity/{profile/PasswordPanel.vue.d.ts → ReturnMenuItem.vue.d.ts} +0 -0
- /package/dist/identity/profile/{SessionsPanel.vue.d.ts → PasswordGroup.vue.d.ts} +0 -0
- /package/dist/identity/profile/{SignInsPanel.vue.d.ts → SessionsGroup.vue.d.ts} +0 -0
|
@@ -1,268 +0,0 @@
|
|
|
1
|
-
import { c as k } from "./client-k9euDWF4.js";
|
|
2
|
-
import { d as q } from "./context-Ch1r4fdN.js";
|
|
3
|
-
import { a as x, A as U } from "./error-CD7x0Jrz.js";
|
|
4
|
-
import { shallowRef as _ } from "vue";
|
|
5
|
-
const z = (e, n) => e.level === n.level && e.id === n.id, C = (e, n) => Object.prototype.hasOwnProperty.call(e, n);
|
|
6
|
-
function I(e, n = {}) {
|
|
7
|
-
const t = n.covers ?? z;
|
|
8
|
-
function o(s) {
|
|
9
|
-
const r = e();
|
|
10
|
-
return !r || !C(r.permissions, s) || r.unavailable.includes(s) ? null : r.permissions[s] ?? null;
|
|
11
|
-
}
|
|
12
|
-
function u(s, r) {
|
|
13
|
-
const i = o(s);
|
|
14
|
-
return i ? r ? (i.clauses.length > 0 ? i.clauses.map((f) => f.scope) : [i.scope]).some((f) => t(f, r)) : !0 : !1;
|
|
15
|
-
}
|
|
16
|
-
return {
|
|
17
|
-
get root() {
|
|
18
|
-
return e()?.root ?? !1;
|
|
19
|
-
},
|
|
20
|
-
can: u,
|
|
21
|
-
canAny: (s) => s.some((r) => u(r)),
|
|
22
|
-
canAll: (s) => s.every((r) => u(r)),
|
|
23
|
-
held: o
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
const A = ["own", "own_location", "all"], m = (e) => typeof e == "object" && e !== null && !Array.isArray(e);
|
|
27
|
-
function $(e, n, t) {
|
|
28
|
-
return !m(e) || typeof e.level != "string" ? (t.push(`${n}: expected { level: string, id?: number }`), { level: "" }) : (e.id !== void 0 && typeof e.id != "number" && t.push(`${n}.id: expected number`), typeof e.id == "number" ? { level: e.level, id: e.id } : { level: e.level });
|
|
29
|
-
}
|
|
30
|
-
function S(e, n, t) {
|
|
31
|
-
return typeof e == "string" && A.includes(e) ? e : (t.push(`${n}: expected one of ${A.join(", ")}`), "own");
|
|
32
|
-
}
|
|
33
|
-
function T(e) {
|
|
34
|
-
const n = [], t = {}, o = { root: !1, permissions: {}, unavailable: [] };
|
|
35
|
-
if (!m(e)) return { snapshot: o, issues: ["access: expected an object"] };
|
|
36
|
-
if (!m(e.permissions)) n.push("access.permissions: expected an object");
|
|
37
|
-
else
|
|
38
|
-
for (const [s, r] of Object.entries(e.permissions)) {
|
|
39
|
-
const i = `access.permissions.${s}`;
|
|
40
|
-
if (!m(r)) {
|
|
41
|
-
n.push(`${i}: expected an object`);
|
|
42
|
-
continue;
|
|
43
|
-
}
|
|
44
|
-
const c = (Array.isArray(r.clauses) ? r.clauses : []).map((f, g) => {
|
|
45
|
-
const a = `${i}.clauses[${g}]`;
|
|
46
|
-
if (!m(f))
|
|
47
|
-
return n.push(`${a}: expected an object`), { scope: { level: "" }, qualifier: "own" };
|
|
48
|
-
const l = { scope: $(f.scope, `${a}.scope`, n), qualifier: S(f.qualifier, `${a}.qualifier`, n) };
|
|
49
|
-
return typeof f.role == "string" ? { ...l, role: f.role } : l;
|
|
50
|
-
});
|
|
51
|
-
t[s] = {
|
|
52
|
-
scope: $(r.scope, `${i}.scope`, n),
|
|
53
|
-
qualifier: S(r.qualifier, `${i}.qualifier`, n),
|
|
54
|
-
clauses: c
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
const u = e.unavailable ?? [];
|
|
58
|
-
return (!Array.isArray(u) || !u.every((s) => typeof s == "string")) && n.push("access.unavailable: expected an array of strings"), {
|
|
59
|
-
snapshot: {
|
|
60
|
-
root: e.root === !0,
|
|
61
|
-
permissions: t,
|
|
62
|
-
unavailable: Array.isArray(u) ? u.filter((s) => typeof s == "string") : []
|
|
63
|
-
},
|
|
64
|
-
issues: n
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
const N = (e) => typeof e == "object" && e !== null && !Array.isArray(e);
|
|
68
|
-
function j(e, n, t = "navigation") {
|
|
69
|
-
return Array.isArray(e) ? e.flatMap((o, u) => {
|
|
70
|
-
const s = `${t}[${u}]`;
|
|
71
|
-
if (!N(o) || typeof o.i18n != "string")
|
|
72
|
-
return n.push(`${s}: expected an object with an i18n key`), [];
|
|
73
|
-
for (const i of ["icon", "route"])
|
|
74
|
-
o[i] != null && typeof o[i] != "string" && n.push(`${s}.${i}: expected a string`);
|
|
75
|
-
const r = o.children == null ? void 0 : j(o.children, n, `${s}.children`);
|
|
76
|
-
return [
|
|
77
|
-
{
|
|
78
|
-
i18n: o.i18n,
|
|
79
|
-
...typeof o.icon == "string" && { icon: o.icon },
|
|
80
|
-
...typeof o.route == "string" && { route: o.route },
|
|
81
|
-
...r && { children: r }
|
|
82
|
-
}
|
|
83
|
-
];
|
|
84
|
-
}) : (n.push(`${t}: expected an array`), []);
|
|
85
|
-
}
|
|
86
|
-
const b = (e) => typeof e == "object" && e !== null && !Array.isArray(e), B = (e) => {
|
|
87
|
-
if (b(e) && (typeof e.id == "number" || typeof e.id == "string")) return { id: e.id };
|
|
88
|
-
throw new TypeError("expected an object with a numeric or string id");
|
|
89
|
-
};
|
|
90
|
-
function F(e, n = B) {
|
|
91
|
-
const t = [];
|
|
92
|
-
if (!b(e)) throw w(["expected an object"]);
|
|
93
|
-
let o = null;
|
|
94
|
-
try {
|
|
95
|
-
o = n(e.user);
|
|
96
|
-
} catch (c) {
|
|
97
|
-
t.push(`user: ${c instanceof Error ? c.message : "invalid"}`);
|
|
98
|
-
}
|
|
99
|
-
let u = null;
|
|
100
|
-
if (e.expires_at !== void 0 && e.expires_at !== null) {
|
|
101
|
-
const c = typeof e.expires_at == "string" ? new Date(e.expires_at) : null;
|
|
102
|
-
c === null || Number.isNaN(c.getTime()) ? t.push("expires_at: expected an ISO date-time string") : u = c;
|
|
103
|
-
}
|
|
104
|
-
let s;
|
|
105
|
-
if (e.impersonator !== void 0 && e.impersonator !== null) {
|
|
106
|
-
const c = e.impersonator;
|
|
107
|
-
b(c) && (typeof c.id == "number" || typeof c.id == "string") && typeof c.name == "string" ? s = { id: c.id, name: c.name } : t.push("impersonator: expected { id, name }");
|
|
108
|
-
}
|
|
109
|
-
const r = T(e.access);
|
|
110
|
-
t.push(...r.issues);
|
|
111
|
-
const i = e.navigation === void 0 || e.navigation === null ? void 0 : j(e.navigation, t);
|
|
112
|
-
if (o === null || t.length > 0) throw w(t);
|
|
113
|
-
return { user: o, expiresAt: u, access: r.snapshot, ...s && { impersonator: s }, ...i && { navigation: i } };
|
|
114
|
-
}
|
|
115
|
-
const w = (e) => new U({ kind: "malformed", message: `Unreadable session payload: ${e.join("; ")}` });
|
|
116
|
-
function H(e, n = {}) {
|
|
117
|
-
const { mePath: t = "/auth/me", signOutPath: o = "/auth/logout", parseUser: u } = n;
|
|
118
|
-
return {
|
|
119
|
-
async load(s) {
|
|
120
|
-
try {
|
|
121
|
-
const { data: r } = await e.get(t, { signal: s, handleUnauthorized: !1 });
|
|
122
|
-
return F(r, u);
|
|
123
|
-
} catch (r) {
|
|
124
|
-
if (x(r) && r.kind === "unauthorized") return null;
|
|
125
|
-
throw r;
|
|
126
|
-
}
|
|
127
|
-
},
|
|
128
|
-
async signOut() {
|
|
129
|
-
try {
|
|
130
|
-
await e.post(o, void 0, { handleUnauthorized: !1 });
|
|
131
|
-
} catch (s) {
|
|
132
|
-
if (!(x(s) && s.kind === "unauthorized")) throw s;
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
};
|
|
136
|
-
}
|
|
137
|
-
function E(e) {
|
|
138
|
-
return e.status === "authenticated" ? e : e.status === "anonymous" && e.reason === "expired" ? e.previous ?? null : null;
|
|
139
|
-
}
|
|
140
|
-
const O = 3e3;
|
|
141
|
-
function Q(e, n = {}) {
|
|
142
|
-
const t = _({ status: "unknown" });
|
|
143
|
-
let o = 0;
|
|
144
|
-
const u = new Set(n.beforeSignOut ? [n.beforeSignOut] : []);
|
|
145
|
-
let s = !1, r = null, i = null;
|
|
146
|
-
function c() {
|
|
147
|
-
o++, i?.controller.abort(), i = null;
|
|
148
|
-
}
|
|
149
|
-
async function f(a) {
|
|
150
|
-
const l = new AbortController();
|
|
151
|
-
let h;
|
|
152
|
-
const y = new Promise((p) => {
|
|
153
|
-
h = setTimeout(() => {
|
|
154
|
-
l.abort(), n.onError?.(new Error(`A before-sign-out hook did not finish within ${O} ms; signing out without it.`)), p();
|
|
155
|
-
}, O);
|
|
156
|
-
}), v = Promise.all(
|
|
157
|
-
[...u].map(async (p) => {
|
|
158
|
-
try {
|
|
159
|
-
await p(a, l.signal);
|
|
160
|
-
} catch (d) {
|
|
161
|
-
n.onError?.(d);
|
|
162
|
-
}
|
|
163
|
-
})
|
|
164
|
-
).then(() => {
|
|
165
|
-
});
|
|
166
|
-
await Promise.race([v, y]), clearTimeout(h);
|
|
167
|
-
}
|
|
168
|
-
function g() {
|
|
169
|
-
if (i) return i.promise;
|
|
170
|
-
const a = o, l = new AbortController(), h = t.value, y = E(h) !== null;
|
|
171
|
-
y || (t.value = { status: "loading" });
|
|
172
|
-
const v = async () => {
|
|
173
|
-
try {
|
|
174
|
-
const d = await e.load(l.signal);
|
|
175
|
-
if (o !== a) return t.value;
|
|
176
|
-
t.value = d ? { status: "authenticated", ...d } : { status: "anonymous", reason: "none" };
|
|
177
|
-
} catch (d) {
|
|
178
|
-
if (o !== a) return t.value;
|
|
179
|
-
n.onError?.(d), t.value = y ? h : { status: "failed", error: d };
|
|
180
|
-
} finally {
|
|
181
|
-
o === a && (i = null);
|
|
182
|
-
}
|
|
183
|
-
return t.value;
|
|
184
|
-
}, p = Promise.resolve().then(v);
|
|
185
|
-
return i = { controller: l, promise: p }, p;
|
|
186
|
-
}
|
|
187
|
-
return {
|
|
188
|
-
state: t,
|
|
189
|
-
restore: () => t.value.status === "unknown" || t.value.status === "failed" ? g() : i?.promise ?? Promise.resolve(t.value),
|
|
190
|
-
refresh: g,
|
|
191
|
-
establish(a) {
|
|
192
|
-
c(), t.value = { status: "authenticated", ...a };
|
|
193
|
-
},
|
|
194
|
-
update(a) {
|
|
195
|
-
const l = t.value;
|
|
196
|
-
if (l.status === "authenticated") {
|
|
197
|
-
if (a.user && a.user.id !== l.user.id)
|
|
198
|
-
throw new Error(`session.update cannot change who is signed in (user ${String(l.user.id)} to ${String(a.user.id)}); use session.establish for a different person.`);
|
|
199
|
-
t.value = {
|
|
200
|
-
...l,
|
|
201
|
-
user: a.user ?? l.user,
|
|
202
|
-
access: a.access ?? l.access,
|
|
203
|
-
...(a.navigation ?? l.navigation) && { navigation: a.navigation ?? l.navigation }
|
|
204
|
-
};
|
|
205
|
-
}
|
|
206
|
-
},
|
|
207
|
-
expire() {
|
|
208
|
-
if (t.value.status !== "authenticated") return;
|
|
209
|
-
const { status: a, ...l } = t.value;
|
|
210
|
-
c(), t.value = s && !t.value.impersonator ? { status: "anonymous", reason: "expired", previous: l } : { status: "anonymous", reason: "expired" }, n.onExpired?.();
|
|
211
|
-
},
|
|
212
|
-
signOut() {
|
|
213
|
-
return r ?? (r = (async () => {
|
|
214
|
-
try {
|
|
215
|
-
const a = t.value;
|
|
216
|
-
a.status === "authenticated" && u.size > 0 && await f(a.user), c(), t.value = { status: "anonymous", reason: "signedOut" }, await e.signOut();
|
|
217
|
-
} finally {
|
|
218
|
-
r = null;
|
|
219
|
-
}
|
|
220
|
-
})()), r;
|
|
221
|
-
},
|
|
222
|
-
holdExpired(a) {
|
|
223
|
-
s = a;
|
|
224
|
-
},
|
|
225
|
-
onBeforeSignOut(a) {
|
|
226
|
-
return u.add(a), () => void u.delete(a);
|
|
227
|
-
}
|
|
228
|
-
};
|
|
229
|
-
}
|
|
230
|
-
function G(e) {
|
|
231
|
-
let n = null;
|
|
232
|
-
const t = k({
|
|
233
|
-
baseUrl: e.config.apiBase,
|
|
234
|
-
transport: e.transport,
|
|
235
|
-
headers: e.headers,
|
|
236
|
-
credentials: e.credentials,
|
|
237
|
-
requestId: e.requestId,
|
|
238
|
-
async onUnauthorized() {
|
|
239
|
-
return s.state.value.status !== "authenticated" ? "fail" : e.renewSession && (n ?? (n = e.renewSession(s, t).then(
|
|
240
|
-
(i) => i,
|
|
241
|
-
() => !1
|
|
242
|
-
).finally(() => {
|
|
243
|
-
n = null;
|
|
244
|
-
})), await n) ? "retry" : (s.expire(), "fail");
|
|
245
|
-
}
|
|
246
|
-
}), o = e.session ?? ((i) => H(i)), u = typeof o == "function" ? o(t) : o, s = Q(u, { onError: e.onSessionError, onExpired: e.onSessionExpired, beforeSignOut: e.beforeSignOut }), r = I(
|
|
247
|
-
() => E(s.state.value)?.access ?? null,
|
|
248
|
-
{ covers: e.covers }
|
|
249
|
-
);
|
|
250
|
-
return { config: e.config, http: t, session: s, access: r };
|
|
251
|
-
}
|
|
252
|
-
const P = q("platform"), R = P[0], J = P[1];
|
|
253
|
-
function V(e, n) {
|
|
254
|
-
e.provide(R, n);
|
|
255
|
-
}
|
|
256
|
-
export {
|
|
257
|
-
G as a,
|
|
258
|
-
O as b,
|
|
259
|
-
I as c,
|
|
260
|
-
Q as d,
|
|
261
|
-
H as e,
|
|
262
|
-
F as f,
|
|
263
|
-
R as g,
|
|
264
|
-
E as h,
|
|
265
|
-
V as i,
|
|
266
|
-
j as p,
|
|
267
|
-
J as u
|
|
268
|
-
};
|
package/dist/route-goWMxDUN.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
function u(e, i, r = {}) {
|
|
2
|
-
return { method: e, path: i, permission: r.permission, public: r.public === !0, raw: !1 };
|
|
3
|
-
}
|
|
4
|
-
u.raw = (e, i, r = {}) => ({
|
|
5
|
-
method: e,
|
|
6
|
-
path: i,
|
|
7
|
-
permission: r.permission,
|
|
8
|
-
public: r.public === !0,
|
|
9
|
-
raw: !0
|
|
10
|
-
});
|
|
11
|
-
export {
|
|
12
|
-
u as r
|
|
13
|
-
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|