@wssto2/vue-core 0.6.0 → 0.8.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.
- package/CHANGELOG.md +39 -0
- package/README.md +3 -0
- package/dist/{AccessGate.vue_vue_type_script_setup_true_lang-DZ9GcLC1.js → AccessGate.vue_vue_type_script_setup_true_lang-CkomzGrt.js} +1 -1
- package/dist/{AccountMenuItem.vue_vue_type_script_setup_true_lang-CPeNxh5K.js → AccountMenuItem.vue_vue_type_script_setup_true_lang-BIYgaihv.js} +1 -1
- package/dist/{ActionRow.vue_vue_type_script_setup_true_lang-D8NCXX4p.js → ActionRow.vue_vue_type_script_setup_true_lang-Cg1lhpcA.js} +2 -2
- package/dist/{Activity-DGodh6BU.js → Activity-Cm1dlM2b.js} +9 -9
- package/dist/{AdaptivePageShell.vue_vue_type_script_setup_true_lang-GUTIXuNd.js → AdaptivePageShell.vue_vue_type_script_setup_true_lang-9Lt1XggN.js} +3 -3
- package/dist/{AlertDialog.vue_vue_type_script_setup_true_lang-whA4WLdl.js → AlertDialog.vue_vue_type_script_setup_true_lang-BvGc1Rfl.js} +1 -1
- package/dist/{AsyncSection.vue_vue_type_script_setup_true_lang-B0NfvG3B.js → AsyncSection.vue_vue_type_script_setup_true_lang-GxAsImnO.js} +4 -4
- package/dist/{Banner.vue_vue_type_script_setup_true_lang-DSStj_5z.js → Banner.vue_vue_type_script_setup_true_lang-sv0phngk.js} +1 -1
- package/dist/{Button.vue_vue_type_script_setup_true_lang-CL9Qh5yq.js → Button.vue_vue_type_script_setup_true_lang-DQq_0P0p.js} +1 -1
- package/dist/{Changes-38u4xY6e.js → Changes-fN0KMYbW.js} +8 -8
- package/dist/{CollectionPage.vue_vue_type_script_setup_true_lang-DPcCnrjr.js → CollectionPage.vue_vue_type_script_setup_true_lang--onFdKOB.js} +17 -16
- package/dist/{DataTable.vue_vue_type_script_setup_true_lang-BEvz5zqo.js → DataTable.vue_vue_type_script_setup_true_lang-CTukf2B2.js} +1 -1
- package/dist/{DateField.vue_vue_type_script_setup_true_lang-BxUuUypB.js → DateField.vue_vue_type_script_setup_true_lang-DmYp54mq.js} +3 -3
- package/dist/{DeadLetters-CeHfhFHP.js → DeadLetters-BslDh93e.js} +5 -5
- package/dist/{DiscardChangesModal.vue_vue_type_script_setup_true_lang-D1arePCZ.js → DiscardChangesModal.vue_vue_type_script_setup_true_lang-DcihJfpk.js} +1 -1
- package/dist/{EmptyState.vue_vue_type_script_setup_true_lang-50p-Mp8I.js → EmptyState.vue_vue_type_script_setup_true_lang-DbZiO2RF.js} +1 -1
- package/dist/{FormErrors.vue_vue_type_script_setup_true_lang-D7edzNTL.js → FormErrors.vue_vue_type_script_setup_true_lang-DJiK8iqo.js} +1 -1
- package/dist/{FormGroup.vue_vue_type_script_setup_true_lang-CNb2CK01.js → FormGroup.vue_vue_type_script_setup_true_lang-BTADNpwB.js} +2 -2
- package/dist/{FormView.vue_vue_type_script_setup_true_lang-nyz8EkzM.js → FormView.vue_vue_type_script_setup_true_lang-Ncl9DmFB.js} +2 -2
- package/dist/{General-BNTjPvat.js → General-DJ53Egpp.js} +8 -8
- package/dist/{HeaderAction.vue_vue_type_script_setup_true_lang-Cgji-Jrr.js → HeaderAction.vue_vue_type_script_setup_true_lang-Da59TLBh.js} +2 -2
- package/dist/{Icon.vue_vue_type_script_lang-D7oC-d-S.js → Icon.vue_vue_type_script_lang-BhhsFYwp.js} +45 -42
- package/dist/{IconTile.vue_vue_type_script_setup_true_lang-_FXvaj93.js → IconTile.vue_vue_type_script_setup_true_lang-BmxCuUZ9.js} +1 -1
- package/dist/IncidentRecord-DQTnYQEe.js +405 -0
- package/dist/IncidentsList-C3yUnwwY.js +140 -0
- package/dist/KeyValue.vue_vue_type_script_setup_true_lang-wcZcvnow.js +35 -0
- package/dist/{LeaveGuardRoot.vue_vue_type_script_setup_true_lang-Cv7KlA5y.js → LeaveGuardRoot.vue_vue_type_script_setup_true_lang-ChIsmnts.js} +1 -1
- package/dist/{Menu.vue_vue_type_script_setup_true_lang-DsFOeCVe.js → Menu.vue_vue_type_script_setup_true_lang-ldLdJ5Q-.js} +1 -1
- package/dist/{MenuButton.vue_vue_type_script_setup_true_lang-AGbN9r5q.js → MenuButton.vue_vue_type_script_setup_true_lang-C-XRr5f2.js} +1 -1
- package/dist/{Modal.vue_vue_type_script_setup_true_lang-DpBb8ans.js → Modal.vue_vue_type_script_setup_true_lang-4MsnTWyx.js} +2 -2
- package/dist/{NewRolePage-Btg7gzzH.js → NewRolePage-Bw2_jXcQ.js} +4 -4
- package/dist/{NoAccess.vue_vue_type_script_setup_true_lang-DWxq-MTM.js → NoAccess.vue_vue_type_script_setup_true_lang-BHzZtZ50.js} +1 -1
- package/dist/{NumberField.vue_vue_type_script_setup_true_lang-C8um4ARi.js → NumberField.vue_vue_type_script_setup_true_lang-C3nw944P.js} +1 -1
- package/dist/{PageBar.vue_vue_type_script_setup_true_lang-B7qdEeej.js → PageBar.vue_vue_type_script_setup_true_lang-DPpcZxuT.js} +1 -1
- package/dist/{Panel.vue_vue_type_script_setup_true_lang-BA0u_DtS.js → Panel.vue_vue_type_script_setup_true_lang-D_Wg42hu.js} +1 -1
- package/dist/{PersonAccess.vue_vue_type_script_setup_true_lang-ClmawvYm.js → PersonAccess.vue_vue_type_script_setup_true_lang-07pq4SrY.js} +12 -12
- package/dist/{PhotoViewer.vue_vue_type_script_setup_true_lang-CY5EZiyK.js → PhotoViewer.vue_vue_type_script_setup_true_lang-Cj0hSMk9.js} +1 -1
- package/dist/{ProfilePage-CoZyG11N.js → ProfilePage-DxALOfzC.js} +19 -19
- package/dist/{RecordHeader.vue_vue_type_script_setup_true_lang-fmx0f8xi.js → RecordHeader.vue_vue_type_script_setup_true_lang-DPm9q1P_.js} +2 -2
- package/dist/{ResourcePage.vue_vue_type_script_setup_true_lang-BFBGvevP.js → ResourcePage.vue_vue_type_script_setup_true_lang-Cm3tx76N.js} +5 -5
- package/dist/{RoleEditor.vue_vue_type_script_setup_true_lang-Bs9bo0Zb.js → RoleEditor.vue_vue_type_script_setup_true_lang-DuQR8hFf.js} +13 -13
- package/dist/{RolePage-CPlwZA6X.js → RolePage-Yv6m6u7o.js} +13 -13
- package/dist/{RolesPage-CdYdIHR4.js → RolesPage-TibtzxzQ.js} +9 -9
- package/dist/{SectionList.vue_vue_type_script_setup_true_lang-wyW7n3Uq.js → SectionList.vue_vue_type_script_setup_true_lang-DAnZbfWA.js} +3 -3
- package/dist/{SectionNavigator.vue_vue_type_script_setup_true_lang-Ci04hApd.js → SectionNavigator.vue_vue_type_script_setup_true_lang-ivdGWUeF.js} +5 -5
- package/dist/{SegmentedField.vue_vue_type_script_setup_true_lang-B_hBL5f4.js → SegmentedField.vue_vue_type_script_setup_true_lang-ChfDFAA2.js} +1 -1
- package/dist/{SelectField.vue_vue_type_script_setup_true_lang-CBZhGNpm.js → SelectField.vue_vue_type_script_setup_true_lang-iJm8qmjT.js} +5 -5
- package/dist/{ServiceAccountDialog.vue_vue_type_script_setup_true_lang-DuvSSBbX.js → ServiceAccountDialog.vue_vue_type_script_setup_true_lang-en2w_pAJ.js} +8 -8
- package/dist/{ServiceAccountRecord-BtaUZuWU.js → ServiceAccountRecord-B_amE8fL.js} +18 -18
- package/dist/{ServiceAccountsList-CcRJvNaf.js → ServiceAccountsList-CoDKG_15.js} +10 -10
- package/dist/{SessionList.vue_vue_type_script_setup_true_lang-VvBB2EZz.js → SessionList.vue_vue_type_script_setup_true_lang-BEKTaL0g.js} +4 -4
- package/dist/{Sessions-DkGNO1FO.js → Sessions-BrAEXAMA.js} +6 -6
- package/dist/{SettingsPage-D4G1HGbG.js → SettingsPage-Cje1X0ix.js} +19 -19
- package/dist/{Sheet.vue_vue_type_script_setup_true_lang-DgOFV4fa.js → Sheet.vue_vue_type_script_setup_true_lang-sh9YD0Pm.js} +1 -1
- package/dist/{SignIn-DS1YymqD.js → SignIn-CbWgDlFb.js} +7 -7
- package/dist/{SignInPage-BrmL0PUw.js → SignInPage-DmHdrZR-.js} +6 -6
- package/dist/{SignIns-C7l7IPHQ.js → SignIns-D5BRb9Sr.js} +6 -6
- package/dist/{SwipeActions.vue_vue_type_script_setup_true_lang-BJIA2JfI.js → SwipeActions.vue_vue_type_script_setup_true_lang-D8SiC0G7.js} +1 -1
- package/dist/{SwitchField.vue_vue_type_script_setup_true_lang-DXZK89A3.js → SwitchField.vue_vue_type_script_setup_true_lang-BMA2YXTZ.js} +1 -1
- package/dist/{Tabs.vue_vue_type_script_setup_true_lang-CcMcE38r.js → Tabs.vue_vue_type_script_setup_true_lang-tpkGp98F.js} +1 -1
- package/dist/{TextField.vue_vue_type_script_setup_true_lang-CX3LdZLK.js → TextField.vue_vue_type_script_setup_true_lang-7IAl4eAE.js} +3 -3
- package/dist/{TextareaField.vue_vue_type_script_setup_true_lang-BOtn_1GT.js → TextareaField.vue_vue_type_script_setup_true_lang-Dyh4Hhyl.js} +1 -1
- package/dist/{TimeField.vue_vue_type_script_setup_true_lang-CbflIrq6.js → TimeField.vue_vue_type_script_setup_true_lang-BwoE08jT.js} +3 -3
- package/dist/{Timestamp.vue_vue_type_script_setup_true_lang-CutyQkJb.js → Timestamp.vue_vue_type_script_setup_true_lang-u53rHMFG.js} +1 -1
- package/dist/{UserRecord-Du8M_kuk.js → UserRecord-rIeTkocJ.js} +12 -12
- package/dist/{UsersList-D3ydQice.js → UsersList-CiPeerC7.js} +8 -8
- package/dist/{ViewTabs.vue_vue_type_script_setup_true_lang-BJIoZAlH.js → ViewTabs.vue_vue_type_script_setup_true_lang-BjdDXE3T.js} +1 -1
- package/dist/access/index.js +4 -4
- package/dist/app/application.d.ts +2 -0
- package/dist/app/index.js +13 -427
- package/dist/application-D8Nm17zA.js +420 -0
- package/dist/button/index.js +1 -1
- package/dist/client/client.d.ts +7 -0
- package/dist/client/index.d.ts +1 -1
- package/dist/client/index.js +5 -4
- package/dist/client-CZgikXPG.js +151 -0
- package/dist/collection/index.d.ts +1 -1
- package/dist/collection/index.js +77 -65
- package/dist/collection/savedViews.d.ts +12 -2
- package/dist/content/index.js +37 -66
- package/dist/{contributions-fx5q5n1u.js → contributions-BQ9dZoRw.js} +1 -1
- package/dist/controls/index.js +4 -4
- package/dist/datePresets-DB13HHHd.js +17 -0
- package/dist/definition-C7QuyV3i.js +54 -0
- package/dist/form/index.js +34 -34
- package/dist/{guards-D4mXf_2X.js → guards-BFCulig0.js} +1 -1
- package/dist/i18n/index.js +18 -18
- package/dist/icon/core.d.ts +3 -0
- package/dist/icon/index.js +1 -1
- package/dist/identity/index.js +2 -2
- package/dist/incidents/IncidentRecord.vue.d.ts +2 -0
- package/dist/incidents/IncidentsList.vue.d.ts +2 -0
- package/dist/incidents/Person.vue.d.ts +7 -0
- package/dist/incidents/ReportDialog.vue.d.ts +21 -0
- package/dist/incidents/ReportHost.vue.d.ts +2 -0
- package/dist/incidents/ReportMenuItem.vue.d.ts +2 -0
- package/dist/incidents/access.d.ts +6 -0
- package/dist/incidents/api.d.ts +27 -0
- package/dist/incidents/clientErrorReporter.d.ts +38 -0
- package/dist/incidents/context.d.ts +7 -0
- package/dist/incidents/feature.d.ts +20 -0
- package/dist/incidents/form.d.ts +16 -0
- package/dist/incidents/index.d.ts +9 -0
- package/dist/incidents/index.js +8 -0
- package/dist/incidents/look.d.ts +6 -0
- package/dist/incidents/routes.d.ts +21 -0
- package/dist/{index-DH0MoFqg.js → index-BQg5X6iK.js} +10 -10
- package/dist/{index-Cmj9iZmT.js → index-B_lzrZot.js} +21 -21
- package/dist/index-Cgu6Ntok.js +340 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/modal/index.js +5 -5
- package/dist/modules/incident/entities.d.ts +84 -0
- package/dist/modules/incident/routes.d.ts +54 -0
- package/dist/modules/incident/schemas.d.ts +48 -0
- package/dist/modules/savedview/entities.d.ts +7 -0
- package/dist/modules/savedview/routes.d.ts +13 -0
- package/dist/modules/savedview/schemas.d.ts +11 -0
- package/dist/{navigation-Bc5EQ_Si.js → navigation-BSC9X7FM.js} +1 -1
- package/dist/{neighbors-DNZuGlQH.js → neighbors-BKzihEGQ.js} +1 -1
- package/dist/notifications/index.js +1 -1
- package/dist/{options-e_CAfvDQ.js → options-QuOkMKVZ.js} +1 -1
- package/dist/overlay/index.js +4 -4
- package/dist/page/index.js +7 -7
- package/dist/phone/index.js +2 -2
- package/dist/platform/index.js +3 -3
- package/dist/{platform-Dx6STiwY.js → platform-Dr4iY3b8.js} +1 -1
- package/dist/resource/index.js +1 -1
- package/dist/router/index.js +4 -4
- package/dist/{rowLayout-BBFyLbOl.js → rowLayout-XlTcD4de.js} +7 -7
- package/dist/{sections-B0HxIOC2.js → sections-BXg4_ZhO.js} +1 -1
- package/dist/shell/index.js +9 -9
- package/dist/state/index.js +4 -4
- package/dist/state-ChVIjayU.js +102 -0
- package/dist/{status-C8XtnK6m.js → status-BV5Ae4K4.js} +5 -5
- package/dist/styles.css +1 -1
- package/dist/{suggestions-cPjs5gQz.js → suggestions-niXd1oOl.js} +1 -1
- package/dist/testing/index.js +1 -1
- package/dist/{useCommand-CfG727e8.js → useCommand-BIZX1ReM.js} +4 -4
- package/dist/{useGroupSheet-BVcNDWbP.js → useGroupSheet-DxXzdKo3.js} +5 -5
- package/dist/{useRecordDialog-D65FF85F.js → useRecordDialog-BLVSz7g3.js} +1 -1
- package/dist/{useResourceForm-CJfl8rj_.js → useResourceForm-DYuYT_on.js} +1 -1
- package/dist/{useTypedEntry-C7k7Dyl-.js → useTypedEntry-CKuGqWT8.js} +2 -2
- package/package.json +6 -2
- package/dist/client-BHPFfBj3.js +0 -147
- package/dist/state-BC1Fc6U2.js +0 -154
|
@@ -2,8 +2,8 @@ import { defineComponent as K, ref as L, watch as re, computed as _, openBlock a
|
|
|
2
2
|
import { i as W } from "./intlLocale-CeRU44qJ.js";
|
|
3
3
|
import { useI18n as X } from "vue-i18n";
|
|
4
4
|
import { u as Me } from "./format-D8X4zsx6.js";
|
|
5
|
-
import { _ as Oe } from "./Sheet.vue_vue_type_script_setup_true_lang-
|
|
6
|
-
import { _ as F } from "./Icon.vue_vue_type_script_lang-
|
|
5
|
+
import { _ as Oe } from "./Sheet.vue_vue_type_script_setup_true_lang-sh9YD0Pm.js";
|
|
6
|
+
import { _ as F } from "./Icon.vue_vue_type_script_lang-BhhsFYwp.js";
|
|
7
7
|
import { a as We } from "./mediaQuery-CygcXmFW.js";
|
|
8
8
|
const Re = /^(\d{4})-(\d{2})-(\d{2})$/, Ve = 864e5, R = (e, t = 2) => String(e).padStart(t, "0"), He = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], Be = (e) => e % 4 === 0 && e % 100 !== 0 || e % 400 === 0, se = (e, t) => t === 2 && Be(e) ? 29 : He[t - 1] ?? 0;
|
|
9
9
|
function O(e, t, a) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wssto2/vue-core",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"goCore": "v1.
|
|
3
|
+
"version": "0.8.0",
|
|
4
|
+
"goCore": "v1.12.0",
|
|
5
5
|
"description": "Shared Vue 3 library for go-core applications: app shell, list / record / form pages and their controls.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"vue",
|
|
@@ -121,6 +121,10 @@
|
|
|
121
121
|
"types": "./dist/notifications/index.d.ts",
|
|
122
122
|
"import": "./dist/notifications/index.js"
|
|
123
123
|
},
|
|
124
|
+
"./incidents": {
|
|
125
|
+
"types": "./dist/incidents/index.d.ts",
|
|
126
|
+
"import": "./dist/incidents/index.js"
|
|
127
|
+
},
|
|
124
128
|
"./push-worker": {
|
|
125
129
|
"types": "./dist/push-worker/index.d.ts",
|
|
126
130
|
"import": "./dist/push-worker/index.js"
|
package/dist/client-BHPFfBj3.js
DELETED
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
import { A, k as I, i as S } from "./error-Bb_dr_Ay.js";
|
|
2
|
-
function U(t) {
|
|
3
|
-
if (!t) return "";
|
|
4
|
-
const e = new URLSearchParams();
|
|
5
|
-
for (const [a, r] of Object.entries(t))
|
|
6
|
-
if (!(r == null || r === ""))
|
|
7
|
-
if (Array.isArray(r)) for (const i of r) e.append(a, String(i));
|
|
8
|
-
else e.append(a, String(r));
|
|
9
|
-
return e.toString();
|
|
10
|
-
}
|
|
11
|
-
const g = (t) => typeof Blob < "u" && t instanceof Blob;
|
|
12
|
-
function D(t) {
|
|
13
|
-
const e = new FormData();
|
|
14
|
-
for (const [a, r] of Object.entries(t))
|
|
15
|
-
if (r != null)
|
|
16
|
-
if (Array.isArray(r))
|
|
17
|
-
for (const i of r) e.append(`${a}[]`, E(i));
|
|
18
|
-
else
|
|
19
|
-
e.append(a, E(r));
|
|
20
|
-
return e;
|
|
21
|
-
}
|
|
22
|
-
function E(t) {
|
|
23
|
-
return g(t) ? t : t instanceof Date ? t.toISOString() : typeof t == "object" && t !== null ? JSON.stringify(t) : String(t);
|
|
24
|
-
}
|
|
25
|
-
function z(t) {
|
|
26
|
-
if (t === void 0) return { body: void 0, contentType: null };
|
|
27
|
-
if (typeof t == "string" || t instanceof FormData || t instanceof URLSearchParams || t instanceof ArrayBuffer || ArrayBuffer.isView(t) || g(t))
|
|
28
|
-
return { body: t, contentType: null };
|
|
29
|
-
if (typeof t == "object" && t !== null && !Array.isArray(t)) {
|
|
30
|
-
const e = t;
|
|
31
|
-
if (Object.values(e).some((a) => g(a) || Array.isArray(a) && a.some(g)))
|
|
32
|
-
return { body: D(e), contentType: null };
|
|
33
|
-
}
|
|
34
|
-
return { body: JSON.stringify(t), contentType: "application/json" };
|
|
35
|
-
}
|
|
36
|
-
function v() {
|
|
37
|
-
const t = new Uint8Array(16);
|
|
38
|
-
return globalThis.crypto.getRandomValues(t), Array.from(t, (e) => e.toString(16).padStart(2, "0")).join("");
|
|
39
|
-
}
|
|
40
|
-
const b = "X-Request-ID", T = (t) => typeof t == "object" && t !== null && !Array.isArray(t), w = (t) => typeof t == "string" && t !== "" ? t : null;
|
|
41
|
-
function B(t) {
|
|
42
|
-
const e = t?.errors ?? t?.fields;
|
|
43
|
-
if (!T(e)) return {};
|
|
44
|
-
const a = {};
|
|
45
|
-
for (const [r, i] of Object.entries(e))
|
|
46
|
-
Array.isArray(i) ? a[r] = i.map(String) : i != null && (a[r] = [String(i)]);
|
|
47
|
-
return a;
|
|
48
|
-
}
|
|
49
|
-
async function O(t) {
|
|
50
|
-
const e = await t.text();
|
|
51
|
-
if (e.trim() === "") return { payload: null, readable: !0 };
|
|
52
|
-
try {
|
|
53
|
-
return { payload: JSON.parse(e), readable: !0 };
|
|
54
|
-
} catch {
|
|
55
|
-
return { payload: null, readable: !1 };
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
async function C(t, e) {
|
|
59
|
-
const a = t.headers.get(b) ?? e, { payload: r, readable: i } = await O(t), o = T(r) ? r : null;
|
|
60
|
-
if (!t.ok) {
|
|
61
|
-
const m = B(o), n = o?.params;
|
|
62
|
-
throw new A({
|
|
63
|
-
kind: I(t.status, Object.keys(m).length > 0),
|
|
64
|
-
message: w(o?.error) ?? w(o?.message) ?? `Request failed with status ${t.status}`,
|
|
65
|
-
status: t.status,
|
|
66
|
-
fields: m,
|
|
67
|
-
code: w(o?.code),
|
|
68
|
-
params: T(n) ? n : null,
|
|
69
|
-
requestId: a,
|
|
70
|
-
payload: r
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
if (!i)
|
|
74
|
-
throw new A({
|
|
75
|
-
kind: "malformed",
|
|
76
|
-
message: `The server answered ${t.status} with a body that is not JSON`,
|
|
77
|
-
status: t.status,
|
|
78
|
-
requestId: a
|
|
79
|
-
});
|
|
80
|
-
return o !== null && typeof o.success == "boolean" ? {
|
|
81
|
-
data: o.data ?? null,
|
|
82
|
-
meta: o.meta ?? null,
|
|
83
|
-
message: w(o.message),
|
|
84
|
-
status: t.status,
|
|
85
|
-
requestId: a
|
|
86
|
-
} : { data: r, meta: null, message: null, status: t.status, requestId: a };
|
|
87
|
-
}
|
|
88
|
-
const F = (t, e) => globalThis.fetch(t, e), H = (t) => /^[a-z][a-z0-9+.-]*:\/\//i.test(t);
|
|
89
|
-
function P(t, e, a) {
|
|
90
|
-
const r = H(e) || t === "" ? e : `${t.replace(/\/+$/, "")}/${e.replace(/^\/+/, "")}`;
|
|
91
|
-
return a === "" ? r : `${r}${r.includes("?") ? "&" : "?"}${a}`;
|
|
92
|
-
}
|
|
93
|
-
const j = (t, e) => new A({ kind: "aborted", message: "The request was cancelled", requestId: t, cause: e });
|
|
94
|
-
function x(t = {}) {
|
|
95
|
-
const { baseUrl: e = "", transport: a = F, credentials: r = "include" } = t;
|
|
96
|
-
async function i(n, s, c, u) {
|
|
97
|
-
const { signal: f } = u, y = t.requestId === !1 ? null : (t.requestId ?? v)();
|
|
98
|
-
if (f?.aborted) throw j(y, f.reason);
|
|
99
|
-
const p = z(c), l = new Headers({ Accept: "application/json" }), h = t.headers ? await t.headers() : void 0;
|
|
100
|
-
for (const d of [h, u.headers])
|
|
101
|
-
d && new Headers(d).forEach(($, q) => l.set(q, $));
|
|
102
|
-
y !== null && !l.has(b) && l.set(b, y), p.contentType !== null && !l.has("Content-Type") && l.set("Content-Type", p.contentType);
|
|
103
|
-
const k = { method: n, headers: l, credentials: r, body: p.body, signal: f }, R = P(e, s, U(u.query));
|
|
104
|
-
try {
|
|
105
|
-
const d = await a(R, k);
|
|
106
|
-
return await C(d, y);
|
|
107
|
-
} catch (d) {
|
|
108
|
-
throw S(d) ? d : f?.aborted || d instanceof Error && d.name === "AbortError" ? j(y, d) : new A({
|
|
109
|
-
kind: "network",
|
|
110
|
-
message: d instanceof Error ? d.message : "The server could not be reached",
|
|
111
|
-
requestId: y,
|
|
112
|
-
cause: d
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
async function o(n, s, c, u = {}) {
|
|
117
|
-
try {
|
|
118
|
-
return await i(n, s, c, u);
|
|
119
|
-
} catch (f) {
|
|
120
|
-
if (!S(f) || f.kind !== "unauthorized" || u.handleUnauthorized === !1 || !t.onUnauthorized || await t.onUnauthorized({ error: f, method: n, path: s }) !== "retry") throw f;
|
|
121
|
-
return i(n, s, c, u);
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
async function m(n, s, c = {}) {
|
|
125
|
-
const u = typeof s == "object" && s !== null && !Array.isArray(s) ? { ...s } : {}, f = n.path.replace(/:([A-Za-z_][A-Za-z0-9_]*)/g, (p, l) => {
|
|
126
|
-
const h = u[l];
|
|
127
|
-
if (h == null || h === "")
|
|
128
|
-
throw new Error(`${n.method} ${n.path}: the input has no value for the path parameter "${l}"`);
|
|
129
|
-
return delete u[l], encodeURIComponent(String(h));
|
|
130
|
-
}), y = Object.keys(u).length > 0;
|
|
131
|
-
return n.method === "GET" || n.method === "DELETE" ? o(n.method, f, void 0, { ...c, query: { ...u, ...c.query } }) : o(n.method, f, y ? u : void 0, c);
|
|
132
|
-
}
|
|
133
|
-
return {
|
|
134
|
-
// the rest-tuple overload is the public contract; the implementation takes its arguments positionally
|
|
135
|
-
request: m,
|
|
136
|
-
get: (n, s) => o("GET", n, void 0, s),
|
|
137
|
-
post: (n, s, c) => o("POST", n, s, c),
|
|
138
|
-
put: (n, s, c) => o("PUT", n, s, c),
|
|
139
|
-
patch: (n, s, c) => o("PATCH", n, s, c),
|
|
140
|
-
delete: (n, s) => o("DELETE", n, void 0, s)
|
|
141
|
-
};
|
|
142
|
-
}
|
|
143
|
-
export {
|
|
144
|
-
b as R,
|
|
145
|
-
x as c,
|
|
146
|
-
F as f
|
|
147
|
-
};
|
package/dist/state-BC1Fc6U2.js
DELETED
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
import { hasInjectionContext as $, inject as z, watch as O } from "vue";
|
|
2
|
-
import { g as j } from "./platform-Dx6STiwY.js";
|
|
3
|
-
const A = [5, 8, 10, 15, 25, 50, 100], v = 25;
|
|
4
|
-
function M(e) {
|
|
5
|
-
const t = `defineCollection("${e.id}")`;
|
|
6
|
-
if (typeof e.id != "string" || e.id.trim() === "") throw new Error("defineCollection: `id` must be a non-empty string.");
|
|
7
|
-
if (!Number.isInteger(e.stateVersion) || e.stateVersion < 1) throw new Error(`${t}: \`stateVersion\` must be a positive integer.`);
|
|
8
|
-
if (typeof e.load != "function") throw new Error(`${t}: \`load\` must be a function.`);
|
|
9
|
-
if (typeof e.key != "function") throw new Error(`${t}: \`key\` must be a function.`);
|
|
10
|
-
const s = {
|
|
11
|
-
sorts: e.query?.sorts ? [...e.query.sorts] : null,
|
|
12
|
-
filters: e.query?.filters ? [...e.query.filters] : null,
|
|
13
|
-
views: e.query?.views ? [...e.query.views] : null,
|
|
14
|
-
sensitive: [...e.query?.sensitive ?? []],
|
|
15
|
-
pageSizes: [...e.query?.pageSizes ?? A],
|
|
16
|
-
search: e.query?.search ?? !0
|
|
17
|
-
};
|
|
18
|
-
if (s.pageSizes.length === 0 || s.pageSizes.some((n) => !Number.isInteger(n) || n < 1))
|
|
19
|
-
throw new Error(`${t}: \`query.pageSizes\` must list positive integers.`);
|
|
20
|
-
for (const n of s.sensitive)
|
|
21
|
-
if (s.filters && !s.filters.includes(n)) throw new Error(`${t}: sensitive filter "${n}" is not in \`query.filters\`.`);
|
|
22
|
-
const r = e.defaults ?? {}, o = r.pageSize ?? (s.pageSizes.includes(v) ? v : s.pageSizes[0]);
|
|
23
|
-
if (!s.pageSizes.includes(o)) throw new Error(`${t}: default page size ${o} is not one of ${s.pageSizes.join(", ")}.`);
|
|
24
|
-
const c = r.sort ?? null;
|
|
25
|
-
if (c !== null && s.sorts && !s.sorts.includes(c)) throw new Error(`${t}: default sort "${c}" is not in \`query.sorts\`.`);
|
|
26
|
-
const i = r.view ?? null;
|
|
27
|
-
if (i !== null && s.views && !s.views.includes(i)) throw new Error(`${t}: default view "${i}" is not in \`query.views\`.`);
|
|
28
|
-
const f = Object.fromEntries(Object.entries(r.filters ?? {}).filter(([, n]) => n !== void 0 && n !== ""));
|
|
29
|
-
for (const n of Object.keys(f))
|
|
30
|
-
if (s.filters && !s.filters.includes(n)) throw new Error(`${t}: default filter "${n}" is not in \`query.filters\`.`);
|
|
31
|
-
const l = r.page ?? 1;
|
|
32
|
-
if (!Number.isInteger(l) || l < 1) throw new Error(`${t}: default page must be a positive integer.`);
|
|
33
|
-
const a = r.direction ?? "asc";
|
|
34
|
-
if (a !== "asc" && a !== "desc") throw new Error(`${t}: default direction must be "asc" or "desc".`);
|
|
35
|
-
return Object.freeze({
|
|
36
|
-
id: e.id,
|
|
37
|
-
stateVersion: e.stateVersion,
|
|
38
|
-
load: e.load,
|
|
39
|
-
key: e.key,
|
|
40
|
-
defaults: Object.freeze({
|
|
41
|
-
page: l,
|
|
42
|
-
pageSize: o,
|
|
43
|
-
sort: c,
|
|
44
|
-
direction: a,
|
|
45
|
-
search: r.search ?? "",
|
|
46
|
-
view: i,
|
|
47
|
-
filters: Object.freeze(f)
|
|
48
|
-
}),
|
|
49
|
-
contract: Object.freeze(s),
|
|
50
|
-
migrate: e.migrate
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
const U = "from";
|
|
54
|
-
function X(e, t) {
|
|
55
|
-
if (typeof e == "string") {
|
|
56
|
-
const s = new URLSearchParams(t).toString(), r = e.indexOf("#"), o = r === -1 ? e : e.slice(0, r);
|
|
57
|
-
return `${o}${o.includes("?") ? "&" : "?"}${s}${r === -1 ? "" : e.slice(r)}`;
|
|
58
|
-
}
|
|
59
|
-
return { ...e, query: { ...e.query, ...t } };
|
|
60
|
-
}
|
|
61
|
-
function P(e) {
|
|
62
|
-
if (!$()) return;
|
|
63
|
-
const t = z(j, null);
|
|
64
|
-
t && O(
|
|
65
|
-
() => {
|
|
66
|
-
const s = t.session.state.value;
|
|
67
|
-
return s.status === "authenticated" ? s.user.id : null;
|
|
68
|
-
},
|
|
69
|
-
e,
|
|
70
|
-
{ flush: "sync" }
|
|
71
|
-
);
|
|
72
|
-
}
|
|
73
|
-
const I = 4096, T = 200, _ = 32, k = 1e6, b = /^[A-Za-z0-9_.-]{1,64}$/;
|
|
74
|
-
function C(e) {
|
|
75
|
-
let t = "";
|
|
76
|
-
for (const s of new TextEncoder().encode(e)) t += String.fromCharCode(s);
|
|
77
|
-
return btoa(t).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
|
|
78
|
-
}
|
|
79
|
-
function N(e) {
|
|
80
|
-
const t = e.replace(/-/g, "+").replace(/_/g, "/"), s = atob(t.padEnd(Math.ceil(t.length / 4) * 4, "="));
|
|
81
|
-
return new TextDecoder("utf-8", { fatal: !0 }).decode(Uint8Array.from(s, (r) => r.charCodeAt(0)));
|
|
82
|
-
}
|
|
83
|
-
const m = (e) => typeof e == "object" && e !== null && !Array.isArray(e);
|
|
84
|
-
function h(e, t = T) {
|
|
85
|
-
return typeof e == "string" && e.length <= t ? e : null;
|
|
86
|
-
}
|
|
87
|
-
function d(e, t, s) {
|
|
88
|
-
const { contract: r } = e, o = s ?? e.defaults, c = typeof t.p == "number" && Number.isInteger(t.p) && t.p >= 1 && t.p <= k ? t.p : o.page, i = typeof t.l == "number" && r.pageSizes.includes(t.l) ? t.l : o.pageSize;
|
|
89
|
-
let f = o.sort;
|
|
90
|
-
const l = h(t.c, 64);
|
|
91
|
-
l !== null && (r.sorts ? r.sorts.includes(l) : b.test(l)) && (f = l);
|
|
92
|
-
const a = t.d === "asc" || t.d === "desc" ? t.d : o.direction, n = h(t.s) ?? o.search;
|
|
93
|
-
let p = o.view;
|
|
94
|
-
const u = h(t.w, 64);
|
|
95
|
-
t.w === "" ? p = null : u !== null && (r.views ? r.views.includes(u) : b.test(u)) && (p = u);
|
|
96
|
-
const S = m(t.f) ? {} : { ...o.filters };
|
|
97
|
-
if (m(t.f)) {
|
|
98
|
-
let E = 0;
|
|
99
|
-
for (const [g, w] of Object.entries(t.f)) {
|
|
100
|
-
if (++E > _) break;
|
|
101
|
-
if (!(r.filters ? r.filters.includes(g) : b.test(g)) || r.sensitive.includes(g)) continue;
|
|
102
|
-
const y = typeof w == "number" || typeof w == "boolean" ? String(w) : h(w);
|
|
103
|
-
y !== null && y !== "" && (S[g] = y);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
return { page: c, pageSize: i, sort: f, direction: a, search: n, view: p, filters: S };
|
|
107
|
-
}
|
|
108
|
-
function R(e, t, s) {
|
|
109
|
-
const r = { v: e.stateVersion, p: t.page, l: t.pageSize };
|
|
110
|
-
t.sort && (r.c = t.sort), r.d = t.direction, (t.search || s && e.defaults.search !== s.search) && (r.s = t.search), (t.view || s && e.defaults.view !== s.view) && (r.w = t.view ?? "");
|
|
111
|
-
const o = Object.fromEntries(
|
|
112
|
-
Object.entries(t.filters).filter(([c, i]) => i !== void 0 && i !== "" && !e.contract.sensitive.includes(c))
|
|
113
|
-
);
|
|
114
|
-
return (Object.keys(o).length > 0 || Object.keys(e.defaults.filters).length > 0 || Object.keys(s?.filters ?? {}).length > 0) && (r.f = o), C(JSON.stringify(r));
|
|
115
|
-
}
|
|
116
|
-
function V(e, t, s) {
|
|
117
|
-
const r = t.v === void 0 ? e.stateVersion : t.v;
|
|
118
|
-
if (typeof r != "number" || !Number.isInteger(r)) return null;
|
|
119
|
-
if (r === e.stateVersion) return d(e, t, s);
|
|
120
|
-
const o = e.migrate?.(t, r);
|
|
121
|
-
return o ? d(e, o, s) : null;
|
|
122
|
-
}
|
|
123
|
-
function q(e, t, s) {
|
|
124
|
-
if (typeof t != "string" || t === "" || t.length > I) return null;
|
|
125
|
-
let r;
|
|
126
|
-
try {
|
|
127
|
-
r = JSON.parse(N(t));
|
|
128
|
-
} catch {
|
|
129
|
-
return null;
|
|
130
|
-
}
|
|
131
|
-
return m(r) ? V(e, r, s) : null;
|
|
132
|
-
}
|
|
133
|
-
function F(e) {
|
|
134
|
-
return JSON.stringify([
|
|
135
|
-
e.page,
|
|
136
|
-
e.pageSize,
|
|
137
|
-
e.sort,
|
|
138
|
-
e.direction,
|
|
139
|
-
e.search,
|
|
140
|
-
e.view,
|
|
141
|
-
Object.entries(e.filters).sort(([t], [s]) => t.localeCompare(s))
|
|
142
|
-
]);
|
|
143
|
-
}
|
|
144
|
-
export {
|
|
145
|
-
A as D,
|
|
146
|
-
U as L,
|
|
147
|
-
M as a,
|
|
148
|
-
q as d,
|
|
149
|
-
R as e,
|
|
150
|
-
P as o,
|
|
151
|
-
F as q,
|
|
152
|
-
V as r,
|
|
153
|
-
X as w
|
|
154
|
-
};
|