@dialecte/core 0.9.0 → 0.10.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/dist/{dialecte-oAXwOG-Q.js → dialecte-CVLWSkgW.js} +1631 -1557
- package/dist/document/query/get/record/get-record.d.ts +14 -1
- package/dist/document/query/get/record/get-record.d.ts.map +1 -1
- package/dist/document/query/get/record/get-records.d.ts +12 -2
- package/dist/document/query/get/record/get-records.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/sqlite-engine.js +14 -10
- package/dist/store/sqlite/runtime/close-engine.d.ts +5 -2
- package/dist/store/sqlite/runtime/close-engine.d.ts.map +1 -1
- package/dist/store/sqlite/runtime/install-pool.d.ts.map +1 -1
- package/dist/store/sqlite/runtime/runtime.types.d.ts +3 -2
- package/dist/store/sqlite/runtime/runtime.types.d.ts.map +1 -1
- package/dist/test/assert-xml/assert-xml.d.ts +4 -2
- package/dist/test/assert-xml/assert-xml.d.ts.map +1 -1
- package/dist/test/assert-xml/index.d.ts +1 -0
- package/dist/test/assert-xml/index.d.ts.map +1 -1
- package/dist/test/assert-xml/xml-assertion-error.d.ts +8 -0
- package/dist/test/assert-xml/xml-assertion-error.d.ts.map +1 -0
- package/dist/test/indexeddb-storage.setup.d.ts +1 -0
- package/dist/test/indexeddb-storage.setup.d.ts.map +1 -0
- package/dist/test.js +154 -148
- package/package.json +40 -4
- package/skills/dialecte/SKILL.md +8 -6
- package/skills/dialecte/references/api.json +5 -5
- package/skills/dialecte/references/api.md +2 -2
- package/skills/dialecte/references/testing.md +167 -11
- package/skills/dialecte-contributing/SKILL.md +1 -1
- package/skills/dialecte-contributing/references/code-rules.md +7 -0
- package/skills/dialecte-contributing/references/landing-changes.md +4 -4
- package/skills/dialecte-lot/SKILL.md +67 -28
- package/skills/dialecte-lot/references/briefs.md +30 -6
- package/skills/dialecte-lot/references/standard-check.md +2 -2
- package/skills/dialecte-lot/references/stations.md +5 -3
package/dist/test.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { B as e, F as t, N as n, P as r, R as i, V as a, m as o, s, t as c, w as l } from "./utils-Cv4oHia0.js";
|
|
2
2
|
import { l as u, m as d, p as f } from "./helpers-D8p0KiJu.js";
|
|
3
|
-
import { B as p, K as m, X as h, n as g, z as _ } from "./dialecte-
|
|
3
|
+
import { B as p, K as m, X as h, n as g, z as _ } from "./dialecte-CVLWSkgW.js";
|
|
4
4
|
import { t as v } from "./engine-store-Deo9XNhr.js";
|
|
5
5
|
import { a as ee, s as te } from "./running-operations-DCKvzlU7.js";
|
|
6
6
|
import { m as y } from "./project-key-2ccZ-0gu.js";
|
|
@@ -2831,15 +2831,21 @@ function Rr(e) {
|
|
|
2831
2831
|
});
|
|
2832
2832
|
return [` ${t}`, ...r.split("\n").map((e) => `${lr}${e}`)];
|
|
2833
2833
|
}
|
|
2834
|
+
// src/test/assert-xml/xml-assertion-error.ts
|
|
2835
|
+
var zr = class extends Error {
|
|
2836
|
+
constructor(e) {
|
|
2837
|
+
super(e), this.name = "AssertionError";
|
|
2838
|
+
}
|
|
2839
|
+
};
|
|
2834
2840
|
// src/test/assert-xml/xpath-parser.ts
|
|
2835
|
-
function
|
|
2836
|
-
let t =
|
|
2841
|
+
function Br(e) {
|
|
2842
|
+
let t = Vr(e);
|
|
2837
2843
|
if (t.length === 0) return [e];
|
|
2838
2844
|
let n = [];
|
|
2839
2845
|
for (let r of t) n.push(e.slice(0, r));
|
|
2840
2846
|
return n.push(e), n;
|
|
2841
2847
|
}
|
|
2842
|
-
function
|
|
2848
|
+
function Vr(e) {
|
|
2843
2849
|
let t = [], n = 0, r = 0, i = null;
|
|
2844
2850
|
for (let a = 0; a < e.length; a++) {
|
|
2845
2851
|
let o = e[a];
|
|
@@ -2864,18 +2870,18 @@ function Br(e) {
|
|
|
2864
2870
|
return t;
|
|
2865
2871
|
}
|
|
2866
2872
|
// src/test/assert-xml/assert-xml.ts
|
|
2867
|
-
function
|
|
2868
|
-
let t =
|
|
2873
|
+
function Hr(e) {
|
|
2874
|
+
let t = Kr(e.namespaces);
|
|
2869
2875
|
return {
|
|
2870
2876
|
assertExpectedElementQueries(e) {
|
|
2871
|
-
|
|
2877
|
+
Gr({
|
|
2872
2878
|
xml: e.xml,
|
|
2873
2879
|
namespaces: t,
|
|
2874
2880
|
expectedQueries: e.queries
|
|
2875
2881
|
});
|
|
2876
2882
|
},
|
|
2877
2883
|
assertUnexpectedElementQueries(e) {
|
|
2878
|
-
|
|
2884
|
+
Gr({
|
|
2879
2885
|
xml: e.xml,
|
|
2880
2886
|
namespaces: t,
|
|
2881
2887
|
unexpectedQueries: e.queries
|
|
@@ -2883,57 +2889,57 @@ function Vr(e) {
|
|
|
2883
2889
|
}
|
|
2884
2890
|
};
|
|
2885
2891
|
}
|
|
2886
|
-
function
|
|
2892
|
+
function Ur(e) {
|
|
2887
2893
|
let { xml: t, queries: n, namespaces: r = {} } = e;
|
|
2888
|
-
|
|
2894
|
+
Gr({
|
|
2889
2895
|
xml: t,
|
|
2890
|
-
namespaces:
|
|
2896
|
+
namespaces: Kr(r),
|
|
2891
2897
|
expectedQueries: n
|
|
2892
2898
|
});
|
|
2893
2899
|
}
|
|
2894
|
-
function
|
|
2900
|
+
function Wr(e) {
|
|
2895
2901
|
let { xml: t, queries: n, namespaces: r = {} } = e;
|
|
2896
|
-
|
|
2902
|
+
Gr({
|
|
2897
2903
|
xml: t,
|
|
2898
|
-
namespaces:
|
|
2904
|
+
namespaces: Kr(r),
|
|
2899
2905
|
unexpectedQueries: n
|
|
2900
2906
|
});
|
|
2901
2907
|
}
|
|
2902
|
-
function
|
|
2908
|
+
function Gr(e) {
|
|
2903
2909
|
let { xml: t, namespaces: n, expectedQueries: r = [], unexpectedQueries: i = [] } = e;
|
|
2904
2910
|
Qn({
|
|
2905
2911
|
xml: t,
|
|
2906
2912
|
label: cr
|
|
2907
2913
|
}, function(e) {
|
|
2908
|
-
for (let t of r)
|
|
2914
|
+
for (let t of r) qr({
|
|
2909
2915
|
document: e,
|
|
2910
2916
|
namespaces: n,
|
|
2911
2917
|
query: t
|
|
2912
2918
|
});
|
|
2913
|
-
for (let t of i)
|
|
2919
|
+
for (let t of i) Jr({
|
|
2914
2920
|
document: e,
|
|
2915
2921
|
namespaces: n,
|
|
2916
2922
|
query: t
|
|
2917
2923
|
});
|
|
2918
2924
|
});
|
|
2919
2925
|
}
|
|
2920
|
-
function
|
|
2926
|
+
function Kr(e) {
|
|
2921
2927
|
return Object.fromEntries(Object.entries(e).map(([e, t]) => [e, t.uri]));
|
|
2922
2928
|
}
|
|
2923
|
-
function
|
|
2929
|
+
function qr(e) {
|
|
2924
2930
|
let { document: t, namespaces: n, query: r } = e;
|
|
2925
|
-
if (
|
|
2931
|
+
if (Yr({
|
|
2926
2932
|
document: t,
|
|
2927
2933
|
namespaces: n,
|
|
2928
2934
|
query: r
|
|
2929
2935
|
})) return;
|
|
2930
|
-
let i =
|
|
2936
|
+
let i = Xr({
|
|
2931
2937
|
document: t,
|
|
2932
2938
|
namespaces: n,
|
|
2933
2939
|
query: r,
|
|
2934
2940
|
stepCount: void 0
|
|
2935
2941
|
});
|
|
2936
|
-
throw
|
|
2942
|
+
throw new zr(Nr({
|
|
2937
2943
|
header: ur.expectedNotFound,
|
|
2938
2944
|
query: r,
|
|
2939
2945
|
trace: i,
|
|
@@ -2941,17 +2947,17 @@ function Kr(e) {
|
|
|
2941
2947
|
namespaces: n
|
|
2942
2948
|
}));
|
|
2943
2949
|
}
|
|
2944
|
-
function
|
|
2945
|
-
let { document: t, namespaces: n, query: r } = e, i =
|
|
2950
|
+
function Jr(e) {
|
|
2951
|
+
let { document: t, namespaces: n, query: r } = e, i = Yr({
|
|
2946
2952
|
document: t,
|
|
2947
2953
|
namespaces: n,
|
|
2948
2954
|
query: r
|
|
2949
2955
|
});
|
|
2950
|
-
if (i) throw
|
|
2956
|
+
if (i) throw new zr(Pr({
|
|
2951
2957
|
query: r,
|
|
2952
2958
|
node: i
|
|
2953
2959
|
}));
|
|
2954
|
-
let a =
|
|
2960
|
+
let a = Br(r).length - 1, o = Xr({
|
|
2955
2961
|
document: t,
|
|
2956
2962
|
namespaces: n,
|
|
2957
2963
|
query: r,
|
|
@@ -2965,7 +2971,7 @@ function qr(e) {
|
|
|
2965
2971
|
namespaces: n
|
|
2966
2972
|
}));
|
|
2967
2973
|
}
|
|
2968
|
-
function
|
|
2974
|
+
function Yr(e) {
|
|
2969
2975
|
let { document: t, namespaces: n, query: r } = e;
|
|
2970
2976
|
try {
|
|
2971
2977
|
return Wn({
|
|
@@ -2980,10 +2986,10 @@ function Jr(e) {
|
|
|
2980
2986
|
})) : e;
|
|
2981
2987
|
}
|
|
2982
2988
|
}
|
|
2983
|
-
function
|
|
2984
|
-
let { document: t, namespaces: n, query: r, stepCount: i } = e, a =
|
|
2989
|
+
function Xr(e) {
|
|
2990
|
+
let { document: t, namespaces: n, query: r, stepCount: i } = e, a = Br(r), o, s = 0;
|
|
2985
2991
|
for (let e of a.slice(0, i ?? a.length)) {
|
|
2986
|
-
let r =
|
|
2992
|
+
let r = Zr({
|
|
2987
2993
|
document: t,
|
|
2988
2994
|
namespaces: n,
|
|
2989
2995
|
step: e
|
|
@@ -2997,7 +3003,7 @@ function Yr(e) {
|
|
|
2997
3003
|
lastMatch: o
|
|
2998
3004
|
};
|
|
2999
3005
|
}
|
|
3000
|
-
function
|
|
3006
|
+
function Zr(e) {
|
|
3001
3007
|
let { document: t, namespaces: n, step: r } = e;
|
|
3002
3008
|
try {
|
|
3003
3009
|
return Wn({
|
|
@@ -3011,7 +3017,7 @@ function Xr(e) {
|
|
|
3011
3017
|
}
|
|
3012
3018
|
}
|
|
3013
3019
|
// src/test/constant.ts
|
|
3014
|
-
var
|
|
3020
|
+
var Qr = {
|
|
3015
3021
|
...r,
|
|
3016
3022
|
default: {
|
|
3017
3023
|
uri: "http://dialecte.dev/XML/DEFAULT",
|
|
@@ -3021,7 +3027,7 @@ var Zr = {
|
|
|
3021
3027
|
uri: "http://dialecte.dev/XML/DEV-EXT",
|
|
3022
3028
|
prefix: "ext"
|
|
3023
3029
|
}
|
|
3024
|
-
},
|
|
3030
|
+
}, $r = `xmlns="${Qr.default.uri}"`, ei = `xmlns:${Qr.dev.prefix}="${Qr.dev.uri}"`, ti = `xmlns:${Qr.ext.prefix}="${Qr.ext.uri}"`, ni = "default", ri = /* @__PURE__ */ "A.AAAA_1.AAAA_2.AAAA_3.AAA_1.AAA_2.AAA_3.AA_1.AA_2.AA_3.B.BBBB_1.BBBB_2.BBBB_3.BBB_1.BBB_2.BBB_3.BB_1.BB_2.BB_3.C.CCCC_1.CCCC_2.CCCC_3.CCC_1.CCC_2.CCC_3.CC_1.CC_2.CC_3.D.DDD_1.DDD_2.DDD_3.DD_1.DD_2.DD_3.Root".split("."), ii = {
|
|
3025
3031
|
A: [
|
|
3026
3032
|
"AA_1",
|
|
3027
3033
|
"AA_2",
|
|
@@ -3153,7 +3159,7 @@ var Zr = {
|
|
|
3153
3159
|
"C",
|
|
3154
3160
|
"D"
|
|
3155
3161
|
]
|
|
3156
|
-
},
|
|
3162
|
+
}, ai = {
|
|
3157
3163
|
A: ["Root"],
|
|
3158
3164
|
AAAA_1: [
|
|
3159
3165
|
"AAA_1",
|
|
@@ -3264,7 +3270,7 @@ var Zr = {
|
|
|
3264
3270
|
DD_2: ["D"],
|
|
3265
3271
|
DD_3: ["D"],
|
|
3266
3272
|
Root: []
|
|
3267
|
-
},
|
|
3273
|
+
}, oi = {
|
|
3268
3274
|
A: [
|
|
3269
3275
|
"AAAA_1",
|
|
3270
3276
|
"AAAA_2",
|
|
@@ -3439,7 +3445,7 @@ var Zr = {
|
|
|
3439
3445
|
DD_2: ["DDD_2", "DDD_3"],
|
|
3440
3446
|
DD_3: [],
|
|
3441
3447
|
Root: /* @__PURE__ */ "A.AAAA_1.AAAA_2.AAAA_3.AAA_1.AAA_2.AAA_3.AA_1.AA_2.AA_3.B.BBBB_1.BBBB_2.BBBB_3.BBB_1.BBB_2.BBB_3.BB_1.BB_2.BB_3.C.CCCC_1.CCCC_2.CCCC_3.CCC_1.CCC_2.CCC_3.CC_1.CC_2.CC_3.D.DDD_1.DDD_2.DDD_3.DD_1.DD_2.DD_3".split(".")
|
|
3442
|
-
},
|
|
3448
|
+
}, si = {
|
|
3443
3449
|
A: ["Root"],
|
|
3444
3450
|
AAAA_1: [
|
|
3445
3451
|
"A",
|
|
@@ -3625,7 +3631,7 @@ var Zr = {
|
|
|
3625
3631
|
DD_2: ["D", "Root"],
|
|
3626
3632
|
DD_3: ["D", "Root"],
|
|
3627
3633
|
Root: []
|
|
3628
|
-
},
|
|
3634
|
+
}, ci = "Root", li = [
|
|
3629
3635
|
"A",
|
|
3630
3636
|
"AA_1",
|
|
3631
3637
|
"B",
|
|
@@ -3843,7 +3849,7 @@ var Zr = {
|
|
|
3843
3849
|
"ext:root": "",
|
|
3844
3850
|
root: ""
|
|
3845
3851
|
}
|
|
3846
|
-
},
|
|
3852
|
+
}, ui = {
|
|
3847
3853
|
byTag: $,
|
|
3848
3854
|
byParent: {
|
|
3849
3855
|
A: {
|
|
@@ -3968,7 +3974,7 @@ var Zr = {
|
|
|
3968
3974
|
D: $.D
|
|
3969
3975
|
}
|
|
3970
3976
|
}
|
|
3971
|
-
},
|
|
3977
|
+
}, di = {
|
|
3972
3978
|
A: {
|
|
3973
3979
|
tag: "A",
|
|
3974
3980
|
namespace: {
|
|
@@ -6167,7 +6173,7 @@ var Zr = {
|
|
|
6167
6173
|
}]]
|
|
6168
6174
|
}]
|
|
6169
6175
|
}
|
|
6170
|
-
},
|
|
6176
|
+
}, fi = {
|
|
6171
6177
|
"{http://dialecte.dev/XML/DEFAULT}tCode": {
|
|
6172
6178
|
attributes: {
|
|
6173
6179
|
sequence: [],
|
|
@@ -6546,7 +6552,7 @@ var Zr = {
|
|
|
6546
6552
|
details: {}
|
|
6547
6553
|
}
|
|
6548
6554
|
}
|
|
6549
|
-
},
|
|
6555
|
+
}, pi = { supportedFileExtensions: [".xml"] }, mi = {
|
|
6550
6556
|
recordSchema: {
|
|
6551
6557
|
primaryKey: "id",
|
|
6552
6558
|
indexes: [
|
|
@@ -6561,41 +6567,41 @@ var Zr = {
|
|
|
6561
6567
|
name: "xmlElements",
|
|
6562
6568
|
schema: "id, tagName, [id+tagName], parent.id, parent.tagName, *children.id, *children.tagName"
|
|
6563
6569
|
} }
|
|
6564
|
-
},
|
|
6565
|
-
rootElementName:
|
|
6566
|
-
singletonElements:
|
|
6567
|
-
elements:
|
|
6568
|
-
namespaces:
|
|
6569
|
-
attributes:
|
|
6570
|
-
children:
|
|
6571
|
-
parents:
|
|
6572
|
-
descendants:
|
|
6573
|
-
ancestors:
|
|
6574
|
-
database:
|
|
6575
|
-
io:
|
|
6576
|
-
definition:
|
|
6577
|
-
types:
|
|
6578
|
-
},
|
|
6570
|
+
}, hi = {
|
|
6571
|
+
rootElementName: ci,
|
|
6572
|
+
singletonElements: li,
|
|
6573
|
+
elements: ri,
|
|
6574
|
+
namespaces: Qr,
|
|
6575
|
+
attributes: ui,
|
|
6576
|
+
children: ii,
|
|
6577
|
+
parents: ai,
|
|
6578
|
+
descendants: oi,
|
|
6579
|
+
ancestors: si,
|
|
6580
|
+
database: mi,
|
|
6581
|
+
io: pi,
|
|
6582
|
+
definition: di,
|
|
6583
|
+
types: fi
|
|
6584
|
+
}, gi = /* @__PURE__ */ new Set(), _i = h({
|
|
6579
6585
|
id: "core/test",
|
|
6580
6586
|
version: "0.0.0",
|
|
6581
|
-
configs: { [
|
|
6582
|
-
defaultConfigKey:
|
|
6583
|
-
}),
|
|
6587
|
+
configs: { [ni]: hi },
|
|
6588
|
+
defaultConfigKey: ni
|
|
6589
|
+
}), vi = Symbol.for("@dialecte/core/test:storage"), yi = { type: "local" };
|
|
6584
6590
|
// src/test/test-storage/read-test-storage.ts
|
|
6585
|
-
function
|
|
6586
|
-
return globalThis[
|
|
6591
|
+
function bi() {
|
|
6592
|
+
return globalThis[vi];
|
|
6587
6593
|
}
|
|
6588
6594
|
// src/test/test-storage/resolve-test-storage.ts
|
|
6589
|
-
function
|
|
6590
|
-
return e.storage ??
|
|
6595
|
+
function xi(e) {
|
|
6596
|
+
return e.storage ?? bi() ?? yi;
|
|
6591
6597
|
}
|
|
6592
6598
|
// src/test/test-storage/use-test-storage.ts
|
|
6593
|
-
function
|
|
6599
|
+
function Si(e) {
|
|
6594
6600
|
let t = globalThis;
|
|
6595
|
-
t[
|
|
6601
|
+
t[vi] = e;
|
|
6596
6602
|
}
|
|
6597
6603
|
// src/test/test-storage/sqlite-test-store.ts
|
|
6598
|
-
async function
|
|
6604
|
+
async function Ci(e) {
|
|
6599
6605
|
let { name: t, dialecte: n, perf: r } = e, { createInProcessConnector: i } = await import("./in-process-link-B-TCHrlb.js"), a = {
|
|
6600
6606
|
configs: n.configs,
|
|
6601
6607
|
defaultConfigKey: n.defaultConfigKey,
|
|
@@ -6612,14 +6618,14 @@ async function Si(e) {
|
|
|
6612
6618
|
});
|
|
6613
6619
|
}
|
|
6614
6620
|
// src/test/test-storage/test-store-providers.constants.ts
|
|
6615
|
-
var
|
|
6621
|
+
var wi = /* @__PURE__ */ new Map([["sqlite", Ci]]);
|
|
6616
6622
|
// src/test/test-storage/test-store-providers.ts
|
|
6617
|
-
function
|
|
6618
|
-
return
|
|
6623
|
+
function Ti(e) {
|
|
6624
|
+
return wi.get(e.type);
|
|
6619
6625
|
}
|
|
6620
6626
|
// src/test/test-storage/test-store-for.ts
|
|
6621
|
-
async function
|
|
6622
|
-
let { storage: t, name: n, dialecte: r, perf: i } = e, a =
|
|
6627
|
+
async function Ei(e) {
|
|
6628
|
+
let { storage: t, name: n, dialecte: r, perf: i } = e, a = Di({
|
|
6623
6629
|
name: n,
|
|
6624
6630
|
type: t.type
|
|
6625
6631
|
});
|
|
@@ -6628,19 +6634,19 @@ async function Ti(e) {
|
|
|
6628
6634
|
store: await a({
|
|
6629
6635
|
name: n,
|
|
6630
6636
|
storage: t,
|
|
6631
|
-
dialecte:
|
|
6637
|
+
dialecte: Oi({ dialecte: r }),
|
|
6632
6638
|
perf: i
|
|
6633
6639
|
})
|
|
6634
6640
|
} : t;
|
|
6635
6641
|
}
|
|
6636
|
-
function
|
|
6642
|
+
function Di(e) {
|
|
6637
6643
|
let { name: t, type: n } = e;
|
|
6638
6644
|
if (!ee({ type: n })) return te({
|
|
6639
6645
|
project: t,
|
|
6640
6646
|
type: n
|
|
6641
|
-
}).testStoreOf ??
|
|
6647
|
+
}).testStoreOf ?? Ti({ type: n });
|
|
6642
6648
|
}
|
|
6643
|
-
function
|
|
6649
|
+
function Oi(e) {
|
|
6644
6650
|
let { id: t, configs: n, defaultConfigKey: r, createHooks: i } = e.dialecte;
|
|
6645
6651
|
return {
|
|
6646
6652
|
id: t,
|
|
@@ -6650,26 +6656,26 @@ function Di(e) {
|
|
|
6650
6656
|
};
|
|
6651
6657
|
}
|
|
6652
6658
|
// src/test/test-dialecte-setup.ts
|
|
6653
|
-
function
|
|
6659
|
+
function ki(e) {
|
|
6654
6660
|
if (e.dialecte) return { dialecte: e.dialecte };
|
|
6655
6661
|
let { dialecteConfig: t, extensions: n, hooks: r } = e;
|
|
6656
|
-
if (!t && !n && !r) return { dialecte:
|
|
6662
|
+
if (!t && !n && !r) return { dialecte: _i };
|
|
6657
6663
|
function i() {
|
|
6658
6664
|
return r ?? {};
|
|
6659
6665
|
}
|
|
6660
6666
|
return {
|
|
6661
6667
|
dialecte: h({
|
|
6662
|
-
id:
|
|
6663
|
-
version:
|
|
6664
|
-
configs: { [
|
|
6665
|
-
defaultConfigKey:
|
|
6668
|
+
id: _i.id,
|
|
6669
|
+
version: _i.version,
|
|
6670
|
+
configs: { [ni]: t ?? hi },
|
|
6671
|
+
defaultConfigKey: ni,
|
|
6666
6672
|
extensions: n?.base,
|
|
6667
6673
|
createHooks: i
|
|
6668
6674
|
}),
|
|
6669
6675
|
custom: n?.custom
|
|
6670
6676
|
};
|
|
6671
6677
|
}
|
|
6672
|
-
function
|
|
6678
|
+
function Ai(e) {
|
|
6673
6679
|
let { dialecte: t } = e.setup, n = e.configKey ?? t.defaultConfigKey;
|
|
6674
6680
|
if (!Object.hasOwn(t.configs, n)) throw a("UNKNOWN_CONFIG_KEY", {
|
|
6675
6681
|
detail: `The test dialecte "${t.id}" has no config "${n}": ${Object.keys(t.configs).join(", ")}.`,
|
|
@@ -6684,8 +6690,8 @@ function ki(e) {
|
|
|
6684
6690
|
config: t.configs[n]
|
|
6685
6691
|
};
|
|
6686
6692
|
}
|
|
6687
|
-
function
|
|
6688
|
-
let { setup: t, dialecteConfig: n, hooks: r } = e, { configKey: i } =
|
|
6693
|
+
function ji(e) {
|
|
6694
|
+
let { setup: t, dialecteConfig: n, hooks: r } = e, { configKey: i } = Ai({
|
|
6689
6695
|
setup: t,
|
|
6690
6696
|
configKey: e.configKey
|
|
6691
6697
|
});
|
|
@@ -6706,12 +6712,12 @@ function Ai(e) {
|
|
|
6706
6712
|
})
|
|
6707
6713
|
};
|
|
6708
6714
|
}
|
|
6709
|
-
async function
|
|
6710
|
-
let { setup: t, sourceXml: n, targetXml: r, dev: i } = e, { dialecte: a, custom: o } = t, { configKey: s } =
|
|
6715
|
+
async function Mi(e) {
|
|
6716
|
+
let { setup: t, sourceXml: n, targetXml: r, dev: i } = e, { dialecte: a, custom: o } = t, { configKey: s } = Ai({
|
|
6711
6717
|
setup: t,
|
|
6712
6718
|
configKey: e.configKey
|
|
6713
|
-
}), c = `test-${crypto.randomUUID()}`, l = await
|
|
6714
|
-
storage:
|
|
6719
|
+
}), c = `test-${crypto.randomUUID()}`, l = await Ei({
|
|
6720
|
+
storage: xi({ storage: e.storage }),
|
|
6715
6721
|
name: c,
|
|
6716
6722
|
dialecte: a,
|
|
6717
6723
|
perf: i?.perf
|
|
@@ -6721,15 +6727,15 @@ async function ji(e) {
|
|
|
6721
6727
|
extensions: o,
|
|
6722
6728
|
dev: i
|
|
6723
6729
|
}).open(c);
|
|
6724
|
-
return
|
|
6730
|
+
return Pi({ project: u }), {
|
|
6725
6731
|
project: u,
|
|
6726
|
-
source: await
|
|
6732
|
+
source: await Ni({
|
|
6727
6733
|
project: u,
|
|
6728
6734
|
xml: n,
|
|
6729
6735
|
fileName: "source.xml",
|
|
6730
6736
|
configKey: s
|
|
6731
6737
|
}),
|
|
6732
|
-
target: r ? await
|
|
6738
|
+
target: r ? await Ni({
|
|
6733
6739
|
project: u,
|
|
6734
6740
|
xml: r,
|
|
6735
6741
|
fileName: "target.xml",
|
|
@@ -6737,7 +6743,7 @@ async function ji(e) {
|
|
|
6737
6743
|
}) : void 0
|
|
6738
6744
|
};
|
|
6739
6745
|
}
|
|
6740
|
-
async function
|
|
6746
|
+
async function Ni(e) {
|
|
6741
6747
|
let { project: t, xml: n, fileName: r, configKey: i } = e, { documentId: a } = await t.importFile(new File([n], r, { type: "text/xml" }), {
|
|
6742
6748
|
configKey: i,
|
|
6743
6749
|
useCustomRecordsIds: !0
|
|
@@ -6747,7 +6753,7 @@ async function Mi(e) {
|
|
|
6747
6753
|
document: t.openDocument(a)
|
|
6748
6754
|
};
|
|
6749
6755
|
}
|
|
6750
|
-
function
|
|
6756
|
+
function Pi(e) {
|
|
6751
6757
|
let { project: t } = e;
|
|
6752
6758
|
try {
|
|
6753
6759
|
ie(() => t.destroy());
|
|
@@ -6758,10 +6764,10 @@ function Ni(e) {
|
|
|
6758
6764
|
n && r && n.unshift(r);
|
|
6759
6765
|
}
|
|
6760
6766
|
// src/test/create-test-dialecte.ts
|
|
6761
|
-
async function
|
|
6767
|
+
async function Fi(e) {
|
|
6762
6768
|
let { sourceXml: t, targetXml: n, configKey: r, storage: i, dev: a } = e;
|
|
6763
|
-
return
|
|
6764
|
-
setup:
|
|
6769
|
+
return Mi({
|
|
6770
|
+
setup: ki(e),
|
|
6765
6771
|
sourceXml: t,
|
|
6766
6772
|
targetXml: n,
|
|
6767
6773
|
configKey: r,
|
|
@@ -6769,12 +6775,12 @@ async function Pi(e) {
|
|
|
6769
6775
|
dev: a
|
|
6770
6776
|
});
|
|
6771
6777
|
}
|
|
6772
|
-
async function
|
|
6773
|
-
let { dialecteConfig: t, documentId: n } = e, r = e.store ?? await
|
|
6778
|
+
async function Ii(e) {
|
|
6779
|
+
let { dialecteConfig: t, documentId: n } = e, r = e.store ?? await Li({
|
|
6774
6780
|
...e,
|
|
6775
6781
|
dialecteConfig: t
|
|
6776
6782
|
});
|
|
6777
|
-
return await r.open(), e.store === void 0 &&
|
|
6783
|
+
return await r.open(), e.store === void 0 && gi.add(r), {
|
|
6778
6784
|
dialecteConfig: t,
|
|
6779
6785
|
store: r,
|
|
6780
6786
|
documentId: n,
|
|
@@ -6790,12 +6796,12 @@ async function Fi(e) {
|
|
|
6790
6796
|
perf: y
|
|
6791
6797
|
};
|
|
6792
6798
|
}
|
|
6793
|
-
async function
|
|
6799
|
+
async function Li(e) {
|
|
6794
6800
|
let { databaseName: t, dialecteId: n, dialecteConfig: r } = e, i = {
|
|
6795
|
-
configs: { [
|
|
6796
|
-
defaultConfigKey:
|
|
6797
|
-
}, o =
|
|
6798
|
-
if (!
|
|
6801
|
+
configs: { [ni]: r },
|
|
6802
|
+
defaultConfigKey: ni
|
|
6803
|
+
}, o = xi({ storage: e.storage });
|
|
6804
|
+
if (!Di({
|
|
6799
6805
|
name: t,
|
|
6800
6806
|
type: o.type
|
|
6801
6807
|
})) return m({
|
|
@@ -6808,7 +6814,7 @@ async function Ii(e) {
|
|
|
6808
6814
|
detail: `A test context on a registered storage kind ("${o.type}") names its project's dialecte: "${t}" has none`,
|
|
6809
6815
|
meta: { databaseName: t }
|
|
6810
6816
|
});
|
|
6811
|
-
let s = await
|
|
6817
|
+
let s = await Ei({
|
|
6812
6818
|
storage: o,
|
|
6813
6819
|
name: t,
|
|
6814
6820
|
dialecte: {
|
|
@@ -6823,31 +6829,31 @@ async function Ii(e) {
|
|
|
6823
6829
|
runtime: i
|
|
6824
6830
|
});
|
|
6825
6831
|
}
|
|
6826
|
-
async function
|
|
6827
|
-
let e = [...
|
|
6828
|
-
|
|
6832
|
+
async function Ri() {
|
|
6833
|
+
let e = [...gi];
|
|
6834
|
+
gi.clear(), await Promise.all(e.map(zi));
|
|
6829
6835
|
}
|
|
6830
|
-
function
|
|
6836
|
+
function zi(e) {
|
|
6831
6837
|
return e.close();
|
|
6832
6838
|
}
|
|
6833
6839
|
// src/test/run-test-cases.ts
|
|
6834
|
-
var
|
|
6835
|
-
function
|
|
6840
|
+
var Bi = crypto.randomUUID.bind(crypto);
|
|
6841
|
+
function Vi(e) {
|
|
6836
6842
|
return c({ seed: e?.seed ?? 0 });
|
|
6837
6843
|
}
|
|
6838
|
-
function
|
|
6839
|
-
let { testCases: t, act: n, storage: r, dev: i, configKey: a, dialecteConfig: o, hooks: s } = e, c =
|
|
6844
|
+
function Hi(e) {
|
|
6845
|
+
let { testCases: t, act: n, storage: r, dev: i, configKey: a, dialecteConfig: o, hooks: s } = e, c = ji({
|
|
6840
6846
|
setup: e.setup,
|
|
6841
6847
|
configKey: a,
|
|
6842
6848
|
dialecteConfig: o,
|
|
6843
6849
|
hooks: s
|
|
6844
|
-
}), { config: l } =
|
|
6850
|
+
}), { config: l } = Ai({
|
|
6845
6851
|
setup: c,
|
|
6846
6852
|
configKey: a
|
|
6847
|
-
}), u =
|
|
6853
|
+
}), u = Kr(l.namespaces);
|
|
6848
6854
|
for (let [e, o] of Object.entries(t)) (o.only ? re.only : re)(e, async () => {
|
|
6849
|
-
crypto.randomUUID =
|
|
6850
|
-
let { project: e, source: t, target: s } = await
|
|
6855
|
+
crypto.randomUUID = Bi;
|
|
6856
|
+
let { project: e, source: t, target: s } = await Mi({
|
|
6851
6857
|
setup: c,
|
|
6852
6858
|
sourceXml: o.sourceXml,
|
|
6853
6859
|
targetXml: o.targetXml,
|
|
@@ -6856,7 +6862,7 @@ function Vi(e) {
|
|
|
6856
6862
|
dev: i
|
|
6857
6863
|
});
|
|
6858
6864
|
try {
|
|
6859
|
-
crypto.randomUUID =
|
|
6865
|
+
crypto.randomUUID = Vi();
|
|
6860
6866
|
let r = await n({
|
|
6861
6867
|
testCase: o,
|
|
6862
6868
|
project: e,
|
|
@@ -6874,27 +6880,27 @@ function Vi(e) {
|
|
|
6874
6880
|
});
|
|
6875
6881
|
i = await c.text();
|
|
6876
6882
|
}
|
|
6877
|
-
(o.expectedQueries?.length || o.unexpectedQueries?.length) &&
|
|
6883
|
+
(o.expectedQueries?.length || o.unexpectedQueries?.length) && Gr({
|
|
6878
6884
|
xml: i,
|
|
6879
6885
|
namespaces: u,
|
|
6880
6886
|
expectedQueries: o.expectedQueries,
|
|
6881
6887
|
unexpectedQueries: o.unexpectedQueries
|
|
6882
6888
|
});
|
|
6883
6889
|
} finally {
|
|
6884
|
-
crypto.randomUUID =
|
|
6890
|
+
crypto.randomUUID = Bi, await e.destroy();
|
|
6885
6891
|
}
|
|
6886
6892
|
});
|
|
6887
6893
|
}
|
|
6888
|
-
function
|
|
6889
|
-
let { testCases: t, act: n, storage: r, dev: i, configKey: a, dialecteConfig: o, hooks: s } = e, c =
|
|
6894
|
+
function Ui(e) {
|
|
6895
|
+
let { testCases: t, act: n, storage: r, dev: i, configKey: a, dialecteConfig: o, hooks: s } = e, c = ji({
|
|
6890
6896
|
setup: e.setup,
|
|
6891
6897
|
configKey: a,
|
|
6892
6898
|
dialecteConfig: o,
|
|
6893
6899
|
hooks: s
|
|
6894
6900
|
});
|
|
6895
6901
|
for (let [e, o] of Object.entries(t)) (o.only ? re.only : re)(e, async () => {
|
|
6896
|
-
crypto.randomUUID =
|
|
6897
|
-
let { project: e, source: t, target: s } = await
|
|
6902
|
+
crypto.randomUUID = Bi;
|
|
6903
|
+
let { project: e, source: t, target: s } = await Mi({
|
|
6898
6904
|
setup: c,
|
|
6899
6905
|
sourceXml: o.sourceXml,
|
|
6900
6906
|
targetXml: o.targetXml,
|
|
@@ -6903,39 +6909,39 @@ function Hi(e) {
|
|
|
6903
6909
|
dev: i
|
|
6904
6910
|
});
|
|
6905
6911
|
try {
|
|
6906
|
-
crypto.randomUUID =
|
|
6912
|
+
crypto.randomUUID = Vi(), await n({
|
|
6907
6913
|
testCase: o,
|
|
6908
6914
|
project: e,
|
|
6909
6915
|
source: t.document,
|
|
6910
6916
|
target: s?.document
|
|
6911
6917
|
});
|
|
6912
6918
|
} finally {
|
|
6913
|
-
crypto.randomUUID =
|
|
6919
|
+
crypto.randomUUID = Bi, await e.destroy();
|
|
6914
6920
|
}
|
|
6915
6921
|
});
|
|
6916
6922
|
}
|
|
6917
|
-
function
|
|
6923
|
+
function Wi(e, t) {
|
|
6918
6924
|
for (let [n, r] of Object.entries(e)) (r.only ? re.only : re)(n, () => t(r));
|
|
6919
6925
|
}
|
|
6920
|
-
function
|
|
6921
|
-
let { storage: t } = e, n =
|
|
6926
|
+
function Gi(e) {
|
|
6927
|
+
let { storage: t } = e, n = ki(e);
|
|
6922
6928
|
return {
|
|
6923
|
-
withExport: (e) =>
|
|
6929
|
+
withExport: (e) => Hi({
|
|
6924
6930
|
setup: n,
|
|
6925
6931
|
storage: t,
|
|
6926
6932
|
...e
|
|
6927
6933
|
}),
|
|
6928
|
-
withoutExport: (e) =>
|
|
6934
|
+
withoutExport: (e) => Ui({
|
|
6929
6935
|
setup: n,
|
|
6930
6936
|
storage: t,
|
|
6931
6937
|
...e
|
|
6932
6938
|
}),
|
|
6933
|
-
generic:
|
|
6939
|
+
generic: Wi
|
|
6934
6940
|
};
|
|
6935
6941
|
}
|
|
6936
|
-
var
|
|
6942
|
+
var Ki = Gi({ dialecte: _i });
|
|
6937
6943
|
// src/test/test-record.ts
|
|
6938
|
-
function
|
|
6944
|
+
function qi(e) {
|
|
6939
6945
|
function t(t) {
|
|
6940
6946
|
let { record: n, type: r = "raw" } = t, i = u({
|
|
6941
6947
|
record: n,
|
|
@@ -6950,9 +6956,9 @@ function Ki(e) {
|
|
|
6950
6956
|
}
|
|
6951
6957
|
return t;
|
|
6952
6958
|
}
|
|
6953
|
-
var
|
|
6959
|
+
var Ji = qi(hi);
|
|
6954
6960
|
// src/test/create-test-helpers.ts
|
|
6955
|
-
function
|
|
6961
|
+
function Yi(e) {
|
|
6956
6962
|
let { config: t, schemaName: n } = e;
|
|
6957
6963
|
return rr({
|
|
6958
6964
|
definition: t.definition,
|
|
@@ -6961,15 +6967,15 @@ function Ji(e) {
|
|
|
6961
6967
|
schemaName: n
|
|
6962
6968
|
});
|
|
6963
6969
|
}
|
|
6964
|
-
function
|
|
6970
|
+
function Xi(e) {
|
|
6965
6971
|
let { dialecte: t, storage: n, schemaName: r = t.id, extraChecks: i } = e, a = { dialecte: t }, o = t.configs[t.defaultConfigKey], s = /* @__PURE__ */ new Map();
|
|
6966
6972
|
function c(e) {
|
|
6967
|
-
let t =
|
|
6973
|
+
let t = Ai({
|
|
6968
6974
|
setup: a,
|
|
6969
6975
|
configKey: e.configKey
|
|
6970
6976
|
});
|
|
6971
6977
|
if (e.caseConfig) {
|
|
6972
|
-
let n =
|
|
6978
|
+
let n = Yi({
|
|
6973
6979
|
config: e.caseConfig,
|
|
6974
6980
|
schemaName: r
|
|
6975
6981
|
});
|
|
@@ -6983,7 +6989,7 @@ function Yi(e) {
|
|
|
6983
6989
|
configKey: t.configKey,
|
|
6984
6990
|
assertions: n
|
|
6985
6991
|
};
|
|
6986
|
-
let i =
|
|
6992
|
+
let i = Yi({
|
|
6987
6993
|
config: t.config,
|
|
6988
6994
|
schemaName: r
|
|
6989
6995
|
});
|
|
@@ -7002,7 +7008,7 @@ function Yi(e) {
|
|
|
7002
7008
|
configKey: n
|
|
7003
7009
|
});
|
|
7004
7010
|
}
|
|
7005
|
-
let u =
|
|
7011
|
+
let u = Gi({
|
|
7006
7012
|
dialecte: t,
|
|
7007
7013
|
storage: n
|
|
7008
7014
|
}), d = {
|
|
@@ -7032,7 +7038,7 @@ function Yi(e) {
|
|
|
7032
7038
|
label: t,
|
|
7033
7039
|
configKey: l
|
|
7034
7040
|
});
|
|
7035
|
-
return
|
|
7041
|
+
return Mi({
|
|
7036
7042
|
setup: a,
|
|
7037
7043
|
sourceXml: t,
|
|
7038
7044
|
targetXml: r,
|
|
@@ -7044,21 +7050,21 @@ function Yi(e) {
|
|
|
7044
7050
|
return {
|
|
7045
7051
|
runTestCases: d,
|
|
7046
7052
|
createTestProject: f,
|
|
7047
|
-
createTestRecord:
|
|
7048
|
-
...
|
|
7053
|
+
createTestRecord: qi(o),
|
|
7054
|
+
...Hr({ namespaces: o.namespaces }),
|
|
7049
7055
|
...c({ configKey: void 0 }).assertions
|
|
7050
7056
|
};
|
|
7051
7057
|
}
|
|
7052
7058
|
// src/test/normalize-uuids.constants.ts
|
|
7053
|
-
var
|
|
7059
|
+
var Zi = /[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/gi;
|
|
7054
7060
|
// src/test/normalize-uuids.ts
|
|
7055
|
-
function
|
|
7061
|
+
function Qi(e) {
|
|
7056
7062
|
let t = /* @__PURE__ */ new Map();
|
|
7057
|
-
return e.replace(
|
|
7063
|
+
return e.replace(Zi, (e) => {
|
|
7058
7064
|
let n = t.get(e);
|
|
7059
7065
|
if (n) return n;
|
|
7060
7066
|
let r = `uuid-${t.size + 1}`;
|
|
7061
7067
|
return t.set(e, r), r;
|
|
7062
7068
|
});
|
|
7063
7069
|
}
|
|
7064
|
-
export {
|
|
7070
|
+
export { mi as DATABASE_CONFIG, Qr as DIALECTE_TEST_NAMESPACES, pi as IO_CONFIG, ni as TEST_CONFIG_KEY, _i as TEST_DIALECTE, hi as TEST_DIALECTE_CONFIG, $r as XMLNS_DEFAULT_NAMESPACE, ei as XMLNS_DEV_NAMESPACE, ti as XMLNS_EXT_NAMESPACE, zr as XmlAssertionError, Ur as assertExpectedElementQueries, Wr as assertUnexpectedElementQueries, Ri as closeTestContexts, Vi as createMockRandomUUID, Ii as createTestContext, Xi as createTestHelpers, Fi as createTestProject, Ji as createTestRecord, qi as createTestRecordFactory, Gi as createTestRunner, Hr as createXmlAssertions, rr as createXmlSchemaAssertions, Qi as normalizeUuids, Ki as runTestCases, Si as useTestStorage };
|