@septkit/ui 0.0.93 → 0.0.94
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/dist/context-menu/context-menu.vue_vue_type_script_setup_true_lang.js +41 -25
- package/dist/dialecte/create-document-store.js +4 -4
- package/dist/external/.pnpm/{@dialecte_core@0.12.1/node_modules/@dialecte/core/dist/dialecte-DHj8__Ch.js → @dialecte_core@0.14.0/node_modules/@dialecte/core/dist/dialecte-BEbOM6IE.js} +1808 -1564
- package/dist/external/.pnpm/{@dialecte_core@0.12.1/node_modules/@dialecte/core/dist/helpers-Bfv2XDC-.js → @dialecte_core@0.14.0/node_modules/@dialecte/core/dist/helpers-v10NItuU.js} +82 -82
- package/dist/external/.pnpm/@dialecte_core@0.14.0/node_modules/@dialecte/core/dist/index.js +6 -0
- package/dist/external/.pnpm/{@dialecte_core@0.12.1/node_modules/@dialecte/core/dist/open-connections-ClJo0-Af.js → @dialecte_core@0.14.0/node_modules/@dialecte/core/dist/open-connections-CWORY1A2.js} +2 -2
- package/dist/external/.pnpm/{@dialecte_core@0.12.1/node_modules/@dialecte/core/dist/project-key-DD8DyQ8-.js → @dialecte_core@0.14.0/node_modules/@dialecte/core/dist/project-key-WGrHzudb.js} +199 -199
- package/dist/external/.pnpm/{@dialecte_core@0.12.1/node_modules/@dialecte/core/dist/qname-definition-C6GUFWL8.js → @dialecte_core@0.14.0/node_modules/@dialecte/core/dist/qname-definition-Cnw9CbiG.js} +8 -8
- package/dist/external/.pnpm/{@dialecte_core@0.12.1 → @dialecte_core@0.14.0}/node_modules/@dialecte/core/dist/rolldown-runtime-CYdcPHCu.js +1 -1
- package/dist/external/.pnpm/{@dialecte_core@0.12.1/node_modules/@dialecte/core/dist/same-json-value-DTtSsGUF.js → @dialecte_core@0.14.0/node_modules/@dialecte/core/dist/same-json-value-Co-vqEAg.js} +66 -66
- package/dist/external/.pnpm/{@dialecte_core@0.12.1/node_modules/@dialecte/core/dist/utils-Q5zsKl3Y.js → @dialecte_core@0.14.0/node_modules/@dialecte/core/dist/utils-9L5_yIvs.js} +2 -2
- package/dist/external/.pnpm/@dialecte_core@0.14.0/node_modules/@dialecte/core/dist/utils.js +2 -0
- package/dist/index.d.ts +2 -0
- package/package.json +3 -3
- package/dist/external/.pnpm/@dialecte_core@0.12.1/node_modules/@dialecte/core/dist/index.js +0 -6
- package/dist/external/.pnpm/@dialecte_core@0.12.1/node_modules/@dialecte/core/dist/utils.js +0 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as _, r as v } from "./qname-definition-
|
|
3
|
-
//#region node_modules/.pnpm/@dialecte+core@0.
|
|
1
|
+
import { $ as e, D as t, M as n, N as r, P as i, Q as a, ct as o, g as s, it as c, nt as l, o as u, p as d, q as f, tt as p, v as m, w as h, x as g } from "./utils-9L5_yIvs.js";
|
|
2
|
+
import { n as _, r as v } from "./qname-definition-Cnw9CbiG.js";
|
|
3
|
+
//#region node_modules/.pnpm/@dialecte+core@0.14.0/node_modules/@dialecte/core/dist/project-key-WGrHzudb.js
|
|
4
4
|
var ee = {
|
|
5
5
|
bigint: "a BigInt",
|
|
6
6
|
function: "a function",
|
|
@@ -8,21 +8,21 @@ var ee = {
|
|
|
8
8
|
}, y = "not well-formed UTF-16 (a lone surrogate)", te = `text that is ${y}`, b = `a key that is ${y}`;
|
|
9
9
|
function ne(e) {
|
|
10
10
|
let { documentId: t } = e;
|
|
11
|
-
|
|
11
|
+
o("STORE_DUPLICATE_ID", {
|
|
12
12
|
detail: `Document "${t}" is already registered`,
|
|
13
13
|
meta: { documentId: t }
|
|
14
14
|
});
|
|
15
15
|
}
|
|
16
16
|
function re(e) {
|
|
17
17
|
let { path: t, reason: n } = e;
|
|
18
|
-
|
|
18
|
+
o("DOCUMENT_PATH_INVALID", {
|
|
19
19
|
detail: `The document path ${JSON.stringify(t)} is refused: ${n}`,
|
|
20
20
|
meta: { path: t }
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
function ie(e) {
|
|
24
24
|
let { documentId: t, path: n, takenBy: r } = e;
|
|
25
|
-
|
|
25
|
+
o("DOCUMENT_PATH_TAKEN", {
|
|
26
26
|
detail: `Document "${t}" cannot take the path "${n}": document "${r}" holds that place`,
|
|
27
27
|
meta: {
|
|
28
28
|
documentId: t,
|
|
@@ -33,14 +33,14 @@ function ie(e) {
|
|
|
33
33
|
}
|
|
34
34
|
function ae(e) {
|
|
35
35
|
let { documentId: t, what: n } = e;
|
|
36
|
-
|
|
36
|
+
o("DOCUMENT_NOT_REGISTERED", {
|
|
37
37
|
detail: `Cannot write ${n} to document "${t}": it is not registered`,
|
|
38
38
|
meta: { documentId: t }
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
41
|
function oe(e) {
|
|
42
42
|
let { documentId: t, recordId: n } = e;
|
|
43
|
-
|
|
43
|
+
o("STORE_RECORD_NOT_FOUND", {
|
|
44
44
|
detail: `Record "${n}" is not in document "${t}": nothing to update`,
|
|
45
45
|
meta: {
|
|
46
46
|
documentId: t,
|
|
@@ -50,7 +50,7 @@ function oe(e) {
|
|
|
50
50
|
}
|
|
51
51
|
function se(e) {
|
|
52
52
|
let { documentId: t, held: n, repeated: r, cause: i } = e;
|
|
53
|
-
|
|
53
|
+
o("STORE_DUPLICATE_ID", {
|
|
54
54
|
detail: `Document "${t}" refuses ids to create - ${[n.length > 0 ? `already holds: ${x(n).join(", ")}` : void 0, r.length > 0 ? `given twice: ${x(r).join(", ")}` : void 0].filter((e) => e !== void 0).join("; ")}`,
|
|
55
55
|
meta: {
|
|
56
56
|
documentId: t,
|
|
@@ -64,7 +64,7 @@ function x(e) {
|
|
|
64
64
|
}
|
|
65
65
|
function ce(e) {
|
|
66
66
|
let { storeName: t, connections: n } = e;
|
|
67
|
-
|
|
67
|
+
o("PROJECT_OPEN_ELSEWHERE", {
|
|
68
68
|
detail: `Project "${t}" cannot be destroyed while another connection has it open: close that one first`,
|
|
69
69
|
meta: {
|
|
70
70
|
project: t,
|
|
@@ -74,7 +74,7 @@ function ce(e) {
|
|
|
74
74
|
}
|
|
75
75
|
function le(e) {
|
|
76
76
|
let { storeName: t } = e;
|
|
77
|
-
|
|
77
|
+
o("STORE_CLOSED", {
|
|
78
78
|
detail: `Store "${t}" is closed: open it again before using it`,
|
|
79
79
|
meta: { storeName: t }
|
|
80
80
|
});
|
|
@@ -95,7 +95,7 @@ function fe() {
|
|
|
95
95
|
}
|
|
96
96
|
function pe(e) {
|
|
97
97
|
let { field: t, value: n } = e;
|
|
98
|
-
n ??
|
|
98
|
+
n ?? o("STORE_VALUE_NOT_JSON", { detail: `The ${t} is missing` }), typeof n != "string" && o("STORE_VALUE_NOT_JSON", { detail: `The ${t} is not text` }), ue({ value: { [t]: n } });
|
|
99
99
|
}
|
|
100
100
|
function me(e) {
|
|
101
101
|
return he({ walk: function() {
|
|
@@ -112,7 +112,7 @@ function he(e) {
|
|
|
112
112
|
return e.walk();
|
|
113
113
|
} catch (e) {
|
|
114
114
|
let t = e instanceof Error ? e : void 0;
|
|
115
|
-
|
|
115
|
+
o("STORE_VALUE_NOT_JSON", {
|
|
116
116
|
detail: t?.message ?? String(e),
|
|
117
117
|
cause: t
|
|
118
118
|
});
|
|
@@ -320,7 +320,7 @@ function De(e) {
|
|
|
320
320
|
}
|
|
321
321
|
function Oe(e) {
|
|
322
322
|
let { project: t, dialecteId: n } = e;
|
|
323
|
-
(Te.includes(t) || n !== void 0 && Te.includes(n)) &&
|
|
323
|
+
(Te.includes(t) || n !== void 0 && Te.includes(n)) && o("PROJECT_NAME_INVALID", {
|
|
324
324
|
detail: `A project cannot be named ${JSON.stringify(t)}${n === void 0 ? "" : ` in dialecte ${JSON.stringify(n)}`}: neither its name nor its dialecte's id may be empty, \`.\` or \`..\``,
|
|
325
325
|
meta: {
|
|
326
326
|
project: t,
|
|
@@ -488,7 +488,7 @@ function Ne(e) {
|
|
|
488
488
|
return t.tagName === n.rootElementName && t.parent === null;
|
|
489
489
|
}
|
|
490
490
|
var Pe = "_temp-idb-id", Fe = {
|
|
491
|
-
namespaceURI:
|
|
491
|
+
namespaceURI: f,
|
|
492
492
|
prefix: null,
|
|
493
493
|
localName: "xmlns",
|
|
494
494
|
value: ""
|
|
@@ -707,16 +707,16 @@ function H(e) {
|
|
|
707
707
|
});
|
|
708
708
|
}
|
|
709
709
|
function nt(e) {
|
|
710
|
-
let { config: t, rootUri: n } = e, r = Object.values(t.namespaces).map((e) => e.prefix).filter((e) => e !== ""), i = !r.includes("xs"),
|
|
710
|
+
let { config: t, rootUri: n } = e, r = Object.values(t.namespaces).map((e) => e.prefix).filter((e) => e !== ""), i = !r.includes("xs"), o = /* @__PURE__ */ new Set([
|
|
711
711
|
...r,
|
|
712
|
-
|
|
712
|
+
a.prefix,
|
|
713
713
|
"xml",
|
|
714
714
|
"xmlns"
|
|
715
715
|
]);
|
|
716
|
-
return i &&
|
|
716
|
+
return i && o.add("xs"), {
|
|
717
717
|
bindings: /* @__PURE__ */ new Map(),
|
|
718
718
|
prefixByUri: /* @__PURE__ */ new Map(),
|
|
719
|
-
reserved:
|
|
719
|
+
reserved: o,
|
|
720
720
|
xsdTakesXs: i,
|
|
721
721
|
nextGenerated: 1,
|
|
722
722
|
defaultOnRoot: n !== "",
|
|
@@ -777,24 +777,24 @@ function W(e) {
|
|
|
777
777
|
};
|
|
778
778
|
}
|
|
779
779
|
function rt(e) {
|
|
780
|
-
let { table: t, config: n } = e, { prefixByUri: r } = t, i = t.bindings.get(""),
|
|
781
|
-
i &&
|
|
780
|
+
let { table: t, config: n } = e, { prefixByUri: r } = t, i = t.bindings.get(""), o = [];
|
|
781
|
+
i && o.push(K({
|
|
782
782
|
uri: i,
|
|
783
783
|
prefix: ""
|
|
784
|
-
})), t.alias !== void 0 &&
|
|
784
|
+
})), t.alias !== void 0 && o.push(K({
|
|
785
785
|
uri: n.namespaces.default.uri,
|
|
786
786
|
prefix: t.alias
|
|
787
787
|
}));
|
|
788
788
|
let s = [];
|
|
789
|
-
r.has(
|
|
789
|
+
r.has(a.uri) && s.push(a.uri);
|
|
790
790
|
let c = /* @__PURE__ */ new Set();
|
|
791
|
-
for (let e of Object.values(n.namespaces)) c.add(e.uri), e.uri !== n.namespaces.default.uri && e.uri !==
|
|
792
|
-
let l = [...r.keys()].filter((e) => e !== i && e !==
|
|
793
|
-
for (let e of [...s, ...l])
|
|
791
|
+
for (let e of Object.values(n.namespaces)) c.add(e.uri), e.uri !== n.namespaces.default.uri && e.uri !== a.uri && r.has(e.uri) && !s.includes(e.uri) && s.push(e.uri);
|
|
792
|
+
let l = [...r.keys()].filter((e) => e !== i && e !== a.uri && !c.has(e)).sort(ct);
|
|
793
|
+
for (let e of [...s, ...l]) o.push(K({
|
|
794
794
|
uri: e,
|
|
795
795
|
prefix: r.get(e) ?? ""
|
|
796
796
|
}));
|
|
797
|
-
return
|
|
797
|
+
return o;
|
|
798
798
|
}
|
|
799
799
|
function it(e) {
|
|
800
800
|
let { table: t, config: n, documentRoot: r, element: i } = e;
|
|
@@ -815,27 +815,27 @@ function it(e) {
|
|
|
815
815
|
return a.attributes.slice(i.attributes.length);
|
|
816
816
|
}
|
|
817
817
|
function at(e) {
|
|
818
|
-
let { table: t, config: n, uri: r, storedPrefix: i } = e,
|
|
818
|
+
let { table: t, config: n, uri: r, storedPrefix: i } = e, o = t.nextGenerated;
|
|
819
819
|
if (r === n.namespaces.default.uri) return {
|
|
820
820
|
prefix: "",
|
|
821
|
-
nextGenerated:
|
|
821
|
+
nextGenerated: o
|
|
822
822
|
};
|
|
823
823
|
let s = Object.values(n.namespaces).find((e) => e.uri === r && e.prefix !== "");
|
|
824
824
|
return s ? {
|
|
825
825
|
prefix: s.prefix,
|
|
826
|
-
nextGenerated:
|
|
827
|
-
} : r ===
|
|
828
|
-
prefix:
|
|
829
|
-
nextGenerated:
|
|
826
|
+
nextGenerated: o
|
|
827
|
+
} : r === a.uri ? {
|
|
828
|
+
prefix: a.prefix,
|
|
829
|
+
nextGenerated: o
|
|
830
830
|
} : r === "http://www.w3.org/2001/XMLSchema" && t.xsdTakesXs ? {
|
|
831
831
|
prefix: "xs",
|
|
832
|
-
nextGenerated:
|
|
832
|
+
nextGenerated: o
|
|
833
833
|
} : i ? {
|
|
834
834
|
prefix: ot({
|
|
835
835
|
table: t,
|
|
836
836
|
storedPrefix: i
|
|
837
837
|
}),
|
|
838
|
-
nextGenerated:
|
|
838
|
+
nextGenerated: o
|
|
839
839
|
} : st({ table: t });
|
|
840
840
|
}
|
|
841
841
|
function ot(e) {
|
|
@@ -870,14 +870,14 @@ function G(e) {
|
|
|
870
870
|
return !t.reserved.has(n) && !t.bindings.has(n);
|
|
871
871
|
}
|
|
872
872
|
function K(e) {
|
|
873
|
-
let { uri: t, prefix:
|
|
874
|
-
return
|
|
875
|
-
namespaceURI:
|
|
873
|
+
let { uri: t, prefix: n } = e;
|
|
874
|
+
return n ? {
|
|
875
|
+
namespaceURI: f,
|
|
876
876
|
prefix: "xmlns",
|
|
877
|
-
localName:
|
|
877
|
+
localName: n,
|
|
878
878
|
value: t
|
|
879
879
|
} : {
|
|
880
|
-
namespaceURI:
|
|
880
|
+
namespaceURI: f,
|
|
881
881
|
prefix: null,
|
|
882
882
|
localName: "xmlns",
|
|
883
883
|
value: t
|
|
@@ -886,47 +886,47 @@ function K(e) {
|
|
|
886
886
|
function ct(e, t) {
|
|
887
887
|
return e === t ? 0 : e < t ? -1 : 1;
|
|
888
888
|
}
|
|
889
|
-
function lt(
|
|
890
|
-
let { config:
|
|
891
|
-
dialecteConfig:
|
|
892
|
-
record:
|
|
893
|
-
})?.attributes.details ?? {},
|
|
894
|
-
for (let [e,
|
|
895
|
-
let
|
|
896
|
-
dialecteConfig:
|
|
897
|
-
record:
|
|
889
|
+
function lt(e) {
|
|
890
|
+
let { config: t, element: n, namespace: r, rootRecord: i } = e, a = h({
|
|
891
|
+
dialecteConfig: t,
|
|
892
|
+
record: i
|
|
893
|
+
})?.attributes.details ?? {}, o = r.uri === t.namespaces.default.uri;
|
|
894
|
+
for (let [e, s] of Object.entries(a)) {
|
|
895
|
+
let a = g({
|
|
896
|
+
dialecteConfig: t,
|
|
897
|
+
record: i,
|
|
898
898
|
attributeName: e,
|
|
899
899
|
defaults: "required"
|
|
900
900
|
});
|
|
901
|
-
if (
|
|
902
|
-
let
|
|
903
|
-
(
|
|
904
|
-
element:
|
|
905
|
-
namespaceURI:
|
|
906
|
-
localName:
|
|
901
|
+
if (a === void 0 || !(o ? !s.namespace : s.namespace?.prefix === r.prefix && s.namespace?.uri === r.uri)) continue;
|
|
902
|
+
let c = m(e);
|
|
903
|
+
(s.namespace ? P({
|
|
904
|
+
element: n,
|
|
905
|
+
namespaceURI: s.namespace.uri,
|
|
906
|
+
localName: c
|
|
907
907
|
}) : N({
|
|
908
|
-
element:
|
|
909
|
-
qualifiedName:
|
|
910
|
-
})) || (
|
|
911
|
-
element:
|
|
912
|
-
namespaceURI:
|
|
913
|
-
qualifiedName: `${
|
|
914
|
-
value:
|
|
908
|
+
element: n,
|
|
909
|
+
qualifiedName: c
|
|
910
|
+
})) || (s.namespace ? M({
|
|
911
|
+
element: n,
|
|
912
|
+
namespaceURI: s.namespace.uri,
|
|
913
|
+
qualifiedName: `${s.namespace.prefix}:${c}`,
|
|
914
|
+
value: a
|
|
915
915
|
}) : j({
|
|
916
|
-
element:
|
|
917
|
-
qualifiedName:
|
|
918
|
-
value:
|
|
916
|
+
element: n,
|
|
917
|
+
qualifiedName: c,
|
|
918
|
+
value: a
|
|
919
919
|
}));
|
|
920
920
|
}
|
|
921
921
|
}
|
|
922
922
|
function ut(e) {
|
|
923
|
-
let { settings: t, table: n, record: r, parent: i } = e, { config: a, declareNamespaces: o, withDatabaseIds: s } = t, c = o &&
|
|
923
|
+
let { settings: t, table: n, record: r, parent: i } = e, { config: a, declareNamespaces: o, withDatabaseIds: s } = t, c = o && l({
|
|
924
924
|
dialecteConfig: a,
|
|
925
925
|
tagName: r.tagName
|
|
926
|
-
}),
|
|
926
|
+
}), u = o && i !== void 0, d = u || c ? v({
|
|
927
927
|
dialecteConfig: a,
|
|
928
928
|
record: r
|
|
929
|
-
}) : void 0,
|
|
929
|
+
}) : void 0, f = dt({
|
|
930
930
|
settings: t,
|
|
931
931
|
table: n,
|
|
932
932
|
record: r,
|
|
@@ -934,42 +934,42 @@ function ut(e) {
|
|
|
934
934
|
holdsNoNamespaceName: o && bt({
|
|
935
935
|
config: a,
|
|
936
936
|
record: r,
|
|
937
|
-
definition:
|
|
937
|
+
definition: d
|
|
938
938
|
})
|
|
939
|
-
}), { element:
|
|
939
|
+
}), { element: p } = f, m = pt({
|
|
940
940
|
settings: t,
|
|
941
|
-
table:
|
|
942
|
-
element:
|
|
941
|
+
table: f.table,
|
|
942
|
+
element: p,
|
|
943
943
|
attributes: r.attributes
|
|
944
|
-
}),
|
|
945
|
-
if (
|
|
944
|
+
}), h = r.value;
|
|
945
|
+
if (d !== void 0 && c) {
|
|
946
946
|
let e = _t({
|
|
947
947
|
settings: t,
|
|
948
|
-
table:
|
|
949
|
-
element:
|
|
948
|
+
table: m,
|
|
949
|
+
element: p,
|
|
950
950
|
record: r,
|
|
951
|
-
definition:
|
|
951
|
+
definition: d
|
|
952
952
|
});
|
|
953
|
-
|
|
953
|
+
m = e.table, h = e.text;
|
|
954
954
|
}
|
|
955
|
-
return
|
|
955
|
+
return d !== void 0 && u && (m = ht({
|
|
956
956
|
settings: t,
|
|
957
|
-
table:
|
|
958
|
-
element:
|
|
957
|
+
table: m,
|
|
958
|
+
element: p,
|
|
959
959
|
record: r,
|
|
960
|
-
definition:
|
|
960
|
+
definition: d
|
|
961
961
|
})), s && j({
|
|
962
|
-
element:
|
|
962
|
+
element: p,
|
|
963
963
|
qualifiedName: "_temp-idb-id",
|
|
964
964
|
value: r.id
|
|
965
|
-
}), o && (
|
|
965
|
+
}), o && (m = gt({
|
|
966
966
|
settings: t,
|
|
967
|
-
table:
|
|
968
|
-
element:
|
|
967
|
+
table: m,
|
|
968
|
+
element: p
|
|
969
969
|
})), {
|
|
970
|
-
element:
|
|
971
|
-
table:
|
|
972
|
-
text:
|
|
970
|
+
element: p,
|
|
971
|
+
table: m,
|
|
972
|
+
text: h
|
|
973
973
|
};
|
|
974
974
|
}
|
|
975
975
|
function dt(e) {
|
|
@@ -1038,7 +1038,7 @@ function pt(e) {
|
|
|
1038
1038
|
});
|
|
1039
1039
|
continue;
|
|
1040
1040
|
}
|
|
1041
|
-
let a =
|
|
1041
|
+
let a = m(e.name);
|
|
1042
1042
|
t.declareNamespaces ? i = mt({
|
|
1043
1043
|
settings: t,
|
|
1044
1044
|
table: i,
|
|
@@ -1080,61 +1080,61 @@ function mt(e) {
|
|
|
1080
1080
|
}
|
|
1081
1081
|
function ht(e) {
|
|
1082
1082
|
let { settings: t, element: n, record: r, definition: i } = e, { config: a } = t, { table: o } = e;
|
|
1083
|
-
for (let [e,
|
|
1084
|
-
let i =
|
|
1083
|
+
for (let [e, s] of Object.entries(i.attributes.details)) {
|
|
1084
|
+
let i = g({
|
|
1085
1085
|
dialecteConfig: a,
|
|
1086
1086
|
record: r,
|
|
1087
1087
|
attributeName: e,
|
|
1088
1088
|
defaults: "required"
|
|
1089
1089
|
});
|
|
1090
1090
|
if (i === void 0) continue;
|
|
1091
|
-
let
|
|
1092
|
-
(
|
|
1091
|
+
let c = m(e);
|
|
1092
|
+
(s.namespace ? P({
|
|
1093
1093
|
element: n,
|
|
1094
|
-
namespaceURI:
|
|
1095
|
-
localName:
|
|
1094
|
+
namespaceURI: s.namespace.uri,
|
|
1095
|
+
localName: c
|
|
1096
1096
|
}) : N({
|
|
1097
1097
|
element: n,
|
|
1098
|
-
qualifiedName:
|
|
1099
|
-
})) || (
|
|
1098
|
+
qualifiedName: c
|
|
1099
|
+
})) || (s.namespace && s.namespace.prefix ? o = mt({
|
|
1100
1100
|
settings: t,
|
|
1101
1101
|
table: o,
|
|
1102
1102
|
element: n,
|
|
1103
|
-
namespace:
|
|
1104
|
-
localName:
|
|
1103
|
+
namespace: s.namespace,
|
|
1104
|
+
localName: c,
|
|
1105
1105
|
value: i
|
|
1106
1106
|
}) : j({
|
|
1107
1107
|
element: n,
|
|
1108
|
-
qualifiedName:
|
|
1108
|
+
qualifiedName: c,
|
|
1109
1109
|
value: i
|
|
1110
1110
|
}));
|
|
1111
1111
|
}
|
|
1112
1112
|
return o;
|
|
1113
1113
|
}
|
|
1114
1114
|
function gt(e) {
|
|
1115
|
-
let { settings: t, table: n, element: r } = e, { config: i } = t,
|
|
1115
|
+
let { settings: t, table: n, element: r } = e, { config: i } = t, o = qe({
|
|
1116
1116
|
element: r,
|
|
1117
|
-
namespaceURI:
|
|
1117
|
+
namespaceURI: a.uri,
|
|
1118
1118
|
localName: "type"
|
|
1119
1119
|
});
|
|
1120
|
-
if (
|
|
1120
|
+
if (o === null) return n;
|
|
1121
1121
|
let s = vt({
|
|
1122
1122
|
settings: t,
|
|
1123
1123
|
table: n,
|
|
1124
1124
|
element: r,
|
|
1125
|
-
value:
|
|
1125
|
+
value: o,
|
|
1126
1126
|
notation: !1
|
|
1127
1127
|
});
|
|
1128
1128
|
if (s === void 0) return n;
|
|
1129
1129
|
let c = U({
|
|
1130
1130
|
table: s.table,
|
|
1131
1131
|
config: i,
|
|
1132
|
-
uri:
|
|
1133
|
-
storedPrefix:
|
|
1132
|
+
uri: a.uri,
|
|
1133
|
+
storedPrefix: a.prefix
|
|
1134
1134
|
});
|
|
1135
1135
|
return M({
|
|
1136
1136
|
element: r,
|
|
1137
|
-
namespaceURI:
|
|
1137
|
+
namespaceURI: a.uri,
|
|
1138
1138
|
qualifiedName: `${c.prefix}:type`,
|
|
1139
1139
|
value: s.value
|
|
1140
1140
|
}), c.table;
|
|
@@ -1146,7 +1146,7 @@ function _t(e) {
|
|
|
1146
1146
|
definition: i,
|
|
1147
1147
|
attribute: e
|
|
1148
1148
|
});
|
|
1149
|
-
if (r === void 0 || !
|
|
1149
|
+
if (r === void 0 || !c(r)) continue;
|
|
1150
1150
|
let o = q({
|
|
1151
1151
|
settings: t,
|
|
1152
1152
|
table: a,
|
|
@@ -1157,7 +1157,7 @@ function _t(e) {
|
|
|
1157
1157
|
a = o.table, St(e) && e.namespace.prefix ? M({
|
|
1158
1158
|
element: n,
|
|
1159
1159
|
namespaceURI: e.namespace.uri,
|
|
1160
|
-
qualifiedName:
|
|
1160
|
+
qualifiedName: m(e.name),
|
|
1161
1161
|
value: o.value
|
|
1162
1162
|
}) : j({
|
|
1163
1163
|
element: n,
|
|
@@ -1166,11 +1166,11 @@ function _t(e) {
|
|
|
1166
1166
|
});
|
|
1167
1167
|
}
|
|
1168
1168
|
let o = i.textContent?.type;
|
|
1169
|
-
if (o === void 0 || !
|
|
1169
|
+
if (o === void 0 || !c(o) || r.value === "") return {
|
|
1170
1170
|
table: a,
|
|
1171
1171
|
text: r.value
|
|
1172
1172
|
};
|
|
1173
|
-
let
|
|
1173
|
+
let s = q({
|
|
1174
1174
|
settings: t,
|
|
1175
1175
|
table: a,
|
|
1176
1176
|
element: n,
|
|
@@ -1178,70 +1178,70 @@ function _t(e) {
|
|
|
1178
1178
|
value: r.value
|
|
1179
1179
|
});
|
|
1180
1180
|
return {
|
|
1181
|
-
table:
|
|
1182
|
-
text:
|
|
1181
|
+
table: s.table,
|
|
1182
|
+
text: s.value
|
|
1183
1183
|
};
|
|
1184
1184
|
}
|
|
1185
1185
|
function q(e) {
|
|
1186
|
-
let { settings: t, element:
|
|
1186
|
+
let { settings: t, element: a, value: o } = e, { table: s } = e, c = r({
|
|
1187
1187
|
type: e.type,
|
|
1188
|
-
value:
|
|
1188
|
+
value: o,
|
|
1189
1189
|
namespaceOf: i({ dialecteConfig: t.config })
|
|
1190
1190
|
});
|
|
1191
|
-
if (
|
|
1192
|
-
table:
|
|
1193
|
-
value:
|
|
1191
|
+
if (c === void 0) return {
|
|
1192
|
+
table: s,
|
|
1193
|
+
value: o
|
|
1194
1194
|
};
|
|
1195
|
-
if ("builtin" in
|
|
1196
|
-
let e =
|
|
1195
|
+
if ("builtin" in c) {
|
|
1196
|
+
let e = c.builtin === "NOTATION";
|
|
1197
1197
|
return vt({
|
|
1198
1198
|
settings: t,
|
|
1199
|
-
table:
|
|
1200
|
-
element:
|
|
1201
|
-
value:
|
|
1199
|
+
table: s,
|
|
1200
|
+
element: a,
|
|
1201
|
+
value: o,
|
|
1202
1202
|
notation: e
|
|
1203
1203
|
}) ?? {
|
|
1204
|
-
table:
|
|
1205
|
-
value:
|
|
1204
|
+
table: s,
|
|
1205
|
+
value: o
|
|
1206
1206
|
};
|
|
1207
1207
|
}
|
|
1208
|
-
let
|
|
1209
|
-
for (let e of
|
|
1210
|
-
let
|
|
1208
|
+
let l = [];
|
|
1209
|
+
for (let e of n(o)) {
|
|
1210
|
+
let n = q({
|
|
1211
1211
|
settings: t,
|
|
1212
|
-
table:
|
|
1213
|
-
element:
|
|
1214
|
-
type:
|
|
1212
|
+
table: s,
|
|
1213
|
+
element: a,
|
|
1214
|
+
type: c.list,
|
|
1215
1215
|
value: e
|
|
1216
1216
|
});
|
|
1217
|
-
|
|
1217
|
+
s = n.table, l.push(n.value);
|
|
1218
1218
|
}
|
|
1219
1219
|
return {
|
|
1220
|
-
table:
|
|
1221
|
-
value:
|
|
1220
|
+
table: s,
|
|
1221
|
+
value: l.join(" ")
|
|
1222
1222
|
};
|
|
1223
1223
|
}
|
|
1224
|
-
function vt(
|
|
1225
|
-
let { settings:
|
|
1224
|
+
function vt(t) {
|
|
1225
|
+
let { settings: n, table: r, element: a, value: o, notation: s } = t, c = e({
|
|
1226
1226
|
value: o,
|
|
1227
|
-
namespaceOf: i({ dialecteConfig:
|
|
1227
|
+
namespaceOf: i({ dialecteConfig: n.config })
|
|
1228
1228
|
});
|
|
1229
1229
|
if (c === void 0) return;
|
|
1230
1230
|
if (c.namespace === "") return F({
|
|
1231
|
-
element:
|
|
1231
|
+
element: a,
|
|
1232
1232
|
prefix: null
|
|
1233
1233
|
}) ? void 0 : {
|
|
1234
|
-
table:
|
|
1234
|
+
table: r,
|
|
1235
1235
|
value: c.local
|
|
1236
1236
|
};
|
|
1237
1237
|
let l = xt({
|
|
1238
|
-
settings:
|
|
1239
|
-
table:
|
|
1240
|
-
element:
|
|
1238
|
+
settings: n,
|
|
1239
|
+
table: r,
|
|
1240
|
+
element: a,
|
|
1241
1241
|
uri: c.namespace
|
|
1242
1242
|
}), u = s && l.prefix === "" && c.namespace !== "" ? W({
|
|
1243
1243
|
table: l.table,
|
|
1244
|
-
config:
|
|
1244
|
+
config: n.config,
|
|
1245
1245
|
storedPrefix: void 0
|
|
1246
1246
|
}) : l;
|
|
1247
1247
|
return {
|
|
@@ -1254,7 +1254,7 @@ function yt(e) {
|
|
|
1254
1254
|
return i ? n.namespace.uri === r.namespaces.default.uri ? bt({
|
|
1255
1255
|
config: r,
|
|
1256
1256
|
record: n,
|
|
1257
|
-
definition:
|
|
1257
|
+
definition: l({
|
|
1258
1258
|
dialecteConfig: r,
|
|
1259
1259
|
tagName: n.tagName
|
|
1260
1260
|
}) ? v({
|
|
@@ -1301,10 +1301,10 @@ function Ct(e) {
|
|
|
1301
1301
|
return e.name === "xmlns" || e.name.startsWith("xmlns:") ? !0 : e.namespace?.prefix === "xmlns";
|
|
1302
1302
|
}
|
|
1303
1303
|
function wt(e) {
|
|
1304
|
-
return
|
|
1304
|
+
return n(e).some((e) => e.startsWith("{}"));
|
|
1305
1305
|
}
|
|
1306
1306
|
function Tt(e) {
|
|
1307
|
-
let t =
|
|
1307
|
+
let t = s.exec(e.text);
|
|
1308
1308
|
if (t) return `U+${t[0].charCodeAt(0).toString(16).toUpperCase().padStart(4, "0")}`;
|
|
1309
1309
|
}
|
|
1310
1310
|
function Et(e) {
|
|
@@ -1313,8 +1313,8 @@ function Et(e) {
|
|
|
1313
1313
|
withId: n
|
|
1314
1314
|
});
|
|
1315
1315
|
if (!r) return;
|
|
1316
|
-
let { character: i, attribute: a, part:
|
|
1317
|
-
|
|
1316
|
+
let { character: i, attribute: a, part: s } = r;
|
|
1317
|
+
o("XML_CHARACTER_NOT_ALLOWED", {
|
|
1318
1318
|
detail: `${kt({
|
|
1319
1319
|
place: r,
|
|
1320
1320
|
element: t.tagName ? `<${t.tagName}> '${t.id}'` : `the record '${t.id}'`
|
|
@@ -1327,7 +1327,7 @@ function Et(e) {
|
|
|
1327
1327
|
recordId: t.id,
|
|
1328
1328
|
...t.tagName && { tagName: t.tagName },
|
|
1329
1329
|
...a && { attribute: a },
|
|
1330
|
-
part:
|
|
1330
|
+
part: s,
|
|
1331
1331
|
character: i
|
|
1332
1332
|
}
|
|
1333
1333
|
});
|
|
@@ -1475,7 +1475,7 @@ function At(e) {
|
|
|
1475
1475
|
});
|
|
1476
1476
|
}
|
|
1477
1477
|
function jt(e) {
|
|
1478
|
-
let { element: t, record: n, value: r, parent: i, rootScope: a, prefixes: o, indent: s } = e, c = r ?
|
|
1478
|
+
let { element: t, record: n, value: r, parent: i, rootScope: a, prefixes: o, indent: s } = e, c = r ? p({ text: r }) : "", l = i ? I({
|
|
1479
1479
|
element: t,
|
|
1480
1480
|
scope: i.scope,
|
|
1481
1481
|
prefixes: o
|
|
@@ -1555,108 +1555,108 @@ async function Rt(e, t = {}) {
|
|
|
1555
1555
|
signal: t.signal,
|
|
1556
1556
|
documentId: i
|
|
1557
1557
|
});
|
|
1558
|
-
let
|
|
1558
|
+
let s = await Bt({
|
|
1559
1559
|
source: n,
|
|
1560
1560
|
documentId: i
|
|
1561
|
-
}), { config:
|
|
1561
|
+
}), { config: c } = je({
|
|
1562
1562
|
configs: r.configs,
|
|
1563
1563
|
defaultConfigKey: r.defaultConfigKey,
|
|
1564
|
-
configKey:
|
|
1565
|
-
}),
|
|
1564
|
+
configKey: s.configKey
|
|
1565
|
+
}), l = zt({ options: e.options });
|
|
1566
1566
|
a.start("export");
|
|
1567
|
-
let
|
|
1567
|
+
let u;
|
|
1568
1568
|
try {
|
|
1569
1569
|
let n = await Vt({
|
|
1570
1570
|
...e,
|
|
1571
|
-
config:
|
|
1571
|
+
config: c,
|
|
1572
1572
|
control: t,
|
|
1573
1573
|
perf: a,
|
|
1574
|
-
batchSize:
|
|
1574
|
+
batchSize: l
|
|
1575
1575
|
});
|
|
1576
|
-
|
|
1576
|
+
u = n.status === "moved" ? await Vt({
|
|
1577
1577
|
...e,
|
|
1578
|
-
config:
|
|
1578
|
+
config: c,
|
|
1579
1579
|
control: t,
|
|
1580
1580
|
perf: a,
|
|
1581
|
-
batchSize:
|
|
1581
|
+
batchSize: l
|
|
1582
1582
|
}) : n;
|
|
1583
1583
|
} finally {
|
|
1584
1584
|
a.stop("export");
|
|
1585
1585
|
}
|
|
1586
|
-
return
|
|
1587
|
-
detail: `Document "${
|
|
1586
|
+
return u.status === "moved" && o("EXPORT_CONFLICT", {
|
|
1587
|
+
detail: `Document "${s.name}" changed twice while it was exported: export it again`,
|
|
1588
1588
|
meta: { documentId: i }
|
|
1589
1589
|
}), {
|
|
1590
|
-
file:
|
|
1591
|
-
filename: `${
|
|
1590
|
+
file: u.file,
|
|
1591
|
+
filename: `${s.name}${s.extension}`,
|
|
1592
1592
|
...r.perf && { perf: a.snapshot() }
|
|
1593
1593
|
};
|
|
1594
1594
|
}
|
|
1595
1595
|
function zt(e) {
|
|
1596
1596
|
let t = e.options?.batchSize ?? 2e3;
|
|
1597
|
-
return (!Number.isInteger(t) || t < 1) &&
|
|
1597
|
+
return (!Number.isInteger(t) || t < 1) && o("ASSERTION_FAILED", { detail: `An export batch size is a whole number from 1, not ${t}` }), t;
|
|
1598
1598
|
}
|
|
1599
1599
|
async function Bt(e) {
|
|
1600
1600
|
let { source: t, documentId: n } = e, r = await t.getDocument(n);
|
|
1601
1601
|
return r && r.status === "ready" || Q({ documentId: n }), r;
|
|
1602
1602
|
}
|
|
1603
1603
|
async function Vt(e) {
|
|
1604
|
-
let { source: t, documentId: n, options: r, config: i, control: a, perf:
|
|
1605
|
-
|
|
1606
|
-
let
|
|
1604
|
+
let { source: t, documentId: n, options: r, config: i, control: a, perf: s, batchSize: c } = e, l = await t.getExportVersion({ documentId: n });
|
|
1605
|
+
l === void 0 && Q({ documentId: n });
|
|
1606
|
+
let u = await t.count(n), d = await Ut({
|
|
1607
1607
|
source: t,
|
|
1608
1608
|
documentId: n,
|
|
1609
1609
|
config: i
|
|
1610
1610
|
});
|
|
1611
|
-
if (!
|
|
1611
|
+
if (!d) {
|
|
1612
1612
|
if (await Z({
|
|
1613
1613
|
source: t,
|
|
1614
1614
|
documentId: n,
|
|
1615
|
-
version:
|
|
1615
|
+
version: l
|
|
1616
1616
|
})) return { status: "moved" };
|
|
1617
|
-
|
|
1617
|
+
o("EXPORT_ROOT_NOT_FOUND", { detail: `No ${i.rootElementName} root element found in document "${n}"` });
|
|
1618
1618
|
}
|
|
1619
|
-
let
|
|
1619
|
+
let f = {
|
|
1620
1620
|
source: t,
|
|
1621
1621
|
documentId: n,
|
|
1622
|
-
version:
|
|
1623
|
-
totalRecords:
|
|
1622
|
+
version: l,
|
|
1623
|
+
totalRecords: u,
|
|
1624
1624
|
control: a,
|
|
1625
|
-
perf:
|
|
1625
|
+
perf: s,
|
|
1626
1626
|
writer: Y({
|
|
1627
1627
|
config: i,
|
|
1628
|
-
documentRoot:
|
|
1628
|
+
documentRoot: d,
|
|
1629
1629
|
indent: r?.indent,
|
|
1630
1630
|
withDatabaseIds: r?.withDatabaseIds
|
|
1631
1631
|
}),
|
|
1632
1632
|
parts: [],
|
|
1633
1633
|
recordsWritten: 0
|
|
1634
|
-
},
|
|
1635
|
-
pass:
|
|
1636
|
-
record:
|
|
1634
|
+
}, p = [Ht({
|
|
1635
|
+
pass: f,
|
|
1636
|
+
record: d,
|
|
1637
1637
|
config: i
|
|
1638
1638
|
})];
|
|
1639
|
-
if (
|
|
1640
|
-
for (;
|
|
1641
|
-
let e =
|
|
1639
|
+
if (f.recordsWritten % c === 0 && await X(f)) return { status: "moved" };
|
|
1640
|
+
for (; p.length > 0;) {
|
|
1641
|
+
let e = p.at(-1);
|
|
1642
1642
|
if (e.next >= e.childRefs.length) {
|
|
1643
|
-
|
|
1643
|
+
s.time("export::write", () => f.writer.closeElement()), p.pop();
|
|
1644
1644
|
continue;
|
|
1645
1645
|
}
|
|
1646
1646
|
if (e.next >= e.chunkStart + e.chunk.length) {
|
|
1647
|
-
let r = e.childRefs.slice(e.next, e.next +
|
|
1648
|
-
|
|
1647
|
+
let r = e.childRefs.slice(e.next, e.next + c).map(Gt);
|
|
1648
|
+
s.start("export::read");
|
|
1649
1649
|
try {
|
|
1650
1650
|
e.chunk = await t.getMany(r, n);
|
|
1651
1651
|
} finally {
|
|
1652
|
-
|
|
1652
|
+
s.stop("export::read");
|
|
1653
1653
|
}
|
|
1654
1654
|
e.chunkStart = e.next;
|
|
1655
1655
|
}
|
|
1656
1656
|
let r = e.childRefs[e.next], a = e.chunk[e.next - e.chunkStart];
|
|
1657
1657
|
if (e.next++, !a) {
|
|
1658
|
-
if (await Z(
|
|
1659
|
-
|
|
1658
|
+
if (await Z(f)) return { status: "moved" };
|
|
1659
|
+
o("EXPORT_ORPHAN_CHILD_REF", {
|
|
1660
1660
|
detail: `Parent '${e.record.tagName}' references non-existent child '${r.tagName}' (id: ${r.id})`,
|
|
1661
1661
|
ref: {
|
|
1662
1662
|
tagName: e.record.tagName,
|
|
@@ -1664,28 +1664,28 @@ async function Vt(e) {
|
|
|
1664
1664
|
}
|
|
1665
1665
|
});
|
|
1666
1666
|
}
|
|
1667
|
-
if (
|
|
1668
|
-
pass:
|
|
1667
|
+
if (p.push(Ht({
|
|
1668
|
+
pass: f,
|
|
1669
1669
|
record: a,
|
|
1670
1670
|
config: i
|
|
1671
|
-
})),
|
|
1671
|
+
})), f.recordsWritten % c === 0 && await X(f)) return { status: "moved" };
|
|
1672
1672
|
}
|
|
1673
|
-
if (Wt(
|
|
1674
|
-
|
|
1673
|
+
if (Wt(f), f.recordsWritten % c !== 0 && await X(f)) return { status: "moved" };
|
|
1674
|
+
s.start("export::assemble");
|
|
1675
1675
|
try {
|
|
1676
1676
|
return {
|
|
1677
1677
|
status: "written",
|
|
1678
|
-
file: new Blob([
|
|
1678
|
+
file: new Blob([f.writer.head(), ...f.parts], { type: "application/xml" })
|
|
1679
1679
|
};
|
|
1680
1680
|
} finally {
|
|
1681
|
-
|
|
1681
|
+
s.stop("export::assemble");
|
|
1682
1682
|
}
|
|
1683
1683
|
}
|
|
1684
1684
|
function Ht(e) {
|
|
1685
1685
|
let { pass: t, record: n, config: r } = e;
|
|
1686
1686
|
return t.perf.time("export::write", () => t.writer.openElement({ record: n })), t.recordsWritten++, {
|
|
1687
1687
|
record: n,
|
|
1688
|
-
childRefs:
|
|
1688
|
+
childRefs: u({
|
|
1689
1689
|
parentTagName: n.tagName,
|
|
1690
1690
|
children: n.children,
|
|
1691
1691
|
childrenConfig: r.children,
|
|
@@ -1731,14 +1731,14 @@ function Gt(e) {
|
|
|
1731
1731
|
}
|
|
1732
1732
|
function Q(e) {
|
|
1733
1733
|
let { documentId: t } = e;
|
|
1734
|
-
|
|
1734
|
+
o("DOCUMENT_NOT_REGISTERED", {
|
|
1735
1735
|
detail: `Document "${t}" is not registered, or not ready, in this store`,
|
|
1736
1736
|
meta: { documentId: t }
|
|
1737
1737
|
});
|
|
1738
1738
|
}
|
|
1739
1739
|
function $(e) {
|
|
1740
1740
|
let { signal: t, documentId: n } = e;
|
|
1741
|
-
t?.aborted &&
|
|
1741
|
+
t?.aborted && o("EXPORT_ABORTED", {
|
|
1742
1742
|
detail: `The export of document "${n}" was aborted`,
|
|
1743
1743
|
meta: { documentId: n }
|
|
1744
1744
|
});
|