@knkcs/importhub-ui 0.5.0 → 0.7.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/testing.js CHANGED
@@ -1,38 +1,38 @@
1
- import { createHostMembers as he } from "@knkcs/anker/host";
2
- import { S as k, R as Y, C as ce, N as be } from "./importhub-client-fCWgKH03.js";
3
- const _ = "user_stub_ada", ee = "user_stub_grace", te = "ws_stub_main", Me = "ws_stub_other";
4
- function ke(r = te) {
1
+ import { createHostMembers as _e } from "@knkcs/anker/host";
2
+ import { A as ce, S as M, R as Q, C as le, N as ye } from "./importhub-client-BS6F4DW2.js";
3
+ const h = "user_stub_ada", q = "user_stub_grace", te = "ws_stub_main", Be = "ws_stub_other";
4
+ function Ae(r = te) {
5
5
  return {
6
- userId: _,
6
+ userId: h,
7
7
  workspaceId: r,
8
- members: he([
9
- { userId: _, displayName: "Ada Importer", email: "ada@example.com" },
10
- { userId: ee, displayName: "Grace Hopper", email: "grace@example.com" }
8
+ members: _e([
9
+ { userId: h, displayName: "Ada Importer", email: "ada@example.com" },
10
+ { userId: q, displayName: "Grace Hopper", email: "grace@example.com" }
11
11
  ])
12
12
  };
13
13
  }
14
- const b = (r, c, l, u = []) => ({
14
+ const _ = (r, c, l, u = []) => ({
15
15
  accessor: r.split(".").pop() ?? r,
16
16
  path: r,
17
17
  fieldType: c,
18
18
  label: l,
19
19
  children: u
20
- }), K = (r) => r.flatMap((c) => [c.path, ...K(c.children)]), le = (r) => [
21
- b("titel", "text", "Titel"),
22
- b("abkuerzung", "text", "Abkürzung"),
23
- ...r ? [b("fussnote", "rich_text", "Fußnote")] : [],
24
- b("stand", "fieldset", "Stand", [
25
- b("stand.datum", "date", "Datum"),
26
- b("stand.art", "select", "Art")
20
+ }), j = (r) => r.flatMap((c) => [c.path, ...j(c.children)]), pe = (r) => [
21
+ _("titel", "text", "Titel"),
22
+ _("abkuerzung", "text", "Abkürzung"),
23
+ ...r ? [_("fussnote", "rich_text", "Fußnote")] : [],
24
+ _("stand", "fieldset", "Stand", [
25
+ _("stand.datum", "date", "Datum"),
26
+ _("stand.art", "select", "Art")
27
27
  ])
28
- ], pe = () => [
29
- b("fundstelle", "text", "Fundstelle"),
30
- b("ausgabedatum", "date", "Ausgabedatum")
28
+ ], de = () => [
29
+ _("fundstelle", "text", "Fundstelle"),
30
+ _("ausgabedatum", "date", "Ausgabedatum")
31
31
  ];
32
- function ue() {
33
- const r = le(!1), c = le(!0), l = [
34
- b("aktenzeichen", "text", "Aktenzeichen"),
35
- b("datum", "date", "Datum")
32
+ function ge() {
33
+ const r = pe(!1), c = pe(!0), l = [
34
+ _("aktenzeichen", "text", "Aktenzeichen"),
35
+ _("datum", "date", "Datum")
36
36
  ];
37
37
  return [
38
38
  {
@@ -40,30 +40,30 @@ function ue() {
40
40
  blueprintId: "bp_stub_gesetz",
41
41
  blueprintName: "Gesetz",
42
42
  label: "Release 2",
43
- fieldPaths: K(r),
43
+ fieldPaths: j(r),
44
44
  fields: r,
45
- releaseSpecFields: pe()
45
+ releaseSpecFields: de()
46
46
  },
47
47
  {
48
48
  id: "br_stub_gesetz_1",
49
49
  blueprintId: "bp_stub_gesetz",
50
50
  blueprintName: "Gesetz",
51
51
  label: "Release 1",
52
- fieldPaths: K(c),
52
+ fieldPaths: j(c),
53
53
  fields: c,
54
- releaseSpecFields: pe()
54
+ releaseSpecFields: de()
55
55
  },
56
56
  {
57
57
  id: "br_stub_entscheidung_1",
58
58
  blueprintId: "bp_stub_entscheidung",
59
59
  blueprintName: "Entscheidung",
60
60
  label: "Release 1",
61
- fieldPaths: K(l),
61
+ fieldPaths: j(l),
62
62
  fields: l
63
63
  }
64
64
  ];
65
65
  }
66
- function _e() {
66
+ function Ie() {
67
67
  return [
68
68
  {
69
69
  id: "mp_stub_norm",
@@ -95,7 +95,7 @@ function _e() {
95
95
  }
96
96
  ];
97
97
  }
98
- function Ie() {
98
+ function Se() {
99
99
  return [
100
100
  {
101
101
  id: "es_stub_latin1",
@@ -108,7 +108,7 @@ function Ie() {
108
108
  }
109
109
  ];
110
110
  }
111
- function ye() {
111
+ function we() {
112
112
  return [
113
113
  {
114
114
  id: "ip_stub_gesetz",
@@ -139,12 +139,12 @@ function ye() {
139
139
  }
140
140
  ];
141
141
  }
142
- const Q = (r, c, l, u = "") => ({
142
+ const X = (r, c, l, u = "") => ({
143
143
  field_type: "text",
144
144
  config: { name: c, api_accessor: r, required: l, instructions: u },
145
145
  system: !1
146
146
  });
147
- function Se() {
147
+ function Pe() {
148
148
  return [
149
149
  {
150
150
  name: "citation-links",
@@ -166,8 +166,8 @@ function Se() {
166
166
  target: "source_file",
167
167
  description: "Renames every element of one name to another.",
168
168
  settingsSpec: [
169
- Q("from", "Element", !0, "The element's name now."),
170
- Q("to", "New name", !0)
169
+ X("from", "Element", !0, "The element's name now."),
170
+ X("to", "New name", !0)
171
171
  ]
172
172
  },
173
173
  {
@@ -175,7 +175,7 @@ function Se() {
175
175
  kind: "preprocessor",
176
176
  target: "source_file",
177
177
  description: "Wraps each sentence of an element in its own element.",
178
- settingsSpec: [Q("element", "Element", !1)]
178
+ settingsSpec: [X("element", "Element", !1)]
179
179
  }
180
180
  ];
181
181
  }
@@ -188,7 +188,7 @@ const $ = (r = {}) => ({
188
188
  kept: 0,
189
189
  unchanged: 0,
190
190
  ...r
191
- }), P = (r) => ({
191
+ }), w = (r) => ({
192
192
  importProfile: {
193
193
  configurationId: "ip_stub_gesetz",
194
194
  name: "Boorberg gesetz",
@@ -213,28 +213,28 @@ const $ = (r = {}) => ({
213
213
  importProfileId: "ip_stub_gesetz",
214
214
  importProfileName: "Boorberg gesetz",
215
215
  sourceFileId: `sf_${r.id}`,
216
- startedBy: _,
216
+ startedBy: h,
217
217
  phase: "ended",
218
218
  failureReason: "",
219
219
  progress: { done: 0, total: 0 },
220
220
  counts: $(),
221
221
  changeSetId: "",
222
- releases: P(2),
222
+ releases: w(2),
223
223
  createTime: "2026-11-03T09:00:00.000Z",
224
224
  startTime: "",
225
225
  endTime: "",
226
226
  cancelledBy: "",
227
227
  effectiveDate: "",
228
228
  ...r
229
- }), B = (r, c, l, u, h) => ({
229
+ }), B = (r, c, l, u, b) => ({
230
230
  id: `prob_stub_${r}`,
231
231
  mappingId: c === "norm" ? "mp_stub_norm" : "mp_stub_title",
232
232
  mappingName: c === "norm" ? "Gesetz norms" : "Gesetz titles",
233
233
  sourceKey: l,
234
234
  field: u,
235
- reason: h
235
+ reason: b
236
236
  });
237
- function Pe() {
237
+ function ve() {
238
238
  return [
239
239
  T({
240
240
  id: "im_stub_running",
@@ -248,8 +248,8 @@ function Pe() {
248
248
  T({
249
249
  id: "im_stub_queued",
250
250
  phase: "queued",
251
- startedBy: ee,
252
- releases: P(2),
251
+ startedBy: q,
252
+ releases: w(2),
253
253
  createTime: "2026-11-04T10:05:00.000Z"
254
254
  }),
255
255
  T({
@@ -265,9 +265,9 @@ function Pe() {
265
265
  }),
266
266
  changeSetId: "cs_stub_problems",
267
267
  releases: {
268
- ...P(2),
268
+ ...w(2),
269
269
  mappings: [
270
- ...P(2).mappings,
270
+ ...w(2).mappings,
271
271
  {
272
272
  configurationId: "mp_stub_title",
273
273
  name: "Gesetz titles",
@@ -294,7 +294,7 @@ function Pe() {
294
294
  outcome: "succeeded",
295
295
  counts: $({ matched: 64, created: 64 }),
296
296
  changeSetId: "cs_stub_succeeded",
297
- releases: P(1),
297
+ releases: w(1),
298
298
  createTime: "2026-11-02T14:00:00.000Z",
299
299
  startTime: "2026-11-02T14:00:01.000Z",
300
300
  endTime: "2026-11-02T14:03:10.000Z"
@@ -304,7 +304,7 @@ function Pe() {
304
304
  outcome: "failed",
305
305
  failureReason: "The worker crashed three times running this Import.",
306
306
  counts: $({ matched: 30 }),
307
- releases: P(1),
307
+ releases: w(1),
308
308
  createTime: "2026-11-02T11:00:00.000Z",
309
309
  startTime: "2026-11-02T11:00:01.000Z",
310
310
  endTime: "2026-11-02T11:20:00.000Z"
@@ -312,16 +312,36 @@ function Pe() {
312
312
  T({
313
313
  id: "im_stub_cancelled",
314
314
  outcome: "cancelled",
315
- cancelledBy: ee,
315
+ cancelledBy: q,
316
316
  counts: $({ matched: 12, created: 3 }),
317
- releases: P(1),
317
+ releases: w(1),
318
318
  createTime: "2026-11-01T16:00:00.000Z",
319
319
  startTime: "2026-11-01T16:00:01.000Z",
320
320
  endTime: "2026-11-01T16:01:00.000Z"
321
321
  })
322
322
  ];
323
323
  }
324
- const we = [
324
+ function Te() {
325
+ return [
326
+ {
327
+ id: "key_stub_nightly",
328
+ name: "Nightly gesetz feed",
329
+ keyPrefix: "ihk_7Qx2",
330
+ owner: q,
331
+ expireTime: "",
332
+ createTime: "2026-11-20T07:30:00.000Z"
333
+ },
334
+ {
335
+ id: "key_stub_pipeline",
336
+ name: "VRPML pipeline",
337
+ keyPrefix: "ihk_b91F",
338
+ owner: h,
339
+ expireTime: "2027-06-30T21:59:59.000Z",
340
+ createTime: "2026-11-03T12:00:00.000Z"
341
+ }
342
+ ];
343
+ }
344
+ const Re = [
325
345
  "listImportProfiles",
326
346
  "getImportProfile",
327
347
  "createImportProfile",
@@ -349,83 +369,94 @@ const we = [
349
369
  "listImports",
350
370
  "getImport",
351
371
  "cancelImport",
352
- "listItemProblems"
372
+ "listItemProblems",
373
+ "listApiKeys",
374
+ "createApiKey",
375
+ "revokeApiKey"
353
376
  ];
354
- let de = Date.parse("2026-11-02T08:00:00Z");
355
- const w = () => (de += 36e5, new Date(de).toISOString()), X = (r = []) => r.map((c) => {
356
- const l = Math.max(c.releaseNumber ?? 0, 1), u = Array.from({ length: l }, (I, p) => ({
377
+ let me = Date.parse("2026-11-02T08:00:00Z");
378
+ const P = () => (me += 36e5, new Date(me).toISOString()), ee = (r = []) => r.map((c) => {
379
+ const l = Math.max(c.releaseNumber ?? 0, 1), u = Array.from({ length: l }, (y, p) => ({
357
380
  id: `${c.id}_r${p + 1}`,
358
381
  content: structuredClone(c.content),
359
- savedBy: _,
360
- savedAt: w(),
382
+ savedBy: h,
383
+ savedAt: P(),
361
384
  restoredFromRevisionId: ""
362
- })), h = Array.from({ length: c.releaseNumber ?? 0 }, (I, p) => ({
385
+ })), b = Array.from({ length: c.releaseNumber ?? 0 }, (y, p) => ({
363
386
  id: `${c.id}_rel${p + 1}`,
364
387
  number: p + 1,
365
388
  revisionId: `${c.id}_r${p + 1}`,
366
- releasedBy: _,
367
- releasedAt: w()
389
+ releasedBy: h,
390
+ releasedAt: P()
368
391
  }));
369
- return { id: c.id, content: structuredClone(c.content), revisions: u, releases: h };
370
- }), N = (r) => r.revisions[r.revisions.length - 1], fe = (r) => r.releases[r.releases.length - 1], D = (r) => {
371
- const c = fe(r), l = r.revisions.find((u) => u.id === c?.revisionId);
392
+ return { id: c.id, content: structuredClone(c.content), revisions: u, releases: b };
393
+ }), A = (r) => r.revisions[r.revisions.length - 1], he = (r) => r.releases[r.releases.length - 1], Z = (r) => {
394
+ const c = he(r), l = r.revisions.find((u) => u.id === c?.revisionId);
372
395
  return {
373
- draftRevisionId: N(r).id,
396
+ draftRevisionId: A(r).id,
374
397
  // By content, as importhub compares: a draft that restored the
375
398
  // released content does not differ.
376
- draftDiffersFromRelease: !l || JSON.stringify(l.content) !== JSON.stringify(N(r).content),
399
+ draftDiffersFromRelease: !l || JSON.stringify(l.content) !== JSON.stringify(A(r).content),
377
400
  ...c ? { latestRelease: { id: c.id, number: c.number } } : {}
378
401
  };
379
- }, ve = (r) => r.replace(/[A-Z]/g, (c) => `_${c.toLowerCase()}`), me = (r) => Object.fromEntries(
380
- Object.entries(r).map(([c, l]) => [ve(c), l])
402
+ }, $e = (r) => r.replace(/[A-Z]/g, (c) => `_${c.toLowerCase()}`), ue = (r) => Object.fromEntries(
403
+ Object.entries(r).map(([c, l]) => [$e(c), l])
381
404
  ), R = (r) => ({
382
405
  valid: r.length === 0,
383
406
  reasons: r
384
- }), j = (r) => [...r].sort((c, l) => c.content.name.localeCompare(l.content.name));
385
- let Te = 0;
386
- function Be(r = {}) {
407
+ }), D = (r) => [...r].sort((c, l) => c.content.name.localeCompare(l.content.name));
408
+ let fe = 0;
409
+ function Ne(r = {}) {
387
410
  const c = Object.fromEntries(
388
411
  Object.entries(
389
412
  r.workspaces ?? {
390
413
  [te]: {
391
- importProfiles: ye(),
392
- mappings: _e(),
393
- entitySets: Ie(),
394
- imports: Pe()
414
+ importProfiles: we(),
415
+ mappings: Ie(),
416
+ entitySets: Se(),
417
+ imports: ve(),
418
+ apiKeys: Te()
395
419
  }
396
420
  }
397
421
  ).map(([e, t]) => [
398
422
  e,
399
423
  {
400
- importProfiles: X(t.importProfiles),
401
- mappings: X(t.mappings),
402
- entitySets: X(t.entitySets),
403
- imports: structuredClone(t.imports ?? [])
424
+ importProfiles: ee(t.importProfiles),
425
+ mappings: ee(t.mappings),
426
+ entitySets: ee(t.entitySets),
427
+ imports: structuredClone(t.imports ?? []),
428
+ apiKeys: structuredClone(t.apiKeys ?? [])
404
429
  }
405
430
  ])
406
- ), l = r.processors ?? Se(), u = r.blueprintReleases ?? ue();
407
- let h = r.activeWorkspaceId ?? te;
408
- const I = Object.fromEntries(we.map((e) => [e, 0])), p = () => (c[h] ??= { importProfiles: [], mappings: [], entitySets: [], imports: [] }, c[h]), f = async (e, t) => {
409
- if (I[e]++, r.fail) throw r.fail;
431
+ ), l = r.processors ?? Pe(), u = r.blueprintReleases ?? ge();
432
+ let b = r.activeWorkspaceId ?? te;
433
+ const y = Object.fromEntries(Re.map((e) => [e, 0])), p = () => (c[b] ??= {
434
+ importProfiles: [],
435
+ mappings: [],
436
+ entitySets: [],
437
+ imports: [],
438
+ apiKeys: []
439
+ }, c[b]), f = async (e, t) => {
440
+ if (y[e]++, r.fail) throw r.fail;
410
441
  return structuredClone(t());
411
442
  }, g = (e, t, s) => {
412
- const n = e.find((a) => a.id === t);
443
+ const n = e.find((i) => i.id === t);
413
444
  if (!n) throw new Error(`${s} ${t} not found`);
414
445
  return n;
415
446
  }, v = (e, t, s) => {
416
447
  if (!t.trim()) throw new Error("a name is required");
417
- if (e.some((n) => n.id !== s && n.content.name === t)) throw new be();
418
- }, ne = (e, t) => t !== "" && t !== N(e).id, O = (e, t, s, n = "") => {
448
+ if (e.some((n) => n.id !== s && n.content.name === t)) throw new ye();
449
+ }, ne = (e, t) => t !== "" && t !== A(e).id, N = (e, t, s, n = "") => {
419
450
  if (ne(e, s))
420
451
  throw new Error("the draft moved: somebody saved in between");
421
452
  e.content = structuredClone(t), e.revisions.push({
422
453
  id: `${e.id}_r${e.revisions.length + 1}`,
423
454
  content: structuredClone(t),
424
- savedBy: _,
425
- savedAt: w(),
455
+ savedBy: h,
456
+ savedAt: P(),
426
457
  restoredFromRevisionId: n
427
458
  });
428
- }, q = (e, t) => {
459
+ }, G = (e, t) => {
429
460
  const s = H(e);
430
461
  return {
431
462
  id: s,
@@ -434,15 +465,15 @@ function Be(r = {}) {
434
465
  {
435
466
  id: `${s}_r1`,
436
467
  content: structuredClone(t),
437
- savedBy: _,
438
- savedAt: w(),
468
+ savedBy: h,
469
+ savedAt: P(),
439
470
  restoredFromRevisionId: ""
440
471
  }
441
472
  ],
442
473
  releases: []
443
474
  };
444
475
  };
445
- function G(e) {
476
+ function J(e) {
446
477
  const t = [], s = u.find((o) => o.id === e.blueprintReleaseId);
447
478
  e.blueprintReleaseId ? s ? s.blueprintId !== e.blueprintId && t.push({
448
479
  path: "/blueprintReleaseId",
@@ -461,15 +492,15 @@ function Be(r = {}) {
461
492
  code: "no_element_selector",
462
493
  message: "It has no element selector."
463
494
  }), !e.sourceKey?.selector && !e.sourceKey?.template && t.push({ path: "/sourceKey", code: "no_source_key", message: "It has no Source Key." });
464
- const n = (o, i) => {
465
- typeof i == "string" && i !== "" && !Re(i) && t.push({ path: o, code: "invalid_xpath", message: `"${i}" is not an XPath.` });
495
+ const n = (o, a) => {
496
+ typeof a == "string" && a !== "" && !Ee(a) && t.push({ path: o, code: "invalid_xpath", message: `"${a}" is not an XPath.` });
466
497
  };
467
498
  n("/element_selector", e.elementSelector), n("/source_key/selector", e.sourceKey?.selector);
468
- const a = [];
469
- return (e.fields ?? []).forEach((o, i) => {
470
- const m = `/fields/${i}`;
471
- for (const { path: d, rel: M, mapping: S } of se(o, "", m))
472
- a.push(d), n(`${M}/selector`, S.selector), s && !s.fieldPaths.includes(d) && t.push({
499
+ const i = [];
500
+ return (e.fields ?? []).forEach((o, a) => {
501
+ const m = `/fields/${a}`;
502
+ for (const { path: d, rel: k, mapping: S } of se(o, "", m))
503
+ i.push(d), n(`${k}/selector`, S.selector), s && !s.fieldPaths.includes(d) && t.push({
473
504
  path: m,
474
505
  code: "unknown_field_path",
475
506
  message: `The pinned Release has no field ${d}.`
@@ -478,68 +509,68 @@ function Be(r = {}) {
478
509
  code: "xmlmapper_schema",
479
510
  message: `The select field ${d} has no select options.`
480
511
  });
481
- }), (e.versionMatch?.contentFields ?? []).forEach((o, i) => {
482
- a.includes(o) || t.push({
483
- path: `/version_match/content_fields/${i}`,
512
+ }), (e.versionMatch?.contentFields ?? []).forEach((o, a) => {
513
+ i.includes(o) || t.push({
514
+ path: `/version_match/content_fields/${a}`,
484
515
  code: "unknown_version_match_field",
485
516
  message: `The Version Match compares ${o}, which the Mapping does not map.`
486
517
  });
487
- }), (e.titleContributions ?? []).forEach((o, i) => {
518
+ }), (e.titleContributions ?? []).forEach((o, a) => {
488
519
  (!o.selector || !o.ausgabeCodeSelector) && t.push({
489
- path: `/title_contributions/${i}`,
520
+ path: `/title_contributions/${a}`,
490
521
  code: "incomplete_title_contribution",
491
522
  message: "A Title Contribution needs a selector and an Ausgabe code selector."
492
- }), n(`/title_contributions/${i}/selector`, o.selector);
493
- }), (e.placeholderAssets ?? []).forEach((o, i) => {
523
+ }), n(`/title_contributions/${a}/selector`, o.selector);
524
+ }), (e.placeholderAssets ?? []).forEach((o, a) => {
494
525
  (!o.selector || !o.assetType || !o.keyParts?.length || !o.nameSelector) && t.push({
495
- path: `/placeholder_assets/${i}`,
526
+ path: `/placeholder_assets/${a}`,
496
527
  code: "incomplete_placeholder_assets",
497
528
  message: "Placeholder Assets need a selector, an asset type, the key's parts and a name selector."
498
- }), n(`/placeholder_assets/${i}/selector`, o.selector), (o.keyParts ?? []).forEach((m, d) => {
499
- n(`/placeholder_assets/${i}/key_parts/${d}`, m);
529
+ }), n(`/placeholder_assets/${a}/selector`, o.selector), (o.keyParts ?? []).forEach((m, d) => {
530
+ n(`/placeholder_assets/${a}/key_parts/${d}`, m);
500
531
  });
501
532
  }), t;
502
533
  }
503
534
  function re(e, t, s) {
504
- return e.flatMap((n, a) => {
505
- const o = `/${t}/${a}`, i = l.find((d) => d.name === n.processor);
506
- return i ? i.target !== "source_file" ? [
535
+ return e.flatMap((n, i) => {
536
+ const o = `/${t}/${i}`, a = l.find((d) => d.name === n.processor);
537
+ return a ? a.target !== "source_file" ? [
507
538
  {
508
539
  path: o,
509
540
  code: "rich_text_processor",
510
- message: `${i.name} is configured on a rich-text field, not on a Profile.`
541
+ message: `${a.name} is configured on a rich-text field, not on a Profile.`
511
542
  }
512
- ] : i.kind !== s ? [{ path: o, code: "wrong_processor_kind", message: `${i.name} does not run here.` }] : i.settingsSpec.filter(
543
+ ] : a.kind !== s ? [{ path: o, code: "wrong_processor_kind", message: `${a.name} does not run here.` }] : a.settingsSpec.filter(
513
544
  (d) => d.config.required && (n.settings[d.config.api_accessor] ?? "") === ""
514
545
  ).map((d) => ({
515
546
  path: `${o}/settings/${d.config.api_accessor}`,
516
547
  code: "invalid_processor_settings",
517
- message: `${i.name}: ${d.config.api_accessor} is required.`
548
+ message: `${a.name}: ${d.config.api_accessor} is required.`
518
549
  })) : [
519
550
  { path: o, code: "unknown_processor", message: `No Processor is called ${n.processor}.` }
520
551
  ];
521
552
  });
522
553
  }
523
- function J(e) {
554
+ function L(e) {
524
555
  const t = p(), s = [
525
556
  ...re(e.preprocessors, "preprocessors", "preprocessor"),
526
557
  ...re(e.postProcessors, "postProcessors", "post_processor")
527
558
  ];
528
- return e.mappingIds.length === 0 && s.push({ path: "/mappingIds", code: "no_mappings", message: "It includes no Mapping." }), e.mappingIds.forEach((n, a) => {
559
+ return e.mappingIds.length === 0 && s.push({ path: "/mappingIds", code: "no_mappings", message: "It includes no Mapping." }), e.mappingIds.forEach((n, i) => {
529
560
  const o = t.mappings.find((m) => m.id === n);
530
561
  if (!o) {
531
562
  s.push({
532
- path: `/mappingIds/${a}`,
563
+ path: `/mappingIds/${i}`,
533
564
  code: "mapping_missing",
534
565
  message: "It includes a Mapping that does not exist."
535
566
  });
536
567
  return;
537
568
  }
538
- const i = G(o.content);
539
- i.length > 0 && s.push({
540
- path: `/mappingIds/${a}`,
569
+ const a = J(o.content);
570
+ a.length > 0 && s.push({
571
+ path: `/mappingIds/${i}`,
541
572
  code: "mapping_invalid",
542
- message: `The Mapping ${o.content.name} is invalid: ${i.map((m) => m.message).join(" ")}`
573
+ message: `The Mapping ${o.content.name} is invalid: ${a.map((m) => m.message).join(" ")}`
543
574
  });
544
575
  }), e.entitySetId && !t.entitySets.some((n) => n.id === e.entitySetId) && s.push({
545
576
  path: "/entitySetId",
@@ -547,63 +578,63 @@ function Be(r = {}) {
547
578
  message: "It names an Entity Set that does not exist."
548
579
  }), s;
549
580
  }
550
- const oe = (e) => Object.keys(e.entities).length === 0 ? [{ path: "/entities", code: "no_entities", message: "It defines no entity." }] : [], F = (e) => ({
581
+ const ie = (e) => Object.keys(e.entities).length === 0 ? [{ path: "/entities", code: "no_entities", message: "It defines no entity." }] : [], x = (e) => ({
551
582
  id: e.id,
552
583
  content: e.content,
553
- validity: R(J(e.content)),
554
- state: D(e)
555
- }), z = (e) => ({
584
+ validity: R(L(e.content)),
585
+ state: Z(e)
586
+ }), O = (e) => ({
556
587
  id: e.id,
557
588
  content: e.content,
558
- validity: R(G(e.content)),
559
- state: D(e)
560
- }), C = (e) => ({
589
+ validity: R(J(e.content)),
590
+ state: Z(e)
591
+ }), F = (e) => ({
561
592
  id: e.id,
562
593
  content: e.content,
563
- validity: R(oe(e.content)),
564
- state: D(e)
565
- }), A = (e) => j(p().importProfiles.filter((t) => e(t.content))).map((t) => ({
594
+ validity: R(ie(e.content)),
595
+ state: Z(e)
596
+ }), K = (e) => D(p().importProfiles.filter((t) => e(t.content))).map((t) => ({
566
597
  id: t.id,
567
598
  name: t.content.name
568
- })), H = (e) => `${e}_stub_new_${++Te}`, E = (e) => {
599
+ })), H = (e) => `${e}_stub_new_${++fe}`, E = (e) => {
569
600
  const t = p();
570
601
  switch (e) {
571
602
  case "importProfile":
572
603
  return {
573
604
  items: t.importProfiles,
574
605
  name: "Import Profile",
575
- reasons: (s) => J(s)
606
+ reasons: (s) => L(s)
576
607
  };
577
608
  case "mapping":
578
609
  return {
579
610
  items: t.mappings,
580
611
  name: "Mapping",
581
- reasons: (s) => G(s)
612
+ reasons: (s) => J(s)
582
613
  };
583
614
  case "entitySet":
584
615
  return {
585
616
  items: t.entitySets,
586
617
  name: "Entity Set",
587
- reasons: (s) => oe(s)
618
+ reasons: (s) => ie(s)
588
619
  };
589
620
  }
590
- }, y = (e, t) => {
591
- N(t).validity = R(E(e).reasons(t.content));
592
- }, L = (e, t) => {
621
+ }, I = (e, t) => {
622
+ A(t).validity = R(E(e).reasons(t.content));
623
+ }, U = (e, t) => {
593
624
  const s = e.revisions.find((n) => n.id === t);
594
625
  if (!s) throw new Error(`Revision ${t} not found`);
595
626
  return s;
596
- }, ie = /* @__PURE__ */ new Set(), ae = r.contenthubRights ?? ["editor", "publisher"], x = (e) => {
627
+ }, oe = /* @__PURE__ */ new Set(), ae = r.contenthubRights ?? ["editor", "publisher"], z = (e) => {
597
628
  const t = p().imports.find((s) => s.id === e);
598
629
  if (!t) throw new Error(`Import ${e} not found`);
599
630
  return t;
600
- }, U = (e) => {
601
- e.cancelledBy && e.phase !== "ended" && (e.phase = "ended", e.outcome = "cancelled", e.endTime = w());
602
- }, Z = ({ itemProblems: e, ...t }) => t, W = (e, t) => {
603
- const s = fe(e);
631
+ }, W = (e) => {
632
+ e.cancelledBy && e.phase !== "ended" && (e.phase = "ended", e.outcome = "cancelled", e.endTime = P());
633
+ }, C = ({ itemProblems: e, ...t }) => t, V = (e, t) => {
634
+ const s = he(e);
604
635
  if (!s)
605
- throw new k(`the ${t} ${e.content.name} has no Release yet`);
606
- const n = e.revisions.find((a) => a.id === s.revisionId)?.content ?? e.content;
636
+ throw new M(`the ${t} ${e.content.name} has no Release yet`);
637
+ const n = e.revisions.find((i) => i.id === s.revisionId)?.content ?? e.content;
607
638
  return {
608
639
  content: n,
609
640
  ref: {
@@ -615,173 +646,173 @@ function Be(r = {}) {
615
646
  };
616
647
  };
617
648
  return {
618
- calls: I,
649
+ calls: y,
619
650
  switchWorkspace(e) {
620
- h = e;
651
+ b = e;
621
652
  },
622
653
  updateImport(e, t) {
623
- Object.assign(x(e), structuredClone(t));
654
+ Object.assign(z(e), structuredClone(t));
624
655
  },
625
- listImportProfiles: () => f("listImportProfiles", () => j(p().importProfiles).map(F)),
626
- getImportProfile: (e) => f("getImportProfile", () => F(g(p().importProfiles, e, "Import Profile"))),
656
+ listImportProfiles: () => f("listImportProfiles", () => D(p().importProfiles).map(x)),
657
+ getImportProfile: (e) => f("getImportProfile", () => x(g(p().importProfiles, e, "Import Profile"))),
627
658
  createImportProfile: (e) => f("createImportProfile", () => {
628
659
  v(p().importProfiles, e.name);
629
- const t = q("ip", e);
630
- return y("importProfile", t), p().importProfiles.push(t), F(t);
660
+ const t = G("ip", e);
661
+ return I("importProfile", t), p().importProfiles.push(t), x(t);
631
662
  }),
632
663
  updateImportProfile: (e, t, s) => f("updateImportProfile", () => {
633
664
  const n = g(p().importProfiles, e, "Import Profile");
634
- return v(p().importProfiles, t.name, e), O(n, t, s), y("importProfile", n), F(n);
665
+ return v(p().importProfiles, t.name, e), N(n, t, s), I("importProfile", n), x(n);
635
666
  }),
636
667
  deleteImportProfile: (e) => f("deleteImportProfile", () => {
637
668
  g(p().importProfiles, e, "Import Profile"), p().importProfiles = p().importProfiles.filter((t) => t.id !== e);
638
669
  }),
639
670
  listProcessors: () => f("listProcessors", () => [...l].sort((e, t) => e.name.localeCompare(t.name))),
640
- listMappings: () => f("listMappings", () => j(p().mappings).map(z)),
641
- getMapping: (e) => f("getMapping", () => z(g(p().mappings, e, "Mapping"))),
671
+ listMappings: () => f("listMappings", () => D(p().mappings).map(O)),
672
+ getMapping: (e) => f("getMapping", () => O(g(p().mappings, e, "Mapping"))),
642
673
  createMapping: (e) => f("createMapping", () => {
643
674
  v(p().mappings, e.name);
644
- const t = q("mp", e);
645
- return y("mapping", t), p().mappings.push(t), z(t);
675
+ const t = G("mp", e);
676
+ return I("mapping", t), p().mappings.push(t), O(t);
646
677
  }),
647
678
  updateMapping: (e, t, s) => f("updateMapping", () => {
648
679
  const n = g(p().mappings, e, "Mapping");
649
- return v(p().mappings, t.name, e), O(n, t, s), y("mapping", n), z(n);
680
+ return v(p().mappings, t.name, e), N(n, t, s), I("mapping", n), O(n);
650
681
  }),
651
682
  deleteMapping: (e) => f("deleteMapping", () => {
652
683
  g(p().mappings, e, "Mapping");
653
- const t = A((s) => s.mappingIds.includes(e));
684
+ const t = K((s) => s.mappingIds.includes(e));
654
685
  if (t.length > 0)
655
- throw new ce(
686
+ throw new le(
656
687
  t,
657
688
  `the Mapping is included by ${t.map((s) => s.name).join(", ")}`
658
689
  );
659
690
  p().mappings = p().mappings.filter((s) => s.id !== e);
660
691
  }),
661
- listMappingImportProfiles: (e) => f("listMappingImportProfiles", () => (g(p().mappings, e, "Mapping"), A((t) => t.mappingIds.includes(e)))),
692
+ listMappingImportProfiles: (e) => f("listMappingImportProfiles", () => (g(p().mappings, e, "Mapping"), K((t) => t.mappingIds.includes(e)))),
662
693
  checkMappingBlueprintRelease: (e, t) => f("checkMappingBlueprintRelease", () => {
663
- const s = g(p().mappings, e, "Mapping"), n = u.find((a) => a.id === t);
694
+ const s = g(p().mappings, e, "Mapping"), n = u.find((i) => i.id === t);
664
695
  if (!n) throw new Error(`Blueprint Release ${t} not found`);
665
696
  if (n.blueprintId !== s.content.blueprintId)
666
697
  throw new Error("the Release is of another Blueprint");
667
698
  return {
668
699
  blueprintId: n.blueprintId,
669
- missingFieldPaths: (s.content.fields ?? []).flatMap((a, o) => se(a, "", `/fields/${o}`).map((i) => i.path)).filter((a) => !n.fieldPaths.includes(a)),
700
+ missingFieldPaths: (s.content.fields ?? []).flatMap((i, o) => se(i, "", `/fields/${o}`).map((a) => a.path)).filter((i) => !n.fieldPaths.includes(i)),
670
701
  missingReleaseSpecFields: [
671
- ...(s.content.releaseSpec ?? []).map((a) => a.field ?? ""),
702
+ ...(s.content.releaseSpec ?? []).map((i) => i.field ?? ""),
672
703
  ...s.content.versionMatch?.releaseSpecFields ?? []
673
704
  ].filter(
674
- (a, o, i) => a !== "" && i.indexOf(a) === o && !(n.releaseSpecFields ?? []).some((m) => m.path === a)
705
+ (i, o, a) => i !== "" && a.indexOf(i) === o && !(n.releaseSpecFields ?? []).some((m) => m.path === i)
675
706
  )
676
707
  };
677
708
  }),
678
- listEntitySets: () => f("listEntitySets", () => j(p().entitySets).map(C)),
679
- getEntitySet: (e) => f("getEntitySet", () => C(g(p().entitySets, e, "Entity Set"))),
709
+ listEntitySets: () => f("listEntitySets", () => D(p().entitySets).map(F)),
710
+ getEntitySet: (e) => f("getEntitySet", () => F(g(p().entitySets, e, "Entity Set"))),
680
711
  createEntitySet: (e) => f("createEntitySet", () => {
681
712
  v(p().entitySets, e.name);
682
- const t = q("es", e);
683
- return y("entitySet", t), p().entitySets.push(t), C(t);
713
+ const t = G("es", e);
714
+ return I("entitySet", t), p().entitySets.push(t), F(t);
684
715
  }),
685
716
  updateEntitySet: (e, t, s) => f("updateEntitySet", () => {
686
717
  const n = g(p().entitySets, e, "Entity Set");
687
- return v(p().entitySets, t.name, e), O(n, t, s), y("entitySet", n), C(n);
718
+ return v(p().entitySets, t.name, e), N(n, t, s), I("entitySet", n), F(n);
688
719
  }),
689
720
  deleteEntitySet: (e) => f("deleteEntitySet", () => {
690
721
  g(p().entitySets, e, "Entity Set");
691
- const t = A((s) => s.entitySetId === e);
722
+ const t = K((s) => s.entitySetId === e);
692
723
  if (t.length > 0)
693
- throw new ce(
724
+ throw new le(
694
725
  t,
695
726
  `the Entity Set is named by ${t.map((s) => s.name).join(", ")}`
696
727
  );
697
728
  p().entitySets = p().entitySets.filter((s) => s.id !== e);
698
729
  }),
699
730
  cutRelease: (e, t, s) => f("cutRelease", () => {
700
- const n = E(e), a = g(n.items, t, n.name);
701
- if (ne(a, s))
702
- throw new Y("the draft moved: somebody saved in between");
703
- const o = R(n.reasons(a.content));
704
- if (!o.valid) throw new Y("the draft is invalid", o);
705
- if (!D(a).draftDiffersFromRelease)
706
- throw new Y(
731
+ const n = E(e), i = g(n.items, t, n.name);
732
+ if (ne(i, s))
733
+ throw new Q("the draft moved: somebody saved in between");
734
+ const o = R(n.reasons(i.content));
735
+ if (!o.valid) throw new Q("the draft is invalid", o);
736
+ if (!Z(i).draftDiffersFromRelease)
737
+ throw new Q(
707
738
  "the draft does not differ from the latest Release: there is nothing to release"
708
739
  );
709
- const i = a.releases.length + 1, m = {
710
- id: `${a.id}_rel${i}`,
711
- number: i,
712
- revisionId: N(a).id,
713
- releasedBy: _,
714
- releasedAt: w()
740
+ const a = i.releases.length + 1, m = {
741
+ id: `${i.id}_rel${a}`,
742
+ number: a,
743
+ revisionId: A(i).id,
744
+ releasedBy: h,
745
+ releasedAt: P()
715
746
  };
716
- return a.releases.push(m), {
747
+ return i.releases.push(m), {
717
748
  release: m,
718
- importProfiles: e === "mapping" ? A((d) => d.mappingIds.includes(t)) : []
749
+ importProfiles: e === "mapping" ? K((d) => d.mappingIds.includes(t)) : []
719
750
  };
720
751
  }),
721
752
  listHistory: (e, t, s) => f("listHistory", () => {
722
- const n = E(e), a = g(n.items, t, n.name), o = [...a.revisions].reverse(), i = Number(s || "0");
753
+ const n = E(e), i = g(n.items, t, n.name), o = [...i.revisions].reverse(), a = Number(s || "0");
723
754
  return {
724
- revisions: o.slice(i, i + 10).map((d) => ({
755
+ revisions: o.slice(a, a + 10).map((d) => ({
725
756
  id: d.id,
726
757
  savedBy: d.savedBy,
727
758
  savedAt: d.savedAt,
728
759
  validity: d.validity ?? R(n.reasons(d.content)),
729
760
  restoredFromRevisionId: d.restoredFromRevisionId
730
761
  })),
731
- releases: [...a.releases].reverse(),
732
- nextPageToken: i + 10 < o.length ? String(i + 10) : ""
762
+ releases: [...i.releases].reverse(),
763
+ nextPageToken: a + 10 < o.length ? String(a + 10) : ""
733
764
  };
734
765
  }),
735
766
  compareRevisions: (e, t, s, n) => f("compareRevisions", () => {
736
- const a = E(e), o = g(a.items, t, a.name), i = me(L(o, s).content), m = me(L(o, n).content), d = [.../* @__PURE__ */ new Set([...Object.keys(i), ...Object.keys(m)])].map((M) => {
737
- const S = i[M], V = m[M], ge = S === void 0 && V !== void 0 ? "added" : S !== void 0 && V === void 0 ? "removed" : JSON.stringify(S) === JSON.stringify(V) ? "unchanged" : "changed";
738
- return { field: M, status: ge };
767
+ const i = E(e), o = g(i.items, t, i.name), a = ue(U(o, s).content), m = ue(U(o, n).content), d = [.../* @__PURE__ */ new Set([...Object.keys(a), ...Object.keys(m)])].map((k) => {
768
+ const S = a[k], Y = m[k], be = S === void 0 && Y !== void 0 ? "added" : S !== void 0 && Y === void 0 ? "removed" : JSON.stringify(S) === JSON.stringify(Y) ? "unchanged" : "changed";
769
+ return { field: k, status: be };
739
770
  });
740
771
  return {
741
- from: { revisionId: s, content: i },
772
+ from: { revisionId: s, content: a },
742
773
  to: { revisionId: n, content: m },
743
774
  fields: d
744
775
  };
745
776
  }),
746
777
  restoreRevision: (e, t, s, n) => f("restoreRevision", () => {
747
- const a = E(e), o = g(a.items, t, a.name);
748
- O(o, L(o, s).content, n, s), y(e, o);
778
+ const i = E(e), o = g(i.items, t, i.name);
779
+ N(o, U(o, s).content, n, s), I(e, o);
749
780
  }),
750
781
  async uploadSourceFile(e, t) {
751
- if (I.uploadSourceFile++, r.fail) throw r.fail;
782
+ if (y.uploadSourceFile++, r.fail) throw r.fail;
752
783
  for (const n of [0.25, 0.5, 0.75])
753
- await new Promise((a) => setTimeout(a, 20)), t(n);
784
+ await new Promise((i) => setTimeout(i, 20)), t(n);
754
785
  if (r.uploadFails) throw r.uploadFails;
755
786
  t(1);
756
787
  const s = H("sf");
757
- return ie.add(s), { id: s, fileName: e.name };
788
+ return oe.add(s), { id: s, fileName: e.name };
758
789
  },
759
790
  startImport: (e) => f("startImport", () => {
760
791
  const t = p(), s = g(t.importProfiles, e.importProfileId, "Import Profile");
761
- if (!ie.has(e.sourceFileId))
762
- throw new k("nothing was uploaded to the Source File");
792
+ if (!oe.has(e.sourceFileId))
793
+ throw new M("nothing was uploaded to the Source File");
763
794
  if (!ae.includes("editor"))
764
- throw new k(
795
+ throw new M(
765
796
  "starting an Import needs contenthub editor in the workspace"
766
797
  );
767
- const n = W(s, "Import Profile");
798
+ const n = V(s, "Import Profile");
768
799
  if (n.content.autoPublish && !ae.includes("publisher"))
769
- throw new k(
800
+ throw new M(
770
801
  "the Import Profile has Auto-publish, which needs contenthub publisher"
771
802
  );
772
- const a = J(n.content);
773
- if (a.length > 0)
774
- throw new k(
775
- `the Import Profile ${n.ref.name} is invalid: ${a.map((d) => d.message).join(" ")}`
803
+ const i = L(n.content);
804
+ if (i.length > 0)
805
+ throw new M(
806
+ `the Import Profile ${n.ref.name} is invalid: ${i.map((d) => d.message).join(" ")}`
776
807
  );
777
808
  const o = n.content.mappingIds.map(
778
- (d) => W(g(t.mappings, d, "Mapping"), "Mapping").ref
779
- ), i = n.content.entitySetId ? W(g(t.entitySets, n.content.entitySetId, "Entity Set"), "Entity Set").ref : void 0, m = {
809
+ (d) => V(g(t.mappings, d, "Mapping"), "Mapping").ref
810
+ ), a = n.content.entitySetId ? V(g(t.entitySets, n.content.entitySetId, "Entity Set"), "Entity Set").ref : void 0, m = {
780
811
  id: H("im"),
781
812
  importProfileId: s.id,
782
813
  importProfileName: n.ref.name,
783
814
  sourceFileId: e.sourceFileId,
784
- startedBy: _,
815
+ startedBy: h,
785
816
  phase: "queued",
786
817
  failureReason: "",
787
818
  progress: { done: 0, total: 0 },
@@ -798,9 +829,9 @@ function Be(r = {}) {
798
829
  releases: {
799
830
  importProfile: n.ref,
800
831
  mappings: o,
801
- ...i ? { entitySet: i } : {}
832
+ ...a ? { entitySet: a } : {}
802
833
  },
803
- createTime: w(),
834
+ createTime: P(),
804
835
  startTime: "",
805
836
  endTime: "",
806
837
  cancelledBy: "",
@@ -808,28 +839,28 @@ function Be(r = {}) {
808
839
  ...e.source ? { source: e.source } : {},
809
840
  itemProblems: []
810
841
  };
811
- return t.imports.unshift(m), Z(m);
842
+ return t.imports.unshift(m), C(m);
812
843
  }),
813
844
  listImports: (e) => f("listImports", () => {
814
845
  const t = p().imports;
815
- t.forEach(U);
846
+ t.forEach(W);
816
847
  const s = Number(e || "0");
817
848
  return {
818
- imports: t.slice(s, s + 50).map(Z),
849
+ imports: t.slice(s, s + 50).map(C),
819
850
  nextPageToken: s + 50 < t.length ? String(s + 50) : ""
820
851
  };
821
852
  }),
822
853
  getImport: (e) => f("getImport", () => {
823
- const t = x(e);
824
- return U(t), Z(t);
854
+ const t = z(e);
855
+ return W(t), C(t);
825
856
  }),
826
857
  cancelImport: (e) => f("cancelImport", () => {
827
- const t = x(e);
858
+ const t = z(e);
828
859
  if (t.phase === "ended") throw new Error("the Import has ended");
829
- return t.cancelledBy ||= _, t.phase === "queued" && U(t), Z(t);
860
+ return t.cancelledBy ||= h, t.phase === "queued" && W(t), C(t);
830
861
  }),
831
862
  listItemProblems: (e, t) => f("listItemProblems", () => {
832
- const s = x(e).itemProblems ?? [], n = t.sourceKeyQuery.toLowerCase(), a = s.filter(
863
+ const s = z(e).itemProblems ?? [], n = t.sourceKeyQuery.toLowerCase(), i = s.filter(
833
864
  (m) => (!t.mappingId || m.mappingId === t.mappingId) && m.sourceKey.toLowerCase().includes(n)
834
865
  ), o = /* @__PURE__ */ new Map();
835
866
  for (const m of s) {
@@ -840,18 +871,42 @@ function Be(r = {}) {
840
871
  };
841
872
  d.count++, o.set(m.mappingId, d);
842
873
  }
843
- const i = Number(t.pageToken || "0");
874
+ const a = Number(t.pageToken || "0");
844
875
  return {
845
- itemProblems: a.slice(i, i + 50),
876
+ itemProblems: i.slice(a, a + 50),
846
877
  totalCount: s.length,
847
- matchingCount: a.length,
878
+ matchingCount: i.length,
848
879
  mappings: [...o.values()].sort((m, d) => m.mappingName.localeCompare(d.mappingName)),
849
- nextPageToken: i + 50 < a.length ? String(i + 50) : ""
880
+ nextPageToken: a + 50 < i.length ? String(a + 50) : ""
850
881
  };
882
+ }),
883
+ listApiKeys: () => f("listApiKeys", () => p().apiKeys),
884
+ createApiKey: (e) => f("createApiKey", () => {
885
+ const t = e.name.trim();
886
+ if (!t) throw new Error("a name is required");
887
+ if (t.length > ce)
888
+ throw new Error(`the name is longer than ${ce} characters`);
889
+ const s = e.expireTime ? new Date(e.expireTime).toISOString() : "";
890
+ if (s && Date.parse(s) <= Date.now())
891
+ throw new Error("the expiry must lie in the future");
892
+ const n = ++fe, i = {
893
+ id: `key_stub_new_${n}`,
894
+ name: t,
895
+ keyPrefix: `ihk_n${String(n).padStart(3, "0")}`,
896
+ owner: h,
897
+ expireTime: s,
898
+ createTime: (/* @__PURE__ */ new Date()).toISOString()
899
+ };
900
+ return p().apiKeys.unshift(i), { apiKey: i, secret: `${i.keyPrefix}_stub_secret_${n}` };
901
+ }),
902
+ revokeApiKey: (e) => f("revokeApiKey", () => {
903
+ const t = p();
904
+ if (!t.apiKeys.some((s) => s.id === e)) throw new Error(`API key ${e} not found`);
905
+ t.apiKeys = t.apiKeys.filter((s) => s.id !== e);
851
906
  })
852
907
  };
853
908
  }
854
- function Re(r) {
909
+ function Ee(r) {
855
910
  const c = [], l = { "]": "[", ")": "(" };
856
911
  for (const u of r)
857
912
  if (u === "[" || u === "(") c.push(u);
@@ -863,13 +918,13 @@ function se(r, c, l) {
863
918
  return [
864
919
  { path: u, rel: l, mapping: r },
865
920
  ...["fields", "virtualTableFields"].flatMap(
866
- (h) => (Array.isArray(r[h]) ? r[h] : []).flatMap(
867
- (I, p) => se(I, `${u}.`, `${l}/${h}/${p}`)
921
+ (b) => (Array.isArray(r[b]) ? r[b] : []).flatMap(
922
+ (y, p) => se(y, `${u}.`, `${l}/${b}/${p}`)
868
923
  )
869
924
  )
870
925
  ];
871
926
  }
872
- function Ne(r = ue()) {
927
+ function xe(r = ge()) {
873
928
  return {
874
929
  async listBlueprints() {
875
930
  return [...new Map(r.map((l) => [l.blueprintId, l.blueprintName]))].map(([l, u]) => ({ id: l, name: u })).sort((l, u) => l.name.localeCompare(u.name));
@@ -897,18 +952,19 @@ function Ne(r = ue()) {
897
952
  };
898
953
  }
899
954
  export {
900
- ee as STUB_OTHER_USER_ID,
901
- Me as STUB_OTHER_WORKSPACE_ID,
902
- _ as STUB_USER_ID,
955
+ q as STUB_OTHER_USER_ID,
956
+ Be as STUB_OTHER_WORKSPACE_ID,
957
+ h as STUB_USER_ID,
903
958
  te as STUB_WORKSPACE_ID,
904
- Ne as createStubBlueprints,
905
- Be as createStubImporthubClient,
906
- ue as stubBlueprintReleases,
907
- Ie as stubEntitySets,
908
- ke as stubIdentity,
909
- ye as stubImportProfiles,
910
- Pe as stubImports,
911
- _e as stubMappings,
912
- Se as stubProcessors
959
+ xe as createStubBlueprints,
960
+ Ne as createStubImporthubClient,
961
+ Te as stubApiKeys,
962
+ ge as stubBlueprintReleases,
963
+ Se as stubEntitySets,
964
+ Ae as stubIdentity,
965
+ we as stubImportProfiles,
966
+ ve as stubImports,
967
+ Ie as stubMappings,
968
+ Pe as stubProcessors
913
969
  };
914
970
  //# sourceMappingURL=testing.js.map