@wssto2/vue-core 0.4.28 → 0.5.0

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 (138) hide show
  1. package/CHANGELOG.md +67 -0
  2. package/dist/{AccessGate.vue_vue_type_script_setup_true_lang-J5HoyGNJ.js → AccessGate.vue_vue_type_script_setup_true_lang-Nw1IsB8N.js} +1 -1
  3. package/dist/{ActionRow.vue_vue_type_script_setup_true_lang-QPvYudWc.js → ActionRow.vue_vue_type_script_setup_true_lang-BCgKzUvG.js} +1 -1
  4. package/dist/{Activity-BWkVX1Nx.js → Activity-CoGI2_GL.js} +7 -7
  5. package/dist/{Changes-MG77TDwz.js → Changes-Cwfe6wbX.js} +6 -6
  6. package/dist/{CollectionPage.vue_vue_type_script_setup_true_lang-Bnpv9TEj.js → CollectionPage.vue_vue_type_script_setup_true_lang-CtvHtFLy.js} +4 -4
  7. package/dist/{DateField.vue_vue_type_script_setup_true_lang-CpuH0WTl.js → DateField.vue_vue_type_script_setup_true_lang-DRuWzSaX.js} +1 -1
  8. package/dist/{DeadLetters-CkDE71B3.js → DeadLetters-DyA5Dqn0.js} +7 -7
  9. 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
  10. package/dist/{FormGroup.vue_vue_type_script_setup_true_lang-DSwSRsA5.js → FormGroup.vue_vue_type_script_setup_true_lang-BPchlRCl.js} +2 -2
  11. package/dist/{FormView.vue_vue_type_script_setup_true_lang-BUrYkjmF.js → FormView.vue_vue_type_script_setup_true_lang-CPSYV7iQ.js} +2 -2
  12. package/dist/{General-UTBVEXbN.js → General-DTEfxWls.js} +10 -10
  13. package/dist/MenuButton.vue_vue_type_script_setup_true_lang-AGbN9r5q.js +28 -0
  14. package/dist/{NewRolePage-B7DwFWPk.js → NewRolePage-CRZoUajV.js} +3 -3
  15. 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
  16. package/dist/ProfilePage-DLY81mvN.js +764 -0
  17. package/dist/RoleEditor.vue_vue_type_script_setup_true_lang-gXbxXG2R.js +325 -0
  18. package/dist/RolePage-B9t586Q8.js +314 -0
  19. package/dist/{RolesPage-B5RwSZ89.js → RolesPage-BRdG-OSL.js} +6 -6
  20. package/dist/{SectionNavigator.vue_vue_type_script_setup_true_lang-Dmv6TpCi.js → SectionNavigator.vue_vue_type_script_setup_true_lang-Cy9Oi0ts.js} +1 -1
  21. 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
  22. package/dist/{SelectField.vue_vue_type_script_setup_true_lang-C3FbRQW7.js → SelectField.vue_vue_type_script_setup_true_lang-BzQC1qDQ.js} +11 -12
  23. package/dist/SessionList.vue_vue_type_script_setup_true_lang-DhoTd5D7.js +133 -0
  24. package/dist/{Sessions-DWj2OGo0.js → Sessions-vGyUOnPG.js} +5 -5
  25. package/dist/SettingsPage-V8WeADZZ.js +632 -0
  26. package/dist/{SignIn-COThB9XN.js → SignIn-C-3i8RG6.js} +7 -7
  27. package/dist/{SignInPage-CdzgSvRm.js → SignInPage-D2NA3VKU.js} +4 -4
  28. package/dist/SignIns-eoYPB6kB.js +121 -0
  29. 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
  30. package/dist/{TextField.vue_vue_type_script_setup_true_lang-CP2WeU36.js → TextField.vue_vue_type_script_setup_true_lang-DTAQPbW0.js} +2 -2
  31. 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
  32. package/dist/{TimeField.vue_vue_type_script_setup_true_lang-DBxKAWRo.js → TimeField.vue_vue_type_script_setup_true_lang-Cz7KhUqt.js} +1 -1
  33. package/dist/{UserRecord-BWMnXz4q.js → UserRecord-BaQl2zzQ.js} +13 -13
  34. package/dist/{UsersList-Chq8yM5C.js → UsersList-BfXWgH5K.js} +9 -9
  35. package/dist/access/RoleCompareDialog.vue.d.ts +1 -1
  36. package/dist/access/RoleEditor.vue.d.ts +2 -0
  37. package/dist/access/constraints.d.ts +28 -0
  38. package/dist/access/context.d.ts +5 -0
  39. package/dist/access/feature.d.ts +17 -0
  40. package/dist/access/index.d.ts +3 -1
  41. package/dist/access/index.js +11 -9
  42. package/dist/access/refusals.d.ts +20 -2
  43. package/dist/app/index.js +6 -6
  44. package/dist/client/index.js +19 -11
  45. package/dist/{client-k9euDWF4.js → client-BHPFfBj3.js} +20 -20
  46. package/dist/collection/index.js +3 -3
  47. package/dist/content/index.js +66 -37
  48. package/dist/{contributions-BVBZP5Jb.js → contributions-DVQPcjJz.js} +1 -1
  49. package/dist/{describeError-B-NMa--w.js → describeError-BqGAUZgX.js} +1 -1
  50. package/dist/{error-CD7x0Jrz.js → error-Bb_dr_Ay.js} +2 -2
  51. package/dist/{fieldMessages-6HVzSDqG.js → fieldMessages-DTXpWnBd.js} +7 -7
  52. package/dist/form/index.js +1235 -1412
  53. package/dist/{guards-BJZjc3FZ.js → guards-DRh4zmxO.js} +1 -1
  54. package/dist/{http-BFfkA7gN.js → http-D_pBg22D.js} +1 -1
  55. package/dist/i18n/index.d.ts +2 -2
  56. package/dist/i18n/index.js +30 -30
  57. package/dist/identity/index.d.ts +2 -0
  58. package/dist/identity/index.js +8 -6
  59. package/dist/identity/profile/DetailsFields.vue.d.ts +8 -0
  60. package/dist/identity/profile/{DetailsPanel.vue.d.ts → DetailsGroup.vue.d.ts} +4 -1
  61. package/dist/identity/profile/{EmailPanel.vue.d.ts → EmailGroup.vue.d.ts} +1 -1
  62. package/dist/identity/profile/SignInsGroup.vue.d.ts +2 -0
  63. package/dist/identity/profile/profileSections.d.ts +37 -0
  64. package/dist/identity/shared/SignInList.vue.d.ts +22 -0
  65. package/dist/identity/shared/deviceLabel.d.ts +7 -0
  66. package/dist/identity/useReturnToOwnAccount.d.ts +10 -0
  67. package/dist/identity/users/context.d.ts +3 -0
  68. package/dist/identity/users/feature.d.ts +3 -0
  69. package/dist/index-WkbzC_ee.js +745 -0
  70. package/dist/index-g-qbUeTk.js +630 -0
  71. package/dist/index-kqk7Mclb.js +480 -0
  72. package/dist/index.d.ts +1 -1
  73. package/dist/index.js +1 -1
  74. package/dist/modules/notification/entities.d.ts +19 -0
  75. package/dist/modules/notification/routes.d.ts +25 -1
  76. package/dist/modules/notification/schemas.d.ts +24 -0
  77. package/dist/{navigation-DpcDF0rX.js → navigation-DuQwti76.js} +1 -1
  78. package/dist/{neighbors-RVQ4O3Qv.js → neighbors-IMRQ4rkm.js} +22 -22
  79. package/dist/notifications/context.d.ts +24 -1
  80. package/dist/notifications/feature.d.ts +10 -1
  81. package/dist/notifications/index.d.ts +1 -1
  82. package/dist/notifications/index.js +1 -1
  83. package/dist/notifications/push/DevicesSection.vue.d.ts +12 -0
  84. package/dist/notifications/push/ThisDeviceSection.vue.d.ts +15 -0
  85. package/dist/notifications/push/browser.d.ts +40 -0
  86. package/dist/notifications/push/devices.d.ts +15 -0
  87. package/dist/notifications/push/thisDevice.d.ts +28 -0
  88. package/dist/notifications/settings/ChannelsSection.vue.d.ts +16 -0
  89. package/dist/notifications/settings/{QuietHoursPanel.vue.d.ts → QuietHoursSection.vue.d.ts} +3 -1
  90. package/dist/notifications/settings/SettingsBody.vue.d.ts +17 -0
  91. package/dist/notifications/settings/settings.d.ts +4 -3
  92. package/dist/notifications/settings/state.d.ts +4 -2
  93. package/dist/options-g8RwEhBk.js +366 -0
  94. package/dist/overlay/index.js +37 -59
  95. package/dist/page/index.js +1 -1
  96. package/dist/phone/index.js +10 -11
  97. package/dist/platform/index.js +3 -3
  98. package/dist/{platform-PZpUkkMS.js → platform-Dl1fbScN.js} +2 -2
  99. package/dist/push-worker/index.d.ts +91 -0
  100. package/dist/push-worker/index.js +54 -0
  101. package/dist/resource/index.js +1 -1
  102. package/dist/{routeResource-DlTsGTg_.js → routeResource-CcYA75T2.js} +2 -2
  103. package/dist/router/index.js +3 -3
  104. package/dist/{sections-CeZl-Jxg.js → sections-D5rgQ4YB.js} +1 -1
  105. package/dist/shell/index.js +3 -3
  106. package/dist/signInEvents-DWShrJox.js +30 -0
  107. package/dist/state/index.js +1 -1
  108. package/dist/{status-dGvfh1TP.js → status-C2gHqkj6.js} +2 -2
  109. package/dist/styles.css +1 -1
  110. package/dist/{suggestions-DHJFKB26.js → suggestions-CfFTHi8y.js} +2 -2
  111. package/dist/testing/index.js +1 -1
  112. package/dist/{useCommand-Cj-APj-P.js → useCommand-CtqheKUv.js} +2 -2
  113. package/dist/useGroupSheet-ATvc0IiM.js +278 -0
  114. package/dist/{useLoad-M7V-AVwR.js → useLoad-W4tfxmm5.js} +1 -1
  115. package/dist/{useResourceForm-tGYTfKhH.js → useResourceForm-CJfl8rj_.js} +1 -1
  116. package/package.json +6 -2
  117. package/dist/KeyValue.vue_vue_type_script_setup_true_lang-wcZcvnow.js +0 -35
  118. package/dist/OtpInput.vue_vue_type_script_setup_true_lang-gp4FfWAH.js +0 -95
  119. package/dist/PanelActions.vue_vue_type_script_setup_true_lang-E9VdIGkf.js +0 -46
  120. package/dist/ProfilePage-C8VhiKIh.js +0 -654
  121. package/dist/RoleEditor.vue_vue_type_script_setup_true_lang-DRHmjA9w.js +0 -300
  122. package/dist/RolePage-ODFu68Ce.js +0 -315
  123. package/dist/SessionList.vue_vue_type_script_setup_true_lang-D5qm77Zo.js +0 -111
  124. package/dist/SettingsPage-C3fPSmi7.js +0 -255
  125. package/dist/SignInTable.vue_vue_type_script_setup_true_lang-Bs0yTi2E.js +0 -79
  126. package/dist/SignIns-cztICmqt.js +0 -66
  127. package/dist/control-B4SdblL6.js +0 -350
  128. package/dist/identity/profile/PanelActions.vue.d.ts +0 -17
  129. package/dist/index-BhtJR4c_.js +0 -459
  130. package/dist/index-C3E6DcO0.js +0 -706
  131. package/dist/index-sTBBHqNG.js +0 -504
  132. package/dist/notifications/settings/EmailPanel.vue.d.ts +0 -14
  133. package/dist/options-Ba_0uLWN.js +0 -18
  134. package/dist/route-goWMxDUN.js +0 -13
  135. package/dist/transport-BnP7WC0Y.js +0 -4
  136. /package/dist/identity/{profile/PasswordPanel.vue.d.ts → ReturnMenuItem.vue.d.ts} +0 -0
  137. /package/dist/identity/profile/{SessionsPanel.vue.d.ts → PasswordGroup.vue.d.ts} +0 -0
  138. /package/dist/identity/profile/{SignInsPanel.vue.d.ts → SessionsGroup.vue.d.ts} +0 -0
@@ -0,0 +1,480 @@
1
+ import { route as i } from "./client/index.js";
2
+ import { d as W, p as H } from "./feature-DdUAfyi4.js";
3
+ import { k as re } from "./keepAlive-CDvMQlcJ.js";
4
+ import { d as G } from "./defineRoutes-BGAdiIrt.js";
5
+ import { d as R } from "./context-Ch1r4fdN.js";
6
+ import { defineComponent as w, computed as g, watch as q, openBlock as _, createElementBlock as D, ref as F, useTemplateRef as ae, watchEffect as ce, onBeforeUnmount as ue, createVNode as v, unref as o, createElementVNode as p, toDisplayString as f, createCommentVNode as I, createBlock as K, useId as le, Teleport as me, normalizeClass as M, createTextVNode as C, withCtx as T, mergeProps as pe, h as de } from "vue";
7
+ import { i as P } from "./error-Bb_dr_Ay.js";
8
+ import { u as fe } from "./environment-Dva-SG8D.js";
9
+ import { u as A } from "./describeError-BqGAUZgX.js";
10
+ import { t as k } from "./toast-CqSDTWRX.js";
11
+ import { u as x, h as O, f as V } from "./platform-Dl1fbScN.js";
12
+ import { useI18n as E } from "vue-i18n";
13
+ import { _ as Y } from "./Icon.vue_vue_type_script_lang-D7oC-d-S.js";
14
+ import { useRouter as J, useRoute as he } from "vue-router";
15
+ import { _ as Q } from "./AccountMenuItem.vue_vue_type_script_setup_true_lang-CPeNxh5K.js";
16
+ import { _ as z } from "./Button.vue_vue_type_script_setup_true_lang-CL9Qh5yq.js";
17
+ import { u as ye } from "./leaveGuard-Cc8yeLxM.js";
18
+ import { _ as ge } from "./FormView.vue_vue_type_script_setup_true_lang-CPSYV7iQ.js";
19
+ import { _ as ve } from "./TextField.vue_vue_type_script_setup_true_lang-DTAQPbW0.js";
20
+ import { u as _e } from "./mediaQuery-CygcXmFW.js";
21
+ import { u as be } from "./useDialog-CXR3hN0G.js";
22
+ import { c as we } from "./closeOverlays-CjVsIrpL.js";
23
+ import { u as xe } from "./FormErrors.vue_vue_type_script_setup_true_lang-D7edzNTL.js";
24
+ import { u as Ee } from "./format-D8X4zsx6.js";
25
+ import { b as Se } from "./routeResource-CcYA75T2.js";
26
+ import "./ActionRow.vue_vue_type_script_setup_true_lang-BCgKzUvG.js";
27
+ import { _ as Te } from "./AccessGate.vue_vue_type_script_setup_true_lang-Nw1IsB8N.js";
28
+ const b = {
29
+ login: i("POST", "/v1/auth/login", { public: !0 }),
30
+ refresh: i("POST", "/v1/auth/refresh", { public: !0 }),
31
+ logout: i("POST", "/v1/auth/logout"),
32
+ me: i("GET", "/v1/auth/me"),
33
+ changeLocale: i("POST", "/v1/auth/change-locale"),
34
+ loginAs: i("POST", "/v1/auth/login-as"),
35
+ loginAsReturn: i("POST", "/v1/auth/login-as/return"),
36
+ usersList: i("GET", "/v1/iam/users", { permission: "iam.user:view" }),
37
+ usersShow: i("GET", "/v1/iam/users/:id", { permission: "iam.user:view" }),
38
+ usersCreate: i("POST", "/v1/iam/users", { permission: "iam.user:manage" }),
39
+ usersUpdate: i("PUT", "/v1/iam/users/:id", { permission: "iam.user:manage" }),
40
+ usersSetPassword: i("PUT", "/v1/iam/users/:id/password", { permission: "iam.user:manage" }),
41
+ usersDeactivate: i("POST", "/v1/iam/users/:id/deactivate", { permission: "iam.user:manage" }),
42
+ usersActivate: i("POST", "/v1/iam/users/:id/activate", { permission: "iam.user:manage" }),
43
+ usersUnlock: i("POST", "/v1/iam/users/:id/unlock", { permission: "iam.user:manage" }),
44
+ usersSignins: i("GET", "/v1/iam/users/:id/signins", { permission: "iam.user:view" }),
45
+ usersChanges: i("GET", "/v1/iam/users/:id/changes", { permission: "iam.user:view" }),
46
+ usersActivity: i("GET", "/v1/iam/users/:id/activity", { permission: "iam.user.activity:view" }),
47
+ usersSessions: i("GET", "/v1/iam/users/:id/sessions", { permission: "iam.user:view" }),
48
+ usersRevokeSession: i("DELETE", "/v1/iam/users/:id/sessions/:session_id", { permission: "iam.user:manage" }),
49
+ usersRevokeSessions: i("DELETE", "/v1/iam/users/:id/sessions", { permission: "iam.user:manage" }),
50
+ profileShow: i("GET", "/v1/iam/profile"),
51
+ profileUpdate: i("PUT", "/v1/iam/profile"),
52
+ profileChangePassword: i("PUT", "/v1/iam/profile/password"),
53
+ profileRequestEmail: i("POST", "/v1/iam/profile/email"),
54
+ profileResendEmail: i("POST", "/v1/iam/profile/email/resend"),
55
+ profileConfirmEmail: i("POST", "/v1/iam/profile/email/confirm"),
56
+ profileCancelEmail: i("DELETE", "/v1/iam/profile/email"),
57
+ profileSignins: i("GET", "/v1/iam/profile/signins"),
58
+ profileSessions: i("GET", "/v1/iam/profile/sessions"),
59
+ profileRevokeSession: i("DELETE", "/v1/iam/profile/sessions/:session_id")
60
+ }, [ke, X] = R("vue-core.identity"), $ = (e) => P(e) && e.kind === "unauthorized";
61
+ function Pe(e) {
62
+ if (!P(e) || e.code !== "identity.signin.locked") return null;
63
+ const s = e.params?.locked_until, t = typeof s == "string" ? new Date(s) : null;
64
+ return t && !Number.isNaN(t.getTime()) ? t : null;
65
+ }
66
+ async function Ae({ http: e, session: s }, t) {
67
+ await e.request(b.login, t, { handleUnauthorized: !1 }), await N({ session: s });
68
+ }
69
+ async function N({ session: e }) {
70
+ const s = await e.refresh();
71
+ if (s.status === "failed") throw s.error;
72
+ if (s.status !== "authenticated") throw new Error("The server accepted the request but reports nobody signed in.");
73
+ }
74
+ async function Ce(e, s) {
75
+ await e.http.request(b.loginAs, { user_id: s }), await N(e);
76
+ }
77
+ async function Oe(e) {
78
+ await e.http.request(b.loginAsReturn), await N(e);
79
+ }
80
+ const Re = { hidden: "" }, Ie = /* @__PURE__ */ w({
81
+ __name: "LocaleSync",
82
+ setup(e) {
83
+ const { http: s, session: t } = x(), n = fe(), m = A(), d = g(() => {
84
+ const r = t.state.value, a = r.status === "authenticated" ? r.user.locale : void 0;
85
+ return typeof a == "string" ? a : null;
86
+ });
87
+ let u = null;
88
+ return q(d, async (r) => {
89
+ u = r, r !== null && r !== n.locale.value && n.locales.includes(r) && await n.setLocale(r);
90
+ }, { immediate: !0 }), q(n.locale, async (r) => {
91
+ if (!(t.state.value.status !== "authenticated" || r === u))
92
+ try {
93
+ await s.request(b.changeLocale, { locale: r }), u = r;
94
+ } catch (a) {
95
+ if ($(a)) return;
96
+ k.error(m(a)), P(a) && a.code === "identity.locale.unsupported" && u !== null && await n.setLocale(u);
97
+ }
98
+ }), (r, a) => (_(), D("span", Re));
99
+ }
100
+ });
101
+ function Z() {
102
+ const e = x(), s = J(), { home: t } = X(), n = A(), m = F(!1), d = g(() => O(e.session.state.value)?.impersonator != null);
103
+ async function u() {
104
+ m.value = !0;
105
+ try {
106
+ await Oe(e), await s.push(t);
107
+ } catch (r) {
108
+ $(r) || k.error(n(r)), e.session.refresh();
109
+ } finally {
110
+ m.value = !1;
111
+ }
112
+ }
113
+ return { impersonating: d, returning: m, leave: u };
114
+ }
115
+ const Ke = { class: "min-w-0 flex-1" }, $e = { class: "hidden md:inline" }, Ue = { class: "md:hidden" }, Le = ["disabled"], qe = /* @__PURE__ */ w({
116
+ __name: "ImpersonationBanner",
117
+ setup(e) {
118
+ const { t: s } = E(), t = x(), { returning: n, leave: m } = Z(), d = g(() => O(t.session.state.value)?.impersonator ?? null), u = g(() => {
119
+ const l = O(t.session.state.value)?.user;
120
+ return typeof l?.name == "string" ? l.name : typeof l?.login == "string" ? l.login : String(l?.id ?? "");
121
+ }), r = ae("strip");
122
+ let a = null;
123
+ return ce(() => {
124
+ a?.disconnect(), a = null;
125
+ const l = r.value;
126
+ if (!l) return void document.documentElement.style.removeProperty("--shell-banner-h");
127
+ if (typeof ResizeObserver > "u") return;
128
+ const c = () => document.documentElement.style.setProperty("--shell-banner-h", `${l.offsetHeight}px`);
129
+ a = new ResizeObserver(c), a.observe(l), c();
130
+ }, { flush: "post" }), ue(() => {
131
+ a?.disconnect(), document.documentElement.style.removeProperty("--shell-banner-h");
132
+ }), (l, c) => d.value ? (_(), D("div", {
133
+ key: 0,
134
+ ref_key: "strip",
135
+ ref: r,
136
+ role: "status",
137
+ "data-impersonation-banner": "",
138
+ class: "sticky top-0 z-40 flex flex-wrap items-center gap-x-3 gap-y-1.5 bg-status-warning-surface px-4 py-2 text-subheadline text-status-warning-content shadow-[inset_0_-1px_0_rgb(154_74_7/0.25)]"
139
+ }, [
140
+ v(o(Y), {
141
+ name: "informationLine",
142
+ size: 18,
143
+ class: "shrink-0 compact:hidden"
144
+ }),
145
+ p("span", Ke, [
146
+ p("span", $e, f(o(s)("core.identity.impersonation.banner", { name: u.value })), 1),
147
+ p("span", Ue, f(o(s)("core.identity.impersonation.banner_short", { name: u.value })), 1)
148
+ ]),
149
+ p("button", {
150
+ type: "button",
151
+ disabled: o(n),
152
+ class: "hit-target cursor-pointer rounded-control bg-status-warning-solid px-3 py-1 text-footnote font-semibold whitespace-nowrap text-white transition duration-motion-fast hover:brightness-110 disabled:opacity-45",
153
+ onClick: c[0] || (c[0] = //@ts-ignore
154
+ (...h) => o(m) && o(m)(...h))
155
+ }, f(o(s)("core.identity.impersonation.return")), 9, Le)
156
+ ], 512)) : I("", !0);
157
+ }
158
+ }), ze = /* @__PURE__ */ w({
159
+ __name: "ReturnMenuItem",
160
+ setup(e) {
161
+ const { t: s } = E(), { impersonating: t, leave: n } = Z();
162
+ return (m, d) => o(t) ? (_(), K(Q, {
163
+ key: 0,
164
+ label: o(s)("core.identity.impersonation.return"),
165
+ icon: "logoutBoxRLine",
166
+ "data-return-menu-item": "",
167
+ onClick: o(n)
168
+ }, null, 8, ["label", "onClick"])) : I("", !0);
169
+ }
170
+ });
171
+ function Ge(e = {}) {
172
+ const { t: s } = E(), t = x(), n = Ee(), m = A(), u = xe({
173
+ defaults: () => ({ login: e.login ?? "", password: "" }),
174
+ validator: {
175
+ safeParse(a) {
176
+ const l = a, c = ["login", "password"].filter((h) => l[h] === "").map((h) => ({ path: [h], message: s("core.identity.signin.required") }));
177
+ return c.length === 0 ? { success: !0, data: l } : { success: !1, error: { issues: c } };
178
+ }
179
+ },
180
+ failureMessage(a, l) {
181
+ const c = Pe(l);
182
+ return c ? s("core.errors.identity.signin.locked", { locked_until: n.time(c) }) : P(l) ? m(l) : void 0;
183
+ }
184
+ }), r = g(() => u.errors.first("password") ?? (u.failure.value?.error ? u.failure.value.message : void 0));
185
+ return { form: u, passwordError: r, submit: async () => (await u.submit((a) => Ae(t, a))).status === "saved" };
186
+ }
187
+ const De = ["aria-labelledby"], Fe = ["id"], Ne = { class: "mt-1 text-subheadline text-content-muted" }, Be = { class: "flex items-center gap-2 rounded-control bg-status-success-surface px-2.5 py-2 text-footnote text-status-success-content" }, Me = { class: "flex flex-col gap-1.5" }, Ve = { class: "text-footnote text-content-muted" }, je = {
188
+ class: "rounded-control bg-fill px-2.5 py-2 text-body text-content-muted",
189
+ "data-expiry-login": ""
190
+ }, We = /* @__PURE__ */ w({
191
+ __name: "SessionExpiry",
192
+ setup(e) {
193
+ const { t: s } = E(), { session: t } = x(), n = he(), m = ye(), d = A(), u = _e(), r = le(), a = g(() => {
194
+ const y = t.state.value, S = y.status === "anonymous" && y.reason === "expired" ? y.previous?.user : void 0;
195
+ return typeof S?.login == "string" ? S.login : null;
196
+ }), l = g(() => a.value !== null && n.meta.public !== !0), c = F(null), h = be(c, { onEscape: () => {
197
+ } }), { isOpen: te } = h, { form: U, passwordError: ne, submit: oe } = Ge({ login: a.value ?? "" });
198
+ q(l, (y) => {
199
+ y ? (U.hydrate({ login: a.value ?? "", password: "" }), we(), k.dismiss(), h.present()) : h.dismissWithoutAsking();
200
+ }, { immediate: !0, flush: "post" });
201
+ async function ie() {
202
+ if (!(m.hasUnsavedChanges() && !await m.confirm()))
203
+ try {
204
+ await t.signOut();
205
+ } catch (y) {
206
+ $(y) || k.error(d(y));
207
+ }
208
+ }
209
+ return (y, S) => (_(), K(me, { to: "body" }, [
210
+ o(te) ? (_(), D("div", {
211
+ key: 0,
212
+ class: "relative z-10000",
213
+ role: "alertdialog",
214
+ "aria-modal": "true",
215
+ "aria-labelledby": o(r),
216
+ "data-session-expiry": ""
217
+ }, [
218
+ S[0] || (S[0] = p("div", {
219
+ class: "fixed inset-0 bg-scrim",
220
+ "aria-hidden": "true"
221
+ }, null, -1)),
222
+ p("div", {
223
+ class: M(["fixed inset-0 flex p-4", o(u) ? "items-end p-0" : "items-center justify-center"])
224
+ }, [
225
+ p("div", {
226
+ ref_key: "panel",
227
+ ref: c,
228
+ tabindex: "-1",
229
+ class: M(["flex w-full flex-col gap-4 bg-surface-overlay p-6 shadow-float outline-none", o(u) ? "rounded-t-2xl pb-[max(2rem,var(--app-safe-bottom))]" : "max-w-sm rounded-menu"])
230
+ }, [
231
+ p("div", null, [
232
+ p("h2", {
233
+ id: o(r),
234
+ class: "text-headline font-semibold text-content-strong"
235
+ }, f(o(s)("core.identity.expired.title")), 9, Fe),
236
+ p("p", Ne, f(o(s)("core.identity.expired.body")), 1)
237
+ ]),
238
+ p("p", Be, [
239
+ v(o(Y), {
240
+ name: "checkboxCircleFill",
241
+ size: 16,
242
+ class: "shrink-0"
243
+ }),
244
+ C(" " + f(o(s)("core.identity.expired.kept")), 1)
245
+ ]),
246
+ v(o(ge), { onSubmit: o(oe) }, {
247
+ default: T(() => [
248
+ p("div", Me, [
249
+ p("span", Ve, f(o(s)("core.identity.username")), 1),
250
+ p("span", je, f(a.value), 1)
251
+ ]),
252
+ v(o(ve), pe(o(U).bind("password"), {
253
+ label: o(s)("core.identity.signin.password"),
254
+ type: "password",
255
+ autocomplete: "current-password",
256
+ required: "",
257
+ error: o(ne)
258
+ }), null, 16, ["label", "error"]),
259
+ v(o(z), {
260
+ type: "submit",
261
+ prominence: "primary",
262
+ class: "w-full",
263
+ processing: o(U).submitting.value
264
+ }, {
265
+ default: T(() => [
266
+ C(f(o(s)("core.identity.signin.submit")), 1)
267
+ ]),
268
+ _: 1
269
+ }, 8, ["processing"])
270
+ ]),
271
+ _: 1
272
+ }, 8, ["onSubmit"]),
273
+ v(o(z), {
274
+ prominence: "plain",
275
+ class: "self-center",
276
+ onClick: ie
277
+ }, {
278
+ default: T(() => [
279
+ C(f(o(s)("core.identity.expired.sign_out")), 1)
280
+ ]),
281
+ _: 1
282
+ })
283
+ ], 2)
284
+ ], 2)
285
+ ], 8, De)) : I("", !0)
286
+ ]));
287
+ }
288
+ }), He = (e) => typeof e == "object" && e !== null && !Array.isArray(e), Ye = (e) => {
289
+ if (!He(e)) throw new TypeError("expected an object");
290
+ if (typeof e.id != "number") throw new TypeError("id: expected a number");
291
+ for (const s of ["login", "name", "email", "locale"])
292
+ if (typeof e[s] != "string") throw new TypeError(`${s}: expected a string`);
293
+ return { id: e.id, login: e.login, name: e.name, email: e.email, locale: e.locale };
294
+ }, L = (e) => P(e) && e.kind === "unauthorized", B = (e, s) => e.request(b.refresh, { refresh_token: "" }, { signal: s, handleUnauthorized: !1 });
295
+ function Je(e, s) {
296
+ return {
297
+ async load(t) {
298
+ try {
299
+ const { data: n } = await e.request(b.me, void 0, { signal: t, handleUnauthorized: !1 });
300
+ return V(n, s);
301
+ } catch (n) {
302
+ if (!L(n)) throw n;
303
+ }
304
+ try {
305
+ const { data: n } = await B(e, t);
306
+ return V(n, s);
307
+ } catch (n) {
308
+ if (L(n)) return null;
309
+ throw n;
310
+ }
311
+ },
312
+ async signOut() {
313
+ try {
314
+ await e.request(b.logout, void 0, { handleUnauthorized: !1 });
315
+ } catch (t) {
316
+ if (!L(t)) throw t;
317
+ }
318
+ }
319
+ };
320
+ }
321
+ function Is(e) {
322
+ const s = e?.parseUser ?? Ye;
323
+ return {
324
+ session: (n) => Je(n, s),
325
+ async renewSession(n, m) {
326
+ try {
327
+ return await B(m), (await n.refresh()).status === "authenticated";
328
+ } catch {
329
+ return !1;
330
+ }
331
+ }
332
+ };
333
+ }
334
+ const Qe = async (e) => {
335
+ await B(e.http);
336
+ }, Xe = G({
337
+ login: { name: "login", path: "/login", component: () => import("./SignInPage-D2NA3VKU.js"), meta: { public: !0, titleKey: "core.identity.signin.title" } }
338
+ });
339
+ function Ks(e = {}) {
340
+ return W({
341
+ id: "identity",
342
+ routes: Xe.records,
343
+ context: H(ke, { home: e.home ?? "/" }),
344
+ holdsExpiredSession: !0,
345
+ contributions: [
346
+ // Not optional: a shell without a `host` could not ask for the password, and the person would be stuck on a dead page.
347
+ { id: "identity.expiry", slot: "host", component: We, scope: "always" },
348
+ // Not optional either: acting as somebody else must always be visible.
349
+ { id: "identity.impersonation", slot: "banner", component: qe, scope: "authenticated" },
350
+ // The same way out in the account menu (a shell without that slot shows only the banner's button).
351
+ { id: "identity.return", slot: "accountMenu", component: ze, scope: "authenticated", optional: !0, order: -20 },
352
+ { id: "identity.locale", slot: "host", component: Ie, scope: "authenticated", optional: !0 }
353
+ ],
354
+ effects: [re({ renew: Qe })]
355
+ });
356
+ }
357
+ const ee = G({
358
+ index: { name: "profile", path: "/profile", component: () => import("./ProfilePage-DLY81mvN.js"), meta: { titleKey: "core.profile.title" } }
359
+ }), Ze = /* @__PURE__ */ w({
360
+ __name: "ProfileMenuItem",
361
+ setup(e) {
362
+ const { t: s } = E();
363
+ return (t, n) => (_(), K(Q, {
364
+ label: o(s)("core.profile.menu"),
365
+ icon: "user3Line",
366
+ to: o(ee).index,
367
+ "data-profile-menu-item": ""
368
+ }, null, 8, ["label", "to"]));
369
+ }
370
+ }), [es, $s] = R("vue-core.users"), ss = Symbol("vue-core.users.person"), [Us, Ls] = R("vue-core.users.personActions"), [qs, zs] = R("vue-core.users.personSessions");
371
+ function ts(e) {
372
+ const s = w({
373
+ name: `PersonSection(${e.path})`,
374
+ setup() {
375
+ const t = Se(ss);
376
+ return () => t.data.value ? de(e.component, e.props?.(t.data.value) ?? {}) : null;
377
+ }
378
+ });
379
+ return { name: `users.record.${e.path}`, path: e.path, component: s, meta: { ...e.meta } };
380
+ }
381
+ const j = "iam.user:view", Gs = "iam.user:manage", ns = "iam.user.activity:view", se = G({
382
+ index: { name: "users.index", path: "/users", component: () => import("./UsersList-BfXWgH5K.js"), meta: { access: j, titleKey: "core.users.title" } },
383
+ record: {
384
+ name: "users.record",
385
+ path: "/users/:id",
386
+ component: () => import("./UserRecord-BaQl2zzQ.js"),
387
+ meta: { access: j, titleKey: "core.users.title", remountOnParam: "id" },
388
+ children: [
389
+ { name: "users.record.general", path: "general", component: () => import("./General-DTEfxWls.js"), meta: { section: { labelKey: "core.users.sections.general", icon: "user3Line", groupKey: "core.users.section_groups.person" } } },
390
+ { name: "users.record.signin", path: "signin", component: () => import("./SignIn-C-3i8RG6.js"), meta: { section: { labelKey: "core.users.sections.signin", icon: "key2Line", groupKey: "core.users.section_groups.access" } } },
391
+ { name: "users.record.sessions", path: "sessions", component: () => import("./Sessions-vGyUOnPG.js"), meta: { section: { labelKey: "core.users.sections.sessions", icon: "deviceLine", groupKey: "core.users.section_groups.access" } } },
392
+ { name: "users.record.signins", path: "signins", component: () => import("./SignIns-eoYPB6kB.js"), meta: { section: { labelKey: "core.users.sections.signins", icon: "timeFill", groupKey: "core.users.section_groups.activity" } } },
393
+ { name: "users.record.changes", path: "changes", component: () => import("./Changes-Cwfe6wbX.js"), meta: { section: { labelKey: "core.users.sections.changes", icon: "edit", groupKey: "core.users.section_groups.activity" } } },
394
+ { name: "users.record.activity", path: "activity", component: () => import("./Activity-CoGI2_GL.js"), meta: { access: ns, section: { labelKey: "core.users.sections.activity", icon: "listCheck", groupKey: "core.users.section_groups.activity" } } }
395
+ ]
396
+ }
397
+ });
398
+ function os(e) {
399
+ return se.records.map((s) => s.name === "users.record" ? { ...s, children: [...s.children ?? [], ...e.map(ts)] } : s);
400
+ }
401
+ function Ds(e = {}) {
402
+ const s = e.people ?? !0, t = e.profile ?? !0, n = e.signInAs ?? "iam.user:impersonate";
403
+ return W({
404
+ id: "users",
405
+ routes: [...s ? os(e.sections ?? []) : [], ...t ? ee.records : []],
406
+ context: H(es, { signInAs: n, activityAreas: e.activityAreas ?? {}, profileSections: e.profileSections ?? [] }),
407
+ navigation: s && e.destination ? [{ destination: e.destination, to: se.index, within: ["users.record"] }] : [],
408
+ // The entry of the account menu; a shell without that menu leaves it out.
409
+ contributions: t ? [{ id: "users.profile", slot: "accountMenu", component: Ze, scope: "authenticated", optional: !0, order: -10 }] : [],
410
+ requires: s && n !== !1 ? ["identity"] : []
411
+ });
412
+ }
413
+ const Fs = /* @__PURE__ */ w({
414
+ __name: "SignInAsButton",
415
+ props: {
416
+ userId: {},
417
+ name: {},
418
+ permission: {}
419
+ },
420
+ setup(e) {
421
+ const s = e, { t } = E(), n = x(), m = J(), { home: d } = X(), u = A(), r = F(!1), a = g(() => {
422
+ const c = O(n.session.state.value);
423
+ return c !== null && c.impersonator === void 0 && c.user.id !== s.userId;
424
+ });
425
+ async function l() {
426
+ r.value = !0;
427
+ try {
428
+ await Ce(n, s.userId), await m.push(d);
429
+ } catch (c) {
430
+ $(c) || k.error(u(c, { fallback: t("core.identity.impersonation.sign_in_as_failed", { name: s.name }) }));
431
+ } finally {
432
+ r.value = !1;
433
+ }
434
+ }
435
+ return (c, h) => a.value ? (_(), K(o(Te), {
436
+ key: 0,
437
+ permission: s.permission
438
+ }, {
439
+ default: T(() => [
440
+ v(o(z), {
441
+ processing: r.value,
442
+ "data-sign-in-as": "",
443
+ onClick: l
444
+ }, {
445
+ default: T(() => [
446
+ C(f(o(t)("core.identity.impersonation.sign_in_as", { name: s.name })), 1)
447
+ ]),
448
+ _: 1
449
+ }, 8, ["processing"])
450
+ ]),
451
+ _: 1
452
+ }, 8, ["permission"])) : I("", !0);
453
+ }
454
+ });
455
+ export {
456
+ Gs as M,
457
+ ss as P,
458
+ Fs as _,
459
+ Ge as a,
460
+ Ls as b,
461
+ $s as c,
462
+ $ as d,
463
+ zs as e,
464
+ se as f,
465
+ Us as g,
466
+ Ks as h,
467
+ b as i,
468
+ Is as j,
469
+ Je as k,
470
+ Pe as l,
471
+ Ye as m,
472
+ ee as n,
473
+ Oe as o,
474
+ qs as p,
475
+ Ce as q,
476
+ Qe as r,
477
+ Ae as s,
478
+ Ds as t,
479
+ X as u
480
+ };
package/dist/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  /** The version of @wssto2/vue-core (kept equal to package.json by index.test.ts). */
2
- export declare const version = "0.4.28";
2
+ export declare const version = "0.5.0";
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- const o = "0.4.28";
1
+ const o = "0.5.0";
2
2
  export {
3
3
  o as version
4
4
  };
@@ -1,6 +1,20 @@
1
1
  export type CategorySettings = {
2
2
  category: string;
3
3
  email: Setting;
4
+ push: Setting;
5
+ };
6
+ export type Device = {
7
+ id: number;
8
+ label: string;
9
+ platform: string;
10
+ endpoint_hash: string;
11
+ active: boolean;
12
+ created_at: string;
13
+ last_seen_at: string;
14
+ last_success_at: string | null;
15
+ };
16
+ export type DeviceList = {
17
+ items: Device[];
4
18
  };
5
19
  export type Item = {
6
20
  id: number;
@@ -18,10 +32,15 @@ export type Page = {
18
32
  };
19
33
  export type Preferences = {
20
34
  email_available: boolean;
35
+ push_available: boolean;
21
36
  categories: CategorySettings[];
22
37
  quiet_hours: QuietHours;
23
38
  time_zone: string;
24
39
  };
40
+ export type PushConfig = {
41
+ enabled: boolean;
42
+ public_key: string;
43
+ };
25
44
  export type QuietHours = {
26
45
  enabled: boolean;
27
46
  start: number;
@@ -1,4 +1,4 @@
1
- import type { CategorySettings, Page, Preferences, QuietHours, UnreadCount } from "./entities";
1
+ import type { CategorySettings, Device, DeviceList, Page, Preferences, PushConfig, QuietHours, UnreadCount } from "./entities";
2
2
  export declare const notificationRoutes: {
3
3
  readonly list: import("../../client").ApiRoute<{
4
4
  before_id?: number | undefined;
@@ -23,4 +23,28 @@ export declare const notificationRoutes: {
23
23
  start: number;
24
24
  end: number;
25
25
  }, QuietHours>;
26
+ readonly preferencesSetPush: import("../../client").ApiRoute<{
27
+ category: string;
28
+ push: boolean | null;
29
+ }, CategorySettings>;
30
+ readonly push: import("../../client").ApiRoute<void, PushConfig>;
31
+ readonly devices: import("../../client").ApiRoute<void, DeviceList>;
32
+ readonly deviceSubscribe: import("../../client").ApiRoute<{
33
+ endpoint: string;
34
+ p256dh: string;
35
+ auth: string;
36
+ }, Device>;
37
+ readonly deviceUnsubscribe: import("../../client").ApiRoute<{
38
+ endpoint: string;
39
+ }, DeviceList>;
40
+ readonly deviceRename: import("../../client").ApiRoute<{
41
+ id: number;
42
+ label: string;
43
+ }, Device>;
44
+ readonly deviceRemove: import("../../client").ApiRoute<{
45
+ id: number;
46
+ }, DeviceList>;
47
+ readonly deviceTest: import("../../client").ApiRoute<{
48
+ id: number;
49
+ }, DeviceList>;
26
50
  };
@@ -1,4 +1,8 @@
1
1
  import { z } from 'zod';
2
+ export declare const DeviceInputSchema: z.ZodObject<{
3
+ id: z.ZodNumber;
4
+ }, z.core.$strip>;
5
+ export type DeviceInput = z.infer<typeof DeviceInputSchema>;
2
6
  export declare const ListQuerySchema: z.ZodObject<{
3
7
  before_id: z.ZodOptional<z.ZodNumber>;
4
8
  limit: z.ZodOptional<z.ZodNumber>;
@@ -18,8 +22,28 @@ export declare const ReadInputSchema: z.ZodObject<{
18
22
  id: z.ZodNumber;
19
23
  }, z.core.$strip>;
20
24
  export type ReadInput = z.infer<typeof ReadInputSchema>;
25
+ export declare const RenameDeviceInputSchema: z.ZodObject<{
26
+ id: z.ZodNumber;
27
+ label: z.ZodString;
28
+ }, z.core.$strip>;
29
+ export type RenameDeviceInput = z.infer<typeof RenameDeviceInputSchema>;
21
30
  export declare const SetEmailInputSchema: z.ZodObject<{
22
31
  category: z.ZodString;
23
32
  email: z.ZodNullable<z.ZodBoolean>;
24
33
  }, z.core.$strip>;
25
34
  export type SetEmailInput = z.infer<typeof SetEmailInputSchema>;
35
+ export declare const SetPushInputSchema: z.ZodObject<{
36
+ category: z.ZodString;
37
+ push: z.ZodNullable<z.ZodBoolean>;
38
+ }, z.core.$strip>;
39
+ export type SetPushInput = z.infer<typeof SetPushInputSchema>;
40
+ export declare const SubscriptionSchema: z.ZodObject<{
41
+ endpoint: z.ZodString;
42
+ p256dh: z.ZodString;
43
+ auth: z.ZodString;
44
+ }, z.core.$strip>;
45
+ export type Subscription = z.infer<typeof SubscriptionSchema>;
46
+ export declare const UnsubscribeInputSchema: z.ZodObject<{
47
+ endpoint: z.ZodString;
48
+ }, z.core.$strip>;
49
+ export type UnsubscribeInput = z.infer<typeof UnsubscribeInputSchema>;
@@ -1,6 +1,6 @@
1
1
  import { computed as k } from "vue";
2
2
  import { d as y } from "./context-Ch1r4fdN.js";
3
- import { h as N } from "./platform-PZpUkkMS.js";
3
+ import { h as N } from "./platform-Dl1fbScN.js";
4
4
  function F(l, a = {}) {
5
5
  const i = /* @__PURE__ */ new Map(), o = [];
6
6
  for (const e of l) {