@nice2dev/erp-adapter 1.3.13 → 1.3.15

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/omniverk.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { objectFileKind as _e, endsWithAny as te, arrayFileKind as ze, i18nFileKind as Be, itemsFileKind as Oe, jsonFileKind as Ae, jsonValuesEqual as Le, keepTextFormat as Je, parseJsonText as _, patchJsonText as De, stringifyJsonText as de } from "@nice2dev/ui-forms/studio";
1
+ import { objectFileKind as _e, endsWithAny as te, arrayFileKind as Be, i18nFileKind as ze, itemsFileKind as Oe, jsonFileKind as Ae, jsonValuesEqual as Le, keepTextFormat as Je, parseJsonText as _, patchJsonText as Me, stringifyJsonText as de } from "@nice2dev/ui-forms/studio";
2
2
  const V = (e) => typeof e == "object" && e !== null && !Array.isArray(e), G = (e) => typeof e == "string" && e ? e : void 0, U = (e) => Object.fromEntries(Object.entries(e).filter(([, i]) => i !== void 0)), He = _e({
3
3
  id: "manifest",
4
4
  label: "Manifest",
@@ -6,14 +6,14 @@ const V = (e) => typeof e == "object" && e !== null && !Array.isArray(e), G = (e
6
6
  icon: "file",
7
7
  editor: "manifest",
8
8
  match: te(".manifest.json")
9
- }), Me = [
9
+ }), De = [
10
10
  ["dataType", "type"],
11
11
  ["isRequired", "required"]
12
12
  ], le = "$aliases";
13
13
  function Ze(e) {
14
14
  if (!V(e))
15
15
  return e;
16
- const i = Me.filter(([o, n]) => !(o in e) && n in e);
16
+ const i = De.filter(([o, n]) => !(o in e) && n in e);
17
17
  if (i.length === 0)
18
18
  return e;
19
19
  const t = {};
@@ -30,13 +30,13 @@ function Ye(e) {
30
30
  for (const [o, n] of Object.entries(e)) {
31
31
  if (o === le)
32
32
  continue;
33
- const s = Me.find(([r, l]) => r === o && i.includes(l));
33
+ const s = De.find(([r, l]) => r === o && i.includes(l));
34
34
  t[s ? s[1] : o] = n;
35
35
  }
36
36
  return t;
37
37
  }
38
38
  const Se = (e, i) => V(e) && Array.isArray(e.fields) ? { ...e, fields: e.fields.map(i) } : e, Xe = (() => {
39
- const e = ze({
39
+ const e = Be({
40
40
  id: "entities",
41
41
  label: "Entities",
42
42
  labelKey: "devStudio.kind.entities",
@@ -55,7 +55,7 @@ const Se = (e, i) => V(e) && Array.isArray(e.fields) ? { ...e, fields: e.fields.
55
55
  o
56
56
  )
57
57
  };
58
- })(), Qe = Be(), ge = {
58
+ })(), Qe = ze(), ge = {
59
59
  input: "textInput",
60
60
  text: "textInput",
61
61
  textarea: "textArea",
@@ -96,19 +96,19 @@ function et(e) {
96
96
  ]
97
97
  };
98
98
  }
99
- function Fe(e, i) {
100
- var l, y, c;
101
- const t = (e.rows ?? []).flatMap((m) => m.cells).find((m) => m.controlType === "dataGrid"), o = ((l = t == null ? void 0 : t.props) == null ? void 0 : l.columns) ?? [], n = i.columns ?? [], s = (c = (y = e.dataSources) == null ? void 0 : y.find((m) => m.type === "entity")) == null ? void 0 : c.entity, r = (m) => "displayName" in m ? "displayName" : "header" in m ? "header" : "label" in m ? "label" : "displayName";
99
+ function Ke(e, i) {
100
+ var l, y, d;
101
+ const t = (e.rows ?? []).flatMap((m) => m.cells).find((m) => m.controlType === "dataGrid"), o = ((l = t == null ? void 0 : t.props) == null ? void 0 : l.columns) ?? [], n = i.columns ?? [], s = (d = (y = e.dataSources) == null ? void 0 : y.find((m) => m.type === "entity")) == null ? void 0 : d.entity, r = (m) => "displayName" in m ? "displayName" : "header" in m ? "header" : "label" in m ? "label" : "displayName";
102
102
  return U({
103
103
  ...i,
104
104
  displayName: "displayName" in i || e.name !== i.name ? e.name : void 0,
105
105
  entityName: s ?? i.entityName,
106
106
  columns: o.map((m) => {
107
- const b = n.find((N) => N.field === m.field);
107
+ const b = n.find((T) => T.field === m.field);
108
108
  if (!b)
109
109
  return { field: m.field, displayName: m.header ?? m.field };
110
- const C = r(b), S = m.header ?? m.field;
111
- return b[C] === void 0 && S === m.field ? b : { ...b, [C]: S };
110
+ const C = r(b), j = m.header ?? m.field;
111
+ return b[C] === void 0 && j === m.field ? b : { ...b, [C]: j };
112
112
  })
113
113
  });
114
114
  }
@@ -142,12 +142,12 @@ function tt(e) {
142
142
  ]
143
143
  });
144
144
  let l = [], y = 0;
145
- const c = () => {
145
+ const d = () => {
146
146
  l.length && (i.push({ id: `tab-${n}-section-${r}-row-${i.length}`, cells: l }), l = [], y = 0);
147
147
  };
148
148
  (s.controls ?? []).forEach((m, b) => {
149
149
  const C = typeof m.colSpan == "number" ? m.colSpan : 6;
150
- y + C > 12 && c(), l.push({
150
+ y + C > 12 && d(), l.push({
151
151
  id: `c-${n}-${r}-${b}`,
152
152
  controlType: ge[String(m.type)] ?? "textInput",
153
153
  colSpan: C,
@@ -159,7 +159,7 @@ function tt(e) {
159
159
  },
160
160
  bindings: { value: { source: "record", field: String(m.field ?? "") } }
161
161
  }), y += C;
162
- }), c();
162
+ }), d();
163
163
  });
164
164
  }), {
165
165
  id: String(e.name),
@@ -171,48 +171,48 @@ function tt(e) {
171
171
  rows: i
172
172
  };
173
173
  }
174
- function Pe(e, i) {
175
- var c, m, b, C, S;
174
+ function Fe(e, i) {
175
+ var d, m, b, C, j;
176
176
  const t = i.tabs ?? [], o = t.flatMap(
177
- (N) => (N.sections ?? []).flatMap((x) => x.controls ?? [])
177
+ (T) => (T.sections ?? []).flatMap((I) => I.controls ?? [])
178
178
  ), n = [];
179
179
  let s = null, r = null;
180
180
  const l = () => (s || (s = { name: "Main", displayName: e.name, sections: [] }, n.push(s)), r || (r = { name: "Details", displayName: "Details", controls: [] }, s.sections.push(r)), r);
181
- for (const N of e.rows ?? [])
182
- for (const x of N.cells) {
183
- const d = x.props ?? {};
184
- if (x.controlType === "heading" && (d.level === 2 || d.level === 3)) {
185
- const I = G(d.name) ?? String(d.text ?? "").replace(/\s+/g, "");
186
- if (d.level === 2)
187
- s = { ...t.find((E) => E.name === I) ?? {}, name: I, displayName: String(d.text ?? I), sections: [] }, n.push(s), r = null;
181
+ for (const T of e.rows ?? [])
182
+ for (const I of T.cells) {
183
+ const c = I.props ?? {};
184
+ if (I.controlType === "heading" && (c.level === 2 || c.level === 3)) {
185
+ const x = G(c.name) ?? String(c.text ?? "").replace(/\s+/g, "");
186
+ if (c.level === 2)
187
+ s = { ...t.find((k) => k.name === x) ?? {}, name: x, displayName: String(c.text ?? x), sections: [] }, n.push(s), r = null;
188
188
  else {
189
189
  s || (s = { name: "Main", displayName: e.name, sections: [] }, n.push(s));
190
- const M = t.flatMap((j) => j.sections ?? []).find((j) => j.name === I);
191
- r = { ...M ? Object.fromEntries(Object.entries(M).filter(([j]) => j !== "controls")) : {}, name: I, displayName: String(d.text ?? I), controls: [] }, s.sections.push(r);
190
+ const D = t.flatMap((S) => S.sections ?? []).find((S) => S.name === x);
191
+ r = { ...D ? Object.fromEntries(Object.entries(D).filter(([S]) => S !== "controls")) : {}, name: x, displayName: String(c.text ?? x), controls: [] }, s.sections.push(r);
192
192
  }
193
193
  continue;
194
194
  }
195
- const $ = ((m = (c = x.bindings) == null ? void 0 : c.value) == null ? void 0 : m.field) ?? G(d.field);
196
- if (!$)
195
+ const v = ((m = (d = I.bindings) == null ? void 0 : d.value) == null ? void 0 : m.field) ?? G(c.field);
196
+ if (!v)
197
197
  continue;
198
- const u = o.find((I) => I.field === $), T = u && ge[String(u.type)] === x.controlType ? u.type : ((b = Object.entries(ge).find(([, I]) => I === x.controlType)) == null ? void 0 : b[0]) ?? "input", L = U({
199
- ...u ?? {},
200
- field: $,
201
- type: T,
202
- label: d.label !== void 0 ? String(d.label) : u == null ? void 0 : u.label,
203
- colSpan: (u == null ? void 0 : u.colSpan) !== void 0 || x.colSpan !== 6 ? x.colSpan : void 0,
204
- required: d.required === !0 ? !0 : (u == null ? void 0 : u.required) === !0 ? !1 : u == null ? void 0 : u.required
198
+ const f = o.find((x) => x.field === v), E = f && ge[String(f.type)] === I.controlType ? f.type : ((b = Object.entries(ge).find(([, x]) => x === I.controlType)) == null ? void 0 : b[0]) ?? "input", A = U({
199
+ ...f ?? {},
200
+ field: v,
201
+ type: E,
202
+ label: c.label !== void 0 ? String(c.label) : f == null ? void 0 : f.label,
203
+ colSpan: (f == null ? void 0 : f.colSpan) !== void 0 || I.colSpan !== 6 ? I.colSpan : void 0,
204
+ required: c.required === !0 ? !0 : (f == null ? void 0 : f.required) === !0 ? !1 : f == null ? void 0 : f.required
205
205
  });
206
- l().controls.push(L);
206
+ l().controls.push(A);
207
207
  }
208
- const y = n.map((N) => {
209
- const x = t.find((d) => d.name === N.name);
210
- return x ? { ...x, ...N } : N;
208
+ const y = n.map((T) => {
209
+ const I = t.find((c) => c.name === T.name);
210
+ return I ? { ...I, ...T } : T;
211
211
  });
212
212
  return U({
213
213
  ...i,
214
214
  displayName: "displayName" in i || e.name !== i.name ? e.name : void 0,
215
- entityName: ((S = (C = e.dataSources) == null ? void 0 : C.find((N) => N.type === "entity")) == null ? void 0 : S.entity) ?? i.entityName,
215
+ entityName: ((j = (C = e.dataSources) == null ? void 0 : C.find((T) => T.type === "entity")) == null ? void 0 : j.entity) ?? i.entityName,
216
216
  tabs: y
217
217
  });
218
218
  }
@@ -229,18 +229,18 @@ function nt(e, i) {
229
229
  source: e,
230
230
  rawReason: String(t.type ?? (t.viewJson ? "viewJson" : "unknown"))
231
231
  };
232
- const r = s === "List" ? et(t) : tt(t), l = s === "List" ? Fe(r, t) : Pe(r, t);
232
+ const r = s === "List" ? et(t) : tt(t), l = s === "List" ? Ke(r, t) : Fe(r, t);
233
233
  return Le(l, e) ? { key: o, label: n, definition: r, source: e } : { key: o, label: n, source: e, rawReason: `${s} (round-trip)` };
234
234
  }
235
235
  function st(e) {
236
236
  if (!e.definition)
237
237
  return e.source;
238
238
  const i = V(e.source) ? e.source : { name: e.definition.id };
239
- return e.definition.kind === "form" ? Pe(e.definition, {
239
+ return e.definition.kind === "form" ? Fe(e.definition, {
240
240
  type: "Form",
241
241
  ...i,
242
242
  name: i.name ?? e.definition.id
243
- }) : Fe(e.definition, {
243
+ }) : Ke(e.definition, {
244
244
  type: "List",
245
245
  ...i,
246
246
  name: i.name ?? e.definition.id
@@ -280,7 +280,7 @@ function at(e) {
280
280
  }))
281
281
  };
282
282
  }
283
- function Re(e, i) {
283
+ function Pe(e, i) {
284
284
  const t = i.steps ?? [], o = i.connections ?? [];
285
285
  return U({
286
286
  ...i,
@@ -312,13 +312,13 @@ function rt(e, i) {
312
312
  if (!(Array.isArray(t.connections) && Array.isArray(s) && s.every((y) => V(y) && typeof y.state == "string")))
313
313
  return { key: o, label: n, source: e, rawReason: G(t.triggerType) ?? "automation" };
314
314
  const l = at(t);
315
- return Le(Re(l, t), e) ? { key: o, label: n, definition: l, source: e } : { key: o, label: n, source: e, rawReason: "state machine (round-trip)" };
315
+ return Le(Pe(l, t), e) ? { key: o, label: n, definition: l, source: e } : { key: o, label: n, source: e, rawReason: "state machine (round-trip)" };
316
316
  }
317
317
  function lt(e) {
318
318
  if (!e.definition)
319
319
  return e.source;
320
320
  const i = V(e.source) ? e.source : { name: e.definition.id };
321
- return Re(e.definition, {
321
+ return Pe(e.definition, {
322
322
  ...i,
323
323
  name: i.name ?? e.definition.id
324
324
  });
@@ -384,7 +384,7 @@ const mt = Ae({
384
384
  select: dt,
385
385
  assign: pt,
386
386
  arrayKey: (e) => e === "/permissions" ? "code" : e === "/permissionGroups" ? "name" : void 0
387
- }), ft = Ae({
387
+ }), ut = Ae({
388
388
  id: "seeds",
389
389
  label: "Seed data",
390
390
  labelKey: "devStudio.kind.seeds",
@@ -399,7 +399,7 @@ const mt = Ae({
399
399
  },
400
400
  assign: (e, i) => U({ ...V(e) ? e : {}, seeds: i.seeds, demoSeeds: i.demoSeeds }),
401
401
  arrayKey: () => "Id"
402
- }), ut = {
402
+ }), ft = {
403
403
  id: "script",
404
404
  label: "Script",
405
405
  labelKey: "devStudio.kind.script",
@@ -417,9 +417,9 @@ const mt = Ae({
417
417
  ot,
418
418
  ct,
419
419
  mt,
420
- ft,
421
- ut
422
- ], gt = (e, i) => i, B = (e) => ({
420
+ ut,
421
+ ft
422
+ ], gt = (e, i) => i, z = (e) => ({
423
423
  type: "array",
424
424
  title: e,
425
425
  items: { type: "string" }
@@ -474,7 +474,9 @@ function ht(e = gt, i = {}) {
474
474
  }
475
475
  },
476
476
  required: ["packageName", "version", "category"]
477
- }
477
+ },
478
+ // a module's description runs to several sentences (1.3.14: it was a one-line field)
479
+ uiSchema: { description: { type: "textarea" } }
478
480
  },
479
481
  {
480
482
  id: "modules",
@@ -493,11 +495,11 @@ function ht(e = gt, i = {}) {
493
495
  description: { type: "string", title: t("field.description", "Description") },
494
496
  icon: { type: "string", title: t("field.icon", "Icon") },
495
497
  color: { type: "string", title: t("field.color", "Colour") },
496
- parts: B(t("field.parts", "Files"))
498
+ parts: z(t("field.parts", "Files"))
497
499
  }
498
500
  }
499
501
  },
500
- i18n: B(t("field.i18n", "Translation files"))
502
+ i18n: z(t("field.i18n", "Translation files"))
501
503
  }
502
504
  }
503
505
  },
@@ -507,7 +509,7 @@ function ht(e = gt, i = {}) {
507
509
  schema: {
508
510
  type: "object",
509
511
  properties: {
510
- dependencies: B(t("field.dependencies", "Required packages")),
512
+ dependencies: z(t("field.dependencies", "Required packages")),
511
513
  dependencyRefs: {
512
514
  type: "array",
513
515
  title: t("field.dependencyRefs", "Dependency details"),
@@ -534,8 +536,8 @@ function ht(e = gt, i = {}) {
534
536
  }
535
537
  }
536
538
  },
537
- provides: B(t("field.provides", "Provides")),
538
- requiredControls: B(t("field.requiredControls", "Required controls"))
539
+ provides: z(t("field.provides", "Provides")),
540
+ requiredControls: z(t("field.requiredControls", "Required controls"))
539
541
  }
540
542
  }
541
543
  },
@@ -711,8 +713,8 @@ function ht(e = gt, i = {}) {
711
713
  image: { type: "string", title: t("field.image", "Image") },
712
714
  tag: { type: "string", title: t("field.tag", "Tag") },
713
715
  description: { type: "string", title: t("field.description", "Description") },
714
- ports: B(t("field.ports", "Ports")),
715
- volumes: B(t("field.volumes", "Volumes")),
716
+ ports: z(t("field.ports", "Ports")),
717
+ volumes: z(t("field.volumes", "Volumes")),
716
718
  command: { type: "string", title: t("field.command", "Command") },
717
719
  healthCheckCmd: {
718
720
  type: "string",
@@ -858,31 +860,31 @@ const W = "Custom.", Ne = "Core", wt = {
858
860
  function bt(e) {
859
861
  return [...e.normalize("NFD")].map((i) => $t[i] ?? (new RegExp("\\p{Mn}", "u").test(i) ? "" : i)).join("").normalize("NFC");
860
862
  }
861
- function R(e) {
863
+ function P(e) {
862
864
  const i = bt(e ?? "").split(/[^A-Za-z0-9]+/).filter(Boolean).map((t) => t[0].toUpperCase() + t.slice(1)).join("");
863
865
  return /^[0-9]/.test(i) ? `M${i}` : i;
864
866
  }
865
- const Te = (e) => e !== e.toLowerCase() && e === e.toUpperCase();
867
+ const je = (e) => e !== e.toLowerCase() && e === e.toUpperCase();
866
868
  function he(e) {
867
869
  return [...e].map(
868
- (i, t) => t > 0 && Te(i) && !Te(e[t - 1]) ? `_${i.toLowerCase()}` : i.toLowerCase()
870
+ (i, t) => t > 0 && je(i) && !je(e[t - 1]) ? `_${i.toLowerCase()}` : i.toLowerCase()
869
871
  ).join("");
870
872
  }
871
873
  function kt(e) {
872
874
  return (e.startsWith(W) ? e.slice(W.length) : e.split(".").pop() ?? e).toLowerCase().replace(/[^a-z0-9_-]+/g, "") || "module";
873
875
  }
874
- async function Ke(e) {
876
+ async function Re(e) {
875
877
  const i = await globalThis.crypto.subtle.digest("SHA-256", new TextEncoder().encode(e));
876
878
  return new Uint8Array(i);
877
879
  }
878
880
  const ke = (e) => Array.from(e, (i) => i.toString(16).padStart(2, "0")).join("");
879
881
  async function qe(e, i) {
880
- const t = (await Ke(`${e}/${i}`.toLowerCase())).slice(0, 16), o = ke([3, 2, 1, 0, 5, 4, 7, 6, 8, 9, 10, 11, 12, 13, 14, 15].map((n) => t[n]));
882
+ const t = (await Re(`${e}/${i}`.toLowerCase())).slice(0, 16), o = ke([3, 2, 1, 0, 5, 4, 7, 6, 8, 9, 10, 11, 12, 13, 14, 15].map((n) => t[n]));
881
883
  return `${o.slice(0, 8)}-${o.slice(8, 12)}-${o.slice(12, 16)}-${o.slice(16, 20)}-${o.slice(20)}`;
882
884
  }
883
885
  async function Ve(e, i) {
884
886
  const t = `custom_${e}_${he(i)}`;
885
- return t.length <= 63 ? t : `${t.slice(0, 54)}_${ke(await Ke(t)).slice(0, 8)}`;
887
+ return t.length <= 63 ? t : `${t.slice(0, 54)}_${ke(await Re(t)).slice(0, 8)}`;
886
888
  }
887
889
  function St(e, i) {
888
890
  const t = new Set([...i].map((o) => o.toLowerCase()));
@@ -932,13 +934,13 @@ const Nt = {
932
934
  date: "date",
933
935
  datetime: "datetime"
934
936
  };
935
- function Tt(e) {
937
+ function jt(e) {
936
938
  var o;
937
939
  const i = [];
938
- (!((o = e.name) != null && o.trim()) || R(e.name).length === 0) && i.push("The module needs a name with letters or digits."), e.entities.length === 0 && i.push("The module has no entities — add at least one.");
940
+ (!((o = e.name) != null && o.trim()) || P(e.name).length === 0) && i.push("The module needs a name with letters or digits."), e.entities.length === 0 && i.push("The module has no entities — add at least one.");
939
941
  const t = /* @__PURE__ */ new Set();
940
942
  for (const n of e.entities) {
941
- const s = R(n.name);
943
+ const s = P(n.name);
942
944
  if (s.length === 0) {
943
945
  i.push(`Entity "${n.name}" needs a name with letters or digits.`);
944
946
  continue;
@@ -948,16 +950,16 @@ function Tt(e) {
948
950
  r.length === 0 && i.push(`Entity ${s} has no fields — add at least one.`);
949
951
  const l = /* @__PURE__ */ new Set();
950
952
  for (const y of r) {
951
- const c = R(y.name);
952
- c.length === 0 ? i.push(`${s}: field "${y.name}" needs a name with letters or digits.`) : l.has(c.toLowerCase()) ? i.push(`${s}: field ${c} appears twice.`) : l.add(c.toLowerCase());
953
+ const d = P(y.name);
954
+ d.length === 0 ? i.push(`${s}: field "${y.name}" needs a name with letters or digits.`) : l.has(d.toLowerCase()) ? i.push(`${s}: field ${d} appears twice.`) : l.add(d.toLowerCase());
953
955
  }
954
956
  }
955
957
  return i;
956
958
  }
957
- const jt = (e) => e.toISOString().replace(/\.(\d{3})Z$/, ".$10000Z"), Y = (e) => de(e, { finalNewline: !1 }), J = (e, i) => ({
959
+ const Tt = (e) => e.toISOString().replace(/\.(\d{3})Z$/, ".$10000Z"), Y = (e) => de(e, { finalNewline: !1 }), J = (e, i) => ({
958
960
  icon: { name: e, package: "@nice2dev/icons", style: i }
959
961
  });
960
- function xt(e) {
962
+ function Et(e) {
961
963
  const i = e && /^Ntd[A-Z]/.test(e), t = e && /^[A-Z]\w*Icon$/.test(e);
962
964
  return {
963
965
  module: {
@@ -980,105 +982,105 @@ function xt(e) {
980
982
  workflowStates: {}
981
983
  };
982
984
  }
983
- async function Et(e, i = {}) {
984
- var T, L, I, M;
985
- const t = Tt(e);
985
+ async function xt(e, i = {}) {
986
+ var E, A, x, D;
987
+ const t = jt(e);
986
988
  if (t.length > 0)
987
989
  return { problems: t };
988
- const o = e.name.toLowerCase().startsWith(W.toLowerCase()), n = R(
990
+ const o = e.name.toLowerCase().startsWith(W.toLowerCase()), n = P(
989
991
  o ? e.name.slice(W.length) : e.name
990
992
  ), s = St(
991
993
  W + n,
992
994
  i.existingPackageNames ?? /* @__PURE__ */ new Set()
993
- ), r = s.slice(W.length), l = r.toLowerCase(), y = `${s}.${Ne}`, c = o ? r : e.name.trim(), m = ((T = e.description) == null ? void 0 : T.trim()) || void 0, b = e.entities.map((E) => ({ ...E, name: R(E.name) })), C = e.views !== !1, S = e.permissions !== !1, N = [.../* @__PURE__ */ new Set(["en", "pl", ...e.locales ?? []])], x = e.icon ?? "widgets", d = [], $ = [
995
+ ), r = s.slice(W.length), l = r.toLowerCase(), y = `${s}.${Ne}`, d = o ? r : e.name.trim(), m = ((E = e.description) == null ? void 0 : E.trim()) || void 0, b = e.entities.map((k) => ({ ...k, name: P(k.name) })), C = e.views !== !1, j = e.permissions !== !1, T = [.../* @__PURE__ */ new Set(["en", "pl", ...e.locales ?? []])], I = e.icon ?? "widgets", c = [], v = [
994
996
  `${l}.entities.json`,
995
997
  ...C ? [`${l}.views.json`] : [],
996
- ...S ? [`${l}.permissions.json`] : []
998
+ ...j ? [`${l}.permissions.json`] : []
997
999
  ];
998
- d.push({
1000
+ c.push({
999
1001
  path: `${l}.manifest.json`,
1000
1002
  text: Y({
1001
1003
  packageName: s,
1002
1004
  version: "1.0.0",
1003
- displayName: c,
1004
- description: m ?? c,
1005
+ displayName: d,
1006
+ description: m ?? d,
1005
1007
  author: "OmniVerk Module Builder",
1006
1008
  license: "Proprietary",
1007
- category: ((L = e.category) == null ? void 0 : L.trim()) || "Custom",
1008
- icon: x,
1009
- exportedAt: jt((i.now ?? (() => /* @__PURE__ */ new Date()))()),
1009
+ category: ((A = e.category) == null ? void 0 : A.trim()) || "Custom",
1010
+ icon: I,
1011
+ exportedAt: Tt((i.now ?? (() => /* @__PURE__ */ new Date()))()),
1010
1012
  modules: [
1011
1013
  {
1012
1014
  name: Ne,
1013
- displayName: c,
1014
- description: e.description ?? c,
1015
- icon: x,
1016
- parts: $
1015
+ displayName: d,
1016
+ description: e.description ?? d,
1017
+ icon: I,
1018
+ parts: v
1017
1019
  }
1018
1020
  ],
1019
1021
  dependencies: ["Core.Users"],
1020
- i18n: N.map((E) => `${l}.${E}.i18n.json`),
1022
+ i18n: T.map((k) => `${l}.${k}.i18n.json`),
1021
1023
  ...e.ownerTenantId ? { ownerTenantId: e.ownerTenantId } : {},
1022
1024
  ...e.sourceDefinitionId ? { sourceDefinitionId: e.sourceDefinitionId } : {}
1023
1025
  })
1024
1026
  });
1025
- const u = [];
1026
- for (const E of b) {
1027
- const j = [{ name: "Id", displayName: "ID", dataType: "Guid", isPrimaryKey: !0 }];
1028
- for (const v of E.fields.filter((O) => !ne(O))) {
1029
- const O = se(v), a = {
1030
- name: R(v.name),
1031
- displayName: q(v),
1027
+ const f = [];
1028
+ for (const k of b) {
1029
+ const S = [{ name: "Id", displayName: "ID", dataType: "Guid", isPrimaryKey: !0 }];
1030
+ for (const $ of k.fields.filter((O) => !ne(O))) {
1031
+ const O = se($), a = {
1032
+ name: P($.name),
1033
+ displayName: q($),
1032
1034
  dataType: O
1033
1035
  };
1034
- O === "string" && (a.maxLength = v.maxLength && v.maxLength > 0 ? v.maxLength : 200), v.isRequired && (a.isRequired = !0), v.isUnique && (a.isUnique = !0), (v.isIndexed || v.isForeignKey) && (a.isIndexed = !0), v.isForeignKey && (a.isForeignKey = !0, v.referencedEntity && (a.referencedEntity = R(v.referencedEntity))), (I = v.defaultValue) != null && I.trim() && (a.defaultValue = v.defaultValue), (M = v.description) != null && M.trim() && (a.description = v.description), j.push(a);
1036
+ O === "string" && (a.maxLength = $.maxLength && $.maxLength > 0 ? $.maxLength : 200), $.isRequired && (a.isRequired = !0), $.isUnique && (a.isUnique = !0), ($.isIndexed || $.isForeignKey) && (a.isIndexed = !0), $.isForeignKey && (a.isForeignKey = !0, $.referencedEntity && (a.referencedEntity = P($.referencedEntity))), (x = $.defaultValue) != null && x.trim() && (a.defaultValue = $.defaultValue), (D = $.description) != null && D.trim() && (a.description = $.description), S.push(a);
1035
1037
  }
1036
- u.push({
1037
- id: await qe(s, E.name),
1038
- name: E.name,
1039
- displayName: q(E),
1040
- tableName: await Ve(l, E.name),
1041
- description: E.description ?? q(E),
1042
- entityIcon: E.icon ?? "table_rows",
1038
+ f.push({
1039
+ id: await qe(s, k.name),
1040
+ name: k.name,
1041
+ displayName: q(k),
1042
+ tableName: await Ve(l, k.name),
1043
+ description: k.description ?? q(k),
1044
+ entityIcon: k.icon ?? "table_rows",
1043
1045
  isAudited: !0,
1044
1046
  isSoftDeleteEnabled: !1,
1045
- fields: j
1047
+ fields: S
1046
1048
  });
1047
1049
  }
1048
- if (d.push({
1050
+ if (c.push({
1049
1051
  path: `${l}.entities.json`,
1050
- text: Y({ moduleName: y, version: "1.0.0", entities: u })
1052
+ text: Y({ moduleName: y, version: "1.0.0", entities: f })
1051
1053
  }), C) {
1052
- const E = (v) => {
1053
- const O = b.find((p) => p.name === R(v)), a = O == null ? void 0 : O.fields.find(
1054
+ const k = ($) => {
1055
+ const O = b.find((p) => p.name === P($)), a = O == null ? void 0 : O.fields.find(
1054
1056
  (p) => !ne(p) && !p.isForeignKey && se(p) === "string"
1055
1057
  );
1056
- return a ? R(a.name) : "Name";
1057
- }, j = [];
1058
- for (const v of b) {
1059
- const O = v.fields.filter((f) => !ne(f)), a = O.filter((f) => !["text", "json"].includes(se(f))).slice(0, 6), p = (a.length ? a : [O[0]]).map((f) => ({
1060
- field: R(f.name),
1061
- displayName: q(f),
1058
+ return a ? P(a.name) : "Name";
1059
+ }, S = [];
1060
+ for (const $ of b) {
1061
+ const O = $.fields.filter((u) => !ne(u)), a = O.filter((u) => !["text", "json"].includes(se(u))).slice(0, 6), p = (a.length ? a : [O[0]]).map((u) => ({
1062
+ field: P(u.name),
1063
+ displayName: q(u),
1062
1064
  sortable: !0,
1063
- type: pe(f)[0],
1064
- ...f.isForeignKey && f.referencedEntity ? { referencedEntity: R(f.referencedEntity) } : {}
1065
- })), g = O.filter((f) => ["string", "text"].includes(se(f))).map((f) => R(f.name)), h = O.map((f) => ({
1066
- field: R(f.name),
1067
- type: Nt[pe(f)[1]] ?? "TextInput",
1068
- label: q(f),
1069
- ...f.isRequired ? { required: !0 } : {},
1070
- ...f.isForeignKey && f.referencedEntity ? {
1071
- entity: R(f.referencedEntity),
1072
- displayField: E(f.referencedEntity)
1065
+ type: pe(u)[0],
1066
+ ...u.isForeignKey && u.referencedEntity ? { referencedEntity: P(u.referencedEntity) } : {}
1067
+ })), g = O.filter((u) => ["string", "text"].includes(se(u))).map((u) => P(u.name)), h = O.map((u) => ({
1068
+ field: P(u.name),
1069
+ type: Nt[pe(u)[1]] ?? "TextInput",
1070
+ label: q(u),
1071
+ ...u.isRequired ? { required: !0 } : {},
1072
+ ...u.isForeignKey && u.referencedEntity ? {
1073
+ entity: P(u.referencedEntity),
1074
+ displayField: k(u.referencedEntity)
1073
1075
  } : {}
1074
1076
  }));
1075
- j.push({
1076
- id: `vw-${l}-${he(v.name)}-list`,
1077
- name: `${v.name}List`,
1078
- displayName: q(v),
1077
+ S.push({
1078
+ id: `vw-${l}-${he($.name)}-list`,
1079
+ name: `${$.name}List`,
1080
+ displayName: q($),
1079
1081
  type: "List",
1080
1082
  icon: "list",
1081
- entityName: v.name,
1083
+ entityName: $.name,
1082
1084
  columns: p,
1083
1085
  searchFields: g,
1084
1086
  pageSize: 25,
@@ -1086,85 +1088,85 @@ async function Et(e, i = {}) {
1086
1088
  allowEdit: !0,
1087
1089
  allowDelete: !0
1088
1090
  });
1089
- const k = O.map((f) => {
1090
- const w = pe(f)[1];
1091
+ const N = O.map((u) => {
1092
+ const w = pe(u)[1];
1091
1093
  return {
1092
- field: R(f.name),
1094
+ field: P(u.name),
1093
1095
  type: w,
1094
- label: q(f),
1096
+ label: q(u),
1095
1097
  colSpan: w === "textarea" ? 12 : 6,
1096
- ...f.isRequired ? { required: !0 } : {},
1097
- ...f.isForeignKey && f.referencedEntity ? { entity: R(f.referencedEntity) } : {}
1098
+ ...u.isRequired ? { required: !0 } : {},
1099
+ ...u.isForeignKey && u.referencedEntity ? { entity: P(u.referencedEntity) } : {}
1098
1100
  };
1099
1101
  });
1100
- j.push({
1101
- id: `vw-${l}-${he(v.name)}-form`,
1102
- name: `${v.name}Form`,
1103
- displayName: q(v),
1102
+ S.push({
1103
+ id: `vw-${l}-${he($.name)}-form`,
1104
+ name: `${$.name}Form`,
1105
+ displayName: q($),
1104
1106
  type: "Form",
1105
1107
  icon: "edit",
1106
- entityName: v.name,
1108
+ entityName: $.name,
1107
1109
  tabs: [
1108
1110
  {
1109
1111
  name: "Main",
1110
- displayName: q(v),
1111
- sections: [{ name: "Details", displayName: "Details", controls: k }]
1112
+ displayName: q($),
1113
+ sections: [{ name: "Details", displayName: "Details", controls: N }]
1112
1114
  }
1113
1115
  ]
1114
1116
  });
1115
1117
  }
1116
- d.push({
1118
+ c.push({
1117
1119
  path: `${l}.views.json`,
1118
- text: Y({ moduleName: y, version: "1.0.0", views: j })
1120
+ text: Y({ moduleName: y, version: "1.0.0", views: S })
1119
1121
  });
1120
1122
  }
1121
- if (S) {
1122
- const E = (O) => `${r}.${O}`, j = (O, a) => ({
1123
- code: E(O),
1124
- name: `${c} — ${a}`,
1125
- description: `${a}: ${c}`
1126
- }), v = (O, a, ...p) => ({
1123
+ if (j) {
1124
+ const k = (O) => `${r}.${O}`, S = (O, a) => ({
1125
+ code: k(O),
1126
+ name: `${d} — ${a}`,
1127
+ description: `${a}: ${d}`
1128
+ }), $ = (O, a, ...p) => ({
1127
1129
  name: `${W}${r} ${O}`,
1128
- description: `${c} — ${a}`,
1129
- permissions: p.map(E)
1130
+ description: `${d} — ${a}`,
1131
+ permissions: p.map(k)
1130
1132
  });
1131
- d.push({
1133
+ c.push({
1132
1134
  path: `${l}.permissions.json`,
1133
1135
  text: Y({
1134
1136
  moduleName: y,
1135
1137
  version: "1.0.0",
1136
1138
  permissions: [
1137
- j("Read", "view records"),
1138
- j("Create", "add records"),
1139
- j("Edit", "edit records"),
1140
- j("Delete", "delete records"),
1141
- j("Admin", "administer the module")
1139
+ S("Read", "view records"),
1140
+ S("Create", "add records"),
1141
+ S("Edit", "edit records"),
1142
+ S("Delete", "delete records"),
1143
+ S("Admin", "administer the module")
1142
1144
  ],
1143
1145
  permissionGroups: [
1144
- v("Viewer", "read only", "Read"),
1145
- v("Editor", "read and edit", "Read", "Create", "Edit"),
1146
- v("Admin", "full access", "Read", "Create", "Edit", "Delete", "Admin")
1146
+ $("Viewer", "read only", "Read"),
1147
+ $("Editor", "read and edit", "Read", "Create", "Edit"),
1148
+ $("Admin", "full access", "Read", "Create", "Edit", "Delete", "Admin")
1147
1149
  ]
1148
1150
  })
1149
1151
  });
1150
1152
  }
1151
- for (const E of N) {
1152
- const j = {
1153
- "module.displayName": c,
1154
- "module.description": m ?? c
1153
+ for (const k of T) {
1154
+ const S = {
1155
+ "module.displayName": d,
1156
+ "module.description": m ?? d
1155
1157
  };
1156
- for (const v of b) {
1157
- j[`entity.${v.name}.displayName`] = q(v);
1158
- for (const O of v.fields.filter((a) => !ne(a)))
1159
- j[`field.${v.name}.${R(O.name)}.displayName`] = q(O);
1160
- C && (j[`view.${v.name}List.displayName`] = q(v), j[`view.${v.name}Form.displayName`] = q(v), j[`view.${v.name}Form.tab.Main`] = q(v), j[`view.${v.name}Form.section.Details`] = E === "pl" ? "Szczegóły" : "Details");
1158
+ for (const $ of b) {
1159
+ S[`entity.${$.name}.displayName`] = q($);
1160
+ for (const O of $.fields.filter((a) => !ne(a)))
1161
+ S[`field.${$.name}.${P(O.name)}.displayName`] = q(O);
1162
+ C && (S[`view.${$.name}List.displayName`] = q($), S[`view.${$.name}Form.displayName`] = q($), S[`view.${$.name}Form.tab.Main`] = q($), S[`view.${$.name}Form.section.Details`] = k === "pl" ? "Szczegóły" : "Details");
1161
1163
  }
1162
- d.push({
1163
- path: `${l}.${E}.i18n.json`,
1164
- text: Y({ moduleName: s, locale: E, version: "1.0.0", translations: j })
1164
+ c.push({
1165
+ path: `${l}.${k}.i18n.json`,
1166
+ text: Y({ moduleName: s, locale: k, version: "1.0.0", translations: S })
1165
1167
  });
1166
1168
  }
1167
- return e.iconConfig !== !1 && d.push({ path: `${l}.iconconfig.json`, text: Y(xt(e.icon)) }), { package: { packageName: s, folder: `Custom/${r}`, files: d }, problems: [] };
1169
+ return e.iconConfig !== !1 && c.push({ path: `${l}.iconconfig.json`, text: Y(Et(e.icon)) }), { package: { packageName: s, folder: `Custom/${r}`, files: c }, problems: [] };
1168
1170
  }
1169
1171
  function It(e) {
1170
1172
  const i = (t) => typeof t == "string" && t ? t : void 0;
@@ -1204,80 +1206,80 @@ function we(e, i) {
1204
1206
  const Ct = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
1205
1207
  async function Ot(e, i) {
1206
1208
  const t = e.find(
1207
- (d) => !d.path.includes("/") && d.path.toLowerCase().endsWith(".manifest.json")
1209
+ (c) => !c.path.includes("/") && c.path.toLowerCase().endsWith(".manifest.json")
1208
1210
  );
1209
1211
  if (!t)
1210
1212
  throw new Error("The module has no manifest.");
1211
- const o = _(t.text).value, n = String(o.packageName ?? ""), s = t.path.slice(0, -14), r = i.id, l = kt(r), y = (d) => d.startsWith(W) ? d.slice(W.length) : d.split(".").pop() ?? d, c = y(n), m = y(r), b = (d) => d.startsWith(`${s}.`) ? `${l}${d.slice(s.length)}` : d, C = new Map(e.map((d) => [d.path, b(d.path)])), S = /* @__PURE__ */ new Map();
1212
- for (const d of e.filter(($) => $.path.toLowerCase().endsWith(".permissions.json")))
1213
+ const o = _(t.text).value, n = String(o.packageName ?? ""), s = t.path.slice(0, -14), r = i.id, l = kt(r), y = (c) => c.startsWith(W) ? c.slice(W.length) : c.split(".").pop() ?? c, d = y(n), m = y(r), b = (c) => c.startsWith(`${s}.`) ? `${l}${c.slice(s.length)}` : c, C = new Map(e.map((c) => [c.path, b(c.path)])), j = /* @__PURE__ */ new Map();
1214
+ for (const c of e.filter((v) => v.path.toLowerCase().endsWith(".permissions.json")))
1213
1215
  try {
1214
- const $ = _(d.text).value;
1215
- for (const u of H($) && Array.isArray($.permissions) ? $.permissions : []) {
1216
- const T = typeof u.code == "string" ? u.code : "";
1217
- T.startsWith(`${c}.`) && S.set(T, `${m}${T.slice(c.length)}`);
1216
+ const v = _(c.text).value;
1217
+ for (const f of H(v) && Array.isArray(v.permissions) ? v.permissions : []) {
1218
+ const E = typeof f.code == "string" ? f.code : "";
1219
+ E.startsWith(`${d}.`) && j.set(E, `${m}${E.slice(d.length)}`);
1218
1220
  }
1219
1221
  } catch {
1220
1222
  }
1221
- const N = (d) => n && (d === n || d.startsWith(`${n}.`) || d.startsWith(`${n} `)) ? r + d.slice(n.length) : S.get(d) ?? C.get(d) ?? d, x = [];
1222
- for (const d of e) {
1223
- if (d.path.startsWith(".revisions/"))
1223
+ const T = (c) => n && (c === n || c.startsWith(`${n}.`) || c.startsWith(`${n} `)) ? r + c.slice(n.length) : j.get(c) ?? C.get(c) ?? c, I = [];
1224
+ for (const c of e) {
1225
+ if (c.path.startsWith(".revisions/"))
1224
1226
  continue;
1225
- const $ = b(d.path);
1226
- if (!d.path.toLowerCase().endsWith(".json")) {
1227
- x.push({ path: $, text: d.text });
1227
+ const v = b(c.path);
1228
+ if (!c.path.toLowerCase().endsWith(".json")) {
1229
+ I.push({ path: v, text: c.text });
1228
1230
  continue;
1229
1231
  }
1230
- let u;
1232
+ let f;
1231
1233
  try {
1232
- u = _(d.text).value;
1234
+ f = _(c.text).value;
1233
1235
  } catch {
1234
- x.push({ path: $, text: d.text });
1236
+ I.push({ path: v, text: c.text });
1235
1237
  continue;
1236
1238
  }
1237
- let T = we(u, N);
1238
- if (d === t && H(T)) {
1239
- const { sourceDefinitionId: L, ...I } = T;
1240
- T = {
1241
- ...I,
1239
+ let E = we(f, T);
1240
+ if (c === t && H(E)) {
1241
+ const { sourceDefinitionId: A, ...x } = E;
1242
+ E = {
1243
+ ...x,
1242
1244
  packageName: r,
1243
1245
  ...i.name ? { displayName: i.name } : {},
1244
1246
  ...i.packageId ? { category: i.packageId } : {}
1245
1247
  };
1246
1248
  }
1247
- if (d.path.toLowerCase().endsWith(".entities.json") && H(T) && Array.isArray(T.entities)) {
1248
- const L = [];
1249
- for (const I of T.entities) {
1250
- if (!H(I) || typeof I.name != "string") {
1251
- L.push(I);
1249
+ if (c.path.toLowerCase().endsWith(".entities.json") && H(E) && Array.isArray(E.entities)) {
1250
+ const A = [];
1251
+ for (const x of E.entities) {
1252
+ if (!H(x) || typeof x.name != "string") {
1253
+ A.push(x);
1252
1254
  continue;
1253
1255
  }
1254
- L.push({
1255
- ...I,
1256
- ...typeof I.id == "string" && Ct.test(I.id) ? { id: await qe(r, I.name) } : {},
1257
- ...typeof I.tableName == "string" ? { tableName: await Ve(l, I.name) } : {}
1256
+ A.push({
1257
+ ...x,
1258
+ ...typeof x.id == "string" && Ct.test(x.id) ? { id: await qe(r, x.name) } : {},
1259
+ ...typeof x.tableName == "string" ? { tableName: await Ve(l, x.name) } : {}
1258
1260
  });
1259
1261
  }
1260
- T = { ...T, entities: L };
1262
+ E = { ...E, entities: A };
1261
1263
  }
1262
- i.name && /\.en\.i18n\.json$/i.test(d.path) && H(T) && H(T.translations) && typeof T.translations["module.displayName"] == "string" && (T = {
1263
- ...T,
1264
- translations: { ...T.translations, "module.displayName": i.name }
1265
- }), x.push({ path: $, text: De(d.text, T) });
1264
+ i.name && /\.en\.i18n\.json$/i.test(c.path) && H(E) && H(E.translations) && typeof E.translations["module.displayName"] == "string" && (E = {
1265
+ ...E,
1266
+ translations: { ...E.translations, "module.displayName": i.name }
1267
+ }), I.push({ path: v, text: Me(c.text, E) });
1266
1268
  }
1267
1269
  return {
1268
1270
  id: r,
1269
1271
  packageId: i.packageId ?? o.category,
1270
- files: x
1272
+ files: I
1271
1273
  };
1272
1274
  }
1273
- const F = (e) => typeof e == "object" && e !== null && !Array.isArray(e), Q = (e, i) => F(e) && Array.isArray(e[i]) ? e[i] : [], oe = (e, i) => e.toLowerCase().endsWith(i), ve = (e) => !e.includes("/"), At = /[ąćęłńóśźżĄĆĘŁŃÓŚŹŻ]/, Lt = [
1275
+ const K = (e) => typeof e == "object" && e !== null && !Array.isArray(e), Q = (e, i) => K(e) && Array.isArray(e[i]) ? e[i] : [], oe = (e, i) => e.toLowerCase().endsWith(i), ve = (e) => !e.includes("/"), At = /[ąćęłńóśźżĄĆĘŁŃÓŚŹŻ]/, Lt = [
1274
1276
  "ING Bank Śląski",
1275
1277
  "Bank Śląski",
1276
1278
  "BOŚ",
1277
1279
  "e-Zamówienia",
1278
1280
  "eZamówienia",
1279
1281
  "Plataforma de Contratación del Sector Público"
1280
- ], ae = (e) => At.test(Lt.reduce((i, t) => i.split(t).join(""), e)), Dt = /* @__PURE__ */ new Set([
1282
+ ], ae = (e) => At.test(Lt.reduce((i, t) => i.split(t).join(""), e)), Mt = /* @__PURE__ */ new Set([
1281
1283
  "module",
1282
1284
  "entity",
1283
1285
  "field",
@@ -1286,8 +1288,8 @@ const F = (e) => typeof e == "object" && e !== null && !Array.isArray(e), Q = (e
1286
1288
  "nav",
1287
1289
  "action",
1288
1290
  "tutorial"
1289
- ]), Mt = /* @__PURE__ */ new Set(["int", "int32", "int64", "long", "integer"]);
1290
- function Ft(e) {
1291
+ ]), Dt = /* @__PURE__ */ new Set(["int", "int32", "int64", "long", "integer"]);
1292
+ function Kt(e) {
1291
1293
  for (let i = 0; i < e.length; i++) {
1292
1294
  const t = e.charCodeAt(i);
1293
1295
  if (t >= 55296 && t <= 56319 || t >= 9728 && t <= 10175)
@@ -1295,13 +1297,13 @@ function Ft(e) {
1295
1297
  }
1296
1298
  return !1;
1297
1299
  }
1298
- function je(e) {
1299
- if (!F(e))
1300
+ function Te(e) {
1301
+ if (!K(e))
1300
1302
  return [];
1301
- const i = F(e.translations) ? e.translations : F(e.keys) ? e.keys : void 0;
1303
+ const i = K(e.translations) ? e.translations : K(e.keys) ? e.keys : void 0;
1302
1304
  return i ? Object.entries(i) : [];
1303
1305
  }
1304
- const xe = /^(.*)\.([a-z]{2,3}(?:-[A-Za-z]{2,4})?)\.i18n\.json$/i, Pt = /* @__PURE__ */ new Set([
1306
+ const Ee = /^(.*)\.([a-z]{2,3}(?:-[A-Za-z]{2,4})?)\.i18n\.json$/i, Ft = /* @__PURE__ */ new Set([
1305
1307
  "hotel.views.json",
1306
1308
  "restaurant.views.json",
1307
1309
  "backup-dr.views.json",
@@ -1310,255 +1312,306 @@ const xe = /^(.*)\.([a-z]{2,3}(?:-[A-Za-z]{2,4})?)\.i18n\.json$/i, Pt = /* @__PU
1310
1312
  "shelf_management.views.json",
1311
1313
  "psa.views.json"
1312
1314
  ]);
1313
- function Rt(e, i = {}) {
1315
+ function Pt(e, i = {}) {
1314
1316
  const t = new Set(
1315
- [...i.legacyListViewFiles ?? Pt].map(
1316
- (d) => d.toLowerCase()
1317
+ [...i.legacyListViewFiles ?? Ft].map(
1318
+ (c) => c.toLowerCase()
1317
1319
  )
1318
- ), o = [], n = (d) => {
1319
- o.push({ severity: "error", ...d });
1320
+ ), o = [], n = (c) => {
1321
+ o.push({ severity: "error", ...c });
1320
1322
  }, s = [];
1321
- for (const d of e.files)
1322
- if (!(!oe(d.path, ".json") || d.path.startsWith(".revisions/")))
1323
+ for (const c of e.files)
1324
+ if (!(!oe(c.path, ".json") || c.path.startsWith(".revisions/")))
1323
1325
  try {
1324
- s.push({ file: d, value: _(d.text).value });
1325
- } catch ($) {
1326
+ s.push({ file: c, value: _(c.text).value });
1327
+ } catch (v) {
1326
1328
  n({
1327
1329
  code: "json.invalid",
1328
- message: `${d.path} is not valid JSON: ${$ instanceof Error ? $.message : String($)}`,
1329
- path: d.path
1330
+ message: `${c.path} is not valid JSON: ${v instanceof Error ? v.message : String(v)}`,
1331
+ messageKey: "devStudio.issue.jsonInvalid",
1332
+ params: { path: c.path, error: v instanceof Error ? v.message : String(v) },
1333
+ path: c.path
1330
1334
  });
1331
1335
  }
1332
- const r = (d) => s.filter(($) => ve($.file.path) && oe($.file.path, d)), l = r(".manifest.json");
1336
+ const r = (c) => s.filter((v) => ve(v.file.path) && oe(v.file.path, c)), l = r(".manifest.json");
1333
1337
  l.length === 0 && n({
1334
1338
  code: "manifest.missing",
1335
1339
  message: "The module has no *.manifest.json.",
1336
1340
  messageKey: "devStudio.issue.manifestMissing"
1337
1341
  });
1338
- for (const { file: d, value: $ } of l)
1339
- for (const u of ["packageName", "version", "category"])
1340
- (!F($) || !(u in $)) && n({
1342
+ for (const { file: c, value: v } of l)
1343
+ for (const f of ["packageName", "version", "category"])
1344
+ (!K(v) || !(f in v)) && n({
1341
1345
  code: "manifest.required",
1342
- message: `The manifest needs "${u}".`,
1346
+ message: `The manifest needs "${f}".`,
1343
1347
  messageKey: "devStudio.issue.manifestRequired",
1344
- params: { field: u },
1345
- path: d.path,
1346
- pointer: `/${u}`
1348
+ params: { field: f },
1349
+ path: c.path,
1350
+ pointer: `/${f}`
1347
1351
  });
1348
1352
  const y = r(".iconconfig.json");
1349
- y.length === 0 && n({
1353
+ y.length === 0 && e.contents !== "manifest" && n({
1350
1354
  severity: "info",
1351
1355
  code: "iconconfig.missing",
1352
- message: "The module has no *.iconconfig.json: its menu shows a default icon (the CI wants one in every Category/Module folder)."
1356
+ message: "The module has no *.iconconfig.json: its menu shows a default icon (the CI wants one in every Category/Module folder).",
1357
+ messageKey: "devStudio.issue.iconconfigMissing"
1353
1358
  });
1354
- for (const { file: d, value: $ } of y) {
1355
- const u = F($) ? $.module : void 0, T = F(u) ? u.icon : void 0, L = [
1356
- ...F(u) ? [] : ["module"],
1357
- ...F(u) && !F(T) ? ["module.icon"] : [],
1358
- ...F(T) && !("name" in T) ? ["module.icon.name"] : [],
1359
- ...F(T) && !("package" in T) ? ["module.icon.package"] : [],
1359
+ for (const { file: c, value: v } of y) {
1360
+ const f = K(v) ? v.module : void 0, E = K(f) ? f.icon : void 0, A = [
1361
+ ...K(f) ? [] : ["module"],
1362
+ ...K(f) && !K(E) ? ["module.icon"] : [],
1363
+ ...K(E) && !("name" in E) ? ["module.icon.name"] : [],
1364
+ ...K(E) && !("package" in E) ? ["module.icon.package"] : [],
1360
1365
  ...["views", "permissions", "workflowStates"].filter(
1361
- (I) => !F($) || !(I in $)
1366
+ (x) => !K(v) || !(x in v)
1362
1367
  )
1363
1368
  ];
1364
- for (const I of L)
1369
+ for (const x of A)
1365
1370
  n({
1366
1371
  code: "iconconfig.structure",
1367
- message: `The icon config needs "${I}".`,
1368
- params: { field: I },
1369
- path: d.path,
1370
- pointer: `/${I.split(".").join("/")}`
1372
+ message: `The icon config needs "${x}".`,
1373
+ messageKey: "devStudio.issue.iconconfigStructure",
1374
+ params: { field: x },
1375
+ path: c.path,
1376
+ pointer: `/${x.split(".").join("/")}`
1371
1377
  });
1372
1378
  }
1373
- const c = [], m = [];
1374
- for (const { file: d, value: $ } of r(".entities.json")) {
1375
- if (!F($) || !("entities" in $))
1379
+ const d = [], m = [];
1380
+ for (const { file: c, value: v } of r(".entities.json")) {
1381
+ if (!K(v) || !("entities" in v))
1376
1382
  continue;
1377
- const u = [], T = $.entities;
1378
- if (!Array.isArray(T) || T.length === 0) {
1383
+ const f = [], E = v.entities;
1384
+ if (!Array.isArray(E) || E.length === 0) {
1379
1385
  n({
1380
1386
  code: "entities.empty",
1381
1387
  message: "The file has no entities.",
1382
- path: d.path,
1388
+ messageKey: "devStudio.issue.entitiesEmpty",
1389
+ path: c.path,
1383
1390
  pointer: "/entities"
1384
1391
  });
1385
1392
  continue;
1386
1393
  }
1387
- T.forEach((L, I) => {
1388
- const M = `/entities/${I}`, E = F(L) && typeof L.name == "string" ? L.name : void 0;
1389
- if (E ? c.push(E) : n({
1394
+ E.forEach((A, x) => {
1395
+ const D = `/entities/${x}`, k = K(A) && typeof A.name == "string" ? A.name : void 0;
1396
+ if (k ? d.push(k) : n({
1390
1397
  code: "entities.name",
1391
- message: `Entity #${I + 1} has no name.`,
1392
- path: d.path,
1393
- pointer: M
1394
- }), !F(L) || !Array.isArray(L.fields)) {
1398
+ message: `Entity #${x + 1} has no name.`,
1399
+ messageKey: "devStudio.issue.entitiesName",
1400
+ params: { n: x + 1 },
1401
+ path: c.path,
1402
+ pointer: D
1403
+ }), !K(A) || !Array.isArray(A.fields)) {
1395
1404
  n({
1396
1405
  code: "entities.fields",
1397
- message: `Entity ${E ?? `#${I + 1}`} has no fields array.`,
1398
- path: d.path,
1399
- pointer: M
1406
+ message: `Entity ${k ?? `#${x + 1}`} has no fields array.`,
1407
+ messageKey: "devStudio.issue.entitiesFields",
1408
+ params: { name: k ?? `#${x + 1}` },
1409
+ path: c.path,
1410
+ pointer: D
1400
1411
  });
1401
1412
  return;
1402
1413
  }
1403
- F(L) && typeof L.displayName == "string" && ae(L.displayName) && n({
1414
+ K(A) && typeof A.displayName == "string" && ae(A.displayName) && n({
1404
1415
  code: "labels.polish",
1405
- message: `Entity ${E}: the display name "${L.displayName}" is Polish — seed labels are English, Polish goes to the .pl bundle.`,
1406
- path: d.path,
1407
- pointer: `${M}/displayName`
1408
- }), L.fields.forEach((j, v) => {
1409
- if (!F(j))
1416
+ message: `Entity ${k}: the display name "${A.displayName}" is Polish — seed labels are English, Polish goes to the .pl bundle.`,
1417
+ messageKey: "devStudio.issue.polishEntity",
1418
+ params: { name: k ?? "", text: A.displayName },
1419
+ path: c.path,
1420
+ pointer: `${D}/displayName`
1421
+ }), A.fields.forEach((S, $) => {
1422
+ if (!K(S))
1410
1423
  return;
1411
- const O = typeof j.name == "string" ? j.name : void 0, a = `${M}/fields/${v}`;
1412
- E && O && j.isPrimaryKey !== !0 && m.push(`field.${E}.${O}`);
1413
- const p = typeof j.dataType == "string" ? j.dataType.replace(/\?+$/, "") : void 0;
1414
- p === void 0 && typeof j.type == "string" && u.push({ name: `${E}.${O}`, pointer: `${a}/type` }), p && Mt.has(p.toLowerCase()) && (O === "Id" || j.isForeignKey === !0) && n({
1424
+ const O = typeof S.name == "string" ? S.name : void 0, a = `${D}/fields/${$}`;
1425
+ k && O && S.isPrimaryKey !== !0 && m.push(`field.${k}.${O}`);
1426
+ const p = typeof S.dataType == "string" ? S.dataType.replace(/\?+$/, "") : void 0;
1427
+ p === void 0 && typeof S.type == "string" && f.push({ name: `${k}.${O}`, pointer: `${a}/type` }), p && Dt.has(p.toLowerCase()) && (O === "Id" || S.isForeignKey === !0) && n({
1415
1428
  code: "entities.keyNotGuid",
1416
- message: `${E}.${O} is ${p}: keys must be Guid (every row's Id is a uuid).`,
1417
- path: d.path,
1429
+ message: `${k}.${O} is ${p}: keys must be Guid (every row's Id is a uuid).`,
1430
+ messageKey: "devStudio.issue.keyNotGuid",
1431
+ params: { name: `${k}.${O}`, type: p },
1432
+ path: c.path,
1418
1433
  pointer: `${a}/dataType`
1419
- }), typeof j.displayName == "string" && ae(j.displayName) && n({
1434
+ }), typeof S.displayName == "string" && ae(S.displayName) && n({
1420
1435
  code: "labels.polish",
1421
- message: `${E}.${O}: the display name "${j.displayName}" is Polish — seed labels are English.`,
1422
- path: d.path,
1436
+ message: `${k}.${O}: the display name "${S.displayName}" is Polish — seed labels are English.`,
1437
+ messageKey: "devStudio.issue.polishField",
1438
+ params: { name: `${k}.${O}`, text: S.displayName },
1439
+ path: c.path,
1423
1440
  pointer: `${a}/displayName`
1424
1441
  });
1425
1442
  });
1426
- }), u.length && n({
1443
+ }), f.length && n({
1427
1444
  severity: "warning",
1428
1445
  code: "entities.typeIgnored",
1429
- message: `${u.length} field(s) give their type as "type", which installing ignores — it reads "dataType": ${u.slice(0, 5).map((L) => L.name).join(", ")}${u.length > 5 ? ", …" : ""}`,
1430
- params: { count: u.length },
1431
- path: d.path,
1432
- pointer: u[0].pointer
1446
+ message: `${f.length} field(s) give their type as "type", which installing ignores — it reads "dataType": ${f.slice(0, 5).map((A) => A.name).join(", ")}${f.length > 5 ? ", …" : ""}`,
1447
+ messageKey: "devStudio.issue.typeIgnored",
1448
+ params: {
1449
+ count: f.length,
1450
+ names: `${f.slice(0, 5).map((A) => A.name).join(", ")}${f.length > 5 ? ", …" : ""}`
1451
+ },
1452
+ path: c.path,
1453
+ pointer: f[0].pointer
1433
1454
  });
1434
1455
  }
1435
- for (const { file: d, value: $ } of r(".permissions.json"))
1436
- (!F($) || !Array.isArray($.permissions) || $.permissions.length === 0) && n({
1456
+ for (const { file: c, value: v } of r(".permissions.json"))
1457
+ (!K(v) || !Array.isArray(v.permissions) || v.permissions.length === 0) && n({
1437
1458
  code: "permissions.empty",
1438
1459
  message: 'The file needs a non-empty "permissions" array.',
1439
- path: d.path,
1460
+ messageKey: "devStudio.issue.permissionsEmpty",
1461
+ path: c.path,
1440
1462
  pointer: "/permissions"
1441
1463
  });
1442
1464
  const b = [];
1443
- for (const { file: d, value: $ } of r(".views.json")) {
1444
- if (!F($) || Object.keys($).length === 0) {
1465
+ for (const { file: c, value: v } of r(".views.json")) {
1466
+ if (!K(v) || Object.keys(v).length === 0) {
1445
1467
  n({
1446
1468
  code: "views.empty",
1447
1469
  message: "A views file is a JSON object with at least one property.",
1448
- path: d.path
1470
+ messageKey: "devStudio.issue.viewsEmpty",
1471
+ path: c.path
1449
1472
  });
1450
1473
  continue;
1451
1474
  }
1452
- Q($, "views").forEach((u, T) => {
1453
- if (!F(u))
1475
+ Q(v, "views").forEach((f, E) => {
1476
+ if (!K(f))
1454
1477
  return;
1455
- const L = `/views/${T}`, I = typeof u.name == "string" ? u.name : "(unnamed)";
1456
- typeof u.name == "string" && b.push(u.name), typeof u.type == "string" && u.type.toLowerCase() === "list" && !t.has(d.path.toLowerCase()) && (typeof u.entityName != "string" || !u.entityName.trim() ? n({
1478
+ const A = `/views/${E}`, x = typeof f.name == "string" ? f.name : "(unnamed)";
1479
+ typeof f.name == "string" && b.push(f.name), typeof f.type == "string" && f.type.toLowerCase() === "list" && !t.has(c.path.toLowerCase()) && (typeof f.entityName != "string" || !f.entityName.trim() ? n({
1457
1480
  code: "views.listEntity",
1458
- message: `List view ${I} needs a top-level "entityName".`,
1459
- path: d.path,
1460
- pointer: L
1461
- }) : (!Array.isArray(u.columns) || u.columns.length === 0) && n({
1481
+ message: `List view ${x} needs a top-level "entityName".`,
1482
+ messageKey: "devStudio.issue.listEntity",
1483
+ params: { name: x },
1484
+ path: c.path,
1485
+ pointer: A
1486
+ }) : (!Array.isArray(f.columns) || f.columns.length === 0) && n({
1462
1487
  code: "views.listColumns",
1463
- message: `List view ${I} needs non-empty top-level "columns".`,
1464
- path: d.path,
1465
- pointer: L
1488
+ message: `List view ${x} needs non-empty top-level "columns".`,
1489
+ messageKey: "devStudio.issue.listColumns",
1490
+ params: { name: x },
1491
+ path: c.path,
1492
+ pointer: A
1466
1493
  }));
1467
- const M = [[u, "displayName", L]];
1468
- Q(u, "columns").forEach((E, j) => {
1469
- for (const v of ["header", "displayName", "label"])
1470
- M.push([E, v, `${L}/columns/${j}`]);
1471
- }), Q(u, "tabs").forEach((E, j) => {
1472
- M.push([E, "displayName", `${L}/tabs/${j}`]), Q(E, "sections").forEach((v, O) => {
1473
- M.push([v, "displayName", `${L}/tabs/${j}/sections/${O}`]), Q(v, "controls").forEach(
1474
- (a, p) => M.push([a, "label", `${L}/tabs/${j}/sections/${O}/controls/${p}`])
1494
+ const D = [[f, "displayName", A]];
1495
+ Q(f, "columns").forEach((k, S) => {
1496
+ for (const $ of ["header", "displayName", "label"])
1497
+ D.push([k, $, `${A}/columns/${S}`]);
1498
+ }), Q(f, "tabs").forEach((k, S) => {
1499
+ D.push([k, "displayName", `${A}/tabs/${S}`]), Q(k, "sections").forEach(($, O) => {
1500
+ D.push([$, "displayName", `${A}/tabs/${S}/sections/${O}`]), Q($, "controls").forEach(
1501
+ (a, p) => D.push([a, "label", `${A}/tabs/${S}/sections/${O}/controls/${p}`])
1475
1502
  );
1476
1503
  });
1477
1504
  });
1478
- for (const [E, j, v] of M) {
1479
- const O = F(E) ? E[j] : void 0;
1505
+ for (const [k, S, $] of D) {
1506
+ const O = K(k) ? k[S] : void 0;
1480
1507
  typeof O == "string" && ae(O) && n({
1481
1508
  code: "labels.polish",
1482
- message: `View ${I}: "${O}" is Polish — seed labels are English.`,
1483
- path: d.path,
1484
- pointer: `${v}/${j}`
1509
+ message: `View ${x}: "${O}" is Polish — seed labels are English.`,
1510
+ messageKey: "devStudio.issue.polishView",
1511
+ params: { name: x, text: O },
1512
+ path: c.path,
1513
+ pointer: `${$}/${S}`
1485
1514
  });
1486
1515
  }
1487
1516
  });
1488
1517
  }
1489
- const C = s.filter((d) => ve(d.file.path) && xe.test(d.file.path)), S = /* @__PURE__ */ new Map();
1490
- for (const d of C) {
1491
- const [, $, u] = xe.exec(d.file.path), T = S.get($) ?? /* @__PURE__ */ new Map();
1492
- T.set(u.toLowerCase(), d), S.set($, T);
1518
+ const C = s.filter((c) => ve(c.file.path) && Ee.test(c.file.path)), j = /* @__PURE__ */ new Map();
1519
+ for (const c of C) {
1520
+ const [, v, f] = Ee.exec(c.file.path), E = j.get(v) ?? /* @__PURE__ */ new Map();
1521
+ E.set(f.toLowerCase(), c), j.set(v, E);
1493
1522
  }
1494
- const N = new Set(
1495
- [...S.keys()].map((d) => d.split(".")[0]).filter((d) => !Dt.has(d))
1496
- ), x = /* @__PURE__ */ new Set();
1497
- for (const [d, $] of S) {
1498
- const u = $.get("en"), T = $.get("pl"), L = (I) => new Set(je(I == null ? void 0 : I.value).map(([M]) => M));
1499
- if (u && !T && n({
1523
+ const T = new Set(
1524
+ [...j.keys()].map((c) => c.split(".")[0]).filter((c) => !Mt.has(c))
1525
+ ), I = /* @__PURE__ */ new Set();
1526
+ for (const [c, v] of j) {
1527
+ const f = v.get("en"), E = v.get("pl"), A = (x) => new Set(Te(x == null ? void 0 : x.value).map(([D]) => D));
1528
+ if (f && !E && n({
1500
1529
  code: "i18n.polishMissing",
1501
- message: `${d}.en.i18n.json needs a .pl.i18n.json sibling (English and Polish are mandatory).`,
1502
- path: u.file.path
1503
- }), T && !u && n({
1530
+ message: `${c}.en.i18n.json needs a .pl.i18n.json sibling (English and Polish are mandatory).`,
1531
+ messageKey: "devStudio.issue.polishBundleMissing",
1532
+ params: { group: c },
1533
+ path: f.file.path
1534
+ }), E && !f && n({
1504
1535
  code: "i18n.englishMissing",
1505
- message: `${d}.pl.i18n.json needs an .en.i18n.json baseline.`,
1506
- path: T.file.path
1507
- }), u && T) {
1508
- const I = L(u), M = L(T), E = [...I].filter((v) => !M.has(v)), j = [...M].filter((v) => !I.has(v));
1509
- E.length && n({
1536
+ message: `${c}.pl.i18n.json needs an .en.i18n.json baseline.`,
1537
+ messageKey: "devStudio.issue.englishBundleMissing",
1538
+ params: { group: c },
1539
+ path: E.file.path
1540
+ }), f && E) {
1541
+ const x = A(f), D = A(E), k = [...x].filter(($) => !D.has($)), S = [...D].filter(($) => !x.has($));
1542
+ k.length && n({
1510
1543
  code: "i18n.keyMissing",
1511
- message: `${T.file.path} is missing ${E.length} key(s) of English: ${E.slice(0, 10).join(", ")}`,
1512
- path: T.file.path
1513
- }), j.length && n({
1544
+ message: `${E.file.path} is missing ${k.length} key(s) of English: ${k.slice(0, 10).join(", ")}`,
1545
+ messageKey: "devStudio.issue.keysMissingPl",
1546
+ params: {
1547
+ path: E.file.path,
1548
+ count: k.length,
1549
+ keys: k.slice(0, 10).join(", ")
1550
+ },
1551
+ path: E.file.path
1552
+ }), S.length && n({
1514
1553
  code: "i18n.keyMissing",
1515
- message: `${u.file.path} is missing ${j.length} key(s) of Polish: ${j.slice(0, 10).join(", ")}`,
1516
- path: u.file.path
1554
+ message: `${f.file.path} is missing ${S.length} key(s) of Polish: ${S.slice(0, 10).join(", ")}`,
1555
+ messageKey: "devStudio.issue.keysMissingEn",
1556
+ params: {
1557
+ path: f.file.path,
1558
+ count: S.length,
1559
+ keys: S.slice(0, 10).join(", ")
1560
+ },
1561
+ path: f.file.path
1517
1562
  });
1518
1563
  }
1519
- for (const [I, M] of $) {
1520
- const E = je(M.value), j = E.filter(([v]) => N.has(v.split(".")[0])).map(([v]) => v);
1521
- if (j.length && n({
1564
+ for (const [x, D] of v) {
1565
+ const k = Te(D.value), S = k.filter(([$]) => T.has($.split(".")[0])).map(([$]) => $);
1566
+ if (S.length && n({
1522
1567
  severity: "warning",
1523
1568
  code: "i18n.fileKey",
1524
- message: `${M.file.path}: nothing reads keys named after the bundle file — use module./entity./field./view. keys (${j.slice(0, 5).join(", ")}).`,
1525
- path: M.file.path
1526
- }), I === "en")
1527
- for (const [v, O] of E) {
1528
- x.add(v);
1529
- const a = v.split(".")[0];
1569
+ message: `${D.file.path}: nothing reads keys named after the bundle file — use module./entity./field./view. keys (${S.slice(0, 5).join(", ")}).`,
1570
+ messageKey: "devStudio.issue.fileKey",
1571
+ params: { path: D.file.path, keys: S.slice(0, 5).join(", ") },
1572
+ path: D.file.path
1573
+ }), x === "en")
1574
+ for (const [$, O] of k) {
1575
+ I.add($);
1576
+ const a = $.split(".")[0];
1530
1577
  ["module", "entity", "field", "view"].includes(a) && typeof O == "string" && ae(O) && n({
1531
1578
  code: "i18n.polishInEnglish",
1532
- message: `${M.file.path}: ${v} = "${O}" — the English bundle is the English UI.`,
1533
- path: M.file.path
1579
+ message: `${D.file.path}: ${$} = "${O}" — the English bundle is the English UI.`,
1580
+ messageKey: "devStudio.issue.polishInEnglish",
1581
+ params: { path: D.file.path, key: $, text: O },
1582
+ path: D.file.path
1534
1583
  });
1535
1584
  }
1536
1585
  }
1537
1586
  }
1538
1587
  if (l.length && C.length) {
1539
- const $ = [
1588
+ const v = [
1540
1589
  "module.displayName",
1541
- ...c.map((u) => `entity.${u}.displayName`),
1542
- ...m.map((u) => `${u}.displayName`),
1543
- ...b.map((u) => `view.${u}.displayName`)
1590
+ ...d.map((f) => `entity.${f}.displayName`),
1591
+ ...m.map((f) => `${f}.displayName`),
1592
+ ...b.map((f) => `view.${f}.displayName`)
1544
1593
  ].filter(
1545
- (u) => !x.has(u) && !(u.startsWith("field.") && x.has(`${u.slice(0, -12)}.label`))
1594
+ (f) => !I.has(f) && !(f.startsWith("field.") && I.has(`${f.slice(0, -12)}.label`))
1546
1595
  );
1547
- $.length && n({
1596
+ v.length && n({
1548
1597
  code: "i18n.labelMissing",
1549
- message: `The English bundle has no label for ${$.length} name(s): ${$.slice(0, 10).join(", ")}`
1598
+ message: `The English bundle has no label for ${v.length} name(s): ${v.slice(0, 10).join(", ")}`,
1599
+ messageKey: "devStudio.issue.labelMissing",
1600
+ params: { count: v.length, keys: v.slice(0, 10).join(", ") }
1550
1601
  });
1551
1602
  }
1552
- for (const { file: d, value: $ } of s)
1603
+ for (const { file: c, value: v } of s)
1553
1604
  ce(
1554
- $,
1605
+ v,
1555
1606
  void 0,
1556
1607
  "",
1557
- (u, T, L) => n({
1608
+ (f, E, A) => n({
1558
1609
  code: "icons.emoji",
1559
- message: `${T} = "${L}": icon fields take an Ntd* name and column headers are words, never emoji.`,
1560
- path: d.path,
1561
- pointer: u
1610
+ message: `${E} = "${A}": icon fields take an Ntd* name and column headers are words, never emoji.`,
1611
+ messageKey: "devStudio.issue.iconsEmoji",
1612
+ params: { key: E, text: A },
1613
+ path: c.path,
1614
+ pointer: f
1562
1615
  })
1563
1616
  );
1564
1617
  return o;
@@ -1568,10 +1621,10 @@ function ce(e, i, t, o) {
1568
1621
  e.forEach((n, s) => ce(n, i, `${t}/${s}`, o));
1569
1622
  return;
1570
1623
  }
1571
- if (F(e))
1624
+ if (K(e))
1572
1625
  for (const [n, s] of Object.entries(e)) {
1573
1626
  const r = `${t}/${n}`;
1574
- if ((n === "icon" || n === "iconName" || n === "entityIcon" || n === "name" && i === "icon" || i === "cardIcon" || (n === "header" || n === "displayName" && i === "columns")) && typeof s == "string" && Ft(s) && o(r, n, s), n === "optionsJson" && typeof s == "string")
1627
+ if ((n === "icon" || n === "iconName" || n === "entityIcon" || n === "name" && i === "icon" || i === "cardIcon" || (n === "header" || n === "displayName" && i === "columns")) && typeof s == "string" && Kt(s) && o(r, n, s), n === "optionsJson" && typeof s == "string")
1575
1628
  try {
1576
1629
  ce(JSON.parse(s), "optionsJson", r, o);
1577
1630
  } catch {
@@ -1579,7 +1632,7 @@ function ce(e, i, t, o) {
1579
1632
  ce(s, n, r, o);
1580
1633
  }
1581
1634
  }
1582
- function Kt(e, i = {}) {
1635
+ function Rt(e, i = {}) {
1583
1636
  const t = [], o = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map();
1584
1637
  for (const r of e)
1585
1638
  for (const l of r.files) {
@@ -1591,14 +1644,14 @@ function Kt(e, i = {}) {
1591
1644
  } catch {
1592
1645
  continue;
1593
1646
  }
1594
- if (oe(l.path, ".manifest.json") && F(y) && typeof y.packageName == "string" && y.packageName) {
1595
- const c = y.packageName.toLowerCase();
1596
- o.set(c, [...o.get(c) ?? [], r.location]);
1647
+ if (oe(l.path, ".manifest.json") && K(y) && typeof y.packageName == "string" && y.packageName) {
1648
+ const d = y.packageName.toLowerCase();
1649
+ o.set(d, [...o.get(d) ?? [], r.location]);
1597
1650
  }
1598
1651
  if (oe(l.path, ".entities.json") && r.group) {
1599
- for (const c of Q(y, "entities"))
1600
- if (F(c) && typeof c.name == "string" && c.name) {
1601
- const m = `${r.group}/${c.name}`.toLowerCase(), b = n.get(m) ?? [];
1652
+ for (const d of Q(y, "entities"))
1653
+ if (K(d) && typeof d.name == "string" && d.name) {
1654
+ const m = `${r.group}/${d.name}`.toLowerCase(), b = n.get(m) ?? [];
1602
1655
  b.includes(r.location) || n.set(m, [...b, r.location]);
1603
1656
  }
1604
1657
  }
@@ -1607,14 +1660,18 @@ function Kt(e, i = {}) {
1607
1660
  l.length > 1 && t.push({
1608
1661
  severity: "error",
1609
1662
  code: "workspace.packageName",
1610
- message: `Package name ${r} is declared by ${l.length} modules: ${l.join(", ")}`
1663
+ message: `Package name ${r} is declared by ${l.length} modules: ${l.join(", ")}`,
1664
+ messageKey: "devStudio.issue.duplicatePackage",
1665
+ params: { name: r, count: l.length, modules: l.join(", ") }
1611
1666
  });
1612
1667
  const s = new Set([...i.knownDuplicates ?? []].map((r) => r.toLowerCase()));
1613
1668
  for (const [r, l] of n)
1614
1669
  l.length > 1 && !s.has(r) && t.push({
1615
1670
  severity: "error",
1616
1671
  code: "workspace.entityName",
1617
- message: `Entity ${r} is declared by ${l.length} modules of the same group: ${l.join(", ")}`
1672
+ message: `Entity ${r} is declared by ${l.length} modules of the same group: ${l.join(", ")}`,
1673
+ messageKey: "devStudio.issue.duplicateEntity",
1674
+ params: { name: r, count: l.length, modules: l.join(", ") }
1618
1675
  });
1619
1676
  return t;
1620
1677
  }
@@ -1663,15 +1720,15 @@ function Vt(e, i) {
1663
1720
  };
1664
1721
  }
1665
1722
  const $e = (e) => Object.fromEntries(Object.entries(e).filter(([, i]) => i !== void 0));
1666
- function Ee(e, i) {
1723
+ function xe(e, i) {
1667
1724
  var l;
1668
1725
  const t = ee(i) ? i : {}, o = (Array.isArray(t.modules) ? t.modules : []).filter(ee), s = JSON.stringify(Ue(t.tags) ?? []) === JSON.stringify(e.tags ?? []) ? t.tags : (l = e.tags) != null && l.length ? typeof t.tags == "string" ? e.tags.join(",") : e.tags : void 0, r = (y) => {
1669
- const c = o.find((m) => m.packageName === y.moduleId);
1726
+ const d = o.find((m) => m.packageName === y.moduleId);
1670
1727
  return $e({
1671
- ...c,
1728
+ ...d,
1672
1729
  packageName: y.moduleId,
1673
1730
  // seed entries spell `required` out, also when it is false
1674
- required: y.required === !0 ? !0 : !c || "required" in c ? !1 : void 0,
1731
+ required: y.required === !0 ? !0 : !d || "required" in d ? !1 : void 0,
1675
1732
  condition: y.condition || void 0,
1676
1733
  description: y.description || void 0
1677
1734
  });
@@ -1741,16 +1798,16 @@ function Ut(e) {
1741
1798
  ...typeof i.defaultLanguage == "string" ? { defaultLanguage: i.defaultLanguage } : {}
1742
1799
  };
1743
1800
  }
1744
- const P = (...e) => e.filter(Boolean).join("/"), Wt = (e) => e.slice(0, Math.max(0, e.lastIndexOf("/"))), Gt = (e) => e.slice(e.lastIndexOf("/") + 1), me = (e) => typeof e == "object" && e !== null && !Array.isArray(e), ie = (e) => typeof e == "string" && e ? e : void 0, _t = /* @__PURE__ */ new Set(["bin", "obj", "node_modules"]), fe = (e) => e.startsWith(".") || _t.has(e), zt = /^wizard-templates-.+\.seed\.json$/i, Bt = /^(\d{4})(\d{2})(\d{2})T(\d{2})(\d{2})(\d{2})(\d{3})Z$/;
1745
- function ue(e) {
1801
+ const F = (...e) => e.filter(Boolean).join("/"), Wt = (e) => e.slice(0, Math.max(0, e.lastIndexOf("/"))), Gt = (e) => e.slice(e.lastIndexOf("/") + 1), me = (e) => typeof e == "object" && e !== null && !Array.isArray(e), ie = (e) => typeof e == "string" && e ? e : void 0, _t = /* @__PURE__ */ new Set(["bin", "obj", "node_modules"]), ue = (e) => e.startsWith(".") || _t.has(e), Bt = /^wizard-templates-.+\.seed\.json$/i, zt = /^(\d{4})(\d{2})(\d{2})T(\d{2})(\d{2})(\d{2})(\d{3})Z$/;
1802
+ function fe(e) {
1746
1803
  const i = (t, o = 2) => String(t).padStart(o, "0");
1747
1804
  return `${e.getUTCFullYear()}${i(e.getUTCMonth() + 1)}${i(e.getUTCDate())}T${i(e.getUTCHours())}${i(e.getUTCMinutes())}${i(e.getUTCSeconds())}${i(e.getUTCMilliseconds(), 3)}Z`;
1748
1805
  }
1749
1806
  function Jt(e) {
1750
- const i = Bt.exec(e);
1807
+ const i = zt.exec(e);
1751
1808
  return i ? Date.UTC(+i[1], +i[2] - 1, +i[3], +i[4], +i[5], +i[6], +i[7]) : void 0;
1752
1809
  }
1753
- const Ht = (e, i) => P(Wt(e), ".revisions", `${Gt(e)}.${i}`), Zt = (e) => e.normalize("NFKD").replace(/[̀-ͯ]/g, "").toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") || "custom";
1810
+ const Ht = (e, i) => F(Wt(e), ".revisions", `${Gt(e)}.${i}`), Zt = (e) => e.normalize("NFKD").replace(/[̀-ͯ]/g, "").toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") || "custom";
1754
1811
  function ni(e) {
1755
1812
  const { roots: i } = e, t = e.revisions !== !1, o = e.now ?? (() => /* @__PURE__ */ new Date()), n = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map();
1756
1813
  let r = null;
@@ -1765,7 +1822,7 @@ function ni(e) {
1765
1822
  throw new Error(`Workspace "${p.label}" is read-only`);
1766
1823
  return p;
1767
1824
  };
1768
- async function c(a, p) {
1825
+ async function d(a, p) {
1769
1826
  const g = await a.read(p);
1770
1827
  try {
1771
1828
  const h = g ? _(g.text).value : void 0;
@@ -1774,129 +1831,129 @@ function ni(e) {
1774
1831
  return {};
1775
1832
  }
1776
1833
  }
1777
- function m(a, p, g, h, k) {
1778
- const f = ie(h.packageName) ?? (p || a.id);
1834
+ function m(a, p, g, h, N) {
1835
+ const u = ie(h.packageName) ?? (p || a.id);
1779
1836
  return {
1780
1837
  workspaceId: a.id,
1781
- id: f,
1838
+ id: u,
1782
1839
  packageId: ie(h.category),
1783
- label: ie(h.displayName) ?? f,
1840
+ label: ie(h.displayName) ?? u,
1784
1841
  description: ie(h.description),
1785
1842
  version: ie(h.version),
1786
1843
  location: p,
1787
1844
  readOnly: a.readOnly,
1788
- files: k,
1845
+ files: N,
1789
1846
  search: `${p} ${g}`
1790
1847
  };
1791
1848
  }
1792
1849
  async function b(a) {
1793
1850
  const p = /* @__PURE__ */ new Map(), g = async (h) => {
1794
- const k = await a.fs.list(h), f = k.filter((w) => w.kind === "file" && w.name.toLowerCase().endsWith(".manifest.json")).map((w) => w.name).sort()[0];
1795
- if (f) {
1796
- const w = k.filter((D) => D.kind === "file").map((D) => D.name), A = m(
1851
+ const N = await a.fs.list(h), u = N.filter((w) => w.kind === "file" && w.name.toLowerCase().endsWith(".manifest.json")).map((w) => w.name).sort()[0];
1852
+ if (u) {
1853
+ const w = N.filter((M) => M.kind === "file").map((M) => M.name), L = m(
1797
1854
  a,
1798
1855
  h,
1799
- f,
1800
- await c(a.fs, P(h, f)),
1856
+ u,
1857
+ await d(a.fs, F(h, u)),
1801
1858
  w
1802
1859
  );
1803
- p.has(A.id.toLowerCase()) || (p.set(A.id.toLowerCase(), { ref: A, dir: h }), s.set(`${a.id}:${A.id.toLowerCase()}`, h));
1860
+ p.has(L.id.toLowerCase()) || (p.set(L.id.toLowerCase(), { ref: L, dir: h }), s.set(`${a.id}:${L.id.toLowerCase()}`, h));
1804
1861
  }
1805
- for (const w of k)
1806
- w.kind === "directory" && !fe(w.name) && !(h === "" && w.name === C(a)) && await g(P(h, w.name));
1862
+ for (const w of N)
1863
+ w.kind === "directory" && !ue(w.name) && !(h === "" && w.name === C(a)) && await g(F(h, w.name));
1807
1864
  };
1808
1865
  return await g(""), p;
1809
1866
  }
1810
- const C = (a) => a.templatesDir === !1 ? void 0 : a.templatesDir ?? "Templates", S = (a) => {
1811
- n.delete(a.id), E.clear();
1812
- }, N = (a) => {
1867
+ const C = (a) => a.templatesDir === !1 ? void 0 : a.templatesDir ?? "Templates", j = (a) => {
1868
+ n.delete(a.id), k.clear();
1869
+ }, T = (a) => {
1813
1870
  let p = n.get(a.id);
1814
1871
  return p || (p = b(a), n.set(a.id, p), p.catch(() => n.delete(a.id))), p;
1815
1872
  };
1816
- async function x(a) {
1817
- const p = l(a.workspaceId), g = await N(p), h = s.get(`${p.id}:${a.id.toLowerCase()}`), k = g.get(a.id.toLowerCase()) ?? (h === void 0 ? void 0 : [...g.values()].find((f) => f.dir === h));
1818
- if (!k)
1873
+ async function I(a) {
1874
+ const p = l(a.workspaceId), g = await T(p), h = s.get(`${p.id}:${a.id.toLowerCase()}`), N = g.get(a.id.toLowerCase()) ?? (h === void 0 ? void 0 : [...g.values()].find((u) => u.dir === h));
1875
+ if (!N)
1819
1876
  throw new Error(`Module "${a.id}" is not in "${p.label}"`);
1820
- return { root: p, module: k };
1877
+ return { root: p, module: N };
1821
1878
  }
1822
- async function d(a, p) {
1823
- const g = [], h = async (k, f) => {
1824
- const w = await a.list(P(p, k));
1825
- if (!(f && w.some((A) => A.kind === "file" && A.name.toLowerCase().endsWith(".manifest.json"))))
1826
- for (const A of w)
1827
- A.kind === "file" ? g.push(P(k, A.name)) : fe(A.name) || await h(P(k, A.name), !0);
1879
+ async function c(a, p) {
1880
+ const g = [], h = async (N, u) => {
1881
+ const w = await a.list(F(p, N));
1882
+ if (!(u && w.some((L) => L.kind === "file" && L.name.toLowerCase().endsWith(".manifest.json"))))
1883
+ for (const L of w)
1884
+ L.kind === "file" ? g.push(F(N, L.name)) : ue(L.name) || await h(F(N, L.name), !0);
1828
1885
  };
1829
1886
  return await h("", !1), g.sort();
1830
1887
  }
1831
- async function $(a, p, g, h) {
1888
+ async function v(a, p, g, h) {
1832
1889
  t && await a.write(Ht(p, h), g);
1833
1890
  }
1834
- async function u(a, p) {
1835
- const g = [], h = async (k) => {
1836
- const f = await a.list(P(p, k));
1837
- for (const w of f)
1891
+ async function f(a, p) {
1892
+ const g = [], h = async (N) => {
1893
+ const u = await a.list(F(p, N));
1894
+ for (const w of u)
1838
1895
  if (w.kind === "directory" && w.name === ".revisions")
1839
- for (const A of await a.list(P(p, k, w.name))) {
1840
- const D = /^(.*)\.(\d{8}T\d{9}Z)$/.exec(A.name);
1841
- A.kind === "file" && D && g.push({
1842
- path: P(k, D[1]),
1843
- stamp: D[2],
1844
- at: P(k, ".revisions", A.name)
1896
+ for (const L of await a.list(F(p, N, w.name))) {
1897
+ const M = /^(.*)\.(\d{8}T\d{9}Z)$/.exec(L.name);
1898
+ L.kind === "file" && M && g.push({
1899
+ path: F(N, M[1]),
1900
+ stamp: M[2],
1901
+ at: F(N, ".revisions", L.name)
1845
1902
  });
1846
1903
  }
1847
- else w.kind === "directory" && !fe(w.name) && await h(P(k, w.name));
1904
+ else w.kind === "directory" && !ue(w.name) && await h(F(N, w.name));
1848
1905
  };
1849
1906
  return await h(""), g;
1850
1907
  }
1851
- async function T(a) {
1908
+ async function E(a) {
1852
1909
  const p = C(a);
1853
- return p ? (await a.fs.list(p)).filter((g) => g.kind === "file" && zt.test(g.name)).map((g) => P(p, g.name)).sort() : [];
1910
+ return p ? (await a.fs.list(p)).filter((g) => g.kind === "file" && Bt.test(g.name)).map((g) => F(p, g.name)).sort() : [];
1854
1911
  }
1855
- async function L(a, p) {
1912
+ async function A(a, p) {
1856
1913
  const g = await a.fs.read(p);
1857
1914
  if (!g)
1858
1915
  return { text: "", entries: [] };
1859
1916
  const h = _(g.text).value;
1860
1917
  return { text: g.text, entries: Array.isArray(h) ? h : [] };
1861
1918
  }
1862
- const I = {
1919
+ const x = {
1863
1920
  arrayKey: (a) => a === "" ? "slug" : a.endsWith("/modules") ? "packageName" : void 0
1864
1921
  };
1865
- async function M(a, p, g, h) {
1866
- if (g && await $(a.fs, p, g, ue(o())), h.length === 0) {
1922
+ async function D(a, p, g, h) {
1923
+ if (g && await v(a.fs, p, g, fe(o())), h.length === 0) {
1867
1924
  await a.fs.remove(p);
1868
1925
  return;
1869
1926
  }
1870
1927
  await a.fs.write(
1871
1928
  p,
1872
- g ? De(g, h, I) : de(h)
1929
+ g ? Me(g, h, x) : de(h)
1873
1930
  );
1874
1931
  }
1875
- const E = /* @__PURE__ */ new Map();
1876
- function j(a, p) {
1932
+ const k = /* @__PURE__ */ new Map();
1933
+ function S(a, p) {
1877
1934
  const g = `${a.id}:${p.dir}`;
1878
- let h = E.get(g);
1935
+ let h = k.get(g);
1879
1936
  if (!h) {
1880
- const k = (p.ref.files ?? []).filter((f) => /\.(manifest|entities)\.json$/i.test(f));
1937
+ const N = (p.ref.files ?? []).filter((u) => /\.(manifest|entities)\.json$/i.test(u));
1881
1938
  h = Promise.all(
1882
- k.map(async (f) => {
1939
+ N.map(async (u) => {
1883
1940
  var w;
1884
1941
  return {
1885
- path: f,
1886
- text: ((w = await a.fs.read(P(p.dir, f))) == null ? void 0 : w.text) ?? ""
1942
+ path: u,
1943
+ text: ((w = await a.fs.read(F(p.dir, u))) == null ? void 0 : w.text) ?? ""
1887
1944
  };
1888
1945
  })
1889
- ).then((f) => ({ location: p.dir, group: p.dir.split("/")[0], files: f })), E.set(g, h);
1946
+ ).then((u) => ({ location: p.dir, group: p.dir.split("/")[0], files: u })), k.set(g, h);
1890
1947
  }
1891
1948
  return h;
1892
1949
  }
1893
- async function v(a) {
1950
+ async function $(a) {
1894
1951
  var p;
1895
1952
  return r || await ((p = O.listTemplates) == null ? void 0 : p.call(O)), r == null ? void 0 : r.get(a.toLowerCase());
1896
1953
  }
1897
1954
  const O = {
1898
1955
  invalidate() {
1899
- n.clear(), E.clear(), r = null;
1956
+ n.clear(), k.clear(), r = null;
1900
1957
  },
1901
1958
  async listWorkspaces() {
1902
1959
  return i.map((a) => ({
@@ -1908,172 +1965,172 @@ function ni(e) {
1908
1965
  }));
1909
1966
  },
1910
1967
  async listModules(a) {
1911
- const p = i.findIndex((f) => f.id === a), g = l(a);
1912
- S(g);
1913
- const h = await N(g), k = await Promise.all(
1914
- i.slice(0, p).map(async (f) => ({ r: f, modules: await N(f) }))
1968
+ const p = i.findIndex((u) => u.id === a), g = l(a);
1969
+ j(g);
1970
+ const h = await T(g), N = await Promise.all(
1971
+ i.slice(0, p).map(async (u) => ({ r: u, modules: await T(u) }))
1915
1972
  );
1916
- return [...h.values()].map(({ ref: f }) => {
1917
- const w = k.find((A) => A.modules.has(f.id.toLowerCase()));
1918
- return w ? { ...f, shadowedBy: w.r.id } : f;
1919
- }).sort((f, w) => f.id.localeCompare(w.id));
1973
+ return [...h.values()].map(({ ref: u }) => {
1974
+ const w = N.find((L) => L.modules.has(u.id.toLowerCase()));
1975
+ return w ? { ...u, shadowedBy: w.r.id } : u;
1976
+ }).sort((u, w) => u.id.localeCompare(w.id));
1920
1977
  },
1921
1978
  async readModule(a) {
1922
- const { root: p, module: g } = await x(a), h = await d(p.fs, g.dir), k = [];
1923
- for (const f of h) {
1924
- const w = await p.fs.read(P(g.dir, f));
1925
- w && k.push({
1926
- path: f,
1979
+ const { root: p, module: g } = await I(a), h = await c(p.fs, g.dir), N = [];
1980
+ for (const u of h) {
1981
+ const w = await p.fs.read(F(g.dir, u));
1982
+ w && N.push({
1983
+ path: u,
1927
1984
  text: w.text,
1928
1985
  version: w.version,
1929
1986
  ...p.readOnly ? { readOnly: !0 } : {}
1930
1987
  });
1931
1988
  }
1932
- return k;
1989
+ return N;
1933
1990
  },
1934
1991
  async writeModule(a, p) {
1935
- const { module: g } = await x(a), h = y(a.workspaceId), k = /* @__PURE__ */ new Map(), f = [];
1936
- for (const D of p) {
1937
- if (D.path.split("/").some((Z) => Z === ".." || Z === "" || Z.startsWith(".")))
1938
- throw new Error(`Refusing to write outside the module: ${D.path}`);
1939
- const K = await h.fs.read(P(g.dir, D.path));
1940
- k.set(D.path, K);
1941
- const z = D.baseVersion;
1942
- (z === void 0 ? K !== null && D.type === "write" : (K == null ? void 0 : K.version) !== z) && f.push({ path: D.path, ...K ? { currentVersion: K.version } : {} });
1992
+ const { module: g } = await I(a), h = y(a.workspaceId), N = /* @__PURE__ */ new Map(), u = [];
1993
+ for (const M of p) {
1994
+ if (M.path.split("/").some((Z) => Z === ".." || Z === "" || Z.startsWith(".")))
1995
+ throw new Error(`Refusing to write outside the module: ${M.path}`);
1996
+ const R = await h.fs.read(F(g.dir, M.path));
1997
+ N.set(M.path, R);
1998
+ const B = M.baseVersion;
1999
+ (B === void 0 ? R !== null && M.type === "write" : (R == null ? void 0 : R.version) !== B) && u.push({ path: M.path, ...R ? { currentVersion: R.version } : {} });
1943
2000
  }
1944
- if (f.length)
1945
- return { ok: !1, conflicts: f };
1946
- const w = ue(o()), A = {};
1947
- for (const D of p) {
1948
- const K = P(g.dir, D.path), z = k.get(D.path);
1949
- z && await $(h.fs, K, z.text, w), D.type === "write" ? A[D.path] = await h.fs.write(K, D.text) : await h.fs.remove(K);
2001
+ if (u.length)
2002
+ return { ok: !1, conflicts: u };
2003
+ const w = fe(o()), L = {};
2004
+ for (const M of p) {
2005
+ const R = F(g.dir, M.path), B = N.get(M.path);
2006
+ B && await v(h.fs, R, B.text, w), M.type === "write" ? L[M.path] = await h.fs.write(R, M.text) : await h.fs.remove(R);
1950
2007
  }
1951
- return S(h), { ok: !0, versions: A, revision: w };
2008
+ return j(h), { ok: !0, versions: L, revision: w };
1952
2009
  },
1953
2010
  async createModule(a) {
1954
- var f;
1955
- const p = y(a.workspaceId), g = a.id.startsWith(W) ? a.id.slice(W.length) : a.id.split(".").pop() ?? a.id, h = ((f = e.moduleFolder) == null ? void 0 : f.call(e, a)) ?? P(
1956
- R(a.packageId ?? "") || "Custom",
1957
- R(g) || "Module"
2011
+ var u;
2012
+ const p = y(a.workspaceId), g = a.id.startsWith(W) ? a.id.slice(W.length) : a.id.split(".").pop() ?? a.id, h = ((u = e.moduleFolder) == null ? void 0 : u.call(e, a)) ?? F(
2013
+ P(a.packageId ?? "") || "Custom",
2014
+ P(g) || "Module"
1958
2015
  );
1959
2016
  if ((await p.fs.list(h)).length > 0)
1960
2017
  throw new Error(`The folder ${h} is not empty`);
1961
- if ((await N(p)).has(a.id.toLowerCase()))
2018
+ if ((await T(p)).has(a.id.toLowerCase()))
1962
2019
  throw new Error(`"${a.id}" already exists in ${p.label}`);
1963
2020
  for (const w of a.files)
1964
- await p.fs.write(P(h, w.path), w.text);
1965
- S(p);
1966
- const k = (await N(p)).get(a.id.toLowerCase());
1967
- if (!k)
2021
+ await p.fs.write(F(h, w.path), w.text);
2022
+ j(p);
2023
+ const N = (await T(p)).get(a.id.toLowerCase());
2024
+ if (!N)
1968
2025
  throw new Error(`The new module ${a.id} has no manifest naming it`);
1969
- return k.ref;
2026
+ return N.ref;
1970
2027
  },
1971
2028
  async deleteModule(a) {
1972
- const { module: p } = await x(a), g = y(a.workspaceId);
1973
- await g.fs.removeDir(p.dir), s.delete(`${g.id}:${a.id.toLowerCase()}`), S(g);
2029
+ const { module: p } = await I(a), g = y(a.workspaceId);
2030
+ await g.fs.removeDir(p.dir), s.delete(`${g.id}:${a.id.toLowerCase()}`), j(g);
1974
2031
  },
1975
2032
  async listTemplates() {
1976
2033
  const a = /* @__PURE__ */ new Map(), p = [];
1977
2034
  for (const g of i)
1978
- for (const h of await T(g)) {
1979
- let k;
2035
+ for (const h of await E(g)) {
2036
+ let N;
1980
2037
  try {
1981
- k = (await L(g, h)).entries;
2038
+ N = (await A(g, h)).entries;
1982
2039
  } catch {
1983
2040
  continue;
1984
2041
  }
1985
- for (const f of k) {
1986
- const w = Vt(f, g.readOnly);
2042
+ for (const u of N) {
2043
+ const w = Vt(u, g.readOnly);
1987
2044
  w.id && !a.has(w.id.toLowerCase()) && (a.set(w.id.toLowerCase(), { rootId: g.id, path: h }), p.push(w));
1988
2045
  }
1989
2046
  }
1990
2047
  return r = a, p;
1991
2048
  },
1992
2049
  async saveTemplate(a, p) {
1993
- const g = (p == null ? void 0 : p.previousId) ?? a.id, h = await v(g);
2050
+ const g = (p == null ? void 0 : p.previousId) ?? a.id, h = await $(g);
1994
2051
  if (h) {
1995
- const k = y(h.rootId), { text: f, entries: w } = await L(k, h.path), A = w.findIndex(
1996
- (K) => me(K) && String(K.slug ?? "").toLowerCase() === g.toLowerCase()
1997
- ), D = [...w];
1998
- D[A < 0 ? D.length : A] = Ee(
2052
+ const N = y(h.rootId), { text: u, entries: w } = await A(N, h.path), L = w.findIndex(
2053
+ (R) => me(R) && String(R.slug ?? "").toLowerCase() === g.toLowerCase()
2054
+ ), M = [...w];
2055
+ M[L < 0 ? M.length : L] = xe(
1999
2056
  a,
2000
- A < 0 ? void 0 : w[A]
2001
- ), await M(k, h.path, f, D);
2057
+ L < 0 ? void 0 : w[L]
2058
+ ), await D(N, h.path, u, M);
2002
2059
  } else {
2003
- const k = i.find((D) => !D.readOnly && C(D));
2004
- if (!k)
2060
+ const N = i.find((M) => !M.readOnly && C(M));
2061
+ if (!N)
2005
2062
  throw new Error("No writable folder holds templates");
2006
- const f = P(
2007
- C(k),
2063
+ const u = F(
2064
+ C(N),
2008
2065
  `wizard-templates-${Zt(a.category ?? "custom")}.seed.json`
2009
- ), { text: w, entries: A } = await L(k, f);
2010
- await M(k, f, w, [...A, Ee(a)]);
2066
+ ), { text: w, entries: L } = await A(N, u);
2067
+ await D(N, u, w, [...L, xe(a)]);
2011
2068
  }
2012
2069
  return r = null, { ...a, extra: a.extra };
2013
2070
  },
2014
2071
  async deleteTemplate(a) {
2015
- const p = await v(a);
2072
+ const p = await $(a);
2016
2073
  if (!p)
2017
2074
  return;
2018
- const g = y(p.rootId), { text: h, entries: k } = await L(g, p.path);
2019
- await M(
2075
+ const g = y(p.rootId), { text: h, entries: N } = await A(g, p.path);
2076
+ await D(
2020
2077
  g,
2021
2078
  p.path,
2022
2079
  h,
2023
- k.filter(
2024
- (f) => !(me(f) && String(f.slug ?? "").toLowerCase() === a.toLowerCase())
2080
+ N.filter(
2081
+ (u) => !(me(u) && String(u.slug ?? "").toLowerCase() === a.toLowerCase())
2025
2082
  )
2026
2083
  ), r = null;
2027
2084
  },
2028
2085
  async validate(a, p) {
2029
- const g = l(a.workspaceId), h = [...(await N(g)).values()], k = await Promise.all(
2030
- h.filter((A) => A.ref.id.toLowerCase() !== a.id.toLowerCase()).map((A) => j(g, A))
2031
- ), f = h.find((A) => A.ref.id.toLowerCase() === a.id.toLowerCase()), w = (f == null ? void 0 : f.dir) ?? a.id;
2032
- return Kt(
2033
- [...k, { location: w, group: w.split("/")[0], files: p }],
2086
+ const g = l(a.workspaceId), h = [...(await T(g)).values()], N = await Promise.all(
2087
+ h.filter((L) => L.ref.id.toLowerCase() !== a.id.toLowerCase()).map((L) => S(g, L))
2088
+ ), u = h.find((L) => L.ref.id.toLowerCase() === a.id.toLowerCase()), w = (u == null ? void 0 : u.dir) ?? a.id;
2089
+ return Rt(
2090
+ [...N, { location: w, group: w.split("/")[0], files: p }],
2034
2091
  {
2035
2092
  knownDuplicates: e.knownDuplicates
2036
2093
  }
2037
- ).filter((A) => A.message.split(/[ ,]+/).includes(w));
2094
+ ).filter((L) => L.message.split(/[ ,]+/).includes(w));
2038
2095
  },
2039
2096
  async listRevisions(a, p) {
2040
- const { root: g, module: h } = await x(a), k = (await u(g.fs, h.dir)).filter(
2097
+ const { root: g, module: h } = await I(a), N = (await f(g.fs, h.dir)).filter(
2041
2098
  (w) => !p || w.path === p
2042
- ), f = /* @__PURE__ */ new Map();
2043
- for (const w of k)
2044
- f.set(w.stamp, [...f.get(w.stamp) ?? [], w.path]);
2045
- return [...f].map(([w, A]) => ({
2099
+ ), u = /* @__PURE__ */ new Map();
2100
+ for (const w of N)
2101
+ u.set(w.stamp, [...u.get(w.stamp) ?? [], w.path]);
2102
+ return [...u].map(([w, L]) => ({
2046
2103
  id: w,
2047
2104
  timestamp: Jt(w) ?? 0,
2048
- summary: A.sort().join(", "),
2105
+ summary: L.sort().join(", "),
2049
2106
  ...p ? { path: p } : {}
2050
- })).sort((w, A) => A.timestamp - w.timestamp);
2107
+ })).sort((w, L) => L.timestamp - w.timestamp);
2051
2108
  },
2052
2109
  async readRevision(a, p, g) {
2053
- var A;
2054
- const { root: h, module: k } = await x(a), f = (await u(h.fs, k.dir)).filter(
2055
- (D) => D.stamp === p && (!g || D.path === g)
2110
+ var L;
2111
+ const { root: h, module: N } = await I(a), u = (await f(h.fs, N.dir)).filter(
2112
+ (M) => M.stamp === p && (!g || M.path === g)
2056
2113
  );
2057
- if (f.length === 0)
2114
+ if (u.length === 0)
2058
2115
  throw new Error(`Unknown revision "${p}"`);
2059
2116
  const w = {};
2060
- for (const D of f)
2061
- w[D.path] = ((A = await h.fs.read(P(k.dir, D.at))) == null ? void 0 : A.text) ?? "";
2117
+ for (const M of u)
2118
+ w[M.path] = ((L = await h.fs.read(F(N.dir, M.at))) == null ? void 0 : L.text) ?? "";
2062
2119
  return g ? w[g] : JSON.stringify(w, null, 2);
2063
2120
  },
2064
2121
  async rollback(a, p, g) {
2065
- var A;
2066
- const { module: h } = await x(a), k = y(a.workspaceId), f = (await u(k.fs, h.dir)).filter(
2067
- (D) => D.stamp === p && (!g || D.path === g)
2122
+ var L;
2123
+ const { module: h } = await I(a), N = y(a.workspaceId), u = (await f(N.fs, h.dir)).filter(
2124
+ (M) => M.stamp === p && (!g || M.path === g)
2068
2125
  );
2069
- if (f.length === 0)
2126
+ if (u.length === 0)
2070
2127
  throw new Error(`Unknown revision "${p}"`);
2071
- const w = ue(o());
2072
- for (const D of f) {
2073
- const K = P(h.dir, D.path), z = ((A = await k.fs.read(P(h.dir, D.at))) == null ? void 0 : A.text) ?? "", Z = await k.fs.read(K);
2074
- Z && await $(k.fs, K, Z.text, w), await k.fs.write(K, z);
2128
+ const w = fe(o());
2129
+ for (const M of u) {
2130
+ const R = F(h.dir, M.path), B = ((L = await N.fs.read(F(h.dir, M.at))) == null ? void 0 : L.text) ?? "", Z = await N.fs.read(R);
2131
+ Z && await v(N.fs, R, Z.text, w), await N.fs.write(R, B);
2075
2132
  }
2076
- S(k);
2133
+ j(N);
2077
2134
  }
2078
2135
  };
2079
2136
  return O;
@@ -2104,41 +2161,41 @@ function Qt(e) {
2104
2161
  return `${e.length}:${(i >>> 0).toString(16)}`;
2105
2162
  }
2106
2163
  function si(e = {}) {
2107
- const i = (e.baseUrl ?? "/api").replace(/\/+$/, ""), t = e.fetch ?? ((c, m) => globalThis.fetch(c, m)), o = e.language ?? "en", n = encodeURIComponent;
2108
- async function s(c, m, b, C = "json") {
2109
- const S = typeof e.headers == "function" ? await e.headers() : e.headers ?? {}, N = await t(`${i}${m}`, {
2110
- method: c,
2164
+ const i = (e.baseUrl ?? "/api").replace(/\/+$/, ""), t = e.fetch ?? ((d, m) => globalThis.fetch(d, m)), o = e.language ?? "en", n = encodeURIComponent;
2165
+ async function s(d, m, b, C = "json") {
2166
+ const j = typeof e.headers == "function" ? await e.headers() : e.headers ?? {}, T = await t(`${i}${m}`, {
2167
+ method: d,
2111
2168
  credentials: e.credentials ?? "same-origin",
2112
2169
  headers: {
2113
2170
  Accept: C === "json" ? "application/json" : "text/plain, application/json",
2114
2171
  ...b === void 0 ? {} : { "Content-Type": "application/json" },
2115
- ...S
2172
+ ...j
2116
2173
  },
2117
2174
  ...b === void 0 ? {} : { body: JSON.stringify(b) }
2118
- }), x = await N.text();
2119
- let d = x;
2120
- if (C === "json" || !N.ok)
2175
+ }), I = await T.text();
2176
+ let c = I;
2177
+ if (C === "json" || !T.ok)
2121
2178
  try {
2122
- d = x ? JSON.parse(x) : void 0;
2179
+ c = I ? JSON.parse(I) : void 0;
2123
2180
  } catch {
2124
- d = x;
2181
+ c = I;
2125
2182
  }
2126
- if (!N.ok)
2183
+ if (!T.ok)
2127
2184
  throw new ye(
2128
- `${c} ${m}: ${N.status} ${N.statusText}`,
2129
- N.status,
2130
- d
2185
+ `${d} ${m}: ${T.status} ${T.statusText}`,
2186
+ T.status,
2187
+ c
2131
2188
  );
2132
- return d;
2189
+ return c;
2133
2190
  }
2134
2191
  const r = e.templates === !1 ? {} : {
2135
2192
  async listTemplates() {
2136
- const c = await s(
2193
+ const d = await s(
2137
2194
  "GET",
2138
2195
  `/module-templates?lang=${n(o)}&hidden=true`
2139
2196
  );
2140
2197
  return (await Promise.all(
2141
- (c ?? []).map(
2198
+ (d ?? []).map(
2142
2199
  (b) => s(
2143
2200
  "GET",
2144
2201
  `/module-templates/${n(b.slug)}?lang=${n(o)}`
@@ -2146,131 +2203,135 @@ function si(e = {}) {
2146
2203
  )
2147
2204
  )).map((b) => Ie(b, o));
2148
2205
  },
2149
- async saveTemplate(c, m) {
2150
- const b = (m == null ? void 0 : m.previousId) ?? c.id, C = Ut(c);
2151
- let S;
2206
+ async saveTemplate(d, m) {
2207
+ const b = (m == null ? void 0 : m.previousId) ?? d.id, C = Ut(d);
2208
+ let j;
2152
2209
  if ((m == null ? void 0 : m.previousId) === void 0)
2153
- S = await s(
2210
+ j = await s(
2154
2211
  "GET",
2155
- `/module-templates/${n(c.id)}?lang=${n(o)}`
2212
+ `/module-templates/${n(d.id)}?lang=${n(o)}`
2156
2213
  ).then(
2157
2214
  () => !0,
2158
- (x) => x instanceof ye && x.status === 404 ? !1 : Promise.reject(x)
2215
+ (I) => I instanceof ye && I.status === 404 ? !1 : Promise.reject(I)
2159
2216
  ) ? await s(
2160
2217
  "PUT",
2161
- `/module-templates/${n(c.id)}?lang=${n(o)}`,
2218
+ `/module-templates/${n(d.id)}?lang=${n(o)}`,
2162
2219
  C
2163
2220
  ) : await s("POST", `/module-templates?lang=${n(o)}`, C);
2164
2221
  else {
2165
- if (b !== c.id)
2222
+ if (b !== d.id)
2166
2223
  throw new Error(
2167
2224
  "The OmniVerk API keeps a template's slug: save it as a new template instead."
2168
2225
  );
2169
- S = await s(
2226
+ j = await s(
2170
2227
  "PUT",
2171
2228
  `/module-templates/${n(b)}?lang=${n(o)}`,
2172
2229
  C
2173
2230
  );
2174
2231
  }
2175
- return Ie(S, o);
2232
+ return Ie(j, o);
2176
2233
  },
2177
- async deleteTemplate(c) {
2178
- await s("DELETE", `/module-templates/${n(c)}`);
2234
+ async deleteTemplate(d) {
2235
+ await s("DELETE", `/module-templates/${n(d)}`);
2179
2236
  }
2180
2237
  };
2181
2238
  if ((e.mode ?? "manifest-only") === "manifest-only") {
2182
- const c = "seed", m = /* @__PURE__ */ new Map(), b = (S) => {
2183
- var N, x;
2184
- return ((N = m.get(S)) == null ? void 0 : N.manifestFile) ?? `${(x = S.split(".").pop()) == null ? void 0 : x.toLowerCase()}.manifest.json`;
2185
- }, C = async (S) => {
2186
- const N = await s("GET", `/module-manifests/${n(S)}`), x = de(N, { finalNewline: !1 });
2187
- return { path: b(S), text: x, version: Qt(x) };
2239
+ const d = "seed", m = /* @__PURE__ */ new Map(), b = (j) => {
2240
+ var T, I;
2241
+ return ((T = m.get(j)) == null ? void 0 : T.manifestFile) ?? `${(I = j.split(".").pop()) == null ? void 0 : I.toLowerCase()}.manifest.json`;
2242
+ }, C = async (j) => {
2243
+ const T = await s("GET", `/module-manifests/${n(j)}`), I = de(T, { finalNewline: !1 });
2244
+ return { path: b(j), text: I, version: Qt(I) };
2188
2245
  };
2189
2246
  return {
2190
2247
  async listWorkspaces() {
2191
- return [{ id: c, label: e.workspaceLabel ?? "Seed/Modules" }];
2248
+ return [{ id: d, label: e.workspaceLabel ?? "Seed/Modules" }];
2192
2249
  },
2193
2250
  async listModules() {
2194
- const S = await s("GET", "/module-manifests");
2195
- return m.clear(), (S ?? []).map((N) => (m.set(N.packageName, N), {
2196
- workspaceId: c,
2197
- id: N.packageName,
2198
- packageId: N.path.split("/")[0] || void 0,
2199
- label: N.packageName,
2200
- location: N.path,
2201
- files: [N.manifestFile],
2202
- search: N.path
2251
+ const j = await s("GET", "/module-manifests");
2252
+ return m.clear(), (j ?? []).map((T) => (m.set(T.packageName, T), {
2253
+ workspaceId: d,
2254
+ id: T.packageName,
2255
+ // the package is the manifest's category, as in the `files` mode and OmniVerk's own
2256
+ // trees (1.3.14); the first folder only while the API does not list the category
2257
+ packageId: T.category || T.path.split("/")[0] || void 0,
2258
+ label: T.packageName,
2259
+ location: T.path,
2260
+ files: [T.manifestFile],
2261
+ search: T.path,
2262
+ // only the manifest: the checks and the preview do not count what is not given
2263
+ contents: "manifest"
2203
2264
  }));
2204
2265
  },
2205
- async readModule(S) {
2206
- return [await C(S.id)];
2266
+ async readModule(j) {
2267
+ return [await C(j.id)];
2207
2268
  },
2208
- async writeModule(S, N) {
2209
- const x = b(S.id), d = N.find((I) => I.path !== x || I.type !== "write");
2210
- if (d)
2269
+ async writeModule(j, T) {
2270
+ const I = b(j.id), c = T.find((x) => x.path !== I || x.type !== "write");
2271
+ if (c)
2211
2272
  throw new Error(
2212
- `This OmniVerk API stores only the manifest; "${d.path}" was not saved.`
2273
+ `This OmniVerk API stores only the manifest; "${c.path}" was not saved.`
2213
2274
  );
2214
- const $ = N[0];
2215
- if (!$ || $.type !== "write")
2275
+ const v = T[0];
2276
+ if (!v || v.type !== "write")
2216
2277
  return { ok: !0, versions: {} };
2217
- const u = await C(S.id);
2218
- if ($.baseVersion !== void 0 && $.baseVersion !== u.version)
2219
- return { ok: !1, conflicts: [{ path: x, currentVersion: u.version }] };
2220
- const T = await s(
2278
+ const f = await C(j.id);
2279
+ if (v.baseVersion !== void 0 && v.baseVersion !== f.version)
2280
+ return { ok: !1, conflicts: [{ path: I, currentVersion: f.version }] };
2281
+ const E = await s(
2221
2282
  "PUT",
2222
- `/module-manifests/${n(S.id)}`,
2283
+ `/module-manifests/${n(j.id)}`,
2223
2284
  {
2224
- manifest: _($.text).value
2285
+ manifest: _(v.text).value
2225
2286
  }
2226
- ), L = await C(S.id);
2287
+ ), A = await C(j.id);
2227
2288
  return {
2228
2289
  ok: !0,
2229
- versions: { [x]: L.version },
2230
- ...T != null && T.revision ? { revision: T.revision } : {}
2290
+ versions: { [I]: A.version },
2291
+ ...E != null && E.revision ? { revision: E.revision } : {}
2231
2292
  };
2232
2293
  },
2233
- async listRevisions(S) {
2294
+ async listRevisions(j) {
2234
2295
  return (await s(
2235
2296
  "GET",
2236
- `/module-manifests/${n(S.id)}/revisions`
2237
- ) ?? []).map((x) => ({
2238
- id: x.id,
2239
- timestamp: Date.parse(x.at) || 0,
2240
- path: b(S.id),
2241
- ...x.sizeBytes !== void 0 ? { summary: `${x.sizeBytes} B` } : {}
2297
+ `/module-manifests/${n(j.id)}/revisions`
2298
+ ) ?? []).map((I) => ({
2299
+ id: I.id,
2300
+ timestamp: Date.parse(I.at) || 0,
2301
+ path: b(j.id),
2302
+ ...I.sizeBytes !== void 0 ? { summary: `${I.sizeBytes} B` } : {}
2242
2303
  }));
2243
2304
  },
2244
- async readRevision(S, N) {
2305
+ async readRevision(j, T) {
2245
2306
  return s(
2246
2307
  "GET",
2247
- `/module-manifests/${n(S.id)}/revisions/${n(N)}`,
2308
+ `/module-manifests/${n(j.id)}/revisions/${n(T)}`,
2248
2309
  void 0,
2249
2310
  "text"
2250
2311
  );
2251
2312
  },
2252
- async rollback(S, N) {
2313
+ async rollback(j, T) {
2253
2314
  await s(
2254
2315
  "POST",
2255
- `/module-manifests/${n(S.id)}/revisions/${n(N)}/rollback`
2316
+ `/module-manifests/${n(j.id)}/revisions/${n(T)}/rollback`
2256
2317
  );
2257
2318
  },
2258
2319
  ...r
2259
2320
  };
2260
2321
  }
2261
- const l = (c) => `/module-files/${n(c.workspaceId)}/modules/${n(c.id)}`, y = (c) => c.map((m) => ({ path: m.path, content: Ce(m.text) }));
2322
+ const l = (d) => `/module-files/${n(d.workspaceId)}/modules/${n(d.id)}`, y = (d) => d.map((m) => ({ path: m.path, content: Ce(m.text) }));
2262
2323
  return {
2263
2324
  async listWorkspaces() {
2264
2325
  return s("GET", "/module-files/workspaces");
2265
2326
  },
2266
- async listModules(c) {
2327
+ async listModules(d) {
2267
2328
  return (await s(
2268
2329
  "GET",
2269
- `/module-files/${n(c)}/modules`
2270
- ) ?? []).map((b) => ({ ...b, workspaceId: c }));
2330
+ `/module-files/${n(d)}/modules`
2331
+ ) ?? []).map((b) => ({ ...b, workspaceId: d }));
2271
2332
  },
2272
- async readModule(c) {
2273
- const m = await s("GET", l(c));
2333
+ async readModule(d) {
2334
+ const m = await s("GET", l(d));
2274
2335
  return ((m == null ? void 0 : m.files) ?? []).map((b) => ({
2275
2336
  path: b.path,
2276
2337
  text: Xt(b.content),
@@ -2278,20 +2339,20 @@ function si(e = {}) {
2278
2339
  ...b.readOnly ? { readOnly: !0 } : {}
2279
2340
  }));
2280
2341
  },
2281
- async writeModule(c, m) {
2342
+ async writeModule(d, m) {
2282
2343
  var b;
2283
2344
  try {
2284
2345
  const C = await s(
2285
2346
  "PUT",
2286
- l(c),
2347
+ l(d),
2287
2348
  {
2288
2349
  changes: m.map(
2289
- (S) => S.type === "write" ? {
2350
+ (j) => j.type === "write" ? {
2290
2351
  type: "write",
2291
- path: S.path,
2292
- content: Ce(S.text),
2293
- baseVersion: S.baseVersion
2294
- } : { type: "delete", path: S.path, baseVersion: S.baseVersion }
2352
+ path: j.path,
2353
+ content: Ce(j.text),
2354
+ baseVersion: j.baseVersion
2355
+ } : { type: "delete", path: j.path, baseVersion: j.baseVersion }
2295
2356
  )
2296
2357
  }
2297
2358
  );
@@ -2302,47 +2363,47 @@ function si(e = {}) {
2302
2363
  };
2303
2364
  } catch (C) {
2304
2365
  if (C instanceof ye && C.status === 409)
2305
- return { ok: !1, conflicts: ((b = C.body) == null ? void 0 : b.conflicts) ?? m.map((N) => ({ path: N.path })) };
2366
+ return { ok: !1, conflicts: ((b = C.body) == null ? void 0 : b.conflicts) ?? m.map((T) => ({ path: T.path })) };
2306
2367
  throw C;
2307
2368
  }
2308
2369
  },
2309
- async createModule(c) {
2370
+ async createModule(d) {
2310
2371
  return { ...await s(
2311
2372
  "POST",
2312
- `/module-files/${n(c.workspaceId)}/modules`,
2373
+ `/module-files/${n(d.workspaceId)}/modules`,
2313
2374
  {
2314
- packageId: c.packageId,
2315
- id: c.id,
2316
- files: y(c.files)
2375
+ packageId: d.packageId,
2376
+ id: d.id,
2377
+ files: y(d.files)
2317
2378
  }
2318
- ), workspaceId: c.workspaceId };
2379
+ ), workspaceId: d.workspaceId };
2319
2380
  },
2320
- async deleteModule(c) {
2321
- await s("DELETE", l(c));
2381
+ async deleteModule(d) {
2382
+ await s("DELETE", l(d));
2322
2383
  },
2323
- async listRevisions(c, m) {
2384
+ async listRevisions(d, m) {
2324
2385
  return s(
2325
2386
  "GET",
2326
- `${l(c)}/revisions${m ? `?path=${n(m)}` : ""}`
2387
+ `${l(d)}/revisions${m ? `?path=${n(m)}` : ""}`
2327
2388
  );
2328
2389
  },
2329
- async readRevision(c, m, b) {
2390
+ async readRevision(d, m, b) {
2330
2391
  return s(
2331
2392
  "GET",
2332
- `${l(c)}/revisions/${n(m)}${b ? `?path=${n(b)}` : ""}`,
2393
+ `${l(d)}/revisions/${n(m)}${b ? `?path=${n(b)}` : ""}`,
2333
2394
  void 0,
2334
2395
  "text"
2335
2396
  );
2336
2397
  },
2337
- async rollback(c, m, b) {
2398
+ async rollback(d, m, b) {
2338
2399
  await s(
2339
2400
  "POST",
2340
- `${l(c)}/revisions/${n(m)}/rollback${b ? `?path=${n(b)}` : ""}`
2401
+ `${l(d)}/revisions/${n(m)}/rollback${b ? `?path=${n(b)}` : ""}`
2341
2402
  );
2342
2403
  },
2343
2404
  ...e.serverValidation ? {
2344
- async validate(c, m) {
2345
- return s("POST", `${l(c)}/validate`, {
2405
+ async validate(d, m) {
2406
+ return s("POST", `${l(d)}/validate`, {
2346
2407
  files: y(m)
2347
2408
  });
2348
2409
  }
@@ -2433,9 +2494,9 @@ function oi(e = {}) {
2433
2494
  const r = (l = be(s)) == null ? void 0 : l.value.packageName;
2434
2495
  return typeof r == "string" && r ? r : void 0;
2435
2496
  },
2436
- validateModule: (s) => Rt(s),
2497
+ validateModule: (s) => Pt(s),
2437
2498
  generateModule: async (s, { existingIds: r }) => {
2438
- const l = await Et(
2499
+ const l = await xt(
2439
2500
  {
2440
2501
  ...It(s),
2441
2502
  iconConfig: e.iconConfig,
@@ -2455,15 +2516,15 @@ function oi(e = {}) {
2455
2516
  duplicateModule: (s, r) => Ot(s, r),
2456
2517
  newFile: (s, { files: r }) => {
2457
2518
  var C;
2458
- const l = ti(r), y = ((C = be(r)) == null ? void 0 : C.value) ?? {}, c = `${String(y.packageName ?? l)}.Core`, b = {
2459
- entities: ["entities.json", { moduleName: c, version: "1.0.0", entities: [] }],
2460
- views: ["views.json", { moduleName: c, version: "1.0.0", views: [] }],
2461
- workflows: ["workflows.json", { moduleName: c, version: "1.0.0", workflows: [] }],
2519
+ const l = ti(r), y = ((C = be(r)) == null ? void 0 : C.value) ?? {}, d = `${String(y.packageName ?? l)}.Core`, b = {
2520
+ entities: ["entities.json", { moduleName: d, version: "1.0.0", entities: [] }],
2521
+ views: ["views.json", { moduleName: d, version: "1.0.0", views: [] }],
2522
+ workflows: ["workflows.json", { moduleName: d, version: "1.0.0", workflows: [] }],
2462
2523
  permissions: [
2463
2524
  "permissions.json",
2464
- { moduleName: c, version: "1.0.0", permissions: [], permissionGroups: [] }
2525
+ { moduleName: d, version: "1.0.0", permissions: [], permissionGroups: [] }
2465
2526
  ],
2466
- seeds: ["seeds.json", { moduleName: c, version: "1.0.0", seeds: {} }]
2527
+ seeds: ["seeds.json", { moduleName: d, version: "1.0.0", seeds: {} }]
2467
2528
  }[s];
2468
2529
  return b ? { path: `${l}.${b[0]}`, text: de(b[1]) } : void 0;
2469
2530
  },
@@ -2501,8 +2562,8 @@ function ai(e = {}) {
2501
2562
  for (const l of t.keys()) {
2502
2563
  if (!l.startsWith(s))
2503
2564
  continue;
2504
- const y = l.slice(s.length), c = y.indexOf("/");
2505
- r.set(c < 0 ? y : y.slice(0, c), c < 0 ? "file" : "directory");
2565
+ const y = l.slice(s.length), d = y.indexOf("/");
2566
+ r.set(d < 0 ? y : y.slice(0, d), d < 0 ? "file" : "directory");
2506
2567
  }
2507
2568
  return [...r].map(([l, y]) => ({ name: l, kind: y }));
2508
2569
  },
@@ -2545,9 +2606,9 @@ function ci(e) {
2545
2606
  const i = new TextDecoder("utf-8", { ignoreBOM: !0 });
2546
2607
  async function t(r, l = !1) {
2547
2608
  let y = e;
2548
- for (const c of r.split("/").filter(Boolean))
2609
+ for (const d of r.split("/").filter(Boolean))
2549
2610
  try {
2550
- y = await y.getDirectoryHandle(c, { create: l });
2611
+ y = await y.getDirectoryHandle(d, { create: l });
2551
2612
  } catch (m) {
2552
2613
  if (re(m))
2553
2614
  return null;
@@ -2560,11 +2621,11 @@ function ci(e) {
2560
2621
  return l < 0 ? ["", r] : [r.slice(0, l), r.slice(l + 1)];
2561
2622
  };
2562
2623
  async function n(r, l = !1) {
2563
- const [y, c] = o(r), m = await t(y, l);
2624
+ const [y, d] = o(r), m = await t(y, l);
2564
2625
  if (!m)
2565
2626
  return null;
2566
2627
  try {
2567
- return await m.getFileHandle(c, { create: l });
2628
+ return await m.getFileHandle(d, { create: l });
2568
2629
  } catch (b) {
2569
2630
  if (re(b))
2570
2631
  return null;
@@ -2576,8 +2637,8 @@ function ci(e) {
2576
2637
  async list(r) {
2577
2638
  const l = await t(r), y = [];
2578
2639
  if (l)
2579
- for await (const c of l.values())
2580
- y.push({ name: c.name, kind: c.kind });
2640
+ for await (const d of l.values())
2641
+ y.push({ name: d.name, kind: d.kind });
2581
2642
  return y;
2582
2643
  },
2583
2644
  async read(r) {
@@ -2591,22 +2652,22 @@ function ci(e) {
2591
2652
  const y = await n(r, !0);
2592
2653
  if (!y)
2593
2654
  throw new Error(`Cannot write ${r}`);
2594
- const c = await y.createWritable();
2595
- return await c.write(l), await c.close(), s(await y.getFile());
2655
+ const d = await y.createWritable();
2656
+ return await d.write(l), await d.close(), s(await y.getFile());
2596
2657
  },
2597
2658
  async remove(r) {
2598
- const [l, y] = o(r), c = await t(l);
2659
+ const [l, y] = o(r), d = await t(l);
2599
2660
  try {
2600
- await (c == null ? void 0 : c.removeEntry(y));
2661
+ await (d == null ? void 0 : d.removeEntry(y));
2601
2662
  } catch (m) {
2602
2663
  if (!re(m))
2603
2664
  throw m;
2604
2665
  }
2605
2666
  },
2606
2667
  async removeDir(r) {
2607
- const [l, y] = o(r), c = await t(l);
2668
+ const [l, y] = o(r), d = await t(l);
2608
2669
  try {
2609
- await (c == null ? void 0 : c.removeEntry(y, { recursive: !0 }));
2670
+ await (d == null ? void 0 : d.removeEntry(y, { recursive: !0 }));
2610
2671
  } catch (m) {
2611
2672
  if (!re(m))
2612
2673
  throw m;
@@ -2617,10 +2678,10 @@ function ci(e) {
2617
2678
  export {
2618
2679
  W as OMNIVERK_CUSTOM_PREFIX,
2619
2680
  vt as OMNIVERK_DATA_TYPES,
2620
- Pt as OMNIVERK_LEGACY_LIST_VIEW_FILES,
2681
+ Ft as OMNIVERK_LEGACY_LIST_VIEW_FILES,
2621
2682
  ei as OMNIVERK_LOCALES,
2622
2683
  ye as OmniVerkRestError,
2623
- Et as buildOmniVerkModule,
2684
+ xt as buildOmniVerkModule,
2624
2685
  ci as createDirectoryHandleFileSystem,
2625
2686
  ai as createMemorySeedFileSystem,
2626
2687
  si as createOmniVerkRestProvider,
@@ -2634,17 +2695,17 @@ export {
2634
2695
  Qe as omniverkI18nKind,
2635
2696
  He as omniverkManifestKind,
2636
2697
  ht as omniverkManifestSections,
2637
- R as omniverkPascalIdentifier,
2698
+ P as omniverkPascalIdentifier,
2638
2699
  mt as omniverkPermissionsKind,
2639
- ue as omniverkRevisionStamp,
2640
- ut as omniverkScriptKind,
2641
- ft as omniverkSeedsKind,
2700
+ fe as omniverkRevisionStamp,
2701
+ ft as omniverkScriptKind,
2702
+ ut as omniverkSeedsKind,
2642
2703
  It as omniverkSpecFromStudio,
2643
2704
  qe as omniverkStableId,
2644
2705
  Ve as omniverkTableName,
2645
2706
  Ie as omniverkTemplateFromDto,
2646
2707
  Vt as omniverkTemplateFromEntry,
2647
- Ee as omniverkTemplateToEntry,
2708
+ xe as omniverkTemplateToEntry,
2648
2709
  Ut as omniverkTemplateToInput,
2649
2710
  st as omniverkViewFromItem,
2650
2711
  nt as omniverkViewItem,
@@ -2653,6 +2714,6 @@ export {
2653
2714
  rt as omniverkWorkflowItem,
2654
2715
  ct as omniverkWorkflowsKind,
2655
2716
  li as pickSeedDirectory,
2656
- Rt as validateOmniVerkModule,
2657
- Kt as validateOmniVerkWorkspace
2717
+ Pt as validateOmniVerkModule,
2718
+ Rt as validateOmniVerkWorkspace
2658
2719
  };