@dialecte/core 0.5.3 → 0.6.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/document/document.d.ts.map +1 -1
- package/dist/document/query/any/any-query.d.ts +2 -2
- package/dist/document/query/any/any-query.d.ts.map +1 -1
- package/dist/document/query/find/by-attribute/find-by-attributes.d.ts +3 -0
- package/dist/document/query/find/by-attribute/find-by-attributes.d.ts.map +1 -1
- package/dist/document/query/find/by-attribute/find-by-attributes.types.d.ts +21 -1
- package/dist/document/query/find/by-attribute/find-by-attributes.types.d.ts.map +1 -1
- package/dist/document/query/get/attribute/get-attributes.d.ts +4 -6
- package/dist/document/query/get/attribute/get-attributes.d.ts.map +1 -1
- package/dist/document/query/get/definition/get-definition.d.ts +2 -2
- package/dist/document/query/get/definition/get-definition.d.ts.map +1 -1
- package/dist/document/query/main.d.ts +11 -10
- package/dist/document/query/main.d.ts.map +1 -1
- package/dist/document/query/tree-filter/omit.d.ts +7 -1
- package/dist/document/query/tree-filter/omit.d.ts.map +1 -1
- package/dist/document/transaction/before-commit/before-commit.d.ts +9 -0
- package/dist/document/transaction/before-commit/before-commit.d.ts.map +1 -0
- package/dist/document/transaction/before-commit/index.d.ts +2 -0
- package/dist/document/transaction/before-commit/index.d.ts.map +1 -0
- package/dist/document/transaction/create/create.d.ts.map +1 -1
- package/dist/document/transaction/create/create.types.d.ts +5 -5
- package/dist/document/transaction/create/create.types.d.ts.map +1 -1
- package/dist/document/transaction/main.d.ts +6 -0
- package/dist/document/transaction/main.d.ts.map +1 -1
- package/dist/document/transaction/update/update.d.ts.map +1 -1
- package/dist/errors/codes.d.ts +12 -0
- package/dist/errors/codes.d.ts.map +1 -1
- package/dist/helpers/assert-fixed.d.ts +3 -2
- package/dist/helpers/assert-fixed.d.ts.map +1 -1
- package/dist/helpers/assert-xsi-type.d.ts +28 -0
- package/dist/helpers/assert-xsi-type.d.ts.map +1 -0
- package/dist/helpers/constant.d.ts +4 -0
- package/dist/helpers/constant.d.ts.map +1 -1
- package/dist/helpers/converter.d.ts +9 -1
- package/dist/helpers/converter.d.ts.map +1 -1
- package/dist/helpers/index.d.ts +1 -0
- package/dist/helpers/index.d.ts.map +1 -1
- package/dist/helpers/standardizing.d.ts.map +1 -1
- package/dist/helpers.js +195 -107
- package/dist/index.js +3 -3
- package/dist/{project-U2L6RvRW.js → project-DwtNI4J5.js} +1648 -1499
- package/dist/test/assert-valid-xml/assert-valid-xml.d.ts.map +1 -1
- package/dist/test/assert-valid-xml/assert-valid-xml.types.d.ts +10 -4
- package/dist/test/assert-valid-xml/assert-valid-xml.types.d.ts.map +1 -1
- package/dist/test/config.d.ts +972 -740
- package/dist/test/config.d.ts.map +1 -1
- package/dist/test/generated/constants.generated.d.ts +59 -4
- package/dist/test/generated/constants.generated.d.ts.map +1 -1
- package/dist/test/generated/definition.generated.d.ts +920 -736
- package/dist/test/generated/definition.generated.d.ts.map +1 -1
- package/dist/test/generated/types.generated.d.ts +401 -1
- package/dist/test/generated/types.generated.d.ts.map +1 -1
- package/dist/test/run-test-cases.d.ts +972 -740
- package/dist/test/run-test-cases.d.ts.map +1 -1
- package/dist/test/test-record.d.ts +9979 -8123
- package/dist/test/test-record.d.ts.map +1 -1
- package/dist/test.js +1234 -735
- package/dist/types/definition.d.ts +80 -68
- package/dist/types/definition.d.ts.map +1 -1
- package/dist/types/dialecte-config.d.ts +20 -7
- package/dist/types/dialecte-config.d.ts.map +1 -1
- package/dist/utils/attribute-rules.d.ts +5 -49
- package/dist/utils/attribute-rules.d.ts.map +1 -1
- package/dist/utils/datatype.d.ts +12 -0
- package/dist/utils/datatype.d.ts.map +1 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/namespaces.d.ts +47 -0
- package/dist/utils/namespaces.d.ts.map +1 -0
- package/dist/utils/resolve-definition.d.ts +29 -11
- package/dist/utils/resolve-definition.d.ts.map +1 -1
- package/dist/utils/resolve-definition.types.d.ts +6 -0
- package/dist/utils/resolve-definition.types.d.ts.map +1 -0
- package/dist/utils/xsi-type.d.ts +55 -0
- package/dist/utils/xsi-type.d.ts.map +1 -0
- package/dist/utils/xsi-type.types.d.ts +10 -0
- package/dist/utils/xsi-type.types.d.ts.map +1 -0
- package/dist/{utils-Cgqv3qwv.js → utils-CZ12wsuC.js} +216 -61
- package/dist/utils.js +2 -2
- package/dist/xml/build/build-xml-document.d.ts.map +1 -1
- package/dist/xml/parse/parser.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/helpers.js
CHANGED
|
@@ -1,15 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
//#region src/helpers/
|
|
3
|
-
var
|
|
4
|
-
uri: "http://dialecte.dev/XML/DEV",
|
|
5
|
-
prefix: "dev"
|
|
6
|
-
}, u = `${l.prefix}:${c}`, d = {
|
|
7
|
-
uri: "http://www.w3.org/2001/XMLSchema-instance",
|
|
8
|
-
prefix: "xsi"
|
|
9
|
-
}, f = `xmlns:${d.prefix}="${d.uri}"`, p = {
|
|
10
|
-
dev: l,
|
|
11
|
-
xsi: d
|
|
12
|
-
}, m = [
|
|
1
|
+
import { A as e, C as t, D as n, E as r, I as i, M as a, O as o, S as s, T as c, _ as l, a as u, b as d, c as f, i as p, j as m, k as h, m as g, o as _, p as v, v as y, x as b } from "./utils-CZ12wsuC.js";
|
|
2
|
+
//#region src/helpers/guard.ts
|
|
3
|
+
var x = [
|
|
13
4
|
"id",
|
|
14
5
|
"tagName",
|
|
15
6
|
"namespace",
|
|
@@ -17,42 +8,42 @@ var c = "db-id", l = {
|
|
|
17
8
|
"children",
|
|
18
9
|
"parent",
|
|
19
10
|
"value"
|
|
20
|
-
],
|
|
21
|
-
function
|
|
11
|
+
], S = [...x, "status"], C = [...S, "tree"];
|
|
12
|
+
function w(e, t) {
|
|
22
13
|
if (typeof e != "object" || !e) return !1;
|
|
23
14
|
let n = Object.keys(e);
|
|
24
15
|
return t.every((t) => t in e) && n.every((e) => t.includes(e)) && n.length === t.length;
|
|
25
16
|
}
|
|
26
|
-
function
|
|
17
|
+
function T(e) {
|
|
27
18
|
return Array.isArray(e);
|
|
28
19
|
}
|
|
29
|
-
function
|
|
30
|
-
return
|
|
20
|
+
function E(e) {
|
|
21
|
+
return w(e, x);
|
|
31
22
|
}
|
|
32
|
-
function
|
|
33
|
-
return
|
|
23
|
+
function D(e) {
|
|
24
|
+
return w(e, S);
|
|
34
25
|
}
|
|
35
|
-
function
|
|
36
|
-
return
|
|
26
|
+
function O(e) {
|
|
27
|
+
return w(e, C);
|
|
37
28
|
}
|
|
38
|
-
function
|
|
29
|
+
function k(e, t) {
|
|
39
30
|
return e.tagName === t;
|
|
40
31
|
}
|
|
41
|
-
function
|
|
32
|
+
function A(e, t) {
|
|
42
33
|
return e.tagName === t;
|
|
43
34
|
}
|
|
44
|
-
function
|
|
35
|
+
function j(e, t) {
|
|
45
36
|
return e.tagName === t;
|
|
46
37
|
}
|
|
47
|
-
function
|
|
38
|
+
function M(e, t) {
|
|
48
39
|
return t.elements.includes(e);
|
|
49
40
|
}
|
|
50
|
-
function
|
|
41
|
+
function N(e, t) {
|
|
51
42
|
return e.attributes.some((e) => e.name === t);
|
|
52
43
|
}
|
|
53
44
|
//#endregion
|
|
54
45
|
//#region src/helpers/converter.ts
|
|
55
|
-
function
|
|
46
|
+
function P(e) {
|
|
56
47
|
return {
|
|
57
48
|
id: e.id,
|
|
58
49
|
tagName: e.tagName,
|
|
@@ -63,143 +54,240 @@ function D(e) {
|
|
|
63
54
|
children: e.children
|
|
64
55
|
};
|
|
65
56
|
}
|
|
66
|
-
function
|
|
57
|
+
function F(e) {
|
|
67
58
|
return e;
|
|
68
59
|
}
|
|
69
|
-
function
|
|
60
|
+
function I(e) {
|
|
70
61
|
let { record: t, status: n } = e, r = n ?? ("status" in t ? t.status : "unchanged");
|
|
71
62
|
return {
|
|
72
|
-
...
|
|
63
|
+
...P(t),
|
|
73
64
|
status: r
|
|
74
65
|
};
|
|
75
66
|
}
|
|
76
|
-
function
|
|
67
|
+
function L(e) {
|
|
77
68
|
let { record: t, status: n, tree: r } = e, i = r ?? ("tree" in t ? t.tree : []);
|
|
78
69
|
return {
|
|
79
|
-
...
|
|
70
|
+
...I({
|
|
80
71
|
record: t,
|
|
81
72
|
status: n
|
|
82
73
|
}),
|
|
83
74
|
tree: i
|
|
84
75
|
};
|
|
85
76
|
}
|
|
86
|
-
function
|
|
87
|
-
let { dialecteConfig: t, tagName: n, attributes: r } = e;
|
|
77
|
+
function R(e) {
|
|
78
|
+
let { dialecteConfig: t, tagName: n, attributes: r, stored: i = [] } = e;
|
|
88
79
|
return (Array.isArray(r) ? r : Object.entries(r).map(([e, r]) => ({
|
|
89
80
|
name: e,
|
|
90
81
|
value: r,
|
|
91
|
-
namespace:
|
|
92
|
-
|
|
82
|
+
namespace: z({
|
|
83
|
+
dialecteConfig: t,
|
|
84
|
+
tagName: n,
|
|
85
|
+
name: e
|
|
86
|
+
}) ?? i.find((t) => t.name === e)?.namespace
|
|
87
|
+
}))).map((e) => B({
|
|
93
88
|
attribute: e,
|
|
94
89
|
dialecteConfig: t,
|
|
95
90
|
tagName: n
|
|
96
91
|
}));
|
|
97
92
|
}
|
|
98
|
-
function
|
|
99
|
-
let {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
93
|
+
function z(e) {
|
|
94
|
+
let { dialecteConfig: t, tagName: n, name: r } = e, i = t.definition[n];
|
|
95
|
+
if (i === void 0) return;
|
|
96
|
+
let a = Object.values(i.declarations ?? {}), o = [i, ...a].flatMap((e) => e.variants ?? []), s = [
|
|
97
|
+
i,
|
|
98
|
+
...a,
|
|
99
|
+
...o.flatMap((e) => t.types[e] ?? [])
|
|
100
|
+
];
|
|
101
|
+
for (let e of s) {
|
|
102
|
+
let t = e.attributes.details[r]?.namespace;
|
|
103
|
+
if (t) return t;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
function B(e) {
|
|
107
|
+
let { attribute: t, dialecteConfig: n, tagName: r } = e, a;
|
|
108
|
+
typeof t.namespace == "string" ? (a = _(n, t.namespace), a || i("UNKNOWN_NAMESPACE_PREFIX", {
|
|
109
|
+
detail: `Unknown namespace '${t.namespace}' on attribute '${t.name}' — use a registered namespace key or pass a full { name, namespace: { prefix, uri } }.`,
|
|
110
|
+
ref: { tagName: r }
|
|
111
|
+
})) : a = t.namespace;
|
|
112
|
+
let o = t.name.indexOf(":");
|
|
113
|
+
if (!a && o !== -1) {
|
|
114
|
+
let e = t.name.slice(0, o);
|
|
115
|
+
e !== "xmlns" && (a = u(n, e), a || i("UNKNOWN_NAMESPACE_PREFIX", {
|
|
116
|
+
detail: `Unknown namespace prefix '${e}' on attribute '${t.name}' — pass it explicitly as { name, namespace: { prefix, uri } }.`,
|
|
117
|
+
ref: { tagName: r }
|
|
110
118
|
}));
|
|
111
119
|
}
|
|
112
|
-
return
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
namespace:
|
|
120
|
+
return a && a.prefix && a.uri !== "http://www.w3.org/2000/xmlns/" && (a = V({
|
|
121
|
+
dialecteConfig: n,
|
|
122
|
+
uri: a.uri
|
|
123
|
+
}) ?? a), a && a.prefix && a.prefix !== "xmlns" ? {
|
|
124
|
+
...t,
|
|
125
|
+
name: `${a.prefix}:${v(t.name)}`,
|
|
126
|
+
namespace: a
|
|
127
|
+
} : (t.namespace, {
|
|
128
|
+
...t,
|
|
129
|
+
namespace: a
|
|
119
130
|
});
|
|
120
131
|
}
|
|
121
|
-
function
|
|
122
|
-
|
|
132
|
+
function V(e) {
|
|
133
|
+
let { dialecteConfig: t, uri: n } = e;
|
|
134
|
+
return Object.values(t.namespaces).find((e) => e.uri === n && e.prefix !== "");
|
|
135
|
+
}
|
|
136
|
+
function H(e) {
|
|
137
|
+
return f(e, { detail: "The record or ref is undefined" }), {
|
|
123
138
|
id: e.id,
|
|
124
139
|
tagName: e.tagName
|
|
125
140
|
};
|
|
126
141
|
}
|
|
127
142
|
//#endregion
|
|
128
143
|
//#region src/helpers/standardizing.ts
|
|
129
|
-
function
|
|
130
|
-
let { dialecteConfig: t, hooks: n, record:
|
|
131
|
-
|
|
132
|
-
attributes:
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
144
|
+
function U(e) {
|
|
145
|
+
let { dialecteConfig: t, hooks: n, record: r } = e, { id: i, tagName: a, attributes: o, namespace: s, value: c } = r, l = i ?? crypto.randomUUID(), u = W({
|
|
146
|
+
dialecteConfig: t,
|
|
147
|
+
attributes: o ? R({
|
|
148
|
+
tagName: a,
|
|
149
|
+
attributes: o,
|
|
150
|
+
dialecteConfig: t
|
|
151
|
+
}) : []
|
|
152
|
+
}), d = {
|
|
153
|
+
id: l,
|
|
154
|
+
tagName: a,
|
|
155
|
+
attributes: u,
|
|
156
|
+
namespace: s ?? {
|
|
139
157
|
prefix: "prefixNeededForNotSupportedNamespace",
|
|
140
158
|
uri: "uriNeededForNotSupportedNamespace"
|
|
141
159
|
},
|
|
142
|
-
value:
|
|
143
|
-
parent:
|
|
144
|
-
children:
|
|
145
|
-
},
|
|
146
|
-
if (!(t.elements.includes(
|
|
147
|
-
let
|
|
160
|
+
value: c ?? "",
|
|
161
|
+
parent: r.parent ?? null,
|
|
162
|
+
children: r.children ?? []
|
|
163
|
+
}, f = Object.values(t.namespaces).map(({ uri: e }) => e), m = s?.uri != null && !f.includes(s.uri);
|
|
164
|
+
if (!(t.elements.includes(a) && !m)) return d;
|
|
165
|
+
let h = y({
|
|
148
166
|
dialecteConfig: t,
|
|
149
|
-
record:
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
167
|
+
record: {
|
|
168
|
+
...d,
|
|
169
|
+
namespace: s
|
|
170
|
+
}
|
|
171
|
+
}), g = h?.attributes.sequence ?? [], _ = h?.attributes.any, v = _ !== void 0 && (_.namespace === void 0 ? !(_.notNamespace ?? []).includes("") : _.namespace.includes("")), b = u.filter((e) => {
|
|
172
|
+
let t = g.includes(e.name), n = "namespace" in e && e.namespace != null;
|
|
173
|
+
if (!t && !n && !v) return !1;
|
|
153
174
|
let r = e.value === void 0 || e.value === null || e.value === "";
|
|
154
175
|
return !(t && r);
|
|
155
|
-
}),
|
|
156
|
-
if ("namespace" in e && e.namespace?.uri ===
|
|
176
|
+
}), x = t.namespaces.default.uri, S = b.map((e) => {
|
|
177
|
+
if ("namespace" in e && e.namespace?.uri === x) {
|
|
157
178
|
let { namespace: t, ...n } = e;
|
|
158
179
|
return n;
|
|
159
180
|
}
|
|
160
181
|
return e;
|
|
161
|
-
}),
|
|
162
|
-
...
|
|
163
|
-
namespace:
|
|
164
|
-
attributes:
|
|
182
|
+
}), C = t.definition[a], w = [h?.namespace ?? C.namespace, ...Object.values(C.declarations ?? {}).map((e) => e.namespace)], T = w.find((e) => e.uri === s?.uri), E = {
|
|
183
|
+
...d,
|
|
184
|
+
namespace: T ?? s ?? w[0],
|
|
185
|
+
attributes: p(S, g)
|
|
165
186
|
};
|
|
166
|
-
return n?.afterStandardizedRecord && (
|
|
167
|
-
...
|
|
168
|
-
attributes:
|
|
169
|
-
|
|
187
|
+
return n?.afterStandardizedRecord && (E = n.afterStandardizedRecord({ record: E }), E = {
|
|
188
|
+
...E,
|
|
189
|
+
attributes: p(W({
|
|
190
|
+
dialecteConfig: t,
|
|
191
|
+
attributes: E.attributes
|
|
192
|
+
}), g)
|
|
193
|
+
}), E;
|
|
194
|
+
}
|
|
195
|
+
function W(e) {
|
|
196
|
+
let { dialecteConfig: n, attributes: r } = e;
|
|
197
|
+
return t({
|
|
198
|
+
dialecteConfig: n,
|
|
199
|
+
attributes: r,
|
|
200
|
+
namespaceOf: s({
|
|
201
|
+
dialecteConfig: n,
|
|
202
|
+
attributes: r
|
|
203
|
+
})
|
|
204
|
+
});
|
|
170
205
|
}
|
|
171
206
|
//#endregion
|
|
172
207
|
//#region src/helpers/assert-fixed.ts
|
|
173
|
-
function
|
|
174
|
-
let { dialecteConfig:
|
|
175
|
-
for (let
|
|
176
|
-
let
|
|
177
|
-
dialecteConfig:
|
|
178
|
-
record:
|
|
179
|
-
attributeName:
|
|
208
|
+
function G(e) {
|
|
209
|
+
let { dialecteConfig: t, record: n, attributes: r } = e;
|
|
210
|
+
for (let e of r) {
|
|
211
|
+
let r = g({
|
|
212
|
+
dialecteConfig: t,
|
|
213
|
+
record: n,
|
|
214
|
+
attributeName: e.name
|
|
180
215
|
});
|
|
181
|
-
|
|
182
|
-
detail: `Attribute '${
|
|
183
|
-
ref: { tagName:
|
|
216
|
+
r.fixed !== void 0 && e.value !== r.fixed && i("FIXED_VALUE_VIOLATION", {
|
|
217
|
+
detail: `Attribute '${e.name}' on '${n.tagName}' is fixed to '${r.fixed}' but was set to '${String(e.value)}'.`,
|
|
218
|
+
ref: { tagName: n.tagName }
|
|
184
219
|
});
|
|
185
220
|
}
|
|
186
221
|
}
|
|
187
222
|
//#endregion
|
|
223
|
+
//#region src/helpers/assert-xsi-type.ts
|
|
224
|
+
function K(e) {
|
|
225
|
+
let { dialecteConfig: t, record: n } = e, r = n.attributes.find(d);
|
|
226
|
+
if (r === void 0) {
|
|
227
|
+
y({
|
|
228
|
+
dialecteConfig: t,
|
|
229
|
+
record: n
|
|
230
|
+
})?.abstractType && i("XSI_TYPE_REQUIRED", {
|
|
231
|
+
detail: `'${n.tagName}' is declared with an abstract type: name one of its variants with xsi:type (${l({
|
|
232
|
+
dialecteConfig: t,
|
|
233
|
+
record: n
|
|
234
|
+
}).join(", ")}).`,
|
|
235
|
+
ref: { tagName: n.tagName }
|
|
236
|
+
});
|
|
237
|
+
return;
|
|
238
|
+
}
|
|
239
|
+
if (y({
|
|
240
|
+
dialecteConfig: t,
|
|
241
|
+
record: n
|
|
242
|
+
}) === void 0) return;
|
|
243
|
+
let a = b({
|
|
244
|
+
dialecteConfig: t,
|
|
245
|
+
record: n
|
|
246
|
+
});
|
|
247
|
+
if (a?.namespace === "http://www.w3.org/2001/XMLSchema") return;
|
|
248
|
+
let o = l({
|
|
249
|
+
dialecteConfig: t,
|
|
250
|
+
record: n
|
|
251
|
+
});
|
|
252
|
+
a !== void 0 && o.includes(a.clark) || i("XSI_TYPE_NOT_ADMITTED", {
|
|
253
|
+
detail: `'${n.tagName}' may not name the type '${String(r.value)}' with xsi:type; it admits ${o.join(", ") || "none"}.`,
|
|
254
|
+
ref: { tagName: n.tagName },
|
|
255
|
+
meta: {
|
|
256
|
+
value: r.value,
|
|
257
|
+
admitted: o
|
|
258
|
+
}
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
function q(e) {
|
|
262
|
+
let { dialecteConfig: t, merged: n, record: r } = e, a = new Set(r.attributes.map((e) => e.name)), o = n.filter((e) => e.value !== "" && !a.has(e.name)).map((e) => e.name), s = y({
|
|
263
|
+
dialecteConfig: t,
|
|
264
|
+
record: r
|
|
265
|
+
}), c = new Set(s?.children.sequence ?? []), l = s?.children.any ? [] : [...new Set(r.children.map((e) => e.tagName))].filter((e) => !c.has(e));
|
|
266
|
+
o.length === 0 && l.length === 0 || i("XSI_TYPE_CHANGE_LEAVES_CONTENT", {
|
|
267
|
+
detail: `'${r.tagName}' now names a type that does not admit ` + [o.length > 0 ? `the attributes ${o.join(", ")} (clear them in the same update)` : "", l.length > 0 ? `the children ${l.join(", ")} (delete them first)` : ""].filter(Boolean).join(" nor ") + ".",
|
|
268
|
+
ref: { tagName: r.tagName },
|
|
269
|
+
meta: {
|
|
270
|
+
attributes: o,
|
|
271
|
+
children: l
|
|
272
|
+
}
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
//#endregion
|
|
188
276
|
//#region src/helpers/merge-extensions.ts
|
|
189
|
-
function
|
|
277
|
+
function J(e, t, n, r) {
|
|
190
278
|
if (!e || !t) return;
|
|
191
|
-
let
|
|
192
|
-
i
|
|
279
|
+
let i = Object.keys(t).filter((t) => t in e);
|
|
280
|
+
f(i.length === 0, {
|
|
193
281
|
key: "EXTENSION_METHOD_COLLISION",
|
|
194
|
-
detail: `Module "${n}" has conflicting ${r} method(s): ${
|
|
282
|
+
detail: `Module "${n}" has conflicting ${r} method(s): ${i.map((e) => `"${e}"`).join(", ")}`
|
|
195
283
|
});
|
|
196
284
|
}
|
|
197
|
-
function
|
|
285
|
+
function Y(e) {
|
|
198
286
|
let t = {}, n = {}, r = [...Object.entries(e.base ?? {}), ...Object.entries(e.custom ?? {})];
|
|
199
|
-
for (let [e, i] of r) i.query && (
|
|
287
|
+
for (let [e, i] of r) i.query && (J(t[e], i.query, e, "query"), t[e] = {
|
|
200
288
|
...t[e],
|
|
201
289
|
...i.query
|
|
202
|
-
}), i.transaction && (
|
|
290
|
+
}), i.transaction && (J(n[e], i.transaction, e, "transaction"), n[e] = {
|
|
203
291
|
...n[e],
|
|
204
292
|
...i.transaction
|
|
205
293
|
});
|
|
@@ -210,15 +298,15 @@ function L(e) {
|
|
|
210
298
|
}
|
|
211
299
|
//#endregion
|
|
212
300
|
//#region src/helpers/strip-attributes.ts
|
|
213
|
-
function
|
|
301
|
+
function X(e, t) {
|
|
214
302
|
let n = new Set(t), r = {
|
|
215
303
|
...e,
|
|
216
304
|
attributes: e.attributes.filter((e) => !n.has(e.name))
|
|
217
305
|
};
|
|
218
306
|
return "tree" in e ? {
|
|
219
307
|
...r,
|
|
220
|
-
tree: e.tree.map((e) =>
|
|
308
|
+
tree: e.tree.map((e) => X(e, t))
|
|
221
309
|
} : r;
|
|
222
310
|
}
|
|
223
311
|
//#endregion
|
|
224
|
-
export {
|
|
312
|
+
export { c as CUSTOM_RECORD_ID_ATTRIBUTE, r as CUSTOM_RECORD_ID_ATTRIBUTE_NAME, n as DIALECTE_DEV_NAMESPACE, o as DIALECTE_NAMESPACES, h as XMLNS_NAMESPACE_URI, e as XMLNS_XSI_NAMESPACE, m as XSD_NAMESPACE_URI, a as XSI_NAMESPACE, G as assertNoFixedViolation, K as assertXsiTypeAdmitted, q as assertXsiTypeChangeLeavesNothing, N as isAttributeOf, A as isChildOf, M as isElementOf, T as isFullAttributeArray, j as isParentOf, E as isRawRecord, k as isRecordOf, D as isTrackedRecord, O as isTreeRecord, Y as mergeExtensions, U as standardizeRecord, X as stripAttributes, R as toFullAttributeArray, P as toRawRecord, H as toRef, I as toTrackedRecord, L as toTreeRecord, F as widen };
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { $ as e, A as t, B as n, C as r, D as i, E as a, F as o, G as s, H as c, I as l, J as u, K as d, L as f, M as p, N as m, O as h, P as g, Q as _, R as v, S as y, T as b, U as x, W as S, X as C, Y as w, Z as T, _ as E, a as D, at as O, b as k, c as A, ct as j, d as M, dt as N, et as P, f as F, ft as I, g as L, h as R, ht as z, i as B, it as V, j as H, k as U, l as W, lt as G, m as K, n as q, nt as J, o as Y, ot as X, p as Z, pt as Q, q as $, r as ee, rt as te, s as ne, st as re, t as ie, tt as ae, u as oe, ut as se, v as ce, w as le, x as ue, y as de, z as fe } from "./project-
|
|
2
|
-
import {
|
|
3
|
-
export { U as AnyQuery, i as AnyTransaction, M as BLOBS_SCHEMA, F as BLOB_DATA_SCHEMA, Z as CHANGELOG_SCHEMA, K as DOCUMENTS_SCHEMA, oe as DexieStore, le as Document,
|
|
1
|
+
import { $ as e, A as t, B as n, C as r, D as i, E as a, F as o, G as s, H as c, I as l, J as u, K as d, L as f, M as p, N as m, O as h, P as g, Q as _, R as v, S as y, T as b, U as x, W as S, X as C, Y as w, Z as T, _ as E, a as D, at as O, b as k, c as A, ct as j, d as M, dt as N, et as P, f as F, ft as I, g as L, h as R, ht as z, i as B, it as V, j as H, k as U, l as W, lt as G, m as K, n as q, nt as J, o as Y, ot as X, p as Z, pt as Q, q as $, r as ee, rt as te, s as ne, st as re, t as ie, tt as ae, u as oe, ut as se, v as ce, w as le, x as ue, y as de, z as fe } from "./project-DwtNI4J5.js";
|
|
2
|
+
import { F as pe, I as me, L as he, N as ge, P as _e, R as ve } from "./utils-CZ12wsuC.js";
|
|
3
|
+
export { U as AnyQuery, i as AnyTransaction, M as BLOBS_SCHEMA, F as BLOB_DATA_SCHEMA, Z as CHANGELOG_SCHEMA, K as DOCUMENTS_SCHEMA, oe as DexieStore, le as Document, ve as ERROR_CATALOG, W as InMemoryStore, R as META_SCHEMA, m as NOOP_PERF, g as ParseSession, ie as Project, h as Query, L as TABLE_BLOBS, E as TABLE_BLOB_PREFIX, ce as TABLE_CHANGELOG, de as TABLE_DOCUMENTS, k as TABLE_META, ue as TABLE_RECORD_PREFIX, fe as TEMP_IDB_ID_ATTRIBUTE_NAME, a as Transaction, d as applyOmit, s as applyOrder, C as applyUnwrap, z as bindExtensions, y as blobTableName, B as buildDocumentState, l as buildXmlDocument, x as collectSnapshotRecords, ge as createDialecteError, p as createPerf, Q as createStagedOperations, _e as defineErrors, f as downloadFile, Y as exportBlob, ne as exportDocument, O as findAncestors, te as findByAttributes, J as findDescendants, n as formatXml, P as getAttribute, ae as getAttributeFullObject, _ as getAttributes, e as getAttributesFullObject, re as getChild, X as getChildren, T as getDefinition, se as getRecord, G as getRecords, j as getRecordsByTagName, t as getSnapshot, S as getTree, ee as importDocument, N as indexStagedDeletesByParent, q as initEmptyDocument, o as inspectXml, pe as isKnownDialecteError, $ as isOmitted, b as isTransactionContext, V as matchesAttributeFilter, I as overlayAllStaged, u as parseOmit, H as parseXmlFile, D as reconcileDocumentState, r as recordTableName, c as recordsToTree, A as resolveStore, w as shouldStopTraversal, me as throwDialecteError, he as toDialecteError, v as xmlDocumentToString };
|