@nice2dev/erp-adapter 1.4.12 → 1.4.14

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,5 +1,5 @@
1
- import { objectFileKind as Ee, endsWithAny as _, arrayFileKind as Fe, i18nFileKind as Ye, itemsFileKind as Pe, jsonFileKind as Re, scriptsFileKind as Xe, jsonValuesEqual as Ve, keepTextFormat as et, parseJsonText as z, patchJsonText as qe, stringifyJsonText as le } from "@nice2dev/ui-forms/studio";
2
- const U = (e) => typeof e == "object" && e !== null && !Array.isArray(e), J = (e) => typeof e == "string" && e ? e : void 0, W = (e) => Object.fromEntries(Object.entries(e).filter(([, i]) => i !== void 0)), tt = Ee({
1
+ import { objectFileKind as Te, endsWithAny as _, arrayFileKind as Pe, i18nFileKind as Xe, itemsFileKind as Fe, jsonFileKind as Re, scriptsFileKind as et, jsonValuesEqual as Ve, keepTextFormat as tt, parseJsonText as z, patchJsonText as qe, stringifyJsonText as le, studioDependencies as it } from "@nice2dev/ui-forms/studio";
2
+ const U = (e) => typeof e == "object" && e !== null && !Array.isArray(e), J = (e) => typeof e == "string" && e ? e : void 0, W = (e) => Object.fromEntries(Object.entries(e).filter(([, i]) => i !== void 0)), nt = Te({
3
3
  id: "manifest",
4
4
  label: "Manifest",
5
5
  labelKey: "devStudio.kind.manifest",
@@ -10,7 +10,7 @@ const U = (e) => typeof e == "object" && e !== null && !Array.isArray(e), J = (e
10
10
  ["dataType", "type"],
11
11
  ["isRequired", "required"]
12
12
  ], ue = "$aliases";
13
- function it(e) {
13
+ function st(e) {
14
14
  if (!U(e))
15
15
  return e;
16
16
  const i = Ue.filter(([o, n]) => !(o in e) && n in e);
@@ -18,25 +18,25 @@ function it(e) {
18
18
  return e;
19
19
  const t = {};
20
20
  for (const [o, n] of Object.entries(e)) {
21
- const s = i.find(([, a]) => a === o);
21
+ const s = i.find(([, r]) => r === o);
22
22
  t[s ? s[0] : o] = n;
23
23
  }
24
24
  return t[ue] = i.map(([, o]) => o), t;
25
25
  }
26
- function nt(e) {
26
+ function ot(e) {
27
27
  if (!U(e) || !Array.isArray(e[ue]))
28
28
  return e;
29
29
  const i = e[ue], t = {};
30
30
  for (const [o, n] of Object.entries(e)) {
31
31
  if (o === ue)
32
32
  continue;
33
- const s = Ue.find(([a, l]) => a === o && i.includes(l));
33
+ const s = Ue.find(([r, a]) => r === o && i.includes(a));
34
34
  t[s ? s[1] : o] = n;
35
35
  }
36
36
  return t;
37
37
  }
38
- const xe = (e, i) => U(e) && Array.isArray(e.fields) ? { ...e, fields: e.fields.map(i) } : e, st = (() => {
39
- const e = Fe({
38
+ const Oe = (e, i) => U(e) && Array.isArray(e.fields) ? { ...e, fields: e.fields.map(i) } : e, at = (() => {
39
+ const e = Pe({
40
40
  id: "entities",
41
41
  label: "Entities",
42
42
  labelKey: "devStudio.kind.entities",
@@ -48,14 +48,14 @@ const xe = (e, i) => U(e) && Array.isArray(e.fields) ? { ...e, fields: e.fields.
48
48
  });
49
49
  return {
50
50
  ...e,
51
- decode: (i, t) => e.decode(i, t).map((o) => xe(o, it)),
51
+ decode: (i, t) => e.decode(i, t).map((o) => Oe(o, st)),
52
52
  encode: (i, t, o) => e.encode(
53
- i.map((n) => xe(n, nt)),
53
+ i.map((n) => Oe(n, ot)),
54
54
  t,
55
55
  o
56
56
  )
57
57
  };
58
- })(), ot = Ye(), $e = {
58
+ })(), rt = Xe(), ke = {
59
59
  input: "textInput",
60
60
  text: "textInput",
61
61
  textarea: "textArea",
@@ -68,7 +68,7 @@ const xe = (e, i) => U(e) && Array.isArray(e.fields) ? { ...e, fields: e.fields.
68
68
  lookup: "select",
69
69
  select: "select"
70
70
  };
71
- function at(e) {
71
+ function lt(e) {
72
72
  const i = e.columns.map((t) => ({
73
73
  field: String(t.field ?? ""),
74
74
  header: String(t.displayName ?? t.header ?? t.label ?? t.field ?? "")
@@ -97,22 +97,22 @@ function at(e) {
97
97
  };
98
98
  }
99
99
  function We(e, i) {
100
- var l, y, p;
101
- const t = (e.rows ?? []).flatMap((u) => u.cells).find((u) => u.controlType === "dataGrid"), o = ((l = t == null ? void 0 : t.props) == null ? void 0 : l.columns) ?? [], n = i.columns ?? [], s = (p = (y = e.dataSources) == null ? void 0 : y.find((u) => u.type === "entity")) == null ? void 0 : p.entity, a = (u) => "displayName" in u ? "displayName" : "header" in u ? "header" : "label" in u ? "label" : "displayName";
100
+ var a, u, p;
101
+ const t = (e.rows ?? []).flatMap((m) => m.cells).find((m) => m.controlType === "dataGrid"), o = ((a = t == null ? void 0 : t.props) == null ? void 0 : a.columns) ?? [], n = i.columns ?? [], s = (p = (u = e.dataSources) == null ? void 0 : u.find((m) => m.type === "entity")) == null ? void 0 : p.entity, r = (m) => "displayName" in m ? "displayName" : "header" in m ? "header" : "label" in m ? "label" : "displayName";
102
102
  return W({
103
103
  ...i,
104
104
  displayName: "displayName" in i || e.name !== i.name ? e.name : void 0,
105
105
  entityName: s ?? i.entityName,
106
- columns: o.map((u) => {
107
- const N = n.find((x) => x.field === u.field);
106
+ columns: o.map((m) => {
107
+ const N = n.find((O) => O.field === m.field);
108
108
  if (!N)
109
- return { field: u.field, displayName: u.header ?? u.field };
110
- const L = a(N), I = u.header ?? u.field;
111
- return N[L] === void 0 && I === u.field ? N : { ...N, [L]: I };
109
+ return { field: m.field, displayName: m.header ?? m.field };
110
+ const L = r(N), I = m.header ?? m.field;
111
+ return N[L] === void 0 && I === m.field ? N : { ...N, [L]: I };
112
112
  })
113
113
  });
114
114
  }
115
- function rt(e) {
115
+ function ct(e) {
116
116
  const i = [];
117
117
  return e.tabs.forEach((o, n) => {
118
118
  i.push({
@@ -125,12 +125,12 @@ function rt(e) {
125
125
  props: { text: String(o.displayName ?? o.name ?? ""), level: 2, name: o.name }
126
126
  }
127
127
  ]
128
- }), (o.sections ?? []).forEach((s, a) => {
128
+ }), (o.sections ?? []).forEach((s, r) => {
129
129
  i.push({
130
- id: `tab-${n}-section-${a}`,
130
+ id: `tab-${n}-section-${r}`,
131
131
  cells: [
132
132
  {
133
- id: `tab-${n}-section-${a}`,
133
+ id: `tab-${n}-section-${r}`,
134
134
  controlType: "heading",
135
135
  colSpan: 12,
136
136
  props: {
@@ -141,24 +141,24 @@ function rt(e) {
141
141
  }
142
142
  ]
143
143
  });
144
- let l = [], y = 0;
144
+ let a = [], u = 0;
145
145
  const p = () => {
146
- l.length && (i.push({ id: `tab-${n}-section-${a}-row-${i.length}`, cells: l }), l = [], y = 0);
146
+ a.length && (i.push({ id: `tab-${n}-section-${r}-row-${i.length}`, cells: a }), a = [], u = 0);
147
147
  };
148
- (s.controls ?? []).forEach((u, N) => {
149
- const L = typeof u.colSpan == "number" ? u.colSpan : 6;
150
- y + L > 12 && p(), l.push({
151
- id: `c-${n}-${a}-${N}`,
152
- controlType: $e[String(u.type)] ?? "textInput",
148
+ (s.controls ?? []).forEach((m, N) => {
149
+ const L = typeof m.colSpan == "number" ? m.colSpan : 6;
150
+ u + L > 12 && p(), a.push({
151
+ id: `c-${n}-${r}-${N}`,
152
+ controlType: ke[String(m.type)] ?? "textInput",
153
153
  colSpan: L,
154
154
  props: {
155
- label: String(u.label ?? u.field ?? ""),
156
- required: u.required === !0,
157
- field: u.field,
158
- type: u.type
155
+ label: String(m.label ?? m.field ?? ""),
156
+ required: m.required === !0,
157
+ field: m.field,
158
+ type: m.type
159
159
  },
160
- bindings: { value: { source: "record", field: String(u.field ?? "") } }
161
- }), y += L;
160
+ bindings: { value: { source: "record", field: String(m.field ?? "") } }
161
+ }), u += L;
162
162
  }), p();
163
163
  });
164
164
  }), {
@@ -172,56 +172,56 @@ function rt(e) {
172
172
  };
173
173
  }
174
174
  function Ge(e, i) {
175
- var p, u, N, L, I;
175
+ var p, m, N, L, I;
176
176
  const t = i.tabs ?? [], o = t.flatMap(
177
- (x) => (x.sections ?? []).flatMap((O) => O.controls ?? [])
177
+ (O) => (O.sections ?? []).flatMap((x) => x.controls ?? [])
178
178
  ), n = [];
179
- let s = null, a = null;
180
- const l = () => (s || (s = { name: "Main", displayName: e.name, sections: [] }, n.push(s)), a || (a = { name: "Details", displayName: "Details", controls: [] }, s.sections.push(a)), a);
181
- for (const x of e.rows ?? [])
182
- for (const O of x.cells) {
183
- const w = O.props ?? {};
184
- if (O.controlType === "heading" && (w.level === 2 || w.level === 3)) {
185
- const E = J(w.name) ?? String(w.text ?? "").replace(/\s+/g, "");
179
+ let s = null, r = null;
180
+ const a = () => (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 O of e.rows ?? [])
182
+ for (const x of O.cells) {
183
+ const w = x.props ?? {};
184
+ if (x.controlType === "heading" && (w.level === 2 || w.level === 3)) {
185
+ const T = J(w.name) ?? String(w.text ?? "").replace(/\s+/g, "");
186
186
  if (w.level === 2)
187
- s = { ...t.find((h) => h.name === E) ?? {}, name: E, displayName: String(w.text ?? E), sections: [] }, n.push(s), a = null;
187
+ s = { ...t.find((h) => h.name === T) ?? {}, name: T, displayName: String(w.text ?? T), sections: [] }, n.push(s), r = null;
188
188
  else {
189
189
  s || (s = { name: "Main", displayName: e.name, sections: [] }, n.push(s));
190
- const C = t.flatMap((S) => S.sections ?? []).find((S) => S.name === E);
191
- a = { ...C ? Object.fromEntries(Object.entries(C).filter(([S]) => S !== "controls")) : {}, name: E, displayName: String(w.text ?? E), controls: [] }, s.sections.push(a);
190
+ const C = t.flatMap((k) => k.sections ?? []).find((k) => k.name === T);
191
+ r = { ...C ? Object.fromEntries(Object.entries(C).filter(([k]) => k !== "controls")) : {}, name: T, displayName: String(w.text ?? T), controls: [] }, s.sections.push(r);
192
192
  }
193
193
  continue;
194
194
  }
195
- const T = ((u = (p = O.bindings) == null ? void 0 : p.value) == null ? void 0 : u.field) ?? J(w.field);
196
- if (!T)
195
+ const E = ((m = (p = x.bindings) == null ? void 0 : p.value) == null ? void 0 : m.field) ?? J(w.field);
196
+ if (!E)
197
197
  continue;
198
- const m = o.find((E) => E.field === T), b = m && $e[String(m.type)] === O.controlType ? m.type : ((N = Object.entries($e).find(([, E]) => E === O.controlType)) == null ? void 0 : N[0]) ?? "input", g = W({
199
- ...m ?? {},
200
- field: T,
198
+ const f = o.find((T) => T.field === E), b = f && ke[String(f.type)] === x.controlType ? f.type : ((N = Object.entries(ke).find(([, T]) => T === x.controlType)) == null ? void 0 : N[0]) ?? "input", g = W({
199
+ ...f ?? {},
200
+ field: E,
201
201
  type: b,
202
- label: w.label !== void 0 ? String(w.label) : m == null ? void 0 : m.label,
203
- colSpan: (m == null ? void 0 : m.colSpan) !== void 0 || O.colSpan !== 6 ? O.colSpan : void 0,
204
- required: w.required === !0 ? !0 : (m == null ? void 0 : m.required) === !0 ? !1 : m == null ? void 0 : m.required
202
+ label: w.label !== void 0 ? String(w.label) : f == null ? void 0 : f.label,
203
+ colSpan: (f == null ? void 0 : f.colSpan) !== void 0 || x.colSpan !== 6 ? x.colSpan : void 0,
204
+ required: w.required === !0 ? !0 : (f == null ? void 0 : f.required) === !0 ? !1 : f == null ? void 0 : f.required
205
205
  });
206
- l().controls.push(g);
206
+ a().controls.push(g);
207
207
  }
208
- const y = n.map((x) => {
209
- const O = t.find((w) => w.name === x.name);
210
- return O ? { ...O, ...x } : x;
208
+ const u = n.map((O) => {
209
+ const x = t.find((w) => w.name === O.name);
210
+ return x ? { ...x, ...O } : O;
211
211
  });
212
212
  return W({
213
213
  ...i,
214
214
  displayName: "displayName" in i || e.name !== i.name ? e.name : void 0,
215
- entityName: ((I = (L = e.dataSources) == null ? void 0 : L.find((x) => x.type === "entity")) == null ? void 0 : I.entity) ?? i.entityName,
216
- tabs: y
215
+ entityName: ((I = (L = e.dataSources) == null ? void 0 : L.find((O) => O.type === "entity")) == null ? void 0 : I.entity) ?? i.entityName,
216
+ tabs: u
217
217
  });
218
218
  }
219
- const lt = (e) => {
219
+ const dt = (e) => {
220
220
  const i = String(e.type ?? "").toLowerCase();
221
221
  return i === "list" && typeof e.entityName == "string" && Array.isArray(e.columns) && e.columns.length > 0 ? "List" : i === "form" && typeof e.entityName == "string" && Array.isArray(e.tabs) ? "Form" : null;
222
222
  };
223
- function ct(e, i) {
224
- const t = U(e) ? e : {}, o = J(t.name) ?? J(t.id) ?? `#${i}`, n = J(t.displayName) ?? o, s = lt(t);
223
+ function pt(e, i) {
224
+ const t = U(e) ? e : {}, o = J(t.name) ?? J(t.id) ?? `#${i}`, n = J(t.displayName) ?? o, s = dt(t);
225
225
  if (!s)
226
226
  return {
227
227
  key: o,
@@ -229,10 +229,10 @@ function ct(e, i) {
229
229
  source: e,
230
230
  rawReason: String(t.type ?? (t.viewJson ? "viewJson" : "unknown"))
231
231
  };
232
- const a = s === "List" ? at(t) : rt(t), l = s === "List" ? We(a, t) : Ge(a, t);
233
- return Ve(l, e) ? { key: o, label: n, definition: a, source: e } : { key: o, label: n, source: e, rawReason: `${s} (round-trip)` };
232
+ const r = s === "List" ? lt(t) : ct(t), a = s === "List" ? We(r, t) : Ge(r, t);
233
+ return Ve(a, e) ? { key: o, label: n, definition: r, source: e } : { key: o, label: n, source: e, rawReason: `${s} (round-trip)` };
234
234
  }
235
- function dt(e) {
235
+ function ut(e) {
236
236
  if (!e.definition)
237
237
  return e.source;
238
238
  const i = U(e.source) ? e.source : { name: e.definition.id };
@@ -246,7 +246,7 @@ function dt(e) {
246
246
  name: i.name ?? e.definition.id
247
247
  });
248
248
  }
249
- const pt = Pe({
249
+ const mt = Fe({
250
250
  id: "views",
251
251
  label: "Views",
252
252
  labelKey: "devStudio.kind.views",
@@ -255,10 +255,10 @@ const pt = Pe({
255
255
  match: _(".views.json"),
256
256
  property: "views",
257
257
  itemKey: "name",
258
- toItem: ct,
259
- fromItem: dt
258
+ toItem: pt,
259
+ fromItem: ut
260
260
  });
261
- function ut(e) {
261
+ function ft(e) {
262
262
  const i = e.steps ?? [], t = e.connections ?? [];
263
263
  return {
264
264
  id: String(e.name),
@@ -287,34 +287,34 @@ function Je(e, i) {
287
287
  displayName: "displayName" in i || e.name !== i.name ? e.name : void 0,
288
288
  entityName: e.entityType || i.entityName,
289
289
  steps: e.states.map((n) => {
290
- const s = t.find((l) => l.state === n.id), a = s ?? { state: n.id };
290
+ const s = t.find((a) => a.state === n.id), r = s ?? { state: n.id };
291
291
  return W({
292
- ...a,
292
+ ...r,
293
293
  displayName: s && "displayName" in s || n.name !== n.id ? n.name : void 0,
294
294
  isInitial: n.type === "initial" ? !0 : (s == null ? void 0 : s.isInitial) === !0 || s == null ? void 0 : s.isInitial,
295
295
  isFinal: n.type === "final" ? !0 : (s == null ? void 0 : s.isFinal) === !0 || s == null ? void 0 : s.isFinal
296
296
  });
297
297
  }),
298
298
  connections: e.transitions.map((n) => {
299
- const s = /^t(\d+)$/.exec(n.id), a = s ? o[Number(s[1])] : o.find((l) => l.fromState === n.fromStateId && l.toState === n.toStateId);
299
+ const s = /^t(\d+)$/.exec(n.id), r = s ? o[Number(s[1])] : o.find((a) => a.fromState === n.fromStateId && a.toState === n.toStateId);
300
300
  return W({
301
- ...a ?? {},
301
+ ...r ?? {},
302
302
  fromState: n.fromStateId,
303
303
  toState: n.toStateId,
304
- actionName: n.name || (a == null ? void 0 : a.actionName),
304
+ actionName: n.name || (r == null ? void 0 : r.actionName),
305
305
  requiredPermission: n.requiredPermission
306
306
  });
307
307
  })
308
308
  });
309
309
  }
310
- function mt(e, i) {
310
+ function yt(e, i) {
311
311
  const t = U(e) ? e : {}, o = J(t.name) ?? `#${i}`, n = J(t.displayName) ?? o, s = t.steps;
312
- if (!(Array.isArray(t.connections) && Array.isArray(s) && s.every((y) => U(y) && typeof y.state == "string")))
312
+ if (!(Array.isArray(t.connections) && Array.isArray(s) && s.every((u) => U(u) && typeof u.state == "string")))
313
313
  return { key: o, label: n, source: e, rawReason: J(t.triggerType) ?? "automation" };
314
- const l = ut(t);
315
- return Ve(Je(l, t), e) ? { key: o, label: n, definition: l, source: e } : { key: o, label: n, source: e, rawReason: "state machine (round-trip)" };
314
+ const a = ft(t);
315
+ return Ve(Je(a, t), e) ? { key: o, label: n, definition: a, source: e } : { key: o, label: n, source: e, rawReason: "state machine (round-trip)" };
316
316
  }
317
- function ft(e) {
317
+ function gt(e) {
318
318
  if (!e.definition)
319
319
  return e.source;
320
320
  const i = U(e.source) ? e.source : { name: e.definition.id };
@@ -323,7 +323,7 @@ function ft(e) {
323
323
  name: i.name ?? e.definition.id
324
324
  });
325
325
  }
326
- const yt = Pe({
326
+ const ht = Fe({
327
327
  id: "workflows",
328
328
  label: "Workflows",
329
329
  labelKey: "devStudio.kind.workflows",
@@ -332,10 +332,10 @@ const yt = Pe({
332
332
  match: _(".workflows.json"),
333
333
  property: "workflows",
334
334
  itemKey: "name",
335
- toItem: mt,
336
- fromItem: ft
335
+ toItem: yt,
336
+ fromItem: gt
337
337
  });
338
- function gt(e) {
338
+ function wt(e) {
339
339
  const i = U(e) ? e : {};
340
340
  return {
341
341
  permissions: (i.permissions ?? []).map(
@@ -355,18 +355,18 @@ function gt(e) {
355
355
  )
356
356
  };
357
357
  }
358
- function ht(e, i) {
358
+ function vt(e, i) {
359
359
  const t = U(e) ? e : {}, o = t.permissions ?? [], n = t.permissionGroups ?? [];
360
360
  return {
361
361
  ...t,
362
362
  permissions: i.permissions.map((s) => {
363
- const a = o.find((l) => l.code === s.code);
364
- return W({ ...a ?? {}, code: s.code, name: s.name, description: s.description });
363
+ const r = o.find((a) => a.code === s.code);
364
+ return W({ ...r ?? {}, code: s.code, name: s.name, description: s.description });
365
365
  }),
366
366
  permissionGroups: i.groups.map((s) => {
367
- const a = n.find((l) => l.name === s.id);
367
+ const r = n.find((a) => a.name === s.id);
368
368
  return W({
369
- ...a ?? {},
369
+ ...r ?? {},
370
370
  name: s.label,
371
371
  description: s.description,
372
372
  permissions: s.permissions
@@ -374,17 +374,17 @@ function ht(e, i) {
374
374
  })
375
375
  };
376
376
  }
377
- const wt = Re({
377
+ const bt = Re({
378
378
  id: "permissions",
379
379
  label: "Permissions",
380
380
  labelKey: "devStudio.kind.permissions",
381
381
  icon: "shield",
382
382
  editor: "permissions",
383
383
  match: _(".permissions.json"),
384
- select: gt,
385
- assign: ht,
384
+ select: wt,
385
+ assign: vt,
386
386
  arrayKey: (e) => e === "/permissions" ? "code" : e === "/permissionGroups" ? "name" : void 0
387
- }), vt = Re({
387
+ }), $t = Re({
388
388
  id: "seeds",
389
389
  label: "Seed data",
390
390
  labelKey: "devStudio.kind.seeds",
@@ -399,7 +399,7 @@ const wt = Re({
399
399
  },
400
400
  assign: (e, i) => W({ ...U(e) ? e : {}, seeds: i.seeds, demoSeeds: i.demoSeeds }),
401
401
  arrayKey: () => "Id"
402
- }), bt = {
402
+ }), kt = {
403
403
  id: "script",
404
404
  label: "Script",
405
405
  labelKey: "devStudio.kind.script",
@@ -408,13 +408,13 @@ const wt = Re({
408
408
  match: (e) => /(^|\/)(services|scripts|jobs|handlers)\/[^/]+\.(js|ts|cs)$/i.test(e) || /\.cs$/i.test(e),
409
409
  decode: (e) => e[0].text,
410
410
  encode: (e, i) => ({
411
- files: [{ path: i[0].path, text: et(e, i[0].text) }]
411
+ files: [{ path: i[0].path, text: tt(e, i[0].text) }]
412
412
  })
413
- }, $t = Xe({
413
+ }, St = et({
414
414
  match: _(".scripts.json"),
415
415
  property: "scripts",
416
416
  phasesProperty: "scripts"
417
- }), St = Fe({
417
+ }), Nt = Pe({
418
418
  id: "dataSources",
419
419
  label: "Data sources",
420
420
  labelKey: "devStudio.kind.dataSources",
@@ -423,34 +423,34 @@ const wt = Re({
423
423
  match: _(".datasources.json"),
424
424
  property: "dataSources",
425
425
  itemKey: "key"
426
- }), kt = Ee({
426
+ }), jt = Te({
427
427
  id: "integrations",
428
428
  label: "Integrations",
429
429
  labelKey: "devStudio.kind.integrations",
430
430
  icon: "plug",
431
431
  editor: "integrations",
432
432
  match: _(".integrations.json")
433
- }), Nt = Ee({
433
+ }), Et = Te({
434
434
  id: "environments",
435
435
  label: "Environment sets",
436
436
  labelKey: "devStudio.kind.environments",
437
437
  icon: "globe",
438
438
  editor: "environments",
439
439
  match: _(".environments.json")
440
- }), jt = [
441
- tt,
442
- st,
443
- ot,
444
- pt,
445
- yt,
446
- wt,
447
- vt,
448
- St,
449
- $t,
440
+ }), Tt = [
441
+ nt,
442
+ at,
443
+ rt,
444
+ mt,
445
+ ht,
450
446
  bt,
447
+ $t,
448
+ Nt,
449
+ St,
451
450
  kt,
452
- Nt
453
- ], G = "Custom.", Oe = "Core", Tt = {
451
+ jt,
452
+ Et
453
+ ], G = "Custom.", xe = "Core", It = {
454
454
  string: "string",
455
455
  varchar: "string",
456
456
  nvarchar: "string",
@@ -480,7 +480,7 @@ const wt = Re({
480
480
  enum: "enum",
481
481
  guid: "Guid",
482
482
  uuid: "Guid"
483
- }, Et = [
483
+ }, Ot = [
484
484
  "string",
485
485
  "text",
486
486
  "int",
@@ -494,7 +494,7 @@ const wt = Re({
494
494
  "json",
495
495
  "enum",
496
496
  "Guid"
497
- ], It = {
497
+ ], xt = {
498
498
  ł: "l",
499
499
  Ł: "L",
500
500
  ß: "ss",
@@ -503,11 +503,11 @@ const wt = Re({
503
503
  ø: "o",
504
504
  Ø: "O"
505
505
  };
506
- function xt(e) {
507
- return [...e.normalize("NFD")].map((i) => It[i] ?? (new RegExp("\\p{Mn}", "u").test(i) ? "" : i)).join("").normalize("NFC");
506
+ function Ct(e) {
507
+ return [...e.normalize("NFD")].map((i) => xt[i] ?? (new RegExp("\\p{Mn}", "u").test(i) ? "" : i)).join("").normalize("NFC");
508
508
  }
509
- function P(e) {
510
- const i = xt(e ?? "").split(/[^A-Za-z0-9]+/).filter(Boolean).map((t) => t[0].toUpperCase() + t.slice(1)).join("");
509
+ function F(e) {
510
+ const i = Ct(e ?? "").split(/[^A-Za-z0-9]+/).filter(Boolean).map((t) => t[0].toUpperCase() + t.slice(1)).join("");
511
511
  return /^[0-9]/.test(i) ? `M${i}` : i;
512
512
  }
513
513
  const Ce = (e) => e !== e.toLowerCase() && e === e.toUpperCase();
@@ -516,7 +516,7 @@ function Se(e) {
516
516
  (i, t) => t > 0 && Ce(i) && !Ce(e[t - 1]) ? `_${i.toLowerCase()}` : i.toLowerCase()
517
517
  ).join("");
518
518
  }
519
- function Ot(e) {
519
+ function At(e) {
520
520
  return (e.startsWith(G) ? e.slice(G.length) : e.split(".").pop() ?? e).toLowerCase().replace(/[^a-z0-9_-]+/g, "") || "module";
521
521
  }
522
522
  async function _e(e) {
@@ -532,7 +532,7 @@ async function Be(e, i) {
532
532
  const t = `custom_${e}_${Se(i)}`;
533
533
  return t.length <= 63 ? t : `${t.slice(0, 54)}_${Ie(await _e(t)).slice(0, 8)}`;
534
534
  }
535
- function Ct(e, i) {
535
+ function Lt(e, i) {
536
536
  const t = new Set([...i].map((o) => o.toLowerCase()));
537
537
  for (let o = 1; o < 100; o++) {
538
538
  const n = o === 1 ? e : `${e}${o}`;
@@ -546,9 +546,9 @@ const oe = (e) => e.name.toLowerCase() === "id", q = (e) => {
546
546
  return (((i = e.displayName) == null ? void 0 : i.trim()) || e.name).trim();
547
547
  };
548
548
  function ae(e) {
549
- return e.isForeignKey ? "Guid" : Tt[String(e.dataType ?? "").trim().toLowerCase()] ?? "string";
549
+ return e.isForeignKey ? "Guid" : It[String(e.dataType ?? "").trim().toLowerCase()] ?? "string";
550
550
  }
551
- function ye(e) {
551
+ function ge(e) {
552
552
  if (e.isForeignKey)
553
553
  return ["Reference", "lookup"];
554
554
  switch (ae(e)) {
@@ -571,7 +571,7 @@ function ye(e) {
571
571
  return ["Text", "input"];
572
572
  }
573
573
  }
574
- const At = {
574
+ const Mt = {
575
575
  lookup: "EntitySelect",
576
576
  textarea: "Textarea",
577
577
  number: "number",
@@ -580,32 +580,32 @@ const At = {
580
580
  date: "date",
581
581
  datetime: "datetime"
582
582
  };
583
- function Lt(e) {
583
+ function Dt(e) {
584
584
  var o;
585
585
  const i = [];
586
- (!((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.");
586
+ (!((o = e.name) != null && o.trim()) || F(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.");
587
587
  const t = /* @__PURE__ */ new Set();
588
588
  for (const n of e.entities) {
589
- const s = P(n.name);
589
+ const s = F(n.name);
590
590
  if (s.length === 0) {
591
591
  i.push(`Entity "${n.name}" needs a name with letters or digits.`);
592
592
  continue;
593
593
  }
594
594
  t.has(s.toLowerCase()) && i.push(`Entity ${s} appears twice.`), t.add(s.toLowerCase());
595
- const a = n.fields.filter((y) => !oe(y));
596
- a.length === 0 && i.push(`Entity ${s} has no fields — add at least one.`);
597
- const l = /* @__PURE__ */ new Set();
598
- for (const y of a) {
599
- const p = P(y.name);
600
- p.length === 0 ? i.push(`${s}: field "${y.name}" needs a name with letters or digits.`) : l.has(p.toLowerCase()) ? i.push(`${s}: field ${p} appears twice.`) : l.add(p.toLowerCase());
595
+ const r = n.fields.filter((u) => !oe(u));
596
+ r.length === 0 && i.push(`Entity ${s} has no fields — add at least one.`);
597
+ const a = /* @__PURE__ */ new Set();
598
+ for (const u of r) {
599
+ const p = F(u.name);
600
+ p.length === 0 ? i.push(`${s}: field "${u.name}" needs a name with letters or digits.`) : a.has(p.toLowerCase()) ? i.push(`${s}: field ${p} appears twice.`) : a.add(p.toLowerCase());
601
601
  }
602
602
  }
603
603
  return i;
604
604
  }
605
- const Mt = (e) => e.toISOString().replace(/\.(\d{3})Z$/, ".$10000Z"), ee = (e) => le(e, { finalNewline: !1 }), Z = (e, i) => ({
605
+ const Kt = (e) => e.toISOString().replace(/\.(\d{3})Z$/, ".$10000Z"), ee = (e) => le(e, { finalNewline: !1 }), Z = (e, i) => ({
606
606
  icon: { name: e, package: "@nice2dev/icons", style: i }
607
607
  });
608
- function Dt(e) {
608
+ function Pt(e) {
609
609
  const i = e && /^Ntd[A-Z]/.test(e), t = e && /^[A-Z]\w*Icon$/.test(e);
610
610
  return {
611
611
  module: {
@@ -628,100 +628,100 @@ function Dt(e) {
628
628
  workflowStates: {}
629
629
  };
630
630
  }
631
- async function Kt(e, i = {}) {
632
- var b, g, E, C;
633
- const t = Lt(e);
631
+ async function Ft(e, i = {}) {
632
+ var b, g, T, C;
633
+ const t = Dt(e);
634
634
  if (t.length > 0)
635
635
  return { problems: t };
636
- const o = e.name.toLowerCase().startsWith(G.toLowerCase()), n = P(
636
+ const o = e.name.toLowerCase().startsWith(G.toLowerCase()), n = F(
637
637
  o ? e.name.slice(G.length) : e.name
638
- ), s = Ct(
638
+ ), s = Lt(
639
639
  G + n,
640
640
  i.existingPackageNames ?? /* @__PURE__ */ new Set()
641
- ), a = s.slice(G.length), l = a.toLowerCase(), y = `${s}.${Oe}`, p = o ? a : e.name.trim(), u = ((b = e.description) == null ? void 0 : b.trim()) || void 0, N = e.entities.map((h) => ({ ...h, name: P(h.name) })), L = e.views !== !1, I = e.permissions !== !1, x = [.../* @__PURE__ */ new Set(["en", "pl", ...e.locales ?? []])], O = e.icon ?? "widgets", w = [], T = [
642
- `${l}.entities.json`,
643
- ...L ? [`${l}.views.json`] : [],
644
- ...I ? [`${l}.permissions.json`] : []
641
+ ), r = s.slice(G.length), a = r.toLowerCase(), u = `${s}.${xe}`, p = o ? r : e.name.trim(), m = ((b = e.description) == null ? void 0 : b.trim()) || void 0, N = e.entities.map((h) => ({ ...h, name: F(h.name) })), L = e.views !== !1, I = e.permissions !== !1, O = [.../* @__PURE__ */ new Set(["en", "pl", ...e.locales ?? []])], x = e.icon ?? "widgets", w = [], E = [
642
+ `${a}.entities.json`,
643
+ ...L ? [`${a}.views.json`] : [],
644
+ ...I ? [`${a}.permissions.json`] : []
645
645
  ];
646
646
  w.push({
647
- path: `${l}.manifest.json`,
647
+ path: `${a}.manifest.json`,
648
648
  text: ee({
649
649
  packageName: s,
650
650
  version: "1.0.0",
651
651
  displayName: p,
652
- description: u ?? p,
652
+ description: m ?? p,
653
653
  author: "OmniVerk Module Builder",
654
654
  license: "Proprietary",
655
655
  category: ((g = e.category) == null ? void 0 : g.trim()) || "Custom",
656
- icon: O,
657
- exportedAt: Mt((i.now ?? (() => /* @__PURE__ */ new Date()))()),
656
+ icon: x,
657
+ exportedAt: Kt((i.now ?? (() => /* @__PURE__ */ new Date()))()),
658
658
  modules: [
659
659
  {
660
- name: Oe,
660
+ name: xe,
661
661
  displayName: p,
662
662
  description: e.description ?? p,
663
- icon: O,
664
- parts: T
663
+ icon: x,
664
+ parts: E
665
665
  }
666
666
  ],
667
667
  dependencies: ["Core.Users"],
668
- i18n: x.map((h) => `${l}.${h}.i18n.json`),
668
+ i18n: O.map((h) => `${a}.${h}.i18n.json`),
669
669
  ...e.ownerTenantId ? { ownerTenantId: e.ownerTenantId } : {},
670
670
  ...e.sourceDefinitionId ? { sourceDefinitionId: e.sourceDefinitionId } : {}
671
671
  })
672
672
  });
673
- const m = [];
673
+ const f = [];
674
674
  for (const h of N) {
675
- const S = [{ name: "Id", displayName: "ID", dataType: "Guid", isPrimaryKey: !0 }];
675
+ const k = [{ name: "Id", displayName: "ID", dataType: "Guid", isPrimaryKey: !0 }];
676
676
  for (const d of h.fields.filter((j) => !oe(j))) {
677
- const j = ae(d), r = {
678
- name: P(d.name),
677
+ const j = ae(d), l = {
678
+ name: F(d.name),
679
679
  displayName: q(d),
680
680
  dataType: j
681
681
  };
682
- j === "string" && (r.maxLength = d.maxLength && d.maxLength > 0 ? d.maxLength : 200), d.isRequired && (r.isRequired = !0), d.isUnique && (r.isUnique = !0), (d.isIndexed || d.isForeignKey) && (r.isIndexed = !0), d.isForeignKey && (r.isForeignKey = !0, d.referencedEntity && (r.referencedEntity = P(d.referencedEntity))), (E = d.defaultValue) != null && E.trim() && (r.defaultValue = d.defaultValue), (C = d.description) != null && C.trim() && (r.description = d.description), S.push(r);
682
+ j === "string" && (l.maxLength = d.maxLength && d.maxLength > 0 ? d.maxLength : 200), d.isRequired && (l.isRequired = !0), d.isUnique && (l.isUnique = !0), (d.isIndexed || d.isForeignKey) && (l.isIndexed = !0), d.isForeignKey && (l.isForeignKey = !0, d.referencedEntity && (l.referencedEntity = F(d.referencedEntity))), (T = d.defaultValue) != null && T.trim() && (l.defaultValue = d.defaultValue), (C = d.description) != null && C.trim() && (l.description = d.description), k.push(l);
683
683
  }
684
- m.push({
684
+ f.push({
685
685
  id: await fe(s, h.name),
686
686
  name: h.name,
687
687
  displayName: q(h),
688
- tableName: await Be(l, h.name),
688
+ tableName: await Be(a, h.name),
689
689
  description: h.description ?? q(h),
690
690
  entityIcon: h.icon ?? "table_rows",
691
691
  isAudited: !0,
692
692
  isSoftDeleteEnabled: !1,
693
- fields: S
693
+ fields: k
694
694
  });
695
695
  }
696
696
  if (w.push({
697
- path: `${l}.entities.json`,
698
- text: ee({ moduleName: y, version: "1.0.0", entities: m })
697
+ path: `${a}.entities.json`,
698
+ text: ee({ moduleName: u, version: "1.0.0", entities: f })
699
699
  }), L) {
700
700
  const h = (d) => {
701
- const j = N.find((c) => c.name === P(d)), r = j == null ? void 0 : j.fields.find(
701
+ const j = N.find((c) => c.name === F(d)), l = j == null ? void 0 : j.fields.find(
702
702
  (c) => !oe(c) && !c.isForeignKey && ae(c) === "string"
703
703
  );
704
- return r ? P(r.name) : "Name";
705
- }, S = [];
704
+ return l ? F(l.name) : "Name";
705
+ }, k = [];
706
706
  for (const d of N) {
707
- const j = d.fields.filter((f) => !oe(f)), r = j.filter((f) => !["text", "json"].includes(ae(f))).slice(0, 6), c = (r.length ? r : [j[0]]).map((f) => ({
708
- field: P(f.name),
709
- displayName: q(f),
707
+ const j = d.fields.filter((y) => !oe(y)), l = j.filter((y) => !["text", "json"].includes(ae(y))).slice(0, 6), c = (l.length ? l : [j[0]]).map((y) => ({
708
+ field: F(y.name),
709
+ displayName: q(y),
710
710
  sortable: !0,
711
- type: ye(f)[0],
712
- ...f.isForeignKey && f.referencedEntity ? { referencedEntity: P(f.referencedEntity) } : {}
713
- })), v = j.filter((f) => ["string", "text"].includes(ae(f))).map((f) => P(f.name)), $ = j.map((f) => ({
714
- field: P(f.name),
715
- type: At[ye(f)[1]] ?? "TextInput",
716
- label: q(f),
717
- ...f.isRequired ? { required: !0 } : {},
718
- ...f.isForeignKey && f.referencedEntity ? {
719
- entity: P(f.referencedEntity),
720
- displayField: h(f.referencedEntity)
711
+ type: ge(y)[0],
712
+ ...y.isForeignKey && y.referencedEntity ? { referencedEntity: F(y.referencedEntity) } : {}
713
+ })), v = j.filter((y) => ["string", "text"].includes(ae(y))).map((y) => F(y.name)), $ = j.map((y) => ({
714
+ field: F(y.name),
715
+ type: Mt[ge(y)[1]] ?? "TextInput",
716
+ label: q(y),
717
+ ...y.isRequired ? { required: !0 } : {},
718
+ ...y.isForeignKey && y.referencedEntity ? {
719
+ entity: F(y.referencedEntity),
720
+ displayField: h(y.referencedEntity)
721
721
  } : {}
722
722
  }));
723
- S.push({
724
- id: `vw-${l}-${Se(d.name)}-list`,
723
+ k.push({
724
+ id: `vw-${a}-${Se(d.name)}-list`,
725
725
  name: `${d.name}List`,
726
726
  displayName: q(d),
727
727
  type: "List",
@@ -734,19 +734,19 @@ async function Kt(e, i = {}) {
734
734
  allowEdit: !0,
735
735
  allowDelete: !0
736
736
  });
737
- const A = j.map((f) => {
738
- const k = ye(f)[1];
737
+ const A = j.map((y) => {
738
+ const S = ge(y)[1];
739
739
  return {
740
- field: P(f.name),
741
- type: k,
742
- label: q(f),
743
- colSpan: k === "textarea" ? 12 : 6,
744
- ...f.isRequired ? { required: !0 } : {},
745
- ...f.isForeignKey && f.referencedEntity ? { entity: P(f.referencedEntity) } : {}
740
+ field: F(y.name),
741
+ type: S,
742
+ label: q(y),
743
+ colSpan: S === "textarea" ? 12 : 6,
744
+ ...y.isRequired ? { required: !0 } : {},
745
+ ...y.isForeignKey && y.referencedEntity ? { entity: F(y.referencedEntity) } : {}
746
746
  };
747
747
  });
748
- S.push({
749
- id: `vw-${l}-${Se(d.name)}-form`,
748
+ k.push({
749
+ id: `vw-${a}-${Se(d.name)}-form`,
750
750
  name: `${d.name}Form`,
751
751
  displayName: q(d),
752
752
  type: "Form",
@@ -762,31 +762,31 @@ async function Kt(e, i = {}) {
762
762
  });
763
763
  }
764
764
  w.push({
765
- path: `${l}.views.json`,
766
- text: ee({ moduleName: y, version: "1.0.0", views: S })
765
+ path: `${a}.views.json`,
766
+ text: ee({ moduleName: u, version: "1.0.0", views: k })
767
767
  });
768
768
  }
769
769
  if (I) {
770
- const h = (j) => `${a}.${j}`, S = (j, r) => ({
770
+ const h = (j) => `${r}.${j}`, k = (j, l) => ({
771
771
  code: h(j),
772
- name: `${p} — ${r}`,
773
- description: `${r}: ${p}`
774
- }), d = (j, r, ...c) => ({
775
- name: `${G}${a} ${j}`,
776
- description: `${p} — ${r}`,
772
+ name: `${p} — ${l}`,
773
+ description: `${l}: ${p}`
774
+ }), d = (j, l, ...c) => ({
775
+ name: `${G}${r} ${j}`,
776
+ description: `${p} — ${l}`,
777
777
  permissions: c.map(h)
778
778
  });
779
779
  w.push({
780
- path: `${l}.permissions.json`,
780
+ path: `${a}.permissions.json`,
781
781
  text: ee({
782
- moduleName: y,
782
+ moduleName: u,
783
783
  version: "1.0.0",
784
784
  permissions: [
785
- S("Read", "view records"),
786
- S("Create", "add records"),
787
- S("Edit", "edit records"),
788
- S("Delete", "delete records"),
789
- S("Admin", "administer the module")
785
+ k("Read", "view records"),
786
+ k("Create", "add records"),
787
+ k("Edit", "edit records"),
788
+ k("Delete", "delete records"),
789
+ k("Admin", "administer the module")
790
790
  ],
791
791
  permissionGroups: [
792
792
  d("Viewer", "read only", "Read"),
@@ -796,25 +796,25 @@ async function Kt(e, i = {}) {
796
796
  })
797
797
  });
798
798
  }
799
- for (const h of x) {
800
- const S = {
799
+ for (const h of O) {
800
+ const k = {
801
801
  "module.displayName": p,
802
- "module.description": u ?? p
802
+ "module.description": m ?? p
803
803
  };
804
804
  for (const d of N) {
805
- S[`entity.${d.name}.displayName`] = q(d);
806
- for (const j of d.fields.filter((r) => !oe(r)))
807
- S[`field.${d.name}.${P(j.name)}.displayName`] = q(j);
808
- L && (S[`view.${d.name}List.displayName`] = q(d), S[`view.${d.name}Form.displayName`] = q(d), S[`view.${d.name}Form.tab.Main`] = q(d), S[`view.${d.name}Form.section.Details`] = h === "pl" ? "Szczegóły" : "Details");
805
+ k[`entity.${d.name}.displayName`] = q(d);
806
+ for (const j of d.fields.filter((l) => !oe(l)))
807
+ k[`field.${d.name}.${F(j.name)}.displayName`] = q(j);
808
+ L && (k[`view.${d.name}List.displayName`] = q(d), k[`view.${d.name}Form.displayName`] = q(d), k[`view.${d.name}Form.tab.Main`] = q(d), k[`view.${d.name}Form.section.Details`] = h === "pl" ? "Szczegóły" : "Details");
809
809
  }
810
810
  w.push({
811
- path: `${l}.${h}.i18n.json`,
812
- text: ee({ moduleName: s, locale: h, version: "1.0.0", translations: S })
811
+ path: `${a}.${h}.i18n.json`,
812
+ text: ee({ moduleName: s, locale: h, version: "1.0.0", translations: k })
813
813
  });
814
814
  }
815
- return e.iconConfig !== !1 && w.push({ path: `${l}.iconconfig.json`, text: ee(Dt(e.icon)) }), { package: { packageName: s, folder: `Custom/${a}`, files: w }, problems: [] };
815
+ return e.iconConfig !== !1 && w.push({ path: `${a}.iconconfig.json`, text: ee(Pt(e.icon)) }), { package: { packageName: s, folder: `Custom/${r}`, files: w }, problems: [] };
816
816
  }
817
- function Ft(e) {
817
+ function Rt(e) {
818
818
  const i = (t) => typeof t == "string" && t ? t : void 0;
819
819
  return {
820
820
  name: e.name,
@@ -846,63 +846,63 @@ function Ft(e) {
846
846
  };
847
847
  }
848
848
  const Y = (e) => typeof e == "object" && e !== null && !Array.isArray(e);
849
- function ke(e, i) {
850
- return typeof e == "string" ? i(e) : Array.isArray(e) ? e.map((t) => ke(t, i)) : Y(e) ? Object.fromEntries(Object.entries(e).map(([t, o]) => [t, ke(o, i)])) : e;
849
+ function Ne(e, i) {
850
+ return typeof e == "string" ? i(e) : Array.isArray(e) ? e.map((t) => Ne(t, i)) : Y(e) ? Object.fromEntries(Object.entries(e).map(([t, o]) => [t, Ne(o, i)])) : e;
851
851
  }
852
- const Pt = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
853
- async function Rt(e, i) {
852
+ const Vt = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
853
+ async function qt(e, i) {
854
854
  const t = e.find(
855
855
  (w) => !w.path.includes("/") && w.path.toLowerCase().endsWith(".manifest.json")
856
856
  );
857
857
  if (!t)
858
858
  throw new Error("The module has no manifest.");
859
- const o = z(t.text).value, n = String(o.packageName ?? ""), s = t.path.slice(0, -14), a = i.id, l = Ot(a), y = (w) => w.startsWith(G) ? w.slice(G.length) : w.split(".").pop() ?? w, p = y(n), u = y(a), N = (w) => w.startsWith(`${s}.`) ? `${l}${w.slice(s.length)}` : w, L = new Map(e.map((w) => [w.path, N(w.path)])), I = /* @__PURE__ */ new Map();
860
- for (const w of e.filter((T) => T.path.toLowerCase().endsWith(".permissions.json")))
859
+ const o = z(t.text).value, n = String(o.packageName ?? ""), s = t.path.slice(0, -14), r = i.id, a = At(r), u = (w) => w.startsWith(G) ? w.slice(G.length) : w.split(".").pop() ?? w, p = u(n), m = u(r), N = (w) => w.startsWith(`${s}.`) ? `${a}${w.slice(s.length)}` : w, L = new Map(e.map((w) => [w.path, N(w.path)])), I = /* @__PURE__ */ new Map();
860
+ for (const w of e.filter((E) => E.path.toLowerCase().endsWith(".permissions.json")))
861
861
  try {
862
- const T = z(w.text).value;
863
- for (const m of Y(T) && Array.isArray(T.permissions) ? T.permissions : []) {
864
- const b = typeof m.code == "string" ? m.code : "";
865
- b.startsWith(`${p}.`) && I.set(b, `${u}${b.slice(p.length)}`);
862
+ const E = z(w.text).value;
863
+ for (const f of Y(E) && Array.isArray(E.permissions) ? E.permissions : []) {
864
+ const b = typeof f.code == "string" ? f.code : "";
865
+ b.startsWith(`${p}.`) && I.set(b, `${m}${b.slice(p.length)}`);
866
866
  }
867
867
  } catch {
868
868
  }
869
- const x = (w) => n && (w === n || w.startsWith(`${n}.`) || w.startsWith(`${n} `)) ? a + w.slice(n.length) : I.get(w) ?? L.get(w) ?? w, O = [];
869
+ const O = (w) => n && (w === n || w.startsWith(`${n}.`) || w.startsWith(`${n} `)) ? r + w.slice(n.length) : I.get(w) ?? L.get(w) ?? w, x = [];
870
870
  for (const w of e) {
871
871
  if (w.path.startsWith(".revisions/"))
872
872
  continue;
873
- const T = N(w.path);
873
+ const E = N(w.path);
874
874
  if (!w.path.toLowerCase().endsWith(".json")) {
875
- O.push({ path: T, text: w.text });
875
+ x.push({ path: E, text: w.text });
876
876
  continue;
877
877
  }
878
- let m;
878
+ let f;
879
879
  try {
880
- m = z(w.text).value;
880
+ f = z(w.text).value;
881
881
  } catch {
882
- O.push({ path: T, text: w.text });
882
+ x.push({ path: E, text: w.text });
883
883
  continue;
884
884
  }
885
- let b = ke(m, x);
885
+ let b = Ne(f, O);
886
886
  if (w === t && Y(b)) {
887
- const { sourceDefinitionId: g, ...E } = b;
887
+ const { sourceDefinitionId: g, ...T } = b;
888
888
  b = {
889
- ...E,
890
- packageName: a,
889
+ ...T,
890
+ packageName: r,
891
891
  ...i.name ? { displayName: i.name } : {},
892
892
  ...i.packageId ? { category: i.packageId } : {}
893
893
  };
894
894
  }
895
895
  if (w.path.toLowerCase().endsWith(".entities.json") && Y(b) && Array.isArray(b.entities)) {
896
896
  const g = [];
897
- for (const E of b.entities) {
898
- if (!Y(E) || typeof E.name != "string") {
899
- g.push(E);
897
+ for (const T of b.entities) {
898
+ if (!Y(T) || typeof T.name != "string") {
899
+ g.push(T);
900
900
  continue;
901
901
  }
902
902
  g.push({
903
- ...E,
904
- ...typeof E.id == "string" && Pt.test(E.id) ? { id: await fe(a, E.name) } : {},
905
- ...typeof E.tableName == "string" ? { tableName: await Be(l, E.name) } : {}
903
+ ...T,
904
+ ...typeof T.id == "string" && Vt.test(T.id) ? { id: await fe(r, T.name) } : {},
905
+ ...typeof T.tableName == "string" ? { tableName: await Be(a, T.name) } : {}
906
906
  });
907
907
  }
908
908
  b = { ...b, entities: g };
@@ -910,23 +910,23 @@ async function Rt(e, i) {
910
910
  i.name && /\.en\.i18n\.json$/i.test(w.path) && Y(b) && Y(b.translations) && typeof b.translations["module.displayName"] == "string" && (b = {
911
911
  ...b,
912
912
  translations: { ...b.translations, "module.displayName": i.name }
913
- }), O.push({ path: T, text: qe(w.text, b) });
913
+ }), x.push({ path: E, text: qe(w.text, b) });
914
914
  }
915
915
  return {
916
- id: a,
916
+ id: r,
917
917
  packageId: i.packageId ?? o.category,
918
- files: O
918
+ files: x
919
919
  };
920
920
  }
921
921
  const ce = (e) => !!e && typeof e == "object" && !Array.isArray(e), B = (e) => Array.isArray(e) ? e.filter(ce) : [], V = (e) => typeof e == "string" && e ? e : void 0;
922
- function Vt(e) {
922
+ function Ut(e) {
923
923
  const i = /* @__PURE__ */ new Map();
924
924
  for (const o of B(e.integrations))
925
925
  for (const n of B(o.providers))
926
926
  for (const s of B(n.fields)) {
927
- const a = V(s.key);
928
- !a || i.has(a) || i.set(a, {
929
- key: a,
927
+ const r = V(s.key);
928
+ !r || i.has(r) || i.set(r, {
929
+ key: r,
930
930
  description: V(s.label) ?? V(s.description),
931
931
  secret: s.isSensitive === !0 || s.fieldType === "password" || void 0,
932
932
  required: s.isRequired === !0 || void 0,
@@ -940,57 +940,57 @@ function Vt(e) {
940
940
  }
941
941
  return [...i.values()];
942
942
  }
943
- function vi(e, i) {
943
+ function ki(e, i) {
944
944
  const t = ce(e.deployment) ? e.deployment : {}, o = new Map(B(t.envVars).map((s) => [V(s.key) ?? "", s])), n = i.filter((s) => !s.secret && s.key).map((s) => {
945
- const a = { ...o.get(s.key) ?? {}, key: s.key };
946
- return s.defaultValue !== void 0 ? a.defaultValue = s.defaultValue : delete a.defaultValue, s.description && (a.description = s.description), a;
945
+ const r = { ...o.get(s.key) ?? {}, key: s.key };
946
+ return s.defaultValue !== void 0 ? r.defaultValue = s.defaultValue : delete r.defaultValue, s.description && (r.description = s.description), r;
947
947
  });
948
948
  return { ...e, deployment: { ...t, envVars: n } };
949
949
  }
950
- const qt = {
950
+ const Wt = {
951
951
  Anonymous: "none",
952
952
  User: "session",
953
953
  Admin: "session"
954
954
  };
955
- function Ut(e, i) {
955
+ function Gt(e, i) {
956
956
  const t = e.replace(/\/+$/, ""), o = i.replace(/^\/+/, "");
957
957
  return o ? `${t}/${o}` : t || "/";
958
958
  }
959
- function Wt(e) {
959
+ function Jt(e) {
960
960
  const i = ce(e.scripting) ? e.scripting : {}, t = [];
961
961
  for (const o of B(i.controllers)) {
962
962
  const n = V(o.route) ?? "";
963
963
  for (const s of B(o.actions)) {
964
- const a = (V(s.verb) ?? "GET").toUpperCase(), l = Ut(n, V(s.path) ?? ""), y = V(s.auth) ?? V(o.auth);
964
+ const r = (V(s.verb) ?? "GET").toUpperCase(), a = Gt(n, V(s.path) ?? ""), u = V(s.auth) ?? V(o.auth);
965
965
  t.push({
966
- key: `${a} ${l}`,
967
- method: a,
968
- path: l,
966
+ key: `${r} ${a}`,
967
+ method: r,
968
+ path: a,
969
969
  handler: V(s.handler),
970
- auth: y ? qt[y] ?? "session" : void 0
970
+ auth: u ? Wt[u] ?? "session" : void 0
971
971
  });
972
972
  }
973
973
  }
974
974
  return t;
975
975
  }
976
- function Gt(e, i) {
977
- const t = Wt(e), o = i.flatMap((l) => l.expose ?? []), n = (l) => `${l.method.toUpperCase()} ${l.path.replace(/\/+$/, "")}`, s = new Set(t.map(n)), a = new Set(o.map(n));
976
+ function _t(e, i) {
977
+ const t = Jt(e), o = i.flatMap((a) => a.expose ?? []), n = (a) => `${a.method.toUpperCase()} ${a.path.replace(/\/+$/, "")}`, s = new Set(t.map(n)), r = new Set(o.map(n));
978
978
  return {
979
- missingInControllers: o.filter((l) => !s.has(n(l))),
980
- notExposed: t.filter((l) => !a.has(n(l)))
979
+ missingInControllers: o.filter((a) => !s.has(n(a))),
980
+ notExposed: t.filter((a) => !r.has(n(a)))
981
981
  };
982
982
  }
983
- function bi(e, i) {
983
+ function Si(e, i) {
984
984
  const t = ce(e.scripting) ? e.scripting : {}, o = B(t.controllers).map((s) => ({
985
985
  ...s,
986
986
  actions: [...B(s.actions)]
987
- })), { missingInControllers: n } = Gt(e, i);
987
+ })), { missingInControllers: n } = _t(e, i);
988
988
  for (const s of n) {
989
- const a = s.path.replace(/^\/+/, "").split("/"), l = `/${a[0] ?? ""}`;
990
- let y = o.find((p) => V(p.route) === l);
991
- y || (y = { route: l, actions: [] }, o.push(y)), y.actions.push({
989
+ const r = s.path.replace(/^\/+/, "").split("/"), a = `/${r[0] ?? ""}`;
990
+ let u = o.find((p) => V(p.route) === a);
991
+ u || (u = { route: a, actions: [] }, o.push(u)), u.actions.push({
992
992
  verb: s.method.toUpperCase(),
993
- path: a.slice(1).join("/"),
993
+ path: r.slice(1).join("/"),
994
994
  handler: s.handler ?? "",
995
995
  auth: s.auth === "none" || s.auth === "signature" || s.auth === "apiKey" ? "Anonymous" : "User"
996
996
  });
@@ -1005,7 +1005,7 @@ function ze(e) {
1005
1005
  }
1006
1006
  return i;
1007
1007
  }
1008
- const ge = (e) => {
1008
+ const he = (e) => {
1009
1009
  switch (e == null ? void 0 : e.type) {
1010
1010
  case "bearer":
1011
1011
  return "Bearer";
@@ -1028,12 +1028,12 @@ const ge = (e) => {
1028
1028
  return "Custom";
1029
1029
  }
1030
1030
  };
1031
- function Jt(e, i) {
1031
+ function Bt(e, i) {
1032
1032
  let t = (e ?? "").split("?")[0];
1033
1033
  return i && t.startsWith(i) && (t = t.slice(i.length)), t = t.replace(/^\{\{[^}]+\}\}/, "").replace(/^[a-z][\w+.-]*:\/\/[^/]*/i, ""), t.startsWith("/") ? t : `/${t}`;
1034
1034
  }
1035
- async function $i(e) {
1036
- var t, o, n, s, a, l, y, p, u, N, L, I, x, O;
1035
+ async function Ni(e) {
1036
+ var t, o, n, s, r, a, u, p, m, N, L, I, O, x;
1037
1037
  const i = {
1038
1038
  RESTConnection: [],
1039
1039
  RESTEndpointDefinition: [],
@@ -1043,36 +1043,36 @@ async function $i(e) {
1043
1043
  GraphQLSavedQuery: []
1044
1044
  };
1045
1045
  for (const w of e) {
1046
- const T = w.connection, m = await fe("integration", w.key), b = (h, S) => fe("integration", `${w.key}/${h.id ?? S}`), g = ze(w.endpoints.items), E = (h) => {
1047
- var S;
1048
- return (S = w.operations) == null ? void 0 : S.find((d) => d.endpoint && d.endpoint === h);
1046
+ const E = w.connection, f = await fe("integration", w.key), b = (h, k) => fe("integration", `${w.key}/${h.id ?? k}`), g = ze(w.endpoints.items), T = (h) => {
1047
+ var k;
1048
+ return (k = w.operations) == null ? void 0 : k.find((d) => d.endpoint && d.endpoint === h);
1049
1049
  }, C = (h) => h != null && h.startsWith("schedule:") ? h.slice(9) : void 0;
1050
- if (T.protocol === "soap") {
1050
+ if (E.protocol === "soap") {
1051
1051
  i.SOAPConnection.push({
1052
- Id: m,
1052
+ Id: f,
1053
1053
  Name: w.name,
1054
- WsdlUrl: T.baseUrl,
1055
- EndpointUrl: T.baseUrl,
1054
+ WsdlUrl: E.baseUrl,
1055
+ EndpointUrl: E.baseUrl,
1056
1056
  SoapVersion: ((o = (t = g.find((h) => {
1057
- var S;
1058
- return (S = h.body) == null ? void 0 : S.version;
1057
+ var k;
1058
+ return (k = h.body) == null ? void 0 : k.version;
1059
1059
  })) == null ? void 0 : t.body) == null ? void 0 : o.version) ?? "1.1",
1060
- AuthType: ge(T.auth),
1061
- AuthConfigJson: T.auth ? JSON.stringify(T.auth) : void 0,
1062
- TimeoutSeconds: T.timeoutMs ? Math.ceil(T.timeoutMs / 1e3) : void 0,
1060
+ AuthType: he(E.auth),
1061
+ AuthConfigJson: E.auth ? JSON.stringify(E.auth) : void 0,
1062
+ TimeoutSeconds: E.timeoutMs ? Math.ceil(E.timeoutMs / 1e3) : void 0,
1063
1063
  IsActive: !0
1064
1064
  });
1065
- for (const [h, S] of g.entries()) {
1066
- const d = E(S.id);
1065
+ for (const [h, k] of g.entries()) {
1066
+ const d = T(k.id);
1067
1067
  i.SOAPSavedCall.push({
1068
- Id: await b(S, h),
1069
- ConnectionId: m,
1070
- Name: S.name ?? `Call ${h + 1}`,
1071
- Description: S.description,
1068
+ Id: await b(k, h),
1069
+ ConnectionId: f,
1070
+ Name: k.name ?? `Call ${h + 1}`,
1071
+ Description: k.description,
1072
1072
  ServiceName: w.name,
1073
- OperationName: S.name ?? `Call${h + 1}`,
1074
- SoapAction: (n = S.body) == null ? void 0 : n.action,
1075
- InputTemplateXml: (s = S.body) == null ? void 0 : s.envelope,
1073
+ OperationName: k.name ?? `Call${h + 1}`,
1074
+ SoapAction: (n = k.body) == null ? void 0 : n.action,
1075
+ InputTemplateXml: (s = k.body) == null ? void 0 : s.envelope,
1076
1076
  LocalEntityName: d == null ? void 0 : d.target,
1077
1077
  FieldMappingsJson: d != null && d.mapping ? JSON.stringify(d.mapping) : void 0,
1078
1078
  SyncCronExpression: C(d == null ? void 0 : d.trigger),
@@ -1083,25 +1083,25 @@ async function $i(e) {
1083
1083
  }
1084
1084
  continue;
1085
1085
  }
1086
- if (T.protocol === "graphql") {
1086
+ if (E.protocol === "graphql") {
1087
1087
  i.GraphQLEndpoint.push({
1088
- Id: m,
1088
+ Id: f,
1089
1089
  Name: w.name,
1090
- EndpointUrl: T.baseUrl,
1091
- AuthType: ge(T.auth),
1092
- CustomHeaders: (a = T.headers) != null && a.length ? JSON.stringify(Object.fromEntries(T.headers.map((h) => [h.key, h.value]))) : void 0,
1093
- TimeoutSeconds: T.timeoutMs ? Math.ceil(T.timeoutMs / 1e3) : void 0,
1090
+ EndpointUrl: E.baseUrl,
1091
+ AuthType: he(E.auth),
1092
+ CustomHeaders: (r = E.headers) != null && r.length ? JSON.stringify(Object.fromEntries(E.headers.map((h) => [h.key, h.value]))) : void 0,
1093
+ TimeoutSeconds: E.timeoutMs ? Math.ceil(E.timeoutMs / 1e3) : void 0,
1094
1094
  IsEnabled: !0
1095
1095
  });
1096
- for (const [h, S] of g.entries()) {
1097
- const d = E(S.id), j = ((l = S.body) == null ? void 0 : l.query) ?? "";
1096
+ for (const [h, k] of g.entries()) {
1097
+ const d = T(k.id), j = ((a = k.body) == null ? void 0 : a.query) ?? "";
1098
1098
  i.GraphQLSavedQuery.push({
1099
- Id: await b(S, h),
1100
- GraphQLEndpointId: m,
1101
- Name: S.name ?? `Query ${h + 1}`,
1099
+ Id: await b(k, h),
1100
+ GraphQLEndpointId: f,
1101
+ Name: k.name ?? `Query ${h + 1}`,
1102
1102
  OperationType: /^\s*mutation/.test(j) ? "mutation" : /^\s*subscription/.test(j) ? "subscription" : "query",
1103
1103
  QueryText: j,
1104
- DefaultVariables: (y = S.body) == null ? void 0 : y.variables,
1104
+ DefaultVariables: (u = k.body) == null ? void 0 : u.variables,
1105
1105
  LocalEntityName: d == null ? void 0 : d.target,
1106
1106
  FieldMappings: d != null && d.mapping ? JSON.stringify(d.mapping) : void 0,
1107
1107
  IsScheduled: !!C(d == null ? void 0 : d.trigger),
@@ -1110,36 +1110,36 @@ async function $i(e) {
1110
1110
  }
1111
1111
  continue;
1112
1112
  }
1113
- if (!(T.protocol !== "rest" && T.protocol !== "odata" && T.protocol !== "webhook")) {
1113
+ if (!(E.protocol !== "rest" && E.protocol !== "odata" && E.protocol !== "webhook")) {
1114
1114
  i.RESTConnection.push({
1115
- Id: m,
1115
+ Id: f,
1116
1116
  Name: w.name,
1117
- BaseUrl: T.baseUrl,
1118
- AuthType: ge(T.auth),
1119
- AuthConfigJson: T.auth ? JSON.stringify(T.auth) : void 0,
1120
- DefaultHeadersJson: (p = T.headers) != null && p.length ? JSON.stringify(Object.fromEntries(T.headers.map((h) => [h.key, h.value]))) : void 0,
1121
- PaginationType: ((u = T.pagination) == null ? void 0 : u.style) ?? "None",
1122
- PaginationConfigJson: T.pagination ? JSON.stringify(T.pagination) : void 0,
1123
- RateLimitMaxRequests: T.rateLimit,
1124
- RateLimitWindowSeconds: T.rateLimit ? 1 : void 0,
1125
- TimeoutSeconds: T.timeoutMs ? Math.ceil(T.timeoutMs / 1e3) : void 0,
1126
- RetryCount: (N = T.retry) == null ? void 0 : N.attempts,
1127
- RetryBackoffMs: (L = T.retry) == null ? void 0 : L.delayMs,
1128
- WebhookPath: (x = (I = w.expose) == null ? void 0 : I.find((h) => h.auth === "signature")) == null ? void 0 : x.path,
1117
+ BaseUrl: E.baseUrl,
1118
+ AuthType: he(E.auth),
1119
+ AuthConfigJson: E.auth ? JSON.stringify(E.auth) : void 0,
1120
+ DefaultHeadersJson: (p = E.headers) != null && p.length ? JSON.stringify(Object.fromEntries(E.headers.map((h) => [h.key, h.value]))) : void 0,
1121
+ PaginationType: ((m = E.pagination) == null ? void 0 : m.style) ?? "None",
1122
+ PaginationConfigJson: E.pagination ? JSON.stringify(E.pagination) : void 0,
1123
+ RateLimitMaxRequests: E.rateLimit,
1124
+ RateLimitWindowSeconds: E.rateLimit ? 1 : void 0,
1125
+ TimeoutSeconds: E.timeoutMs ? Math.ceil(E.timeoutMs / 1e3) : void 0,
1126
+ RetryCount: (N = E.retry) == null ? void 0 : N.attempts,
1127
+ RetryBackoffMs: (L = E.retry) == null ? void 0 : L.delayMs,
1128
+ WebhookPath: (O = (I = w.expose) == null ? void 0 : I.find((h) => h.auth === "signature")) == null ? void 0 : O.path,
1129
1129
  IsActive: !0
1130
1130
  });
1131
- for (const [h, S] of g.entries()) {
1132
- const d = E(S.id), j = (S.params ?? []).filter((c) => c.in === "query" && c.enabled !== !1), r = (S.params ?? []).filter((c) => c.in === "header" && c.enabled !== !1);
1131
+ for (const [h, k] of g.entries()) {
1132
+ const d = T(k.id), j = (k.params ?? []).filter((c) => c.in === "query" && c.enabled !== !1), l = (k.params ?? []).filter((c) => c.in === "header" && c.enabled !== !1);
1133
1133
  i.RESTEndpointDefinition.push({
1134
- Id: await b(S, h),
1135
- ConnectionId: m,
1136
- Name: S.name ?? `Endpoint ${h + 1}`,
1137
- Description: S.description,
1138
- HttpMethod: (S.method ?? "GET").toUpperCase(),
1139
- PathTemplate: Jt(S.url, T.baseUrl),
1134
+ Id: await b(k, h),
1135
+ ConnectionId: f,
1136
+ Name: k.name ?? `Endpoint ${h + 1}`,
1137
+ Description: k.description,
1138
+ HttpMethod: (k.method ?? "GET").toUpperCase(),
1139
+ PathTemplate: Bt(k.url, E.baseUrl),
1140
1140
  QueryParamsJson: j.length ? JSON.stringify(Object.fromEntries(j.map((c) => [c.key, c.value]))) : void 0,
1141
- HeadersJson: r.length ? JSON.stringify(Object.fromEntries(r.map((c) => [c.key, c.value]))) : void 0,
1142
- BodyTemplate: (O = S.body) == null ? void 0 : O.text,
1141
+ HeadersJson: l.length ? JSON.stringify(Object.fromEntries(l.map((c) => [c.key, c.value]))) : void 0,
1142
+ BodyTemplate: (x = k.body) == null ? void 0 : x.text,
1143
1143
  LocalEntityName: d == null ? void 0 : d.target,
1144
1144
  FieldMappingsJson: d != null && d.mapping ? JSON.stringify(d.mapping) : void 0,
1145
1145
  SyncDirection: d ? "Inbound" : void 0,
@@ -1153,18 +1153,18 @@ async function $i(e) {
1153
1153
  }
1154
1154
  }
1155
1155
  for (const w of Object.values(i))
1156
- w.forEach((T, m) => {
1157
- w[m] = Object.fromEntries(Object.entries(T).filter(([, b]) => b !== void 0));
1156
+ w.forEach((E, f) => {
1157
+ w[f] = Object.fromEntries(Object.entries(E).filter(([, b]) => b !== void 0));
1158
1158
  });
1159
1159
  return i;
1160
1160
  }
1161
- const _t = (e, i) => i, Q = (e) => ({
1161
+ const zt = (e, i) => i, Q = (e) => ({
1162
1162
  type: "array",
1163
1163
  title: e,
1164
1164
  items: { type: "string" }
1165
1165
  });
1166
- function Bt(e = _t, i = {}) {
1167
- const t = (s, a) => e(`devStudio.omniverk.${s}`, a), o = {
1166
+ function Ht(e = zt, i = {}) {
1167
+ const t = (s, r) => e(`devStudio.omniverk.${s}`, r), o = {
1168
1168
  type: "object",
1169
1169
  properties: {
1170
1170
  key: { type: "string", title: t("field.key", "Key") },
@@ -1543,14 +1543,14 @@ function Bt(e = _t, i = {}) {
1543
1543
  }
1544
1544
  return n;
1545
1545
  }
1546
- const K = (e) => typeof e == "object" && e !== null && !Array.isArray(e), ie = (e, i) => K(e) && Array.isArray(e[i]) ? e[i] : [], re = (e, i) => e.toLowerCase().endsWith(i), Ne = (e) => !e.includes("/"), zt = /[ąćęłńóśźżĄĆĘŁŃÓŚŹŻ]/, Ht = [
1546
+ const K = (e) => typeof e == "object" && e !== null && !Array.isArray(e), ie = (e, i) => K(e) && Array.isArray(e[i]) ? e[i] : [], re = (e, i) => e.toLowerCase().endsWith(i), je = (e) => !e.includes("/"), Zt = /[ąćęłńóśźżĄĆĘŁŃÓŚŹŻ]/, Qt = [
1547
1547
  "ING Bank Śląski",
1548
1548
  "Bank Śląski",
1549
1549
  "BOŚ",
1550
1550
  "e-Zamówienia",
1551
1551
  "eZamówienia",
1552
1552
  "Plataforma de Contratación del Sector Público"
1553
- ], de = (e) => zt.test(Ht.reduce((i, t) => i.split(t).join(""), e)), Zt = /* @__PURE__ */ new Set([
1553
+ ], de = (e) => Zt.test(Qt.reduce((i, t) => i.split(t).join(""), e)), Yt = /* @__PURE__ */ new Set([
1554
1554
  "module",
1555
1555
  "entity",
1556
1556
  "field",
@@ -1559,8 +1559,8 @@ const K = (e) => typeof e == "object" && e !== null && !Array.isArray(e), ie = (
1559
1559
  "nav",
1560
1560
  "action",
1561
1561
  "tutorial"
1562
- ]), Qt = /* @__PURE__ */ new Set(["int", "int32", "int64", "long", "integer"]);
1563
- function Yt(e) {
1562
+ ]), Xt = /* @__PURE__ */ new Set(["int", "int32", "int64", "long", "integer"]);
1563
+ function ei(e) {
1564
1564
  for (let i = 0; i < e.length; i++) {
1565
1565
  const t = e.charCodeAt(i);
1566
1566
  if (t >= 55296 && t <= 56319 || t >= 9728 && t <= 10175)
@@ -1574,7 +1574,7 @@ function Ae(e) {
1574
1574
  const i = K(e.translations) ? e.translations : K(e.keys) ? e.keys : void 0;
1575
1575
  return i ? Object.entries(i) : [];
1576
1576
  }
1577
- const Le = /^(.*)\.([a-z]{2,3}(?:-[A-Za-z]{2,4})?)\.i18n\.json$/i, Xt = /* @__PURE__ */ new Set([
1577
+ const Le = /^(.*)\.([a-z]{2,3}(?:-[A-Za-z]{2,4})?)\.i18n\.json$/i, ti = /* @__PURE__ */ new Set([
1578
1578
  "hotel.views.json",
1579
1579
  "restaurant.views.json",
1580
1580
  "backup-dr.views.json",
@@ -1583,57 +1583,57 @@ const Le = /^(.*)\.([a-z]{2,3}(?:-[A-Za-z]{2,4})?)\.i18n\.json$/i, Xt = /* @__PU
1583
1583
  "shelf_management.views.json",
1584
1584
  "psa.views.json"
1585
1585
  ]);
1586
- function ei(e, i = {}) {
1587
- var T;
1586
+ function ii(e, i = {}) {
1587
+ var E;
1588
1588
  const t = new Set(
1589
- [...i.legacyListViewFiles ?? Xt].map(
1590
- (m) => m.toLowerCase()
1589
+ [...i.legacyListViewFiles ?? ti].map(
1590
+ (f) => f.toLowerCase()
1591
1591
  )
1592
- ), o = [], n = (m) => {
1593
- o.push({ severity: "error", ...m });
1592
+ ), o = [], n = (f) => {
1593
+ o.push({ severity: "error", ...f });
1594
1594
  }, s = [];
1595
- for (const m of e.files)
1596
- if (!(!re(m.path, ".json") || m.path.startsWith(".revisions/")))
1595
+ for (const f of e.files)
1596
+ if (!(!re(f.path, ".json") || f.path.startsWith(".revisions/")))
1597
1597
  try {
1598
- s.push({ file: m, value: z(m.text).value });
1598
+ s.push({ file: f, value: z(f.text).value });
1599
1599
  } catch (b) {
1600
1600
  n({
1601
1601
  code: "json.invalid",
1602
- message: `${m.path} is not valid JSON: ${b instanceof Error ? b.message : String(b)}`,
1602
+ message: `${f.path} is not valid JSON: ${b instanceof Error ? b.message : String(b)}`,
1603
1603
  messageKey: "devStudio.issue.jsonInvalid",
1604
- params: { path: m.path, error: b instanceof Error ? b.message : String(b) },
1605
- path: m.path
1604
+ params: { path: f.path, error: b instanceof Error ? b.message : String(b) },
1605
+ path: f.path
1606
1606
  });
1607
1607
  }
1608
- const a = (m) => s.filter((b) => Ne(b.file.path) && re(b.file.path, m)), l = a(".manifest.json");
1609
- l.length === 0 && n({
1608
+ const r = (f) => s.filter((b) => je(b.file.path) && re(b.file.path, f)), a = r(".manifest.json");
1609
+ a.length === 0 && n({
1610
1610
  code: "manifest.missing",
1611
1611
  message: "The module has no *.manifest.json.",
1612
1612
  messageKey: "devStudio.issue.manifestMissing"
1613
1613
  });
1614
- for (const { file: m, value: b } of l)
1614
+ for (const { file: f, value: b } of a)
1615
1615
  for (const g of ["packageName", "version", "category"])
1616
1616
  (!K(b) || !(g in b)) && n({
1617
1617
  code: "manifest.required",
1618
1618
  message: `The manifest needs "${g}".`,
1619
1619
  messageKey: "devStudio.issue.manifestRequired",
1620
1620
  params: { field: g },
1621
- path: m.path,
1621
+ path: f.path,
1622
1622
  pointer: `/${g}`
1623
1623
  });
1624
- const y = a(".iconconfig.json");
1625
- y.length === 0 && e.contents !== "manifest" && n({
1624
+ const u = r(".iconconfig.json");
1625
+ u.length === 0 && e.contents !== "manifest" && n({
1626
1626
  severity: "info",
1627
1627
  code: "iconconfig.missing",
1628
1628
  message: "The module has no *.iconconfig.json: its menu shows a default icon (the CI wants one in every Category/Module folder).",
1629
1629
  messageKey: "devStudio.issue.iconconfigMissing"
1630
1630
  });
1631
- for (const { file: m, value: b } of y) {
1632
- const g = K(b) ? b.module : void 0, E = K(g) ? g.icon : void 0, C = [
1631
+ for (const { file: f, value: b } of u) {
1632
+ const g = K(b) ? b.module : void 0, T = K(g) ? g.icon : void 0, C = [
1633
1633
  ...K(g) ? [] : ["module"],
1634
- ...K(g) && !K(E) ? ["module.icon"] : [],
1635
- ...K(E) && !("name" in E) ? ["module.icon.name"] : [],
1636
- ...K(E) && !("package" in E) ? ["module.icon.package"] : [],
1634
+ ...K(g) && !K(T) ? ["module.icon"] : [],
1635
+ ...K(T) && !("name" in T) ? ["module.icon.name"] : [],
1636
+ ...K(T) && !("package" in T) ? ["module.icon.package"] : [],
1637
1637
  ...["views", "permissions", "workflowStates"].filter(
1638
1638
  (h) => !K(b) || !(h in b)
1639
1639
  )
@@ -1644,42 +1644,42 @@ function ei(e, i = {}) {
1644
1644
  message: `The icon config needs "${h}".`,
1645
1645
  messageKey: "devStudio.issue.iconconfigStructure",
1646
1646
  params: { field: h },
1647
- path: m.path,
1647
+ path: f.path,
1648
1648
  pointer: `/${h.split(".").join("/")}`
1649
1649
  });
1650
1650
  }
1651
- const p = [], u = [];
1652
- for (const { file: m, value: b } of a(".entities.json")) {
1651
+ const p = [], m = [];
1652
+ for (const { file: f, value: b } of r(".entities.json")) {
1653
1653
  if (!K(b) || !("entities" in b))
1654
1654
  continue;
1655
- const g = [], E = b.entities;
1656
- if (!Array.isArray(E) || E.length === 0) {
1655
+ const g = [], T = b.entities;
1656
+ if (!Array.isArray(T) || T.length === 0) {
1657
1657
  n({
1658
1658
  code: "entities.empty",
1659
1659
  message: "The file has no entities.",
1660
1660
  messageKey: "devStudio.issue.entitiesEmpty",
1661
- path: m.path,
1661
+ path: f.path,
1662
1662
  pointer: "/entities"
1663
1663
  });
1664
1664
  continue;
1665
1665
  }
1666
- E.forEach((C, h) => {
1667
- const S = `/entities/${h}`, d = K(C) && typeof C.name == "string" ? C.name : void 0;
1666
+ T.forEach((C, h) => {
1667
+ const k = `/entities/${h}`, d = K(C) && typeof C.name == "string" ? C.name : void 0;
1668
1668
  if (d ? p.push(d) : n({
1669
1669
  code: "entities.name",
1670
1670
  message: `Entity #${h + 1} has no name.`,
1671
1671
  messageKey: "devStudio.issue.entitiesName",
1672
1672
  params: { n: h + 1 },
1673
- path: m.path,
1674
- pointer: S
1673
+ path: f.path,
1674
+ pointer: k
1675
1675
  }), !K(C) || !Array.isArray(C.fields)) {
1676
1676
  n({
1677
1677
  code: "entities.fields",
1678
1678
  message: `Entity ${d ?? `#${h + 1}`} has no fields array.`,
1679
1679
  messageKey: "devStudio.issue.entitiesFields",
1680
1680
  params: { name: d ?? `#${h + 1}` },
1681
- path: m.path,
1682
- pointer: S
1681
+ path: f.path,
1682
+ pointer: k
1683
1683
  });
1684
1684
  return;
1685
1685
  }
@@ -1688,27 +1688,27 @@ function ei(e, i = {}) {
1688
1688
  message: `Entity ${d}: the display name "${C.displayName}" is Polish — seed labels are English, Polish goes to the .pl bundle.`,
1689
1689
  messageKey: "devStudio.issue.polishEntity",
1690
1690
  params: { name: d ?? "", text: C.displayName },
1691
- path: m.path,
1692
- pointer: `${S}/displayName`
1693
- }), C.fields.forEach((j, r) => {
1691
+ path: f.path,
1692
+ pointer: `${k}/displayName`
1693
+ }), C.fields.forEach((j, l) => {
1694
1694
  if (!K(j))
1695
1695
  return;
1696
- const c = typeof j.name == "string" ? j.name : void 0, v = `${S}/fields/${r}`;
1697
- d && c && j.isPrimaryKey !== !0 && u.push(`field.${d}.${c}`);
1696
+ const c = typeof j.name == "string" ? j.name : void 0, v = `${k}/fields/${l}`;
1697
+ d && c && j.isPrimaryKey !== !0 && m.push(`field.${d}.${c}`);
1698
1698
  const $ = typeof j.dataType == "string" ? j.dataType.replace(/\?+$/, "") : void 0;
1699
- $ === void 0 && typeof j.type == "string" && g.push({ name: `${d}.${c}`, pointer: `${v}/type` }), $ && Qt.has($.toLowerCase()) && (c === "Id" || j.isForeignKey === !0) && n({
1699
+ $ === void 0 && typeof j.type == "string" && g.push({ name: `${d}.${c}`, pointer: `${v}/type` }), $ && Xt.has($.toLowerCase()) && (c === "Id" || j.isForeignKey === !0) && n({
1700
1700
  code: "entities.keyNotGuid",
1701
1701
  message: `${d}.${c} is ${$}: keys must be Guid (every row's Id is a uuid).`,
1702
1702
  messageKey: "devStudio.issue.keyNotGuid",
1703
1703
  params: { name: `${d}.${c}`, type: $ },
1704
- path: m.path,
1704
+ path: f.path,
1705
1705
  pointer: `${v}/dataType`
1706
1706
  }), typeof j.displayName == "string" && de(j.displayName) && n({
1707
1707
  code: "labels.polish",
1708
1708
  message: `${d}.${c}: the display name "${j.displayName}" is Polish — seed labels are English.`,
1709
1709
  messageKey: "devStudio.issue.polishField",
1710
1710
  params: { name: `${d}.${c}`, text: j.displayName },
1711
- path: m.path,
1711
+ path: f.path,
1712
1712
  pointer: `${v}/displayName`
1713
1713
  });
1714
1714
  });
@@ -1721,106 +1721,106 @@ function ei(e, i = {}) {
1721
1721
  count: g.length,
1722
1722
  names: `${g.slice(0, 5).map((C) => C.name).join(", ")}${g.length > 5 ? ", …" : ""}`
1723
1723
  },
1724
- path: m.path,
1724
+ path: f.path,
1725
1725
  pointer: g[0].pointer
1726
1726
  });
1727
1727
  }
1728
- for (const { file: m, value: b } of a(".permissions.json"))
1728
+ for (const { file: f, value: b } of r(".permissions.json"))
1729
1729
  (!K(b) || !Array.isArray(b.permissions) || b.permissions.length === 0) && n({
1730
1730
  code: "permissions.empty",
1731
1731
  message: 'The file needs a non-empty "permissions" array.',
1732
1732
  messageKey: "devStudio.issue.permissionsEmpty",
1733
- path: m.path,
1733
+ path: f.path,
1734
1734
  pointer: "/permissions"
1735
1735
  });
1736
1736
  const N = [];
1737
- for (const { file: m, value: b } of a(".views.json")) {
1737
+ for (const { file: f, value: b } of r(".views.json")) {
1738
1738
  if (!K(b) || Object.keys(b).length === 0) {
1739
1739
  n({
1740
1740
  code: "views.empty",
1741
1741
  message: "A views file is a JSON object with at least one property.",
1742
1742
  messageKey: "devStudio.issue.viewsEmpty",
1743
- path: m.path
1743
+ path: f.path
1744
1744
  });
1745
1745
  continue;
1746
1746
  }
1747
- ie(b, "views").forEach((g, E) => {
1747
+ ie(b, "views").forEach((g, T) => {
1748
1748
  if (!K(g))
1749
1749
  return;
1750
- const C = `/views/${E}`, h = typeof g.name == "string" ? g.name : "(unnamed)";
1751
- typeof g.name == "string" && N.push(g.name), typeof g.type == "string" && g.type.toLowerCase() === "list" && !t.has(m.path.toLowerCase()) && (typeof g.entityName != "string" || !g.entityName.trim() ? n({
1750
+ const C = `/views/${T}`, h = typeof g.name == "string" ? g.name : "(unnamed)";
1751
+ typeof g.name == "string" && N.push(g.name), typeof g.type == "string" && g.type.toLowerCase() === "list" && !t.has(f.path.toLowerCase()) && (typeof g.entityName != "string" || !g.entityName.trim() ? n({
1752
1752
  code: "views.listEntity",
1753
1753
  message: `List view ${h} needs a top-level "entityName".`,
1754
1754
  messageKey: "devStudio.issue.listEntity",
1755
1755
  params: { name: h },
1756
- path: m.path,
1756
+ path: f.path,
1757
1757
  pointer: C
1758
1758
  }) : (!Array.isArray(g.columns) || g.columns.length === 0) && n({
1759
1759
  code: "views.listColumns",
1760
1760
  message: `List view ${h} needs non-empty top-level "columns".`,
1761
1761
  messageKey: "devStudio.issue.listColumns",
1762
1762
  params: { name: h },
1763
- path: m.path,
1763
+ path: f.path,
1764
1764
  pointer: C
1765
1765
  }));
1766
- const S = [[g, "displayName", C]];
1766
+ const k = [[g, "displayName", C]];
1767
1767
  ie(g, "columns").forEach((d, j) => {
1768
- for (const r of ["header", "displayName", "label"])
1769
- S.push([d, r, `${C}/columns/${j}`]);
1768
+ for (const l of ["header", "displayName", "label"])
1769
+ k.push([d, l, `${C}/columns/${j}`]);
1770
1770
  }), ie(g, "tabs").forEach((d, j) => {
1771
- S.push([d, "displayName", `${C}/tabs/${j}`]), ie(d, "sections").forEach((r, c) => {
1772
- S.push([r, "displayName", `${C}/tabs/${j}/sections/${c}`]), ie(r, "controls").forEach(
1773
- (v, $) => S.push([v, "label", `${C}/tabs/${j}/sections/${c}/controls/${$}`])
1771
+ k.push([d, "displayName", `${C}/tabs/${j}`]), ie(d, "sections").forEach((l, c) => {
1772
+ k.push([l, "displayName", `${C}/tabs/${j}/sections/${c}`]), ie(l, "controls").forEach(
1773
+ (v, $) => k.push([v, "label", `${C}/tabs/${j}/sections/${c}/controls/${$}`])
1774
1774
  );
1775
1775
  });
1776
1776
  });
1777
- for (const [d, j, r] of S) {
1777
+ for (const [d, j, l] of k) {
1778
1778
  const c = K(d) ? d[j] : void 0;
1779
1779
  typeof c == "string" && de(c) && n({
1780
1780
  code: "labels.polish",
1781
1781
  message: `View ${h}: "${c}" is Polish — seed labels are English.`,
1782
1782
  messageKey: "devStudio.issue.polishView",
1783
1783
  params: { name: h, text: c },
1784
- path: m.path,
1785
- pointer: `${r}/${j}`
1784
+ path: f.path,
1785
+ pointer: `${l}/${j}`
1786
1786
  });
1787
1787
  }
1788
1788
  });
1789
1789
  }
1790
- const L = s.filter((m) => Ne(m.file.path) && Le.test(m.file.path)), I = /* @__PURE__ */ new Map();
1791
- for (const m of L) {
1792
- const [, b, g] = Le.exec(m.file.path), E = I.get(b) ?? /* @__PURE__ */ new Map();
1793
- E.set(g.toLowerCase(), m), I.set(b, E);
1790
+ const L = s.filter((f) => je(f.file.path) && Le.test(f.file.path)), I = /* @__PURE__ */ new Map();
1791
+ for (const f of L) {
1792
+ const [, b, g] = Le.exec(f.file.path), T = I.get(b) ?? /* @__PURE__ */ new Map();
1793
+ T.set(g.toLowerCase(), f), I.set(b, T);
1794
1794
  }
1795
- const x = new Set(
1796
- [...I.keys()].map((m) => m.split(".")[0]).filter((m) => !Zt.has(m))
1797
- ), O = /* @__PURE__ */ new Set();
1798
- for (const [m, b] of I) {
1799
- const g = b.get("en"), E = b.get("pl"), C = (h) => new Set(Ae(h == null ? void 0 : h.value).map(([S]) => S));
1800
- if (g && !E && n({
1795
+ const O = new Set(
1796
+ [...I.keys()].map((f) => f.split(".")[0]).filter((f) => !Yt.has(f))
1797
+ ), x = /* @__PURE__ */ new Set();
1798
+ for (const [f, b] of I) {
1799
+ const g = b.get("en"), T = b.get("pl"), C = (h) => new Set(Ae(h == null ? void 0 : h.value).map(([k]) => k));
1800
+ if (g && !T && n({
1801
1801
  code: "i18n.polishMissing",
1802
- message: `${m}.en.i18n.json needs a .pl.i18n.json sibling (English and Polish are mandatory).`,
1802
+ message: `${f}.en.i18n.json needs a .pl.i18n.json sibling (English and Polish are mandatory).`,
1803
1803
  messageKey: "devStudio.issue.polishBundleMissing",
1804
- params: { group: m },
1804
+ params: { group: f },
1805
1805
  path: g.file.path
1806
- }), E && !g && n({
1806
+ }), T && !g && n({
1807
1807
  code: "i18n.englishMissing",
1808
- message: `${m}.pl.i18n.json needs an .en.i18n.json baseline.`,
1808
+ message: `${f}.pl.i18n.json needs an .en.i18n.json baseline.`,
1809
1809
  messageKey: "devStudio.issue.englishBundleMissing",
1810
- params: { group: m },
1811
- path: E.file.path
1812
- }), g && E) {
1813
- const h = C(g), S = C(E), d = [...h].filter((r) => !S.has(r)), j = [...S].filter((r) => !h.has(r));
1810
+ params: { group: f },
1811
+ path: T.file.path
1812
+ }), g && T) {
1813
+ const h = C(g), k = C(T), d = [...h].filter((l) => !k.has(l)), j = [...k].filter((l) => !h.has(l));
1814
1814
  d.length && n({
1815
1815
  code: "i18n.keyMissing",
1816
- message: `${E.file.path} is missing ${d.length} key(s) of English: ${d.slice(0, 10).join(", ")}`,
1816
+ message: `${T.file.path} is missing ${d.length} key(s) of English: ${d.slice(0, 10).join(", ")}`,
1817
1817
  messageKey: "devStudio.issue.keysMissingPl",
1818
1818
  params: {
1819
- path: E.file.path,
1819
+ path: T.file.path,
1820
1820
  count: d.length,
1821
1821
  keys: d.slice(0, 10).join(", ")
1822
1822
  },
1823
- path: E.file.path
1823
+ path: T.file.path
1824
1824
  }), j.length && n({
1825
1825
  code: "i18n.keyMissing",
1826
1826
  message: `${g.file.path} is missing ${j.length} key(s) of Polish: ${j.slice(0, 10).join(", ")}`,
@@ -1833,37 +1833,37 @@ function ei(e, i = {}) {
1833
1833
  path: g.file.path
1834
1834
  });
1835
1835
  }
1836
- for (const [h, S] of b) {
1837
- const d = Ae(S.value), j = d.filter(([r]) => x.has(r.split(".")[0])).map(([r]) => r);
1836
+ for (const [h, k] of b) {
1837
+ const d = Ae(k.value), j = d.filter(([l]) => O.has(l.split(".")[0])).map(([l]) => l);
1838
1838
  if (j.length && n({
1839
1839
  severity: "warning",
1840
1840
  code: "i18n.fileKey",
1841
- message: `${S.file.path}: nothing reads keys named after the bundle file — use module./entity./field./view. keys (${j.slice(0, 5).join(", ")}).`,
1841
+ message: `${k.file.path}: nothing reads keys named after the bundle file — use module./entity./field./view. keys (${j.slice(0, 5).join(", ")}).`,
1842
1842
  messageKey: "devStudio.issue.fileKey",
1843
- params: { path: S.file.path, keys: j.slice(0, 5).join(", ") },
1844
- path: S.file.path
1843
+ params: { path: k.file.path, keys: j.slice(0, 5).join(", ") },
1844
+ path: k.file.path
1845
1845
  }), h === "en")
1846
- for (const [r, c] of d) {
1847
- O.add(r);
1848
- const v = r.split(".")[0];
1846
+ for (const [l, c] of d) {
1847
+ x.add(l);
1848
+ const v = l.split(".")[0];
1849
1849
  ["module", "entity", "field", "view"].includes(v) && typeof c == "string" && de(c) && n({
1850
1850
  code: "i18n.polishInEnglish",
1851
- message: `${S.file.path}: ${r} = "${c}" — the English bundle is the English UI.`,
1851
+ message: `${k.file.path}: ${l} = "${c}" — the English bundle is the English UI.`,
1852
1852
  messageKey: "devStudio.issue.polishInEnglish",
1853
- params: { path: S.file.path, key: r, text: c },
1854
- path: S.file.path
1853
+ params: { path: k.file.path, key: l, text: c },
1854
+ path: k.file.path
1855
1855
  });
1856
1856
  }
1857
1857
  }
1858
1858
  }
1859
- if (l.length && L.length) {
1859
+ if (a.length && L.length) {
1860
1860
  const b = [
1861
1861
  "module.displayName",
1862
1862
  ...p.map((g) => `entity.${g}.displayName`),
1863
- ...u.map((g) => `${g}.displayName`),
1863
+ ...m.map((g) => `${g}.displayName`),
1864
1864
  ...N.map((g) => `view.${g}.displayName`)
1865
1865
  ].filter(
1866
- (g) => !O.has(g) && !(g.startsWith("field.") && O.has(`${g.slice(0, -12)}.label`))
1866
+ (g) => !x.has(g) && !(g.startsWith("field.") && x.has(`${g.slice(0, -12)}.label`))
1867
1867
  );
1868
1868
  b.length && n({
1869
1869
  code: "i18n.labelMissing",
@@ -1872,41 +1872,41 @@ function ei(e, i = {}) {
1872
1872
  params: { count: b.length, keys: b.slice(0, 10).join(", ") }
1873
1873
  });
1874
1874
  }
1875
- for (const { file: m, value: b } of s)
1875
+ for (const { file: f, value: b } of s)
1876
1876
  me(
1877
1877
  b,
1878
1878
  void 0,
1879
1879
  "",
1880
- (g, E, C) => n({
1880
+ (g, T, C) => n({
1881
1881
  code: "icons.emoji",
1882
- message: `${E} = "${C}": icon fields take an Ntd* name and column headers are words, never emoji.`,
1882
+ message: `${T} = "${C}": icon fields take an Ntd* name and column headers are words, never emoji.`,
1883
1883
  messageKey: "devStudio.issue.iconsEmoji",
1884
- params: { key: E, text: C },
1885
- path: m.path,
1884
+ params: { key: T, text: C },
1885
+ path: f.path,
1886
1886
  pointer: g
1887
1887
  })
1888
1888
  );
1889
- const w = a(".datasources.json");
1890
- if (w.length && l.length) {
1891
- const m = /* @__PURE__ */ new Set();
1889
+ const w = r(".datasources.json");
1890
+ if (w.length && a.length) {
1891
+ const f = /* @__PURE__ */ new Set();
1892
1892
  for (const { value: g } of w) {
1893
- const E = Array.isArray(g) ? g : g == null ? void 0 : g.dataSources;
1894
- for (const C of Array.isArray(E) ? E : []) {
1893
+ const T = Array.isArray(g) ? g : g == null ? void 0 : g.dataSources;
1894
+ for (const C of Array.isArray(T) ? T : []) {
1895
1895
  const h = (C == null ? void 0 : C.key) ?? (C == null ? void 0 : C.name);
1896
- typeof h == "string" && m.add(h);
1896
+ typeof h == "string" && f.add(h);
1897
1897
  }
1898
1898
  }
1899
- const b = (T = l[0].value) == null ? void 0 : T.dataSources;
1900
- (Array.isArray(b) ? b : []).forEach((g, E) => {
1899
+ const b = (E = a[0].value) == null ? void 0 : E.dataSources;
1900
+ (Array.isArray(b) ? b : []).forEach((g, T) => {
1901
1901
  const C = (g == null ? void 0 : g.key) ?? (g == null ? void 0 : g.name);
1902
- typeof C == "string" && !m.has(C) && n({
1902
+ typeof C == "string" && !f.has(C) && n({
1903
1903
  severity: "warning",
1904
1904
  code: "dataSources.undefined",
1905
1905
  message: `The manifest lists the data source "${C}", which no *.datasources.json defines.`,
1906
1906
  messageKey: "devStudio.issue.dataSourceUndefined",
1907
1907
  params: { key: C },
1908
- path: l[0].file.path,
1909
- pointer: `/dataSources/${E}`
1908
+ path: a[0].file.path,
1909
+ pointer: `/dataSources/${T}`
1910
1910
  });
1911
1911
  });
1912
1912
  }
@@ -1919,59 +1919,59 @@ function me(e, i, t, o) {
1919
1919
  }
1920
1920
  if (K(e))
1921
1921
  for (const [n, s] of Object.entries(e)) {
1922
- const a = `${t}/${n}`;
1923
- if ((n === "icon" || n === "iconName" || n === "entityIcon" || n === "name" && i === "icon" || i === "cardIcon" || (n === "header" || n === "displayName" && i === "columns")) && typeof s == "string" && Yt(s) && o(a, n, s), n === "optionsJson" && typeof s == "string")
1922
+ const r = `${t}/${n}`;
1923
+ if ((n === "icon" || n === "iconName" || n === "entityIcon" || n === "name" && i === "icon" || i === "cardIcon" || (n === "header" || n === "displayName" && i === "columns")) && typeof s == "string" && ei(s) && o(r, n, s), n === "optionsJson" && typeof s == "string")
1924
1924
  try {
1925
- me(JSON.parse(s), "optionsJson", a, o);
1925
+ me(JSON.parse(s), "optionsJson", r, o);
1926
1926
  } catch {
1927
1927
  }
1928
- me(s, n, a, o);
1928
+ me(s, n, r, o);
1929
1929
  }
1930
1930
  }
1931
- function ti(e, i = {}) {
1931
+ function ni(e, i = {}) {
1932
1932
  const t = [], o = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map();
1933
- for (const a of e)
1934
- for (const l of a.files) {
1935
- if (!Ne(l.path) || !re(l.path, ".json"))
1933
+ for (const r of e)
1934
+ for (const a of r.files) {
1935
+ if (!je(a.path) || !re(a.path, ".json"))
1936
1936
  continue;
1937
- let y;
1937
+ let u;
1938
1938
  try {
1939
- y = z(l.text).value;
1939
+ u = z(a.text).value;
1940
1940
  } catch {
1941
1941
  continue;
1942
1942
  }
1943
- if (re(l.path, ".manifest.json") && K(y) && typeof y.packageName == "string" && y.packageName) {
1944
- const p = y.packageName.toLowerCase();
1945
- o.set(p, [...o.get(p) ?? [], a.location]);
1943
+ if (re(a.path, ".manifest.json") && K(u) && typeof u.packageName == "string" && u.packageName) {
1944
+ const p = u.packageName.toLowerCase();
1945
+ o.set(p, [...o.get(p) ?? [], r.location]);
1946
1946
  }
1947
- if (re(l.path, ".entities.json") && a.group) {
1948
- for (const p of ie(y, "entities"))
1947
+ if (re(a.path, ".entities.json") && r.group) {
1948
+ for (const p of ie(u, "entities"))
1949
1949
  if (K(p) && typeof p.name == "string" && p.name) {
1950
- const u = `${a.group}/${p.name}`.toLowerCase(), N = n.get(u) ?? [];
1951
- N.includes(a.location) || n.set(u, [...N, a.location]);
1950
+ const m = `${r.group}/${p.name}`.toLowerCase(), N = n.get(m) ?? [];
1951
+ N.includes(r.location) || n.set(m, [...N, r.location]);
1952
1952
  }
1953
1953
  }
1954
1954
  }
1955
- for (const [a, l] of o)
1956
- l.length > 1 && t.push({
1955
+ for (const [r, a] of o)
1956
+ a.length > 1 && t.push({
1957
1957
  severity: "error",
1958
1958
  code: "workspace.packageName",
1959
- message: `Package name ${a} is declared by ${l.length} modules: ${l.join(", ")}`,
1959
+ message: `Package name ${r} is declared by ${a.length} modules: ${a.join(", ")}`,
1960
1960
  messageKey: "devStudio.issue.duplicatePackage",
1961
- params: { name: a, count: l.length, modules: l.join(", ") }
1961
+ params: { name: r, count: a.length, modules: a.join(", ") }
1962
1962
  });
1963
- const s = new Set([...i.knownDuplicates ?? []].map((a) => a.toLowerCase()));
1964
- for (const [a, l] of n)
1965
- l.length > 1 && !s.has(a) && t.push({
1963
+ const s = new Set([...i.knownDuplicates ?? []].map((r) => r.toLowerCase()));
1964
+ for (const [r, a] of n)
1965
+ a.length > 1 && !s.has(r) && t.push({
1966
1966
  severity: "error",
1967
1967
  code: "workspace.entityName",
1968
- message: `Entity ${a} is declared by ${l.length} modules of the same group: ${l.join(", ")}`,
1968
+ message: `Entity ${r} is declared by ${a.length} modules of the same group: ${a.join(", ")}`,
1969
1969
  messageKey: "devStudio.issue.duplicateEntity",
1970
- params: { name: a, count: l.length, modules: l.join(", ") }
1970
+ params: { name: r, count: a.length, modules: a.join(", ") }
1971
1971
  });
1972
1972
  return t;
1973
1973
  }
1974
- const ne = (e) => typeof e == "object" && e !== null && !Array.isArray(e), te = (e) => typeof e == "string" && e ? e : void 0, ii = /* @__PURE__ */ new Set([
1974
+ const ne = (e) => typeof e == "object" && e !== null && !Array.isArray(e), te = (e) => typeof e == "string" && e ? e : void 0, si = /* @__PURE__ */ new Set([
1975
1975
  "slug",
1976
1976
  "category",
1977
1977
  "subCategory",
@@ -1994,8 +1994,8 @@ function Ze(e) {
1994
1994
  ne(o) && (i[t] = { ...o, name: String(o.name ?? "") });
1995
1995
  return i;
1996
1996
  }
1997
- function ni(e, i) {
1998
- const t = ne(e) ? e : {}, o = Object.fromEntries(Object.entries(t).filter(([n]) => !ii.has(n)));
1997
+ function oi(e, i) {
1998
+ const t = ne(e) ? e : {}, o = Object.fromEntries(Object.entries(t).filter(([n]) => !si.has(n)));
1999
1999
  return {
2000
2000
  id: String(t.slug ?? ""),
2001
2001
  category: te(t.category),
@@ -2015,21 +2015,21 @@ function ni(e, i) {
2015
2015
  ...i ? { readOnly: i } : {}
2016
2016
  };
2017
2017
  }
2018
- const je = (e) => Object.fromEntries(Object.entries(e).filter(([, i]) => i !== void 0));
2018
+ const Ee = (e) => Object.fromEntries(Object.entries(e).filter(([, i]) => i !== void 0));
2019
2019
  function Me(e, i) {
2020
- var l;
2021
- const t = ne(i) ? i : {}, o = (Array.isArray(t.modules) ? t.modules : []).filter(ne), s = JSON.stringify(He(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, a = (y) => {
2022
- const p = o.find((u) => u.packageName === y.moduleId);
2023
- return je({
2020
+ var a;
2021
+ const t = ne(i) ? i : {}, o = (Array.isArray(t.modules) ? t.modules : []).filter(ne), s = JSON.stringify(He(t.tags) ?? []) === JSON.stringify(e.tags ?? []) ? t.tags : (a = e.tags) != null && a.length ? typeof t.tags == "string" ? e.tags.join(",") : e.tags : void 0, r = (u) => {
2022
+ const p = o.find((m) => m.packageName === u.moduleId);
2023
+ return Ee({
2024
2024
  ...p,
2025
- packageName: y.moduleId,
2025
+ packageName: u.moduleId,
2026
2026
  // seed entries spell `required` out, also when it is false
2027
- required: y.required === !0 ? !0 : !p || "required" in p ? !1 : void 0,
2028
- condition: y.condition || void 0,
2029
- description: y.description || void 0
2027
+ required: u.required === !0 ? !0 : !p || "required" in p ? !1 : void 0,
2028
+ condition: u.condition || void 0,
2029
+ description: u.description || void 0
2030
2030
  });
2031
2031
  };
2032
- return je({
2032
+ return Ee({
2033
2033
  ...t,
2034
2034
  slug: e.id,
2035
2035
  category: e.category,
@@ -2040,7 +2040,7 @@ function Me(e, i) {
2040
2040
  ...e.extra,
2041
2041
  tags: s,
2042
2042
  translations: e.translations,
2043
- modules: e.modules.map(a)
2043
+ modules: e.modules.map(r)
2044
2044
  });
2045
2045
  }
2046
2046
  function De(e, i = "en") {
@@ -2049,7 +2049,7 @@ function De(e, i = "en") {
2049
2049
  name: e.name,
2050
2050
  ...e.description ? { description: e.description } : {}
2051
2051
  });
2052
- const o = je({
2052
+ const o = Ee({
2053
2053
  isActive: e.isActive,
2054
2054
  compliance: e.compliance,
2055
2055
  defaultLanguage: e.defaultLanguage ?? void 0,
@@ -2074,7 +2074,7 @@ function De(e, i = "en") {
2074
2074
  readOnly: e.source === "seed" || e.source === "code"
2075
2075
  };
2076
2076
  }
2077
- function si(e) {
2077
+ function ai(e) {
2078
2078
  const i = e.extra ?? {};
2079
2079
  return {
2080
2080
  slug: e.id,
@@ -2094,239 +2094,239 @@ function si(e) {
2094
2094
  ...typeof i.defaultLanguage == "string" ? { defaultLanguage: i.defaultLanguage } : {}
2095
2095
  };
2096
2096
  }
2097
- const F = (...e) => e.filter(Boolean).join("/"), oi = (e) => e.slice(0, Math.max(0, e.lastIndexOf("/"))), ai = (e) => e.slice(e.lastIndexOf("/") + 1), he = (e) => typeof e == "object" && e !== null && !Array.isArray(e), se = (e) => typeof e == "string" && e ? e : void 0, ri = /* @__PURE__ */ new Set(["bin", "obj", "node_modules"]), we = (e) => e.startsWith(".") || ri.has(e), li = /^wizard-templates-.+\.seed\.json$/i, ci = /^(\d{4})(\d{2})(\d{2})T(\d{2})(\d{2})(\d{2})(\d{3})Z$/;
2098
- function ve(e) {
2097
+ const P = (...e) => e.filter(Boolean).join("/"), ri = (e) => e.slice(0, Math.max(0, e.lastIndexOf("/"))), li = (e) => e.slice(e.lastIndexOf("/") + 1), we = (e) => typeof e == "object" && e !== null && !Array.isArray(e), se = (e) => typeof e == "string" && e ? e : void 0, ci = /* @__PURE__ */ new Set(["bin", "obj", "node_modules"]), ve = (e) => e.startsWith(".") || ci.has(e), di = /^wizard-templates-.+\.seed\.json$/i, pi = /^(\d{4})(\d{2})(\d{2})T(\d{2})(\d{2})(\d{2})(\d{3})Z$/;
2098
+ function be(e) {
2099
2099
  const i = (t, o = 2) => String(t).padStart(o, "0");
2100
2100
  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`;
2101
2101
  }
2102
- function di(e) {
2103
- const i = ci.exec(e);
2102
+ function ui(e) {
2103
+ const i = pi.exec(e);
2104
2104
  return i ? Date.UTC(+i[1], +i[2] - 1, +i[3], +i[4], +i[5], +i[6], +i[7]) : void 0;
2105
2105
  }
2106
- const pi = (e, i) => F(oi(e), ".revisions", `${ai(e)}.${i}`), ui = (e) => e.normalize("NFKD").replace(/[̀-ͯ]/g, "").toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") || "custom";
2107
- function Si(e) {
2106
+ const mi = (e, i) => P(ri(e), ".revisions", `${li(e)}.${i}`), fi = (e) => e.normalize("NFKD").replace(/[̀-ͯ]/g, "").toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") || "custom";
2107
+ function ji(e) {
2108
2108
  const { roots: i } = e, t = e.revisions !== !1, o = e.now ?? (() => /* @__PURE__ */ new Date()), n = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map();
2109
- let a = null;
2110
- const l = (r) => {
2111
- const c = i.find((v) => v.id === r);
2109
+ let r = null;
2110
+ const a = (l) => {
2111
+ const c = i.find((v) => v.id === l);
2112
2112
  if (!c)
2113
- throw new Error(`Unknown workspace "${r}"`);
2113
+ throw new Error(`Unknown workspace "${l}"`);
2114
2114
  return c;
2115
- }, y = (r) => {
2116
- const c = l(r);
2115
+ }, u = (l) => {
2116
+ const c = a(l);
2117
2117
  if (c.readOnly)
2118
2118
  throw new Error(`Workspace "${c.label}" is read-only`);
2119
2119
  return c;
2120
2120
  };
2121
- async function p(r, c) {
2122
- const v = await r.read(c);
2121
+ async function p(l, c) {
2122
+ const v = await l.read(c);
2123
2123
  try {
2124
2124
  const $ = v ? z(v.text).value : void 0;
2125
- return he($) ? $ : {};
2125
+ return we($) ? $ : {};
2126
2126
  } catch {
2127
2127
  return {};
2128
2128
  }
2129
2129
  }
2130
- function u(r, c, v, $, A) {
2131
- const f = se($.packageName) ?? (c || r.id);
2130
+ function m(l, c, v, $, A) {
2131
+ const y = se($.packageName) ?? (c || l.id);
2132
2132
  return {
2133
- workspaceId: r.id,
2134
- id: f,
2133
+ workspaceId: l.id,
2134
+ id: y,
2135
2135
  packageId: se($.category),
2136
- label: se($.displayName) ?? f,
2136
+ label: se($.displayName) ?? y,
2137
2137
  description: se($.description),
2138
2138
  version: se($.version),
2139
2139
  location: c,
2140
- readOnly: r.readOnly,
2140
+ readOnly: l.readOnly,
2141
2141
  files: A,
2142
2142
  search: `${c} ${v}`
2143
2143
  };
2144
2144
  }
2145
- async function N(r) {
2145
+ async function N(l) {
2146
2146
  const c = /* @__PURE__ */ new Map(), v = async ($) => {
2147
- const A = await r.fs.list($), f = A.filter((k) => k.kind === "file" && k.name.toLowerCase().endsWith(".manifest.json")).map((k) => k.name).sort()[0];
2148
- if (f) {
2149
- const k = A.filter((D) => D.kind === "file").map((D) => D.name), M = u(
2150
- r,
2147
+ const A = await l.fs.list($), y = A.filter((S) => S.kind === "file" && S.name.toLowerCase().endsWith(".manifest.json")).map((S) => S.name).sort()[0];
2148
+ if (y) {
2149
+ const S = A.filter((D) => D.kind === "file").map((D) => D.name), M = m(
2150
+ l,
2151
2151
  $,
2152
- f,
2153
- await p(r.fs, F($, f)),
2154
- k
2152
+ y,
2153
+ await p(l.fs, P($, y)),
2154
+ S
2155
2155
  );
2156
- c.has(M.id.toLowerCase()) || (c.set(M.id.toLowerCase(), { ref: M, dir: $ }), s.set(`${r.id}:${M.id.toLowerCase()}`, $));
2156
+ c.has(M.id.toLowerCase()) || (c.set(M.id.toLowerCase(), { ref: M, dir: $ }), s.set(`${l.id}:${M.id.toLowerCase()}`, $));
2157
2157
  }
2158
- for (const k of A)
2159
- k.kind === "directory" && !we(k.name) && !($ === "" && k.name === L(r)) && await v(F($, k.name));
2158
+ for (const S of A)
2159
+ S.kind === "directory" && !ve(S.name) && !($ === "" && S.name === L(l)) && await v(P($, S.name));
2160
2160
  };
2161
2161
  return await v(""), c;
2162
2162
  }
2163
- const L = (r) => r.templatesDir === !1 ? void 0 : r.templatesDir ?? "Templates", I = (r) => {
2164
- n.delete(r.id), h.clear();
2165
- }, x = (r) => {
2166
- let c = n.get(r.id);
2167
- return c || (c = N(r), n.set(r.id, c), c.catch(() => n.delete(r.id))), c;
2163
+ const L = (l) => l.templatesDir === !1 ? void 0 : l.templatesDir ?? "Templates", I = (l) => {
2164
+ n.delete(l.id), h.clear();
2165
+ }, O = (l) => {
2166
+ let c = n.get(l.id);
2167
+ return c || (c = N(l), n.set(l.id, c), c.catch(() => n.delete(l.id))), c;
2168
2168
  };
2169
- async function O(r) {
2170
- const c = l(r.workspaceId), v = await x(c), $ = s.get(`${c.id}:${r.id.toLowerCase()}`), A = v.get(r.id.toLowerCase()) ?? ($ === void 0 ? void 0 : [...v.values()].find((f) => f.dir === $));
2169
+ async function x(l) {
2170
+ const c = a(l.workspaceId), v = await O(c), $ = s.get(`${c.id}:${l.id.toLowerCase()}`), A = v.get(l.id.toLowerCase()) ?? ($ === void 0 ? void 0 : [...v.values()].find((y) => y.dir === $));
2171
2171
  if (!A)
2172
- throw new Error(`Module "${r.id}" is not in "${c.label}"`);
2172
+ throw new Error(`Module "${l.id}" is not in "${c.label}"`);
2173
2173
  return { root: c, module: A };
2174
2174
  }
2175
- async function w(r, c) {
2176
- const v = [], $ = async (A, f) => {
2177
- const k = await r.list(F(c, A));
2178
- if (!(f && k.some((M) => M.kind === "file" && M.name.toLowerCase().endsWith(".manifest.json"))))
2179
- for (const M of k)
2180
- M.kind === "file" ? v.push(F(A, M.name)) : we(M.name) || await $(F(A, M.name), !0);
2175
+ async function w(l, c) {
2176
+ const v = [], $ = async (A, y) => {
2177
+ const S = await l.list(P(c, A));
2178
+ if (!(y && S.some((M) => M.kind === "file" && M.name.toLowerCase().endsWith(".manifest.json"))))
2179
+ for (const M of S)
2180
+ M.kind === "file" ? v.push(P(A, M.name)) : ve(M.name) || await $(P(A, M.name), !0);
2181
2181
  };
2182
2182
  return await $("", !1), v.sort();
2183
2183
  }
2184
- async function T(r, c, v, $) {
2185
- t && await r.write(pi(c, $), v);
2184
+ async function E(l, c, v, $) {
2185
+ t && await l.write(mi(c, $), v);
2186
2186
  }
2187
- async function m(r, c) {
2187
+ async function f(l, c) {
2188
2188
  const v = [], $ = async (A) => {
2189
- const f = await r.list(F(c, A));
2190
- for (const k of f)
2191
- if (k.kind === "directory" && k.name === ".revisions")
2192
- for (const M of await r.list(F(c, A, k.name))) {
2189
+ const y = await l.list(P(c, A));
2190
+ for (const S of y)
2191
+ if (S.kind === "directory" && S.name === ".revisions")
2192
+ for (const M of await l.list(P(c, A, S.name))) {
2193
2193
  const D = /^(.*)\.(\d{8}T\d{9}Z)$/.exec(M.name);
2194
2194
  M.kind === "file" && D && v.push({
2195
- path: F(A, D[1]),
2195
+ path: P(A, D[1]),
2196
2196
  stamp: D[2],
2197
- at: F(A, ".revisions", M.name)
2197
+ at: P(A, ".revisions", M.name)
2198
2198
  });
2199
2199
  }
2200
- else k.kind === "directory" && !we(k.name) && await $(F(A, k.name));
2200
+ else S.kind === "directory" && !ve(S.name) && await $(P(A, S.name));
2201
2201
  };
2202
2202
  return await $(""), v;
2203
2203
  }
2204
- async function b(r) {
2205
- const c = L(r);
2206
- return c ? (await r.fs.list(c)).filter((v) => v.kind === "file" && li.test(v.name)).map((v) => F(c, v.name)).sort() : [];
2204
+ async function b(l) {
2205
+ const c = L(l);
2206
+ return c ? (await l.fs.list(c)).filter((v) => v.kind === "file" && di.test(v.name)).map((v) => P(c, v.name)).sort() : [];
2207
2207
  }
2208
- async function g(r, c) {
2209
- const v = await r.fs.read(c);
2208
+ async function g(l, c) {
2209
+ const v = await l.fs.read(c);
2210
2210
  if (!v)
2211
2211
  return { text: "", entries: [] };
2212
2212
  const $ = z(v.text).value;
2213
2213
  return { text: v.text, entries: Array.isArray($) ? $ : [] };
2214
2214
  }
2215
- const E = {
2216
- arrayKey: (r) => r === "" ? "slug" : r.endsWith("/modules") ? "packageName" : void 0
2215
+ const T = {
2216
+ arrayKey: (l) => l === "" ? "slug" : l.endsWith("/modules") ? "packageName" : void 0
2217
2217
  };
2218
- async function C(r, c, v, $) {
2219
- if (v && await T(r.fs, c, v, ve(o())), $.length === 0) {
2220
- await r.fs.remove(c);
2218
+ async function C(l, c, v, $) {
2219
+ if (v && await E(l.fs, c, v, be(o())), $.length === 0) {
2220
+ await l.fs.remove(c);
2221
2221
  return;
2222
2222
  }
2223
- await r.fs.write(
2223
+ await l.fs.write(
2224
2224
  c,
2225
- v ? qe(v, $, E) : le($)
2225
+ v ? qe(v, $, T) : le($)
2226
2226
  );
2227
2227
  }
2228
2228
  const h = /* @__PURE__ */ new Map();
2229
- function S(r, c) {
2230
- const v = `${r.id}:${c.dir}`;
2229
+ function k(l, c) {
2230
+ const v = `${l.id}:${c.dir}`;
2231
2231
  let $ = h.get(v);
2232
2232
  if (!$) {
2233
- const A = (c.ref.files ?? []).filter((f) => /\.(manifest|entities)\.json$/i.test(f));
2233
+ const A = (c.ref.files ?? []).filter((y) => /\.(manifest|entities)\.json$/i.test(y));
2234
2234
  $ = Promise.all(
2235
- A.map(async (f) => {
2236
- var k;
2235
+ A.map(async (y) => {
2236
+ var S;
2237
2237
  return {
2238
- path: f,
2239
- text: ((k = await r.fs.read(F(c.dir, f))) == null ? void 0 : k.text) ?? ""
2238
+ path: y,
2239
+ text: ((S = await l.fs.read(P(c.dir, y))) == null ? void 0 : S.text) ?? ""
2240
2240
  };
2241
2241
  })
2242
- ).then((f) => ({ location: c.dir, group: c.dir.split("/")[0], files: f })), h.set(v, $);
2242
+ ).then((y) => ({ location: c.dir, group: c.dir.split("/")[0], files: y })), h.set(v, $);
2243
2243
  }
2244
2244
  return $;
2245
2245
  }
2246
- async function d(r) {
2246
+ async function d(l) {
2247
2247
  var c;
2248
- return a || await ((c = j.listTemplates) == null ? void 0 : c.call(j)), a == null ? void 0 : a.get(r.toLowerCase());
2248
+ return r || await ((c = j.listTemplates) == null ? void 0 : c.call(j)), r == null ? void 0 : r.get(l.toLowerCase());
2249
2249
  }
2250
2250
  const j = {
2251
2251
  invalidate() {
2252
- n.clear(), h.clear(), a = null;
2252
+ n.clear(), h.clear(), r = null;
2253
2253
  },
2254
2254
  async listWorkspaces() {
2255
- return i.map((r) => ({
2256
- id: r.id,
2257
- label: r.label,
2258
- ...r.description ? { description: r.description } : {},
2259
- ...r.icon ? { icon: r.icon } : {},
2260
- ...r.readOnly ? { readOnly: !0 } : {}
2255
+ return i.map((l) => ({
2256
+ id: l.id,
2257
+ label: l.label,
2258
+ ...l.description ? { description: l.description } : {},
2259
+ ...l.icon ? { icon: l.icon } : {},
2260
+ ...l.readOnly ? { readOnly: !0 } : {}
2261
2261
  }));
2262
2262
  },
2263
- async listModules(r) {
2264
- const c = i.findIndex((f) => f.id === r), v = l(r);
2263
+ async listModules(l) {
2264
+ const c = i.findIndex((y) => y.id === l), v = a(l);
2265
2265
  I(v);
2266
- const $ = await x(v), A = await Promise.all(
2267
- i.slice(0, c).map(async (f) => ({ r: f, modules: await x(f) }))
2266
+ const $ = await O(v), A = await Promise.all(
2267
+ i.slice(0, c).map(async (y) => ({ r: y, modules: await O(y) }))
2268
2268
  );
2269
- return [...$.values()].map(({ ref: f }) => {
2270
- const k = A.find((M) => M.modules.has(f.id.toLowerCase()));
2271
- return k ? { ...f, shadowedBy: k.r.id } : f;
2272
- }).sort((f, k) => f.id.localeCompare(k.id));
2269
+ return [...$.values()].map(({ ref: y }) => {
2270
+ const S = A.find((M) => M.modules.has(y.id.toLowerCase()));
2271
+ return S ? { ...y, shadowedBy: S.r.id } : y;
2272
+ }).sort((y, S) => y.id.localeCompare(S.id));
2273
2273
  },
2274
- async readModule(r) {
2275
- const { root: c, module: v } = await O(r), $ = await w(c.fs, v.dir), A = [];
2276
- for (const f of $) {
2277
- const k = await c.fs.read(F(v.dir, f));
2278
- k && A.push({
2279
- path: f,
2280
- text: k.text,
2281
- version: k.version,
2274
+ async readModule(l) {
2275
+ const { root: c, module: v } = await x(l), $ = await w(c.fs, v.dir), A = [];
2276
+ for (const y of $) {
2277
+ const S = await c.fs.read(P(v.dir, y));
2278
+ S && A.push({
2279
+ path: y,
2280
+ text: S.text,
2281
+ version: S.version,
2282
2282
  ...c.readOnly ? { readOnly: !0 } : {}
2283
2283
  });
2284
2284
  }
2285
2285
  return A;
2286
2286
  },
2287
- async writeModule(r, c) {
2288
- const { module: v } = await O(r), $ = y(r.workspaceId), A = /* @__PURE__ */ new Map(), f = [];
2287
+ async writeModule(l, c) {
2288
+ const { module: v } = await x(l), $ = u(l.workspaceId), A = /* @__PURE__ */ new Map(), y = [];
2289
2289
  for (const D of c) {
2290
2290
  if (D.path.split("/").some((X) => X === ".." || X === "" || X.startsWith(".")))
2291
2291
  throw new Error(`Refusing to write outside the module: ${D.path}`);
2292
- const R = await $.fs.read(F(v.dir, D.path));
2292
+ const R = await $.fs.read(P(v.dir, D.path));
2293
2293
  A.set(D.path, R);
2294
2294
  const H = D.baseVersion;
2295
- (H === void 0 ? R !== null && D.type === "write" : (R == null ? void 0 : R.version) !== H) && f.push({ path: D.path, ...R ? { currentVersion: R.version } : {} });
2295
+ (H === void 0 ? R !== null && D.type === "write" : (R == null ? void 0 : R.version) !== H) && y.push({ path: D.path, ...R ? { currentVersion: R.version } : {} });
2296
2296
  }
2297
- if (f.length)
2298
- return { ok: !1, conflicts: f };
2299
- const k = ve(o()), M = {};
2297
+ if (y.length)
2298
+ return { ok: !1, conflicts: y };
2299
+ const S = be(o()), M = {};
2300
2300
  for (const D of c) {
2301
- const R = F(v.dir, D.path), H = A.get(D.path);
2302
- H && await T($.fs, R, H.text, k), D.type === "write" ? M[D.path] = await $.fs.write(R, D.text) : await $.fs.remove(R);
2301
+ const R = P(v.dir, D.path), H = A.get(D.path);
2302
+ H && await E($.fs, R, H.text, S), D.type === "write" ? M[D.path] = await $.fs.write(R, D.text) : await $.fs.remove(R);
2303
2303
  }
2304
- return I($), { ok: !0, versions: M, revision: k };
2304
+ return I($), { ok: !0, versions: M, revision: S };
2305
2305
  },
2306
- async createModule(r) {
2307
- var f;
2308
- const c = y(r.workspaceId), v = r.id.startsWith(G) ? r.id.slice(G.length) : r.id.split(".").pop() ?? r.id, $ = ((f = e.moduleFolder) == null ? void 0 : f.call(e, r)) ?? F(
2309
- P(r.packageId ?? "") || "Custom",
2310
- P(v) || "Module"
2306
+ async createModule(l) {
2307
+ var y;
2308
+ const c = u(l.workspaceId), v = l.id.startsWith(G) ? l.id.slice(G.length) : l.id.split(".").pop() ?? l.id, $ = ((y = e.moduleFolder) == null ? void 0 : y.call(e, l)) ?? P(
2309
+ F(l.packageId ?? "") || "Custom",
2310
+ F(v) || "Module"
2311
2311
  );
2312
2312
  if ((await c.fs.list($)).length > 0)
2313
2313
  throw new Error(`The folder ${$} is not empty`);
2314
- if ((await x(c)).has(r.id.toLowerCase()))
2315
- throw new Error(`"${r.id}" already exists in ${c.label}`);
2316
- for (const k of r.files)
2317
- await c.fs.write(F($, k.path), k.text);
2314
+ if ((await O(c)).has(l.id.toLowerCase()))
2315
+ throw new Error(`"${l.id}" already exists in ${c.label}`);
2316
+ for (const S of l.files)
2317
+ await c.fs.write(P($, S.path), S.text);
2318
2318
  I(c);
2319
- const A = (await x(c)).get(r.id.toLowerCase());
2319
+ const A = (await O(c)).get(l.id.toLowerCase());
2320
2320
  if (!A)
2321
- throw new Error(`The new module ${r.id} has no manifest naming it`);
2321
+ throw new Error(`The new module ${l.id} has no manifest naming it`);
2322
2322
  return A.ref;
2323
2323
  },
2324
- async deleteModule(r) {
2325
- const { module: c } = await O(r), v = y(r.workspaceId);
2326
- await v.fs.removeDir(c.dir), s.delete(`${v.id}:${r.id.toLowerCase()}`), I(v);
2324
+ async deleteModule(l) {
2325
+ const { module: c } = await x(l), v = u(l.workspaceId);
2326
+ await v.fs.removeDir(c.dir), s.delete(`${v.id}:${l.id.toLowerCase()}`), I(v);
2327
2327
  },
2328
2328
  async listTemplates() {
2329
- const r = /* @__PURE__ */ new Map(), c = [];
2329
+ const l = /* @__PURE__ */ new Map(), c = [];
2330
2330
  for (const v of i)
2331
2331
  for (const $ of await b(v)) {
2332
2332
  let A;
@@ -2335,113 +2335,113 @@ function Si(e) {
2335
2335
  } catch {
2336
2336
  continue;
2337
2337
  }
2338
- for (const f of A) {
2339
- const k = ni(f, v.readOnly);
2340
- k.id && !r.has(k.id.toLowerCase()) && (r.set(k.id.toLowerCase(), { rootId: v.id, path: $ }), c.push(k));
2338
+ for (const y of A) {
2339
+ const S = oi(y, v.readOnly);
2340
+ S.id && !l.has(S.id.toLowerCase()) && (l.set(S.id.toLowerCase(), { rootId: v.id, path: $ }), c.push(S));
2341
2341
  }
2342
2342
  }
2343
- return a = r, c;
2343
+ return r = l, c;
2344
2344
  },
2345
- async saveTemplate(r, c) {
2346
- const v = (c == null ? void 0 : c.previousId) ?? r.id, $ = await d(v);
2345
+ async saveTemplate(l, c) {
2346
+ const v = (c == null ? void 0 : c.previousId) ?? l.id, $ = await d(v);
2347
2347
  if ($) {
2348
- const A = y($.rootId), { text: f, entries: k } = await g(A, $.path), M = k.findIndex(
2349
- (R) => he(R) && String(R.slug ?? "").toLowerCase() === v.toLowerCase()
2350
- ), D = [...k];
2348
+ const A = u($.rootId), { text: y, entries: S } = await g(A, $.path), M = S.findIndex(
2349
+ (R) => we(R) && String(R.slug ?? "").toLowerCase() === v.toLowerCase()
2350
+ ), D = [...S];
2351
2351
  D[M < 0 ? D.length : M] = Me(
2352
- r,
2353
- M < 0 ? void 0 : k[M]
2354
- ), await C(A, $.path, f, D);
2352
+ l,
2353
+ M < 0 ? void 0 : S[M]
2354
+ ), await C(A, $.path, y, D);
2355
2355
  } else {
2356
2356
  const A = i.find((D) => !D.readOnly && L(D));
2357
2357
  if (!A)
2358
2358
  throw new Error("No writable folder holds templates");
2359
- const f = F(
2359
+ const y = P(
2360
2360
  L(A),
2361
- `wizard-templates-${ui(r.category ?? "custom")}.seed.json`
2362
- ), { text: k, entries: M } = await g(A, f);
2363
- await C(A, f, k, [...M, Me(r)]);
2361
+ `wizard-templates-${fi(l.category ?? "custom")}.seed.json`
2362
+ ), { text: S, entries: M } = await g(A, y);
2363
+ await C(A, y, S, [...M, Me(l)]);
2364
2364
  }
2365
- return a = null, { ...r, extra: r.extra };
2365
+ return r = null, { ...l, extra: l.extra };
2366
2366
  },
2367
- async deleteTemplate(r) {
2368
- const c = await d(r);
2367
+ async deleteTemplate(l) {
2368
+ const c = await d(l);
2369
2369
  if (!c)
2370
2370
  return;
2371
- const v = y(c.rootId), { text: $, entries: A } = await g(v, c.path);
2371
+ const v = u(c.rootId), { text: $, entries: A } = await g(v, c.path);
2372
2372
  await C(
2373
2373
  v,
2374
2374
  c.path,
2375
2375
  $,
2376
2376
  A.filter(
2377
- (f) => !(he(f) && String(f.slug ?? "").toLowerCase() === r.toLowerCase())
2377
+ (y) => !(we(y) && String(y.slug ?? "").toLowerCase() === l.toLowerCase())
2378
2378
  )
2379
- ), a = null;
2379
+ ), r = null;
2380
2380
  },
2381
- async validate(r, c) {
2382
- const v = l(r.workspaceId), $ = [...(await x(v)).values()], A = await Promise.all(
2383
- $.filter((M) => M.ref.id.toLowerCase() !== r.id.toLowerCase()).map((M) => S(v, M))
2384
- ), f = $.find((M) => M.ref.id.toLowerCase() === r.id.toLowerCase()), k = (f == null ? void 0 : f.dir) ?? r.id;
2385
- return ti(
2386
- [...A, { location: k, group: k.split("/")[0], files: c }],
2381
+ async validate(l, c) {
2382
+ const v = a(l.workspaceId), $ = [...(await O(v)).values()], A = await Promise.all(
2383
+ $.filter((M) => M.ref.id.toLowerCase() !== l.id.toLowerCase()).map((M) => k(v, M))
2384
+ ), y = $.find((M) => M.ref.id.toLowerCase() === l.id.toLowerCase()), S = (y == null ? void 0 : y.dir) ?? l.id;
2385
+ return ni(
2386
+ [...A, { location: S, group: S.split("/")[0], files: c }],
2387
2387
  {
2388
2388
  knownDuplicates: e.knownDuplicates
2389
2389
  }
2390
- ).filter((M) => M.message.split(/[ ,]+/).includes(k));
2390
+ ).filter((M) => M.message.split(/[ ,]+/).includes(S));
2391
2391
  },
2392
- async listRevisions(r, c) {
2393
- const { root: v, module: $ } = await O(r), A = (await m(v.fs, $.dir)).filter(
2394
- (k) => !c || k.path === c
2395
- ), f = /* @__PURE__ */ new Map();
2396
- for (const k of A)
2397
- f.set(k.stamp, [...f.get(k.stamp) ?? [], k.path]);
2398
- return [...f].map(([k, M]) => ({
2399
- id: k,
2400
- timestamp: di(k) ?? 0,
2392
+ async listRevisions(l, c) {
2393
+ const { root: v, module: $ } = await x(l), A = (await f(v.fs, $.dir)).filter(
2394
+ (S) => !c || S.path === c
2395
+ ), y = /* @__PURE__ */ new Map();
2396
+ for (const S of A)
2397
+ y.set(S.stamp, [...y.get(S.stamp) ?? [], S.path]);
2398
+ return [...y].map(([S, M]) => ({
2399
+ id: S,
2400
+ timestamp: ui(S) ?? 0,
2401
2401
  summary: M.sort().join(", "),
2402
2402
  ...c ? { path: c } : {}
2403
- })).sort((k, M) => M.timestamp - k.timestamp);
2403
+ })).sort((S, M) => M.timestamp - S.timestamp);
2404
2404
  },
2405
- async readRevision(r, c, v) {
2405
+ async readRevision(l, c, v) {
2406
2406
  var M;
2407
- const { root: $, module: A } = await O(r), f = (await m($.fs, A.dir)).filter(
2407
+ const { root: $, module: A } = await x(l), y = (await f($.fs, A.dir)).filter(
2408
2408
  (D) => D.stamp === c && (!v || D.path === v)
2409
2409
  );
2410
- if (f.length === 0)
2410
+ if (y.length === 0)
2411
2411
  throw new Error(`Unknown revision "${c}"`);
2412
- const k = {};
2413
- for (const D of f)
2414
- k[D.path] = ((M = await $.fs.read(F(A.dir, D.at))) == null ? void 0 : M.text) ?? "";
2415
- return v ? k[v] : JSON.stringify(k, null, 2);
2412
+ const S = {};
2413
+ for (const D of y)
2414
+ S[D.path] = ((M = await $.fs.read(P(A.dir, D.at))) == null ? void 0 : M.text) ?? "";
2415
+ return v ? S[v] : JSON.stringify(S, null, 2);
2416
2416
  },
2417
- async rollback(r, c, v) {
2417
+ async rollback(l, c, v) {
2418
2418
  var M;
2419
- const { module: $ } = await O(r), A = y(r.workspaceId), f = (await m(A.fs, $.dir)).filter(
2419
+ const { module: $ } = await x(l), A = u(l.workspaceId), y = (await f(A.fs, $.dir)).filter(
2420
2420
  (D) => D.stamp === c && (!v || D.path === v)
2421
2421
  );
2422
- if (f.length === 0)
2422
+ if (y.length === 0)
2423
2423
  throw new Error(`Unknown revision "${c}"`);
2424
- const k = ve(o());
2425
- for (const D of f) {
2426
- const R = F($.dir, D.path), H = ((M = await A.fs.read(F($.dir, D.at))) == null ? void 0 : M.text) ?? "", X = await A.fs.read(R);
2427
- X && await T(A.fs, R, X.text, k), await A.fs.write(R, H);
2424
+ const S = be(o());
2425
+ for (const D of y) {
2426
+ const R = P($.dir, D.path), H = ((M = await A.fs.read(P($.dir, D.at))) == null ? void 0 : M.text) ?? "", X = await A.fs.read(R);
2427
+ X && await E(A.fs, R, X.text, S), await A.fs.write(R, H);
2428
2428
  }
2429
2429
  I(A);
2430
2430
  }
2431
2431
  };
2432
2432
  return j;
2433
2433
  }
2434
- class be extends Error {
2434
+ class $e extends Error {
2435
2435
  constructor(i, t, o) {
2436
2436
  super(i), this.status = t, this.body = o, this.name = "OmniVerkRestError";
2437
2437
  }
2438
2438
  }
2439
- const mi = new TextDecoder("utf-8", { ignoreBOM: !0 });
2440
- function fi(e) {
2439
+ const yi = new TextDecoder("utf-8", { ignoreBOM: !0 });
2440
+ function gi(e) {
2441
2441
  const i = atob(e), t = new Uint8Array(i.length);
2442
2442
  for (let o = 0; o < i.length; o++)
2443
2443
  t[o] = i.charCodeAt(o);
2444
- return mi.decode(t);
2444
+ return yi.decode(t);
2445
2445
  }
2446
2446
  function Ke(e) {
2447
2447
  const i = new TextEncoder().encode(e);
@@ -2450,16 +2450,16 @@ function Ke(e) {
2450
2450
  t += String.fromCharCode(...i.subarray(o, o + 32768));
2451
2451
  return btoa(t);
2452
2452
  }
2453
- function yi(e) {
2453
+ function hi(e) {
2454
2454
  let i = 2166136261;
2455
2455
  for (let t = 0; t < e.length; t++)
2456
2456
  i = Math.imul(i ^ e.charCodeAt(t), 16777619);
2457
2457
  return `${e.length}:${(i >>> 0).toString(16)}`;
2458
2458
  }
2459
- function ki(e = {}) {
2460
- const i = (e.baseUrl ?? "/api").replace(/\/+$/, ""), t = e.fetch ?? ((p, u) => globalThis.fetch(p, u)), o = e.language ?? "en", n = encodeURIComponent;
2461
- async function s(p, u, N, L = "json") {
2462
- const I = typeof e.headers == "function" ? await e.headers() : e.headers ?? {}, x = await t(`${i}${u}`, {
2459
+ function Ei(e = {}) {
2460
+ const i = (e.baseUrl ?? "/api").replace(/\/+$/, ""), t = e.fetch ?? ((p, m) => globalThis.fetch(p, m)), o = e.language ?? "en", n = encodeURIComponent;
2461
+ async function s(p, m, N, L = "json") {
2462
+ const I = typeof e.headers == "function" ? await e.headers() : e.headers ?? {}, O = await t(`${i}${m}`, {
2463
2463
  method: p,
2464
2464
  credentials: e.credentials ?? "same-origin",
2465
2465
  headers: {
@@ -2468,23 +2468,23 @@ function ki(e = {}) {
2468
2468
  ...I
2469
2469
  },
2470
2470
  ...N === void 0 ? {} : { body: JSON.stringify(N) }
2471
- }), O = await x.text();
2472
- let w = O;
2473
- if (L === "json" || !x.ok)
2471
+ }), x = await O.text();
2472
+ let w = x;
2473
+ if (L === "json" || !O.ok)
2474
2474
  try {
2475
- w = O ? JSON.parse(O) : void 0;
2475
+ w = x ? JSON.parse(x) : void 0;
2476
2476
  } catch {
2477
- w = O;
2477
+ w = x;
2478
2478
  }
2479
- if (!x.ok)
2480
- throw new be(
2481
- `${p} ${u}: ${x.status} ${x.statusText}`,
2482
- x.status,
2479
+ if (!O.ok)
2480
+ throw new $e(
2481
+ `${p} ${m}: ${O.status} ${O.statusText}`,
2482
+ O.status,
2483
2483
  w
2484
2484
  );
2485
2485
  return w;
2486
2486
  }
2487
- const a = e.templates === !1 ? {} : {
2487
+ const r = e.templates === !1 ? {} : {
2488
2488
  async listTemplates() {
2489
2489
  const p = await s(
2490
2490
  "GET",
@@ -2499,16 +2499,16 @@ function ki(e = {}) {
2499
2499
  )
2500
2500
  )).map((N) => De(N, o));
2501
2501
  },
2502
- async saveTemplate(p, u) {
2503
- const N = (u == null ? void 0 : u.previousId) ?? p.id, L = si(p);
2502
+ async saveTemplate(p, m) {
2503
+ const N = (m == null ? void 0 : m.previousId) ?? p.id, L = ai(p);
2504
2504
  let I;
2505
- if ((u == null ? void 0 : u.previousId) === void 0)
2505
+ if ((m == null ? void 0 : m.previousId) === void 0)
2506
2506
  I = await s(
2507
2507
  "GET",
2508
2508
  `/module-templates/${n(p.id)}?lang=${n(o)}`
2509
2509
  ).then(
2510
2510
  () => !0,
2511
- (O) => O instanceof be && O.status === 404 ? !1 : Promise.reject(O)
2511
+ (x) => x instanceof $e && x.status === 404 ? !1 : Promise.reject(x)
2512
2512
  ) ? await s(
2513
2513
  "PUT",
2514
2514
  `/module-templates/${n(p.id)}?lang=${n(o)}`,
@@ -2532,12 +2532,12 @@ function ki(e = {}) {
2532
2532
  }
2533
2533
  };
2534
2534
  if ((e.mode ?? "manifest-only") === "manifest-only") {
2535
- const p = "seed", u = /* @__PURE__ */ new Map(), N = (I) => {
2536
- var x, O;
2537
- return ((x = u.get(I)) == null ? void 0 : x.manifestFile) ?? `${(O = I.split(".").pop()) == null ? void 0 : O.toLowerCase()}.manifest.json`;
2535
+ const p = "seed", m = /* @__PURE__ */ new Map(), N = (I) => {
2536
+ var O, x;
2537
+ return ((O = m.get(I)) == null ? void 0 : O.manifestFile) ?? `${(x = I.split(".").pop()) == null ? void 0 : x.toLowerCase()}.manifest.json`;
2538
2538
  }, L = async (I) => {
2539
- const x = await s("GET", `/module-manifests/${n(I)}`), O = le(x, { finalNewline: !1 });
2540
- return { path: N(I), text: O, version: yi(O) };
2539
+ const O = await s("GET", `/module-manifests/${n(I)}`), x = le(O, { finalNewline: !1 });
2540
+ return { path: N(I), text: x, version: hi(x) };
2541
2541
  };
2542
2542
  return {
2543
2543
  async listWorkspaces() {
@@ -2545,16 +2545,16 @@ function ki(e = {}) {
2545
2545
  },
2546
2546
  async listModules() {
2547
2547
  const I = await s("GET", "/module-manifests");
2548
- return u.clear(), (I ?? []).map((x) => (u.set(x.packageName, x), {
2548
+ return m.clear(), (I ?? []).map((O) => (m.set(O.packageName, O), {
2549
2549
  workspaceId: p,
2550
- id: x.packageName,
2550
+ id: O.packageName,
2551
2551
  // the package is the manifest's category, as in the `files` mode and OmniVerk's own
2552
2552
  // trees (1.3.14); the first folder only while the API does not list the category
2553
- packageId: x.category || x.path.split("/")[0] || void 0,
2554
- label: x.packageName,
2555
- location: x.path,
2556
- files: [x.manifestFile],
2557
- search: x.path,
2553
+ packageId: O.category || O.path.split("/")[0] || void 0,
2554
+ label: O.packageName,
2555
+ location: O.path,
2556
+ files: [O.manifestFile],
2557
+ search: O.path,
2558
2558
  // only the manifest: the checks and the preview do not count what is not given
2559
2559
  contents: "manifest"
2560
2560
  }));
@@ -2562,28 +2562,28 @@ function ki(e = {}) {
2562
2562
  async readModule(I) {
2563
2563
  return [await L(I.id)];
2564
2564
  },
2565
- async writeModule(I, x) {
2566
- const O = N(I.id), w = x.find((E) => E.path !== O || E.type !== "write");
2565
+ async writeModule(I, O) {
2566
+ const x = N(I.id), w = O.find((T) => T.path !== x || T.type !== "write");
2567
2567
  if (w)
2568
2568
  throw new Error(
2569
2569
  `This OmniVerk API stores only the manifest; "${w.path}" was not saved.`
2570
2570
  );
2571
- const T = x[0];
2572
- if (!T || T.type !== "write")
2571
+ const E = O[0];
2572
+ if (!E || E.type !== "write")
2573
2573
  return { ok: !0, versions: {} };
2574
- const m = await L(I.id);
2575
- if (T.baseVersion !== void 0 && T.baseVersion !== m.version)
2576
- return { ok: !1, conflicts: [{ path: O, currentVersion: m.version }] };
2574
+ const f = await L(I.id);
2575
+ if (E.baseVersion !== void 0 && E.baseVersion !== f.version)
2576
+ return { ok: !1, conflicts: [{ path: x, currentVersion: f.version }] };
2577
2577
  const b = await s(
2578
2578
  "PUT",
2579
2579
  `/module-manifests/${n(I.id)}`,
2580
2580
  {
2581
- manifest: z(T.text).value
2581
+ manifest: z(E.text).value
2582
2582
  }
2583
2583
  ), g = await L(I.id);
2584
2584
  return {
2585
2585
  ok: !0,
2586
- versions: { [O]: g.version },
2586
+ versions: { [x]: g.version },
2587
2587
  ...b != null && b.revision ? { revision: b.revision } : {}
2588
2588
  };
2589
2589
  },
@@ -2591,31 +2591,31 @@ function ki(e = {}) {
2591
2591
  return (await s(
2592
2592
  "GET",
2593
2593
  `/module-manifests/${n(I.id)}/revisions`
2594
- ) ?? []).map((O) => ({
2595
- id: O.id,
2596
- timestamp: Date.parse(O.at) || 0,
2594
+ ) ?? []).map((x) => ({
2595
+ id: x.id,
2596
+ timestamp: Date.parse(x.at) || 0,
2597
2597
  path: N(I.id),
2598
- ...O.sizeBytes !== void 0 ? { summary: `${O.sizeBytes} B` } : {}
2598
+ ...x.sizeBytes !== void 0 ? { summary: `${x.sizeBytes} B` } : {}
2599
2599
  }));
2600
2600
  },
2601
- async readRevision(I, x) {
2601
+ async readRevision(I, O) {
2602
2602
  return s(
2603
2603
  "GET",
2604
- `/module-manifests/${n(I.id)}/revisions/${n(x)}`,
2604
+ `/module-manifests/${n(I.id)}/revisions/${n(O)}`,
2605
2605
  void 0,
2606
2606
  "text"
2607
2607
  );
2608
2608
  },
2609
- async rollback(I, x) {
2609
+ async rollback(I, O) {
2610
2610
  await s(
2611
2611
  "POST",
2612
- `/module-manifests/${n(I.id)}/revisions/${n(x)}/rollback`
2612
+ `/module-manifests/${n(I.id)}/revisions/${n(O)}/rollback`
2613
2613
  );
2614
2614
  },
2615
- ...a
2615
+ ...r
2616
2616
  };
2617
2617
  }
2618
- const l = (p) => `/module-files/${n(p.workspaceId)}/modules/${n(p.id)}`, y = (p) => p.map((u) => ({ path: u.path, content: Ke(u.text) }));
2618
+ const a = (p) => `/module-files/${n(p.workspaceId)}/modules/${n(p.id)}`, u = (p) => p.map((m) => ({ path: m.path, content: Ke(m.text) }));
2619
2619
  return {
2620
2620
  async listWorkspaces() {
2621
2621
  return s("GET", "/module-files/workspaces");
@@ -2627,22 +2627,22 @@ function ki(e = {}) {
2627
2627
  ) ?? []).map((N) => ({ ...N, workspaceId: p }));
2628
2628
  },
2629
2629
  async readModule(p) {
2630
- const u = await s("GET", l(p));
2631
- return ((u == null ? void 0 : u.files) ?? []).map((N) => ({
2630
+ const m = await s("GET", a(p));
2631
+ return ((m == null ? void 0 : m.files) ?? []).map((N) => ({
2632
2632
  path: N.path,
2633
- text: fi(N.content),
2633
+ text: gi(N.content),
2634
2634
  ...N.version ? { version: N.version } : {},
2635
2635
  ...N.readOnly ? { readOnly: !0 } : {}
2636
2636
  }));
2637
2637
  },
2638
- async writeModule(p, u) {
2638
+ async writeModule(p, m) {
2639
2639
  var N;
2640
2640
  try {
2641
2641
  const L = await s(
2642
2642
  "PUT",
2643
- l(p),
2643
+ a(p),
2644
2644
  {
2645
- changes: u.map(
2645
+ changes: m.map(
2646
2646
  (I) => I.type === "write" ? {
2647
2647
  type: "write",
2648
2648
  path: I.path,
@@ -2658,8 +2658,8 @@ function ki(e = {}) {
2658
2658
  ...L != null && L.revision ? { revision: L.revision } : {}
2659
2659
  };
2660
2660
  } catch (L) {
2661
- if (L instanceof be && L.status === 409)
2662
- return { ok: !1, conflicts: ((N = L.body) == null ? void 0 : N.conflicts) ?? u.map((x) => ({ path: x.path })) };
2661
+ if (L instanceof $e && L.status === 409)
2662
+ return { ok: !1, conflicts: ((N = L.body) == null ? void 0 : N.conflicts) ?? m.map((O) => ({ path: O.path })) };
2663
2663
  throw L;
2664
2664
  }
2665
2665
  },
@@ -2670,44 +2670,44 @@ function ki(e = {}) {
2670
2670
  {
2671
2671
  packageId: p.packageId,
2672
2672
  id: p.id,
2673
- files: y(p.files)
2673
+ files: u(p.files)
2674
2674
  }
2675
2675
  ), workspaceId: p.workspaceId };
2676
2676
  },
2677
2677
  async deleteModule(p) {
2678
- await s("DELETE", l(p));
2678
+ await s("DELETE", a(p));
2679
2679
  },
2680
- async listRevisions(p, u) {
2680
+ async listRevisions(p, m) {
2681
2681
  return s(
2682
2682
  "GET",
2683
- `${l(p)}/revisions${u ? `?path=${n(u)}` : ""}`
2683
+ `${a(p)}/revisions${m ? `?path=${n(m)}` : ""}`
2684
2684
  );
2685
2685
  },
2686
- async readRevision(p, u, N) {
2686
+ async readRevision(p, m, N) {
2687
2687
  return s(
2688
2688
  "GET",
2689
- `${l(p)}/revisions/${n(u)}${N ? `?path=${n(N)}` : ""}`,
2689
+ `${a(p)}/revisions/${n(m)}${N ? `?path=${n(N)}` : ""}`,
2690
2690
  void 0,
2691
2691
  "text"
2692
2692
  );
2693
2693
  },
2694
- async rollback(p, u, N) {
2694
+ async rollback(p, m, N) {
2695
2695
  await s(
2696
2696
  "POST",
2697
- `${l(p)}/revisions/${n(u)}/rollback${N ? `?path=${n(N)}` : ""}`
2697
+ `${a(p)}/revisions/${n(m)}/rollback${N ? `?path=${n(N)}` : ""}`
2698
2698
  );
2699
2699
  },
2700
2700
  ...e.serverValidation ? {
2701
- async validate(p, u) {
2702
- return s("POST", `${l(p)}/validate`, {
2703
- files: y(u)
2701
+ async validate(p, m) {
2702
+ return s("POST", `${a(p)}/validate`, {
2703
+ files: u(m)
2704
2704
  });
2705
2705
  }
2706
2706
  } : {},
2707
- ...a
2707
+ ...r
2708
2708
  };
2709
2709
  }
2710
- const gi = [
2710
+ const wi = [
2711
2711
  "en",
2712
2712
  "pl",
2713
2713
  "de",
@@ -2722,7 +2722,7 @@ const gi = [
2722
2722
  "ja",
2723
2723
  "ko",
2724
2724
  "zh-CN"
2725
- ], Te = (e) => {
2725
+ ], ye = (e) => {
2726
2726
  const i = e.find(
2727
2727
  (t) => !t.path.includes("/") && t.path.toLowerCase().endsWith(".manifest.json")
2728
2728
  );
@@ -2736,12 +2736,86 @@ const gi = [
2736
2736
  } catch {
2737
2737
  return { path: i.path, value: {} };
2738
2738
  }
2739
- }, hi = (e) => {
2739
+ }, vi = (e) => {
2740
2740
  var i;
2741
- return ((i = Te(e)) == null ? void 0 : i.path.replace(/\.manifest\.json$/i, "")) ?? "module";
2741
+ return ((i = ye(e)) == null ? void 0 : i.path.replace(/\.manifest\.json$/i, "")) ?? "module";
2742
+ }, Qe = {
2743
+ entity: [
2744
+ { prop: "referencedEntity", part: "tail" },
2745
+ { prop: "foreignKey" },
2746
+ { prop: "reference", part: "tail" },
2747
+ { prop: "references", part: "tail" },
2748
+ { prop: "entity", part: "tail" },
2749
+ { prop: "entityName", part: "tail" },
2750
+ { prop: "entityType", part: "tail" },
2751
+ { prop: "childEntity" },
2752
+ { prop: "sourceEntity" },
2753
+ { prop: "targetEntity" },
2754
+ { prop: "triggerEntity" },
2755
+ { prop: "source", within: "relations" },
2756
+ { prop: "target", within: "relations" },
2757
+ { prop: "from", part: "head", within: "relations" },
2758
+ { prop: "to", part: "head", within: "relations" },
2759
+ { prop: "from", part: "head", within: "relationships" },
2760
+ { prop: "to", part: "head", within: "relationships" },
2761
+ { prop: "dataSource", part: "query", files: /\.(views|panels)\.json$/i },
2762
+ { prop: "event", part: "head" },
2763
+ { prop: "trigger", part: "head", files: /lifesim/i },
2764
+ { prop: "source", part: "head", within: "variables", files: /\.workflows\.json$/i },
2765
+ { jsonIn: "viewJson" },
2766
+ { jsonIn: "optionsJson" },
2767
+ { keysOf: "seeds" },
2768
+ { keysOf: "demoSeeds" },
2769
+ { keysOf: "seeds.demo" },
2770
+ { keysOf: "translations.entities" },
2771
+ { keyPattern: "entity.{name}.", files: /i18n/i },
2772
+ { keyPattern: "field.{name}.", files: /i18n/i },
2773
+ { keyPattern: "status.{name}.", files: /i18n/i },
2774
+ { prop: "modules", files: /\.manifest\.json$/i },
2775
+ { keysOf: "entities", files: /iconconfig/i },
2776
+ { keysOf: "defaultRecordCounts" },
2777
+ { prop: "target", prefix: "form:", files: /tutorial/i },
2778
+ { prop: "target", within: "operations", files: /\.integrations\.json$/i },
2779
+ { prop: "source", within: "operations", files: /\.integrations\.json$/i },
2780
+ { prop: "name", within: "tables", table: !0, files: /\.datasources\.json$/i }
2781
+ ],
2782
+ dataSource: [
2783
+ { prop: "ref", files: /\.views\.json$/i },
2784
+ { prop: "source", files: /\.scripts\.json$/i },
2785
+ { prop: "target", files: /\.scripts\.json$/i },
2786
+ { prop: "sources", files: /\.datasources\.json$/i },
2787
+ { prop: "source", within: "operations", files: /\.integrations\.json$/i }
2788
+ ]
2742
2789
  };
2743
- function Ni(e = {}) {
2744
- const i = e.t ?? ((s, a) => a), t = (s, a) => i(`devStudio.omniverk.${s}`, a), o = {
2790
+ function bi(e, i) {
2791
+ var r;
2792
+ const t = ((r = ye(i)) == null ? void 0 : r.value) ?? {}, o = [e.id, t.packageName, t.moduleName].filter(
2793
+ (a) => typeof a == "string" && a !== ""
2794
+ ), n = /* @__PURE__ */ new Map(), s = (a, u = {}) => {
2795
+ const p = n.get(a) ?? { id: a, via: "manifest" };
2796
+ n.set(a, { ...p, ...u });
2797
+ };
2798
+ for (const a of Array.isArray(t.dependencies) ? t.dependencies : [])
2799
+ typeof a == "string" && a && s(a);
2800
+ for (const a of Array.isArray(t.dependencyRefs) ? t.dependencyRefs : [])
2801
+ if (typeof a == "string" && a)
2802
+ s(a);
2803
+ else if (a && typeof a == "object" && typeof a.package == "string") {
2804
+ const u = a, p = u.isOptional === !0 || u.required === !1;
2805
+ s(u.package, {
2806
+ required: !p,
2807
+ ...typeof u.reason == "string" && u.reason ? { reason: u.reason } : {}
2808
+ });
2809
+ }
2810
+ return it(
2811
+ [...n.values()],
2812
+ i,
2813
+ Qe.entity ?? [],
2814
+ o
2815
+ );
2816
+ }
2817
+ function Ti(e = {}) {
2818
+ const i = e.t ?? ((s, r) => r), t = (s, r) => i(`devStudio.omniverk.${s}`, r), o = {
2745
2819
  type: "object",
2746
2820
  properties: {
2747
2821
  name: { type: "string", title: t("field.name", "Name") },
@@ -2749,7 +2823,7 @@ function Ni(e = {}) {
2749
2823
  dataType: {
2750
2824
  type: "string",
2751
2825
  title: t("field.dataType", "Data type"),
2752
- enum: [...Et]
2826
+ enum: [...Ot]
2753
2827
  },
2754
2828
  maxLength: { type: "integer", title: t("field.maxLength", "Max length") },
2755
2829
  isRequired: { type: "boolean", title: t("field.isRequired", "Required") },
@@ -2780,36 +2854,38 @@ function Ni(e = {}) {
2780
2854
  };
2781
2855
  return {
2782
2856
  id: "omniverk",
2783
- kinds: jt,
2784
- manifestSections: Bt(i, { scripting: e.scripting }),
2857
+ kinds: Tt,
2858
+ references: Qe,
2859
+ dependencies: (s) => bi(s.key, s.files),
2860
+ manifestSections: Ht(i, { scripting: e.scripting }),
2785
2861
  entities: { entityMetaSchema: n, fieldSchema: o },
2786
- locales: e.locales ?? gi,
2862
+ locales: e.locales ?? wi,
2787
2863
  requiredLocales: ["en", "pl"],
2788
2864
  moduleId: (s) => {
2789
- var l;
2790
- const a = (l = Te(s)) == null ? void 0 : l.value.packageName;
2791
- return typeof a == "string" && a ? a : void 0;
2865
+ var a;
2866
+ const r = (a = ye(s)) == null ? void 0 : a.value.packageName;
2867
+ return typeof r == "string" && r ? r : void 0;
2792
2868
  },
2793
- validateModule: (s) => ei(s),
2794
- generateModule: async (s, { existingIds: a }) => {
2795
- const l = await Kt(
2869
+ validateModule: (s) => ii(s),
2870
+ generateModule: async (s, { existingIds: r }) => {
2871
+ const a = await Ft(
2796
2872
  {
2797
- ...Ft(s),
2873
+ ...Rt(s),
2798
2874
  iconConfig: e.iconConfig,
2799
2875
  ownerTenantId: e.ownerTenantId
2800
2876
  },
2801
- { existingPackageNames: a }
2877
+ { existingPackageNames: r }
2802
2878
  );
2803
- if (!l.package)
2804
- throw new Error(l.problems.join(`
2879
+ if (!a.package)
2880
+ throw new Error(a.problems.join(`
2805
2881
  `));
2806
2882
  return {
2807
- id: l.package.packageName,
2883
+ id: a.package.packageName,
2808
2884
  packageId: s.packageId,
2809
- files: l.package.files
2885
+ files: a.package.files
2810
2886
  };
2811
2887
  },
2812
- duplicateModule: (s, a) => Rt(s, a),
2888
+ duplicateModule: (s, r) => qt(s, r),
2813
2889
  scripts: {
2814
2890
  categories: [
2815
2891
  "calculation",
@@ -2822,21 +2898,21 @@ function Ni(e = {}) {
2822
2898
  ],
2823
2899
  phases: ["preInstall", "postInstall", "preUninstall", "postUninstall", "migrations"]
2824
2900
  },
2825
- newFile: (s, { files: a }) => {
2901
+ newFile: (s, { files: r }) => {
2826
2902
  var L;
2827
- const l = hi(a), y = ((L = Te(a)) == null ? void 0 : L.value) ?? {};
2903
+ const a = vi(r), u = ((L = ye(r)) == null ? void 0 : L.value) ?? {};
2828
2904
  if (s === "scripts") {
2829
- let I = `${l}.scripts.json`;
2830
- for (let O = 2; a.some((w) => w.path === I); O++)
2831
- I = `${l}.${O}.scripts.json`;
2832
- const x = {
2833
- moduleName: String(y.packageName ?? l),
2905
+ let I = `${a}.scripts.json`;
2906
+ for (let x = 2; r.some((w) => w.path === I); x++)
2907
+ I = `${a}.${x}.scripts.json`;
2908
+ const O = {
2909
+ moduleName: String(u.packageName ?? a),
2834
2910
  version: "1.0.0",
2835
2911
  scripts: []
2836
2912
  };
2837
- return { path: I, text: le(x) };
2913
+ return { path: I, text: le(O) };
2838
2914
  }
2839
- const p = `${String(y.packageName ?? l)}.Core`, N = {
2915
+ const p = `${String(u.packageName ?? a)}.Core`, N = {
2840
2916
  entities: ["entities.json", { moduleName: p, version: "1.0.0", entities: [] }],
2841
2917
  views: ["views.json", { moduleName: p, version: "1.0.0", views: [] }],
2842
2918
  workflows: ["workflows.json", { moduleName: p, version: "1.0.0", workflows: [] }],
@@ -2847,13 +2923,13 @@ function Ni(e = {}) {
2847
2923
  seeds: ["seeds.json", { moduleName: p, version: "1.0.0", seeds: {} }],
2848
2924
  dataSources: [
2849
2925
  "datasources.json",
2850
- { moduleName: String(y.packageName ?? l), version: "1.0.0", dataSources: [] }
2926
+ { moduleName: String(u.packageName ?? a), version: "1.0.0", dataSources: [] }
2851
2927
  ],
2852
2928
  // 1.4.12: the variables start from what the manifest's wizard fields and env vars declare
2853
2929
  integrations: [
2854
2930
  "integrations.json",
2855
2931
  {
2856
- moduleName: String(y.packageName ?? l),
2932
+ moduleName: String(u.packageName ?? a),
2857
2933
  version: "1.0.0",
2858
2934
  integrations: []
2859
2935
  }
@@ -2861,14 +2937,14 @@ function Ni(e = {}) {
2861
2937
  environments: [
2862
2938
  "environments.json",
2863
2939
  {
2864
- moduleName: String(y.packageName ?? l),
2940
+ moduleName: String(u.packageName ?? a),
2865
2941
  version: "1.0.0",
2866
- variables: Vt(y),
2942
+ variables: Ut(u),
2867
2943
  sets: [{ id: "default", name: "Default", values: {} }]
2868
2944
  }
2869
2945
  ]
2870
2946
  }[s];
2871
- return N ? { path: `${l}.${N[0]}`, text: le(N[1]) } : void 0;
2947
+ return N ? { path: `${a}.${N[0]}`, text: le(N[1]) } : void 0;
2872
2948
  },
2873
2949
  templateSchema: {
2874
2950
  type: "object",
@@ -2892,7 +2968,7 @@ function Ni(e = {}) {
2892
2968
  }
2893
2969
  };
2894
2970
  }
2895
- function ji(e = {}) {
2971
+ function Ii(e = {}) {
2896
2972
  let i = 0;
2897
2973
  const t = /* @__PURE__ */ new Map();
2898
2974
  for (const [n, s] of Object.entries(e))
@@ -2900,42 +2976,42 @@ function ji(e = {}) {
2900
2976
  const o = (n) => n ? `${n}/` : "";
2901
2977
  return {
2902
2978
  async list(n) {
2903
- const s = o(n), a = /* @__PURE__ */ new Map();
2904
- for (const l of t.keys()) {
2905
- if (!l.startsWith(s))
2979
+ const s = o(n), r = /* @__PURE__ */ new Map();
2980
+ for (const a of t.keys()) {
2981
+ if (!a.startsWith(s))
2906
2982
  continue;
2907
- const y = l.slice(s.length), p = y.indexOf("/");
2908
- a.set(p < 0 ? y : y.slice(0, p), p < 0 ? "file" : "directory");
2983
+ const u = a.slice(s.length), p = u.indexOf("/");
2984
+ r.set(p < 0 ? u : u.slice(0, p), p < 0 ? "file" : "directory");
2909
2985
  }
2910
- return [...a].map(([l, y]) => ({ name: l, kind: y }));
2986
+ return [...r].map(([a, u]) => ({ name: a, kind: u }));
2911
2987
  },
2912
2988
  async read(n) {
2913
2989
  const s = t.get(n);
2914
2990
  return s ? { ...s } : null;
2915
2991
  },
2916
2992
  async write(n, s) {
2917
- const a = String(++i);
2918
- return t.set(n, { text: s, version: a }), a;
2993
+ const r = String(++i);
2994
+ return t.set(n, { text: s, version: r }), r;
2919
2995
  },
2920
2996
  async remove(n) {
2921
2997
  t.delete(n);
2922
2998
  },
2923
2999
  async removeDir(n) {
2924
3000
  const s = o(n);
2925
- for (const a of [...t.keys()])
2926
- a.startsWith(s) && t.delete(a);
3001
+ for (const r of [...t.keys()])
3002
+ r.startsWith(s) && t.delete(r);
2927
3003
  },
2928
3004
  snapshot() {
2929
3005
  return Object.fromEntries([...t].map(([n, s]) => [n, s.text]));
2930
3006
  }
2931
3007
  };
2932
3008
  }
2933
- const Qe = () => typeof window > "u" ? void 0 : window.showDirectoryPicker;
2934
- function Ti() {
2935
- return typeof Qe() == "function";
3009
+ const Ye = () => typeof window > "u" ? void 0 : window.showDirectoryPicker;
3010
+ function Oi() {
3011
+ return typeof Ye() == "function";
2936
3012
  }
2937
- async function Ei(e = {}) {
2938
- const i = Qe();
3013
+ async function xi(e = {}) {
3014
+ const i = Ye();
2939
3015
  if (!i)
2940
3016
  throw new Error("This browser cannot open folders (File System Access API).");
2941
3017
  return i({
@@ -2944,126 +3020,128 @@ async function Ei(e = {}) {
2944
3020
  });
2945
3021
  }
2946
3022
  const pe = (e) => typeof e == "object" && e !== null && (e.name === "NotFoundError" || e.name === "TypeMismatchError");
2947
- function Ii(e) {
3023
+ function Ci(e) {
2948
3024
  const i = new TextDecoder("utf-8", { ignoreBOM: !0 });
2949
- async function t(a, l = !1) {
2950
- let y = e;
2951
- for (const p of a.split("/").filter(Boolean))
3025
+ async function t(r, a = !1) {
3026
+ let u = e;
3027
+ for (const p of r.split("/").filter(Boolean))
2952
3028
  try {
2953
- y = await y.getDirectoryHandle(p, { create: l });
2954
- } catch (u) {
2955
- if (pe(u))
3029
+ u = await u.getDirectoryHandle(p, { create: a });
3030
+ } catch (m) {
3031
+ if (pe(m))
2956
3032
  return null;
2957
- throw u;
3033
+ throw m;
2958
3034
  }
2959
- return y;
3035
+ return u;
2960
3036
  }
2961
- const o = (a) => {
2962
- const l = a.lastIndexOf("/");
2963
- return l < 0 ? ["", a] : [a.slice(0, l), a.slice(l + 1)];
3037
+ const o = (r) => {
3038
+ const a = r.lastIndexOf("/");
3039
+ return a < 0 ? ["", r] : [r.slice(0, a), r.slice(a + 1)];
2964
3040
  };
2965
- async function n(a, l = !1) {
2966
- const [y, p] = o(a), u = await t(y, l);
2967
- if (!u)
3041
+ async function n(r, a = !1) {
3042
+ const [u, p] = o(r), m = await t(u, a);
3043
+ if (!m)
2968
3044
  return null;
2969
3045
  try {
2970
- return await u.getFileHandle(p, { create: l });
3046
+ return await m.getFileHandle(p, { create: a });
2971
3047
  } catch (N) {
2972
3048
  if (pe(N))
2973
3049
  return null;
2974
3050
  throw N;
2975
3051
  }
2976
3052
  }
2977
- const s = (a) => `${a.lastModified}:${a.size}`;
3053
+ const s = (r) => `${r.lastModified}:${r.size}`;
2978
3054
  return {
2979
- async list(a) {
2980
- const l = await t(a), y = [];
2981
- if (l)
2982
- for await (const p of l.values())
2983
- y.push({ name: p.name, kind: p.kind });
2984
- return y;
3055
+ async list(r) {
3056
+ const a = await t(r), u = [];
3057
+ if (a)
3058
+ for await (const p of a.values())
3059
+ u.push({ name: p.name, kind: p.kind });
3060
+ return u;
2985
3061
  },
2986
- async read(a) {
2987
- const l = await n(a);
2988
- if (!l)
3062
+ async read(r) {
3063
+ const a = await n(r);
3064
+ if (!a)
2989
3065
  return null;
2990
- const y = await l.getFile();
2991
- return { text: i.decode(await y.arrayBuffer()), version: s(y) };
3066
+ const u = await a.getFile();
3067
+ return { text: i.decode(await u.arrayBuffer()), version: s(u) };
2992
3068
  },
2993
- async write(a, l) {
2994
- const y = await n(a, !0);
2995
- if (!y)
2996
- throw new Error(`Cannot write ${a}`);
2997
- const p = await y.createWritable();
2998
- return await p.write(l), await p.close(), s(await y.getFile());
3069
+ async write(r, a) {
3070
+ const u = await n(r, !0);
3071
+ if (!u)
3072
+ throw new Error(`Cannot write ${r}`);
3073
+ const p = await u.createWritable();
3074
+ return await p.write(a), await p.close(), s(await u.getFile());
2999
3075
  },
3000
- async remove(a) {
3001
- const [l, y] = o(a), p = await t(l);
3076
+ async remove(r) {
3077
+ const [a, u] = o(r), p = await t(a);
3002
3078
  try {
3003
- await (p == null ? void 0 : p.removeEntry(y));
3004
- } catch (u) {
3005
- if (!pe(u))
3006
- throw u;
3079
+ await (p == null ? void 0 : p.removeEntry(u));
3080
+ } catch (m) {
3081
+ if (!pe(m))
3082
+ throw m;
3007
3083
  }
3008
3084
  },
3009
- async removeDir(a) {
3010
- const [l, y] = o(a), p = await t(l);
3085
+ async removeDir(r) {
3086
+ const [a, u] = o(r), p = await t(a);
3011
3087
  try {
3012
- await (p == null ? void 0 : p.removeEntry(y, { recursive: !0 }));
3013
- } catch (u) {
3014
- if (!pe(u))
3015
- throw u;
3088
+ await (p == null ? void 0 : p.removeEntry(u, { recursive: !0 }));
3089
+ } catch (m) {
3090
+ if (!pe(m))
3091
+ throw m;
3016
3092
  }
3017
3093
  }
3018
3094
  };
3019
3095
  }
3020
3096
  export {
3021
3097
  G as OMNIVERK_CUSTOM_PREFIX,
3022
- Et as OMNIVERK_DATA_TYPES,
3023
- Xt as OMNIVERK_LEGACY_LIST_VIEW_FILES,
3024
- gi as OMNIVERK_LOCALES,
3025
- be as OmniVerkRestError,
3026
- Kt as buildOmniVerkModule,
3027
- Gt as controllerDifferences,
3028
- bi as controllersFromExposed,
3029
- Ii as createDirectoryHandleFileSystem,
3030
- ji as createMemorySeedFileSystem,
3031
- ki as createOmniVerkRestProvider,
3032
- Ni as createOmniVerkStudioPreset,
3033
- Si as createSeedFolderProvider,
3034
- Rt as duplicateOmniVerkModule,
3035
- vi as envVarsToManifest,
3036
- Wt as exposedFromControllers,
3037
- Ti as isSeedFolderPickerSupported,
3038
- St as omniverkDataSourcesKind,
3039
- st as omniverkEntitiesKind,
3040
- jt as omniverkFileKinds,
3041
- Ot as omniverkFilePrefix,
3042
- ot as omniverkI18nKind,
3043
- tt as omniverkManifestKind,
3044
- Bt as omniverkManifestSections,
3045
- P as omniverkPascalIdentifier,
3046
- wt as omniverkPermissionsKind,
3047
- ve as omniverkRevisionStamp,
3048
- bt as omniverkScriptKind,
3049
- $t as omniverkScriptsKind,
3050
- vt as omniverkSeedsKind,
3051
- Ft as omniverkSpecFromStudio,
3098
+ Ot as OMNIVERK_DATA_TYPES,
3099
+ ti as OMNIVERK_LEGACY_LIST_VIEW_FILES,
3100
+ wi as OMNIVERK_LOCALES,
3101
+ $e as OmniVerkRestError,
3102
+ Ft as buildOmniVerkModule,
3103
+ _t as controllerDifferences,
3104
+ Si as controllersFromExposed,
3105
+ Ci as createDirectoryHandleFileSystem,
3106
+ Ii as createMemorySeedFileSystem,
3107
+ Ei as createOmniVerkRestProvider,
3108
+ Ti as createOmniVerkStudioPreset,
3109
+ ji as createSeedFolderProvider,
3110
+ qt as duplicateOmniVerkModule,
3111
+ ki as envVarsToManifest,
3112
+ Jt as exposedFromControllers,
3113
+ Oi as isSeedFolderPickerSupported,
3114
+ Nt as omniverkDataSourcesKind,
3115
+ bi as omniverkDependencies,
3116
+ at as omniverkEntitiesKind,
3117
+ Tt as omniverkFileKinds,
3118
+ At as omniverkFilePrefix,
3119
+ rt as omniverkI18nKind,
3120
+ nt as omniverkManifestKind,
3121
+ Ht as omniverkManifestSections,
3122
+ F as omniverkPascalIdentifier,
3123
+ bt as omniverkPermissionsKind,
3124
+ be as omniverkRevisionStamp,
3125
+ kt as omniverkScriptKind,
3126
+ St as omniverkScriptsKind,
3127
+ $t as omniverkSeedsKind,
3128
+ Rt as omniverkSpecFromStudio,
3052
3129
  fe as omniverkStableId,
3130
+ Qe as omniverkStudioReferences,
3053
3131
  Be as omniverkTableName,
3054
3132
  De as omniverkTemplateFromDto,
3055
- ni as omniverkTemplateFromEntry,
3133
+ oi as omniverkTemplateFromEntry,
3056
3134
  Me as omniverkTemplateToEntry,
3057
- si as omniverkTemplateToInput,
3058
- dt as omniverkViewFromItem,
3059
- ct as omniverkViewItem,
3060
- pt as omniverkViewsKind,
3061
- ft as omniverkWorkflowFromItem,
3062
- mt as omniverkWorkflowItem,
3063
- yt as omniverkWorkflowsKind,
3064
- Ei as pickSeedDirectory,
3065
- $i as toOmniVerkConnectorSeeds,
3066
- ei as validateOmniVerkModule,
3067
- ti as validateOmniVerkWorkspace,
3068
- Vt as variablesFromManifest
3135
+ ai as omniverkTemplateToInput,
3136
+ ut as omniverkViewFromItem,
3137
+ pt as omniverkViewItem,
3138
+ mt as omniverkViewsKind,
3139
+ gt as omniverkWorkflowFromItem,
3140
+ yt as omniverkWorkflowItem,
3141
+ ht as omniverkWorkflowsKind,
3142
+ xi as pickSeedDirectory,
3143
+ Ni as toOmniVerkConnectorSeeds,
3144
+ ii as validateOmniVerkModule,
3145
+ ni as validateOmniVerkWorkspace,
3146
+ Ut as variablesFromManifest
3069
3147
  };