@knkcs/importhub-ui 0.7.0 → 0.9.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 +14 -0
- package/README.md +3 -3
- package/dist/field-tree-CghMgGKm.js +108 -0
- package/dist/field-tree-CghMgGKm.js.map +1 -0
- package/dist/{importhub-client-BS6F4DW2.js → importhub-client-Wrb4s3lw.js} +16 -10
- package/dist/importhub-client-Wrb4s3lw.js.map +1 -0
- package/dist/index.d.ts +161 -0
- package/dist/index.js +994 -966
- package/dist/index.js.map +1 -1
- package/dist/mapping-editor.d.ts +66 -0
- package/dist/mapping-editor.js +806 -662
- package/dist/mapping-editor.js.map +1 -1
- package/dist/{mapping-page-Lu48SY_L.js → mapping-page-BTEJR0-z.js} +136 -134
- package/dist/{mapping-page-Lu48SY_L.js.map → mapping-page-BTEJR0-z.js.map} +1 -1
- package/dist/testing.d.ts +72 -0
- package/dist/testing.js +572 -418
- package/dist/testing.js.map +1 -1
- package/package.json +1 -1
- package/dist/importhub-client-BS6F4DW2.js.map +0 -1
package/dist/testing.js
CHANGED
|
@@ -1,38 +1,40 @@
|
|
|
1
|
-
import { createHostMembers as
|
|
2
|
-
import { A as
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { createHostMembers as Se } from "@knkcs/anker/host";
|
|
2
|
+
import { M as O, A as pe, S as B, R as ee, C as ce, N as we } from "./importhub-client-Wrb4s3lw.js";
|
|
3
|
+
import { p as Pe } from "./field-tree-CghMgGKm.js";
|
|
4
|
+
const b = "user_stub_ada", H = "user_stub_grace", ne = "ws_stub_main", De = "ws_stub_other";
|
|
5
|
+
function Ze(n = ne) {
|
|
5
6
|
return {
|
|
6
|
-
userId:
|
|
7
|
-
workspaceId:
|
|
8
|
-
members:
|
|
9
|
-
{ userId:
|
|
10
|
-
{ userId:
|
|
7
|
+
userId: b,
|
|
8
|
+
workspaceId: n,
|
|
9
|
+
members: Se([
|
|
10
|
+
{ userId: b, displayName: "Ada Importer", email: "ada@example.com" },
|
|
11
|
+
{ userId: H, displayName: "Grace Hopper", email: "grace@example.com" }
|
|
11
12
|
])
|
|
12
13
|
};
|
|
13
14
|
}
|
|
14
|
-
const
|
|
15
|
-
accessor:
|
|
16
|
-
path:
|
|
17
|
-
fieldType:
|
|
18
|
-
label:
|
|
19
|
-
children:
|
|
20
|
-
}),
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
15
|
+
const S = (n, a, o, m = []) => ({
|
|
16
|
+
accessor: n.split(".").pop() ?? n,
|
|
17
|
+
path: n,
|
|
18
|
+
fieldType: a,
|
|
19
|
+
label: o,
|
|
20
|
+
children: m
|
|
21
|
+
}), q = (n) => n.flatMap((a) => [a.path, ...q(a.children)]), de = (n) => [
|
|
22
|
+
S("titel", "text", "Titel"),
|
|
23
|
+
S("abkuerzung", "text", "Abkürzung"),
|
|
24
|
+
S("anzeigename", "textarea", "Anzeigename"),
|
|
25
|
+
...n ? [S("fussnote", "rich_text", "Fußnote")] : [],
|
|
26
|
+
S("stand", "fieldset", "Stand", [
|
|
27
|
+
S("stand.datum", "date", "Datum"),
|
|
28
|
+
S("stand.art", "select", "Art")
|
|
27
29
|
])
|
|
28
|
-
],
|
|
29
|
-
|
|
30
|
-
|
|
30
|
+
], me = () => [
|
|
31
|
+
S("fundstelle", "text", "Fundstelle"),
|
|
32
|
+
S("ausgabedatum", "date", "Ausgabedatum")
|
|
31
33
|
];
|
|
32
34
|
function ge() {
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
35
|
+
const n = de(!1), a = de(!0), o = [
|
|
36
|
+
S("aktenzeichen", "text", "Aktenzeichen"),
|
|
37
|
+
S("datum", "date", "Datum")
|
|
36
38
|
];
|
|
37
39
|
return [
|
|
38
40
|
{
|
|
@@ -40,30 +42,30 @@ function ge() {
|
|
|
40
42
|
blueprintId: "bp_stub_gesetz",
|
|
41
43
|
blueprintName: "Gesetz",
|
|
42
44
|
label: "Release 2",
|
|
43
|
-
fieldPaths:
|
|
44
|
-
fields:
|
|
45
|
-
releaseSpecFields:
|
|
45
|
+
fieldPaths: q(n),
|
|
46
|
+
fields: n,
|
|
47
|
+
releaseSpecFields: me()
|
|
46
48
|
},
|
|
47
49
|
{
|
|
48
50
|
id: "br_stub_gesetz_1",
|
|
49
51
|
blueprintId: "bp_stub_gesetz",
|
|
50
52
|
blueprintName: "Gesetz",
|
|
51
53
|
label: "Release 1",
|
|
52
|
-
fieldPaths:
|
|
53
|
-
fields:
|
|
54
|
-
releaseSpecFields:
|
|
54
|
+
fieldPaths: q(a),
|
|
55
|
+
fields: a,
|
|
56
|
+
releaseSpecFields: me()
|
|
55
57
|
},
|
|
56
58
|
{
|
|
57
59
|
id: "br_stub_entscheidung_1",
|
|
58
60
|
blueprintId: "bp_stub_entscheidung",
|
|
59
61
|
blueprintName: "Entscheidung",
|
|
60
62
|
label: "Release 1",
|
|
61
|
-
fieldPaths:
|
|
62
|
-
fields:
|
|
63
|
+
fieldPaths: q(o),
|
|
64
|
+
fields: o
|
|
63
65
|
}
|
|
64
66
|
];
|
|
65
67
|
}
|
|
66
|
-
function
|
|
68
|
+
function Te() {
|
|
67
69
|
return [
|
|
68
70
|
{
|
|
69
71
|
id: "mp_stub_norm",
|
|
@@ -95,7 +97,13 @@ function Ie() {
|
|
|
95
97
|
}
|
|
96
98
|
];
|
|
97
99
|
}
|
|
98
|
-
|
|
100
|
+
const je = `<?xml version="1.0" encoding="UTF-8"?>
|
|
101
|
+
<gesetz>
|
|
102
|
+
<norm id="n1"><titel>§ 1 Geltungsbereich</titel><fn>Gilt ab 2026.</fn></norm>
|
|
103
|
+
<norm id="n2"><titel>§ 2 Begriffsbestimmungen</titel></norm>
|
|
104
|
+
</gesetz>
|
|
105
|
+
`;
|
|
106
|
+
function ve() {
|
|
99
107
|
return [
|
|
100
108
|
{
|
|
101
109
|
id: "es_stub_latin1",
|
|
@@ -108,7 +116,7 @@ function Se() {
|
|
|
108
116
|
}
|
|
109
117
|
];
|
|
110
118
|
}
|
|
111
|
-
function
|
|
119
|
+
function $e() {
|
|
112
120
|
return [
|
|
113
121
|
{
|
|
114
122
|
id: "ip_stub_gesetz",
|
|
@@ -139,12 +147,12 @@ function we() {
|
|
|
139
147
|
}
|
|
140
148
|
];
|
|
141
149
|
}
|
|
142
|
-
const
|
|
150
|
+
const te = (n, a, o, m = "") => ({
|
|
143
151
|
field_type: "text",
|
|
144
|
-
config: { name:
|
|
152
|
+
config: { name: a, api_accessor: n, required: o, instructions: m },
|
|
145
153
|
system: !1
|
|
146
154
|
});
|
|
147
|
-
function
|
|
155
|
+
function Ee() {
|
|
148
156
|
return [
|
|
149
157
|
{
|
|
150
158
|
name: "citation-links",
|
|
@@ -166,8 +174,8 @@ function Pe() {
|
|
|
166
174
|
target: "source_file",
|
|
167
175
|
description: "Renames every element of one name to another.",
|
|
168
176
|
settingsSpec: [
|
|
169
|
-
|
|
170
|
-
|
|
177
|
+
te("from", "Element", !0, "The element's name now."),
|
|
178
|
+
te("to", "New name", !0)
|
|
171
179
|
]
|
|
172
180
|
},
|
|
173
181
|
{
|
|
@@ -175,11 +183,11 @@ function Pe() {
|
|
|
175
183
|
kind: "preprocessor",
|
|
176
184
|
target: "source_file",
|
|
177
185
|
description: "Wraps each sentence of an element in its own element.",
|
|
178
|
-
settingsSpec: [
|
|
186
|
+
settingsSpec: [te("element", "Element", !1)]
|
|
179
187
|
}
|
|
180
188
|
];
|
|
181
189
|
}
|
|
182
|
-
const
|
|
190
|
+
const M = (n = {}) => ({
|
|
183
191
|
matched: 0,
|
|
184
192
|
created: 0,
|
|
185
193
|
problems: 0,
|
|
@@ -187,13 +195,13 @@ const $ = (r = {}) => ({
|
|
|
187
195
|
corrected: 0,
|
|
188
196
|
kept: 0,
|
|
189
197
|
unchanged: 0,
|
|
190
|
-
...
|
|
191
|
-
}),
|
|
198
|
+
...n
|
|
199
|
+
}), v = (n) => ({
|
|
192
200
|
importProfile: {
|
|
193
201
|
configurationId: "ip_stub_gesetz",
|
|
194
202
|
name: "Boorberg gesetz",
|
|
195
|
-
releaseId: `ip_stub_gesetz_rel${
|
|
196
|
-
number:
|
|
203
|
+
releaseId: `ip_stub_gesetz_rel${n}`,
|
|
204
|
+
number: n
|
|
197
205
|
},
|
|
198
206
|
mappings: [
|
|
199
207
|
{
|
|
@@ -209,53 +217,53 @@ const $ = (r = {}) => ({
|
|
|
209
217
|
releaseId: "es_stub_latin1_rel1",
|
|
210
218
|
number: 1
|
|
211
219
|
}
|
|
212
|
-
}),
|
|
220
|
+
}), E = (n) => ({
|
|
213
221
|
importProfileId: "ip_stub_gesetz",
|
|
214
222
|
importProfileName: "Boorberg gesetz",
|
|
215
|
-
sourceFileId: `sf_${
|
|
216
|
-
startedBy:
|
|
223
|
+
sourceFileId: `sf_${n.id}`,
|
|
224
|
+
startedBy: b,
|
|
217
225
|
phase: "ended",
|
|
218
226
|
failureReason: "",
|
|
219
227
|
progress: { done: 0, total: 0 },
|
|
220
|
-
counts:
|
|
228
|
+
counts: M(),
|
|
221
229
|
changeSetId: "",
|
|
222
|
-
releases:
|
|
230
|
+
releases: v(2),
|
|
223
231
|
createTime: "2026-11-03T09:00:00.000Z",
|
|
224
232
|
startTime: "",
|
|
225
233
|
endTime: "",
|
|
226
234
|
cancelledBy: "",
|
|
227
235
|
effectiveDate: "",
|
|
228
|
-
...
|
|
229
|
-
}),
|
|
230
|
-
id: `prob_stub_${
|
|
231
|
-
mappingId:
|
|
232
|
-
mappingName:
|
|
233
|
-
sourceKey:
|
|
234
|
-
field:
|
|
235
|
-
reason:
|
|
236
|
+
...n
|
|
237
|
+
}), x = (n, a, o, m, g) => ({
|
|
238
|
+
id: `prob_stub_${n}`,
|
|
239
|
+
mappingId: a === "norm" ? "mp_stub_norm" : "mp_stub_title",
|
|
240
|
+
mappingName: a === "norm" ? "Gesetz norms" : "Gesetz titles",
|
|
241
|
+
sourceKey: o,
|
|
242
|
+
field: m,
|
|
243
|
+
reason: g
|
|
236
244
|
});
|
|
237
|
-
function
|
|
245
|
+
function Re() {
|
|
238
246
|
return [
|
|
239
|
-
|
|
247
|
+
E({
|
|
240
248
|
id: "im_stub_running",
|
|
241
249
|
phase: "writing",
|
|
242
250
|
progress: { done: 48, total: 120 },
|
|
243
|
-
counts:
|
|
251
|
+
counts: M({ matched: 120, created: 40, planned: 8 }),
|
|
244
252
|
changeSetId: "cs_stub_running",
|
|
245
253
|
createTime: "2026-11-04T10:00:00.000Z",
|
|
246
254
|
startTime: "2026-11-04T10:00:05.000Z"
|
|
247
255
|
}),
|
|
248
|
-
|
|
256
|
+
E({
|
|
249
257
|
id: "im_stub_queued",
|
|
250
258
|
phase: "queued",
|
|
251
|
-
startedBy:
|
|
252
|
-
releases:
|
|
259
|
+
startedBy: H,
|
|
260
|
+
releases: v(2),
|
|
253
261
|
createTime: "2026-11-04T10:05:00.000Z"
|
|
254
262
|
}),
|
|
255
|
-
|
|
263
|
+
E({
|
|
256
264
|
id: "im_stub_problems",
|
|
257
265
|
outcome: "succeeded_with_problems",
|
|
258
|
-
counts:
|
|
266
|
+
counts: M({
|
|
259
267
|
matched: 212,
|
|
260
268
|
created: 180,
|
|
261
269
|
planned: 20,
|
|
@@ -265,9 +273,9 @@ function ve() {
|
|
|
265
273
|
}),
|
|
266
274
|
changeSetId: "cs_stub_problems",
|
|
267
275
|
releases: {
|
|
268
|
-
...
|
|
276
|
+
...v(2),
|
|
269
277
|
mappings: [
|
|
270
|
-
...
|
|
278
|
+
...v(2).mappings,
|
|
271
279
|
{
|
|
272
280
|
configurationId: "mp_stub_title",
|
|
273
281
|
name: "Gesetz titles",
|
|
@@ -282,52 +290,52 @@ function ve() {
|
|
|
282
290
|
effectiveDate: "2026-10-01",
|
|
283
291
|
source: { date: "2026-09-20", reference: "BGBl. 2026 I Nr. 270" },
|
|
284
292
|
itemProblems: [
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
293
|
+
x(1, "norm", "BJNR000010001", "stand/datum", "“31.02.2026” is not a date."),
|
|
294
|
+
x(2, "norm", "BJNR000010002", "", "The Version Match found two Releases."),
|
|
295
|
+
x(3, "title", "BJNR000020001", "", "No Title has the Ausgabe code BY-7."),
|
|
296
|
+
x(4, "norm", "BJNR000030001", "titel", "The field is required."),
|
|
297
|
+
x(5, "title", "BJNR000030002", "", "No Title has the Ausgabe code BY-9.")
|
|
290
298
|
]
|
|
291
299
|
}),
|
|
292
|
-
|
|
300
|
+
E({
|
|
293
301
|
id: "im_stub_succeeded",
|
|
294
302
|
outcome: "succeeded",
|
|
295
|
-
counts:
|
|
303
|
+
counts: M({ matched: 64, created: 64 }),
|
|
296
304
|
changeSetId: "cs_stub_succeeded",
|
|
297
|
-
releases:
|
|
305
|
+
releases: v(1),
|
|
298
306
|
createTime: "2026-11-02T14:00:00.000Z",
|
|
299
307
|
startTime: "2026-11-02T14:00:01.000Z",
|
|
300
308
|
endTime: "2026-11-02T14:03:10.000Z"
|
|
301
309
|
}),
|
|
302
|
-
|
|
310
|
+
E({
|
|
303
311
|
id: "im_stub_failed",
|
|
304
312
|
outcome: "failed",
|
|
305
313
|
failureReason: "The worker crashed three times running this Import.",
|
|
306
|
-
counts:
|
|
307
|
-
releases:
|
|
314
|
+
counts: M({ matched: 30 }),
|
|
315
|
+
releases: v(1),
|
|
308
316
|
createTime: "2026-11-02T11:00:00.000Z",
|
|
309
317
|
startTime: "2026-11-02T11:00:01.000Z",
|
|
310
318
|
endTime: "2026-11-02T11:20:00.000Z"
|
|
311
319
|
}),
|
|
312
|
-
|
|
320
|
+
E({
|
|
313
321
|
id: "im_stub_cancelled",
|
|
314
322
|
outcome: "cancelled",
|
|
315
|
-
cancelledBy:
|
|
316
|
-
counts:
|
|
317
|
-
releases:
|
|
323
|
+
cancelledBy: H,
|
|
324
|
+
counts: M({ matched: 12, created: 3 }),
|
|
325
|
+
releases: v(1),
|
|
318
326
|
createTime: "2026-11-01T16:00:00.000Z",
|
|
319
327
|
startTime: "2026-11-01T16:00:01.000Z",
|
|
320
328
|
endTime: "2026-11-01T16:01:00.000Z"
|
|
321
329
|
})
|
|
322
330
|
];
|
|
323
331
|
}
|
|
324
|
-
function
|
|
332
|
+
function Me() {
|
|
325
333
|
return [
|
|
326
334
|
{
|
|
327
335
|
id: "key_stub_nightly",
|
|
328
336
|
name: "Nightly gesetz feed",
|
|
329
337
|
keyPrefix: "ihk_7Qx2",
|
|
330
|
-
owner:
|
|
338
|
+
owner: H,
|
|
331
339
|
expireTime: "",
|
|
332
340
|
createTime: "2026-11-20T07:30:00.000Z"
|
|
333
341
|
},
|
|
@@ -335,13 +343,115 @@ function Te() {
|
|
|
335
343
|
id: "key_stub_pipeline",
|
|
336
344
|
name: "VRPML pipeline",
|
|
337
345
|
keyPrefix: "ihk_b91F",
|
|
338
|
-
owner:
|
|
346
|
+
owner: b,
|
|
339
347
|
expireTime: "2027-06-30T21:59:59.000Z",
|
|
340
348
|
createTime: "2026-11-03T12:00:00.000Z"
|
|
341
349
|
}
|
|
342
350
|
];
|
|
343
351
|
}
|
|
344
|
-
const
|
|
352
|
+
const ke = /* @__PURE__ */ new Set(["amp", "lt", "gt", "quot", "apos"]);
|
|
353
|
+
function Ne(n, a) {
|
|
354
|
+
return n.replace(
|
|
355
|
+
/&([A-Za-z_][\w.-]*);/g,
|
|
356
|
+
(o, m) => !ke.has(m) && m in a ? a[m] ?? o : o
|
|
357
|
+
);
|
|
358
|
+
}
|
|
359
|
+
function Ae(n, a) {
|
|
360
|
+
if (typeof DOMParser > "u")
|
|
361
|
+
throw new Error("the stub's Mapping Test reads the sample with the DOM: run it in a browser");
|
|
362
|
+
const o = new DOMParser().parseFromString(a, "application/xml"), m = o.getElementsByTagName("parsererror")[0];
|
|
363
|
+
if (m)
|
|
364
|
+
throw new O(
|
|
365
|
+
`the sample is not XML: ${(m.textContent ?? "").split(`
|
|
366
|
+
`)[0]}`
|
|
367
|
+
);
|
|
368
|
+
const g = n.elementSelector?.trim() ?? "";
|
|
369
|
+
if (!g) throw new O("the Mapping has no element selector");
|
|
370
|
+
const y = (() => {
|
|
371
|
+
try {
|
|
372
|
+
const d = o.evaluate(g, o, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
|
|
373
|
+
return Array.from({ length: d.snapshotLength }, (h, _) => d.snapshotItem(_));
|
|
374
|
+
} catch {
|
|
375
|
+
throw new O(`the element selector ${g} cannot be evaluated`);
|
|
376
|
+
}
|
|
377
|
+
})(), r = n.sourceKey?.selector?.trim() ?? "";
|
|
378
|
+
return {
|
|
379
|
+
elements: y.map((d, h) => {
|
|
380
|
+
const _ = [];
|
|
381
|
+
let w = "";
|
|
382
|
+
if (r)
|
|
383
|
+
try {
|
|
384
|
+
w = _e(o, r, d).trim();
|
|
385
|
+
} catch {
|
|
386
|
+
throw new O(`the Source Key ${r} cannot be evaluated`);
|
|
387
|
+
}
|
|
388
|
+
w || _.push({ field: "", reason: "the element has no Source Key" });
|
|
389
|
+
const I = ye(o, n.fields ?? [], d, "", _);
|
|
390
|
+
return {
|
|
391
|
+
position: h + 1,
|
|
392
|
+
sourceKey: w,
|
|
393
|
+
values: I,
|
|
394
|
+
firstDay: "",
|
|
395
|
+
lastDay: "",
|
|
396
|
+
releaseSpec: {},
|
|
397
|
+
displayName: "",
|
|
398
|
+
collections: [...n.collections ?? []],
|
|
399
|
+
problems: _
|
|
400
|
+
};
|
|
401
|
+
})
|
|
402
|
+
};
|
|
403
|
+
}
|
|
404
|
+
function _e(n, a, o) {
|
|
405
|
+
return n.evaluate(`string(${a})`, o, null, XPathResult.STRING_TYPE, null).stringValue;
|
|
406
|
+
}
|
|
407
|
+
function ye(n, a, o, m, g) {
|
|
408
|
+
const y = {};
|
|
409
|
+
for (const r of a) {
|
|
410
|
+
const d = typeof r.name == "string" ? r.name : "";
|
|
411
|
+
if (!d) continue;
|
|
412
|
+
const h = m ? `${m}.${d}` : d, _ = typeof r.selector == "string" ? r.selector.trim() : "";
|
|
413
|
+
if (r.type === "fieldset") {
|
|
414
|
+
let I = o;
|
|
415
|
+
if (_ && _ !== ".")
|
|
416
|
+
try {
|
|
417
|
+
I = n.evaluate(
|
|
418
|
+
_,
|
|
419
|
+
o,
|
|
420
|
+
null,
|
|
421
|
+
XPathResult.FIRST_ORDERED_NODE_TYPE,
|
|
422
|
+
null
|
|
423
|
+
).singleNodeValue;
|
|
424
|
+
} catch {
|
|
425
|
+
I = null;
|
|
426
|
+
}
|
|
427
|
+
if (!I) {
|
|
428
|
+
r.optional || g.push({ field: h, reason: `nothing at ${_}` });
|
|
429
|
+
continue;
|
|
430
|
+
}
|
|
431
|
+
const k = Array.isArray(r.fields) ? r.fields : [];
|
|
432
|
+
y[d] = ye(n, k, I, h, g);
|
|
433
|
+
continue;
|
|
434
|
+
}
|
|
435
|
+
if (!_) {
|
|
436
|
+
g.push({ field: h, reason: "the field has no XPath" });
|
|
437
|
+
continue;
|
|
438
|
+
}
|
|
439
|
+
let w;
|
|
440
|
+
try {
|
|
441
|
+
w = _e(n, _, o).trim();
|
|
442
|
+
} catch {
|
|
443
|
+
g.push({ field: h, reason: `the XPath ${_} cannot be evaluated` });
|
|
444
|
+
continue;
|
|
445
|
+
}
|
|
446
|
+
if (!w) {
|
|
447
|
+
r.optional || g.push({ field: h, reason: `nothing at ${_}` });
|
|
448
|
+
continue;
|
|
449
|
+
}
|
|
450
|
+
y[d] = w;
|
|
451
|
+
}
|
|
452
|
+
return y;
|
|
453
|
+
}
|
|
454
|
+
const Be = [
|
|
345
455
|
"listImportProfiles",
|
|
346
456
|
"getImportProfile",
|
|
347
457
|
"createImportProfile",
|
|
@@ -355,6 +465,7 @@ const Re = [
|
|
|
355
465
|
"deleteMapping",
|
|
356
466
|
"listMappingImportProfiles",
|
|
357
467
|
"checkMappingBlueprintRelease",
|
|
468
|
+
"runMappingTest",
|
|
358
469
|
"listEntitySets",
|
|
359
470
|
"getEntitySet",
|
|
360
471
|
"createEntitySet",
|
|
@@ -374,90 +485,90 @@ const Re = [
|
|
|
374
485
|
"createApiKey",
|
|
375
486
|
"revokeApiKey"
|
|
376
487
|
];
|
|
377
|
-
let
|
|
378
|
-
const
|
|
379
|
-
const
|
|
380
|
-
id: `${
|
|
381
|
-
content: structuredClone(
|
|
382
|
-
savedBy:
|
|
383
|
-
savedAt:
|
|
488
|
+
let ue = Date.parse("2026-11-02T08:00:00Z");
|
|
489
|
+
const $ = () => (ue += 36e5, new Date(ue).toISOString()), se = (n = []) => n.map((a) => {
|
|
490
|
+
const o = Math.max(a.releaseNumber ?? 0, 1), m = Array.from({ length: o }, (y, r) => ({
|
|
491
|
+
id: `${a.id}_r${r + 1}`,
|
|
492
|
+
content: structuredClone(a.content),
|
|
493
|
+
savedBy: b,
|
|
494
|
+
savedAt: $(),
|
|
384
495
|
restoredFromRevisionId: ""
|
|
385
|
-
})),
|
|
386
|
-
id: `${
|
|
387
|
-
number:
|
|
388
|
-
revisionId: `${
|
|
389
|
-
releasedBy:
|
|
390
|
-
releasedAt:
|
|
496
|
+
})), g = Array.from({ length: a.releaseNumber ?? 0 }, (y, r) => ({
|
|
497
|
+
id: `${a.id}_rel${r + 1}`,
|
|
498
|
+
number: r + 1,
|
|
499
|
+
revisionId: `${a.id}_r${r + 1}`,
|
|
500
|
+
releasedBy: b,
|
|
501
|
+
releasedAt: $()
|
|
391
502
|
}));
|
|
392
|
-
return { id:
|
|
393
|
-
}),
|
|
394
|
-
const
|
|
503
|
+
return { id: a.id, content: structuredClone(a.content), revisions: m, releases: g };
|
|
504
|
+
}), F = (n) => n.revisions[n.revisions.length - 1], be = (n) => n.releases[n.releases.length - 1], G = (n) => {
|
|
505
|
+
const a = be(n), o = n.revisions.find((m) => m.id === a?.revisionId);
|
|
395
506
|
return {
|
|
396
|
-
draftRevisionId:
|
|
507
|
+
draftRevisionId: F(n).id,
|
|
397
508
|
// By content, as importhub compares: a draft that restored the
|
|
398
509
|
// released content does not differ.
|
|
399
|
-
draftDiffersFromRelease: !
|
|
400
|
-
...
|
|
510
|
+
draftDiffersFromRelease: !o || JSON.stringify(o.content) !== JSON.stringify(F(n).content),
|
|
511
|
+
...a ? { latestRelease: { id: a.id, number: a.number } } : {}
|
|
401
512
|
};
|
|
402
|
-
},
|
|
403
|
-
Object.entries(
|
|
404
|
-
), R = (
|
|
405
|
-
valid:
|
|
406
|
-
reasons:
|
|
407
|
-
}),
|
|
408
|
-
let
|
|
409
|
-
function
|
|
410
|
-
const
|
|
513
|
+
}, xe = (n) => n.replace(/[A-Z]/g, (a) => `_${a.toLowerCase()}`), fe = (n) => Object.fromEntries(
|
|
514
|
+
Object.entries(n).map(([a, o]) => [xe(a), o])
|
|
515
|
+
), R = (n) => ({
|
|
516
|
+
valid: n.length === 0,
|
|
517
|
+
reasons: n
|
|
518
|
+
}), L = (n) => [...n].sort((a, o) => a.content.name.localeCompare(o.content.name));
|
|
519
|
+
let he = 0;
|
|
520
|
+
function Ge(n = {}) {
|
|
521
|
+
const a = Object.fromEntries(
|
|
411
522
|
Object.entries(
|
|
412
|
-
|
|
413
|
-
[
|
|
414
|
-
importProfiles:
|
|
415
|
-
mappings:
|
|
416
|
-
entitySets:
|
|
417
|
-
imports:
|
|
418
|
-
apiKeys:
|
|
523
|
+
n.workspaces ?? {
|
|
524
|
+
[ne]: {
|
|
525
|
+
importProfiles: $e(),
|
|
526
|
+
mappings: Te(),
|
|
527
|
+
entitySets: ve(),
|
|
528
|
+
imports: Re(),
|
|
529
|
+
apiKeys: Me()
|
|
419
530
|
}
|
|
420
531
|
}
|
|
421
532
|
).map(([e, t]) => [
|
|
422
533
|
e,
|
|
423
534
|
{
|
|
424
|
-
importProfiles:
|
|
425
|
-
mappings:
|
|
426
|
-
entitySets:
|
|
535
|
+
importProfiles: se(t.importProfiles),
|
|
536
|
+
mappings: se(t.mappings),
|
|
537
|
+
entitySets: se(t.entitySets),
|
|
427
538
|
imports: structuredClone(t.imports ?? []),
|
|
428
539
|
apiKeys: structuredClone(t.apiKeys ?? [])
|
|
429
540
|
}
|
|
430
541
|
])
|
|
431
|
-
),
|
|
432
|
-
let
|
|
433
|
-
const y = Object.fromEntries(
|
|
542
|
+
), o = n.processors ?? Ee(), m = n.blueprintReleases ?? ge();
|
|
543
|
+
let g = n.activeWorkspaceId ?? ne;
|
|
544
|
+
const y = Object.fromEntries(Be.map((e) => [e, 0])), r = () => (a[g] ??= {
|
|
434
545
|
importProfiles: [],
|
|
435
546
|
mappings: [],
|
|
436
547
|
entitySets: [],
|
|
437
548
|
imports: [],
|
|
438
549
|
apiKeys: []
|
|
439
|
-
},
|
|
440
|
-
if (y[e]++,
|
|
550
|
+
}, a[g]), d = async (e, t) => {
|
|
551
|
+
if (y[e]++, n.fail) throw n.fail;
|
|
441
552
|
return structuredClone(t());
|
|
442
|
-
},
|
|
443
|
-
const
|
|
444
|
-
if (!
|
|
445
|
-
return
|
|
446
|
-
},
|
|
553
|
+
}, h = (e, t, s) => {
|
|
554
|
+
const i = e.find((l) => l.id === t);
|
|
555
|
+
if (!i) throw new Error(`${s} ${t} not found`);
|
|
556
|
+
return i;
|
|
557
|
+
}, _ = (e, t, s) => {
|
|
447
558
|
if (!t.trim()) throw new Error("a name is required");
|
|
448
|
-
if (e.some((
|
|
449
|
-
},
|
|
450
|
-
if (
|
|
559
|
+
if (e.some((i) => i.id !== s && i.content.name === t)) throw new we();
|
|
560
|
+
}, w = (e, t) => t !== "" && t !== F(e).id, I = (e, t, s, i = "") => {
|
|
561
|
+
if (w(e, s))
|
|
451
562
|
throw new Error("the draft moved: somebody saved in between");
|
|
452
563
|
e.content = structuredClone(t), e.revisions.push({
|
|
453
564
|
id: `${e.id}_r${e.revisions.length + 1}`,
|
|
454
565
|
content: structuredClone(t),
|
|
455
|
-
savedBy:
|
|
456
|
-
savedAt:
|
|
457
|
-
restoredFromRevisionId:
|
|
566
|
+
savedBy: b,
|
|
567
|
+
savedAt: $(),
|
|
568
|
+
restoredFromRevisionId: i
|
|
458
569
|
});
|
|
459
|
-
},
|
|
460
|
-
const s =
|
|
570
|
+
}, k = (e, t) => {
|
|
571
|
+
const s = X(e);
|
|
461
572
|
return {
|
|
462
573
|
id: s,
|
|
463
574
|
content: structuredClone(t),
|
|
@@ -465,8 +576,8 @@ function Ne(r = {}) {
|
|
|
465
576
|
{
|
|
466
577
|
id: `${s}_r1`,
|
|
467
578
|
content: structuredClone(t),
|
|
468
|
-
savedBy:
|
|
469
|
-
savedAt:
|
|
579
|
+
savedBy: b,
|
|
580
|
+
savedAt: $(),
|
|
470
581
|
restoredFromRevisionId: ""
|
|
471
582
|
}
|
|
472
583
|
],
|
|
@@ -474,7 +585,7 @@ function Ne(r = {}) {
|
|
|
474
585
|
};
|
|
475
586
|
};
|
|
476
587
|
function J(e) {
|
|
477
|
-
const t = [], s =
|
|
588
|
+
const t = [], s = m.find((p) => p.id === e.blueprintReleaseId);
|
|
478
589
|
e.blueprintReleaseId ? s ? s.blueprintId !== e.blueprintId && t.push({
|
|
479
590
|
path: "/blueprintReleaseId",
|
|
480
591
|
code: "release_of_other_blueprint",
|
|
@@ -492,118 +603,118 @@ function Ne(r = {}) {
|
|
|
492
603
|
code: "no_element_selector",
|
|
493
604
|
message: "It has no element selector."
|
|
494
605
|
}), !e.sourceKey?.selector && !e.sourceKey?.template && t.push({ path: "/sourceKey", code: "no_source_key", message: "It has no Source Key." });
|
|
495
|
-
const
|
|
496
|
-
typeof
|
|
606
|
+
const i = (p, c) => {
|
|
607
|
+
typeof c == "string" && c !== "" && !Oe(c) && t.push({ path: p, code: "invalid_xpath", message: `"${c}" is not an XPath.` });
|
|
497
608
|
};
|
|
498
|
-
|
|
499
|
-
const
|
|
500
|
-
return (e.fields ?? []).forEach((
|
|
501
|
-
const
|
|
502
|
-
for (const { path:
|
|
503
|
-
|
|
504
|
-
path:
|
|
609
|
+
i("/element_selector", e.elementSelector), i("/source_key/selector", e.sourceKey?.selector);
|
|
610
|
+
const l = [];
|
|
611
|
+
return (e.fields ?? []).forEach((p, c) => {
|
|
612
|
+
const f = `/fields/${c}`;
|
|
613
|
+
for (const { path: u, rel: A, mapping: T } of ie(p, "", f))
|
|
614
|
+
l.push(u), i(`${A}/selector`, T.selector), s && !s.fieldPaths.includes(u) && t.push({
|
|
615
|
+
path: f,
|
|
505
616
|
code: "unknown_field_path",
|
|
506
|
-
message: `The pinned Release has no field ${
|
|
507
|
-
}),
|
|
508
|
-
path:
|
|
617
|
+
message: `The pinned Release has no field ${u}.`
|
|
618
|
+
}), T.type === "select" && !T.selectOptions && t.push({
|
|
619
|
+
path: f,
|
|
509
620
|
code: "xmlmapper_schema",
|
|
510
|
-
message: `The select field ${
|
|
621
|
+
message: `The select field ${u} has no select options.`
|
|
511
622
|
});
|
|
512
|
-
}), (e.versionMatch?.contentFields ?? []).forEach((
|
|
513
|
-
|
|
514
|
-
path: `/version_match/content_fields/${
|
|
623
|
+
}), (e.versionMatch?.contentFields ?? []).forEach((p, c) => {
|
|
624
|
+
l.includes(p) || t.push({
|
|
625
|
+
path: `/version_match/content_fields/${c}`,
|
|
515
626
|
code: "unknown_version_match_field",
|
|
516
|
-
message: `The Version Match compares ${
|
|
627
|
+
message: `The Version Match compares ${p}, which the Mapping does not map.`
|
|
517
628
|
});
|
|
518
|
-
}), (e.titleContributions ?? []).forEach((
|
|
519
|
-
(!
|
|
520
|
-
path: `/title_contributions/${
|
|
629
|
+
}), (e.titleContributions ?? []).forEach((p, c) => {
|
|
630
|
+
(!p.selector || !p.ausgabeCodeSelector) && t.push({
|
|
631
|
+
path: `/title_contributions/${c}`,
|
|
521
632
|
code: "incomplete_title_contribution",
|
|
522
633
|
message: "A Title Contribution needs a selector and an Ausgabe code selector."
|
|
523
|
-
}),
|
|
524
|
-
}), (e.placeholderAssets ?? []).forEach((
|
|
525
|
-
(!
|
|
526
|
-
path: `/placeholder_assets/${
|
|
634
|
+
}), i(`/title_contributions/${c}/selector`, p.selector);
|
|
635
|
+
}), (e.placeholderAssets ?? []).forEach((p, c) => {
|
|
636
|
+
(!p.selector || !p.assetType || !p.keyParts?.length || !p.nameSelector) && t.push({
|
|
637
|
+
path: `/placeholder_assets/${c}`,
|
|
527
638
|
code: "incomplete_placeholder_assets",
|
|
528
639
|
message: "Placeholder Assets need a selector, an asset type, the key's parts and a name selector."
|
|
529
|
-
}),
|
|
530
|
-
|
|
640
|
+
}), i(`/placeholder_assets/${c}/selector`, p.selector), (p.keyParts ?? []).forEach((f, u) => {
|
|
641
|
+
i(`/placeholder_assets/${c}/key_parts/${u}`, f);
|
|
531
642
|
});
|
|
532
|
-
}), t;
|
|
643
|
+
}), t.push(...Fe(e, s?.fields, l)), t;
|
|
533
644
|
}
|
|
534
645
|
function re(e, t, s) {
|
|
535
|
-
return e.flatMap((
|
|
536
|
-
const
|
|
537
|
-
return
|
|
646
|
+
return e.flatMap((i, l) => {
|
|
647
|
+
const p = `/${t}/${l}`, c = o.find((u) => u.name === i.processor);
|
|
648
|
+
return c ? c.target !== "source_file" ? [
|
|
538
649
|
{
|
|
539
|
-
path:
|
|
650
|
+
path: p,
|
|
540
651
|
code: "rich_text_processor",
|
|
541
|
-
message: `${
|
|
652
|
+
message: `${c.name} is configured on a rich-text field, not on a Profile.`
|
|
542
653
|
}
|
|
543
|
-
] :
|
|
544
|
-
(
|
|
545
|
-
).map((
|
|
546
|
-
path: `${
|
|
654
|
+
] : c.kind !== s ? [{ path: p, code: "wrong_processor_kind", message: `${c.name} does not run here.` }] : c.settingsSpec.filter(
|
|
655
|
+
(u) => u.config.required && (i.settings[u.config.api_accessor] ?? "") === ""
|
|
656
|
+
).map((u) => ({
|
|
657
|
+
path: `${p}/settings/${u.config.api_accessor}`,
|
|
547
658
|
code: "invalid_processor_settings",
|
|
548
|
-
message: `${
|
|
659
|
+
message: `${c.name}: ${u.config.api_accessor} is required.`
|
|
549
660
|
})) : [
|
|
550
|
-
{ path:
|
|
661
|
+
{ path: p, code: "unknown_processor", message: `No Processor is called ${i.processor}.` }
|
|
551
662
|
];
|
|
552
663
|
});
|
|
553
664
|
}
|
|
554
|
-
function
|
|
555
|
-
const t =
|
|
665
|
+
function U(e) {
|
|
666
|
+
const t = r(), s = [
|
|
556
667
|
...re(e.preprocessors, "preprocessors", "preprocessor"),
|
|
557
668
|
...re(e.postProcessors, "postProcessors", "post_processor")
|
|
558
669
|
];
|
|
559
|
-
return e.mappingIds.length === 0 && s.push({ path: "/mappingIds", code: "no_mappings", message: "It includes no Mapping." }), e.mappingIds.forEach((
|
|
560
|
-
const
|
|
561
|
-
if (!
|
|
670
|
+
return e.mappingIds.length === 0 && s.push({ path: "/mappingIds", code: "no_mappings", message: "It includes no Mapping." }), e.mappingIds.forEach((i, l) => {
|
|
671
|
+
const p = t.mappings.find((f) => f.id === i);
|
|
672
|
+
if (!p) {
|
|
562
673
|
s.push({
|
|
563
|
-
path: `/mappingIds/${
|
|
674
|
+
path: `/mappingIds/${l}`,
|
|
564
675
|
code: "mapping_missing",
|
|
565
676
|
message: "It includes a Mapping that does not exist."
|
|
566
677
|
});
|
|
567
678
|
return;
|
|
568
679
|
}
|
|
569
|
-
const
|
|
570
|
-
|
|
571
|
-
path: `/mappingIds/${
|
|
680
|
+
const c = J(p.content);
|
|
681
|
+
c.length > 0 && s.push({
|
|
682
|
+
path: `/mappingIds/${l}`,
|
|
572
683
|
code: "mapping_invalid",
|
|
573
|
-
message: `The Mapping ${
|
|
684
|
+
message: `The Mapping ${p.content.name} is invalid: ${c.map((f) => f.message).join(" ")}`
|
|
574
685
|
});
|
|
575
|
-
}), e.entitySetId && !t.entitySets.some((
|
|
686
|
+
}), e.entitySetId && !t.entitySets.some((i) => i.id === e.entitySetId) && s.push({
|
|
576
687
|
path: "/entitySetId",
|
|
577
688
|
code: "entity_set_missing",
|
|
578
689
|
message: "It names an Entity Set that does not exist."
|
|
579
690
|
}), s;
|
|
580
691
|
}
|
|
581
|
-
const
|
|
692
|
+
const oe = (e) => Object.keys(e.entities).length === 0 ? [{ path: "/entities", code: "no_entities", message: "It defines no entity." }] : [], K = (e) => ({
|
|
582
693
|
id: e.id,
|
|
583
694
|
content: e.content,
|
|
584
|
-
validity: R(
|
|
585
|
-
state:
|
|
586
|
-
}),
|
|
695
|
+
validity: R(U(e.content)),
|
|
696
|
+
state: G(e)
|
|
697
|
+
}), z = (e) => ({
|
|
587
698
|
id: e.id,
|
|
588
699
|
content: e.content,
|
|
589
700
|
validity: R(J(e.content)),
|
|
590
|
-
state:
|
|
591
|
-
}),
|
|
701
|
+
state: G(e)
|
|
702
|
+
}), C = (e) => ({
|
|
592
703
|
id: e.id,
|
|
593
704
|
content: e.content,
|
|
594
|
-
validity: R(
|
|
595
|
-
state:
|
|
596
|
-
}),
|
|
705
|
+
validity: R(oe(e.content)),
|
|
706
|
+
state: G(e)
|
|
707
|
+
}), D = (e) => L(r().importProfiles.filter((t) => e(t.content))).map((t) => ({
|
|
597
708
|
id: t.id,
|
|
598
709
|
name: t.content.name
|
|
599
|
-
})),
|
|
600
|
-
const t =
|
|
710
|
+
})), X = (e) => `${e}_stub_new_${++he}`, N = (e) => {
|
|
711
|
+
const t = r();
|
|
601
712
|
switch (e) {
|
|
602
713
|
case "importProfile":
|
|
603
714
|
return {
|
|
604
715
|
items: t.importProfiles,
|
|
605
716
|
name: "Import Profile",
|
|
606
|
-
reasons: (s) =>
|
|
717
|
+
reasons: (s) => U(s)
|
|
607
718
|
};
|
|
608
719
|
case "mapping":
|
|
609
720
|
return {
|
|
@@ -615,31 +726,31 @@ function Ne(r = {}) {
|
|
|
615
726
|
return {
|
|
616
727
|
items: t.entitySets,
|
|
617
728
|
name: "Entity Set",
|
|
618
|
-
reasons: (s) =>
|
|
729
|
+
reasons: (s) => oe(s)
|
|
619
730
|
};
|
|
620
731
|
}
|
|
621
|
-
},
|
|
622
|
-
|
|
623
|
-
},
|
|
624
|
-
const s = e.revisions.find((
|
|
732
|
+
}, P = (e, t) => {
|
|
733
|
+
F(t).validity = R(N(e).reasons(t.content));
|
|
734
|
+
}, V = (e, t) => {
|
|
735
|
+
const s = e.revisions.find((i) => i.id === t);
|
|
625
736
|
if (!s) throw new Error(`Revision ${t} not found`);
|
|
626
737
|
return s;
|
|
627
|
-
},
|
|
628
|
-
const t =
|
|
738
|
+
}, ae = /* @__PURE__ */ new Set(), le = n.contenthubRights ?? ["editor", "publisher"], Z = (e) => {
|
|
739
|
+
const t = r().imports.find((s) => s.id === e);
|
|
629
740
|
if (!t) throw new Error(`Import ${e} not found`);
|
|
630
741
|
return t;
|
|
631
|
-
},
|
|
632
|
-
e.cancelledBy && e.phase !== "ended" && (e.phase = "ended", e.outcome = "cancelled", e.endTime =
|
|
633
|
-
},
|
|
634
|
-
const s =
|
|
742
|
+
}, Y = (e) => {
|
|
743
|
+
e.cancelledBy && e.phase !== "ended" && (e.phase = "ended", e.outcome = "cancelled", e.endTime = $());
|
|
744
|
+
}, j = ({ itemProblems: e, ...t }) => t, W = (e, t) => {
|
|
745
|
+
const s = be(e);
|
|
635
746
|
if (!s)
|
|
636
|
-
throw new
|
|
637
|
-
const
|
|
747
|
+
throw new B(`the ${t} ${e.content.name} has no Release yet`);
|
|
748
|
+
const i = e.revisions.find((l) => l.id === s.revisionId)?.content ?? e.content;
|
|
638
749
|
return {
|
|
639
|
-
content:
|
|
750
|
+
content: i,
|
|
640
751
|
ref: {
|
|
641
752
|
configurationId: e.id,
|
|
642
|
-
name:
|
|
753
|
+
name: i.name,
|
|
643
754
|
releaseId: s.id,
|
|
644
755
|
number: s.number
|
|
645
756
|
}
|
|
@@ -648,171 +759,180 @@ function Ne(r = {}) {
|
|
|
648
759
|
return {
|
|
649
760
|
calls: y,
|
|
650
761
|
switchWorkspace(e) {
|
|
651
|
-
|
|
762
|
+
g = e;
|
|
652
763
|
},
|
|
653
764
|
updateImport(e, t) {
|
|
654
|
-
Object.assign(
|
|
765
|
+
Object.assign(Z(e), structuredClone(t));
|
|
655
766
|
},
|
|
656
|
-
listImportProfiles: () =>
|
|
657
|
-
getImportProfile: (e) =>
|
|
658
|
-
createImportProfile: (e) =>
|
|
659
|
-
|
|
660
|
-
const t =
|
|
661
|
-
return
|
|
767
|
+
listImportProfiles: () => d("listImportProfiles", () => L(r().importProfiles).map(K)),
|
|
768
|
+
getImportProfile: (e) => d("getImportProfile", () => K(h(r().importProfiles, e, "Import Profile"))),
|
|
769
|
+
createImportProfile: (e) => d("createImportProfile", () => {
|
|
770
|
+
_(r().importProfiles, e.name);
|
|
771
|
+
const t = k("ip", e);
|
|
772
|
+
return P("importProfile", t), r().importProfiles.push(t), K(t);
|
|
662
773
|
}),
|
|
663
|
-
updateImportProfile: (e, t, s) =>
|
|
664
|
-
const
|
|
665
|
-
return
|
|
774
|
+
updateImportProfile: (e, t, s) => d("updateImportProfile", () => {
|
|
775
|
+
const i = h(r().importProfiles, e, "Import Profile");
|
|
776
|
+
return _(r().importProfiles, t.name, e), I(i, t, s), P("importProfile", i), K(i);
|
|
666
777
|
}),
|
|
667
|
-
deleteImportProfile: (e) =>
|
|
668
|
-
|
|
778
|
+
deleteImportProfile: (e) => d("deleteImportProfile", () => {
|
|
779
|
+
h(r().importProfiles, e, "Import Profile"), r().importProfiles = r().importProfiles.filter((t) => t.id !== e);
|
|
669
780
|
}),
|
|
670
|
-
listProcessors: () =>
|
|
671
|
-
listMappings: () =>
|
|
672
|
-
getMapping: (e) =>
|
|
673
|
-
createMapping: (e) =>
|
|
674
|
-
|
|
675
|
-
const t =
|
|
676
|
-
return
|
|
781
|
+
listProcessors: () => d("listProcessors", () => [...o].sort((e, t) => e.name.localeCompare(t.name))),
|
|
782
|
+
listMappings: () => d("listMappings", () => L(r().mappings).map(z)),
|
|
783
|
+
getMapping: (e) => d("getMapping", () => z(h(r().mappings, e, "Mapping"))),
|
|
784
|
+
createMapping: (e) => d("createMapping", () => {
|
|
785
|
+
_(r().mappings, e.name);
|
|
786
|
+
const t = k("mp", e);
|
|
787
|
+
return P("mapping", t), r().mappings.push(t), z(t);
|
|
677
788
|
}),
|
|
678
|
-
updateMapping: (e, t, s) =>
|
|
679
|
-
const
|
|
680
|
-
return
|
|
789
|
+
updateMapping: (e, t, s) => d("updateMapping", () => {
|
|
790
|
+
const i = h(r().mappings, e, "Mapping");
|
|
791
|
+
return _(r().mappings, t.name, e), I(i, t, s), P("mapping", i), z(i);
|
|
681
792
|
}),
|
|
682
|
-
deleteMapping: (e) =>
|
|
683
|
-
|
|
684
|
-
const t =
|
|
793
|
+
deleteMapping: (e) => d("deleteMapping", () => {
|
|
794
|
+
h(r().mappings, e, "Mapping");
|
|
795
|
+
const t = D((s) => s.mappingIds.includes(e));
|
|
685
796
|
if (t.length > 0)
|
|
686
|
-
throw new
|
|
797
|
+
throw new ce(
|
|
687
798
|
t,
|
|
688
799
|
`the Mapping is included by ${t.map((s) => s.name).join(", ")}`
|
|
689
800
|
);
|
|
690
|
-
|
|
801
|
+
r().mappings = r().mappings.filter((s) => s.id !== e);
|
|
691
802
|
}),
|
|
692
|
-
listMappingImportProfiles: (e) =>
|
|
693
|
-
checkMappingBlueprintRelease: (e, t) =>
|
|
694
|
-
const s =
|
|
695
|
-
if (!
|
|
696
|
-
if (
|
|
803
|
+
listMappingImportProfiles: (e) => d("listMappingImportProfiles", () => (h(r().mappings, e, "Mapping"), D((t) => t.mappingIds.includes(e)))),
|
|
804
|
+
checkMappingBlueprintRelease: (e, t) => d("checkMappingBlueprintRelease", () => {
|
|
805
|
+
const s = h(r().mappings, e, "Mapping"), i = m.find((l) => l.id === t);
|
|
806
|
+
if (!i) throw new Error(`Blueprint Release ${t} not found`);
|
|
807
|
+
if (i.blueprintId !== s.content.blueprintId)
|
|
697
808
|
throw new Error("the Release is of another Blueprint");
|
|
698
809
|
return {
|
|
699
|
-
blueprintId:
|
|
700
|
-
missingFieldPaths: (s.content.fields ?? []).flatMap((
|
|
810
|
+
blueprintId: i.blueprintId,
|
|
811
|
+
missingFieldPaths: (s.content.fields ?? []).flatMap((l, p) => ie(l, "", `/fields/${p}`).map((c) => c.path)).filter((l) => !i.fieldPaths.includes(l)),
|
|
701
812
|
missingReleaseSpecFields: [
|
|
702
|
-
...(s.content.releaseSpec ?? []).map((
|
|
813
|
+
...(s.content.releaseSpec ?? []).map((l) => l.field ?? ""),
|
|
703
814
|
...s.content.versionMatch?.releaseSpecFields ?? []
|
|
704
815
|
].filter(
|
|
705
|
-
(
|
|
816
|
+
(l, p, c) => l !== "" && c.indexOf(l) === p && !(i.releaseSpecFields ?? []).some((f) => f.path === l)
|
|
706
817
|
)
|
|
707
818
|
};
|
|
708
819
|
}),
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
820
|
+
runMappingTest: ({ content: e, sample: t, entitySetId: s }) => d("runMappingTest", () => {
|
|
821
|
+
let i = new TextDecoder().decode(t);
|
|
822
|
+
if (s) {
|
|
823
|
+
const l = r().entitySets.find((p) => p.id === s);
|
|
824
|
+
if (!l) throw new O(`Entity Set ${s} not found`);
|
|
825
|
+
i = Ne(i, l.content.entities);
|
|
826
|
+
}
|
|
827
|
+
return Ae(e, i);
|
|
828
|
+
}),
|
|
829
|
+
listEntitySets: () => d("listEntitySets", () => L(r().entitySets).map(C)),
|
|
830
|
+
getEntitySet: (e) => d("getEntitySet", () => C(h(r().entitySets, e, "Entity Set"))),
|
|
831
|
+
createEntitySet: (e) => d("createEntitySet", () => {
|
|
832
|
+
_(r().entitySets, e.name);
|
|
833
|
+
const t = k("es", e);
|
|
834
|
+
return P("entitySet", t), r().entitySets.push(t), C(t);
|
|
715
835
|
}),
|
|
716
|
-
updateEntitySet: (e, t, s) =>
|
|
717
|
-
const
|
|
718
|
-
return
|
|
836
|
+
updateEntitySet: (e, t, s) => d("updateEntitySet", () => {
|
|
837
|
+
const i = h(r().entitySets, e, "Entity Set");
|
|
838
|
+
return _(r().entitySets, t.name, e), I(i, t, s), P("entitySet", i), C(i);
|
|
719
839
|
}),
|
|
720
|
-
deleteEntitySet: (e) =>
|
|
721
|
-
|
|
722
|
-
const t =
|
|
840
|
+
deleteEntitySet: (e) => d("deleteEntitySet", () => {
|
|
841
|
+
h(r().entitySets, e, "Entity Set");
|
|
842
|
+
const t = D((s) => s.entitySetId === e);
|
|
723
843
|
if (t.length > 0)
|
|
724
|
-
throw new
|
|
844
|
+
throw new ce(
|
|
725
845
|
t,
|
|
726
846
|
`the Entity Set is named by ${t.map((s) => s.name).join(", ")}`
|
|
727
847
|
);
|
|
728
|
-
|
|
848
|
+
r().entitySets = r().entitySets.filter((s) => s.id !== e);
|
|
729
849
|
}),
|
|
730
|
-
cutRelease: (e, t, s) =>
|
|
731
|
-
const
|
|
732
|
-
if (
|
|
733
|
-
throw new
|
|
734
|
-
const
|
|
735
|
-
if (!
|
|
736
|
-
if (!
|
|
737
|
-
throw new
|
|
850
|
+
cutRelease: (e, t, s) => d("cutRelease", () => {
|
|
851
|
+
const i = N(e), l = h(i.items, t, i.name);
|
|
852
|
+
if (w(l, s))
|
|
853
|
+
throw new ee("the draft moved: somebody saved in between");
|
|
854
|
+
const p = R(i.reasons(l.content));
|
|
855
|
+
if (!p.valid) throw new ee("the draft is invalid", p);
|
|
856
|
+
if (!G(l).draftDiffersFromRelease)
|
|
857
|
+
throw new ee(
|
|
738
858
|
"the draft does not differ from the latest Release: there is nothing to release"
|
|
739
859
|
);
|
|
740
|
-
const
|
|
741
|
-
id: `${
|
|
742
|
-
number:
|
|
743
|
-
revisionId:
|
|
744
|
-
releasedBy:
|
|
745
|
-
releasedAt:
|
|
860
|
+
const c = l.releases.length + 1, f = {
|
|
861
|
+
id: `${l.id}_rel${c}`,
|
|
862
|
+
number: c,
|
|
863
|
+
revisionId: F(l).id,
|
|
864
|
+
releasedBy: b,
|
|
865
|
+
releasedAt: $()
|
|
746
866
|
};
|
|
747
|
-
return
|
|
748
|
-
release:
|
|
749
|
-
importProfiles: e === "mapping" ?
|
|
867
|
+
return l.releases.push(f), {
|
|
868
|
+
release: f,
|
|
869
|
+
importProfiles: e === "mapping" ? D((u) => u.mappingIds.includes(t)) : []
|
|
750
870
|
};
|
|
751
871
|
}),
|
|
752
|
-
listHistory: (e, t, s) =>
|
|
753
|
-
const
|
|
872
|
+
listHistory: (e, t, s) => d("listHistory", () => {
|
|
873
|
+
const i = N(e), l = h(i.items, t, i.name), p = [...l.revisions].reverse(), c = Number(s || "0");
|
|
754
874
|
return {
|
|
755
|
-
revisions:
|
|
756
|
-
id:
|
|
757
|
-
savedBy:
|
|
758
|
-
savedAt:
|
|
759
|
-
validity:
|
|
760
|
-
restoredFromRevisionId:
|
|
875
|
+
revisions: p.slice(c, c + 10).map((u) => ({
|
|
876
|
+
id: u.id,
|
|
877
|
+
savedBy: u.savedBy,
|
|
878
|
+
savedAt: u.savedAt,
|
|
879
|
+
validity: u.validity ?? R(i.reasons(u.content)),
|
|
880
|
+
restoredFromRevisionId: u.restoredFromRevisionId
|
|
761
881
|
})),
|
|
762
|
-
releases: [...
|
|
763
|
-
nextPageToken:
|
|
882
|
+
releases: [...l.releases].reverse(),
|
|
883
|
+
nextPageToken: c + 10 < p.length ? String(c + 10) : ""
|
|
764
884
|
};
|
|
765
885
|
}),
|
|
766
|
-
compareRevisions: (e, t, s,
|
|
767
|
-
const
|
|
768
|
-
const
|
|
769
|
-
return { field:
|
|
886
|
+
compareRevisions: (e, t, s, i) => d("compareRevisions", () => {
|
|
887
|
+
const l = N(e), p = h(l.items, t, l.name), c = fe(V(p, s).content), f = fe(V(p, i).content), u = [.../* @__PURE__ */ new Set([...Object.keys(c), ...Object.keys(f)])].map((A) => {
|
|
888
|
+
const T = c[A], Q = f[A], Ie = T === void 0 && Q !== void 0 ? "added" : T !== void 0 && Q === void 0 ? "removed" : JSON.stringify(T) === JSON.stringify(Q) ? "unchanged" : "changed";
|
|
889
|
+
return { field: A, status: Ie };
|
|
770
890
|
});
|
|
771
891
|
return {
|
|
772
|
-
from: { revisionId: s, content:
|
|
773
|
-
to: { revisionId:
|
|
774
|
-
fields:
|
|
892
|
+
from: { revisionId: s, content: c },
|
|
893
|
+
to: { revisionId: i, content: f },
|
|
894
|
+
fields: u
|
|
775
895
|
};
|
|
776
896
|
}),
|
|
777
|
-
restoreRevision: (e, t, s,
|
|
778
|
-
const
|
|
779
|
-
|
|
897
|
+
restoreRevision: (e, t, s, i) => d("restoreRevision", () => {
|
|
898
|
+
const l = N(e), p = h(l.items, t, l.name);
|
|
899
|
+
I(p, V(p, s).content, i, s), P(e, p);
|
|
780
900
|
}),
|
|
781
901
|
async uploadSourceFile(e, t) {
|
|
782
|
-
if (y.uploadSourceFile++,
|
|
783
|
-
for (const
|
|
784
|
-
await new Promise((
|
|
785
|
-
if (
|
|
902
|
+
if (y.uploadSourceFile++, n.fail) throw n.fail;
|
|
903
|
+
for (const i of [0.25, 0.5, 0.75])
|
|
904
|
+
await new Promise((l) => setTimeout(l, 20)), t(i);
|
|
905
|
+
if (n.uploadFails) throw n.uploadFails;
|
|
786
906
|
t(1);
|
|
787
|
-
const s =
|
|
788
|
-
return
|
|
907
|
+
const s = X("sf");
|
|
908
|
+
return ae.add(s), { id: s, fileName: e.name };
|
|
789
909
|
},
|
|
790
|
-
startImport: (e) =>
|
|
791
|
-
const t =
|
|
792
|
-
if (!
|
|
793
|
-
throw new
|
|
794
|
-
if (!
|
|
795
|
-
throw new
|
|
910
|
+
startImport: (e) => d("startImport", () => {
|
|
911
|
+
const t = r(), s = h(t.importProfiles, e.importProfileId, "Import Profile");
|
|
912
|
+
if (!ae.has(e.sourceFileId))
|
|
913
|
+
throw new B("nothing was uploaded to the Source File");
|
|
914
|
+
if (!le.includes("editor"))
|
|
915
|
+
throw new B(
|
|
796
916
|
"starting an Import needs contenthub editor in the workspace"
|
|
797
917
|
);
|
|
798
|
-
const
|
|
799
|
-
if (
|
|
800
|
-
throw new
|
|
918
|
+
const i = W(s, "Import Profile");
|
|
919
|
+
if (i.content.autoPublish && !le.includes("publisher"))
|
|
920
|
+
throw new B(
|
|
801
921
|
"the Import Profile has Auto-publish, which needs contenthub publisher"
|
|
802
922
|
);
|
|
803
|
-
const
|
|
804
|
-
if (
|
|
805
|
-
throw new
|
|
806
|
-
`the Import Profile ${
|
|
923
|
+
const l = U(i.content);
|
|
924
|
+
if (l.length > 0)
|
|
925
|
+
throw new B(
|
|
926
|
+
`the Import Profile ${i.ref.name} is invalid: ${l.map((u) => u.message).join(" ")}`
|
|
807
927
|
);
|
|
808
|
-
const
|
|
809
|
-
(
|
|
810
|
-
),
|
|
811
|
-
id:
|
|
928
|
+
const p = i.content.mappingIds.map(
|
|
929
|
+
(u) => W(h(t.mappings, u, "Mapping"), "Mapping").ref
|
|
930
|
+
), c = i.content.entitySetId ? W(h(t.entitySets, i.content.entitySetId, "Entity Set"), "Entity Set").ref : void 0, f = {
|
|
931
|
+
id: X("im"),
|
|
812
932
|
importProfileId: s.id,
|
|
813
|
-
importProfileName:
|
|
933
|
+
importProfileName: i.ref.name,
|
|
814
934
|
sourceFileId: e.sourceFileId,
|
|
815
|
-
startedBy:
|
|
935
|
+
startedBy: b,
|
|
816
936
|
phase: "queued",
|
|
817
937
|
failureReason: "",
|
|
818
938
|
progress: { done: 0, total: 0 },
|
|
@@ -827,11 +947,11 @@ function Ne(r = {}) {
|
|
|
827
947
|
},
|
|
828
948
|
changeSetId: "",
|
|
829
949
|
releases: {
|
|
830
|
-
importProfile:
|
|
831
|
-
mappings:
|
|
832
|
-
...
|
|
950
|
+
importProfile: i.ref,
|
|
951
|
+
mappings: p,
|
|
952
|
+
...c ? { entitySet: c } : {}
|
|
833
953
|
},
|
|
834
|
-
createTime:
|
|
954
|
+
createTime: $(),
|
|
835
955
|
startTime: "",
|
|
836
956
|
endTime: "",
|
|
837
957
|
cancelledBy: "",
|
|
@@ -839,132 +959,166 @@ function Ne(r = {}) {
|
|
|
839
959
|
...e.source ? { source: e.source } : {},
|
|
840
960
|
itemProblems: []
|
|
841
961
|
};
|
|
842
|
-
return t.imports.unshift(
|
|
962
|
+
return t.imports.unshift(f), j(f);
|
|
843
963
|
}),
|
|
844
|
-
listImports: (e) =>
|
|
845
|
-
const t =
|
|
846
|
-
t.forEach(
|
|
964
|
+
listImports: (e) => d("listImports", () => {
|
|
965
|
+
const t = r().imports;
|
|
966
|
+
t.forEach(Y);
|
|
847
967
|
const s = Number(e || "0");
|
|
848
968
|
return {
|
|
849
|
-
imports: t.slice(s, s + 50).map(
|
|
969
|
+
imports: t.slice(s, s + 50).map(j),
|
|
850
970
|
nextPageToken: s + 50 < t.length ? String(s + 50) : ""
|
|
851
971
|
};
|
|
852
972
|
}),
|
|
853
|
-
getImport: (e) =>
|
|
854
|
-
const t =
|
|
855
|
-
return
|
|
973
|
+
getImport: (e) => d("getImport", () => {
|
|
974
|
+
const t = Z(e);
|
|
975
|
+
return Y(t), j(t);
|
|
856
976
|
}),
|
|
857
|
-
cancelImport: (e) =>
|
|
858
|
-
const t =
|
|
977
|
+
cancelImport: (e) => d("cancelImport", () => {
|
|
978
|
+
const t = Z(e);
|
|
859
979
|
if (t.phase === "ended") throw new Error("the Import has ended");
|
|
860
|
-
return t.cancelledBy ||=
|
|
980
|
+
return t.cancelledBy ||= b, t.phase === "queued" && Y(t), j(t);
|
|
861
981
|
}),
|
|
862
|
-
listItemProblems: (e, t) =>
|
|
863
|
-
const s =
|
|
864
|
-
(
|
|
865
|
-
),
|
|
866
|
-
for (const
|
|
867
|
-
const
|
|
868
|
-
mappingId:
|
|
869
|
-
mappingName:
|
|
982
|
+
listItemProblems: (e, t) => d("listItemProblems", () => {
|
|
983
|
+
const s = Z(e).itemProblems ?? [], i = t.sourceKeyQuery.toLowerCase(), l = s.filter(
|
|
984
|
+
(f) => (!t.mappingId || f.mappingId === t.mappingId) && f.sourceKey.toLowerCase().includes(i)
|
|
985
|
+
), p = /* @__PURE__ */ new Map();
|
|
986
|
+
for (const f of s) {
|
|
987
|
+
const u = p.get(f.mappingId) ?? {
|
|
988
|
+
mappingId: f.mappingId,
|
|
989
|
+
mappingName: f.mappingName,
|
|
870
990
|
count: 0
|
|
871
991
|
};
|
|
872
|
-
|
|
992
|
+
u.count++, p.set(f.mappingId, u);
|
|
873
993
|
}
|
|
874
|
-
const
|
|
994
|
+
const c = Number(t.pageToken || "0");
|
|
875
995
|
return {
|
|
876
|
-
itemProblems:
|
|
996
|
+
itemProblems: l.slice(c, c + 50),
|
|
877
997
|
totalCount: s.length,
|
|
878
|
-
matchingCount:
|
|
879
|
-
mappings: [...
|
|
880
|
-
nextPageToken:
|
|
998
|
+
matchingCount: l.length,
|
|
999
|
+
mappings: [...p.values()].sort((f, u) => f.mappingName.localeCompare(u.mappingName)),
|
|
1000
|
+
nextPageToken: c + 50 < l.length ? String(c + 50) : ""
|
|
881
1001
|
};
|
|
882
1002
|
}),
|
|
883
|
-
listApiKeys: () =>
|
|
884
|
-
createApiKey: (e) =>
|
|
1003
|
+
listApiKeys: () => d("listApiKeys", () => r().apiKeys),
|
|
1004
|
+
createApiKey: (e) => d("createApiKey", () => {
|
|
885
1005
|
const t = e.name.trim();
|
|
886
1006
|
if (!t) throw new Error("a name is required");
|
|
887
|
-
if (t.length >
|
|
888
|
-
throw new Error(`the name is longer than ${
|
|
1007
|
+
if (t.length > pe)
|
|
1008
|
+
throw new Error(`the name is longer than ${pe} characters`);
|
|
889
1009
|
const s = e.expireTime ? new Date(e.expireTime).toISOString() : "";
|
|
890
1010
|
if (s && Date.parse(s) <= Date.now())
|
|
891
1011
|
throw new Error("the expiry must lie in the future");
|
|
892
|
-
const
|
|
893
|
-
id: `key_stub_new_${
|
|
1012
|
+
const i = ++he, l = {
|
|
1013
|
+
id: `key_stub_new_${i}`,
|
|
894
1014
|
name: t,
|
|
895
|
-
keyPrefix: `ihk_n${String(
|
|
896
|
-
owner:
|
|
1015
|
+
keyPrefix: `ihk_n${String(i).padStart(3, "0")}`,
|
|
1016
|
+
owner: b,
|
|
897
1017
|
expireTime: s,
|
|
898
1018
|
createTime: (/* @__PURE__ */ new Date()).toISOString()
|
|
899
1019
|
};
|
|
900
|
-
return
|
|
1020
|
+
return r().apiKeys.unshift(l), { apiKey: l, secret: `${l.keyPrefix}_stub_secret_${i}` };
|
|
901
1021
|
}),
|
|
902
|
-
revokeApiKey: (e) =>
|
|
903
|
-
const t =
|
|
1022
|
+
revokeApiKey: (e) => d("revokeApiKey", () => {
|
|
1023
|
+
const t = r();
|
|
904
1024
|
if (!t.apiKeys.some((s) => s.id === e)) throw new Error(`API key ${e} not found`);
|
|
905
1025
|
t.apiKeys = t.apiKeys.filter((s) => s.id !== e);
|
|
906
1026
|
})
|
|
907
1027
|
};
|
|
908
1028
|
}
|
|
909
|
-
function
|
|
910
|
-
const
|
|
911
|
-
for (const
|
|
912
|
-
if (
|
|
913
|
-
else if (
|
|
914
|
-
return
|
|
1029
|
+
function Oe(n) {
|
|
1030
|
+
const a = [], o = { "]": "[", ")": "(" };
|
|
1031
|
+
for (const m of n)
|
|
1032
|
+
if (m === "[" || m === "(") a.push(m);
|
|
1033
|
+
else if (m in o && a.pop() !== o[m]) return !1;
|
|
1034
|
+
return a.length === 0;
|
|
915
1035
|
}
|
|
916
|
-
function
|
|
917
|
-
const
|
|
1036
|
+
function ie(n, a, o) {
|
|
1037
|
+
const m = `${a}${String(n.name ?? "")}`;
|
|
918
1038
|
return [
|
|
919
|
-
{ path:
|
|
1039
|
+
{ path: m, rel: o, mapping: n },
|
|
920
1040
|
...["fields", "virtualTableFields"].flatMap(
|
|
921
|
-
(
|
|
922
|
-
(y,
|
|
1041
|
+
(g) => (Array.isArray(n[g]) ? n[g] : []).flatMap(
|
|
1042
|
+
(y, r) => ie(y, `${m}.`, `${o}/${g}/${r}`)
|
|
923
1043
|
)
|
|
924
1044
|
)
|
|
925
1045
|
];
|
|
926
1046
|
}
|
|
927
|
-
function
|
|
1047
|
+
function Le(n = ge()) {
|
|
928
1048
|
return {
|
|
929
1049
|
async listBlueprints() {
|
|
930
|
-
return [...new Map(
|
|
1050
|
+
return [...new Map(n.map((o) => [o.blueprintId, o.blueprintName]))].map(([o, m]) => ({ id: o, name: m })).sort((o, m) => o.name.localeCompare(m.name));
|
|
931
1051
|
},
|
|
932
|
-
async listReleases(
|
|
933
|
-
return
|
|
1052
|
+
async listReleases(a) {
|
|
1053
|
+
return n.filter((o) => o.blueprintId === a).map((o) => ({ id: o.id, label: o.label }));
|
|
934
1054
|
},
|
|
935
|
-
async getRelease(
|
|
936
|
-
const
|
|
937
|
-
if (!
|
|
1055
|
+
async getRelease(a) {
|
|
1056
|
+
const o = n.find((m) => m.id === a);
|
|
1057
|
+
if (!o) throw new Error(`Blueprint Release ${a} not found`);
|
|
938
1058
|
return {
|
|
939
|
-
id:
|
|
940
|
-
blueprintId:
|
|
941
|
-
name:
|
|
942
|
-
fields:
|
|
943
|
-
accessor:
|
|
944
|
-
path:
|
|
1059
|
+
id: o.id,
|
|
1060
|
+
blueprintId: o.blueprintId,
|
|
1061
|
+
name: o.label,
|
|
1062
|
+
fields: o.fields ?? o.fieldPaths.map((m) => ({
|
|
1063
|
+
accessor: m,
|
|
1064
|
+
path: m,
|
|
945
1065
|
fieldType: "text",
|
|
946
1066
|
label: "",
|
|
947
1067
|
children: []
|
|
948
1068
|
})),
|
|
949
|
-
releaseSpecFields:
|
|
1069
|
+
releaseSpecFields: o.releaseSpecFields ?? []
|
|
950
1070
|
};
|
|
951
1071
|
}
|
|
952
1072
|
};
|
|
953
1073
|
}
|
|
1074
|
+
function Fe(n, a, o) {
|
|
1075
|
+
const m = (n.displayNameTemplate ?? "").trim(), g = (n.displayNameField ?? "").trim(), y = (d, h, _) => [
|
|
1076
|
+
{ path: d, code: h, message: _ }
|
|
1077
|
+
];
|
|
1078
|
+
if (!m && !g) return [];
|
|
1079
|
+
if (!g)
|
|
1080
|
+
return y(
|
|
1081
|
+
"/display_name_field",
|
|
1082
|
+
"incomplete_display_name",
|
|
1083
|
+
"the display-name template names no field to write the display name into"
|
|
1084
|
+
);
|
|
1085
|
+
if (!m)
|
|
1086
|
+
return y(
|
|
1087
|
+
"/display_name_template",
|
|
1088
|
+
"incomplete_display_name",
|
|
1089
|
+
`the display-name field "${g}" has no display-name template to fill it`
|
|
1090
|
+
);
|
|
1091
|
+
if (!a) return [];
|
|
1092
|
+
const r = (d) => d.flatMap((h) => [h.path, ...r(h.children)]);
|
|
1093
|
+
return r(a).includes(g) ? Pe(a).some((d) => d.path === g) ? o.includes(g) ? y(
|
|
1094
|
+
"/display_name_field",
|
|
1095
|
+
"display_name_field_mapped",
|
|
1096
|
+
`the field "${g}" is mapped too: it takes the display name or a mapped value, not both`
|
|
1097
|
+
) : [] : y(
|
|
1098
|
+
"/display_name_field",
|
|
1099
|
+
"display_name_field_not_plain_text",
|
|
1100
|
+
`the display-name field "${g}" is not a plain-text one (text or textarea)`
|
|
1101
|
+
) : y(
|
|
1102
|
+
"/display_name_field",
|
|
1103
|
+
"unknown_display_name_field",
|
|
1104
|
+
`the Blueprint Release has no field "${g}" to write the display name into`
|
|
1105
|
+
);
|
|
1106
|
+
}
|
|
954
1107
|
export {
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
1108
|
+
H as STUB_OTHER_USER_ID,
|
|
1109
|
+
De as STUB_OTHER_WORKSPACE_ID,
|
|
1110
|
+
b as STUB_USER_ID,
|
|
1111
|
+
ne as STUB_WORKSPACE_ID,
|
|
1112
|
+
Le as createStubBlueprints,
|
|
1113
|
+
Ge as createStubImporthubClient,
|
|
1114
|
+
Me as stubApiKeys,
|
|
962
1115
|
ge as stubBlueprintReleases,
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
1116
|
+
ve as stubEntitySets,
|
|
1117
|
+
Ze as stubIdentity,
|
|
1118
|
+
$e as stubImportProfiles,
|
|
1119
|
+
Re as stubImports,
|
|
1120
|
+
je as stubMappingTestSample,
|
|
1121
|
+
Te as stubMappings,
|
|
1122
|
+
Ee as stubProcessors
|
|
969
1123
|
};
|
|
970
1124
|
//# sourceMappingURL=testing.js.map
|